From: Andrea Amorese
Date: Thu, 27 Jan 2022 14:02:52 +0000 (+0100)
Subject: Built motion from commit 47e64239.|2.5.50
X-Git-Url: http://repos.xcallymotion.com/base//%22?a=commitdiff_plain;h=bfec9a8f08676fb300e8a84e880f92a9f5a5f207;p=motion2.git
Built motion from commit 47e64239.|2.5.50
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 5adb2fe..00b2426 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-01-27T12:57:35.648Z",
+ "time": "2022-01-27T13:38:05.081Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index fcea87f..507bc3d 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-27T12:57:35.648Z",
+ "time": "2022-01-27T13:38:05.081Z",
"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 26045ac..f6981b6 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 _0xe521=['urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','integration','jscripty'];(function(_0x1f2857,_0x2492df){var _0x126806=function(_0x32ebca){while(--_0x32ebca){_0x1f2857['push'](_0x1f2857['shift']());}};_0x126806(++_0x2492df);}(_0xe521,0x1a1));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1e52('0x0'));module[_0x1e52('0x1')]={'name':{'type':Sequelize[_0x1e52('0x2')],'get':function(_0x1b442d){return this[_0x1e52('0x3')](_0x1e52('0x4'));}},'action':{'type':Sequelize[_0x1e52('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x1e52('0x6'),'motionbar',_0x1e52('0x7'),_0x1e52('0x8'),_0x1e52('0x9'),_0x1e52('0xa'),_0x1e52('0xb')]],'msg':_0x1e52('0xc')}},'comment':_0x1e52('0xc')},'data1':{'type':Sequelize[_0x1e52('0x5')](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[_0x1e52('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x1e52('0x5')](0x1000),'comment':_0x1e52('0xd')},'data4':{'type':Sequelize[_0x1e52('0x5')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x1e52('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x1e52('0x5')],'comments':_0x1e52('0xe')},'data7':{'type':Sequelize[_0x1e52('0xf')],'comments':_0x1e52('0x10')}};
\ No newline at end of file
+var _0xb2f1=['getDataValue','STRING','contactManager','jscripty','urlForward','browser','bot','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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xb2f1,0xee));var _0x1b2f=function(_0x271bf4,_0x122da4){_0x271bf4=_0x271bf4-0x0;var _0x50a50b=_0xb2f1[_0x271bf4];return _0x50a50b;};'use strict';var Sequelize=require(_0x1b2f('0x0'));module[_0x1b2f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x33346a){return this[_0x1b2f('0x2')]('action');}},'action':{'type':Sequelize[_0x1b2f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1b2f('0x4'),'integration','motionbar',_0x1b2f('0x5'),_0x1b2f('0x6'),_0x1b2f('0x7'),_0x1b2f('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x1b2f('0x9')},'data1':{'type':Sequelize[_0x1b2f('0x3')](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[_0x1b2f('0x3')](0x1000),'comment':_0x1b2f('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x1b2f('0xb')},'data4':{'type':Sequelize[_0x1b2f('0x3')](0x1000),'comments':_0x1b2f('0xc')},'data5':{'type':Sequelize[_0x1b2f('0x3')](0x1000),'comments':_0x1b2f('0xd')},'data6':{'type':Sequelize[_0x1b2f('0x3')],'comments':_0x1b2f('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x1b2f('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 82c9d93..de0c68c 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 _0xd661=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x277540,_0x44fed1){var _0x3436ea=function(_0x3548e1){while(--_0x3548e1){_0x277540['push'](_0x277540['shift']());}};_0x3436ea(++_0x44fed1);}(_0xd661,0x13f));var _0x1d66=function(_0x4ca4c8,_0x163fc3){_0x4ca4c8=_0x4ca4c8-0x0;var _0x4097c1=_0xd661[_0x4ca4c8];return _0x4097c1;};'use strict';var emlformat=require(_0x1d66('0x0'));var rimraf=require(_0x1d66('0x1'));var zipdir=require(_0x1d66('0x2'));var jsonpatch=require(_0x1d66('0x3'));var rp=require(_0x1d66('0x4'));var moment=require(_0x1d66('0x5'));var BPromise=require(_0x1d66('0x6'));var Mustache=require(_0x1d66('0x7'));var util=require(_0x1d66('0x8'));var path=require(_0x1d66('0x9'));var sox=require(_0x1d66('0xa'));var csv=require('to-csv');var ejs=require(_0x1d66('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d66('0xc'));var squel=require(_0x1d66('0xd'));var crypto=require('crypto');var jsforce=require(_0x1d66('0xe'));var deskjs=require(_0x1d66('0xf'));var toCsv=require(_0x1d66('0x10'));var querystring=require(_0x1d66('0x11'));var Papa=require(_0x1d66('0x12'));var Redis=require(_0x1d66('0x13'));var authService=require(_0x1d66('0x14'));var qs=require(_0x1d66('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d66('0x16'))('api');var utils=require(_0x1d66('0x17'));var config=require(_0x1d66('0x18'));var licenseUtil=require(_0x1d66('0x19'));var db=require(_0x1d66('0x1a'))['db'];function respondWithStatusCode(_0x195c81,_0x11a1a6){_0x11a1a6=_0x11a1a6||0xcc;return function(_0x54a03a){if(_0x54a03a){return _0x195c81[_0x1d66('0x1b')](_0x11a1a6);}return _0x195c81[_0x1d66('0x1c')](_0x11a1a6)[_0x1d66('0x1d')]();};}function respondWithResult(_0x118082,_0x329998){_0x329998=_0x329998||0xc8;return function(_0x1a198f){if(_0x1a198f){return _0x118082[_0x1d66('0x1c')](_0x329998)['json'](_0x1a198f);}};}function respondWithFilteredResult(_0x1295e3,_0x57aa44){return function(_0x42fa74){if(_0x42fa74){var _0xe00342=typeof _0x57aa44[_0x1d66('0x1e')]===_0x1d66('0x1f')&&typeof _0x57aa44[_0x1d66('0x20')]===_0x1d66('0x1f');var _0x55f985=_0x42fa74[_0x1d66('0x21')];var _0x25b039=_0xe00342?0x0:_0x57aa44[_0x1d66('0x1e')];var _0x17bcc9=_0xe00342?_0x42fa74['count']:_0x57aa44[_0x1d66('0x1e')]+_0x57aa44[_0x1d66('0x20')];var _0x49c4b3;if(_0x17bcc9>=_0x55f985){_0x17bcc9=_0x55f985;_0x49c4b3=0xc8;}else{_0x49c4b3=0xce;}_0x1295e3[_0x1d66('0x1c')](_0x49c4b3);return _0x1295e3[_0x1d66('0x22')](_0x1d66('0x23'),_0x25b039+'-'+_0x17bcc9+'/'+_0x55f985)[_0x1d66('0x24')](_0x42fa74);}return null;};}function patchUpdates(_0x53ca28){return function(_0x5b6e22){try{jsonpatch[_0x1d66('0x25')](_0x5b6e22,_0x53ca28,!![]);}catch(_0x14cdf2){return BPromise[_0x1d66('0x26')](_0x14cdf2);}return _0x5b6e22[_0x1d66('0x27')]();};}function saveUpdates(_0x42e44c,_0x448d9d){return function(_0x5c0e12){if(_0x5c0e12){return _0x5c0e12[_0x1d66('0x28')](_0x42e44c)['then'](function(_0x21a2f7){return _0x21a2f7;});}return null;};}function removeEntity(_0x2ca925,_0x158ade){return function(_0x32d126){if(_0x32d126){return _0x32d126[_0x1d66('0x29')]()[_0x1d66('0x2a')](function(){_0x2ca925['status'](0xcc)[_0x1d66('0x1d')]();});}};}function handleEntityNotFound(_0x133416,_0x587315){return function(_0x5ba515){if(!_0x5ba515){_0x133416[_0x1d66('0x1b')](0x194);}return _0x5ba515;};}function handleError(_0x1b7cd2,_0x6da84){_0x6da84=_0x6da84||0x1f4;return function(_0x54d57a){logger['error'](_0x54d57a[_0x1d66('0x2b')]);if(_0x54d57a[_0x1d66('0x2c')]){delete _0x54d57a[_0x1d66('0x2c')];}_0x1b7cd2[_0x1d66('0x1c')](_0x6da84)['send'](_0x54d57a);};}exports[_0x1d66('0x28')]=function(_0x1abbab,_0x428adc){if(_0x1abbab[_0x1d66('0x2d')]['id']){delete _0x1abbab[_0x1d66('0x2d')]['id'];}return db[_0x1d66('0x2e')][_0x1d66('0x2f')]({'where':{'id':_0x1abbab['params']['id']}})[_0x1d66('0x2a')](handleEntityNotFound(_0x428adc,null))[_0x1d66('0x2a')](saveUpdates(_0x1abbab['body'],null))[_0x1d66('0x2a')](respondWithResult(_0x428adc,null))['catch'](handleError(_0x428adc,null));};exports[_0x1d66('0x29')]=function(_0x3f8a88,_0x1f1436){return db[_0x1d66('0x2e')]['find']({'where':{'id':_0x3f8a88[_0x1d66('0x30')]['id']}})[_0x1d66('0x2a')](handleEntityNotFound(_0x1f1436,null))['then'](removeEntity(_0x1f1436,null))[_0x1d66('0x31')](handleError(_0x1f1436,null));};
\ No newline at end of file
+var _0xae34=['body','Action','find','catch','params','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','update'];(function(_0x11fc13,_0x55d096){var _0x559da9=function(_0x41ca0a){while(--_0x41ca0a){_0x11fc13['push'](_0x11fc13['shift']());}};_0x559da9(++_0x55d096);}(_0xae34,0x12b));var _0x4ae3=function(_0x28aff4,_0x1cd4a0){_0x28aff4=_0x28aff4-0x0;var _0x55eed5=_0xae34[_0x28aff4];return _0x55eed5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ae3('0x0'));var zipdir=require(_0x4ae3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae3('0x2'));var moment=require(_0x4ae3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4ae3('0x4'));var util=require(_0x4ae3('0x5'));var path=require(_0x4ae3('0x6'));var sox=require(_0x4ae3('0x7'));var csv=require(_0x4ae3('0x8'));var ejs=require(_0x4ae3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ae3('0xa'));var _=require('lodash');var squel=require(_0x4ae3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae3('0xc'));var toCsv=require(_0x4ae3('0x8'));var querystring=require(_0x4ae3('0xd'));var Papa=require(_0x4ae3('0xe'));var Redis=require(_0x4ae3('0xf'));var authService=require(_0x4ae3('0x10'));var qs=require(_0x4ae3('0x11'));var as=require(_0x4ae3('0x12'));var hardwareService=require(_0x4ae3('0x13'));var logger=require(_0x4ae3('0x14'))(_0x4ae3('0x15'));var utils=require(_0x4ae3('0x16'));var config=require(_0x4ae3('0x17'));var licenseUtil=require(_0x4ae3('0x18'));var db=require(_0x4ae3('0x19'))['db'];function respondWithStatusCode(_0x3bcd0f,_0xde03d7){_0xde03d7=_0xde03d7||0xcc;return function(_0x5d4b77){if(_0x5d4b77){return _0x3bcd0f[_0x4ae3('0x1a')](_0xde03d7);}return _0x3bcd0f[_0x4ae3('0x1b')](_0xde03d7)[_0x4ae3('0x1c')]();};}function respondWithResult(_0x559ca1,_0x160c29){_0x160c29=_0x160c29||0xc8;return function(_0x1f8d16){if(_0x1f8d16){return _0x559ca1['status'](_0x160c29)['json'](_0x1f8d16);}};}function respondWithFilteredResult(_0x18ad7b,_0x3d12b0){return function(_0x4e1a8d){if(_0x4e1a8d){var _0x512d1c=typeof _0x3d12b0[_0x4ae3('0x1d')]===_0x4ae3('0x1e')&&typeof _0x3d12b0[_0x4ae3('0x1f')]===_0x4ae3('0x1e');var _0x4864b7=_0x4e1a8d[_0x4ae3('0x20')];var _0x320cfc=_0x512d1c?0x0:_0x3d12b0['offset'];var _0x29a45d=_0x512d1c?_0x4e1a8d[_0x4ae3('0x20')]:_0x3d12b0[_0x4ae3('0x1d')]+_0x3d12b0[_0x4ae3('0x1f')];var _0x48b6df;if(_0x29a45d>=_0x4864b7){_0x29a45d=_0x4864b7;_0x48b6df=0xc8;}else{_0x48b6df=0xce;}_0x18ad7b[_0x4ae3('0x1b')](_0x48b6df);return _0x18ad7b[_0x4ae3('0x21')](_0x4ae3('0x22'),_0x320cfc+'-'+_0x29a45d+'/'+_0x4864b7)['json'](_0x4e1a8d);}return null;};}function patchUpdates(_0x24be8a){return function(_0x259124){try{jsonpatch[_0x4ae3('0x23')](_0x259124,_0x24be8a,!![]);}catch(_0x504725){return BPromise['reject'](_0x504725);}return _0x259124[_0x4ae3('0x24')]();};}function saveUpdates(_0x599603,_0x5d0ad7){return function(_0x41cdf3){if(_0x41cdf3){return _0x41cdf3['update'](_0x599603)[_0x4ae3('0x25')](function(_0x3fc2e2){return _0x3fc2e2;});}return null;};}function removeEntity(_0xe86e39,_0x1909be){return function(_0x2a3729){if(_0x2a3729){return _0x2a3729[_0x4ae3('0x26')]()['then'](function(){_0xe86e39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db2fd,_0x4c7505){return function(_0x3f8548){if(!_0x3f8548){_0x3db2fd['sendStatus'](0x194);}return _0x3f8548;};}function handleError(_0x159372,_0x2035d2){_0x2035d2=_0x2035d2||0x1f4;return function(_0x3643f6){logger[_0x4ae3('0x27')](_0x3643f6[_0x4ae3('0x28')]);if(_0x3643f6[_0x4ae3('0x29')]){delete _0x3643f6[_0x4ae3('0x29')];}_0x159372[_0x4ae3('0x1b')](_0x2035d2)[_0x4ae3('0x2a')](_0x3643f6);};}exports[_0x4ae3('0x2b')]=function(_0x969896,_0x2a3c08){if(_0x969896[_0x4ae3('0x2c')]['id']){delete _0x969896[_0x4ae3('0x2c')]['id'];}return db[_0x4ae3('0x2d')][_0x4ae3('0x2e')]({'where':{'id':_0x969896['params']['id']}})['then'](handleEntityNotFound(_0x2a3c08,null))['then'](saveUpdates(_0x969896[_0x4ae3('0x2c')],null))[_0x4ae3('0x25')](respondWithResult(_0x2a3c08,null))[_0x4ae3('0x2f')](handleError(_0x2a3c08,null));};exports['destroy']=function(_0x4b414d,_0x47489f){return db[_0x4ae3('0x2d')][_0x4ae3('0x2e')]({'where':{'id':_0x4b414d[_0x4ae3('0x30')]['id']}})[_0x4ae3('0x25')](handleEntityNotFound(_0x47489f,null))[_0x4ae3('0x25')](removeEntity(_0x47489f,null))[_0x4ae3('0x2f')](handleError(_0x47489f,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index c42b420..05bf741 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 _0x1391=['bluebird','request-promise','path','./action.attributes','exports','define','Action','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1391,0xcd));var _0x1139=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1391[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x1139('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1139('0x1'));var BPromise=require(_0x1139('0x2'));var rp=require(_0x1139('0x3'));var fs=require('fs');var path=require(_0x1139('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1139('0x5'));module[_0x1139('0x6')]=function(_0x43ecaf,_0x42ea70){return _0x43ecaf[_0x1139('0x7')](_0x1139('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24ef=['tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x24ef,0x1ef));var _0xf24e=function(_0x191fab,_0x4508f1){_0x191fab=_0x191fab-0x0;var _0x34f5ae=_0x24ef[_0x191fab];return _0x34f5ae;};'use strict';var _=require(_0xf24e('0x0'));var util=require(_0xf24e('0x1'));var logger=require(_0xf24e('0x2'))('api');var moment=require(_0xf24e('0x3'));var BPromise=require(_0xf24e('0x4'));var rp=require(_0xf24e('0x5'));var fs=require('fs');var path=require(_0xf24e('0x6'));var rimraf=require(_0xf24e('0x7'));var config=require(_0xf24e('0x8'));var attributes=require(_0xf24e('0x9'));module[_0xf24e('0xa')]=function(_0x18c91e,_0x38a255){return _0x18c91e[_0xf24e('0xb')]('Action',attributes,{'tableName':_0xf24e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 432a193..88f6222 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 _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(_0x2743b1,_0x29474f){var _0xaaffd1=function(_0x58dd6f){while(--_0x58dd6f){_0x2743b1['push'](_0x2743b1['shift']());}};_0xaaffd1(++_0x29474f);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x5fab[_0x3e7804];return _0x56efda;};'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
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x39000a,_0x439386){var _0x374dba=function(_0x4c6783){while(--_0x4c6783){_0x39000a['push'](_0x39000a['shift']());}};_0x374dba(++_0x439386);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9a0e0ac..dde558d 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 _0xa968=['../../components/interaction/service','../../config/environment','/:id','isAuthenticated','delete','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x430394,_0x58f6f7){var _0x1aa043=function(_0x4ba1fe){while(--_0x4ba1fe){_0x430394['push'](_0x430394['shift']());}};_0x1aa043(++_0x58f6f7);}(_0xa968,0xb0));var _0x8a96=function(_0x3988e6,_0x3bc5f9){_0x3988e6=_0x3988e6-0x0;var _0x4b832a=_0xa968[_0x3988e6];return _0x4b832a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a96('0x0'));var router=express[_0x8a96('0x1')]();var fs_extra=require(_0x8a96('0x2'));var auth=require(_0x8a96('0x3'));var interaction=require(_0x8a96('0x4'));var config=require(_0x8a96('0x5'));var controller=require('./action.controller');router['put'](_0x8a96('0x6'),auth[_0x8a96('0x7')](),controller['update']);router[_0x8a96('0x8')](_0x8a96('0x6'),auth[_0x8a96('0x7')](),controller['destroy']);module[_0x8a96('0x9')]=router;
\ No newline at end of file
+var _0x06bf=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x5f2676,_0x136cc3){var _0x31fdf5=function(_0x9ca173){while(--_0x9ca173){_0x5f2676['push'](_0x5f2676['shift']());}};_0x31fdf5(++_0x136cc3);}(_0x06bf,0xb4));var _0xf06b=function(_0x5c1126,_0x4895ef){_0x5c1126=_0x5c1126-0x0;var _0x4e9072=_0x06bf[_0x5c1126];return _0x4e9072;};'use strict';var multer=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var path=require(_0xf06b('0x2'));var timeout=require(_0xf06b('0x3'));var express=require('express');var router=express[_0xf06b('0x4')]();var fs_extra=require(_0xf06b('0x5'));var auth=require(_0xf06b('0x6'));var interaction=require(_0xf06b('0x7'));var config=require(_0xf06b('0x8'));var controller=require(_0xf06b('0x9'));router[_0xf06b('0xa')](_0xf06b('0xb'),auth['isAuthenticated'](),controller[_0xf06b('0xc')]);router[_0xf06b('0xd')](_0xf06b('0xb'),auth['isAuthenticated'](),controller[_0xf06b('0xe')]);module[_0xf06b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index f3d9808..bebc3b5 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x49c4c3,_0x259d31){var _0x2a55f2=function(_0x3db643){while(--_0x3db643){_0x49c4c3['push'](_0x49c4c3['shift']());}};_0x2a55f2(++_0x259d31);}(_0x425d,0x1e0));var _0xd425=function(_0x1233d1,_0x15cf04){_0x1233d1=_0x1233d1-0x0;var _0x56ee5e=_0x425d[_0x1233d1];return _0x56ee5e;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x4d9b2d,_0x266d0b){var _0x391282=function(_0x11b35b){while(--_0x11b35b){_0x4d9b2d['push'](_0x4d9b2d['shift']());}};_0x391282(++_0x266d0b);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x465c8d,_0x308d2e){_0x465c8d=_0x465c8d-0x0;var _0x3e64a8=_0x3f8a[_0x465c8d];return _0x3e64a8;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index c60d283..b4bdb68 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 _0xf2dd=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','ValidationErrorItem','findAll','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','MAX(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20NOT\x20EMPTY','operator','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','output','web','fullPath','randomstring','csv','custom','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','run','runReport','AVG(%s)','debug','eml-format','rimraf','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x20401b,_0xabfc49){var _0x34d458=function(_0x449785){while(--_0x449785){_0x20401b['push'](_0x20401b['shift']());}};_0x34d458(++_0xabfc49);}(_0xf2dd,0x1e3));var _0xdf2d=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0xf2dd[_0x1e06f1];return _0x34f77e;};'use strict';var emlformat=require(_0xdf2d('0x0'));var rimraf=require(_0xdf2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf2d('0x2'));var rp=require(_0xdf2d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf2d('0x4'));var path=require(_0xdf2d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdf2d('0x6'));var fs=require('fs');var fs_extra=require(_0xdf2d('0x7'));var _=require(_0xdf2d('0x8'));var squel=require('squel');var crypto=require(_0xdf2d('0x9'));var jsforce=require(_0xdf2d('0xa'));var deskjs=require(_0xdf2d('0xb'));var toCsv=require(_0xdf2d('0xc'));var querystring=require(_0xdf2d('0xd'));var Papa=require(_0xdf2d('0xe'));var Redis=require(_0xdf2d('0xf'));var authService=require(_0xdf2d('0x10'));var qs=require(_0xdf2d('0x11'));var as=require(_0xdf2d('0x12'));var hardwareService=require(_0xdf2d('0x13'));var logger=require('../../config/logger')(_0xdf2d('0x14'));var utils=require(_0xdf2d('0x15'));var config=require(_0xdf2d('0x16'));var licenseUtil=require(_0xdf2d('0x17'));var db=require(_0xdf2d('0x18'))['db'];var dbH=require(_0xdf2d('0x18'))[_0xdf2d('0x19')];function respondWithStatusCode(_0x1494ed,_0x309a8d){_0x309a8d=_0x309a8d||0xcc;return function(_0x2bff89){if(_0x2bff89){return _0x1494ed[_0xdf2d('0x1a')](_0x309a8d);}return _0x1494ed[_0xdf2d('0x1b')](_0x309a8d)[_0xdf2d('0x1c')]();};}function respondWithResult(_0x53d3c4,_0xa2bd1c){_0xa2bd1c=_0xa2bd1c||0xc8;return function(_0x41f07e){if(_0x41f07e){return _0x53d3c4[_0xdf2d('0x1b')](_0xa2bd1c)[_0xdf2d('0x1d')](_0x41f07e);}};}function respondWithFilteredResult(_0x4e099f,_0x105212){return function(_0x1d269c){if(_0x1d269c){var _0x5e9802=typeof _0x105212[_0xdf2d('0x1e')]===_0xdf2d('0x1f')&&typeof _0x105212['limit']===_0xdf2d('0x1f');var _0x493e1c=_0x1d269c[_0xdf2d('0x20')];var _0x17e1ac=_0x5e9802?0x0:_0x105212['offset'];var _0x6fed33=_0x5e9802?_0x1d269c[_0xdf2d('0x20')]:_0x105212[_0xdf2d('0x1e')]+_0x105212[_0xdf2d('0x21')];var _0xee626c;if(_0x6fed33>=_0x493e1c){_0x6fed33=_0x493e1c;_0xee626c=0xc8;}else{_0xee626c=0xce;}_0x4e099f[_0xdf2d('0x1b')](_0xee626c);return _0x4e099f[_0xdf2d('0x22')](_0xdf2d('0x23'),_0x17e1ac+'-'+_0x6fed33+'/'+_0x493e1c)[_0xdf2d('0x1d')](_0x1d269c);}return null;};}function patchUpdates(_0x10358a){return function(_0x1554e4){try{jsonpatch['apply'](_0x1554e4,_0x10358a,!![]);}catch(_0x53b7cb){return BPromise[_0xdf2d('0x24')](_0x53b7cb);}return _0x1554e4[_0xdf2d('0x25')]();};}function saveUpdates(_0xe3bfde,_0x504d01){return function(_0x330b72){if(_0x330b72){return _0x330b72[_0xdf2d('0x26')](_0xe3bfde)[_0xdf2d('0x27')](function(_0x4f7480){return _0x4f7480;});}return null;};}function removeEntity(_0x3083f0,_0x283e5c){return function(_0x3cd513){if(_0x3cd513){return _0x3cd513['destroy']()[_0xdf2d('0x27')](function(){var _0x1875e=_0x3cd513[_0xdf2d('0x28')]({'plain':!![]});var _0x57e89a='CustomReports';return db['UserProfileResource'][_0xdf2d('0x29')]({'where':{'type':_0x57e89a,'resourceId':_0x1875e['id']}})['then'](function(){return _0x3cd513;});})[_0xdf2d('0x27')](function(){_0x3083f0[_0xdf2d('0x1b')](0xcc)[_0xdf2d('0x1c')]();});}};}function handleEntityNotFound(_0x154f37,_0x1a7eb1){return function(_0x40df96){if(!_0x40df96){_0x154f37[_0xdf2d('0x1a')](0x194);}return _0x40df96;};}function handleError(_0x3d9197,_0x158929){_0x158929=_0x158929||0x1f4;return function(_0x2e2549){logger[_0xdf2d('0x2a')](_0x2e2549[_0xdf2d('0x2b')]);if(_0x2e2549['name']){delete _0x2e2549[_0xdf2d('0x2c')];}_0x3d9197['status'](_0x158929)[_0xdf2d('0x2d')](_0x2e2549);};}exports[_0xdf2d('0x2e')]=function(_0x3632b4,_0x148de8){var _0x419e40={},_0x5309bf={},_0x2a7aeb={'count':0x0,'rows':[]};var _0x1523d9=_[_0xdf2d('0x2f')](db[_0xdf2d('0x30')]['rawAttributes'],function(_0x139c2e){return{'name':_0x139c2e[_0xdf2d('0x31')],'type':_0x139c2e[_0xdf2d('0x32')][_0xdf2d('0x33')]};});_0x5309bf[_0xdf2d('0x34')]=_['map'](_0x1523d9,_0xdf2d('0x2c'));_0x5309bf[_0xdf2d('0x35')]=_['keys'](_0x3632b4[_0xdf2d('0x35')]);_0x5309bf['filters']=_[_0xdf2d('0x36')](_0x5309bf[_0xdf2d('0x34')],_0x5309bf[_0xdf2d('0x35')]);_0x419e40[_0xdf2d('0x37')]=_[_0xdf2d('0x36')](_0x5309bf[_0xdf2d('0x34')],qs['fields'](_0x3632b4[_0xdf2d('0x35')][_0xdf2d('0x38')]));_0x419e40[_0xdf2d('0x37')]=_0x419e40[_0xdf2d('0x37')][_0xdf2d('0x39')]?_0x419e40[_0xdf2d('0x37')]:_0x5309bf[_0xdf2d('0x34')];if(!_0x3632b4[_0xdf2d('0x35')][_0xdf2d('0x3a')]('nolimit')){_0x419e40[_0xdf2d('0x21')]=qs[_0xdf2d('0x21')](_0x3632b4['query'][_0xdf2d('0x21')]);_0x419e40[_0xdf2d('0x1e')]=qs[_0xdf2d('0x1e')](_0x3632b4[_0xdf2d('0x35')][_0xdf2d('0x1e')]);}_0x419e40[_0xdf2d('0x3b')]=qs['sort'](_0x3632b4['query'][_0xdf2d('0x3c')]);_0x419e40['where']=qs[_0xdf2d('0x3d')](_[_0xdf2d('0x3e')](_0x3632b4[_0xdf2d('0x35')],_0x5309bf['filters']),_0x1523d9);if(_0x3632b4[_0xdf2d('0x35')][_0xdf2d('0x3f')]){_0x419e40[_0xdf2d('0x40')]=_[_0xdf2d('0x41')](_0x419e40[_0xdf2d('0x40')],{'$or':_[_0xdf2d('0x2f')](_0x1523d9,function(_0x1010c0){if(_0x1010c0['type']!=='VIRTUAL'){var _0x1c71c2={};_0x1c71c2[_0x1010c0['name']]={'$like':'%'+_0x3632b4[_0xdf2d('0x35')][_0xdf2d('0x3f')]+'%'};return _0x1c71c2;}})});}_0x419e40=_['merge']({},_0x419e40,_0x3632b4[_0xdf2d('0x42')]);var _0x50f500={'where':_0x419e40[_0xdf2d('0x40')]};return db[_0xdf2d('0x30')]['count'](_0x50f500)[_0xdf2d('0x27')](function(_0x59050b){_0x2a7aeb[_0xdf2d('0x20')]=_0x59050b;if(_0x3632b4[_0xdf2d('0x35')][_0xdf2d('0x43')]){_0x419e40[_0xdf2d('0x44')]=[{'all':!![]}];}return db[_0xdf2d('0x30')]['findAll'](_0x419e40);})[_0xdf2d('0x27')](function(_0xbf0a57){_0x2a7aeb[_0xdf2d('0x45')]=_0xbf0a57;return _0x2a7aeb;})[_0xdf2d('0x27')](respondWithFilteredResult(_0x148de8,_0x419e40))[_0xdf2d('0x46')](handleError(_0x148de8,null));};exports['show']=function(_0x4ecc05,_0x178edc){var _0x3a1da2={'raw':![],'where':{'id':_0x4ecc05[_0xdf2d('0x47')]['id']}},_0x3df7be={};_0x3df7be[_0xdf2d('0x34')]=_['keys'](db[_0xdf2d('0x30')][_0xdf2d('0x48')]);_0x3df7be[_0xdf2d('0x35')]=_['keys'](_0x4ecc05[_0xdf2d('0x35')]);_0x3df7be[_0xdf2d('0x3d')]=_[_0xdf2d('0x36')](_0x3df7be['model'],_0x3df7be[_0xdf2d('0x35')]);_0x3a1da2[_0xdf2d('0x37')]=_[_0xdf2d('0x36')](_0x3df7be[_0xdf2d('0x34')],qs[_0xdf2d('0x38')](_0x4ecc05[_0xdf2d('0x35')][_0xdf2d('0x38')]));_0x3a1da2[_0xdf2d('0x37')]=_0x3a1da2['attributes'][_0xdf2d('0x39')]?_0x3a1da2['attributes']:_0x3df7be[_0xdf2d('0x34')];if(_0x4ecc05[_0xdf2d('0x35')][_0xdf2d('0x43')]){_0x3a1da2[_0xdf2d('0x44')]=[{'all':!![]}];}_0x3a1da2=_['merge']({},_0x3a1da2,_0x4ecc05[_0xdf2d('0x42')]);return db[_0xdf2d('0x30')][_0xdf2d('0x49')](_0x3a1da2)['then'](handleEntityNotFound(_0x178edc,null))[_0xdf2d('0x27')](respondWithResult(_0x178edc,null))['catch'](handleError(_0x178edc,null));};exports['create']=function(_0x483931,_0x76b196){return db[_0xdf2d('0x30')][_0xdf2d('0x4a')](_0x483931[_0xdf2d('0x4b')],{})[_0xdf2d('0x27')](function(_0x4fc9f9){var _0x29d589=_0x483931[_0xdf2d('0x4c')][_0xdf2d('0x28')]({'plain':!![]});if(!_0x29d589)throw new Error(_0xdf2d('0x4d'));if(_0x29d589[_0xdf2d('0x4e')]===_0xdf2d('0x4c')){var _0x2d099a=_0x4fc9f9[_0xdf2d('0x28')]({'plain':!![]});var _0x45dda7=_0xdf2d('0x4f');return db[_0xdf2d('0x50')][_0xdf2d('0x49')]({'where':{'name':_0x45dda7,'userProfileId':_0x29d589[_0xdf2d('0x51')]},'raw':!![]})[_0xdf2d('0x27')](function(_0x23e68a){if(_0x23e68a&&_0x23e68a[_0xdf2d('0x52')]===0x0){return db[_0xdf2d('0x53')][_0xdf2d('0x4a')]({'name':_0x2d099a[_0xdf2d('0x2c')],'resourceId':_0x2d099a['id'],'type':_0xdf2d('0x54'),'sectionId':_0x23e68a['id']},{})['then'](function(){return _0x4fc9f9;});}else{return _0x4fc9f9;}})[_0xdf2d('0x46')](function(_0x3b37e7){logger[_0xdf2d('0x2a')](_0xdf2d('0x55'),_0x3b37e7);throw _0x3b37e7;});}return _0x4fc9f9;})[_0xdf2d('0x27')](respondWithResult(_0x76b196,0xc9))['catch'](handleError(_0x76b196,null));};exports[_0xdf2d('0x26')]=function(_0x21aac3,_0x59efa2){if(_0x21aac3[_0xdf2d('0x4b')]['id']){delete _0x21aac3[_0xdf2d('0x4b')]['id'];}return db['AnalyticCustomReport'][_0xdf2d('0x49')]({'where':{'id':_0x21aac3['params']['id']}})[_0xdf2d('0x27')](handleEntityNotFound(_0x59efa2,null))[_0xdf2d('0x27')](saveUpdates(_0x21aac3[_0xdf2d('0x4b')],null))[_0xdf2d('0x27')](respondWithResult(_0x59efa2,null))[_0xdf2d('0x46')](handleError(_0x59efa2,null));};exports[_0xdf2d('0x29')]=function(_0x4a37a1,_0x70b831){return db['AnalyticCustomReport']['find']({'where':{'id':_0x4a37a1[_0xdf2d('0x47')]['id']}})[_0xdf2d('0x27')](handleEntityNotFound(_0x70b831,null))[_0xdf2d('0x27')](removeEntity(_0x70b831,null))[_0xdf2d('0x46')](handleError(_0x70b831,null));};exports['preview']=function(_0x5182bf,_0x3d486a){var _0x3a2aa5=0xa;var _0x27eb0b=[_0xdf2d('0x56'),_0xdf2d('0x57'),_0xdf2d('0x58'),_0xdf2d('0x59')];var _0x4bc8e2={'SUM':_0xdf2d('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xdf2d('0x5b'),'MAX':'MAX(%s)','MIN':_0xdf2d('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdf2d('0x5d'),'GROUP_CONCAT ASC':_0xdf2d('0x5e'),'GROUP_CONCAT DESC':_0xdf2d('0x5f')};var _0x5becb6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xdf2d('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdf2d('0x61')};var _0x26b2b4=function(_0x5637b3){return!_[_0xdf2d('0x62')]([_0xdf2d('0x63'),_0xdf2d('0x64'),_0xdf2d('0x65'),'IS\x20NOT\x20EMPTY'],_0x5637b3);};var _0x539a44=function(_0x132dcb){if(!_0x132dcb||!_0x132dcb[_0xdf2d('0x66')][_0xdf2d('0x39')]){return'';}for(var _0x26eb83='(',_0x304556=0x0;_0x304556<_0x132dcb[_0xdf2d('0x66')]['length'];_0x304556+=0x1){_0x304556>0x0&&(_0x26eb83+='\x20'+_0x132dcb['operator']+'\x20');_0x26eb83+=_0x132dcb['rules'][_0x304556][_0xdf2d('0x67')]?_0x539a44(_0x132dcb[_0xdf2d('0x66')][_0x304556][_0xdf2d('0x67')]):_0x132dcb[_0xdf2d('0x66')][_0x304556]['field']+'\x20'+_0x132dcb[_0xdf2d('0x66')][_0x304556][_0xdf2d('0x68')]+(_0x26b2b4(_0x132dcb[_0xdf2d('0x66')][_0x304556]['condition'])?'\x20'+_0x132dcb[_0xdf2d('0x66')][_0x304556][_0xdf2d('0x69')]:'');}return _0x26eb83+')';};var _0x28c133={'where':{'id':_0x5182bf[_0xdf2d('0x47')]['id']}},_0x218d55,_0x1551c6,_0x5c1611,_0x14a4b8,_0x1aea7a;_0x28c133=_[_0xdf2d('0x41')]({},_0x28c133,_0x5182bf[_0xdf2d('0x42')]);return db['AnalyticCustomReport'][_0xdf2d('0x49')](_0x28c133)['then'](function(_0x536fc0){if(_0x536fc0){_0x218d55=_0x536fc0;return _0x536fc0['getFields']();}return null;})[_0xdf2d('0x27')](function(_0x53592e){if(_0x53592e){if(!_0x53592e[_0xdf2d('0x39')]){throw new db['Sequelize'][(_0xdf2d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1551c6=_0x53592e;return db['AnalyticMetric'][_0xdf2d('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x3b2ef7){if(_0x3b2ef7){_0x5c1611=_[_0xdf2d('0x6c')](_0x3b2ef7,'id');var _0x40dab0;var _0xa98757=squel['select']();_0xa98757[_0xdf2d('0x6d')](_0x218d55[_0xdf2d('0x6e')]);for(var _0x54253a=0x0;_0x54253a<_0x1551c6['length'];_0x54253a+=0x1){_0x40dab0=_0x1551c6[_0x54253a]['MetricId']?_0x5c1611[_0x1551c6[_0x54253a][_0xdf2d('0x6f')]][_0xdf2d('0x70')]:_0x1551c6[_0x54253a]['field'];_0x40dab0=_0x1551c6[_0x54253a][_0xdf2d('0x71')]?_[_0xdf2d('0x72')](_0x4bc8e2[_0x1551c6[_0x54253a]['function']],'%s',_0x40dab0):_0x40dab0;_0x40dab0=_0x1551c6[_0x54253a][_0xdf2d('0x73')]?_[_0xdf2d('0x72')](_0x5becb6[_0x1551c6[_0x54253a][_0xdf2d('0x73')]],'%s',_0x40dab0):_0x40dab0;if(_0x1551c6[_0x54253a][_0xdf2d('0x74')]){_0xa98757['group'](_0x40dab0);}_0x1551c6[_0x54253a]['orderBy']&&_0xa98757['order'](_0x40dab0,_0x1551c6[_0x54253a][_0xdf2d('0x75')]===_0xdf2d('0x76')?![]:!![]);_0xa98757[_0xdf2d('0x77')](_0x40dab0,_0x1551c6[_0x54253a][_0xdf2d('0x78')]||_0x40dab0);}if(_0x218d55[_0xdf2d('0x79')]){_0x218d55['joins']=JSON[_0xdf2d('0x7a')](_0x218d55[_0xdf2d('0x79')]);for(var _0x3c0ddd=0x0;_0x3c0ddd<_0x218d55[_0xdf2d('0x79')]['length'];_0x3c0ddd+=0x1){if(_0x218d55['joins'][_0x3c0ddd][_0xdf2d('0x32')]&&_[_0xdf2d('0x62')](_0x27eb0b,_0x218d55[_0xdf2d('0x79')][_0x3c0ddd][_0xdf2d('0x32')])&&_0x218d55[_0xdf2d('0x79')][_0x3c0ddd][_0xdf2d('0x7b')]&&_0x218d55['joins'][_0x3c0ddd]['foreignTable']&&_0x218d55[_0xdf2d('0x79')][_0x3c0ddd][_0xdf2d('0x7c')]){_0xa98757[_0x218d55['joins'][_0x3c0ddd][_0xdf2d('0x32')]](_0x218d55[_0xdf2d('0x79')][_0x3c0ddd][_0xdf2d('0x7d')],null,util[_0xdf2d('0x73')](_0xdf2d('0x7e'),_0x218d55[_0xdf2d('0x6e')],_0x218d55[_0xdf2d('0x79')][_0x3c0ddd][_0xdf2d('0x7b')],_0x218d55[_0xdf2d('0x79')][_0x3c0ddd][_0xdf2d('0x7d')],_0x218d55[_0xdf2d('0x79')][_0x3c0ddd]['foreignKey']));}}}if(_0x218d55[_0xdf2d('0x7f')]){_0x218d55[_0xdf2d('0x7f')]=JSON[_0xdf2d('0x7a')](_0x218d55[_0xdf2d('0x7f')]);_0xa98757['where'](_0x539a44(_0x218d55[_0xdf2d('0x7f')][_0xdf2d('0x67')]));}_0x1aea7a=_0xa98757[_0xdf2d('0x80')]();_0xa98757[_0xdf2d('0x21')](_0x3a2aa5);_0xa98757['offset'](0x0);logger['debug'](_0xdf2d('0x81'),_0xa98757[_0xdf2d('0x82')]());return dbH[_0xdf2d('0x83')][_0xdf2d('0x35')](_0xa98757[_0xdf2d('0x82')](),{'type':dbH[_0xdf2d('0x83')]['QueryTypes'][_0xdf2d('0x84')]});}})[_0xdf2d('0x27')](respondWithResult(_0x3d486a,null))[_0xdf2d('0x46')](handleError(_0x3d486a,null));};function runReport(_0x4d4752,_0x6063f1,_0x2be465){var _0x5f0e0f=_0x6063f1['name'];var _0x1c6036=0xa;var _0x11efab=[_0xdf2d('0x56'),_0xdf2d('0x57'),'right_join',_0xdf2d('0x59')];var _0xf3cc79={'SUM':'SUM(%s)','COUNT':_0xdf2d('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdf2d('0x86'),'MIN':_0xdf2d('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdf2d('0x5d'),'GROUP_CONCAT ASC':_0xdf2d('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xeb1ce3={'SEC_TO_TIME':_0xdf2d('0x87'),'DATE':_0xdf2d('0x88'),'HOUR':'HOUR(%s)','ROUND':_0xdf2d('0x89'),'UNIX_TIMESTAMP':_0xdf2d('0x61')};var _0x491a36=function(_0x3f30d1){return!_['includes']([_0xdf2d('0x63'),_0xdf2d('0x64'),'IS\x20EMPTY',_0xdf2d('0x8a')],_0x3f30d1);};var _0x190a4a=function(_0x2ffa07){if(!_0x2ffa07||!_0x2ffa07['rules']['length']){return'';}for(var _0x226ef0='(',_0x4af3ab=0x0;_0x4af3ab<_0x2ffa07['rules'][_0xdf2d('0x39')];_0x4af3ab+=0x1){_0x4af3ab>0x0&&(_0x226ef0+='\x20'+_0x2ffa07[_0xdf2d('0x8b')]+'\x20');_0x226ef0+=_0x2ffa07[_0xdf2d('0x66')][_0x4af3ab][_0xdf2d('0x67')]?_0x190a4a(_0x2ffa07['rules'][_0x4af3ab][_0xdf2d('0x67')]):_0x2ffa07['rules'][_0x4af3ab]['field']+'\x20'+_0x2ffa07['rules'][_0x4af3ab][_0xdf2d('0x68')]+(_0x491a36(_0x2ffa07[_0xdf2d('0x66')][_0x4af3ab]['condition'])?'\x20'+_0x2ffa07[_0xdf2d('0x66')][_0x4af3ab]['value']:'');}return _0x226ef0+')';};var _0x3f6b1f={'where':{'id':_0x4d4752['id']}},_0x4eab7b,_0x43f6cd,_0x598131,_0x1bb07e,_0xfb2d54;_0x3f6b1f=_[_0xdf2d('0x41')]({},_0x3f6b1f,_0x2be465);return db[_0xdf2d('0x30')][_0xdf2d('0x49')](_0x3f6b1f)[_0xdf2d('0x27')](function(_0x20fa9a){if(_0x20fa9a){_0x4eab7b=_0x20fa9a;return _0x20fa9a[_0xdf2d('0x8c')]();}return null;})[_0xdf2d('0x27')](function(_0x2aad73){if(_0x2aad73){if(!_0x2aad73[_0xdf2d('0x39')]){throw new db['Sequelize'][(_0xdf2d('0x6a'))](_0xdf2d('0x8d'),0x193);}_0x43f6cd=_0x2aad73;return db[_0xdf2d('0x8e')][_0xdf2d('0x6b')]({'raw':!![]});}return null;})[_0xdf2d('0x27')](function(_0x18d732){if(_0x18d732){_0x598131=_[_0xdf2d('0x6c')](_0x18d732,'id');var _0x46740d;var _0x35b3f7=squel[_0xdf2d('0x8f')]();_0x35b3f7[_0xdf2d('0x6d')](_0x4eab7b[_0xdf2d('0x6e')]);for(var _0x1ec21c=0x0;_0x1ec21c<_0x43f6cd[_0xdf2d('0x39')];_0x1ec21c+=0x1){_0x46740d=_0x43f6cd[_0x1ec21c][_0xdf2d('0x6f')]?_0x598131[_0x43f6cd[_0x1ec21c][_0xdf2d('0x6f')]][_0xdf2d('0x70')]:_0x43f6cd[_0x1ec21c][_0xdf2d('0x77')];_0x46740d=_0x43f6cd[_0x1ec21c][_0xdf2d('0x71')]?_['replace'](_0xf3cc79[_0x43f6cd[_0x1ec21c][_0xdf2d('0x71')]],'%s',_0x46740d):_0x46740d;_0x46740d=_0x43f6cd[_0x1ec21c][_0xdf2d('0x73')]?_[_0xdf2d('0x72')](_0xeb1ce3[_0x43f6cd[_0x1ec21c]['format']],'%s',_0x46740d):_0x46740d;if(_0x43f6cd[_0x1ec21c][_0xdf2d('0x74')]){_0x35b3f7['group'](_0x46740d);}_0x43f6cd[_0x1ec21c][_0xdf2d('0x75')]&&_0x35b3f7[_0xdf2d('0x3b')](_0x46740d,_0x43f6cd[_0x1ec21c][_0xdf2d('0x75')]===_0xdf2d('0x76')?![]:!![]);_0x35b3f7[_0xdf2d('0x77')](_0x46740d,_0x43f6cd[_0x1ec21c][_0xdf2d('0x78')]||_0x46740d);}if(_0x4eab7b['joins']){_0x4eab7b[_0xdf2d('0x79')]=JSON['parse'](_0x4eab7b[_0xdf2d('0x79')]);for(var _0x25afc3=0x0;_0x25afc3<_0x4eab7b['joins']['length'];_0x25afc3+=0x1){if(_0x4eab7b['joins'][_0x25afc3][_0xdf2d('0x32')]&&_[_0xdf2d('0x62')](_0x11efab,_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x32')])&&_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x7b')]&&_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x7d')]&&_0x4eab7b['joins'][_0x25afc3]['foreignKey']){_0x35b3f7[_0x4eab7b[_0xdf2d('0x79')][_0x25afc3]['type']](_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x7d')],null,util[_0xdf2d('0x73')](_0xdf2d('0x7e'),_0x4eab7b[_0xdf2d('0x6e')],_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x7b')],_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x7d')],_0x4eab7b[_0xdf2d('0x79')][_0x25afc3][_0xdf2d('0x7c')]));}}}if(_0x4eab7b[_0xdf2d('0x7f')]){_0x4eab7b[_0xdf2d('0x7f')]=JSON['parse'](_0x4eab7b[_0xdf2d('0x7f')]);_0x35b3f7[_0xdf2d('0x40')](_0x190a4a(_0x4eab7b[_0xdf2d('0x7f')][_0xdf2d('0x67')]));}_0xfb2d54=_0x35b3f7[_0xdf2d('0x80')]();_0x35b3f7['limit'](_0x1c6036);_0x35b3f7['offset'](0x0);return;}})['then'](function(){if(_0x6063f1[_0xdf2d('0x90')]===_0xdf2d('0x91')){return null;}var _0x5e43a0=_[_0xdf2d('0x41')](_0x6063f1,{'name':_0x6063f1[_0xdf2d('0x92')]||_0x6063f1[_0xdf2d('0x2c')]||_0x4eab7b['name'],'basename':_0x5f0e0f,'savename':util['format']('%s-%s.%s',_0x6063f1[_0xdf2d('0x2c')]||_0x4eab7b[_0xdf2d('0x2c')],require(_0xdf2d('0x93'))['generate'](0x4),_0x6063f1['output']||_0xdf2d('0x94')),'reportId':_0x4eab7b['id'],'reportType':_0xdf2d('0x95')});return db['AnalyticExtractedReport'][_0xdf2d('0x4a')](_0x5e43a0,{'raw':!![]});})[_0xdf2d('0x27')](function(_0x2dd1cd){if(_0x4eab7b[_0xdf2d('0x6e')]===_0xdf2d('0x96')){_0xfb2d54[_0xdf2d('0x40')](_0x4eab7b[_0xdf2d('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x6063f1[_0xdf2d('0x97')],_0x6063f1[_0xdf2d('0x98')]);}else{_0xfb2d54[_0xdf2d('0x40')](_0x4eab7b[_0xdf2d('0x6e')]+_0xdf2d('0x99'),_0x6063f1[_0xdf2d('0x97')],_0x6063f1['endDate']);}if(_0x2dd1cd){logger[_0xdf2d('0x9a')](_0xdf2d('0x9b'),_0xfb2d54[_0xdf2d('0x82')]());require(_0xdf2d('0x9c'))[_0xdf2d('0x9d')](path['join'](__dirname,_0xdf2d('0x9e'),_0x2dd1cd[_0xdf2d('0x90')]),[_0x2dd1cd['id'],_0xfb2d54[_0xdf2d('0x82')](),path[_0xdf2d('0x56')](__dirname,_0xdf2d('0x9f'),_0x2dd1cd[_0xdf2d('0xa0')]),_0x5f0e0f]);return _0x2dd1cd;}else{var _0x3c357e=squel[_0xdf2d('0x8f')]();_0x3c357e[_0xdf2d('0x6d')]('('+_0xfb2d54[_0xdf2d('0x82')]()+')','countTable');_0x3c357e[_0xdf2d('0x77')]('COUNT(*)',_0xdf2d('0x20'));_0xfb2d54[_0xdf2d('0x21')](_0x6063f1[_0xdf2d('0x21')]||_0x1c6036);_0xfb2d54[_0xdf2d('0x1e')](_0x6063f1[_0xdf2d('0x1e')]||0x0);return dbH['sequelize'][_0xdf2d('0x35')](_0x3c357e[_0xdf2d('0x82')](),{'type':dbH[_0xdf2d('0x83')][_0xdf2d('0xa1')][_0xdf2d('0x84')]})[_0xdf2d('0x27')](function(_0x3057e1){if(!_0x3057e1[_0xdf2d('0x39')]){_0x1bb07e=0x0;}else{_0x1bb07e=_0x3057e1[0x0][_0xdf2d('0x20')]||0x0;}return dbH['sequelize'][_0xdf2d('0x35')](_0xfb2d54[_0xdf2d('0x82')](),{'type':dbH[_0xdf2d('0x83')][_0xdf2d('0xa1')][_0xdf2d('0x84')]});})[_0xdf2d('0x27')](function(_0x23fd8f){return{'rows':_0x23fd8f||[],'count':_0x1bb07e};});}});}exports[_0xdf2d('0xa2')]=function(_0x327dff,_0xeb5022){return runReport(_0x327dff[_0xdf2d('0x47')],_0x327dff['query'],_0x327dff[_0xdf2d('0x42')])[_0xdf2d('0x27')](respondWithResult(_0xeb5022,null))['catch'](handleError(_0xeb5022,null));};exports[_0xdf2d('0xa3')]=runReport;exports[_0xdf2d('0x35')]=function(_0x2070c5,_0x451895){var _0x508a7e=0xa;var _0x21dfca=['join',_0xdf2d('0x57'),_0xdf2d('0x58'),_0xdf2d('0x59')];var _0x102688={'SUM':_0xdf2d('0x5a'),'COUNT':_0xdf2d('0x85'),'COUNT DISTINCT':_0xdf2d('0x5b'),'MAX':_0xdf2d('0x86'),'MIN':'MIN(%s)','AVG':_0xdf2d('0xa4'),'GROUP_CONCAT':_0xdf2d('0x5d'),'GROUP_CONCAT ASC':_0xdf2d('0x5e'),'GROUP_CONCAT DESC':_0xdf2d('0x5f')};var _0xfe9bd5={'SEC_TO_TIME':_0xdf2d('0x87'),'DATE':_0xdf2d('0x88'),'HOUR':_0xdf2d('0x60'),'ROUND':_0xdf2d('0x89'),'UNIX_TIMESTAMP':_0xdf2d('0x61')};var _0x3c2d64=function(_0x748859){return!_[_0xdf2d('0x62')](['IS\x20NULL',_0xdf2d('0x64'),_0xdf2d('0x65'),'IS\x20NOT\x20EMPTY'],_0x748859);};var _0x1708d7=function(_0x369529){if(!_0x369529||!_0x369529[_0xdf2d('0x66')][_0xdf2d('0x39')]){return'';}for(var _0x507259='(',_0x8d2cab=0x0;_0x8d2cab<_0x369529[_0xdf2d('0x66')][_0xdf2d('0x39')];_0x8d2cab+=0x1){_0x8d2cab>0x0&&(_0x507259+='\x20'+_0x369529[_0xdf2d('0x8b')]+'\x20');_0x507259+=_0x369529[_0xdf2d('0x66')][_0x8d2cab][_0xdf2d('0x67')]?_0x1708d7(_0x369529[_0xdf2d('0x66')][_0x8d2cab]['group']):_0x369529[_0xdf2d('0x66')][_0x8d2cab][_0xdf2d('0x77')]+'\x20'+_0x369529[_0xdf2d('0x66')][_0x8d2cab][_0xdf2d('0x68')]+(_0x3c2d64(_0x369529[_0xdf2d('0x66')][_0x8d2cab]['condition'])?'\x20'+_0x369529[_0xdf2d('0x66')][_0x8d2cab][_0xdf2d('0x69')]:'');}return _0x507259+')';};var _0x1e875b={'where':{'id':_0x2070c5[_0xdf2d('0x47')]['id']}},_0x6e904b,_0xb2f988,_0x129f19,_0x3f0be7,_0x5b2ceb;_0x1e875b=_[_0xdf2d('0x41')]({},_0x1e875b,_0x2070c5[_0xdf2d('0x42')]);return db[_0xdf2d('0x30')]['find'](_0x1e875b)[_0xdf2d('0x27')](function(_0x8c3524){if(_0x8c3524){_0x6e904b=_0x8c3524;return _0x8c3524[_0xdf2d('0x8c')]();}return null;})[_0xdf2d('0x27')](function(_0x80b372){if(_0x80b372){if(!_0x80b372['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xdf2d('0x8d'),0x193);}_0xb2f988=_0x80b372;return db[_0xdf2d('0x8e')][_0xdf2d('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x5baebb){if(_0x5baebb){_0x129f19=_[_0xdf2d('0x6c')](_0x5baebb,'id');var _0x12e801;var _0x44643b=squel[_0xdf2d('0x8f')]();_0x44643b[_0xdf2d('0x6d')](_0x6e904b[_0xdf2d('0x6e')]);for(var _0x3cf1b5=0x0;_0x3cf1b5<_0xb2f988[_0xdf2d('0x39')];_0x3cf1b5+=0x1){_0x12e801=_0xb2f988[_0x3cf1b5][_0xdf2d('0x6f')]?_0x129f19[_0xb2f988[_0x3cf1b5][_0xdf2d('0x6f')]][_0xdf2d('0x70')]:_0xb2f988[_0x3cf1b5]['field'];_0x12e801=_0xb2f988[_0x3cf1b5][_0xdf2d('0x71')]?_[_0xdf2d('0x72')](_0x102688[_0xb2f988[_0x3cf1b5][_0xdf2d('0x71')]],'%s',_0x12e801):_0x12e801;_0x12e801=_0xb2f988[_0x3cf1b5]['format']?_['replace'](_0xfe9bd5[_0xb2f988[_0x3cf1b5][_0xdf2d('0x73')]],'%s',_0x12e801):_0x12e801;if(_0xb2f988[_0x3cf1b5][_0xdf2d('0x74')]){_0x44643b[_0xdf2d('0x67')](_0x12e801);}_0xb2f988[_0x3cf1b5][_0xdf2d('0x75')]&&_0x44643b[_0xdf2d('0x3b')](_0x12e801,_0xb2f988[_0x3cf1b5][_0xdf2d('0x75')]===_0xdf2d('0x76')?![]:!![]);_0x44643b[_0xdf2d('0x77')](_0x12e801,_0xb2f988[_0x3cf1b5]['alias']||_0x12e801);}if(_0x6e904b[_0xdf2d('0x79')]){_0x6e904b['joins']=JSON[_0xdf2d('0x7a')](_0x6e904b[_0xdf2d('0x79')]);for(var _0x4a202b=0x0;_0x4a202b<_0x6e904b[_0xdf2d('0x79')][_0xdf2d('0x39')];_0x4a202b+=0x1){if(_0x6e904b[_0xdf2d('0x79')][_0x4a202b][_0xdf2d('0x32')]&&_[_0xdf2d('0x62')](_0x21dfca,_0x6e904b['joins'][_0x4a202b]['type'])&&_0x6e904b[_0xdf2d('0x79')][_0x4a202b][_0xdf2d('0x7b')]&&_0x6e904b[_0xdf2d('0x79')][_0x4a202b][_0xdf2d('0x7d')]&&_0x6e904b['joins'][_0x4a202b][_0xdf2d('0x7c')]){_0x44643b[_0x6e904b[_0xdf2d('0x79')][_0x4a202b][_0xdf2d('0x32')]](_0x6e904b['joins'][_0x4a202b]['foreignTable'],null,util[_0xdf2d('0x73')](_0xdf2d('0x7e'),_0x6e904b['table'],_0x6e904b['joins'][_0x4a202b][_0xdf2d('0x7b')],_0x6e904b[_0xdf2d('0x79')][_0x4a202b]['foreignTable'],_0x6e904b[_0xdf2d('0x79')][_0x4a202b]['foreignKey']));}}}if(_0x6e904b['conditions']){_0x6e904b[_0xdf2d('0x7f')]=JSON[_0xdf2d('0x7a')](_0x6e904b[_0xdf2d('0x7f')]);_0x44643b[_0xdf2d('0x40')](_0x1708d7(_0x6e904b['conditions'][_0xdf2d('0x67')]));}_0x5b2ceb=_0x44643b[_0xdf2d('0x80')]();_0x44643b['limit'](_0x508a7e);_0x44643b['offset'](0x0);logger[_0xdf2d('0xa5')](_0xdf2d('0x81'),_0x44643b[_0xdf2d('0x82')]());return dbH['sequelize'][_0xdf2d('0x35')](_0x44643b['toString'](),{'type':dbH[_0xdf2d('0x83')][_0xdf2d('0xa1')]['SELECT']});}})[_0xdf2d('0x27')](function(){return{'sql':_0x5b2ceb[_0xdf2d('0x82')]()};})[_0xdf2d('0x27')](respondWithResult(_0x451895,null))[_0xdf2d('0x46')](handleError(_0x451895,null));};
\ No newline at end of file
+var _0x851f=['IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parse','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(%s)','IS\x20EMPTY','value','Sequelize','keyBy','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','COUNT(*)','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ValidationErrorItem','metric','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','get','UserProfileResource','destroy','error','name','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticCustomReport','include','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL'];(function(_0x574c1d,_0x2a45a1){var _0x286a3c=function(_0x2796e8){while(--_0x2796e8){_0x574c1d['push'](_0x574c1d['shift']());}};_0x286a3c(++_0x2a45a1);}(_0x851f,0x185));var _0xf851=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x851f[_0x4715d2];return _0x141811;};'use strict';var emlformat=require(_0xf851('0x0'));var rimraf=require(_0xf851('0x1'));var zipdir=require(_0xf851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf851('0x3'));var moment=require(_0xf851('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf851('0x5'));var util=require(_0xf851('0x6'));var path=require('path');var sox=require(_0xf851('0x7'));var csv=require('to-csv');var ejs=require(_0xf851('0x8'));var fs=require('fs');var fs_extra=require(_0xf851('0x9'));var _=require(_0xf851('0xa'));var squel=require(_0xf851('0xb'));var crypto=require(_0xf851('0xc'));var jsforce=require(_0xf851('0xd'));var deskjs=require(_0xf851('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf851('0xf'));var Papa=require('papaparse');var Redis=require(_0xf851('0x10'));var authService=require(_0xf851('0x11'));var qs=require(_0xf851('0x12'));var as=require(_0xf851('0x13'));var hardwareService=require(_0xf851('0x14'));var logger=require('../../config/logger')(_0xf851('0x15'));var utils=require(_0xf851('0x16'));var config=require(_0xf851('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf851('0x18')];function respondWithStatusCode(_0x913b1a,_0x23132b){_0x23132b=_0x23132b||0xcc;return function(_0x1b0734){if(_0x1b0734){return _0x913b1a[_0xf851('0x19')](_0x23132b);}return _0x913b1a[_0xf851('0x1a')](_0x23132b)[_0xf851('0x1b')]();};}function respondWithResult(_0x103f43,_0x2a1d8a){_0x2a1d8a=_0x2a1d8a||0xc8;return function(_0x516390){if(_0x516390){return _0x103f43['status'](_0x2a1d8a)[_0xf851('0x1c')](_0x516390);}};}function respondWithFilteredResult(_0x55dec9,_0x54dc50){return function(_0xa7a925){if(_0xa7a925){var _0x2ba712=typeof _0x54dc50[_0xf851('0x1d')]===_0xf851('0x1e')&&typeof _0x54dc50[_0xf851('0x1f')]==='undefined';var _0x10f724=_0xa7a925['count'];var _0x26dc49=_0x2ba712?0x0:_0x54dc50[_0xf851('0x1d')];var _0x1d3bda=_0x2ba712?_0xa7a925[_0xf851('0x20')]:_0x54dc50[_0xf851('0x1d')]+_0x54dc50['limit'];var _0x4ca496;if(_0x1d3bda>=_0x10f724){_0x1d3bda=_0x10f724;_0x4ca496=0xc8;}else{_0x4ca496=0xce;}_0x55dec9['status'](_0x4ca496);return _0x55dec9[_0xf851('0x21')]('Content-Range',_0x26dc49+'-'+_0x1d3bda+'/'+_0x10f724)[_0xf851('0x1c')](_0xa7a925);}return null;};}function patchUpdates(_0x414326){return function(_0x251353){try{jsonpatch[_0xf851('0x22')](_0x251353,_0x414326,!![]);}catch(_0x360939){return BPromise['reject'](_0x360939);}return _0x251353[_0xf851('0x23')]();};}function saveUpdates(_0x1bda22,_0x603486){return function(_0x577827){if(_0x577827){return _0x577827['update'](_0x1bda22)[_0xf851('0x24')](function(_0x22aa50){return _0x22aa50;});}return null;};}function removeEntity(_0x3b7dd8,_0x484e3a){return function(_0x379d5a){if(_0x379d5a){return _0x379d5a['destroy']()[_0xf851('0x24')](function(){var _0x3e7758=_0x379d5a[_0xf851('0x25')]({'plain':!![]});var _0x2f2ac0='CustomReports';return db[_0xf851('0x26')][_0xf851('0x27')]({'where':{'type':_0x2f2ac0,'resourceId':_0x3e7758['id']}})['then'](function(){return _0x379d5a;});})['then'](function(){_0x3b7dd8[_0xf851('0x1a')](0xcc)[_0xf851('0x1b')]();});}};}function handleEntityNotFound(_0x18e1c2,_0x577823){return function(_0x387d1b){if(!_0x387d1b){_0x18e1c2[_0xf851('0x19')](0x194);}return _0x387d1b;};}function handleError(_0x4472d7,_0x306bac){_0x306bac=_0x306bac||0x1f4;return function(_0x39a9e5){logger[_0xf851('0x28')](_0x39a9e5['stack']);if(_0x39a9e5[_0xf851('0x29')]){delete _0x39a9e5[_0xf851('0x29')];}_0x4472d7['status'](_0x306bac)['send'](_0x39a9e5);};}exports['index']=function(_0x23a2e0,_0x249bbf){var _0x232d0b={},_0x64ea2f={},_0xe8ecf7={'count':0x0,'rows':[]};var _0x505a6a=_[_0xf851('0x2a')](db['AnalyticCustomReport'][_0xf851('0x2b')],function(_0x3178c6){return{'name':_0x3178c6[_0xf851('0x2c')],'type':_0x3178c6[_0xf851('0x2d')]['key']};});_0x64ea2f[_0xf851('0x2e')]=_[_0xf851('0x2a')](_0x505a6a,_0xf851('0x29'));_0x64ea2f[_0xf851('0x2f')]=_['keys'](_0x23a2e0[_0xf851('0x2f')]);_0x64ea2f[_0xf851('0x30')]=_[_0xf851('0x31')](_0x64ea2f[_0xf851('0x2e')],_0x64ea2f['query']);_0x232d0b['attributes']=_['intersection'](_0x64ea2f[_0xf851('0x2e')],qs[_0xf851('0x32')](_0x23a2e0[_0xf851('0x2f')]['fields']));_0x232d0b[_0xf851('0x33')]=_0x232d0b[_0xf851('0x33')][_0xf851('0x34')]?_0x232d0b[_0xf851('0x33')]:_0x64ea2f[_0xf851('0x2e')];if(!_0x23a2e0[_0xf851('0x2f')][_0xf851('0x35')](_0xf851('0x36'))){_0x232d0b['limit']=qs['limit'](_0x23a2e0['query'][_0xf851('0x1f')]);_0x232d0b[_0xf851('0x1d')]=qs[_0xf851('0x1d')](_0x23a2e0[_0xf851('0x2f')][_0xf851('0x1d')]);}_0x232d0b['order']=qs[_0xf851('0x37')](_0x23a2e0[_0xf851('0x2f')][_0xf851('0x37')]);_0x232d0b[_0xf851('0x38')]=qs[_0xf851('0x30')](_[_0xf851('0x39')](_0x23a2e0[_0xf851('0x2f')],_0x64ea2f[_0xf851('0x30')]),_0x505a6a);if(_0x23a2e0[_0xf851('0x2f')]['filter']){_0x232d0b[_0xf851('0x38')]=_[_0xf851('0x3a')](_0x232d0b[_0xf851('0x38')],{'$or':_[_0xf851('0x2a')](_0x505a6a,function(_0xe279d2){if(_0xe279d2[_0xf851('0x2d')]!==_0xf851('0x3b')){var _0x5be904={};_0x5be904[_0xe279d2['name']]={'$like':'%'+_0x23a2e0[_0xf851('0x2f')][_0xf851('0x3c')]+'%'};return _0x5be904;}})});}_0x232d0b=_[_0xf851('0x3a')]({},_0x232d0b,_0x23a2e0[_0xf851('0x3d')]);var _0x14f73e={'where':_0x232d0b[_0xf851('0x38')]};return db[_0xf851('0x3e')][_0xf851('0x20')](_0x14f73e)[_0xf851('0x24')](function(_0x5dd5e2){_0xe8ecf7[_0xf851('0x20')]=_0x5dd5e2;if(_0x23a2e0[_0xf851('0x2f')]['includeAll']){_0x232d0b[_0xf851('0x3f')]=[{'all':!![]}];}return db[_0xf851('0x3e')]['findAll'](_0x232d0b);})['then'](function(_0x190336){_0xe8ecf7['rows']=_0x190336;return _0xe8ecf7;})['then'](respondWithFilteredResult(_0x249bbf,_0x232d0b))[_0xf851('0x40')](handleError(_0x249bbf,null));};exports[_0xf851('0x41')]=function(_0x279bcf,_0xb0b31c){var _0x539bf8={'raw':![],'where':{'id':_0x279bcf['params']['id']}},_0x1e17c4={};_0x1e17c4[_0xf851('0x2e')]=_[_0xf851('0x42')](db[_0xf851('0x3e')][_0xf851('0x2b')]);_0x1e17c4[_0xf851('0x2f')]=_[_0xf851('0x42')](_0x279bcf[_0xf851('0x2f')]);_0x1e17c4[_0xf851('0x30')]=_[_0xf851('0x31')](_0x1e17c4[_0xf851('0x2e')],_0x1e17c4[_0xf851('0x2f')]);_0x539bf8[_0xf851('0x33')]=_['intersection'](_0x1e17c4[_0xf851('0x2e')],qs['fields'](_0x279bcf[_0xf851('0x2f')]['fields']));_0x539bf8['attributes']=_0x539bf8[_0xf851('0x33')]['length']?_0x539bf8[_0xf851('0x33')]:_0x1e17c4[_0xf851('0x2e')];if(_0x279bcf[_0xf851('0x2f')]['includeAll']){_0x539bf8[_0xf851('0x3f')]=[{'all':!![]}];}_0x539bf8=_[_0xf851('0x3a')]({},_0x539bf8,_0x279bcf[_0xf851('0x3d')]);return db['AnalyticCustomReport'][_0xf851('0x43')](_0x539bf8)['then'](handleEntityNotFound(_0xb0b31c,null))['then'](respondWithResult(_0xb0b31c,null))[_0xf851('0x40')](handleError(_0xb0b31c,null));};exports[_0xf851('0x44')]=function(_0x330b57,_0x293a99){return db['AnalyticCustomReport'][_0xf851('0x44')](_0x330b57[_0xf851('0x45')],{})[_0xf851('0x24')](function(_0x1116a3){var _0x496b36=_0x330b57['user'][_0xf851('0x25')]({'plain':!![]});if(!_0x496b36)throw new Error(_0xf851('0x46'));if(_0x496b36['role']===_0xf851('0x47')){var _0x48beec=_0x1116a3[_0xf851('0x25')]({'plain':!![]});var _0x3f0447=_0xf851('0x48');return db['UserProfileSection']['find']({'where':{'name':_0x3f0447,'userProfileId':_0x496b36[_0xf851('0x49')]},'raw':!![]})['then'](function(_0x53aa84){if(_0x53aa84&&_0x53aa84[_0xf851('0x4a')]===0x0){return db[_0xf851('0x26')][_0xf851('0x44')]({'name':_0x48beec['name'],'resourceId':_0x48beec['id'],'type':_0xf851('0x4b'),'sectionId':_0x53aa84['id']},{})[_0xf851('0x24')](function(){return _0x1116a3;});}else{return _0x1116a3;}})[_0xf851('0x40')](function(_0x34a492){logger[_0xf851('0x28')](_0xf851('0x4c'),_0x34a492);throw _0x34a492;});}return _0x1116a3;})[_0xf851('0x24')](respondWithResult(_0x293a99,0xc9))[_0xf851('0x40')](handleError(_0x293a99,null));};exports[_0xf851('0x4d')]=function(_0x3cb102,_0x18ea99){if(_0x3cb102[_0xf851('0x45')]['id']){delete _0x3cb102['body']['id'];}return db[_0xf851('0x3e')][_0xf851('0x43')]({'where':{'id':_0x3cb102['params']['id']}})[_0xf851('0x24')](handleEntityNotFound(_0x18ea99,null))[_0xf851('0x24')](saveUpdates(_0x3cb102[_0xf851('0x45')],null))[_0xf851('0x24')](respondWithResult(_0x18ea99,null))[_0xf851('0x40')](handleError(_0x18ea99,null));};exports[_0xf851('0x27')]=function(_0x35c447,_0x4185e6){return db['AnalyticCustomReport'][_0xf851('0x43')]({'where':{'id':_0x35c447[_0xf851('0x4e')]['id']}})[_0xf851('0x24')](handleEntityNotFound(_0x4185e6,null))[_0xf851('0x24')](removeEntity(_0x4185e6,null))['catch'](handleError(_0x4185e6,null));};exports[_0xf851('0x4f')]=function(_0x6664e,_0x4333c2){var _0x48bcdb=0xa;var _0x25ba99=[_0xf851('0x50'),_0xf851('0x51'),_0xf851('0x52'),_0xf851('0x53')];var _0x511a8f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf851('0x54'),'MAX':_0xf851('0x55'),'MIN':_0xf851('0x56'),'AVG':_0xf851('0x57'),'GROUP_CONCAT':_0xf851('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf851('0x59')};var _0x2bbde5={'SEC_TO_TIME':_0xf851('0x5a'),'DATE':_0xf851('0x5b'),'HOUR':_0xf851('0x5c'),'ROUND':_0xf851('0x5d'),'UNIX_TIMESTAMP':_0xf851('0x5e')};var _0x4d1219=function(_0x773c74){return!_[_0xf851('0x5f')]([_0xf851('0x60'),_0xf851('0x61'),'IS\x20EMPTY',_0xf851('0x62')],_0x773c74);};var _0x51a1e3=function(_0x121a34){if(!_0x121a34||!_0x121a34[_0xf851('0x63')]['length']){return'';}for(var _0x421a7f='(',_0x36417b=0x0;_0x36417b<_0x121a34['rules'][_0xf851('0x34')];_0x36417b+=0x1){_0x36417b>0x0&&(_0x421a7f+='\x20'+_0x121a34[_0xf851('0x64')]+'\x20');_0x421a7f+=_0x121a34['rules'][_0x36417b]['group']?_0x51a1e3(_0x121a34[_0xf851('0x63')][_0x36417b][_0xf851('0x65')]):_0x121a34['rules'][_0x36417b][_0xf851('0x66')]+'\x20'+_0x121a34[_0xf851('0x63')][_0x36417b][_0xf851('0x67')]+(_0x4d1219(_0x121a34[_0xf851('0x63')][_0x36417b][_0xf851('0x67')])?'\x20'+_0x121a34['rules'][_0x36417b]['value']:'');}return _0x421a7f+')';};var _0x2e3496={'where':{'id':_0x6664e[_0xf851('0x4e')]['id']}},_0x3c10a6,_0x541208,_0x20a0a8,_0x2cbc9e,_0x2390c6;_0x2e3496=_[_0xf851('0x3a')]({},_0x2e3496,_0x6664e[_0xf851('0x3d')]);return db[_0xf851('0x3e')][_0xf851('0x43')](_0x2e3496)[_0xf851('0x24')](function(_0xdd53aa){if(_0xdd53aa){_0x3c10a6=_0xdd53aa;return _0xdd53aa[_0xf851('0x68')]();}return null;})[_0xf851('0x24')](function(_0x6a1a3b){if(_0x6a1a3b){if(!_0x6a1a3b[_0xf851('0x34')]){throw new db['Sequelize']['ValidationErrorItem'](_0xf851('0x69'),0x193);}_0x541208=_0x6a1a3b;return db[_0xf851('0x6a')][_0xf851('0x6b')]({'raw':!![]});}return null;})[_0xf851('0x24')](function(_0x1c4df2){if(_0x1c4df2){_0x20a0a8=_['keyBy'](_0x1c4df2,'id');var _0x25e5f9;var _0x1e7d41=squel['select']();_0x1e7d41[_0xf851('0x6c')](_0x3c10a6[_0xf851('0x6d')]);for(var _0x58d364=0x0;_0x58d364<_0x541208[_0xf851('0x34')];_0x58d364+=0x1){_0x25e5f9=_0x541208[_0x58d364]['MetricId']?_0x20a0a8[_0x541208[_0x58d364][_0xf851('0x6e')]]['metric']:_0x541208[_0x58d364]['field'];_0x25e5f9=_0x541208[_0x58d364][_0xf851('0x6f')]?_[_0xf851('0x70')](_0x511a8f[_0x541208[_0x58d364][_0xf851('0x6f')]],'%s',_0x25e5f9):_0x25e5f9;_0x25e5f9=_0x541208[_0x58d364][_0xf851('0x71')]?_['replace'](_0x2bbde5[_0x541208[_0x58d364][_0xf851('0x71')]],'%s',_0x25e5f9):_0x25e5f9;if(_0x541208[_0x58d364][_0xf851('0x72')]){_0x1e7d41[_0xf851('0x65')](_0x25e5f9);}_0x541208[_0x58d364][_0xf851('0x73')]&&_0x1e7d41[_0xf851('0x74')](_0x25e5f9,_0x541208[_0x58d364][_0xf851('0x73')]===_0xf851('0x75')?![]:!![]);_0x1e7d41[_0xf851('0x66')](_0x25e5f9,_0x541208[_0x58d364][_0xf851('0x76')]||_0x25e5f9);}if(_0x3c10a6[_0xf851('0x77')]){_0x3c10a6[_0xf851('0x77')]=JSON['parse'](_0x3c10a6['joins']);for(var _0x4729e3=0x0;_0x4729e3<_0x3c10a6[_0xf851('0x77')]['length'];_0x4729e3+=0x1){if(_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x2d')]&&_['includes'](_0x25ba99,_0x3c10a6['joins'][_0x4729e3][_0xf851('0x2d')])&&_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x78')]&&_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x79')]&&_0x3c10a6['joins'][_0x4729e3][_0xf851('0x7a')]){_0x1e7d41[_0x3c10a6['joins'][_0x4729e3]['type']](_0x3c10a6[_0xf851('0x77')][_0x4729e3]['foreignTable'],null,util[_0xf851('0x71')](_0xf851('0x7b'),_0x3c10a6['table'],_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x78')],_0x3c10a6['joins'][_0x4729e3][_0xf851('0x79')],_0x3c10a6[_0xf851('0x77')][_0x4729e3][_0xf851('0x7a')]));}}}if(_0x3c10a6['conditions']){_0x3c10a6['conditions']=JSON[_0xf851('0x7c')](_0x3c10a6[_0xf851('0x7d')]);_0x1e7d41[_0xf851('0x38')](_0x51a1e3(_0x3c10a6['conditions'][_0xf851('0x65')]));}_0x2390c6=_0x1e7d41[_0xf851('0x7e')]();_0x1e7d41[_0xf851('0x1f')](_0x48bcdb);_0x1e7d41[_0xf851('0x1d')](0x0);logger[_0xf851('0x7f')](_0xf851('0x80'),_0x1e7d41[_0xf851('0x81')]());return dbH[_0xf851('0x82')][_0xf851('0x2f')](_0x1e7d41[_0xf851('0x81')](),{'type':dbH[_0xf851('0x82')][_0xf851('0x83')][_0xf851('0x84')]});}})[_0xf851('0x24')](respondWithResult(_0x4333c2,null))[_0xf851('0x40')](handleError(_0x4333c2,null));};function runReport(_0xf511e,_0x27de56,_0x5e0ce1){var _0x2afff7=_0x27de56[_0xf851('0x29')];var _0x127835=0xa;var _0x20b92a=[_0xf851('0x50'),'left_join',_0xf851('0x52'),_0xf851('0x53')];var _0x2cc937={'SUM':_0xf851('0x85'),'COUNT':_0xf851('0x86'),'COUNT DISTINCT':_0xf851('0x54'),'MAX':_0xf851('0x55'),'MIN':_0xf851('0x56'),'AVG':_0xf851('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf851('0x59')};var _0x15e333={'SEC_TO_TIME':_0xf851('0x5a'),'DATE':_0xf851('0x5b'),'HOUR':_0xf851('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf851('0x5e')};var _0x5bdb99=function(_0x33a3ab){return!_[_0xf851('0x5f')]([_0xf851('0x60'),_0xf851('0x61'),_0xf851('0x87'),_0xf851('0x62')],_0x33a3ab);};var _0x19581b=function(_0x63ff6){if(!_0x63ff6||!_0x63ff6[_0xf851('0x63')][_0xf851('0x34')]){return'';}for(var _0x5668c3='(',_0x562c9c=0x0;_0x562c9c<_0x63ff6['rules'][_0xf851('0x34')];_0x562c9c+=0x1){_0x562c9c>0x0&&(_0x5668c3+='\x20'+_0x63ff6[_0xf851('0x64')]+'\x20');_0x5668c3+=_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x65')]?_0x19581b(_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x65')]):_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x66')]+'\x20'+_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x67')]+(_0x5bdb99(_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x67')])?'\x20'+_0x63ff6[_0xf851('0x63')][_0x562c9c][_0xf851('0x88')]:'');}return _0x5668c3+')';};var _0x46f07e={'where':{'id':_0xf511e['id']}},_0x1ca6dd,_0x36e95f,_0x335680,_0x3fb226,_0x38610b;_0x46f07e=_['merge']({},_0x46f07e,_0x5e0ce1);return db[_0xf851('0x3e')]['find'](_0x46f07e)[_0xf851('0x24')](function(_0x51a6ae){if(_0x51a6ae){_0x1ca6dd=_0x51a6ae;return _0x51a6ae['getFields']();}return null;})['then'](function(_0x8b4036){if(_0x8b4036){if(!_0x8b4036['length']){throw new db[(_0xf851('0x89'))]['ValidationErrorItem'](_0xf851('0x69'),0x193);}_0x36e95f=_0x8b4036;return db['AnalyticMetric'][_0xf851('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x23c2ea){if(_0x23c2ea){_0x335680=_[_0xf851('0x8a')](_0x23c2ea,'id');var _0x4ea8df;var _0x393722=squel['select']();_0x393722[_0xf851('0x6c')](_0x1ca6dd[_0xf851('0x6d')]);for(var _0x3c1138=0x0;_0x3c1138<_0x36e95f[_0xf851('0x34')];_0x3c1138+=0x1){_0x4ea8df=_0x36e95f[_0x3c1138][_0xf851('0x6e')]?_0x335680[_0x36e95f[_0x3c1138][_0xf851('0x6e')]]['metric']:_0x36e95f[_0x3c1138][_0xf851('0x66')];_0x4ea8df=_0x36e95f[_0x3c1138][_0xf851('0x6f')]?_[_0xf851('0x70')](_0x2cc937[_0x36e95f[_0x3c1138][_0xf851('0x6f')]],'%s',_0x4ea8df):_0x4ea8df;_0x4ea8df=_0x36e95f[_0x3c1138][_0xf851('0x71')]?_['replace'](_0x15e333[_0x36e95f[_0x3c1138][_0xf851('0x71')]],'%s',_0x4ea8df):_0x4ea8df;if(_0x36e95f[_0x3c1138][_0xf851('0x72')]){_0x393722[_0xf851('0x65')](_0x4ea8df);}_0x36e95f[_0x3c1138][_0xf851('0x73')]&&_0x393722[_0xf851('0x74')](_0x4ea8df,_0x36e95f[_0x3c1138]['orderBy']===_0xf851('0x75')?![]:!![]);_0x393722[_0xf851('0x66')](_0x4ea8df,_0x36e95f[_0x3c1138][_0xf851('0x76')]||_0x4ea8df);}if(_0x1ca6dd[_0xf851('0x77')]){_0x1ca6dd[_0xf851('0x77')]=JSON['parse'](_0x1ca6dd[_0xf851('0x77')]);for(var _0x201615=0x0;_0x201615<_0x1ca6dd[_0xf851('0x77')][_0xf851('0x34')];_0x201615+=0x1){if(_0x1ca6dd[_0xf851('0x77')][_0x201615]['type']&&_[_0xf851('0x5f')](_0x20b92a,_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x2d')])&&_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x78')]&&_0x1ca6dd['joins'][_0x201615][_0xf851('0x79')]&&_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x7a')]){_0x393722[_0x1ca6dd[_0xf851('0x77')][_0x201615]['type']](_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x79')],null,util[_0xf851('0x71')](_0xf851('0x7b'),_0x1ca6dd[_0xf851('0x6d')],_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x78')],_0x1ca6dd[_0xf851('0x77')][_0x201615][_0xf851('0x79')],_0x1ca6dd[_0xf851('0x77')][_0x201615]['foreignKey']));}}}if(_0x1ca6dd[_0xf851('0x7d')]){_0x1ca6dd[_0xf851('0x7d')]=JSON[_0xf851('0x7c')](_0x1ca6dd['conditions']);_0x393722[_0xf851('0x38')](_0x19581b(_0x1ca6dd[_0xf851('0x7d')][_0xf851('0x65')]));}_0x38610b=_0x393722[_0xf851('0x7e')]();_0x393722[_0xf851('0x1f')](_0x127835);_0x393722[_0xf851('0x1d')](0x0);return;}})[_0xf851('0x24')](function(){if(_0x27de56['output']==='web'){return null;}var _0x30353b=_[_0xf851('0x3a')](_0x27de56,{'name':_0x27de56[_0xf851('0x8b')]||_0x27de56[_0xf851('0x29')]||_0x1ca6dd[_0xf851('0x29')],'basename':_0x2afff7,'savename':util[_0xf851('0x71')](_0xf851('0x8c'),_0x27de56[_0xf851('0x29')]||_0x1ca6dd[_0xf851('0x29')],require(_0xf851('0x8d'))[_0xf851('0x8e')](0x4),_0x27de56[_0xf851('0x8f')]||_0xf851('0x90')),'reportId':_0x1ca6dd['id'],'reportType':'custom'});return db[_0xf851('0x91')]['create'](_0x30353b,{'raw':!![]});})[_0xf851('0x24')](function(_0xf42968){if(_0x1ca6dd[_0xf851('0x6d')]===_0xf851('0x92')){_0x38610b[_0xf851('0x38')](_0x1ca6dd[_0xf851('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x27de56[_0xf851('0x93')],_0x27de56[_0xf851('0x94')]);}else{_0x38610b[_0xf851('0x38')](_0x1ca6dd[_0xf851('0x6d')]+_0xf851('0x95'),_0x27de56[_0xf851('0x93')],_0x27de56[_0xf851('0x94')]);}if(_0xf42968){logger['info'](_0xf851('0x96'),_0x38610b['toString']());require(_0xf851('0x97'))[_0xf851('0x98')](path[_0xf851('0x50')](__dirname,_0xf851('0x99'),_0xf42968[_0xf851('0x8f')]),[_0xf42968['id'],_0x38610b['toString'](),path['join'](__dirname,_0xf851('0x9a'),_0xf42968[_0xf851('0x9b')]),_0x2afff7]);return _0xf42968;}else{var _0x11b702=squel[_0xf851('0x9c')]();_0x11b702[_0xf851('0x6c')]('('+_0x38610b[_0xf851('0x81')]()+')','countTable');_0x11b702[_0xf851('0x66')](_0xf851('0x9d'),'count');_0x38610b[_0xf851('0x1f')](_0x27de56[_0xf851('0x1f')]||_0x127835);_0x38610b[_0xf851('0x1d')](_0x27de56[_0xf851('0x1d')]||0x0);return dbH[_0xf851('0x82')][_0xf851('0x2f')](_0x11b702[_0xf851('0x81')](),{'type':dbH[_0xf851('0x82')]['QueryTypes'][_0xf851('0x84')]})[_0xf851('0x24')](function(_0x5dd720){if(!_0x5dd720[_0xf851('0x34')]){_0x3fb226=0x0;}else{_0x3fb226=_0x5dd720[0x0][_0xf851('0x20')]||0x0;}return dbH[_0xf851('0x82')]['query'](_0x38610b[_0xf851('0x81')](),{'type':dbH['sequelize'][_0xf851('0x83')]['SELECT']});})[_0xf851('0x24')](function(_0x2ede2d){return{'rows':_0x2ede2d||[],'count':_0x3fb226};});}});}exports[_0xf851('0x9e')]=function(_0x2a8a73,_0x2a9f91){return runReport(_0x2a8a73['params'],_0x2a8a73[_0xf851('0x2f')],_0x2a8a73['options'])[_0xf851('0x24')](respondWithResult(_0x2a9f91,null))[_0xf851('0x40')](handleError(_0x2a9f91,null));};exports['runReport']=runReport;exports[_0xf851('0x2f')]=function(_0x2de596,_0x4b16f5){var _0x29ea51=0xa;var _0x5b2bb9=[_0xf851('0x50'),_0xf851('0x51'),'right_join',_0xf851('0x53')];var _0x39c850={'SUM':_0xf851('0x85'),'COUNT':_0xf851('0x86'),'COUNT DISTINCT':_0xf851('0x54'),'MAX':_0xf851('0x55'),'MIN':_0xf851('0x56'),'AVG':_0xf851('0x57'),'GROUP_CONCAT':_0xf851('0x58'),'GROUP_CONCAT ASC':_0xf851('0x9f'),'GROUP_CONCAT DESC':_0xf851('0x59')};var _0x30b452={'SEC_TO_TIME':_0xf851('0x5a'),'DATE':'DATE(%s)','HOUR':_0xf851('0x5c'),'ROUND':_0xf851('0x5d'),'UNIX_TIMESTAMP':_0xf851('0x5e')};var _0x3c03db=function(_0x456ee4){return!_[_0xf851('0x5f')]([_0xf851('0x60'),_0xf851('0x61'),_0xf851('0x87'),_0xf851('0x62')],_0x456ee4);};var _0x1b58d9=function(_0x27857d){if(!_0x27857d||!_0x27857d[_0xf851('0x63')][_0xf851('0x34')]){return'';}for(var _0x47bb9d='(',_0x3853d3=0x0;_0x3853d3<_0x27857d[_0xf851('0x63')]['length'];_0x3853d3+=0x1){_0x3853d3>0x0&&(_0x47bb9d+='\x20'+_0x27857d[_0xf851('0x64')]+'\x20');_0x47bb9d+=_0x27857d['rules'][_0x3853d3][_0xf851('0x65')]?_0x1b58d9(_0x27857d[_0xf851('0x63')][_0x3853d3][_0xf851('0x65')]):_0x27857d['rules'][_0x3853d3][_0xf851('0x66')]+'\x20'+_0x27857d[_0xf851('0x63')][_0x3853d3][_0xf851('0x67')]+(_0x3c03db(_0x27857d[_0xf851('0x63')][_0x3853d3]['condition'])?'\x20'+_0x27857d[_0xf851('0x63')][_0x3853d3][_0xf851('0x88')]:'');}return _0x47bb9d+')';};var _0x234d57={'where':{'id':_0x2de596[_0xf851('0x4e')]['id']}},_0x316e08,_0x346cb6,_0x143afb,_0x3c6dc5,_0x3ac882;_0x234d57=_[_0xf851('0x3a')]({},_0x234d57,_0x2de596['options']);return db['AnalyticCustomReport'][_0xf851('0x43')](_0x234d57)[_0xf851('0x24')](function(_0x4f5a8d){if(_0x4f5a8d){_0x316e08=_0x4f5a8d;return _0x4f5a8d[_0xf851('0x68')]();}return null;})[_0xf851('0x24')](function(_0xc17975){if(_0xc17975){if(!_0xc17975['length']){throw new db[(_0xf851('0x89'))][(_0xf851('0xa0'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x346cb6=_0xc17975;return db['AnalyticMetric'][_0xf851('0x6b')]({'raw':!![]});}return null;})[_0xf851('0x24')](function(_0x345d7c){if(_0x345d7c){_0x143afb=_[_0xf851('0x8a')](_0x345d7c,'id');var _0x1d185c;var _0x2a6ea1=squel[_0xf851('0x9c')]();_0x2a6ea1[_0xf851('0x6c')](_0x316e08['table']);for(var _0xaaef57=0x0;_0xaaef57<_0x346cb6['length'];_0xaaef57+=0x1){_0x1d185c=_0x346cb6[_0xaaef57]['MetricId']?_0x143afb[_0x346cb6[_0xaaef57][_0xf851('0x6e')]][_0xf851('0xa1')]:_0x346cb6[_0xaaef57][_0xf851('0x66')];_0x1d185c=_0x346cb6[_0xaaef57][_0xf851('0x6f')]?_[_0xf851('0x70')](_0x39c850[_0x346cb6[_0xaaef57]['function']],'%s',_0x1d185c):_0x1d185c;_0x1d185c=_0x346cb6[_0xaaef57][_0xf851('0x71')]?_[_0xf851('0x70')](_0x30b452[_0x346cb6[_0xaaef57][_0xf851('0x71')]],'%s',_0x1d185c):_0x1d185c;if(_0x346cb6[_0xaaef57][_0xf851('0x72')]){_0x2a6ea1['group'](_0x1d185c);}_0x346cb6[_0xaaef57][_0xf851('0x73')]&&_0x2a6ea1[_0xf851('0x74')](_0x1d185c,_0x346cb6[_0xaaef57][_0xf851('0x73')]===_0xf851('0x75')?![]:!![]);_0x2a6ea1['field'](_0x1d185c,_0x346cb6[_0xaaef57]['alias']||_0x1d185c);}if(_0x316e08[_0xf851('0x77')]){_0x316e08[_0xf851('0x77')]=JSON[_0xf851('0x7c')](_0x316e08[_0xf851('0x77')]);for(var _0x43a380=0x0;_0x43a380<_0x316e08[_0xf851('0x77')][_0xf851('0x34')];_0x43a380+=0x1){if(_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x2d')]&&_['includes'](_0x5b2bb9,_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x2d')])&&_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x78')]&&_0x316e08['joins'][_0x43a380]['foreignTable']&&_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x7a')]){_0x2a6ea1[_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x2d')]](_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x79')],null,util[_0xf851('0x71')]('%s.%s\x20=\x20%s.%s',_0x316e08[_0xf851('0x6d')],_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x78')],_0x316e08[_0xf851('0x77')][_0x43a380][_0xf851('0x79')],_0x316e08[_0xf851('0x77')][_0x43a380]['foreignKey']));}}}if(_0x316e08['conditions']){_0x316e08[_0xf851('0x7d')]=JSON[_0xf851('0x7c')](_0x316e08[_0xf851('0x7d')]);_0x2a6ea1['where'](_0x1b58d9(_0x316e08[_0xf851('0x7d')][_0xf851('0x65')]));}_0x3ac882=_0x2a6ea1[_0xf851('0x7e')]();_0x2a6ea1[_0xf851('0x1f')](_0x29ea51);_0x2a6ea1[_0xf851('0x1d')](0x0);logger['debug'](_0xf851('0x80'),_0x2a6ea1[_0xf851('0x81')]());return dbH[_0xf851('0x82')][_0xf851('0x2f')](_0x2a6ea1['toString'](),{'type':dbH[_0xf851('0x82')][_0xf851('0x83')][_0xf851('0x84')]});}})[_0xf851('0x24')](function(){return{'sql':_0x3ac882[_0xf851('0x81')]()};})[_0xf851('0x24')](respondWithResult(_0x4b16f5,null))[_0xf851('0x40')](handleError(_0x4b16f5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 03d8a03..d0d5b36 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 _0xc8f2=['analytics_custom_reports','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x401d0f,_0xd04011){var _0xe9ba07=function(_0x2005d1){while(--_0x2005d1){_0x401d0f['push'](_0x401d0f['shift']());}};_0xe9ba07(++_0xd04011);}(_0xc8f2,0x1a5));var _0x2c8f=function(_0x4d20c8,_0x28d948){_0x4d20c8=_0x4d20c8-0x0;var _0x324c4d=_0xc8f2[_0x4d20c8];return _0x324c4d;};'use strict';var _=require(_0x2c8f('0x0'));var util=require('util');var logger=require(_0x2c8f('0x1'))(_0x2c8f('0x2'));var moment=require('moment');var BPromise=require(_0x2c8f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c8f('0x4'));var rimraf=require(_0x2c8f('0x5'));var config=require(_0x2c8f('0x6'));var attributes=require(_0x2c8f('0x7'));module[_0x2c8f('0x8')]=function(_0x456d54,_0x567b6d){return _0x456d54[_0x2c8f('0x9')](_0x2c8f('0xa'),attributes,{'tableName':_0x2c8f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x31c1=['request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x31c1,0xcf));var _0x131c=function(_0x44c96b,_0x5e1812){_0x44c96b=_0x44c96b-0x0;var _0x47c673=_0x31c1[_0x44c96b];return _0x47c673;};'use strict';var _=require(_0x131c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x131c('0x1'));var moment=require(_0x131c('0x2'));var BPromise=require('bluebird');var rp=require(_0x131c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x131c('0x4'));var config=require('../../config/environment');var attributes=require(_0x131c('0x5'));module[_0x131c('0x6')]=function(_0x21a6bf,_0x4654f1){return _0x21a6bf[_0x131c('0x7')](_0x131c('0x8'),attributes,{'tableName':_0x131c('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 2b23b06..22a2aa4 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 _0xbc93=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0xbc93,0x1f0));var _0x3bc9=function(_0x41545c,_0xa723d0){_0x41545c=_0x41545c-0x0;var _0x3e283a=_0xbc93[_0x41545c];return _0x3e283a;};'use strict';var _=require(_0x3bc9('0x0'));var util=require('util');var moment=require(_0x3bc9('0x1'));var BPromise=require(_0x3bc9('0x2'));var rs=require(_0x3bc9('0x3'));var fs=require('fs');var Redis=require(_0x3bc9('0x4'));var db=require(_0x3bc9('0x5'))['db'];var utils=require(_0x3bc9('0x6'));var logger=require(_0x3bc9('0x7'))(_0x3bc9('0x8'));var config=require(_0x3bc9('0x9'));var jayson=require(_0x3bc9('0xa'));var client=jayson['client'][_0x3bc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f81e,_0x3ad675,_0x1f963c){return new BPromise(function(_0x5d13bc,_0x179a6b){return client[_0x3bc9('0xc')](_0x50f81e,_0x1f963c)[_0x3bc9('0xd')](function(_0x1ae801){logger[_0x3bc9('0xe')](_0x3bc9('0xf'),_0x3ad675,_0x3bc9('0x10'));logger[_0x3bc9('0x11')](_0x3bc9('0x12'),_0x3ad675,_0x3bc9('0x10'),JSON[_0x3bc9('0x13')](_0x1ae801));if(_0x1ae801['error']){if(_0x1ae801[_0x3bc9('0x14')][_0x3bc9('0x15')]===0x1f4){logger[_0x3bc9('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3ad675,_0x1ae801[_0x3bc9('0x14')]['message']);return _0x179a6b(_0x1ae801['error'][_0x3bc9('0x16')]);}logger[_0x3bc9('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3ad675,_0x1ae801[_0x3bc9('0x14')][_0x3bc9('0x16')]);return _0x5d13bc(_0x1ae801[_0x3bc9('0x14')][_0x3bc9('0x16')]);}else{logger[_0x3bc9('0xe')](_0x3bc9('0xf'),_0x3ad675,'request\x20sent');_0x5d13bc(_0x1ae801[_0x3bc9('0x17')][_0x3bc9('0x16')]);}})[_0x3bc9('0x18')](function(_0x1b4286){logger[_0x3bc9('0x14')](_0x3bc9('0xf'),_0x3ad675,_0x1b4286);_0x179a6b(_0x1b4286);});});}
\ No newline at end of file
+var _0xc2b4=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc2b4,0xbc));var _0x4c2b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2b4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var moment=require(_0x4c2b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c2b('0x3'));var db=require(_0x4c2b('0x4'))['db'];var utils=require(_0x4c2b('0x5'));var logger=require(_0x4c2b('0x6'))('rpc');var config=require(_0x4c2b('0x7'));var jayson=require(_0x4c2b('0x8'));var client=jayson[_0x4c2b('0x9')][_0x4c2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4734e8,_0x8125c1,_0x527654){return new BPromise(function(_0x579e5e,_0x4b8024){return client[_0x4c2b('0xb')](_0x4734e8,_0x527654)[_0x4c2b('0xc')](function(_0x36c5fe){logger[_0x4c2b('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8125c1,_0x4c2b('0xe'));logger[_0x4c2b('0xf')](_0x4c2b('0x10'),_0x8125c1,_0x4c2b('0xe'),JSON[_0x4c2b('0x11')](_0x36c5fe));if(_0x36c5fe['error']){if(_0x36c5fe['error'][_0x4c2b('0x12')]===0x1f4){logger[_0x4c2b('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8125c1,_0x36c5fe[_0x4c2b('0x13')]['message']);return _0x4b8024(_0x36c5fe[_0x4c2b('0x13')][_0x4c2b('0x14')]);}logger[_0x4c2b('0x13')](_0x4c2b('0x15'),_0x8125c1,_0x36c5fe[_0x4c2b('0x13')]['message']);return _0x579e5e(_0x36c5fe[_0x4c2b('0x13')][_0x4c2b('0x14')]);}else{logger[_0x4c2b('0xd')](_0x4c2b('0x15'),_0x8125c1,_0x4c2b('0xe'));_0x579e5e(_0x36c5fe[_0x4c2b('0x16')][_0x4c2b('0x14')]);}})[_0x4c2b('0x17')](function(_0x402832){logger[_0x4c2b('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8125c1,_0x402832);_0x4b8024(_0x402832);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 36d6dcf..cbd7ce0 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 _0x03f4=['show','preview','/:id/run','/:id/query','query','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x03f4,0x183));var _0x403f=function(_0x40b504,_0x456815){_0x40b504=_0x40b504-0x0;var _0x36a3e8=_0x03f4[_0x40b504];return _0x36a3e8;};'use strict';var multer=require('multer');var util=require(_0x403f('0x0'));var path=require(_0x403f('0x1'));var timeout=require(_0x403f('0x2'));var express=require(_0x403f('0x3'));var router=express['Router']();var fs_extra=require(_0x403f('0x4'));var auth=require(_0x403f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x403f('0x6'));var controller=require(_0x403f('0x7'));router[_0x403f('0x8')]('/',auth[_0x403f('0x9')](),controller[_0x403f('0xa')]);router[_0x403f('0x8')](_0x403f('0xb'),auth[_0x403f('0x9')](),controller[_0x403f('0xc')]);router[_0x403f('0x8')]('/:id/preview',auth[_0x403f('0x9')](),controller[_0x403f('0xd')]);router['get'](_0x403f('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x403f('0x8')](_0x403f('0xf'),auth[_0x403f('0x9')](),controller[_0x403f('0x10')]);router['post']('/',auth[_0x403f('0x9')](),controller['create']);router[_0x403f('0x11')](_0x403f('0xb'),auth[_0x403f('0x9')](),controller['update']);router[_0x403f('0x12')](_0x403f('0xb'),auth[_0x403f('0x9')](),controller[_0x403f('0x13')]);module[_0x403f('0x14')]=router;
\ No newline at end of file
+var _0x5cf5=['Router','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','run','query','post','update','delete','destroy','exports','multer','path','express'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0x5cf5,0x89));var _0x55cf=function(_0x1ae6b3,_0x3290bb){_0x1ae6b3=_0x1ae6b3-0x0;var _0x311586=_0x5cf5[_0x1ae6b3];return _0x311586;};'use strict';var multer=require(_0x55cf('0x0'));var util=require('util');var path=require(_0x55cf('0x1'));var timeout=require('connect-timeout');var express=require(_0x55cf('0x2'));var router=express[_0x55cf('0x3')]();var fs_extra=require(_0x55cf('0x4'));var auth=require(_0x55cf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x55cf('0x6'));router[_0x55cf('0x7')]('/',auth[_0x55cf('0x8')](),controller['index']);router[_0x55cf('0x7')](_0x55cf('0x9'),auth[_0x55cf('0x8')](),controller[_0x55cf('0xa')]);router[_0x55cf('0x7')](_0x55cf('0xb'),auth[_0x55cf('0x8')](),controller[_0x55cf('0xc')]);router['get']('/:id/run',auth[_0x55cf('0x8')](),controller[_0x55cf('0xd')]);router[_0x55cf('0x7')]('/:id/query',auth[_0x55cf('0x8')](),controller[_0x55cf('0xe')]);router[_0x55cf('0xf')]('/',auth[_0x55cf('0x8')](),controller['create']);router['put']('/:id',auth[_0x55cf('0x8')](),controller[_0x55cf('0x10')]);router[_0x55cf('0x11')](_0x55cf('0x9'),auth[_0x55cf('0x8')](),controller[_0x55cf('0x12')]);module[_0x55cf('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index eaa3243..a2d64ed 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbf5=['exports','STRING','TEXT'];(function(_0x2bd3a7,_0x49af46){var _0x395edd=function(_0x10854d){while(--_0x10854d){_0x2bd3a7['push'](_0x2bd3a7['shift']());}};_0x395edd(++_0x49af46);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4fbb3f,_0x476e0e){_0x4fbb3f=_0x4fbb3f-0x0;var _0x47ca5e=_0xdbf5[_0x4fbb3f];return _0x47ca5e;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x232e7a,_0x19997){var _0x445ddd=function(_0x43628d){while(--_0x43628d){_0x232e7a['push'](_0x232e7a['shift']());}};_0x445ddd(++_0x19997);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2deac4,_0xc27a2b){_0x2deac4=_0x2deac4-0x0;var _0x1c0bda=_0xfdbd[_0x2deac4];return _0x1c0bda;};'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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 7d02b43..33da7ec 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x3cadb1,_0x5174ee){var _0x5d198=function(_0x4b701d){while(--_0x4b701d){_0x3cadb1['push'](_0x3cadb1['shift']());}};_0x5d198(++_0x5174ee);}(_0xba34,0x119));var _0x4ba3=function(_0x37de58,_0x1308a3){_0x37de58=_0x37de58-0x0;var _0x59037d=_0xba34[_0x37de58];return _0x59037d;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x50c52e,_0x2b747d){var _0x2edb61=function(_0x577f78){while(--_0x577f78){_0x50c52e['push'](_0x50c52e['shift']());}};_0x2edb61(++_0x2b747d);}(_0xf494,0x1c6));var _0x4f49=function(_0x390645,_0x20383a){_0x390645=_0x390645-0x0;var _0xb0308=_0xf494[_0x390645];return _0xb0308;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 706ff23..86d0bef 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 _0x553e=['AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x553e,0x1a3));var _0xe553=function(_0x18eb80,_0x8947db){_0x18eb80=_0x18eb80-0x0;var _0x474ac1=_0x553e[_0x18eb80];return _0x474ac1;};'use strict';var _=require(_0xe553('0x0'));var util=require(_0xe553('0x1'));var logger=require(_0xe553('0x2'))(_0xe553('0x3'));var moment=require(_0xe553('0x4'));var BPromise=require(_0xe553('0x5'));var rp=require(_0xe553('0x6'));var fs=require('fs');var path=require(_0xe553('0x7'));var rimraf=require(_0xe553('0x8'));var config=require('../../config/environment');var attributes=require(_0xe553('0x9'));module['exports']=function(_0x46eed5,_0x58cbe3){return _0x46eed5['define'](_0xe553('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3c8=['api','bluebird','request-promise','rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x57d973,_0x283ef5){var _0x1a2d7b=function(_0x1410cb){while(--_0x1410cb){_0x57d973['push'](_0x57d973['shift']());}};_0x1a2d7b(++_0x283ef5);}(_0xf3c8,0x13e));var _0x8f3c=function(_0x346af7,_0x1b7649){_0x346af7=_0x346af7-0x0;var _0x1772bb=_0xf3c8[_0x346af7];return _0x1772bb;};'use strict';var _=require(_0x8f3c('0x0'));var util=require(_0x8f3c('0x1'));var logger=require('../../config/logger')(_0x8f3c('0x2'));var moment=require('moment');var BPromise=require(_0x8f3c('0x3'));var rp=require(_0x8f3c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f3c('0x5'));var config=require(_0x8f3c('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x8f3c('0x7')]=function(_0x57c0e6,_0x2d954b){return _0x57c0e6['define'](_0x8f3c('0x8'),attributes,{'tableName':_0x8f3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index f689d1e..88b7c6d 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 _0x102f=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x42907e,_0x5de9c5){var _0x176db7=function(_0x5930e0){while(--_0x5930e0){_0x42907e['push'](_0x42907e['shift']());}};_0x176db7(++_0x5de9c5);}(_0x102f,0x170));var _0xf102=function(_0xc2b4c8,_0x756a49){_0xc2b4c8=_0xc2b4c8-0x0;var _0x402443=_0x102f[_0xc2b4c8];return _0x402443;};'use strict';var _=require('lodash');var util=require(_0xf102('0x0'));var moment=require(_0xf102('0x1'));var BPromise=require('bluebird');var rs=require(_0xf102('0x2'));var fs=require('fs');var Redis=require(_0xf102('0x3'));var db=require(_0xf102('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf102('0x5'))(_0xf102('0x6'));var config=require('../../config/environment');var jayson=require(_0xf102('0x7'));var client=jayson[_0xf102('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee0,_0x34fd0c,_0x3a8beb){return new BPromise(function(_0x31691f,_0x249085){return client['request'](_0x32dee0,_0x3a8beb)[_0xf102('0x9')](function(_0x2ef1f1){logger[_0xf102('0xa')](_0xf102('0xb'),_0x34fd0c,_0xf102('0xc'));logger[_0xf102('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x34fd0c,_0xf102('0xc'),JSON[_0xf102('0xe')](_0x2ef1f1));if(_0x2ef1f1['error']){if(_0x2ef1f1[_0xf102('0xf')][_0xf102('0x10')]===0x1f4){logger[_0xf102('0xf')](_0xf102('0xb'),_0x34fd0c,_0x2ef1f1[_0xf102('0xf')][_0xf102('0x11')]);return _0x249085(_0x2ef1f1[_0xf102('0xf')][_0xf102('0x11')]);}logger[_0xf102('0xf')](_0xf102('0xb'),_0x34fd0c,_0x2ef1f1[_0xf102('0xf')]['message']);return _0x31691f(_0x2ef1f1['error'][_0xf102('0x11')]);}else{logger[_0xf102('0xa')](_0xf102('0xb'),_0x34fd0c,'request\x20sent');_0x31691f(_0x2ef1f1[_0xf102('0x12')][_0xf102('0x11')]);}})[_0xf102('0x13')](function(_0x57e1f5){logger[_0xf102('0xf')](_0xf102('0xb'),_0x34fd0c,_0x57e1f5);_0x249085(_0x57e1f5);});});}
\ No newline at end of file
+var _0xe721=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13fe35,_0x537cee){var _0x4875a8=function(_0x3fb855){while(--_0x3fb855){_0x13fe35['push'](_0x13fe35['shift']());}};_0x4875a8(++_0x537cee);}(_0xe721,0x150));var _0x1e72=function(_0x38833a,_0x151c2d){_0x38833a=_0x38833a-0x0;var _0x2ec16=_0xe721[_0x38833a];return _0x2ec16;};'use strict';var _=require(_0x1e72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1e72('0x1'));var rs=require(_0x1e72('0x2'));var fs=require('fs');var Redis=require(_0x1e72('0x3'));var db=require(_0x1e72('0x4'))['db'];var utils=require(_0x1e72('0x5'));var logger=require(_0x1e72('0x6'))(_0x1e72('0x7'));var config=require(_0x1e72('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1e72('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d4e81,_0x59dbf7,_0x1d914f){return new BPromise(function(_0x5d8423,_0x4e5247){return client['request'](_0x3d4e81,_0x1d914f)[_0x1e72('0xa')](function(_0x5d88c4){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x59dbf7,_0x1e72('0xb'));logger[_0x1e72('0xc')](_0x1e72('0xd'),_0x59dbf7,_0x1e72('0xb'),JSON[_0x1e72('0xe')](_0x5d88c4));if(_0x5d88c4[_0x1e72('0xf')]){if(_0x5d88c4[_0x1e72('0xf')][_0x1e72('0x10')]===0x1f4){logger['error'](_0x1e72('0x11'),_0x59dbf7,_0x5d88c4[_0x1e72('0xf')]['message']);return _0x4e5247(_0x5d88c4[_0x1e72('0xf')][_0x1e72('0x12')]);}logger[_0x1e72('0xf')](_0x1e72('0x11'),_0x59dbf7,_0x5d88c4[_0x1e72('0xf')][_0x1e72('0x12')]);return _0x5d8423(_0x5d88c4['error'][_0x1e72('0x12')]);}else{logger[_0x1e72('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x59dbf7,_0x1e72('0xb'));_0x5d8423(_0x5d88c4[_0x1e72('0x14')][_0x1e72('0x12')]);}})[_0x1e72('0x15')](function(_0x3f10cf){logger[_0x1e72('0xf')](_0x1e72('0x11'),_0x59dbf7,_0x3f10cf);_0x4e5247(_0x3f10cf);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7d774ca..6ee306d 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 _0xe69c=['get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','post','put','delete','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x307bf2,_0x24996f){var _0x1d5ef6=function(_0x57c968){while(--_0x57c968){_0x307bf2['push'](_0x307bf2['shift']());}};_0x1d5ef6(++_0x24996f);}(_0xe69c,0x92));var _0xce69=function(_0x29949a,_0x4a4340){_0x29949a=_0x29949a-0x0;var _0xd5220c=_0xe69c[_0x29949a];return _0xd5220c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce69('0x0'));var timeout=require('connect-timeout');var express=require(_0xce69('0x1'));var router=express['Router']();var fs_extra=require(_0xce69('0x2'));var auth=require(_0xce69('0x3'));var interaction=require(_0xce69('0x4'));var config=require(_0xce69('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0xce69('0x6')]('/',auth['isAuthenticated'](),controller[_0xce69('0x7')]);router[_0xce69('0x6')](_0xce69('0x8'),auth[_0xce69('0x9')](),controller[_0xce69('0xa')]);router[_0xce69('0x6')](_0xce69('0xb'),auth[_0xce69('0x9')](),controller[_0xce69('0xc')]);router[_0xce69('0x6')](_0xce69('0xd'),auth['isAuthenticated'](),controller[_0xce69('0xe')]);router[_0xce69('0x6')]('/:id/query',auth[_0xce69('0x9')](),controller['query']);router[_0xce69('0xf')]('/',auth[_0xce69('0x9')](),controller['create']);router[_0xce69('0x10')](_0xce69('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xce69('0x11')](_0xce69('0x8'),auth[_0xce69('0x9')](),controller['destroy']);module[_0xce69('0x12')]=router;
\ No newline at end of file
+var _0xd61c=['/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x225c0a,_0x44aefd){var _0x367b07=function(_0x1c0685){while(--_0x1c0685){_0x225c0a['push'](_0x225c0a['shift']());}};_0x367b07(++_0x44aefd);}(_0xd61c,0xdd));var _0xcd61=function(_0x5b42d1,_0x547e75){_0x5b42d1=_0x5b42d1-0x0;var _0x316b2c=_0xd61c[_0x5b42d1];return _0x316b2c;};'use strict';var multer=require(_0xcd61('0x0'));var util=require(_0xcd61('0x1'));var path=require(_0xcd61('0x2'));var timeout=require(_0xcd61('0x3'));var express=require(_0xcd61('0x4'));var router=express['Router']();var fs_extra=require(_0xcd61('0x5'));var auth=require(_0xcd61('0x6'));var interaction=require(_0xcd61('0x7'));var config=require(_0xcd61('0x8'));var controller=require(_0xcd61('0x9'));router[_0xcd61('0xa')]('/',auth[_0xcd61('0xb')](),controller[_0xcd61('0xc')]);router['get'](_0xcd61('0xd'),auth[_0xcd61('0xb')](),controller[_0xcd61('0xe')]);router[_0xcd61('0xa')](_0xcd61('0xf'),auth['isAuthenticated'](),controller[_0xcd61('0x10')]);router[_0xcd61('0xa')](_0xcd61('0x11'),auth['isAuthenticated'](),controller[_0xcd61('0x12')]);router['get'](_0xcd61('0x13'),auth['isAuthenticated'](),controller[_0xcd61('0x14')]);router[_0xcd61('0x15')]('/',auth['isAuthenticated'](),controller[_0xcd61('0x16')]);router['put'](_0xcd61('0xd'),auth[_0xcd61('0xb')](),controller['update']);router[_0xcd61('0x17')](_0xcd61('0xd'),auth[_0xcd61('0xb')](),controller[_0xcd61('0x18')]);module[_0xcd61('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 3baf37b..c195e52 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 _0xfd34=['INTEGER','sequelize','moment','exports','STRING','ENUM','pdf','csv','DATE','manual','scheduled'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0xfd34,0x177));var _0x4fd3=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0xfd34[_0x113e32];return _0x4ff939;};'use strict';var Sequelize=require(_0x4fd3('0x0'));var moment=require(_0x4fd3('0x1'));module[_0x4fd3('0x2')]={'name':{'type':Sequelize[_0x4fd3('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x4fd3('0x4')]('csv',_0x4fd3('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x4fd3('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4fd3('0x7')]},'endDate':{'type':Sequelize[_0x4fd3('0x7')]},'status':{'type':Sequelize[_0x4fd3('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4fd3('0x4')](_0x4fd3('0x8'),_0x4fd3('0x9')),'allowNull':![],'defaultValue':_0x4fd3('0x8')},'reportId':{'type':Sequelize[_0x4fd3('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x4fd3('0x3')]}};
\ No newline at end of file
+var _0xbf8d=['manual','UNSIGNED','moment','STRING','ENUM','xlsx','DATE','Loading'];(function(_0x3714bb,_0x48cf77){var _0x4c3f81=function(_0x4c0f00){while(--_0x4c0f00){_0x3714bb['push'](_0x3714bb['shift']());}};_0x4c3f81(++_0x48cf77);}(_0xbf8d,0x1ca));var _0xdbf8=function(_0x10fad9,_0x310fda){_0x10fad9=_0x10fad9-0x0;var _0x221098=_0xbf8d[_0x10fad9];return _0x221098;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdbf8('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbf8('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xdbf8('0x2')]('csv','pdf',_0xdbf8('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xdbf8('0x4')]},'status':{'type':Sequelize[_0xdbf8('0x1')],'defaultValue':_0xdbf8('0x5')},'type':{'type':Sequelize['ENUM'](_0xdbf8('0x6'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xdbf8('0x7')]},'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 60507b1..c6437c4 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 _0x23b6=['include','catch','show','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','%s.%s','toLowerCase','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x2e8325,_0x48dfe1){var _0x2ef325=function(_0x1b9bbc){while(--_0x1b9bbc){_0x2e8325['push'](_0x2e8325['shift']());}};_0x2ef325(++_0x48dfe1);}(_0x23b6,0x1a6));var _0x623b=function(_0x2db025,_0x1cf6de){_0x2db025=_0x2db025-0x0;var _0x47afbe=_0x23b6[_0x2db025];return _0x47afbe;};'use strict';var emlformat=require(_0x623b('0x0'));var rimraf=require(_0x623b('0x1'));var zipdir=require(_0x623b('0x2'));var jsonpatch=require(_0x623b('0x3'));var rp=require(_0x623b('0x4'));var moment=require(_0x623b('0x5'));var BPromise=require(_0x623b('0x6'));var Mustache=require(_0x623b('0x7'));var util=require(_0x623b('0x8'));var path=require(_0x623b('0x9'));var sox=require(_0x623b('0xa'));var csv=require(_0x623b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x623b('0xc'));var _=require(_0x623b('0xd'));var squel=require(_0x623b('0xe'));var crypto=require(_0x623b('0xf'));var jsforce=require(_0x623b('0x10'));var deskjs=require(_0x623b('0x11'));var toCsv=require(_0x623b('0xb'));var querystring=require(_0x623b('0x12'));var Papa=require(_0x623b('0x13'));var Redis=require(_0x623b('0x14'));var authService=require(_0x623b('0x15'));var qs=require(_0x623b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x623b('0x17'));var logger=require(_0x623b('0x18'))(_0x623b('0x19'));var utils=require('../../config/utils');var config=require(_0x623b('0x1a'));var licenseUtil=require(_0x623b('0x1b'));var db=require(_0x623b('0x1c'))['db'];function respondWithStatusCode(_0x50e8be,_0x1c12db){_0x1c12db=_0x1c12db||0xcc;return function(_0x5835cb){if(_0x5835cb){return _0x50e8be[_0x623b('0x1d')](_0x1c12db);}return _0x50e8be[_0x623b('0x1e')](_0x1c12db)[_0x623b('0x1f')]();};}function respondWithResult(_0x40f596,_0x5f3bdf){_0x5f3bdf=_0x5f3bdf||0xc8;return function(_0x4dad2b){if(_0x4dad2b){return _0x40f596[_0x623b('0x1e')](_0x5f3bdf)[_0x623b('0x20')](_0x4dad2b);}};}function respondWithFilteredResult(_0x5ec1eb,_0x19b442){return function(_0x1e420e){if(_0x1e420e){var _0x2d946e=typeof _0x19b442['offset']===_0x623b('0x21')&&typeof _0x19b442['limit']===_0x623b('0x21');var _0x2b72f6=_0x1e420e['count'];var _0x25d4f6=_0x2d946e?0x0:_0x19b442[_0x623b('0x22')];var _0x1e1eb6=_0x2d946e?_0x1e420e[_0x623b('0x23')]:_0x19b442[_0x623b('0x22')]+_0x19b442['limit'];var _0x498dc1;if(_0x1e1eb6>=_0x2b72f6){_0x1e1eb6=_0x2b72f6;_0x498dc1=0xc8;}else{_0x498dc1=0xce;}_0x5ec1eb['status'](_0x498dc1);return _0x5ec1eb[_0x623b('0x24')](_0x623b('0x25'),_0x25d4f6+'-'+_0x1e1eb6+'/'+_0x2b72f6)[_0x623b('0x20')](_0x1e420e);}return null;};}function patchUpdates(_0x22a32a){return function(_0x382eee){try{jsonpatch['apply'](_0x382eee,_0x22a32a,!![]);}catch(_0x59813f){return BPromise[_0x623b('0x26')](_0x59813f);}return _0x382eee[_0x623b('0x27')]();};}function saveUpdates(_0x26941e,_0x49a127){return function(_0x31e5cb){if(_0x31e5cb){return _0x31e5cb[_0x623b('0x28')](_0x26941e)['then'](function(_0x13d0c4){return _0x13d0c4;});}return null;};}function removeEntity(_0x1c76c0,_0x4277dd){return function(_0x4f8e14){if(_0x4f8e14){return _0x4f8e14[_0x623b('0x29')]()['then'](function(){var _0x529981=_0x4f8e14[_0x623b('0x2a')]({'plain':!![]});var _0xdb17f9='ExtractedReports';return db[_0x623b('0x2b')]['destroy']({'where':{'type':_0xdb17f9,'resourceId':_0x529981['id']}})[_0x623b('0x2c')](function(){return _0x4f8e14;});})['then'](function(){_0x1c76c0[_0x623b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c987,_0x50d0cb){return function(_0x33d7f8){if(!_0x33d7f8){_0x38c987['sendStatus'](0x194);}return _0x33d7f8;};}function handleError(_0x200c73,_0xa7f9e0){_0xa7f9e0=_0xa7f9e0||0x1f4;return function(_0x1cda2b){logger[_0x623b('0x2d')](_0x1cda2b[_0x623b('0x2e')]);if(_0x1cda2b[_0x623b('0x2f')]){delete _0x1cda2b[_0x623b('0x2f')];}_0x200c73[_0x623b('0x1e')](_0xa7f9e0)[_0x623b('0x30')](_0x1cda2b);};}exports[_0x623b('0x31')]=function(_0x2da010,_0x15ee29){var _0x132d1e={},_0x5823ef={},_0x1b6ed4={'count':0x0,'rows':[]};var _0xcd4fea=_['map'](db[_0x623b('0x32')][_0x623b('0x33')],function(_0x2a672a){return{'name':_0x2a672a[_0x623b('0x34')],'type':_0x2a672a['type'][_0x623b('0x35')]};});_0x5823ef[_0x623b('0x36')]=_[_0x623b('0x37')](_0xcd4fea,_0x623b('0x2f'));_0x5823ef[_0x623b('0x38')]=_['keys'](_0x2da010[_0x623b('0x38')]);_0x5823ef['filters']=_[_0x623b('0x39')](_0x5823ef['model'],_0x5823ef['query']);_0x132d1e[_0x623b('0x3a')]=_['intersection'](_0x5823ef['model'],qs[_0x623b('0x3b')](_0x2da010[_0x623b('0x38')][_0x623b('0x3b')]));_0x132d1e[_0x623b('0x3a')]=_0x132d1e[_0x623b('0x3a')][_0x623b('0x3c')]?_0x132d1e[_0x623b('0x3a')]:_0x5823ef[_0x623b('0x36')];if(!_0x2da010[_0x623b('0x38')][_0x623b('0x3d')](_0x623b('0x3e'))){_0x132d1e[_0x623b('0x3f')]=qs['limit'](_0x2da010[_0x623b('0x38')][_0x623b('0x3f')]);_0x132d1e[_0x623b('0x22')]=qs[_0x623b('0x22')](_0x2da010['query'][_0x623b('0x22')]);}_0x132d1e[_0x623b('0x40')]=qs[_0x623b('0x41')](_0x2da010[_0x623b('0x38')]['sort']);_0x132d1e['where']=qs[_0x623b('0x42')](_['pick'](_0x2da010[_0x623b('0x38')],_0x5823ef[_0x623b('0x42')]),_0xcd4fea);if(_0x2da010['query'][_0x623b('0x43')]){_0x132d1e[_0x623b('0x44')]=_[_0x623b('0x45')](_0x132d1e[_0x623b('0x44')],{'$or':_[_0x623b('0x37')](_0xcd4fea,function(_0x3c0f6d){if(_0x3c0f6d['type']!==_0x623b('0x46')){var _0x10d4ad={};_0x10d4ad[_0x3c0f6d['name']]={'$like':'%'+_0x2da010[_0x623b('0x38')]['filter']+'%'};return _0x10d4ad;}})});}_0x132d1e=_[_0x623b('0x45')]({},_0x132d1e,_0x2da010[_0x623b('0x47')]);var _0x415c26={'where':_0x132d1e[_0x623b('0x44')]};return db[_0x623b('0x32')]['count'](_0x415c26)[_0x623b('0x2c')](function(_0xead232){_0x1b6ed4[_0x623b('0x23')]=_0xead232;if(_0x2da010[_0x623b('0x38')][_0x623b('0x48')]){_0x132d1e[_0x623b('0x49')]=[{'all':!![]}];}return db[_0x623b('0x32')]['findAll'](_0x132d1e);})['then'](function(_0x484eec){_0x1b6ed4['rows']=_0x484eec;return _0x1b6ed4;})[_0x623b('0x2c')](respondWithFilteredResult(_0x15ee29,_0x132d1e))[_0x623b('0x4a')](handleError(_0x15ee29,null));};exports[_0x623b('0x4b')]=function(_0x70af34,_0x206fb9){var _0x38a52e={'raw':!![],'where':{'id':_0x70af34['params']['id']}},_0x510433={};_0x510433['model']=_[_0x623b('0x4c')](db[_0x623b('0x32')][_0x623b('0x33')]);_0x510433[_0x623b('0x38')]=_['keys'](_0x70af34[_0x623b('0x38')]);_0x510433[_0x623b('0x42')]=_[_0x623b('0x39')](_0x510433['model'],_0x510433[_0x623b('0x38')]);_0x38a52e[_0x623b('0x3a')]=_['intersection'](_0x510433['model'],qs['fields'](_0x70af34['query'][_0x623b('0x3b')]));_0x38a52e[_0x623b('0x3a')]=_0x38a52e[_0x623b('0x3a')]['length']?_0x38a52e[_0x623b('0x3a')]:_0x510433[_0x623b('0x36')];if(_0x70af34['query'][_0x623b('0x48')]){_0x38a52e[_0x623b('0x49')]=[{'all':!![]}];}_0x38a52e=_[_0x623b('0x45')]({},_0x38a52e,_0x70af34[_0x623b('0x47')]);return db[_0x623b('0x32')][_0x623b('0x4d')](_0x38a52e)[_0x623b('0x2c')](handleEntityNotFound(_0x206fb9,null))[_0x623b('0x2c')](respondWithResult(_0x206fb9,null))[_0x623b('0x4a')](handleError(_0x206fb9,null));};exports[_0x623b('0x4e')]=function(_0x47349f,_0x10311e){return db[_0x623b('0x32')][_0x623b('0x4e')](_0x47349f[_0x623b('0x4f')],{})[_0x623b('0x2c')](function(_0x248909){var _0x1ab648=_0x47349f['user'][_0x623b('0x2a')]({'plain':!![]});if(!_0x1ab648)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ab648['role']===_0x623b('0x50')){var _0x42af27=_0x248909['get']({'plain':!![]});var _0x57a1e8='ExtractedReports';return db[_0x623b('0x51')]['find']({'where':{'name':_0x57a1e8,'userProfileId':_0x1ab648[_0x623b('0x52')]},'raw':!![]})[_0x623b('0x2c')](function(_0x30562d){if(_0x30562d&&_0x30562d[_0x623b('0x53')]===0x0){return db[_0x623b('0x2b')][_0x623b('0x4e')]({'name':_0x42af27[_0x623b('0x2f')],'resourceId':_0x42af27['id'],'type':_0x30562d[_0x623b('0x2f')],'sectionId':_0x30562d['id']},{})[_0x623b('0x2c')](function(){return _0x248909;});}else{return _0x248909;}})['catch'](function(_0x413d5d){logger['error'](_0x623b('0x54'),_0x413d5d);throw _0x413d5d;});}return _0x248909;})['then'](respondWithResult(_0x10311e,0xc9))['catch'](handleError(_0x10311e,null));};exports[_0x623b('0x28')]=function(_0x1e22a2,_0x21728b){if(_0x1e22a2[_0x623b('0x4f')]['id']){delete _0x1e22a2[_0x623b('0x4f')]['id'];}return db[_0x623b('0x32')][_0x623b('0x4d')]({'where':{'id':_0x1e22a2[_0x623b('0x55')]['id']}})[_0x623b('0x2c')](handleEntityNotFound(_0x21728b,null))[_0x623b('0x2c')](saveUpdates(_0x1e22a2[_0x623b('0x4f')],null))['then'](respondWithResult(_0x21728b,null))['catch'](handleError(_0x21728b,null));};exports[_0x623b('0x29')]=function(_0xb92ac7,_0x3ecfd5){return db['AnalyticExtractedReport'][_0x623b('0x4d')]({'where':{'id':_0xb92ac7[_0x623b('0x55')]['id']}})[_0x623b('0x2c')](handleEntityNotFound(_0x3ecfd5,null))[_0x623b('0x2c')](removeEntity(_0x3ecfd5,null))[_0x623b('0x4a')](handleError(_0x3ecfd5,null));};exports[_0x623b('0x56')]=function(_0x570610,_0x43e2ea,_0x1698b7){return db['AnalyticExtractedReport'][_0x623b('0x4d')]({'where':{'id':_0x570610[_0x623b('0x55')]['id']},'attributes':[_0x623b('0x2f'),_0x623b('0x57'),_0x623b('0x58'),_0x623b('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0x43e2ea,null))[_0x623b('0x2c')](function(_0x13b50d){if(_0x13b50d){if(!fs[_0x623b('0x5a')](path['join'](config[_0x623b('0x5b')],_0x623b('0x5c'),_0x13b50d[_0x623b('0x58')]))){throw new db[(_0x623b('0x5d'))][(_0x623b('0x5e'))](_0x623b('0x5f'));}if(_0x570610[_0x623b('0x38')]['exists']){return _0x43e2ea['sendStatus'](0xc8);}return _0x43e2ea['download'](path[_0x623b('0x60')](config['root'],'server/files/reports',_0x13b50d[_0x623b('0x58')]),util['format'](_0x623b('0x61'),_0x13b50d['basename']||_0x13b50d['name'],_0x13b50d[_0x623b('0x59')][_0x623b('0x62')]()));}})[_0x623b('0x4a')](handleError(_0x43e2ea,null));};
\ No newline at end of file
+var _0xe3c0=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise'];(function(_0x5c4b4e,_0x577213){var _0x1c093b=function(_0x25100e){while(--_0x25100e){_0x5c4b4e['push'](_0x5c4b4e['shift']());}};_0x1c093b(++_0x577213);}(_0xe3c0,0x125));var _0x0e3c=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe3c0[_0x543084];return _0x306a57;};'use strict';var emlformat=require(_0x0e3c('0x0'));var rimraf=require(_0x0e3c('0x1'));var zipdir=require(_0x0e3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e3c('0x3'));var moment=require(_0x0e3c('0x4'));var BPromise=require(_0x0e3c('0x5'));var Mustache=require(_0x0e3c('0x6'));var util=require(_0x0e3c('0x7'));var path=require(_0x0e3c('0x8'));var sox=require(_0x0e3c('0x9'));var csv=require(_0x0e3c('0xa'));var ejs=require(_0x0e3c('0xb'));var fs=require('fs');var fs_extra=require(_0x0e3c('0xc'));var _=require(_0x0e3c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e3c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e3c('0xa'));var querystring=require(_0x0e3c('0xf'));var Papa=require(_0x0e3c('0x10'));var Redis=require(_0x0e3c('0x11'));var authService=require(_0x0e3c('0x12'));var qs=require(_0x0e3c('0x13'));var as=require(_0x0e3c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e3c('0x15'))(_0x0e3c('0x16'));var utils=require(_0x0e3c('0x17'));var config=require(_0x0e3c('0x18'));var licenseUtil=require(_0x0e3c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf1635,_0xa03c43){_0xa03c43=_0xa03c43||0xcc;return function(_0x4fdc29){if(_0x4fdc29){return _0xcf1635['sendStatus'](_0xa03c43);}return _0xcf1635[_0x0e3c('0x1a')](_0xa03c43)['end']();};}function respondWithResult(_0x287afb,_0x1dfbdf){_0x1dfbdf=_0x1dfbdf||0xc8;return function(_0x2b9237){if(_0x2b9237){return _0x287afb[_0x0e3c('0x1a')](_0x1dfbdf)['json'](_0x2b9237);}};}function respondWithFilteredResult(_0x56c52f,_0x3bf0e7){return function(_0x366720){if(_0x366720){var _0x534939=typeof _0x3bf0e7[_0x0e3c('0x1b')]===_0x0e3c('0x1c')&&typeof _0x3bf0e7[_0x0e3c('0x1d')]===_0x0e3c('0x1c');var _0x5369ad=_0x366720[_0x0e3c('0x1e')];var _0x2c20c2=_0x534939?0x0:_0x3bf0e7[_0x0e3c('0x1b')];var _0x2cdfed=_0x534939?_0x366720['count']:_0x3bf0e7[_0x0e3c('0x1b')]+_0x3bf0e7['limit'];var _0x581bfb;if(_0x2cdfed>=_0x5369ad){_0x2cdfed=_0x5369ad;_0x581bfb=0xc8;}else{_0x581bfb=0xce;}_0x56c52f[_0x0e3c('0x1a')](_0x581bfb);return _0x56c52f[_0x0e3c('0x1f')]('Content-Range',_0x2c20c2+'-'+_0x2cdfed+'/'+_0x5369ad)[_0x0e3c('0x20')](_0x366720);}return null;};}function patchUpdates(_0x182b65){return function(_0x42b1bd){try{jsonpatch[_0x0e3c('0x21')](_0x42b1bd,_0x182b65,!![]);}catch(_0xc73ba1){return BPromise[_0x0e3c('0x22')](_0xc73ba1);}return _0x42b1bd[_0x0e3c('0x23')]();};}function saveUpdates(_0x5953af,_0x402a5e){return function(_0x5026a4){if(_0x5026a4){return _0x5026a4[_0x0e3c('0x24')](_0x5953af)[_0x0e3c('0x25')](function(_0x266949){return _0x266949;});}return null;};}function removeEntity(_0x47a822,_0x2c597e){return function(_0x25602f){if(_0x25602f){return _0x25602f['destroy']()['then'](function(){var _0x3668=_0x25602f[_0x0e3c('0x26')]({'plain':!![]});var _0x570fce=_0x0e3c('0x27');return db[_0x0e3c('0x28')][_0x0e3c('0x29')]({'where':{'type':_0x570fce,'resourceId':_0x3668['id']}})[_0x0e3c('0x25')](function(){return _0x25602f;});})[_0x0e3c('0x25')](function(){_0x47a822[_0x0e3c('0x1a')](0xcc)[_0x0e3c('0x2a')]();});}};}function handleEntityNotFound(_0x3148c4,_0x151843){return function(_0x16d964){if(!_0x16d964){_0x3148c4[_0x0e3c('0x2b')](0x194);}return _0x16d964;};}function handleError(_0x118c69,_0x397341){_0x397341=_0x397341||0x1f4;return function(_0x58062b){logger['error'](_0x58062b['stack']);if(_0x58062b[_0x0e3c('0x2c')]){delete _0x58062b['name'];}_0x118c69[_0x0e3c('0x1a')](_0x397341)[_0x0e3c('0x2d')](_0x58062b);};}exports[_0x0e3c('0x2e')]=function(_0x115b24,_0x2f5a80){var _0x2d0162={},_0x49bab2={},_0x2200d1={'count':0x0,'rows':[]};var _0x4b7fb4=_['map'](db['AnalyticExtractedReport'][_0x0e3c('0x2f')],function(_0x39b84c){return{'name':_0x39b84c[_0x0e3c('0x30')],'type':_0x39b84c[_0x0e3c('0x31')][_0x0e3c('0x32')]};});_0x49bab2[_0x0e3c('0x33')]=_['map'](_0x4b7fb4,'name');_0x49bab2[_0x0e3c('0x34')]=_[_0x0e3c('0x35')](_0x115b24[_0x0e3c('0x34')]);_0x49bab2[_0x0e3c('0x36')]=_['intersection'](_0x49bab2[_0x0e3c('0x33')],_0x49bab2[_0x0e3c('0x34')]);_0x2d0162[_0x0e3c('0x37')]=_[_0x0e3c('0x38')](_0x49bab2[_0x0e3c('0x33')],qs[_0x0e3c('0x39')](_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x39')]));_0x2d0162[_0x0e3c('0x37')]=_0x2d0162[_0x0e3c('0x37')][_0x0e3c('0x3a')]?_0x2d0162[_0x0e3c('0x37')]:_0x49bab2['model'];if(!_0x115b24['query'][_0x0e3c('0x3b')](_0x0e3c('0x3c'))){_0x2d0162[_0x0e3c('0x1d')]=qs[_0x0e3c('0x1d')](_0x115b24[_0x0e3c('0x34')]['limit']);_0x2d0162[_0x0e3c('0x1b')]=qs[_0x0e3c('0x1b')](_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x1b')]);}_0x2d0162[_0x0e3c('0x3d')]=qs[_0x0e3c('0x3e')](_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x3e')]);_0x2d0162[_0x0e3c('0x3f')]=qs[_0x0e3c('0x36')](_[_0x0e3c('0x40')](_0x115b24[_0x0e3c('0x34')],_0x49bab2[_0x0e3c('0x36')]),_0x4b7fb4);if(_0x115b24['query']['filter']){_0x2d0162['where']=_[_0x0e3c('0x41')](_0x2d0162[_0x0e3c('0x3f')],{'$or':_[_0x0e3c('0x42')](_0x4b7fb4,function(_0x5ce47f){if(_0x5ce47f[_0x0e3c('0x31')]!==_0x0e3c('0x43')){var _0x487224={};_0x487224[_0x5ce47f['name']]={'$like':'%'+_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x44')]+'%'};return _0x487224;}})});}_0x2d0162=_[_0x0e3c('0x41')]({},_0x2d0162,_0x115b24[_0x0e3c('0x45')]);var _0xa70a13={'where':_0x2d0162[_0x0e3c('0x3f')]};return db[_0x0e3c('0x46')][_0x0e3c('0x1e')](_0xa70a13)[_0x0e3c('0x25')](function(_0x21559d){_0x2200d1[_0x0e3c('0x1e')]=_0x21559d;if(_0x115b24[_0x0e3c('0x34')][_0x0e3c('0x47')]){_0x2d0162[_0x0e3c('0x48')]=[{'all':!![]}];}return db[_0x0e3c('0x46')]['findAll'](_0x2d0162);})[_0x0e3c('0x25')](function(_0x3f0329){_0x2200d1[_0x0e3c('0x49')]=_0x3f0329;return _0x2200d1;})[_0x0e3c('0x25')](respondWithFilteredResult(_0x2f5a80,_0x2d0162))[_0x0e3c('0x4a')](handleError(_0x2f5a80,null));};exports['show']=function(_0x5dc569,_0x3cec0b){var _0x4c57f5={'raw':!![],'where':{'id':_0x5dc569[_0x0e3c('0x4b')]['id']}},_0x3ba7e2={};_0x3ba7e2[_0x0e3c('0x33')]=_[_0x0e3c('0x35')](db[_0x0e3c('0x46')][_0x0e3c('0x2f')]);_0x3ba7e2[_0x0e3c('0x34')]=_[_0x0e3c('0x35')](_0x5dc569[_0x0e3c('0x34')]);_0x3ba7e2[_0x0e3c('0x36')]=_[_0x0e3c('0x38')](_0x3ba7e2[_0x0e3c('0x33')],_0x3ba7e2[_0x0e3c('0x34')]);_0x4c57f5[_0x0e3c('0x37')]=_['intersection'](_0x3ba7e2[_0x0e3c('0x33')],qs['fields'](_0x5dc569[_0x0e3c('0x34')][_0x0e3c('0x39')]));_0x4c57f5[_0x0e3c('0x37')]=_0x4c57f5['attributes'][_0x0e3c('0x3a')]?_0x4c57f5[_0x0e3c('0x37')]:_0x3ba7e2[_0x0e3c('0x33')];if(_0x5dc569[_0x0e3c('0x34')][_0x0e3c('0x47')]){_0x4c57f5[_0x0e3c('0x48')]=[{'all':!![]}];}_0x4c57f5=_['merge']({},_0x4c57f5,_0x5dc569[_0x0e3c('0x45')]);return db[_0x0e3c('0x46')][_0x0e3c('0x4c')](_0x4c57f5)['then'](handleEntityNotFound(_0x3cec0b,null))[_0x0e3c('0x25')](respondWithResult(_0x3cec0b,null))[_0x0e3c('0x4a')](handleError(_0x3cec0b,null));};exports['create']=function(_0x4a11bc,_0x1d6402){return db[_0x0e3c('0x46')][_0x0e3c('0x4d')](_0x4a11bc[_0x0e3c('0x4e')],{})[_0x0e3c('0x25')](function(_0x49c709){var _0x27f80d=_0x4a11bc[_0x0e3c('0x4f')][_0x0e3c('0x26')]({'plain':!![]});if(!_0x27f80d)throw new Error(_0x0e3c('0x50'));if(_0x27f80d[_0x0e3c('0x51')]===_0x0e3c('0x4f')){var _0x1f74ac=_0x49c709['get']({'plain':!![]});var _0x115391=_0x0e3c('0x27');return db[_0x0e3c('0x52')][_0x0e3c('0x4c')]({'where':{'name':_0x115391,'userProfileId':_0x27f80d['userProfileId']},'raw':!![]})[_0x0e3c('0x25')](function(_0x36683e){if(_0x36683e&&_0x36683e[_0x0e3c('0x53')]===0x0){return db[_0x0e3c('0x28')][_0x0e3c('0x4d')]({'name':_0x1f74ac[_0x0e3c('0x2c')],'resourceId':_0x1f74ac['id'],'type':_0x36683e[_0x0e3c('0x2c')],'sectionId':_0x36683e['id']},{})[_0x0e3c('0x25')](function(){return _0x49c709;});}else{return _0x49c709;}})['catch'](function(_0x447667){logger[_0x0e3c('0x54')](_0x0e3c('0x55'),_0x447667);throw _0x447667;});}return _0x49c709;})[_0x0e3c('0x25')](respondWithResult(_0x1d6402,0xc9))['catch'](handleError(_0x1d6402,null));};exports['update']=function(_0x3d2f57,_0x4faa99){if(_0x3d2f57[_0x0e3c('0x4e')]['id']){delete _0x3d2f57[_0x0e3c('0x4e')]['id'];}return db[_0x0e3c('0x46')][_0x0e3c('0x4c')]({'where':{'id':_0x3d2f57[_0x0e3c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4faa99,null))[_0x0e3c('0x25')](saveUpdates(_0x3d2f57[_0x0e3c('0x4e')],null))[_0x0e3c('0x25')](respondWithResult(_0x4faa99,null))[_0x0e3c('0x4a')](handleError(_0x4faa99,null));};exports[_0x0e3c('0x29')]=function(_0x41060b,_0x53efc3){return db[_0x0e3c('0x46')]['find']({'where':{'id':_0x41060b[_0x0e3c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53efc3,null))[_0x0e3c('0x25')](removeEntity(_0x53efc3,null))[_0x0e3c('0x4a')](handleError(_0x53efc3,null));};exports['download']=function(_0x5d1d83,_0x3ff096,_0x3e42df){return db[_0x0e3c('0x46')][_0x0e3c('0x4c')]({'where':{'id':_0x5d1d83[_0x0e3c('0x4b')]['id']},'attributes':[_0x0e3c('0x2c'),_0x0e3c('0x56'),_0x0e3c('0x57'),_0x0e3c('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x3ff096,null))[_0x0e3c('0x25')](function(_0x338dc4){if(_0x338dc4){if(!fs[_0x0e3c('0x59')](path[_0x0e3c('0x5a')](config['root'],_0x0e3c('0x5b'),_0x338dc4[_0x0e3c('0x57')]))){throw new db[(_0x0e3c('0x5c'))][(_0x0e3c('0x5d'))](_0x0e3c('0x5e'));}if(_0x5d1d83[_0x0e3c('0x34')]['exists']){return _0x3ff096[_0x0e3c('0x2b')](0xc8);}return _0x3ff096[_0x0e3c('0x5f')](path[_0x0e3c('0x5a')](config['root'],_0x0e3c('0x5b'),_0x338dc4['savename']),util[_0x0e3c('0x60')](_0x0e3c('0x61'),_0x338dc4[_0x0e3c('0x56')]||_0x338dc4[_0x0e3c('0x2c')],_0x338dc4[_0x0e3c('0x58')][_0x0e3c('0x62')]()));}})['catch'](handleError(_0x3ff096,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 952643f..c227cfa 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 _0xa1e0=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x43b1f1,_0x42e0ae){var _0x24613b=function(_0x3d4814){while(--_0x3d4814){_0x43b1f1['push'](_0x43b1f1['shift']());}};_0x24613b(++_0x42e0ae);}(_0xa1e0,0x178));var _0x0a1e=function(_0x3ed5f1,_0x365b3b){_0x3ed5f1=_0x3ed5f1-0x0;var _0x276c9a=_0xa1e0[_0x3ed5f1];return _0x276c9a;};'use strict';var _=require(_0x0a1e('0x0'));var util=require(_0x0a1e('0x1'));var logger=require(_0x0a1e('0x2'))(_0x0a1e('0x3'));var moment=require(_0x0a1e('0x4'));var BPromise=require(_0x0a1e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a1e('0x6'));var rimraf=require('rimraf');var config=require(_0x0a1e('0x7'));var attributes=require(_0x0a1e('0x8'));module[_0x0a1e('0x9')]=function(_0x5a2a9f,_0x317741){return _0x5a2a9f[_0x0a1e('0xa')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e2e=['analytics_extracted_reports','lodash','util','api','moment','path','exports','AnalyticExtractedReport'];(function(_0x377161,_0x200fd6){var _0x2a4ff6=function(_0x549334){while(--_0x549334){_0x377161['push'](_0x377161['shift']());}};_0x2a4ff6(++_0x200fd6);}(_0x8e2e,0x81));var _0xe8e2=function(_0x4bab92,_0x497266){_0x4bab92=_0x4bab92-0x0;var _0x5ebe8b=_0x8e2e[_0x4bab92];return _0x5ebe8b;};'use strict';var _=require(_0xe8e2('0x0'));var util=require(_0xe8e2('0x1'));var logger=require('../../config/logger')(_0xe8e2('0x2'));var moment=require(_0xe8e2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8e2('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xe8e2('0x5')]=function(_0x4fc4e5,_0x479f8d){return _0x4fc4e5['define'](_0xe8e2('0x6'),attributes,{'tableName':_0xe8e2('0x7'),'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 f270d50..91251bc 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 _0x6868=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x380f9c,_0x5eb36c){var _0x447a50=function(_0xc827fa){while(--_0xc827fa){_0x380f9c['push'](_0x380f9c['shift']());}};_0x447a50(++_0x5eb36c);}(_0x6868,0xdd));var _0x8686=function(_0xa39931,_0x60e64d){_0xa39931=_0xa39931-0x0;var _0x4372ce=_0x6868[_0xa39931];return _0x4372ce;};'use strict';var _=require(_0x8686('0x0'));var util=require('util');var moment=require(_0x8686('0x1'));var BPromise=require(_0x8686('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8686('0x3'));var db=require(_0x8686('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8686('0x5'))('rpc');var config=require(_0x8686('0x6'));var jayson=require(_0x8686('0x7'));var client=jayson[_0x8686('0x8')][_0x8686('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2732e6,_0x4e3d3,_0xbbc930){return new BPromise(function(_0x1958aa,_0x388050){return client[_0x8686('0xa')](_0x2732e6,_0xbbc930)[_0x8686('0xb')](function(_0x5277fe){logger['info'](_0x8686('0xc'),_0x4e3d3,'request\x20sent');logger[_0x8686('0xd')](_0x8686('0xe'),_0x4e3d3,_0x8686('0xf'),JSON[_0x8686('0x10')](_0x5277fe));if(_0x5277fe[_0x8686('0x11')]){if(_0x5277fe[_0x8686('0x11')][_0x8686('0x12')]===0x1f4){logger['error'](_0x8686('0xc'),_0x4e3d3,_0x5277fe[_0x8686('0x11')][_0x8686('0x13')]);return _0x388050(_0x5277fe[_0x8686('0x11')]['message']);}logger[_0x8686('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4e3d3,_0x5277fe[_0x8686('0x11')]['message']);return _0x1958aa(_0x5277fe[_0x8686('0x11')]['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4e3d3,_0x8686('0xf'));_0x1958aa(_0x5277fe[_0x8686('0x14')][_0x8686('0x13')]);}})[_0x8686('0x15')](function(_0x5abafc){logger[_0x8686('0x11')](_0x8686('0xc'),_0x4e3d3,_0x5abafc);_0x388050(_0x5abafc);});});}
\ No newline at end of file
+var _0xc576=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird','randomstring'];(function(_0x482ce2,_0x48b227){var _0x47fc6e=function(_0x1264c7){while(--_0x1264c7){_0x482ce2['push'](_0x482ce2['shift']());}};_0x47fc6e(++_0x48b227);}(_0xc576,0xf9));var _0x6c57=function(_0xdb951d,_0x1dc42b){_0xdb951d=_0xdb951d-0x0;var _0x5e789e=_0xc576[_0xdb951d];return _0x5e789e;};'use strict';var _=require(_0x6c57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c57('0x1'));var rs=require(_0x6c57('0x2'));var fs=require('fs');var Redis=require(_0x6c57('0x3'));var db=require(_0x6c57('0x4'))['db'];var utils=require(_0x6c57('0x5'));var logger=require(_0x6c57('0x6'))(_0x6c57('0x7'));var config=require(_0x6c57('0x8'));var jayson=require(_0x6c57('0x9'));var client=jayson['client'][_0x6c57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a5a7c,_0x5ee76c,_0x325c4b){return new BPromise(function(_0x2d69d0,_0x319aa9){return client[_0x6c57('0xb')](_0x2a5a7c,_0x325c4b)[_0x6c57('0xc')](function(_0x3a31d8){logger['info'](_0x6c57('0xd'),_0x5ee76c,_0x6c57('0xe'));logger['debug'](_0x6c57('0xf'),_0x5ee76c,_0x6c57('0xe'),JSON[_0x6c57('0x10')](_0x3a31d8));if(_0x3a31d8['error']){if(_0x3a31d8[_0x6c57('0x11')]['code']===0x1f4){logger[_0x6c57('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ee76c,_0x3a31d8[_0x6c57('0x11')]['message']);return _0x319aa9(_0x3a31d8[_0x6c57('0x11')][_0x6c57('0x12')]);}logger['error'](_0x6c57('0xd'),_0x5ee76c,_0x3a31d8[_0x6c57('0x11')][_0x6c57('0x12')]);return _0x2d69d0(_0x3a31d8[_0x6c57('0x11')]['message']);}else{logger[_0x6c57('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ee76c,_0x6c57('0xe'));_0x2d69d0(_0x3a31d8['result']['message']);}})[_0x6c57('0x14')](function(_0x5d1249){logger[_0x6c57('0x11')](_0x6c57('0xd'),_0x5ee76c,_0x5d1249);_0x319aa9(_0x5d1249);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 0813bc6..6b9c563 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 _0x4e44=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post'];(function(_0x21d0d2,_0x1bfe5a){var _0x2f050e=function(_0x1b849c){while(--_0x1b849c){_0x21d0d2['push'](_0x21d0d2['shift']());}};_0x2f050e(++_0x1bfe5a);}(_0x4e44,0x165));var _0x44e4=function(_0x11113e,_0x869716){_0x11113e=_0x11113e-0x0;var _0x2f43fc=_0x4e44[_0x11113e];return _0x2f43fc;};'use strict';var multer=require(_0x44e4('0x0'));var util=require(_0x44e4('0x1'));var path=require(_0x44e4('0x2'));var timeout=require(_0x44e4('0x3'));var express=require(_0x44e4('0x4'));var router=express['Router']();var fs_extra=require(_0x44e4('0x5'));var auth=require(_0x44e4('0x6'));var interaction=require(_0x44e4('0x7'));var config=require('../../config/environment');var controller=require(_0x44e4('0x8'));router[_0x44e4('0x9')]('/',auth[_0x44e4('0xa')](),controller[_0x44e4('0xb')]);router[_0x44e4('0x9')](_0x44e4('0xc'),auth[_0x44e4('0xa')](),controller[_0x44e4('0xd')]);router[_0x44e4('0x9')](_0x44e4('0xe'),auth['isAuthenticated'](),controller[_0x44e4('0xf')]);router[_0x44e4('0x10')]('/',auth['isAuthenticated'](),controller[_0x44e4('0x11')]);router['put'](_0x44e4('0xc'),auth[_0x44e4('0xa')](),controller[_0x44e4('0x12')]);router[_0x44e4('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x44e4('0x14')]);module[_0x44e4('0x15')]=router;
\ No newline at end of file
+var _0x4755=['../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','express','Router','fs-extra'];(function(_0x5b4504,_0x5a2198){var _0x486149=function(_0x449f50){while(--_0x449f50){_0x5b4504['push'](_0x5b4504['shift']());}};_0x486149(++_0x5a2198);}(_0x4755,0x13f));var _0x5475=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x4755[_0x1e9424];return _0x1bd96c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5475('0x0'));var router=express[_0x5475('0x1')]();var fs_extra=require(_0x5475('0x2'));var auth=require(_0x5475('0x3'));var interaction=require(_0x5475('0x4'));var config=require('../../config/environment');var controller=require(_0x5475('0x5'));router[_0x5475('0x6')]('/',auth[_0x5475('0x7')](),controller['index']);router[_0x5475('0x6')](_0x5475('0x8'),auth[_0x5475('0x7')](),controller[_0x5475('0x9')]);router[_0x5475('0x6')]('/:id/download',auth[_0x5475('0x7')](),controller['download']);router[_0x5475('0xa')]('/',auth['isAuthenticated'](),controller[_0x5475('0xb')]);router[_0x5475('0xc')]('/:id',auth[_0x5475('0x7')](),controller['update']);router['delete'](_0x5475('0x8'),auth[_0x5475('0x7')](),controller[_0x5475('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 5d49b47..7203f1b 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 _0xb7d1=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x453c03,_0x4bd254){var _0x19d5b6=function(_0x398163){while(--_0x398163){_0x453c03['push'](_0x453c03['shift']());}};_0x19d5b6(++_0x4bd254);}(_0xb7d1,0x1a6));var _0x1b7d=function(_0x540cb1,_0x3a40be){_0x540cb1=_0x540cb1-0x0;var _0x1263d9=_0xb7d1[_0x540cb1];return _0x1263d9;};'use strict';var Sequelize=require(_0x1b7d('0x0'));module[_0x1b7d('0x1')]={'field':{'type':Sequelize[_0x1b7d('0x2')]},'alias':{'type':Sequelize[_0x1b7d('0x3')]},'function':{'type':Sequelize[_0x1b7d('0x3')]},'format':{'type':Sequelize[_0x1b7d('0x3')]},'groupBy':{'type':Sequelize[_0x1b7d('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1b7d('0x3')]},'custom':{'type':Sequelize[_0x1b7d('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7916=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3be021,_0x4931ab){var _0x28b009=function(_0x54a2ce){while(--_0x54a2ce){_0x3be021['push'](_0x3be021['shift']());}};_0x28b009(++_0x4931ab);}(_0x7916,0x1d3));var _0x6791=function(_0x45271c,_0x1bf2d8){_0x45271c=_0x45271c-0x0;var _0x44bfda=_0x7916[_0x45271c];return _0x44bfda;};'use strict';var Sequelize=require(_0x6791('0x0'));module[_0x6791('0x1')]={'field':{'type':Sequelize[_0x6791('0x2')]},'alias':{'type':Sequelize[_0x6791('0x3')]},'function':{'type':Sequelize[_0x6791('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6791('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6791('0x3')]},'custom':{'type':Sequelize[_0x6791('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 10ae69c..a0d9f95 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 _0x8a96=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL','AnalyticFieldReport','includeAll','include','findAll','catch','show','keys','rawAttributes','options','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel'];(function(_0x1f7af5,_0x25a19c){var _0xf8075d=function(_0x2bba6a){while(--_0x2bba6a){_0x1f7af5['push'](_0x1f7af5['shift']());}};_0xf8075d(++_0x25a19c);}(_0x8a96,0xf3));var _0x68a9=function(_0x1e69e5,_0x31c9d7){_0x1e69e5=_0x1e69e5-0x0;var _0x54927a=_0x8a96[_0x1e69e5];return _0x54927a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68a9('0x0'));var zipdir=require(_0x68a9('0x1'));var jsonpatch=require(_0x68a9('0x2'));var rp=require(_0x68a9('0x3'));var moment=require(_0x68a9('0x4'));var BPromise=require(_0x68a9('0x5'));var Mustache=require(_0x68a9('0x6'));var util=require(_0x68a9('0x7'));var path=require(_0x68a9('0x8'));var sox=require('sox');var csv=require(_0x68a9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68a9('0xa'));var squel=require(_0x68a9('0xb'));var crypto=require(_0x68a9('0xc'));var jsforce=require(_0x68a9('0xd'));var deskjs=require(_0x68a9('0xe'));var toCsv=require(_0x68a9('0x9'));var querystring=require(_0x68a9('0xf'));var Papa=require(_0x68a9('0x10'));var Redis=require(_0x68a9('0x11'));var authService=require(_0x68a9('0x12'));var qs=require(_0x68a9('0x13'));var as=require(_0x68a9('0x14'));var hardwareService=require(_0x68a9('0x15'));var logger=require('../../config/logger')(_0x68a9('0x16'));var utils=require(_0x68a9('0x17'));var config=require(_0x68a9('0x18'));var licenseUtil=require(_0x68a9('0x19'));var db=require(_0x68a9('0x1a'))['db'];function respondWithStatusCode(_0x3e5c9e,_0x45607b){_0x45607b=_0x45607b||0xcc;return function(_0x106d4c){if(_0x106d4c){return _0x3e5c9e['sendStatus'](_0x45607b);}return _0x3e5c9e['status'](_0x45607b)[_0x68a9('0x1b')]();};}function respondWithResult(_0x2b9053,_0x199f20){_0x199f20=_0x199f20||0xc8;return function(_0x5b3957){if(_0x5b3957){return _0x2b9053[_0x68a9('0x1c')](_0x199f20)[_0x68a9('0x1d')](_0x5b3957);}};}function respondWithFilteredResult(_0x1b7a6b,_0x1eee90){return function(_0x41e1a8){if(_0x41e1a8){var _0x42c713=typeof _0x1eee90['offset']===_0x68a9('0x1e')&&typeof _0x1eee90[_0x68a9('0x1f')]===_0x68a9('0x1e');var _0x1f9c0c=_0x41e1a8['count'];var _0x1d69d9=_0x42c713?0x0:_0x1eee90[_0x68a9('0x20')];var _0x1b9055=_0x42c713?_0x41e1a8[_0x68a9('0x21')]:_0x1eee90[_0x68a9('0x20')]+_0x1eee90[_0x68a9('0x1f')];var _0x4b6b41;if(_0x1b9055>=_0x1f9c0c){_0x1b9055=_0x1f9c0c;_0x4b6b41=0xc8;}else{_0x4b6b41=0xce;}_0x1b7a6b[_0x68a9('0x1c')](_0x4b6b41);return _0x1b7a6b[_0x68a9('0x22')]('Content-Range',_0x1d69d9+'-'+_0x1b9055+'/'+_0x1f9c0c)[_0x68a9('0x1d')](_0x41e1a8);}return null;};}function patchUpdates(_0x142e49){return function(_0x13da15){try{jsonpatch[_0x68a9('0x23')](_0x13da15,_0x142e49,!![]);}catch(_0x208048){return BPromise[_0x68a9('0x24')](_0x208048);}return _0x13da15[_0x68a9('0x25')]();};}function saveUpdates(_0x4c8101,_0x55afc3){return function(_0x1ed71c){if(_0x1ed71c){return _0x1ed71c[_0x68a9('0x26')](_0x4c8101)[_0x68a9('0x27')](function(_0x5a5b39){return _0x5a5b39;});}return null;};}function removeEntity(_0x16f2e0,_0x4e8b1f){return function(_0x3fab80){if(_0x3fab80){return _0x3fab80[_0x68a9('0x28')]()['then'](function(){_0x16f2e0[_0x68a9('0x1c')](0xcc)[_0x68a9('0x1b')]();});}};}function handleEntityNotFound(_0x55db51,_0xcd18ad){return function(_0x52c382){if(!_0x52c382){_0x55db51[_0x68a9('0x29')](0x194);}return _0x52c382;};}function handleError(_0x1d7485,_0x423f61){_0x423f61=_0x423f61||0x1f4;return function(_0x2d3b8e){logger['error'](_0x2d3b8e[_0x68a9('0x2a')]);if(_0x2d3b8e[_0x68a9('0x2b')]){delete _0x2d3b8e[_0x68a9('0x2b')];}_0x1d7485['status'](_0x423f61)[_0x68a9('0x2c')](_0x2d3b8e);};}exports['index']=function(_0x458cab,_0x122fe6){var _0x82569d={},_0x4d144f={},_0x561245={'count':0x0,'rows':[]};var _0x52c7c1=_[_0x68a9('0x2d')](db['AnalyticFieldReport']['rawAttributes'],function(_0x3d6ece){return{'name':_0x3d6ece[_0x68a9('0x2e')],'type':_0x3d6ece[_0x68a9('0x2f')][_0x68a9('0x30')]};});_0x4d144f[_0x68a9('0x31')]=_[_0x68a9('0x2d')](_0x52c7c1,'name');_0x4d144f[_0x68a9('0x32')]=_['keys'](_0x458cab[_0x68a9('0x32')]);_0x4d144f['filters']=_[_0x68a9('0x33')](_0x4d144f['model'],_0x4d144f[_0x68a9('0x32')]);_0x82569d[_0x68a9('0x34')]=_[_0x68a9('0x33')](_0x4d144f[_0x68a9('0x31')],qs[_0x68a9('0x35')](_0x458cab[_0x68a9('0x32')][_0x68a9('0x35')]));_0x82569d[_0x68a9('0x34')]=_0x82569d[_0x68a9('0x34')][_0x68a9('0x36')]?_0x82569d[_0x68a9('0x34')]:_0x4d144f[_0x68a9('0x31')];if(!_0x458cab['query'][_0x68a9('0x37')](_0x68a9('0x38'))){_0x82569d[_0x68a9('0x1f')]=qs['limit'](_0x458cab[_0x68a9('0x32')][_0x68a9('0x1f')]);_0x82569d[_0x68a9('0x20')]=qs['offset'](_0x458cab[_0x68a9('0x32')][_0x68a9('0x20')]);}_0x82569d['order']=qs[_0x68a9('0x39')](_0x458cab[_0x68a9('0x32')][_0x68a9('0x39')]);_0x82569d['where']=qs['filters'](_[_0x68a9('0x3a')](_0x458cab[_0x68a9('0x32')],_0x4d144f[_0x68a9('0x3b')]),_0x52c7c1);if(_0x458cab[_0x68a9('0x32')][_0x68a9('0x3c')]){_0x82569d[_0x68a9('0x3d')]=_[_0x68a9('0x3e')](_0x82569d[_0x68a9('0x3d')],{'$or':_[_0x68a9('0x2d')](_0x52c7c1,function(_0x1629cd){if(_0x1629cd['type']!==_0x68a9('0x3f')){var _0x2082fd={};_0x2082fd[_0x1629cd['name']]={'$like':'%'+_0x458cab[_0x68a9('0x32')][_0x68a9('0x3c')]+'%'};return _0x2082fd;}})});}_0x82569d=_['merge']({},_0x82569d,_0x458cab['options']);var _0x3751a3={'where':_0x82569d[_0x68a9('0x3d')]};return db[_0x68a9('0x40')][_0x68a9('0x21')](_0x3751a3)[_0x68a9('0x27')](function(_0x5b74aa){_0x561245[_0x68a9('0x21')]=_0x5b74aa;if(_0x458cab[_0x68a9('0x32')][_0x68a9('0x41')]){_0x82569d[_0x68a9('0x42')]=[{'all':!![]}];}return db[_0x68a9('0x40')][_0x68a9('0x43')](_0x82569d);})['then'](function(_0x7605b7){_0x561245['rows']=_0x7605b7;return _0x561245;})['then'](respondWithFilteredResult(_0x122fe6,_0x82569d))[_0x68a9('0x44')](handleError(_0x122fe6,null));};exports[_0x68a9('0x45')]=function(_0x253b18,_0x5eceb2){var _0x2423b7={'raw':![],'where':{'id':_0x253b18['params']['id']}},_0x37118f={};_0x37118f['model']=_[_0x68a9('0x46')](db[_0x68a9('0x40')][_0x68a9('0x47')]);_0x37118f[_0x68a9('0x32')]=_[_0x68a9('0x46')](_0x253b18[_0x68a9('0x32')]);_0x37118f['filters']=_[_0x68a9('0x33')](_0x37118f[_0x68a9('0x31')],_0x37118f[_0x68a9('0x32')]);_0x2423b7[_0x68a9('0x34')]=_[_0x68a9('0x33')](_0x37118f['model'],qs[_0x68a9('0x35')](_0x253b18[_0x68a9('0x32')]['fields']));_0x2423b7['attributes']=_0x2423b7[_0x68a9('0x34')][_0x68a9('0x36')]?_0x2423b7['attributes']:_0x37118f[_0x68a9('0x31')];if(_0x253b18[_0x68a9('0x32')][_0x68a9('0x41')]){_0x2423b7[_0x68a9('0x42')]=[{'all':!![]}];}_0x2423b7=_[_0x68a9('0x3e')]({},_0x2423b7,_0x253b18[_0x68a9('0x48')]);return db[_0x68a9('0x40')][_0x68a9('0x49')](_0x2423b7)[_0x68a9('0x27')](handleEntityNotFound(_0x5eceb2,null))['then'](respondWithResult(_0x5eceb2,null))[_0x68a9('0x44')](handleError(_0x5eceb2,null));};exports[_0x68a9('0x4a')]=function(_0x53b6b4,_0x3fe8df){return db['AnalyticFieldReport'][_0x68a9('0x4a')](_0x53b6b4[_0x68a9('0x4b')],{})['then'](respondWithResult(_0x3fe8df,0xc9))[_0x68a9('0x44')](handleError(_0x3fe8df,null));};exports[_0x68a9('0x4c')]=function(_0x2ebc74,_0x262d87){return db['AnalyticFieldReport'][_0x68a9('0x4c')](_0x2ebc74[_0x68a9('0x4b')],{'raw':![],'individualHooks':!![]})[_0x68a9('0x27')](respondWithResult(_0x262d87,0xc9))['catch'](handleError(_0x262d87,null));};exports[_0x68a9('0x26')]=function(_0x5b6706,_0x16f5f4){if(_0x5b6706['body']['id']){delete _0x5b6706[_0x68a9('0x4b')]['id'];}return db[_0x68a9('0x40')][_0x68a9('0x49')]({'where':{'id':_0x5b6706[_0x68a9('0x4d')]['id']}})[_0x68a9('0x27')](handleEntityNotFound(_0x16f5f4,null))['then'](saveUpdates(_0x5b6706[_0x68a9('0x4b')],null))[_0x68a9('0x27')](respondWithResult(_0x16f5f4,null))[_0x68a9('0x44')](handleError(_0x16f5f4,null));};exports[_0x68a9('0x28')]=function(_0xc51376,_0x35ad07){return db[_0x68a9('0x40')][_0x68a9('0x49')]({'where':{'id':_0xc51376[_0x68a9('0x4d')]['id']}})[_0x68a9('0x27')](handleEntityNotFound(_0x35ad07,null))['then'](removeEntity(_0x35ad07,null))[_0x68a9('0x44')](handleError(_0x35ad07,null));};exports[_0x68a9('0x4e')]=function(_0x1f3fe5,_0x217314){return db['AnalyticFieldReport'][_0x68a9('0x28')]({'where':{'id':_0x1f3fe5['query'][_0x68a9('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x68a9('0x27')](respondWithResult(_0x217314,0xcc))[_0x68a9('0x44')](handleError(_0x217314,null));};exports[_0x68a9('0x50')]=function(_0x3797ca,_0xc86f72,_0x553e52){return db[_0x68a9('0x51')][_0x68a9('0x52')]({'where':{'id':_0x3797ca[_0x68a9('0x4d')]['id']}})[_0x68a9('0x27')](handleEntityNotFound(_0xc86f72,null))[_0x68a9('0x27')](function(_0x585def){if(_0x585def){return db[_0x68a9('0x53')]['transaction'](function(_0x469d8c){return db[_0x68a9('0x40')][_0x68a9('0x28')]({'where':{'CustomReportId':_0x3797ca[_0x68a9('0x4d')]['id']},'transaction':_0x469d8c})[_0x68a9('0x27')](function(_0x3e1e83){var _0x4022e4=_[_0x68a9('0x2d')](_0x3797ca[_0x68a9('0x4b')],function(_0x208d98){delete _0x208d98['id'];_0x208d98[_0x68a9('0x54')]=_0x3797ca[_0x68a9('0x4d')]['id'];return _0x208d98;});return db['AnalyticFieldReport'][_0x68a9('0x4c')](_0x4022e4,{'transaction':_0x469d8c});});})['then'](function(){return db[_0x68a9('0x40')][_0x68a9('0x43')]({'where':{'CustomReportId':_0x3797ca[_0x68a9('0x4d')]['id']}});});}})[_0x68a9('0x27')](respondWithResult(_0xc86f72,null))[_0x68a9('0x44')](handleError(_0xc86f72,null));};
\ No newline at end of file
+var _0x4623=['filter','merge','options','includeAll','rows','catch','params','find','create','body','bulkCreate','update','destroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','map','AnalyticFieldReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4623,0x13f));var _0x3462=function(_0x792e6b,_0x1949c4){_0x792e6b=_0x792e6b-0x0;var _0x1627c2=_0x4623[_0x792e6b];return _0x1627c2;};'use strict';var emlformat=require(_0x3462('0x0'));var rimraf=require(_0x3462('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3462('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3462('0x3'));var path=require(_0x3462('0x4'));var sox=require(_0x3462('0x5'));var csv=require(_0x3462('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3462('0x7'));var squel=require('squel');var crypto=require(_0x3462('0x8'));var jsforce=require(_0x3462('0x9'));var deskjs=require(_0x3462('0xa'));var toCsv=require(_0x3462('0x6'));var querystring=require('querystring');var Papa=require(_0x3462('0xb'));var Redis=require(_0x3462('0xc'));var authService=require(_0x3462('0xd'));var qs=require(_0x3462('0xe'));var as=require(_0x3462('0xf'));var hardwareService=require(_0x3462('0x10'));var logger=require(_0x3462('0x11'))(_0x3462('0x12'));var utils=require(_0x3462('0x13'));var config=require(_0x3462('0x14'));var licenseUtil=require(_0x3462('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a0e9e,_0x1757fc){_0x1757fc=_0x1757fc||0xcc;return function(_0x175fe6){if(_0x175fe6){return _0x4a0e9e['sendStatus'](_0x1757fc);}return _0x4a0e9e['status'](_0x1757fc)[_0x3462('0x16')]();};}function respondWithResult(_0x2a3bce,_0x2b43af){_0x2b43af=_0x2b43af||0xc8;return function(_0x17003a){if(_0x17003a){return _0x2a3bce[_0x3462('0x17')](_0x2b43af)['json'](_0x17003a);}};}function respondWithFilteredResult(_0x6033db,_0x36b016){return function(_0x4cb59c){if(_0x4cb59c){var _0x10d51a=typeof _0x36b016[_0x3462('0x18')]===_0x3462('0x19')&&typeof _0x36b016[_0x3462('0x1a')]===_0x3462('0x19');var _0x127117=_0x4cb59c['count'];var _0x3a3d03=_0x10d51a?0x0:_0x36b016[_0x3462('0x18')];var _0x4b42de=_0x10d51a?_0x4cb59c[_0x3462('0x1b')]:_0x36b016[_0x3462('0x18')]+_0x36b016[_0x3462('0x1a')];var _0x2849ce;if(_0x4b42de>=_0x127117){_0x4b42de=_0x127117;_0x2849ce=0xc8;}else{_0x2849ce=0xce;}_0x6033db[_0x3462('0x17')](_0x2849ce);return _0x6033db[_0x3462('0x1c')](_0x3462('0x1d'),_0x3a3d03+'-'+_0x4b42de+'/'+_0x127117)[_0x3462('0x1e')](_0x4cb59c);}return null;};}function patchUpdates(_0x4e9776){return function(_0x18084a){try{jsonpatch[_0x3462('0x1f')](_0x18084a,_0x4e9776,!![]);}catch(_0x40d686){return BPromise[_0x3462('0x20')](_0x40d686);}return _0x18084a[_0x3462('0x21')]();};}function saveUpdates(_0x549547,_0x318593){return function(_0x410583){if(_0x410583){return _0x410583['update'](_0x549547)[_0x3462('0x22')](function(_0x819f6b){return _0x819f6b;});}return null;};}function removeEntity(_0x113212,_0x357957){return function(_0x2aacce){if(_0x2aacce){return _0x2aacce['destroy']()['then'](function(){_0x113212[_0x3462('0x17')](0xcc)[_0x3462('0x16')]();});}};}function handleEntityNotFound(_0x32b8bf,_0x4927be){return function(_0x7fca8c){if(!_0x7fca8c){_0x32b8bf[_0x3462('0x23')](0x194);}return _0x7fca8c;};}function handleError(_0x3c2fad,_0x4ac4d0){_0x4ac4d0=_0x4ac4d0||0x1f4;return function(_0x5c842c){logger[_0x3462('0x24')](_0x5c842c[_0x3462('0x25')]);if(_0x5c842c['name']){delete _0x5c842c[_0x3462('0x26')];}_0x3c2fad[_0x3462('0x17')](_0x4ac4d0)['send'](_0x5c842c);};}exports['index']=function(_0x4615e7,_0x877e3a){var _0x20b0e8={},_0x155ac8={},_0x4a5b61={'count':0x0,'rows':[]};var _0x41898f=_[_0x3462('0x27')](db[_0x3462('0x28')][_0x3462('0x29')],function(_0x36c017){return{'name':_0x36c017['fieldName'],'type':_0x36c017[_0x3462('0x2a')]['key']};});_0x155ac8[_0x3462('0x2b')]=_[_0x3462('0x27')](_0x41898f,_0x3462('0x26'));_0x155ac8[_0x3462('0x2c')]=_[_0x3462('0x2d')](_0x4615e7[_0x3462('0x2c')]);_0x155ac8[_0x3462('0x2e')]=_[_0x3462('0x2f')](_0x155ac8[_0x3462('0x2b')],_0x155ac8[_0x3462('0x2c')]);_0x20b0e8[_0x3462('0x30')]=_['intersection'](_0x155ac8[_0x3462('0x2b')],qs[_0x3462('0x31')](_0x4615e7[_0x3462('0x2c')][_0x3462('0x31')]));_0x20b0e8[_0x3462('0x30')]=_0x20b0e8[_0x3462('0x30')][_0x3462('0x32')]?_0x20b0e8['attributes']:_0x155ac8[_0x3462('0x2b')];if(!_0x4615e7[_0x3462('0x2c')][_0x3462('0x33')]('nolimit')){_0x20b0e8[_0x3462('0x1a')]=qs[_0x3462('0x1a')](_0x4615e7[_0x3462('0x2c')][_0x3462('0x1a')]);_0x20b0e8[_0x3462('0x18')]=qs[_0x3462('0x18')](_0x4615e7[_0x3462('0x2c')][_0x3462('0x18')]);}_0x20b0e8[_0x3462('0x34')]=qs[_0x3462('0x35')](_0x4615e7[_0x3462('0x2c')]['sort']);_0x20b0e8[_0x3462('0x36')]=qs[_0x3462('0x2e')](_[_0x3462('0x37')](_0x4615e7[_0x3462('0x2c')],_0x155ac8[_0x3462('0x2e')]),_0x41898f);if(_0x4615e7['query'][_0x3462('0x38')]){_0x20b0e8[_0x3462('0x36')]=_[_0x3462('0x39')](_0x20b0e8[_0x3462('0x36')],{'$or':_['map'](_0x41898f,function(_0x29852e){if(_0x29852e['type']!=='VIRTUAL'){var _0x958790={};_0x958790[_0x29852e[_0x3462('0x26')]]={'$like':'%'+_0x4615e7['query'][_0x3462('0x38')]+'%'};return _0x958790;}})});}_0x20b0e8=_[_0x3462('0x39')]({},_0x20b0e8,_0x4615e7[_0x3462('0x3a')]);var _0x3fbec5={'where':_0x20b0e8[_0x3462('0x36')]};return db[_0x3462('0x28')]['count'](_0x3fbec5)[_0x3462('0x22')](function(_0x33cc9e){_0x4a5b61[_0x3462('0x1b')]=_0x33cc9e;if(_0x4615e7[_0x3462('0x2c')][_0x3462('0x3b')]){_0x20b0e8['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x20b0e8);})[_0x3462('0x22')](function(_0x2b1e0b){_0x4a5b61[_0x3462('0x3c')]=_0x2b1e0b;return _0x4a5b61;})['then'](respondWithFilteredResult(_0x877e3a,_0x20b0e8))[_0x3462('0x3d')](handleError(_0x877e3a,null));};exports['show']=function(_0x18df4f,_0x4443e6){var _0x3881f7={'raw':![],'where':{'id':_0x18df4f[_0x3462('0x3e')]['id']}},_0x53ec62={};_0x53ec62[_0x3462('0x2b')]=_['keys'](db[_0x3462('0x28')][_0x3462('0x29')]);_0x53ec62[_0x3462('0x2c')]=_[_0x3462('0x2d')](_0x18df4f[_0x3462('0x2c')]);_0x53ec62[_0x3462('0x2e')]=_[_0x3462('0x2f')](_0x53ec62[_0x3462('0x2b')],_0x53ec62[_0x3462('0x2c')]);_0x3881f7['attributes']=_[_0x3462('0x2f')](_0x53ec62[_0x3462('0x2b')],qs[_0x3462('0x31')](_0x18df4f['query'][_0x3462('0x31')]));_0x3881f7[_0x3462('0x30')]=_0x3881f7[_0x3462('0x30')][_0x3462('0x32')]?_0x3881f7[_0x3462('0x30')]:_0x53ec62[_0x3462('0x2b')];if(_0x18df4f['query'][_0x3462('0x3b')]){_0x3881f7['include']=[{'all':!![]}];}_0x3881f7=_['merge']({},_0x3881f7,_0x18df4f[_0x3462('0x3a')]);return db[_0x3462('0x28')][_0x3462('0x3f')](_0x3881f7)[_0x3462('0x22')](handleEntityNotFound(_0x4443e6,null))[_0x3462('0x22')](respondWithResult(_0x4443e6,null))[_0x3462('0x3d')](handleError(_0x4443e6,null));};exports[_0x3462('0x40')]=function(_0x195862,_0x1e7b00){return db['AnalyticFieldReport'][_0x3462('0x40')](_0x195862[_0x3462('0x41')],{})[_0x3462('0x22')](respondWithResult(_0x1e7b00,0xc9))[_0x3462('0x3d')](handleError(_0x1e7b00,null));};exports['bulkCreate']=function(_0x1e7bdb,_0x3a6cfd){return db['AnalyticFieldReport'][_0x3462('0x42')](_0x1e7bdb[_0x3462('0x41')],{'raw':![],'individualHooks':!![]})[_0x3462('0x22')](respondWithResult(_0x3a6cfd,0xc9))[_0x3462('0x3d')](handleError(_0x3a6cfd,null));};exports[_0x3462('0x43')]=function(_0x5ba4ec,_0x1bea44){if(_0x5ba4ec[_0x3462('0x41')]['id']){delete _0x5ba4ec['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x5ba4ec['params']['id']}})['then'](handleEntityNotFound(_0x1bea44,null))[_0x3462('0x22')](saveUpdates(_0x5ba4ec[_0x3462('0x41')],null))[_0x3462('0x22')](respondWithResult(_0x1bea44,null))['catch'](handleError(_0x1bea44,null));};exports[_0x3462('0x44')]=function(_0x5ac289,_0x3028db){return db['AnalyticFieldReport']['find']({'where':{'id':_0x5ac289[_0x3462('0x3e')]['id']}})[_0x3462('0x22')](handleEntityNotFound(_0x3028db,null))['then'](removeEntity(_0x3028db,null))[_0x3462('0x3d')](handleError(_0x3028db,null));};exports['bulkDestroy']=function(_0x493eee,_0xd5dbd5){return db[_0x3462('0x28')][_0x3462('0x44')]({'where':{'id':_0x493eee[_0x3462('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3462('0x22')](respondWithResult(_0xd5dbd5,0xcc))['catch'](handleError(_0xd5dbd5,null));};exports[_0x3462('0x45')]=function(_0x3f3584,_0x1e12ca,_0x3e9f86){return db[_0x3462('0x46')][_0x3462('0x47')]({'where':{'id':_0x3f3584[_0x3462('0x3e')]['id']}})[_0x3462('0x22')](handleEntityNotFound(_0x1e12ca,null))[_0x3462('0x22')](function(_0x24c01a){if(_0x24c01a){return db[_0x3462('0x48')][_0x3462('0x49')](function(_0x3d5b8b){return db[_0x3462('0x28')][_0x3462('0x44')]({'where':{'CustomReportId':_0x3f3584[_0x3462('0x3e')]['id']},'transaction':_0x3d5b8b})[_0x3462('0x22')](function(_0x5bcfe4){var _0x541316=_['map'](_0x3f3584[_0x3462('0x41')],function(_0x8d5ea6){delete _0x8d5ea6['id'];_0x8d5ea6[_0x3462('0x4a')]=_0x3f3584[_0x3462('0x3e')]['id'];return _0x8d5ea6;});return db['AnalyticFieldReport'][_0x3462('0x42')](_0x541316,{'transaction':_0x3d5b8b});});})['then'](function(){return db[_0x3462('0x28')]['findAll']({'where':{'CustomReportId':_0x3f3584[_0x3462('0x3e')]['id']}});});}})[_0x3462('0x22')](respondWithResult(_0x1e12ca,null))[_0x3462('0x3d')](handleError(_0x1e12ca,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6e8ca2f..7dbfacb 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 _0xe4e9=['path','../../config/environment','./analyticFieldReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1d1f0f,_0x2392c3){var _0xbf9076=function(_0x4e61b0){while(--_0x4e61b0){_0x1d1f0f['push'](_0x1d1f0f['shift']());}};_0xbf9076(++_0x2392c3);}(_0xe4e9,0xc0));var _0x9e4e=function(_0x4e5e7e,_0x12013b){_0x4e5e7e=_0x4e5e7e-0x0;var _0x1daff0=_0xe4e9[_0x4e5e7e];return _0x1daff0;};'use strict';var _=require(_0x9e4e('0x0'));var util=require(_0x9e4e('0x1'));var logger=require(_0x9e4e('0x2'))(_0x9e4e('0x3'));var moment=require(_0x9e4e('0x4'));var BPromise=require(_0x9e4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e4e('0x6'));var rimraf=require('rimraf');var config=require(_0x9e4e('0x7'));var attributes=require(_0x9e4e('0x8'));module[_0x9e4e('0x9')]=function(_0x59c34e,_0x482ad1){return _0x59c34e[_0x9e4e('0xa')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc70f=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3441e2,_0x57b820){var _0x1a129b=function(_0x4864bb){while(--_0x4864bb){_0x3441e2['push'](_0x3441e2['shift']());}};_0x1a129b(++_0x57b820);}(_0xc70f,0x1d3));var _0xfc70=function(_0x227576,_0x13ac66){_0x227576=_0x227576-0x0;var _0x1fbfae=_0xc70f[_0x227576];return _0x1fbfae;};'use strict';var _=require(_0xfc70('0x0'));var util=require('util');var logger=require(_0xfc70('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfc70('0x2'));var rp=require(_0xfc70('0x3'));var fs=require('fs');var path=require(_0xfc70('0x4'));var rimraf=require(_0xfc70('0x5'));var config=require(_0xfc70('0x6'));var attributes=require(_0xfc70('0x7'));module[_0xfc70('0x8')]=function(_0x6ac643,_0x219d97){return _0x6ac643[_0xfc70('0x9')](_0xfc70('0xa'),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 413ca6a..8a3446f 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 _0x5aa9=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x4505b8,_0x4ac0d7){var _0x4b3368=function(_0x2fd5cf){while(--_0x2fd5cf){_0x4505b8['push'](_0x4505b8['shift']());}};_0x4b3368(++_0x4ac0d7);}(_0x5aa9,0xcc));var _0x95aa=function(_0x3a6d7d,_0x5e5c87){_0x3a6d7d=_0x3a6d7d-0x0;var _0x22c3d4=_0x5aa9[_0x3a6d7d];return _0x22c3d4;};'use strict';var _=require(_0x95aa('0x0'));var util=require(_0x95aa('0x1'));var moment=require(_0x95aa('0x2'));var BPromise=require(_0x95aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95aa('0x4'));var db=require(_0x95aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95aa('0x6'))('rpc');var config=require(_0x95aa('0x7'));var jayson=require(_0x95aa('0x8'));var client=jayson[_0x95aa('0x9')][_0x95aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44e0a9,_0x587e58,_0x194a87){return new BPromise(function(_0x5eca8d,_0x46e18c){return client['request'](_0x44e0a9,_0x194a87)[_0x95aa('0xb')](function(_0x42dda1){logger[_0x95aa('0xc')](_0x95aa('0xd'),_0x587e58,'request\x20sent');logger[_0x95aa('0xe')](_0x95aa('0xf'),_0x587e58,'request\x20sent',JSON[_0x95aa('0x10')](_0x42dda1));if(_0x42dda1['error']){if(_0x42dda1[_0x95aa('0x11')]['code']===0x1f4){logger[_0x95aa('0x11')](_0x95aa('0xd'),_0x587e58,_0x42dda1['error'][_0x95aa('0x12')]);return _0x46e18c(_0x42dda1['error']['message']);}logger[_0x95aa('0x11')](_0x95aa('0xd'),_0x587e58,_0x42dda1[_0x95aa('0x11')][_0x95aa('0x12')]);return _0x5eca8d(_0x42dda1[_0x95aa('0x11')][_0x95aa('0x12')]);}else{logger[_0x95aa('0xc')](_0x95aa('0xd'),_0x587e58,'request\x20sent');_0x5eca8d(_0x42dda1['result']['message']);}})[_0x95aa('0x13')](function(_0x3738dc){logger[_0x95aa('0x11')](_0x95aa('0xd'),_0x587e58,_0x3738dc);_0x46e18c(_0x3738dc);});});}
\ No newline at end of file
+var _0x976f=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x296030,_0x7159dd){var _0x2d7da7=function(_0x203744){while(--_0x203744){_0x296030['push'](_0x296030['shift']());}};_0x2d7da7(++_0x7159dd);}(_0x976f,0x14a));var _0xf976=function(_0x8bbe95,_0x407d05){_0x8bbe95=_0x8bbe95-0x0;var _0x587734=_0x976f[_0x8bbe95];return _0x587734;};'use strict';var _=require(_0xf976('0x0'));var util=require(_0xf976('0x1'));var moment=require(_0xf976('0x2'));var BPromise=require(_0xf976('0x3'));var rs=require(_0xf976('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf976('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf976('0x6'))(_0xf976('0x7'));var config=require('../../config/environment');var jayson=require(_0xf976('0x8'));var client=jayson[_0xf976('0x9')][_0xf976('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x357498,_0x20f2a2,_0x5aad06){return new BPromise(function(_0x476640,_0x348c99){return client[_0xf976('0xb')](_0x357498,_0x5aad06)[_0xf976('0xc')](function(_0x2c1d49){logger[_0xf976('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20f2a2,_0xf976('0xe'));logger[_0xf976('0xf')](_0xf976('0x10'),_0x20f2a2,_0xf976('0xe'),JSON[_0xf976('0x11')](_0x2c1d49));if(_0x2c1d49[_0xf976('0x12')]){if(_0x2c1d49[_0xf976('0x12')][_0xf976('0x13')]===0x1f4){logger[_0xf976('0x12')](_0xf976('0x14'),_0x20f2a2,_0x2c1d49['error'][_0xf976('0x15')]);return _0x348c99(_0x2c1d49[_0xf976('0x12')][_0xf976('0x15')]);}logger[_0xf976('0x12')](_0xf976('0x14'),_0x20f2a2,_0x2c1d49[_0xf976('0x12')][_0xf976('0x15')]);return _0x476640(_0x2c1d49[_0xf976('0x12')][_0xf976('0x15')]);}else{logger[_0xf976('0xd')](_0xf976('0x14'),_0x20f2a2,_0xf976('0xe'));_0x476640(_0x2c1d49[_0xf976('0x16')][_0xf976('0x15')]);}})[_0xf976('0x17')](function(_0x194317){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x20f2a2,_0x194317);_0x348c99(_0x194317);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0857fb5..ca9036a 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(_0x3443a5,_0x461820){var _0x244e62=function(_0x1f81d1){while(--_0x1f81d1){_0x3443a5['push'](_0x3443a5['shift']());}};_0x244e62(++_0x461820);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x47029e,_0x275210){var _0x137b88=function(_0x533f06){while(--_0x533f06){_0x47029e['push'](_0x47029e['shift']());}};_0x137b88(++_0x275210);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 8c0f270..fd13814 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 _0xffda=['sequelize','exports','STRING','name','TEXT'];(function(_0x363887,_0x4f5e81){var _0x3dbf=function(_0x35a9b2){while(--_0x35a9b2){_0x363887['push'](_0x363887['shift']());}};_0x3dbf(++_0x4f5e81);}(_0xffda,0x73));var _0xaffd=function(_0x4519d3,_0x31164e){_0x4519d3=_0x4519d3-0x0;var _0x37aa91=_0xffda[_0x4519d3];return _0x37aa91;};'use strict';var Sequelize=require(_0xaffd('0x0'));module[_0xaffd('0x1')]={'name':{'type':Sequelize[_0xaffd('0x2')],'allowNull':![],'unique':_0xaffd('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xaffd('0x4')]},'description':{'type':Sequelize[_0xaffd('0x2')]}};
\ No newline at end of file
+var _0xb9a7=['exports','TEXT'];(function(_0x4ac6e0,_0x44425d){var _0x283b36=function(_0x4d09ff){while(--_0x4d09ff){_0x4ac6e0['push'](_0x4ac6e0['shift']());}};_0x283b36(++_0x44425d);}(_0xb9a7,0x112));var _0x7b9a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb9a7[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7b9a('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 183de4f..ef24ba3 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x13028a,_0x53710e){var _0x392245=function(_0x46792f){while(--_0x46792f){_0x13028a['push'](_0x13028a['shift']());}};_0x392245(++_0x53710e);}(_0xe14b,0x93));var _0xbe14=function(_0x31b368,_0xa3c65e){_0x31b368=_0x31b368-0x0;var _0x4b2c51=_0xe14b[_0x31b368];return _0x4b2c51;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x3e8ecf,_0x3bb3eb){var _0x42826a=function(_0x48677e){while(--_0x48677e){_0x3e8ecf['push'](_0x3e8ecf['shift']());}};_0x42826a(++_0x3bb3eb);}(_0x9a19,0x114));var _0x99a1=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x9a19[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 6b6c69d..3a9148f 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 _0x6822=['path','rimraf','./analyticMetric.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x35b55e,_0x1b6650){var _0x2b91d5=function(_0xb89afa){while(--_0xb89afa){_0x35b55e['push'](_0x35b55e['shift']());}};_0x2b91d5(++_0x1b6650);}(_0x6822,0xca));var _0x2682=function(_0x84c4fb,_0x403cb1){_0x84c4fb=_0x84c4fb-0x0;var _0x2bd119=_0x6822[_0x84c4fb];return _0x2bd119;};'use strict';var _=require(_0x2682('0x0'));var util=require(_0x2682('0x1'));var logger=require(_0x2682('0x2'))(_0x2682('0x3'));var moment=require(_0x2682('0x4'));var BPromise=require(_0x2682('0x5'));var rp=require(_0x2682('0x6'));var fs=require('fs');var path=require(_0x2682('0x7'));var rimraf=require(_0x2682('0x8'));var config=require('../../config/environment');var attributes=require(_0x2682('0x9'));module['exports']=function(_0x30fcd9,_0x39d4f7){return _0x30fcd9[_0x2682('0xa')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d59=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x6f62c1,_0x42bec0){var _0x3ac066=function(_0x730d90){while(--_0x730d90){_0x6f62c1['push'](_0x6f62c1['shift']());}};_0x3ac066(++_0x42bec0);}(_0x5d59,0x15f));var _0x95d5=function(_0x5681e5,_0x4a17a4){_0x5681e5=_0x5681e5-0x0;var _0x5c343a=_0x5d59[_0x5681e5];return _0x5c343a;};'use strict';var _=require('lodash');var util=require(_0x95d5('0x0'));var logger=require(_0x95d5('0x1'))(_0x95d5('0x2'));var moment=require(_0x95d5('0x3'));var BPromise=require(_0x95d5('0x4'));var rp=require(_0x95d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95d5('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x95d5('0x7')]=function(_0x4a733e,_0x4b4e5f){return _0x4a733e[_0x95d5('0x8')](_0x95d5('0x9'),attributes,{'tableName':_0x95d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index a78580c..ab55fed 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 _0x0280=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring'];(function(_0x2a5392,_0x402775){var _0xf419c4=function(_0x2bb2bb){while(--_0x2bb2bb){_0x2a5392['push'](_0x2a5392['shift']());}};_0xf419c4(++_0x402775);}(_0x0280,0x163));var _0x0028=function(_0x3f460a,_0x5761a3){_0x3f460a=_0x3f460a-0x0;var _0x360ca7=_0x0280[_0x3f460a];return _0x360ca7;};'use strict';var _=require(_0x0028('0x0'));var util=require(_0x0028('0x1'));var moment=require(_0x0028('0x2'));var BPromise=require(_0x0028('0x3'));var rs=require(_0x0028('0x4'));var fs=require('fs');var Redis=require(_0x0028('0x5'));var db=require(_0x0028('0x6'))['db'];var utils=require(_0x0028('0x7'));var logger=require(_0x0028('0x8'))(_0x0028('0x9'));var config=require(_0x0028('0xa'));var jayson=require(_0x0028('0xb'));var client=jayson[_0x0028('0xc')][_0x0028('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40b021,_0x4b81c2,_0x255ebd){return new BPromise(function(_0x173358,_0x297d90){return client[_0x0028('0xe')](_0x40b021,_0x255ebd)[_0x0028('0xf')](function(_0x2df8e7){logger[_0x0028('0x10')](_0x0028('0x11'),_0x4b81c2,_0x0028('0x12'));logger[_0x0028('0x13')](_0x0028('0x14'),_0x4b81c2,'request\x20sent',JSON[_0x0028('0x15')](_0x2df8e7));if(_0x2df8e7[_0x0028('0x16')]){if(_0x2df8e7['error']['code']===0x1f4){logger['error'](_0x0028('0x11'),_0x4b81c2,_0x2df8e7[_0x0028('0x16')][_0x0028('0x17')]);return _0x297d90(_0x2df8e7[_0x0028('0x16')][_0x0028('0x17')]);}logger[_0x0028('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x4b81c2,_0x2df8e7[_0x0028('0x16')][_0x0028('0x17')]);return _0x173358(_0x2df8e7['error'][_0x0028('0x17')]);}else{logger[_0x0028('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4b81c2,_0x0028('0x12'));_0x173358(_0x2df8e7['result'][_0x0028('0x17')]);}})['catch'](function(_0x10e01b){logger[_0x0028('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x4b81c2,_0x10e01b);_0x297d90(_0x10e01b);});});}
\ No newline at end of file
+var _0x15ed=['rpc','../../config/environment','jayson/promise','request','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x151527,_0x2a6a1f){var _0x23687c=function(_0x312331){while(--_0x312331){_0x151527['push'](_0x151527['shift']());}};_0x23687c(++_0x2a6a1f);}(_0x15ed,0x172));var _0xd15e=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x15ed[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require('lodash');var util=require(_0xd15e('0x0'));var moment=require(_0xd15e('0x1'));var BPromise=require(_0xd15e('0x2'));var rs=require(_0xd15e('0x3'));var fs=require('fs');var Redis=require(_0xd15e('0x4'));var db=require(_0xd15e('0x5'))['db'];var utils=require(_0xd15e('0x6'));var logger=require(_0xd15e('0x7'))(_0xd15e('0x8'));var config=require(_0xd15e('0x9'));var jayson=require(_0xd15e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c57a4,_0x56422e,_0x50bd2f){return new BPromise(function(_0x49a6fc,_0x49305a){return client[_0xd15e('0xb')](_0x1c57a4,_0x50bd2f)['then'](function(_0x4a741a){logger['info'](_0xd15e('0xc'),_0x56422e,_0xd15e('0xd'));logger['debug'](_0xd15e('0xe'),_0x56422e,_0xd15e('0xd'),JSON['stringify'](_0x4a741a));if(_0x4a741a[_0xd15e('0xf')]){if(_0x4a741a[_0xd15e('0xf')][_0xd15e('0x10')]===0x1f4){logger[_0xd15e('0xf')](_0xd15e('0xc'),_0x56422e,_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);return _0x49305a(_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);}logger[_0xd15e('0xf')](_0xd15e('0xc'),_0x56422e,_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);return _0x49a6fc(_0x4a741a[_0xd15e('0xf')][_0xd15e('0x11')]);}else{logger[_0xd15e('0x12')](_0xd15e('0xc'),_0x56422e,'request\x20sent');_0x49a6fc(_0x4a741a[_0xd15e('0x13')][_0xd15e('0x11')]);}})[_0xd15e('0x14')](function(_0x980779){logger['error'](_0xd15e('0xc'),_0x56422e,_0x980779);_0x49305a(_0x980779);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index ae55db5..69fe309 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 _0x21d1=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x21d1,0x1c9));var _0x121d=function(_0xe36b59,_0x1b444a){_0xe36b59=_0xe36b59-0x0;var _0x4e0cf1=_0x21d1[_0xe36b59];return _0x4e0cf1;};'use strict';var multer=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var path=require(_0x121d('0x2'));var timeout=require(_0x121d('0x3'));var express=require(_0x121d('0x4'));var router=express[_0x121d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var controller=require(_0x121d('0x8'));router[_0x121d('0x9')]('/',auth[_0x121d('0xa')](),controller['index']);router[_0x121d('0x9')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0xc')]);router[_0x121d('0xd')]('/',auth[_0x121d('0xa')](),controller[_0x121d('0xe')]);router[_0x121d('0xf')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller['update']);router[_0x121d('0x10')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf603=['isAuthenticated','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf603,0x124));var _0x3f60=function(_0x2936ae,_0x45287a){_0x2936ae=_0x2936ae-0x0;var _0x38c6df=_0xf603[_0x2936ae];return _0x38c6df;};'use strict';var multer=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var path=require('path');var timeout=require(_0x3f60('0x2'));var express=require(_0x3f60('0x3'));var router=express[_0x3f60('0x4')]();var fs_extra=require(_0x3f60('0x5'));var auth=require(_0x3f60('0x6'));var interaction=require(_0x3f60('0x7'));var config=require(_0x3f60('0x8'));var controller=require(_0x3f60('0x9'));router[_0x3f60('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3f60('0xb'),auth[_0x3f60('0xc')](),controller[_0x3f60('0xd')]);router[_0x3f60('0xe')]('/',auth[_0x3f60('0xc')](),controller[_0x3f60('0xf')]);router[_0x3f60('0x10')](_0x3f60('0xb'),auth[_0x3f60('0xc')](),controller[_0x3f60('0x11')]);router[_0x3f60('0x12')](_0x3f60('0xb'),auth[_0x3f60('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a9ea711..47fd8c8 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 _0x6549=['TEXT','sequelize','exports'];(function(_0x17c3fd,_0x5412e1){var _0x42d639=function(_0x4a2b3b){while(--_0x4a2b3b){_0x17c3fd['push'](_0x17c3fd['shift']());}};_0x42d639(++_0x5412e1);}(_0x6549,0xb5));var _0x9654=function(_0x40c88f,_0x160997){_0x40c88f=_0x40c88f-0x0;var _0x343443=_0x6549[_0x40c88f];return _0x343443;};'use strict';var Sequelize=require(_0x9654('0x0'));module[_0x9654('0x1')]={'tree':{'type':Sequelize[_0x9654('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x238d=['exports','TEXT'];(function(_0x208213,_0x330f26){var _0x2fe677=function(_0xccc12c){while(--_0xccc12c){_0x208213['push'](_0x208213['shift']());}};_0x2fe677(++_0x330f26);}(_0x238d,0xba));var _0xd238=function(_0x5a6519,_0x4c13e9){_0x5a6519=_0x5a6519-0x0;var _0x51e08e=_0x238d[_0x5a6519];return _0x51e08e;};'use strict';var Sequelize=require('sequelize');module[_0xd238('0x0')]={'tree':{'type':Sequelize[_0xd238('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 3cb1c59..3b2fbb6 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 _0x62ee=['set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','filter','merge','options','includeAll','catch','show','params','include','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count'];(function(_0x51eac4,_0x5d541f){var _0x33f9b3=function(_0x506a61){while(--_0x506a61){_0x51eac4['push'](_0x51eac4['shift']());}};_0x33f9b3(++_0x5d541f);}(_0x62ee,0x153));var _0xe62e=function(_0x3ab7ed,_0x428bb8){_0x3ab7ed=_0x3ab7ed-0x0;var _0x5dbad0=_0x62ee[_0x3ab7ed];return _0x5dbad0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe62e('0x0'));var zipdir=require(_0xe62e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe62e('0x2'));var moment=require(_0xe62e('0x3'));var BPromise=require(_0xe62e('0x4'));var Mustache=require('mustache');var util=require(_0xe62e('0x5'));var path=require(_0xe62e('0x6'));var sox=require(_0xe62e('0x7'));var csv=require(_0xe62e('0x8'));var ejs=require(_0xe62e('0x9'));var fs=require('fs');var fs_extra=require(_0xe62e('0xa'));var _=require('lodash');var squel=require(_0xe62e('0xb'));var crypto=require(_0xe62e('0xc'));var jsforce=require(_0xe62e('0xd'));var deskjs=require(_0xe62e('0xe'));var toCsv=require(_0xe62e('0x8'));var querystring=require(_0xe62e('0xf'));var Papa=require(_0xe62e('0x10'));var Redis=require(_0xe62e('0x11'));var authService=require(_0xe62e('0x12'));var qs=require(_0xe62e('0x13'));var as=require(_0xe62e('0x14'));var hardwareService=require(_0xe62e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe62e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe62e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e56fe,_0x5c4144){_0x5c4144=_0x5c4144||0xcc;return function(_0x2978a0){if(_0x2978a0){return _0x2e56fe['sendStatus'](_0x5c4144);}return _0x2e56fe['status'](_0x5c4144)[_0xe62e('0x18')]();};}function respondWithResult(_0x16a414,_0x2f7332){_0x2f7332=_0x2f7332||0xc8;return function(_0x7eab1c){if(_0x7eab1c){return _0x16a414[_0xe62e('0x19')](_0x2f7332)[_0xe62e('0x1a')](_0x7eab1c);}};}function respondWithFilteredResult(_0x2a724a,_0x10150b){return function(_0x59d405){if(_0x59d405){var _0x3233ec=typeof _0x10150b[_0xe62e('0x1b')]===_0xe62e('0x1c')&&typeof _0x10150b[_0xe62e('0x1d')]===_0xe62e('0x1c');var _0x5efec1=_0x59d405[_0xe62e('0x1e')];var _0x28146a=_0x3233ec?0x0:_0x10150b[_0xe62e('0x1b')];var _0x5e674b=_0x3233ec?_0x59d405[_0xe62e('0x1e')]:_0x10150b[_0xe62e('0x1b')]+_0x10150b['limit'];var _0x14cf38;if(_0x5e674b>=_0x5efec1){_0x5e674b=_0x5efec1;_0x14cf38=0xc8;}else{_0x14cf38=0xce;}_0x2a724a['status'](_0x14cf38);return _0x2a724a[_0xe62e('0x1f')](_0xe62e('0x20'),_0x28146a+'-'+_0x5e674b+'/'+_0x5efec1)[_0xe62e('0x1a')](_0x59d405);}return null;};}function patchUpdates(_0x3ca7e1){return function(_0x44f8eb){try{jsonpatch[_0xe62e('0x21')](_0x44f8eb,_0x3ca7e1,!![]);}catch(_0x388fe0){return BPromise[_0xe62e('0x22')](_0x388fe0);}return _0x44f8eb[_0xe62e('0x23')]();};}function saveUpdates(_0x560f25,_0x73f5ec){return function(_0xd3826d){if(_0xd3826d){return _0xd3826d[_0xe62e('0x24')](_0x560f25)['then'](function(_0x35ba66){return _0x35ba66;});}return null;};}function removeEntity(_0x7fb1e4,_0x16456a){return function(_0x17b26d){if(_0x17b26d){return _0x17b26d[_0xe62e('0x25')]()[_0xe62e('0x26')](function(){_0x7fb1e4[_0xe62e('0x19')](0xcc)[_0xe62e('0x18')]();});}};}function handleEntityNotFound(_0x22cd91,_0x57ee78){return function(_0x25eb2f){if(!_0x25eb2f){_0x22cd91['sendStatus'](0x194);}return _0x25eb2f;};}function handleError(_0x543d3a,_0x3122b3){_0x3122b3=_0x3122b3||0x1f4;return function(_0x496da6){logger[_0xe62e('0x27')](_0x496da6[_0xe62e('0x28')]);if(_0x496da6[_0xe62e('0x29')]){delete _0x496da6[_0xe62e('0x29')];}_0x543d3a[_0xe62e('0x19')](_0x3122b3)[_0xe62e('0x2a')](_0x496da6);};}exports['index']=function(_0x384b2a,_0x583e58){var _0x555773={},_0x108d56={},_0x25bf0f={'count':0x0,'rows':[]};var _0xec4476=_['map'](db[_0xe62e('0x2b')][_0xe62e('0x2c')],function(_0x4b214c){return{'name':_0x4b214c[_0xe62e('0x2d')],'type':_0x4b214c[_0xe62e('0x2e')][_0xe62e('0x2f')]};});_0x108d56[_0xe62e('0x30')]=_[_0xe62e('0x31')](_0xec4476,_0xe62e('0x29'));_0x108d56[_0xe62e('0x32')]=_[_0xe62e('0x33')](_0x384b2a[_0xe62e('0x32')]);_0x108d56['filters']=_[_0xe62e('0x34')](_0x108d56[_0xe62e('0x30')],_0x108d56[_0xe62e('0x32')]);_0x555773[_0xe62e('0x35')]=_['intersection'](_0x108d56[_0xe62e('0x30')],qs['fields'](_0x384b2a[_0xe62e('0x32')][_0xe62e('0x36')]));_0x555773[_0xe62e('0x35')]=_0x555773['attributes'][_0xe62e('0x37')]?_0x555773['attributes']:_0x108d56[_0xe62e('0x30')];if(!_0x384b2a[_0xe62e('0x32')][_0xe62e('0x38')](_0xe62e('0x39'))){_0x555773[_0xe62e('0x1d')]=qs[_0xe62e('0x1d')](_0x384b2a[_0xe62e('0x32')][_0xe62e('0x1d')]);_0x555773['offset']=qs['offset'](_0x384b2a[_0xe62e('0x32')]['offset']);}_0x555773[_0xe62e('0x3a')]=qs[_0xe62e('0x3b')](_0x384b2a[_0xe62e('0x32')]['sort']);_0x555773['where']=qs[_0xe62e('0x3c')](_[_0xe62e('0x3d')](_0x384b2a[_0xe62e('0x32')],_0x108d56['filters']),_0xec4476);if(_0x384b2a['query']['filter']){_0x555773['where']=_['merge'](_0x555773[_0xe62e('0x3e')],{'$or':_[_0xe62e('0x31')](_0xec4476,function(_0x32018d){if(_0x32018d[_0xe62e('0x2e')]!=='VIRTUAL'){var _0x141c65={};_0x141c65[_0x32018d[_0xe62e('0x29')]]={'$like':'%'+_0x384b2a[_0xe62e('0x32')][_0xe62e('0x3f')]+'%'};return _0x141c65;}})});}_0x555773=_[_0xe62e('0x40')]({},_0x555773,_0x384b2a[_0xe62e('0x41')]);var _0x47e407={'where':_0x555773[_0xe62e('0x3e')]};return db[_0xe62e('0x2b')]['count'](_0x47e407)['then'](function(_0x7fd317){_0x25bf0f[_0xe62e('0x1e')]=_0x7fd317;if(_0x384b2a[_0xe62e('0x32')][_0xe62e('0x42')]){_0x555773['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x555773);})['then'](function(_0x101d41){_0x25bf0f['rows']=_0x101d41;return _0x25bf0f;})[_0xe62e('0x26')](respondWithFilteredResult(_0x583e58,_0x555773))[_0xe62e('0x43')](handleError(_0x583e58,null));};exports[_0xe62e('0x44')]=function(_0x1e9a2b,_0x46dfde){var _0x2a7956={'raw':!![],'where':{'id':_0x1e9a2b[_0xe62e('0x45')]['id']}},_0x26a3f0={};_0x26a3f0[_0xe62e('0x30')]=_[_0xe62e('0x33')](db[_0xe62e('0x2b')][_0xe62e('0x2c')]);_0x26a3f0[_0xe62e('0x32')]=_[_0xe62e('0x33')](_0x1e9a2b['query']);_0x26a3f0[_0xe62e('0x3c')]=_['intersection'](_0x26a3f0[_0xe62e('0x30')],_0x26a3f0[_0xe62e('0x32')]);_0x2a7956[_0xe62e('0x35')]=_[_0xe62e('0x34')](_0x26a3f0[_0xe62e('0x30')],qs[_0xe62e('0x36')](_0x1e9a2b[_0xe62e('0x32')][_0xe62e('0x36')]));_0x2a7956[_0xe62e('0x35')]=_0x2a7956[_0xe62e('0x35')][_0xe62e('0x37')]?_0x2a7956['attributes']:_0x26a3f0[_0xe62e('0x30')];if(_0x1e9a2b[_0xe62e('0x32')][_0xe62e('0x42')]){_0x2a7956[_0xe62e('0x46')]=[{'all':!![]}];}_0x2a7956=_[_0xe62e('0x40')]({},_0x2a7956,_0x1e9a2b[_0xe62e('0x41')]);return db[_0xe62e('0x2b')][_0xe62e('0x47')](_0x2a7956)[_0xe62e('0x26')](handleEntityNotFound(_0x46dfde,null))[_0xe62e('0x26')](respondWithResult(_0x46dfde,null))[_0xe62e('0x43')](handleError(_0x46dfde,null));};exports[_0xe62e('0x48')]=function(_0x4b260b,_0x174d64){return db['AnalyticTreeReport'][_0xe62e('0x48')](_0x4b260b[_0xe62e('0x49')],{})[_0xe62e('0x26')](respondWithResult(_0x174d64,0xc9))[_0xe62e('0x43')](handleError(_0x174d64,null));};exports[_0xe62e('0x24')]=function(_0x1d1490,_0x3dcf5a){if(_0x1d1490[_0xe62e('0x49')]['id']){delete _0x1d1490[_0xe62e('0x49')]['id'];}return db['AnalyticTreeReport'][_0xe62e('0x47')]({'where':{'id':_0x1d1490['params']['id']}})[_0xe62e('0x26')](handleEntityNotFound(_0x3dcf5a,null))['then'](saveUpdates(_0x1d1490[_0xe62e('0x49')],null))[_0xe62e('0x26')](respondWithResult(_0x3dcf5a,null))[_0xe62e('0x43')](handleError(_0x3dcf5a,null));};exports['destroy']=function(_0x3f6904,_0xbeaa6e){return db[_0xe62e('0x2b')][_0xe62e('0x47')]({'where':{'id':_0x3f6904[_0xe62e('0x45')]['id']}})[_0xe62e('0x26')](handleEntityNotFound(_0xbeaa6e,null))[_0xe62e('0x26')](removeEntity(_0xbeaa6e,null))[_0xe62e('0x43')](handleError(_0xbeaa6e,null));};
\ No newline at end of file
+var _0x8d4b=['rawAttributes','type','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','index','map'];(function(_0x4d57e2,_0x36403){var _0x33136c=function(_0x1a917f){while(--_0x1a917f){_0x4d57e2['push'](_0x4d57e2['shift']());}};_0x33136c(++_0x36403);}(_0x8d4b,0x17a));var _0xb8d4=function(_0x480e91,_0x15c065){_0x480e91=_0x480e91-0x0;var _0x272813=_0x8d4b[_0x480e91];return _0x272813;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb8d4('0x0'));var zipdir=require(_0xb8d4('0x1'));var jsonpatch=require(_0xb8d4('0x2'));var rp=require(_0xb8d4('0x3'));var moment=require('moment');var BPromise=require(_0xb8d4('0x4'));var Mustache=require(_0xb8d4('0x5'));var util=require(_0xb8d4('0x6'));var path=require(_0xb8d4('0x7'));var sox=require(_0xb8d4('0x8'));var csv=require(_0xb8d4('0x9'));var ejs=require(_0xb8d4('0xa'));var fs=require('fs');var fs_extra=require(_0xb8d4('0xb'));var _=require(_0xb8d4('0xc'));var squel=require('squel');var crypto=require(_0xb8d4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8d4('0x9'));var querystring=require(_0xb8d4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb8d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8d4('0x10'));var as=require(_0xb8d4('0x11'));var hardwareService=require(_0xb8d4('0x12'));var logger=require('../../config/logger')(_0xb8d4('0x13'));var utils=require(_0xb8d4('0x14'));var config=require(_0xb8d4('0x15'));var licenseUtil=require(_0xb8d4('0x16'));var db=require(_0xb8d4('0x17'))['db'];function respondWithStatusCode(_0x337133,_0x32a065){_0x32a065=_0x32a065||0xcc;return function(_0x296bc1){if(_0x296bc1){return _0x337133['sendStatus'](_0x32a065);}return _0x337133['status'](_0x32a065)[_0xb8d4('0x18')]();};}function respondWithResult(_0x4655bf,_0x34e60c){_0x34e60c=_0x34e60c||0xc8;return function(_0x56e657){if(_0x56e657){return _0x4655bf[_0xb8d4('0x19')](_0x34e60c)[_0xb8d4('0x1a')](_0x56e657);}};}function respondWithFilteredResult(_0x5407d3,_0x5470b4){return function(_0x455822){if(_0x455822){var _0x2c4993=typeof _0x5470b4[_0xb8d4('0x1b')]===_0xb8d4('0x1c')&&typeof _0x5470b4['limit']===_0xb8d4('0x1c');var _0x5f553f=_0x455822[_0xb8d4('0x1d')];var _0xe40f44=_0x2c4993?0x0:_0x5470b4[_0xb8d4('0x1b')];var _0x1ef818=_0x2c4993?_0x455822[_0xb8d4('0x1d')]:_0x5470b4[_0xb8d4('0x1b')]+_0x5470b4['limit'];var _0x214629;if(_0x1ef818>=_0x5f553f){_0x1ef818=_0x5f553f;_0x214629=0xc8;}else{_0x214629=0xce;}_0x5407d3[_0xb8d4('0x19')](_0x214629);return _0x5407d3[_0xb8d4('0x1e')](_0xb8d4('0x1f'),_0xe40f44+'-'+_0x1ef818+'/'+_0x5f553f)[_0xb8d4('0x1a')](_0x455822);}return null;};}function patchUpdates(_0x144109){return function(_0x5a235a){try{jsonpatch[_0xb8d4('0x20')](_0x5a235a,_0x144109,!![]);}catch(_0x1c5a8b){return BPromise[_0xb8d4('0x21')](_0x1c5a8b);}return _0x5a235a[_0xb8d4('0x22')]();};}function saveUpdates(_0x17ed75,_0x5e8906){return function(_0x415b4a){if(_0x415b4a){return _0x415b4a[_0xb8d4('0x23')](_0x17ed75)[_0xb8d4('0x24')](function(_0x2051c9){return _0x2051c9;});}return null;};}function removeEntity(_0x8ba3c4,_0x487b39){return function(_0x17e9c9){if(_0x17e9c9){return _0x17e9c9[_0xb8d4('0x25')]()[_0xb8d4('0x24')](function(){_0x8ba3c4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x142541,_0x18bb1d){return function(_0x3b2f0e){if(!_0x3b2f0e){_0x142541[_0xb8d4('0x26')](0x194);}return _0x3b2f0e;};}function handleError(_0x5a7ce0,_0xd239f9){_0xd239f9=_0xd239f9||0x1f4;return function(_0x341226){logger['error'](_0x341226['stack']);if(_0x341226[_0xb8d4('0x27')]){delete _0x341226[_0xb8d4('0x27')];}_0x5a7ce0[_0xb8d4('0x19')](_0xd239f9)['send'](_0x341226);};}exports[_0xb8d4('0x28')]=function(_0xcf6c79,_0x3ad797){var _0x550960={},_0x5df0f0={},_0x40b10b={'count':0x0,'rows':[]};var _0x20b699=_[_0xb8d4('0x29')](db['AnalyticTreeReport'][_0xb8d4('0x2a')],function(_0x302b09){return{'name':_0x302b09['fieldName'],'type':_0x302b09[_0xb8d4('0x2b')]['key']};});_0x5df0f0['model']=_[_0xb8d4('0x29')](_0x20b699,'name');_0x5df0f0[_0xb8d4('0x2c')]=_[_0xb8d4('0x2d')](_0xcf6c79['query']);_0x5df0f0[_0xb8d4('0x2e')]=_[_0xb8d4('0x2f')](_0x5df0f0[_0xb8d4('0x30')],_0x5df0f0[_0xb8d4('0x2c')]);_0x550960['attributes']=_[_0xb8d4('0x2f')](_0x5df0f0[_0xb8d4('0x30')],qs[_0xb8d4('0x31')](_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x31')]));_0x550960['attributes']=_0x550960['attributes'][_0xb8d4('0x32')]?_0x550960[_0xb8d4('0x33')]:_0x5df0f0['model'];if(!_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x34')](_0xb8d4('0x35'))){_0x550960[_0xb8d4('0x36')]=qs[_0xb8d4('0x36')](_0xcf6c79['query'][_0xb8d4('0x36')]);_0x550960['offset']=qs[_0xb8d4('0x1b')](_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x1b')]);}_0x550960[_0xb8d4('0x37')]=qs['sort'](_0xcf6c79[_0xb8d4('0x2c')][_0xb8d4('0x38')]);_0x550960[_0xb8d4('0x39')]=qs[_0xb8d4('0x2e')](_[_0xb8d4('0x3a')](_0xcf6c79[_0xb8d4('0x2c')],_0x5df0f0[_0xb8d4('0x2e')]),_0x20b699);if(_0xcf6c79[_0xb8d4('0x2c')]['filter']){_0x550960[_0xb8d4('0x39')]=_['merge'](_0x550960[_0xb8d4('0x39')],{'$or':_['map'](_0x20b699,function(_0x54b2eb){if(_0x54b2eb[_0xb8d4('0x2b')]!=='VIRTUAL'){var _0x5ca648={};_0x5ca648[_0x54b2eb[_0xb8d4('0x27')]]={'$like':'%'+_0xcf6c79[_0xb8d4('0x2c')]['filter']+'%'};return _0x5ca648;}})});}_0x550960=_[_0xb8d4('0x3b')]({},_0x550960,_0xcf6c79[_0xb8d4('0x3c')]);var _0x2437e4={'where':_0x550960[_0xb8d4('0x39')]};return db[_0xb8d4('0x3d')][_0xb8d4('0x1d')](_0x2437e4)['then'](function(_0x20b0bd){_0x40b10b['count']=_0x20b0bd;if(_0xcf6c79['query'][_0xb8d4('0x3e')]){_0x550960['include']=[{'all':!![]}];}return db[_0xb8d4('0x3d')][_0xb8d4('0x3f')](_0x550960);})[_0xb8d4('0x24')](function(_0x365976){_0x40b10b[_0xb8d4('0x40')]=_0x365976;return _0x40b10b;})['then'](respondWithFilteredResult(_0x3ad797,_0x550960))[_0xb8d4('0x41')](handleError(_0x3ad797,null));};exports['show']=function(_0x56d790,_0x2bdd4c){var _0x35b273={'raw':!![],'where':{'id':_0x56d790[_0xb8d4('0x42')]['id']}},_0x5f305e={};_0x5f305e[_0xb8d4('0x30')]=_[_0xb8d4('0x2d')](db[_0xb8d4('0x3d')][_0xb8d4('0x2a')]);_0x5f305e['query']=_[_0xb8d4('0x2d')](_0x56d790[_0xb8d4('0x2c')]);_0x5f305e[_0xb8d4('0x2e')]=_['intersection'](_0x5f305e[_0xb8d4('0x30')],_0x5f305e[_0xb8d4('0x2c')]);_0x35b273[_0xb8d4('0x33')]=_['intersection'](_0x5f305e[_0xb8d4('0x30')],qs[_0xb8d4('0x31')](_0x56d790['query'][_0xb8d4('0x31')]));_0x35b273['attributes']=_0x35b273[_0xb8d4('0x33')]['length']?_0x35b273['attributes']:_0x5f305e[_0xb8d4('0x30')];if(_0x56d790[_0xb8d4('0x2c')][_0xb8d4('0x3e')]){_0x35b273['include']=[{'all':!![]}];}_0x35b273=_[_0xb8d4('0x3b')]({},_0x35b273,_0x56d790['options']);return db[_0xb8d4('0x3d')][_0xb8d4('0x43')](_0x35b273)[_0xb8d4('0x24')](handleEntityNotFound(_0x2bdd4c,null))[_0xb8d4('0x24')](respondWithResult(_0x2bdd4c,null))[_0xb8d4('0x41')](handleError(_0x2bdd4c,null));};exports[_0xb8d4('0x44')]=function(_0xd42a84,_0x37982d){return db[_0xb8d4('0x3d')]['create'](_0xd42a84[_0xb8d4('0x45')],{})[_0xb8d4('0x24')](respondWithResult(_0x37982d,0xc9))[_0xb8d4('0x41')](handleError(_0x37982d,null));};exports[_0xb8d4('0x23')]=function(_0x33a47b,_0x2f5fa7){if(_0x33a47b[_0xb8d4('0x45')]['id']){delete _0x33a47b['body']['id'];}return db[_0xb8d4('0x3d')][_0xb8d4('0x43')]({'where':{'id':_0x33a47b[_0xb8d4('0x42')]['id']}})[_0xb8d4('0x24')](handleEntityNotFound(_0x2f5fa7,null))[_0xb8d4('0x24')](saveUpdates(_0x33a47b[_0xb8d4('0x45')],null))['then'](respondWithResult(_0x2f5fa7,null))[_0xb8d4('0x41')](handleError(_0x2f5fa7,null));};exports[_0xb8d4('0x25')]=function(_0x108961,_0x5c38fb){return db['AnalyticTreeReport'][_0xb8d4('0x43')]({'where':{'id':_0x108961['params']['id']}})[_0xb8d4('0x24')](handleEntityNotFound(_0x5c38fb,null))[_0xb8d4('0x24')](removeEntity(_0x5c38fb,null))['catch'](handleError(_0x5c38fb,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 87d2ab0..059340f 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 _0x8557=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x48ba8f,_0x4698c7){var _0x1f0d89=function(_0x376f3d){while(--_0x376f3d){_0x48ba8f['push'](_0x48ba8f['shift']());}};_0x1f0d89(++_0x4698c7);}(_0x8557,0x117));var _0x7855=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x8557[_0x4695ba];return _0x524b7d;};'use strict';var _=require(_0x7855('0x0'));var util=require(_0x7855('0x1'));var logger=require('../../config/logger')(_0x7855('0x2'));var moment=require(_0x7855('0x3'));var BPromise=require(_0x7855('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7855('0x5'));var rimraf=require('rimraf');var config=require(_0x7855('0x6'));var attributes=require(_0x7855('0x7'));module[_0x7855('0x8')]=function(_0x11dcb7,_0x4014b4){return _0x11dcb7[_0x7855('0x9')](_0x7855('0xa'),attributes,{'tableName':_0x7855('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x040b=['bluebird','request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment'];(function(_0x197845,_0x5ccccc){var _0x12f6b7=function(_0x444f0a){while(--_0x444f0a){_0x197845['push'](_0x197845['shift']());}};_0x12f6b7(++_0x5ccccc);}(_0x040b,0xa4));var _0xb040=function(_0x3858b8,_0x566519){_0x3858b8=_0x3858b8-0x0;var _0x32ae8e=_0x040b[_0x3858b8];return _0x32ae8e;};'use strict';var _=require('lodash');var util=require(_0xb040('0x0'));var logger=require(_0xb040('0x1'))(_0xb040('0x2'));var moment=require(_0xb040('0x3'));var BPromise=require(_0xb040('0x4'));var rp=require(_0xb040('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb040('0x6'));var config=require('../../config/environment');var attributes=require(_0xb040('0x7'));module[_0xb040('0x8')]=function(_0xf9b76b,_0x361125){return _0xf9b76b[_0xb040('0x9')](_0xb040('0xa'),attributes,{'tableName':_0xb040('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index ecaedd3..679939c 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3ea392,_0x59d098){var _0x160ddf=function(_0x24664a){while(--_0x24664a){_0x3ea392['push'](_0x3ea392['shift']());}};_0x160ddf(++_0x59d098);}(_0xadb5,0xad));var _0x5adb=function(_0x2fc204,_0x1babd7){_0x2fc204=_0x2fc204-0x0;var _0x28d5ae=_0xadb5[_0x2fc204];return _0x28d5ae;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1fde84,_0x453e74){var _0x4d5b74=function(_0x4c8833){while(--_0x4c8833){_0x1fde84['push'](_0x1fde84['shift']());}};_0x4d5b74(++_0x453e74);}(_0xdb28,0x106));var _0x8db2=function(_0x8fab9a,_0x2c0282){_0x8fab9a=_0x8fab9a-0x0;var _0x435da4=_0xdb28[_0x8fab9a];return _0x435da4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 6ee1749..170b489 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 _0x65c6=['fs-extra','../../config/environment','get','isAuthenticated','show','post','create','put','update','delete','/:id','exports','multer','util','path','express'];(function(_0x19746a,_0x5edf80){var _0x559c8f=function(_0x629fec){while(--_0x629fec){_0x19746a['push'](_0x19746a['shift']());}};_0x559c8f(++_0x5edf80);}(_0x65c6,0x6c));var _0x665c=function(_0x477a43,_0x33885f){_0x477a43=_0x477a43-0x0;var _0x43b61e=_0x65c6[_0x477a43];return _0x43b61e;};'use strict';var multer=require(_0x665c('0x0'));var util=require(_0x665c('0x1'));var path=require(_0x665c('0x2'));var timeout=require('connect-timeout');var express=require(_0x665c('0x3'));var router=express['Router']();var fs_extra=require(_0x665c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x665c('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x665c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x665c('0x6')]('/:id',auth[_0x665c('0x7')](),controller[_0x665c('0x8')]);router[_0x665c('0x9')]('/',auth['isAuthenticated'](),controller[_0x665c('0xa')]);router[_0x665c('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x665c('0xc')]);router[_0x665c('0xd')](_0x665c('0xe'),auth[_0x665c('0x7')](),controller['destroy']);module[_0x665c('0xf')]=router;
\ No newline at end of file
+var _0xd92a=['put','delete','destroy','exports','multer','connect-timeout','../../components/interaction/service','get','isAuthenticated','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd92a,0x1bc));var _0xad92=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd92a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xad92('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad92('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad92('0x2'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xad92('0x3')]('/',auth[_0xad92('0x4')](),controller['index']);router[_0xad92('0x3')](_0xad92('0x5'),auth['isAuthenticated'](),controller[_0xad92('0x6')]);router['post']('/',auth[_0xad92('0x4')](),controller['create']);router[_0xad92('0x7')](_0xad92('0x5'),auth[_0xad92('0x4')](),controller['update']);router[_0xad92('0x8')](_0xad92('0x5'),auth[_0xad92('0x4')](),controller[_0xad92('0x9')]);module[_0xad92('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 595350d..ba822d4 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 _0x8db0=['exports','STRING','sequelize'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0x8db0,0x65));var _0x08db=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x8db0[_0x6ca7f4];return _0x494fa6;};'use strict';var Sequelize=require(_0x08db('0x0'));module[_0x08db('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x08db('0x2')]},'type':{'type':Sequelize[_0x08db('0x2')]}};
\ No newline at end of file
+var _0xcab6=['sequelize','STRING'];(function(_0x52b67b,_0x126ce8){var _0x314fd1=function(_0x58b8cb){while(--_0x58b8cb){_0x52b67b['push'](_0x52b67b['shift']());}};_0x314fd1(++_0x126ce8);}(_0xcab6,0xd4));var _0x6cab=function(_0x2eb72e,_0x4ac410){_0x2eb72e=_0x2eb72e-0x0;var _0x298ddd=_0xcab6[_0x2eb72e];return _0x298ddd;};'use strict';var Sequelize=require(_0x6cab('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cab('0x1')]},'basename':{'type':Sequelize[_0x6cab('0x1')]},'type':{'type':Sequelize[_0x6cab('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1a7387d..6884d40 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 _0xf436=['attributes','fields','length','nolimit','order','sort','filter','VIRTUAL','options','where','count','findAll','rows','catch','show','params','includeAll','include','merge','get','omit','updatedAt','body','createdAt','create','find','file','basename','filename','download','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','update','then','destroy','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x4f7588,_0x399e6b){var _0x535c70=function(_0x5c2bbb){while(--_0x5c2bbb){_0x4f7588['push'](_0x4f7588['shift']());}};_0x535c70(++_0x399e6b);}(_0xf436,0x177));var _0x6f43=function(_0x538b31,_0x4f2ade){_0x538b31=_0x538b31-0x0;var _0x16b8cd=_0xf436[_0x538b31];return _0x16b8cd;};'use strict';var emlformat=require(_0x6f43('0x0'));var rimraf=require(_0x6f43('0x1'));var zipdir=require(_0x6f43('0x2'));var jsonpatch=require(_0x6f43('0x3'));var rp=require(_0x6f43('0x4'));var moment=require('moment');var BPromise=require(_0x6f43('0x5'));var Mustache=require(_0x6f43('0x6'));var util=require('util');var path=require(_0x6f43('0x7'));var sox=require(_0x6f43('0x8'));var csv=require('to-csv');var ejs=require(_0x6f43('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f43('0xa'));var squel=require(_0x6f43('0xb'));var crypto=require(_0x6f43('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6f43('0xd'));var toCsv=require(_0x6f43('0xe'));var querystring=require('querystring');var Papa=require(_0x6f43('0xf'));var Redis=require(_0x6f43('0x10'));var authService=require(_0x6f43('0x11'));var qs=require(_0x6f43('0x12'));var as=require(_0x6f43('0x13'));var hardwareService=require(_0x6f43('0x14'));var logger=require(_0x6f43('0x15'))(_0x6f43('0x16'));var utils=require('../../config/utils');var config=require(_0x6f43('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d51eb,_0x5b82ca){_0x5b82ca=_0x5b82ca||0xcc;return function(_0x517f8f){if(_0x517f8f){return _0x1d51eb[_0x6f43('0x18')](_0x5b82ca);}return _0x1d51eb[_0x6f43('0x19')](_0x5b82ca)[_0x6f43('0x1a')]();};}function respondWithResult(_0x40e7d1,_0xce253b){_0xce253b=_0xce253b||0xc8;return function(_0x298df6){if(_0x298df6){return _0x40e7d1[_0x6f43('0x19')](_0xce253b)['json'](_0x298df6);}};}function respondWithFilteredResult(_0x380322,_0x1365b3){return function(_0x50aacc){if(_0x50aacc){var _0xf64d70=typeof _0x1365b3[_0x6f43('0x1b')]===_0x6f43('0x1c')&&typeof _0x1365b3[_0x6f43('0x1d')]==='undefined';var _0x42821c=_0x50aacc['count'];var _0x4ee6a6=_0xf64d70?0x0:_0x1365b3['offset'];var _0x4ca017=_0xf64d70?_0x50aacc['count']:_0x1365b3[_0x6f43('0x1b')]+_0x1365b3[_0x6f43('0x1d')];var _0x42d67b;if(_0x4ca017>=_0x42821c){_0x4ca017=_0x42821c;_0x42d67b=0xc8;}else{_0x42d67b=0xce;}_0x380322['status'](_0x42d67b);return _0x380322['set'](_0x6f43('0x1e'),_0x4ee6a6+'-'+_0x4ca017+'/'+_0x42821c)['json'](_0x50aacc);}return null;};}function patchUpdates(_0x37daf4){return function(_0x33b198){try{jsonpatch[_0x6f43('0x1f')](_0x33b198,_0x37daf4,!![]);}catch(_0xa45661){return BPromise['reject'](_0xa45661);}return _0x33b198['save']();};}function saveUpdates(_0x1baa3b,_0x416f0e){return function(_0x57837f){if(_0x57837f){return _0x57837f[_0x6f43('0x20')](_0x1baa3b)[_0x6f43('0x21')](function(_0x2673db){return _0x2673db;});}return null;};}function removeEntity(_0x268af7,_0x24fd2e){return function(_0x1edbd8){if(_0x1edbd8){return _0x1edbd8[_0x6f43('0x22')]()[_0x6f43('0x21')](function(){_0x268af7['status'](0xcc)[_0x6f43('0x1a')]();});}};}function handleEntityNotFound(_0x1a977a,_0x41b95e){return function(_0x5f4ec2){if(!_0x5f4ec2){_0x1a977a[_0x6f43('0x18')](0x194);}return _0x5f4ec2;};}function handleError(_0x598abb,_0x3c11ff){_0x3c11ff=_0x3c11ff||0x1f4;return function(_0x52441a){logger['error'](_0x52441a[_0x6f43('0x23')]);if(_0x52441a[_0x6f43('0x24')]){delete _0x52441a['name'];}_0x598abb[_0x6f43('0x19')](_0x3c11ff)[_0x6f43('0x25')](_0x52441a);};}exports[_0x6f43('0x26')]=function(_0x13ef53,_0x5bdd8a){var _0x1c76f2={},_0x490fca={},_0x548216={'count':0x0,'rows':[]};var _0x33361a=_['map'](db[_0x6f43('0x27')][_0x6f43('0x28')],function(_0x15027a){return{'name':_0x15027a[_0x6f43('0x29')],'type':_0x15027a[_0x6f43('0x2a')][_0x6f43('0x2b')]};});_0x490fca[_0x6f43('0x2c')]=_[_0x6f43('0x2d')](_0x33361a,'name');_0x490fca[_0x6f43('0x2e')]=_[_0x6f43('0x2f')](_0x13ef53[_0x6f43('0x2e')]);_0x490fca[_0x6f43('0x30')]=_[_0x6f43('0x31')](_0x490fca[_0x6f43('0x2c')],_0x490fca[_0x6f43('0x2e')]);_0x1c76f2[_0x6f43('0x32')]=_[_0x6f43('0x31')](_0x490fca[_0x6f43('0x2c')],qs[_0x6f43('0x33')](_0x13ef53[_0x6f43('0x2e')][_0x6f43('0x33')]));_0x1c76f2[_0x6f43('0x32')]=_0x1c76f2[_0x6f43('0x32')][_0x6f43('0x34')]?_0x1c76f2[_0x6f43('0x32')]:_0x490fca['model'];if(!_0x13ef53[_0x6f43('0x2e')]['hasOwnProperty'](_0x6f43('0x35'))){_0x1c76f2[_0x6f43('0x1d')]=qs[_0x6f43('0x1d')](_0x13ef53[_0x6f43('0x2e')][_0x6f43('0x1d')]);_0x1c76f2[_0x6f43('0x1b')]=qs[_0x6f43('0x1b')](_0x13ef53[_0x6f43('0x2e')][_0x6f43('0x1b')]);}_0x1c76f2[_0x6f43('0x36')]=qs[_0x6f43('0x37')](_0x13ef53[_0x6f43('0x2e')][_0x6f43('0x37')]);_0x1c76f2['where']=qs[_0x6f43('0x30')](_['pick'](_0x13ef53[_0x6f43('0x2e')],_0x490fca[_0x6f43('0x30')]),_0x33361a);if(_0x13ef53[_0x6f43('0x2e')][_0x6f43('0x38')]){_0x1c76f2['where']=_['merge'](_0x1c76f2['where'],{'$or':_[_0x6f43('0x2d')](_0x33361a,function(_0x21fb02){if(_0x21fb02[_0x6f43('0x2a')]!==_0x6f43('0x39')){var _0x12cd39={};_0x12cd39[_0x21fb02['name']]={'$like':'%'+_0x13ef53[_0x6f43('0x2e')][_0x6f43('0x38')]+'%'};return _0x12cd39;}})});}_0x1c76f2=_['merge']({},_0x1c76f2,_0x13ef53[_0x6f43('0x3a')]);var _0x195f04={'where':_0x1c76f2[_0x6f43('0x3b')]};return db[_0x6f43('0x27')][_0x6f43('0x3c')](_0x195f04)[_0x6f43('0x21')](function(_0x395c21){_0x548216[_0x6f43('0x3c')]=_0x395c21;if(_0x13ef53[_0x6f43('0x2e')]['includeAll']){_0x1c76f2['include']=[{'all':!![]}];}return db[_0x6f43('0x27')][_0x6f43('0x3d')](_0x1c76f2);})['then'](function(_0x5e37a5){_0x548216[_0x6f43('0x3e')]=_0x5e37a5;return _0x548216;})[_0x6f43('0x21')](respondWithFilteredResult(_0x5bdd8a,_0x1c76f2))[_0x6f43('0x3f')](handleError(_0x5bdd8a,null));};exports[_0x6f43('0x40')]=function(_0x2adc82,_0x55068c){var _0x514564={'raw':!![],'where':{'id':_0x2adc82[_0x6f43('0x41')]['id']}},_0x2aeff1={};_0x2aeff1['model']=_[_0x6f43('0x2f')](db[_0x6f43('0x27')][_0x6f43('0x28')]);_0x2aeff1[_0x6f43('0x2e')]=_[_0x6f43('0x2f')](_0x2adc82['query']);_0x2aeff1[_0x6f43('0x30')]=_[_0x6f43('0x31')](_0x2aeff1[_0x6f43('0x2c')],_0x2aeff1[_0x6f43('0x2e')]);_0x514564[_0x6f43('0x32')]=_[_0x6f43('0x31')](_0x2aeff1[_0x6f43('0x2c')],qs[_0x6f43('0x33')](_0x2adc82[_0x6f43('0x2e')]['fields']));_0x514564['attributes']=_0x514564['attributes'][_0x6f43('0x34')]?_0x514564[_0x6f43('0x32')]:_0x2aeff1[_0x6f43('0x2c')];if(_0x2adc82[_0x6f43('0x2e')][_0x6f43('0x42')]){_0x514564[_0x6f43('0x43')]=[{'all':!![]}];}_0x514564=_[_0x6f43('0x44')]({},_0x514564,_0x2adc82[_0x6f43('0x3a')]);return db[_0x6f43('0x27')]['find'](_0x514564)['then'](handleEntityNotFound(_0x55068c,null))['then'](respondWithResult(_0x55068c,null))[_0x6f43('0x3f')](handleError(_0x55068c,null));};exports['clone']=function(_0x3839a4,_0x35f95d){var _0x58d5b9={'where':{'id':_0x3839a4['params']['id']}},_0x552c67={};_0x552c67['model']=_[_0x6f43('0x2f')](db[_0x6f43('0x27')]['rawAttributes']);_0x58d5b9[_0x6f43('0x32')]=_[_0x6f43('0x31')](_0x552c67[_0x6f43('0x2c')],qs[_0x6f43('0x33')](_0x3839a4[_0x6f43('0x2e')]['fields']));_0x58d5b9['attributes']=_0x58d5b9['attributes'][_0x6f43('0x34')]?_0x58d5b9['attributes']:_0x552c67[_0x6f43('0x2c')];if(_0x3839a4[_0x6f43('0x2e')]['includeAll']){_0x58d5b9[_0x6f43('0x43')]=[{'all':!![]}];}_0x58d5b9=_[_0x6f43('0x44')]({},_0x58d5b9,_0x3839a4[_0x6f43('0x3a')]);return db[_0x6f43('0x27')]['find'](_0x58d5b9)[_0x6f43('0x21')](handleEntityNotFound(_0x35f95d,null))[_0x6f43('0x21')](function(_0x37040a){if(_0x37040a){var _0x5ec6f1=_0x37040a[_0x6f43('0x45')]({'plain':!![]});_0x5ec6f1=qs[_0x6f43('0x46')](_0x5ec6f1,['id','createdAt',_0x6f43('0x47')]);_0x3839a4[_0x6f43('0x48')]=_[_0x6f43('0x46')](_0x3839a4['body'],['id',_0x6f43('0x49'),_0x6f43('0x47')]);return db[_0x6f43('0x27')][_0x6f43('0x4a')](_['merge'](_0x5ec6f1,_0x3839a4['body']),{'include':_0x3839a4[_0x6f43('0x2e')][_0x6f43('0x42')]?[{'all':!![]}]:undefined});}})[_0x6f43('0x21')](respondWithResult(_0x35f95d,0xc9))[_0x6f43('0x3f')](handleError(_0x35f95d,null));};exports['update']=function(_0xc1b196,_0x1a97b4){if(_0xc1b196[_0x6f43('0x48')]['id']){delete _0xc1b196[_0x6f43('0x48')]['id'];}return db[_0x6f43('0x27')]['find']({'where':{'id':_0xc1b196[_0x6f43('0x41')]['id']}})[_0x6f43('0x21')](handleEntityNotFound(_0x1a97b4,null))[_0x6f43('0x21')](saveUpdates(_0xc1b196[_0x6f43('0x48')],null))['then'](respondWithResult(_0x1a97b4,null))[_0x6f43('0x3f')](handleError(_0x1a97b4,null));};exports[_0x6f43('0x22')]=function(_0x48cdf8,_0x5af94d){return db[_0x6f43('0x27')][_0x6f43('0x4b')]({'where':{'id':_0x48cdf8[_0x6f43('0x41')]['id']}})[_0x6f43('0x21')](handleEntityNotFound(_0x5af94d,null))[_0x6f43('0x21')](removeEntity(_0x5af94d,null))[_0x6f43('0x3f')](handleError(_0x5af94d,null));};exports['create']=function(_0x167ba2,_0xe28fe2,_0x4ea6fe){_0x167ba2[_0x6f43('0x48')][_0x6f43('0x24')]=_0x167ba2[_0x6f43('0x4c')]['originalname'];_0x167ba2[_0x6f43('0x48')][_0x6f43('0x4d')]=_0x167ba2[_0x6f43('0x4c')][_0x6f43('0x4e')];_0x167ba2[_0x6f43('0x48')][_0x6f43('0x2a')]=_0x167ba2[_0x6f43('0x4c')]['mimetype'];return db[_0x6f43('0x27')]['create'](_0x167ba2[_0x6f43('0x48')])[_0x6f43('0x21')](respondWithResult(_0xe28fe2,0xc9))['catch'](handleError(_0xe28fe2,null));};exports[_0x6f43('0x4f')]=function(_0x2a642d,_0x2459a7,_0x42f160){return db[_0x6f43('0x27')]['findOne']({'where':{'id':_0x2a642d['params']['id']},'raw':!![]})[_0x6f43('0x21')](handleEntityNotFound(_0x2459a7,null))[_0x6f43('0x21')](function(_0x4fb3b0){if(_0x4fb3b0){var _0xc41c09=_0x4fb3b0[_0x6f43('0x50')]!==null;var _0x239bad=path['join'](config[_0x6f43('0x51')],_0x6f43('0x52'));if(_0xc41c09){_0x239bad=path[_0x6f43('0x53')](_0x239bad,_0x6f43('0x54'));}var _0x3f6560=path[_0x6f43('0x53')](_0x239bad,_0x4fb3b0[_0x6f43('0x4d')]);return _0x2459a7['download'](_0x3f6560);}})['catch'](handleError(_0x2459a7,null));};
\ No newline at end of file
+var _0xcd79=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','send','Attachment','rawAttributes','fieldName','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','include','findAll','rows','show','params','length','merge','options','find','catch','includeAll','get','omit','createdAt','updatedAt','body','create','originalname','basename','filename','file','mimetype','download','findOne','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x891294,_0x3a5772){var _0x1d74de=function(_0x17b04b){while(--_0x17b04b){_0x891294['push'](_0x891294['shift']());}};_0x1d74de(++_0x3a5772);}(_0xcd79,0x15b));var _0x9cd7=function(_0x581b42,_0x3e6805){_0x581b42=_0x581b42-0x0;var _0x15197d=_0xcd79[_0x581b42];return _0x15197d;};'use strict';var emlformat=require(_0x9cd7('0x0'));var rimraf=require(_0x9cd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cd7('0x2'));var rp=require(_0x9cd7('0x3'));var moment=require(_0x9cd7('0x4'));var BPromise=require(_0x9cd7('0x5'));var Mustache=require(_0x9cd7('0x6'));var util=require(_0x9cd7('0x7'));var path=require(_0x9cd7('0x8'));var sox=require(_0x9cd7('0x9'));var csv=require(_0x9cd7('0xa'));var ejs=require(_0x9cd7('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd7('0xc'));var _=require(_0x9cd7('0xd'));var squel=require(_0x9cd7('0xe'));var crypto=require(_0x9cd7('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9cd7('0x11'));var Papa=require(_0x9cd7('0x12'));var Redis=require(_0x9cd7('0x13'));var authService=require(_0x9cd7('0x14'));var qs=require(_0x9cd7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cd7('0x16'));var logger=require('../../config/logger')(_0x9cd7('0x17'));var utils=require('../../config/utils');var config=require(_0x9cd7('0x18'));var licenseUtil=require(_0x9cd7('0x19'));var db=require(_0x9cd7('0x1a'))['db'];function respondWithStatusCode(_0x3d29a0,_0x309a2e){_0x309a2e=_0x309a2e||0xcc;return function(_0x35e1d5){if(_0x35e1d5){return _0x3d29a0[_0x9cd7('0x1b')](_0x309a2e);}return _0x3d29a0[_0x9cd7('0x1c')](_0x309a2e)['end']();};}function respondWithResult(_0x33c78d,_0x3bf5ac){_0x3bf5ac=_0x3bf5ac||0xc8;return function(_0x25d306){if(_0x25d306){return _0x33c78d['status'](_0x3bf5ac)[_0x9cd7('0x1d')](_0x25d306);}};}function respondWithFilteredResult(_0x1a1aa8,_0x356e3b){return function(_0x32fec3){if(_0x32fec3){var _0x14096e=typeof _0x356e3b[_0x9cd7('0x1e')]===_0x9cd7('0x1f')&&typeof _0x356e3b[_0x9cd7('0x20')]===_0x9cd7('0x1f');var _0x8897f4=_0x32fec3[_0x9cd7('0x21')];var _0x257d9f=_0x14096e?0x0:_0x356e3b[_0x9cd7('0x1e')];var _0x38474c=_0x14096e?_0x32fec3[_0x9cd7('0x21')]:_0x356e3b['offset']+_0x356e3b['limit'];var _0x38f880;if(_0x38474c>=_0x8897f4){_0x38474c=_0x8897f4;_0x38f880=0xc8;}else{_0x38f880=0xce;}_0x1a1aa8[_0x9cd7('0x1c')](_0x38f880);return _0x1a1aa8[_0x9cd7('0x22')](_0x9cd7('0x23'),_0x257d9f+'-'+_0x38474c+'/'+_0x8897f4)[_0x9cd7('0x1d')](_0x32fec3);}return null;};}function patchUpdates(_0x4a73ba){return function(_0x3d86e6){try{jsonpatch['apply'](_0x3d86e6,_0x4a73ba,!![]);}catch(_0x5cc0f8){return BPromise[_0x9cd7('0x24')](_0x5cc0f8);}return _0x3d86e6[_0x9cd7('0x25')]();};}function saveUpdates(_0x53f7c9,_0x1205f7){return function(_0x588edf){if(_0x588edf){return _0x588edf[_0x9cd7('0x26')](_0x53f7c9)[_0x9cd7('0x27')](function(_0x120f30){return _0x120f30;});}return null;};}function removeEntity(_0x5be7b4,_0x68e279){return function(_0x1bf349){if(_0x1bf349){return _0x1bf349[_0x9cd7('0x28')]()[_0x9cd7('0x27')](function(){_0x5be7b4[_0x9cd7('0x1c')](0xcc)[_0x9cd7('0x29')]();});}};}function handleEntityNotFound(_0x2099fb,_0x2a7b8f){return function(_0x2ec99d){if(!_0x2ec99d){_0x2099fb[_0x9cd7('0x1b')](0x194);}return _0x2ec99d;};}function handleError(_0x54ecf0,_0x3f7f3d){_0x3f7f3d=_0x3f7f3d||0x1f4;return function(_0x73abd1){logger[_0x9cd7('0x2a')](_0x73abd1[_0x9cd7('0x2b')]);if(_0x73abd1['name']){delete _0x73abd1['name'];}_0x54ecf0[_0x9cd7('0x1c')](_0x3f7f3d)[_0x9cd7('0x2c')](_0x73abd1);};}exports['index']=function(_0x3609d8,_0x39d69a){var _0x45aa7f={},_0x5772d6={},_0xaad15a={'count':0x0,'rows':[]};var _0x33f332=_['map'](db[_0x9cd7('0x2d')][_0x9cd7('0x2e')],function(_0xed5dca){return{'name':_0xed5dca[_0x9cd7('0x2f')],'type':_0xed5dca['type']['key']};});_0x5772d6[_0x9cd7('0x30')]=_[_0x9cd7('0x31')](_0x33f332,_0x9cd7('0x32'));_0x5772d6[_0x9cd7('0x33')]=_[_0x9cd7('0x34')](_0x3609d8[_0x9cd7('0x33')]);_0x5772d6[_0x9cd7('0x35')]=_['intersection'](_0x5772d6[_0x9cd7('0x30')],_0x5772d6[_0x9cd7('0x33')]);_0x45aa7f['attributes']=_[_0x9cd7('0x36')](_0x5772d6[_0x9cd7('0x30')],qs[_0x9cd7('0x37')](_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x37')]));_0x45aa7f[_0x9cd7('0x38')]=_0x45aa7f['attributes']['length']?_0x45aa7f['attributes']:_0x5772d6[_0x9cd7('0x30')];if(!_0x3609d8['query'][_0x9cd7('0x39')]('nolimit')){_0x45aa7f[_0x9cd7('0x20')]=qs[_0x9cd7('0x20')](_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x20')]);_0x45aa7f[_0x9cd7('0x1e')]=qs[_0x9cd7('0x1e')](_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x1e')]);}_0x45aa7f['order']=qs[_0x9cd7('0x3a')](_0x3609d8['query']['sort']);_0x45aa7f['where']=qs[_0x9cd7('0x35')](_[_0x9cd7('0x3b')](_0x3609d8[_0x9cd7('0x33')],_0x5772d6['filters']),_0x33f332);if(_0x3609d8[_0x9cd7('0x33')][_0x9cd7('0x3c')]){_0x45aa7f['where']=_['merge'](_0x45aa7f[_0x9cd7('0x3d')],{'$or':_[_0x9cd7('0x31')](_0x33f332,function(_0x53f765){if(_0x53f765[_0x9cd7('0x3e')]!==_0x9cd7('0x3f')){var _0xcea180={};_0xcea180[_0x53f765[_0x9cd7('0x32')]]={'$like':'%'+_0x3609d8[_0x9cd7('0x33')]['filter']+'%'};return _0xcea180;}})});}_0x45aa7f=_['merge']({},_0x45aa7f,_0x3609d8['options']);var _0x2c2643={'where':_0x45aa7f[_0x9cd7('0x3d')]};return db[_0x9cd7('0x2d')]['count'](_0x2c2643)[_0x9cd7('0x27')](function(_0x187f6e){_0xaad15a[_0x9cd7('0x21')]=_0x187f6e;if(_0x3609d8['query']['includeAll']){_0x45aa7f[_0x9cd7('0x40')]=[{'all':!![]}];}return db[_0x9cd7('0x2d')][_0x9cd7('0x41')](_0x45aa7f);})[_0x9cd7('0x27')](function(_0x151058){_0xaad15a[_0x9cd7('0x42')]=_0x151058;return _0xaad15a;})['then'](respondWithFilteredResult(_0x39d69a,_0x45aa7f))['catch'](handleError(_0x39d69a,null));};exports[_0x9cd7('0x43')]=function(_0x126405,_0x3c7dce){var _0x1f4d75={'raw':!![],'where':{'id':_0x126405[_0x9cd7('0x44')]['id']}},_0x126557={};_0x126557[_0x9cd7('0x30')]=_[_0x9cd7('0x34')](db[_0x9cd7('0x2d')][_0x9cd7('0x2e')]);_0x126557[_0x9cd7('0x33')]=_[_0x9cd7('0x34')](_0x126405['query']);_0x126557[_0x9cd7('0x35')]=_['intersection'](_0x126557[_0x9cd7('0x30')],_0x126557[_0x9cd7('0x33')]);_0x1f4d75[_0x9cd7('0x38')]=_[_0x9cd7('0x36')](_0x126557[_0x9cd7('0x30')],qs['fields'](_0x126405['query'][_0x9cd7('0x37')]));_0x1f4d75[_0x9cd7('0x38')]=_0x1f4d75[_0x9cd7('0x38')][_0x9cd7('0x45')]?_0x1f4d75[_0x9cd7('0x38')]:_0x126557[_0x9cd7('0x30')];if(_0x126405[_0x9cd7('0x33')]['includeAll']){_0x1f4d75[_0x9cd7('0x40')]=[{'all':!![]}];}_0x1f4d75=_[_0x9cd7('0x46')]({},_0x1f4d75,_0x126405[_0x9cd7('0x47')]);return db[_0x9cd7('0x2d')][_0x9cd7('0x48')](_0x1f4d75)[_0x9cd7('0x27')](handleEntityNotFound(_0x3c7dce,null))[_0x9cd7('0x27')](respondWithResult(_0x3c7dce,null))[_0x9cd7('0x49')](handleError(_0x3c7dce,null));};exports['clone']=function(_0x2c0d23,_0x660f8b){var _0x5bf237={'where':{'id':_0x2c0d23[_0x9cd7('0x44')]['id']}},_0x28e0b1={};_0x28e0b1[_0x9cd7('0x30')]=_[_0x9cd7('0x34')](db[_0x9cd7('0x2d')][_0x9cd7('0x2e')]);_0x5bf237[_0x9cd7('0x38')]=_['intersection'](_0x28e0b1[_0x9cd7('0x30')],qs['fields'](_0x2c0d23[_0x9cd7('0x33')][_0x9cd7('0x37')]));_0x5bf237[_0x9cd7('0x38')]=_0x5bf237[_0x9cd7('0x38')]['length']?_0x5bf237[_0x9cd7('0x38')]:_0x28e0b1[_0x9cd7('0x30')];if(_0x2c0d23[_0x9cd7('0x33')][_0x9cd7('0x4a')]){_0x5bf237[_0x9cd7('0x40')]=[{'all':!![]}];}_0x5bf237=_[_0x9cd7('0x46')]({},_0x5bf237,_0x2c0d23['options']);return db[_0x9cd7('0x2d')][_0x9cd7('0x48')](_0x5bf237)[_0x9cd7('0x27')](handleEntityNotFound(_0x660f8b,null))['then'](function(_0x574607){if(_0x574607){var _0x463009=_0x574607[_0x9cd7('0x4b')]({'plain':!![]});_0x463009=qs[_0x9cd7('0x4c')](_0x463009,['id',_0x9cd7('0x4d'),_0x9cd7('0x4e')]);_0x2c0d23['body']=_[_0x9cd7('0x4c')](_0x2c0d23[_0x9cd7('0x4f')],['id',_0x9cd7('0x4d'),_0x9cd7('0x4e')]);return db['Attachment'][_0x9cd7('0x50')](_[_0x9cd7('0x46')](_0x463009,_0x2c0d23[_0x9cd7('0x4f')]),{'include':_0x2c0d23[_0x9cd7('0x33')][_0x9cd7('0x4a')]?[{'all':!![]}]:undefined});}})[_0x9cd7('0x27')](respondWithResult(_0x660f8b,0xc9))[_0x9cd7('0x49')](handleError(_0x660f8b,null));};exports['update']=function(_0x536200,_0x32c11c){if(_0x536200['body']['id']){delete _0x536200[_0x9cd7('0x4f')]['id'];}return db[_0x9cd7('0x2d')][_0x9cd7('0x48')]({'where':{'id':_0x536200[_0x9cd7('0x44')]['id']}})['then'](handleEntityNotFound(_0x32c11c,null))[_0x9cd7('0x27')](saveUpdates(_0x536200['body'],null))[_0x9cd7('0x27')](respondWithResult(_0x32c11c,null))['catch'](handleError(_0x32c11c,null));};exports['destroy']=function(_0x2d4b96,_0x4c4396){return db[_0x9cd7('0x2d')][_0x9cd7('0x48')]({'where':{'id':_0x2d4b96[_0x9cd7('0x44')]['id']}})[_0x9cd7('0x27')](handleEntityNotFound(_0x4c4396,null))[_0x9cd7('0x27')](removeEntity(_0x4c4396,null))[_0x9cd7('0x49')](handleError(_0x4c4396,null));};exports[_0x9cd7('0x50')]=function(_0x18ea9a,_0x56eef0,_0x1dfe3f){_0x18ea9a[_0x9cd7('0x4f')][_0x9cd7('0x32')]=_0x18ea9a['file'][_0x9cd7('0x51')];_0x18ea9a[_0x9cd7('0x4f')][_0x9cd7('0x52')]=_0x18ea9a['file'][_0x9cd7('0x53')];_0x18ea9a[_0x9cd7('0x4f')][_0x9cd7('0x3e')]=_0x18ea9a[_0x9cd7('0x54')][_0x9cd7('0x55')];return db[_0x9cd7('0x2d')][_0x9cd7('0x50')](_0x18ea9a[_0x9cd7('0x4f')])[_0x9cd7('0x27')](respondWithResult(_0x56eef0,0xc9))[_0x9cd7('0x49')](handleError(_0x56eef0,null));};exports[_0x9cd7('0x56')]=function(_0x17a7eb,_0x56ca72,_0x4e5d55){return db['Attachment'][_0x9cd7('0x57')]({'where':{'id':_0x17a7eb[_0x9cd7('0x44')]['id']},'raw':!![]})[_0x9cd7('0x27')](handleEntityNotFound(_0x56ca72,null))['then'](function(_0x4b668c){if(_0x4b668c){var _0x5e6cff=_0x4b668c['ChatOfflineMessageId']!==null;var _0x21d70a=path[_0x9cd7('0x58')](config[_0x9cd7('0x59')],'server/files/attachments/');if(_0x5e6cff){_0x21d70a=path[_0x9cd7('0x58')](_0x21d70a,_0x9cd7('0x5a'));}var _0x309408=path['join'](_0x21d70a,_0x4b668c[_0x9cd7('0x52')]);return _0x56ca72[_0x9cd7('0x56')](_0x309408);}})['catch'](handleError(_0x56ca72,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3df7906..35a61a4 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 _0x4a84=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x4a84,0xab));var _0x44a8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4a84[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x44a8('0x0'));var util=require(_0x44a8('0x1'));var logger=require(_0x44a8('0x2'))(_0x44a8('0x3'));var moment=require(_0x44a8('0x4'));var BPromise=require(_0x44a8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44a8('0x6'));var config=require(_0x44a8('0x7'));var attributes=require(_0x44a8('0x8'));module[_0x44a8('0x9')]=function(_0x421f4b,_0x4b06ca){return _0x421f4b[_0x44a8('0xa')](_0x44a8('0xb'),attributes,{'tableName':_0x44a8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa53=['moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','api'];(function(_0xa651d4,_0x5df6cb){var _0x1301be=function(_0x5aa409){while(--_0x5aa409){_0xa651d4['push'](_0xa651d4['shift']());}};_0x1301be(++_0x5df6cb);}(_0xaa53,0xc0));var _0x3aa5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa53[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x3aa5('0x0'));var logger=require(_0x3aa5('0x1'))(_0x3aa5('0x2'));var moment=require(_0x3aa5('0x3'));var BPromise=require(_0x3aa5('0x4'));var rp=require(_0x3aa5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa5('0x6'));var config=require(_0x3aa5('0x7'));var attributes=require(_0x3aa5('0x8'));module[_0x3aa5('0x9')]=function(_0x4394ab,_0x54e9f9){return _0x4394ab[_0x3aa5('0xa')](_0x3aa5('0xb'),attributes,{'tableName':_0x3aa5('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 7c2c0b3..77b0847 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 _0x644a=['../../config/environment','jayson/promise','client','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x480591,_0x538ba6){var _0x5213fa=function(_0x36d2f1){while(--_0x36d2f1){_0x480591['push'](_0x480591['shift']());}};_0x5213fa(++_0x538ba6);}(_0x644a,0xfd));var _0xa644=function(_0x5c2748,_0x564960){_0x5c2748=_0x5c2748-0x0;var _0x59761d=_0x644a[_0x5c2748];return _0x59761d;};'use strict';var _=require(_0xa644('0x0'));var util=require(_0xa644('0x1'));var moment=require(_0xa644('0x2'));var BPromise=require(_0xa644('0x3'));var rs=require(_0xa644('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa644('0x5'))['db'];var utils=require(_0xa644('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa644('0x7'));var jayson=require(_0xa644('0x8'));var client=jayson[_0xa644('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa4af13,_0x1aaaae,_0x4f8b23){return new BPromise(function(_0x15995f,_0x252108){return client['request'](_0xa4af13,_0x4f8b23)['then'](function(_0x36f677){logger[_0xa644('0xa')]('Attachment,\x20%s,\x20%s',_0x1aaaae,_0xa644('0xb'));logger[_0xa644('0xc')](_0xa644('0xd'),_0x1aaaae,_0xa644('0xb'),JSON[_0xa644('0xe')](_0x36f677));if(_0x36f677['error']){if(_0x36f677[_0xa644('0xf')][_0xa644('0x10')]===0x1f4){logger[_0xa644('0xf')](_0xa644('0x11'),_0x1aaaae,_0x36f677[_0xa644('0xf')][_0xa644('0x12')]);return _0x252108(_0x36f677['error'][_0xa644('0x12')]);}logger[_0xa644('0xf')](_0xa644('0x11'),_0x1aaaae,_0x36f677[_0xa644('0xf')][_0xa644('0x12')]);return _0x15995f(_0x36f677[_0xa644('0xf')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x1aaaae,'request\x20sent');_0x15995f(_0x36f677['result']['message']);}})[_0xa644('0x13')](function(_0x45e115){logger[_0xa644('0xf')](_0xa644('0x11'),_0x1aaaae,_0x45e115);_0x252108(_0x45e115);});});}exports[_0xa644('0x14')]=function(_0x1536ee){var _0x6fb957=this;return new Promise(function(_0x2cf6c9,_0x300aa0){return db[_0xa644('0x15')][_0xa644('0x16')](_0x1536ee[_0xa644('0x17')],{'raw':_0x1536ee[_0xa644('0x18')]?_0x1536ee[_0xa644('0x18')][_0xa644('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x257e3d){logger[_0xa644('0xa')](_0xa644('0x14'),_0x1536ee);logger['debug'](_0xa644('0x14'),_0x1536ee,JSON[_0xa644('0xe')](_0x257e3d));_0x2cf6c9(_0x257e3d);})['catch'](function(_0x384a2d){logger[_0xa644('0xf')]('CreateAttachment',_0x384a2d[_0xa644('0x12')],_0x1536ee);_0x300aa0(_0x6fb957[_0xa644('0xf')](0x1f4,_0x384a2d[_0xa644('0x12')]));});});};
\ No newline at end of file
+var _0x21a3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21a3,0x66));var _0x321a=function(_0x1e73fc,_0x533750){_0x1e73fc=_0x1e73fc-0x0;var _0xeceac4=_0x21a3[_0x1e73fc];return _0xeceac4;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Attachment,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateAttachment']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateAttachment',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 78bcdc0..0c9bfbd 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(_0x38d50c,_0x40b2b9){var _0x64a16c=function(_0x1533ab){while(--_0x1533ab){_0x38d50c['push'](_0x38d50c['shift']());}};_0x64a16c(++_0x40b2b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x388550,_0x3fd74b){_0x388550=_0x388550-0x0;var _0x735860=_0xb10b[_0x388550];return _0x735860;};'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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 2a772c8..0422544 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 _0x5a39=['api','undefined','activedirectory','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','role','blocked','blockedAt','online','admin','disabled','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger'];(function(_0x13840d,_0x494dd3){var _0x1199a9=function(_0x19954a){while(--_0x19954a){_0x13840d['push'](_0x13840d['shift']());}};_0x1199a9(++_0x494dd3);}(_0x5a39,0xbd));var _0x95a3=function(_0x2acc9c,_0x54b2ff){_0x2acc9c=_0x2acc9c-0x0;var _0x424840=_0x5a39[_0x2acc9c];return _0x424840;};'use strict';var passport=require(_0x95a3('0x0'));var LocalStrategy=require(_0x95a3('0x1'))[_0x95a3('0x2')];var moment=require(_0x95a3('0x3'));var ActiveDirectory=require(_0x95a3('0x4'));var BPromise=require(_0x95a3('0x5'));var util=require(_0x95a3('0x6'));var db=require(_0x95a3('0x7'))['db'];var authService=require(_0x95a3('0x8'));var utils=require(_0x95a3('0x9'));var config=require('../../config/environment');var logger=require(_0x95a3('0xa'))(_0x95a3('0xb'));function isActiveDirectoryConfigured(_0x151dd6){var _0x133313=![];if(typeof _0x151dd6['activedirectory']!==_0x95a3('0xc')){_0x133313=_0x151dd6[_0x95a3('0xd')]['baseDN']&&_0x151dd6[_0x95a3('0xd')][_0x95a3('0xe')]&&_0x151dd6[_0x95a3('0xd')][_0x95a3('0xf')];}return _0x133313;}function adAuthenticate(_0x22f742,_0x102280,_0x4a1dc4){return new BPromise(function(_0x2c6d85,_0x5a5864){try{var _0x2c7665=new ActiveDirectory(_0x22f742);_0x2c7665[_0x95a3('0x10')](_0x102280,_0x4a1dc4,function(_0x3c8768,_0x998230){if(_0x3c8768){logger[_0x95a3('0x11')](_0x95a3('0x12'),_0x102280,util[_0x95a3('0x13')](_0x3c8768,{'showHidden':![],'depth':null}));_0x5a5864(_0x95a3('0x14'));}else if(!_0x998230){logger[_0x95a3('0x11')](_0x95a3('0x15'),_0x102280);_0x5a5864('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2c6d85(_0x998230);}});}catch(_0x55160f){_0x5a5864(_0x55160f);}});}function ActiveDirectoryAuthenticate(_0x1fb790,_0x237078,_0x24097c,_0x1f1f7a){var _0x992ca1,_0x2919a6;if(!isActiveDirectoryConfigured(config)){logger[_0x95a3('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x237078);return _0x1f1f7a(null,![],{'message':_0x95a3('0x14')});}return db[_0x95a3('0x16')][_0x95a3('0x17')]({'where':{'id':0x1},'attributes':[_0x95a3('0x18'),_0x95a3('0x19')],'raw':!![]})[_0x95a3('0x1a')](function(_0x45d4ff){_0x992ca1=_0x45d4ff;if(!_0x992ca1[_0x95a3('0x18')]){logger[_0x95a3('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x237078);throw new Error(_0x95a3('0x14'));}return _0x1fb790[_0x95a3('0x17')]({'logging':!![],'attributes':['id',_0x95a3('0x1b'),_0x95a3('0x1c'),_0x95a3('0x1d'),_0x95a3('0x1e'),'disabled',_0x95a3('0x1f'),_0x95a3('0x20'),_0x95a3('0x21')],'where':{'name':_0x237078,'role':{'$or':[_0x95a3('0x22'),'user','agent']},'adSsoEnabled':!![]}});})[_0x95a3('0x1a')](function(_0x15658a){if(!_0x15658a||_0x15658a&&_0x15658a['name']!==_0x237078){throw new Error(_0x95a3('0x14'));}_0x2919a6=_0x15658a;var _0x82049c=_0x2919a6['name']+'@'+config[_0x95a3('0xd')][_0x95a3('0xf')];return adAuthenticate(config[_0x95a3('0xd')],_0x82049c,_0x24097c);})[_0x95a3('0x1a')](function(_0x209ab3){if(_0x2919a6[_0x95a3('0x23')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x992ca1[_0x95a3('0x19')]>0x0){if(_0x2919a6['blocked']){if(moment(_0x2919a6[_0x95a3('0x20')])[_0x95a3('0x24')](_0x992ca1[_0x95a3('0x19')],_0x95a3('0x25'))>moment()){throw new Error(_0x95a3('0x14'));}return utils[_0x95a3('0x26')](_0x2919a6,0x0,![],null)[_0x95a3('0x1a')](function(){return utils[_0x95a3('0x27')](_0x2919a6);})[_0x95a3('0x1a')](function(){return _0x1f1f7a(null,_0x2919a6);});}else{return utils[_0x95a3('0x27')](_0x2919a6)[_0x95a3('0x1a')](function(){return _0x1f1f7a(null,_0x2919a6);});}}else{return utils['getLicense'](_0x2919a6)['then'](function(){return _0x1f1f7a(null,_0x2919a6);});}})[_0x95a3('0x28')](function(_0x1e48b9){return _0x1f1f7a(null,![],_0x1e48b9);});}function handleError(_0x1151f6,_0x2bf186,_0x219cb0){return _0x1151f6[_0x95a3('0x29')](_0x2bf186||0x1f4)['send']({'message':_0x219cb0?_0x219cb0[_0x95a3('0x2a')]||_0x219cb0:''});}exports[_0x95a3('0x2b')]=function(_0x41ccd3,_0x24eb1c,_0x4392d9){passport[_0x95a3('0x10')](_0x95a3('0x2c'),function(_0xdd4fcc,_0x4c20eb,_0x2f812a){var _0x1da34d=_0xdd4fcc||_0x2f812a;if(_0x1da34d){return handleError(_0x24eb1c,0x191,_0x1da34d);}if(!_0x4c20eb){return handleError(_0x24eb1c,0x194,{'message':_0x95a3('0x2d')});}else{var _0x2eb34d={'payload':{'id':_0x4c20eb['id'],'role':_0x4c20eb[_0x95a3('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x95a3('0x2e')](_0x2eb34d)[_0x95a3('0x1a')](function(_0x99e55a){_0x24eb1c[_0x95a3('0x2f')]({'id':_0x4c20eb['id'],'token':_0x99e55a,'statusCall':'','isAlreadyLogged':_0x4c20eb[_0x95a3('0x21')]});});}})(_0x41ccd3,_0x24eb1c,_0x4392d9);};passport[_0x95a3('0x30')](_0x95a3('0x2c'),new LocalStrategy({'usernameField':_0x95a3('0x1b'),'passwordField':_0x95a3('0x1c')},function(_0x35ac47,_0x3934ee,_0x1812de){return ActiveDirectoryAuthenticate(db[_0x95a3('0x31')],_0x35ac47,_0x3934ee,_0x1812de);}));
\ No newline at end of file
+var _0x60a1=['bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','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','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','user','agent','disabled','add','minutes','getLicense','catch','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','Strategy','activedirectory2'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x60a1,0xb9));var _0x160a=function(_0x35ecfb,_0x4fc054){_0x35ecfb=_0x35ecfb-0x0;var _0x303599=_0x60a1[_0x35ecfb];return _0x303599;};'use strict';var passport=require(_0x160a('0x0'));var LocalStrategy=require('passport-local')[_0x160a('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x160a('0x2'));var BPromise=require(_0x160a('0x3'));var util=require('util');var db=require(_0x160a('0x4'))['db'];var authService=require(_0x160a('0x5'));var utils=require(_0x160a('0x6'));var config=require(_0x160a('0x7'));var logger=require(_0x160a('0x8'))(_0x160a('0x9'));function isActiveDirectoryConfigured(_0x5ac356){var _0x5291fb=![];if(typeof _0x5ac356[_0x160a('0xa')]!==_0x160a('0xb')){_0x5291fb=_0x5ac356[_0x160a('0xa')][_0x160a('0xc')]&&_0x5ac356[_0x160a('0xa')][_0x160a('0xd')]&&_0x5ac356[_0x160a('0xa')][_0x160a('0xe')];}return _0x5291fb;}function adAuthenticate(_0x302d24,_0x350229,_0x5191e8){return new BPromise(function(_0xa9e494,_0x245c7b){try{var _0x4b121d=new ActiveDirectory(_0x302d24);_0x4b121d['authenticate'](_0x350229,_0x5191e8,function(_0x15044b,_0x21b1a8){if(_0x15044b){logger['error'](_0x160a('0xf'),_0x350229,util[_0x160a('0x10')](_0x15044b,{'showHidden':![],'depth':null}));_0x245c7b(_0x160a('0x11'));}else if(!_0x21b1a8){logger[_0x160a('0x12')](_0x160a('0x13'),_0x350229);_0x245c7b(_0x160a('0x11'));}else{_0xa9e494(_0x21b1a8);}});}catch(_0x2609ed){_0x245c7b(_0x2609ed);}});}function ActiveDirectoryAuthenticate(_0x17c378,_0x577afe,_0x194b2b,_0x5a5988){var _0x4e9585,_0x237659;if(!isActiveDirectoryConfigured(config)){logger[_0x160a('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x577afe);return _0x5a5988(null,![],{'message':_0x160a('0x11')});}return db[_0x160a('0x14')][_0x160a('0x15')]({'where':{'id':0x1},'attributes':[_0x160a('0x16'),_0x160a('0x17')],'raw':!![]})[_0x160a('0x18')](function(_0x14b713){_0x4e9585=_0x14b713;if(!_0x4e9585[_0x160a('0x16')]){logger['error'](_0x160a('0x19'),_0x577afe);throw new Error(_0x160a('0x11'));}return _0x17c378[_0x160a('0x15')]({'logging':!![],'attributes':['id',_0x160a('0x1a'),_0x160a('0x1b'),_0x160a('0x1c'),_0x160a('0x1d'),'disabled',_0x160a('0x1e'),_0x160a('0x1f'),'online'],'where':{'name':_0x577afe,'role':{'$or':['admin',_0x160a('0x20'),_0x160a('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x2512ae){if(!_0x2512ae||_0x2512ae&&_0x2512ae[_0x160a('0x1a')]!==_0x577afe){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x237659=_0x2512ae;var _0x5038e8=_0x237659[_0x160a('0x1a')]+'@'+config[_0x160a('0xa')]['domain'];return adAuthenticate(config[_0x160a('0xa')],_0x5038e8,_0x194b2b);})[_0x160a('0x18')](function(_0x1f5c9a){if(_0x237659[_0x160a('0x22')]){throw new Error(_0x160a('0x11'));}if(_0x4e9585[_0x160a('0x17')]>0x0){if(_0x237659[_0x160a('0x1e')]){if(moment(_0x237659[_0x160a('0x1f')])[_0x160a('0x23')](_0x4e9585['blockDuration'],_0x160a('0x24'))>moment()){throw new Error(_0x160a('0x11'));}return utils['clearBlockUser'](_0x237659,0x0,![],null)[_0x160a('0x18')](function(){return utils[_0x160a('0x25')](_0x237659);})[_0x160a('0x18')](function(){return _0x5a5988(null,_0x237659);});}else{return utils[_0x160a('0x25')](_0x237659)['then'](function(){return _0x5a5988(null,_0x237659);});}}else{return utils[_0x160a('0x25')](_0x237659)[_0x160a('0x18')](function(){return _0x5a5988(null,_0x237659);});}})[_0x160a('0x26')](function(_0x4648ad){return _0x5a5988(null,![],_0x4648ad);});}function handleError(_0x4a2af9,_0x5aa34a,_0x1a8938){return _0x4a2af9['status'](_0x5aa34a||0x1f4)['send']({'message':_0x1a8938?_0x1a8938[_0x160a('0x27')]||_0x1a8938:''});}exports[_0x160a('0x28')]=function(_0x32b5d5,_0x2738ba,_0x52b7a1){passport['authenticate'](_0x160a('0x29'),function(_0x332dd5,_0x14cafc,_0x5845f2){var _0x4ec84e=_0x332dd5||_0x5845f2;if(_0x4ec84e){return handleError(_0x2738ba,0x191,_0x4ec84e);}if(!_0x14cafc){return handleError(_0x2738ba,0x194,{'message':_0x160a('0x2a')});}else{var _0x58012d={'payload':{'id':_0x14cafc['id'],'role':_0x14cafc[_0x160a('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x58012d)[_0x160a('0x18')](function(_0xa84ec0){_0x2738ba[_0x160a('0x2b')]({'id':_0x14cafc['id'],'token':_0xa84ec0,'statusCall':'','isAlreadyLogged':_0x14cafc[_0x160a('0x2c')]});});}})(_0x32b5d5,_0x2738ba,_0x52b7a1);};passport[_0x160a('0x2d')](_0x160a('0x29'),new LocalStrategy({'usernameField':'name','passwordField':_0x160a('0x1b')},function(_0x5ad62c,_0x41de2e,_0x4d4817){return ActiveDirectoryAuthenticate(db[_0x160a('0x2e')],_0x5ad62c,_0x41de2e,_0x4d4817);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 5eecd77..d4b874b 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 _0xcc01=['express','Router','login','exports'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0xcc01,0x12c));var _0x1cc0=function(_0x5dc240,_0x5ce6c5){_0x5dc240=_0x5dc240-0x0;var _0x5c89c5=_0xcc01[_0x5dc240];return _0x5c89c5;};'use strict';var express=require(_0x1cc0('0x0'));var router=express[_0x1cc0('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x1cc0('0x2')]);module[_0x1cc0('0x3')]=router;
\ No newline at end of file
+var _0x9b6f=['express','Router','./authActiveDirectory.controller','post','exports'];(function(_0xff27d9,_0xd9cce){var _0x375453=function(_0x54e5d0){while(--_0x54e5d0){_0xff27d9['push'](_0xff27d9['shift']());}};_0x375453(++_0xd9cce);}(_0x9b6f,0xcd));var _0xf9b6=function(_0x3ca3bd,_0xfaea6e){_0x3ca3bd=_0x3ca3bd-0x0;var _0x36f896=_0x9b6f[_0x3ca3bd];return _0x36f896;};'use strict';var express=require(_0xf9b6('0x0'));var router=express[_0xf9b6('0x1')]();var controller=require(_0xf9b6('0x2'));router[_0xf9b6('0x3')]('/',controller['login']);module[_0xf9b6('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 8f8a8a4..897d4c1 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(_0x4128bb,_0x4f9c32){var _0x293df0=function(_0x22b29b){while(--_0x22b29b){_0x4128bb['push'](_0x4128bb['shift']());}};_0x293df0(++_0x4f9c32);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a54,0x106));var _0x47a5=function(_0x217320,_0x2dfb07){_0x217320=_0x217320-0x0;var _0x50c1bb=_0x7a54[_0x217320];return _0x50c1bb;};'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 f66bd4f..3942732 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 _0x8373=['isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8373,0x1c5));var _0x3837=function(_0x25bcd3,_0x92b584){_0x25bcd3=_0x25bcd3-0x0;var _0x3d9689=_0x8373[_0x25bcd3];return _0x3d9689;};'use strict';var express=require(_0x3837('0x0'));var passport=require(_0x3837('0x1'));var router=express[_0x3837('0x2')]();var controller=require(_0x3837('0x3'));var userController=require(_0x3837('0x4'));var authService=require(_0x3837('0x5'));router[_0x3837('0x6')]('/',controller[_0x3837('0x7')]);router[_0x3837('0x6')](_0x3837('0x8'),controller['callback'],authService[_0x3837('0x9')],userController[_0x3837('0x7')],authService[_0x3837('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xa404=['get','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','login'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xa404,0x159));var _0x4a40=function(_0x196d84,_0x4acd97){_0x196d84=_0x196d84-0x0;var _0x28e207=_0xa404[_0x196d84];return _0x28e207;};'use strict';var express=require(_0x4a40('0x0'));var passport=require(_0x4a40('0x1'));var router=express[_0x4a40('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x4a40('0x3'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x4a40('0x4')]);router[_0x4a40('0x5')]('/callback',controller[_0x4a40('0x6')],authService[_0x4a40('0x7')],userController[_0x4a40('0x4')],authService[_0x4a40('0x8')]);module[_0x4a40('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 cb50bf4..3d5d2c3 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 _0xd2ac=['headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','Password\x20reset!','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','then','findOne','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockDuration','clearBlockUser','minutes','getLicense','catch','MailAccount','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','Smtp','user','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://'];(function(_0x402783,_0x33fc38){var _0x271fc3=function(_0x11a16f){while(--_0x11a16f){_0x402783['push'](_0x402783['shift']());}};_0x271fc3(++_0x33fc38);}(_0xd2ac,0x149));var _0xcd2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2ac[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xcd2a('0x0'));var passport=require(_0xcd2a('0x1'));var LocalStrategy=require(_0xcd2a('0x2'))[_0xcd2a('0x3')];var jayson=require(_0xcd2a('0x4'));var _=require('lodash');var rs=require(_0xcd2a('0x5'));var moment=require(_0xcd2a('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xcd2a('0x7'));var utils=require(_0xcd2a('0x8'));var client=jayson[_0xcd2a('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x4106f7,_0x3d74f2,_0x405166,_0x51546b){var _0x3f0af9,_0x35e627;return db[_0xcd2a('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xcd2a('0xb'),'blockDuration'],'raw':!![]})[_0xcd2a('0xc')](function(_0x219364){_0x3f0af9=_0x219364;return _0x4106f7[_0xcd2a('0xd')]({'attributes':['id',_0xcd2a('0xe'),_0xcd2a('0xf'),_0xcd2a('0x10'),_0xcd2a('0x11'),_0xcd2a('0x12'),'blocked',_0xcd2a('0x13'),_0xcd2a('0x14')],'where':{'name':_0x3d74f2,'role':{'$or':[_0xcd2a('0x15'),'user','agent']}}});})[_0xcd2a('0xc')](function(_0x3d2d65){if(!_0x3d2d65||_0x3d2d65&&_0x3d2d65[_0xcd2a('0xe')]!==_0x3d74f2){throw new Error(_0xcd2a('0x16'));}else{_0x35e627=_0x3d2d65;return _0x35e627;}})['then'](function(){_0x35e627[_0xcd2a('0x17')](_0x405166,function(_0x48a1d9,_0x58a86a){var _0x3c57e1=_0x35e627[_0xcd2a('0x14')]+0x1;if(_0x48a1d9){return _0x51546b(_0x48a1d9);}else if(!_0x58a86a){if(_0x35e627['disabled']){return _0x51546b(null,![],{'message':_0xcd2a('0x16')});}else if(_0x3f0af9[_0xcd2a('0xb')]>0x0){if(_0x35e627[_0xcd2a('0x18')]){if(_0x3f0af9[_0xcd2a('0x19')]>0x0){if(moment(_0x35e627['blockedAt'])['add'](_0x3f0af9[_0xcd2a('0x19')],'minutes')>moment()){return _0x51546b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xcd2a('0x1a')](_0x35e627,_0x3c57e1,![],null)[_0xcd2a('0xc')](function(){return _0x51546b(null,![],{'message':_0xcd2a('0x16')});});}}else{return _0x51546b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3c57e1>=_0x3f0af9[_0xcd2a('0xb')]){return utils['clearBlockUser'](_0x35e627,0x0,!![],moment())[_0xcd2a('0xc')](function(){return _0x51546b(null,![],{'message':_0xcd2a('0x16')});});}else{return utils[_0xcd2a('0x1a')](_0x35e627,_0x3c57e1,![],null)[_0xcd2a('0xc')](function(){return _0x51546b(null,![],{'message':_0xcd2a('0x16')});});}}}else{return _0x51546b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x35e627['disabled']){return _0x51546b(null,![],{'message':_0xcd2a('0x16')});}else if(_0x3f0af9['allowedLoginAttempts']>0x0){if(_0x35e627[_0xcd2a('0x18')]){if(_0x3f0af9[_0xcd2a('0x19')]>0x0){if(moment(_0x35e627[_0xcd2a('0x13')])['add'](_0x3f0af9[_0xcd2a('0x19')],_0xcd2a('0x1b'))>moment()){return _0x51546b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xcd2a('0x1a')](_0x35e627,0x0,![],null)[_0xcd2a('0xc')](function(){return utils[_0xcd2a('0x1c')](_0x35e627);})[_0xcd2a('0xc')](function(){return _0x51546b(null,_0x35e627);});}}else{return _0x51546b(null,![],{'message':_0xcd2a('0x16')});}}else{return utils[_0xcd2a('0x1a')](_0x35e627,0x0,![],null)[_0xcd2a('0xc')](function(){return utils[_0xcd2a('0x1c')](_0x35e627);})[_0xcd2a('0xc')](function(){return _0x51546b(null,_0x35e627);})['catch'](function(_0x374247){return _0x51546b(null,![],_0x374247);});}}else{if(_0x35e627['blocked']){return _0x51546b(null,![],{'message':_0xcd2a('0x16')});}else{return utils['getLicense'](_0x35e627)[_0xcd2a('0xc')](function(){return _0x51546b(null,_0x35e627);});}}}});})[_0xcd2a('0x1d')](function(_0x3c8111){return _0x51546b(null,![],_0x3c8111);});}function sendServiceMail(_0x43d529){return db[_0xcd2a('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xcd2a('0xe'),'email'],'include':[{'model':db[_0xcd2a('0x1f')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xcd2a('0x20')}]}]})['then'](function(_0x585e9b){if(!_0x585e9b){throw new Error(_0xcd2a('0x21'));}var _0x528c84=_0x585e9b[_0xcd2a('0x22')]();var _0x56cb8f={'account':_0x528c84,'message':_[_0xcd2a('0x23')]({'from':util[_0xcd2a('0x24')](_0xcd2a('0x25'),_0x585e9b[_0xcd2a('0xe')],_0x585e9b[_0xcd2a('0x26')]||_0x585e9b[_0xcd2a('0x27')][_0xcd2a('0x28')])},_0x43d529)};return client['request'](_0xcd2a('0x29'),_0x56cb8f);})[_0xcd2a('0xc')](function(_0x10338a){if(_0x10338a[_0xcd2a('0x2a')]){throw new Error(util[_0xcd2a('0x24')](_0xcd2a('0x2b'),_0x10338a[_0xcd2a('0x2a')]['message']||JSON[_0xcd2a('0x2c')](_0x10338a[_0xcd2a('0x2a')])));}return!![];});}function handleError(_0x3c28b0,_0xade0c7,_0xd06ade){return _0x3c28b0[_0xcd2a('0x2d')](_0xade0c7||0x1f4)[_0xcd2a('0x2e')]({'message':_0xd06ade?_0xd06ade[_0xcd2a('0x2f')]||_0xd06ade:''});}exports[_0xcd2a('0x30')]=function(_0x284d79,_0xe3ae25,_0x302c4a){passport[_0xcd2a('0x17')]('local-login',function(_0xbcee8e,_0x18846a,_0x5e1baf){var _0x3407c2=_0xbcee8e||_0x5e1baf;if(_0x3407c2){return handleError(_0xe3ae25,0x191,_0x3407c2);}if(!_0x18846a){return handleError(_0xe3ae25,0x194,{'message':_0xcd2a('0x31')});}else{var _0x5501aa={'payload':{'id':_0x18846a['id'],'role':_0x18846a[_0xcd2a('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5501aa)[_0xcd2a('0xc')](function(_0x27f7b9){_0xe3ae25['json']({'id':_0x18846a['id'],'token':_0x27f7b9,'statusCall':'','isAlreadyLogged':_0x18846a['online']});});}})(_0x284d79,_0xe3ae25,_0x302c4a);};exports['forgot']=function(_0x37e981,_0x1a6875){if(!_0x37e981[_0xcd2a('0x32')][_0xcd2a('0x26')]){return handleError(_0x1a6875,0x1f4,{'message':_0xcd2a('0x33')});}var _0xef5d50=rs[_0xcd2a('0x34')]();_0x37e981[_0xcd2a('0x32')][_0xcd2a('0x26')]=_0x37e981[_0xcd2a('0x32')][_0xcd2a('0x26')]['trim']()[_0xcd2a('0x35')]();var _0x452fec;return db[_0xcd2a('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xcd2a('0x19')],'raw':!![]})[_0xcd2a('0xc')](function(_0x9c33b7){_0x452fec=_0x9c33b7;return db[_0xcd2a('0x36')][_0xcd2a('0x37')]({'where':{'email':_0x37e981[_0xcd2a('0x32')]['email']}});})['then'](function(_0x5a6c06){if(!_0x5a6c06){throw new Error(_0xcd2a('0x38'));}if(_0x5a6c06[_0xcd2a('0x12')]){throw new Error(_0xcd2a('0x39'));}if(_0x5a6c06['blocked']){if(moment(_0x5a6c06[_0xcd2a('0x13')])['add'](_0x452fec[_0xcd2a('0x19')],_0xcd2a('0x1b'))>moment()){throw new Error(_0xcd2a('0x3a'));}else{_0x5a6c06['blocked']=![];_0x5a6c06['blockedAt']=null;}}_0x5a6c06[_0xcd2a('0x3b')]=_0xef5d50;_0x5a6c06[_0xcd2a('0x3c')]=Date[_0xcd2a('0x3d')]()+0x36ee80;return _0x5a6c06[_0xcd2a('0x3e')]();})[_0xcd2a('0xc')](function(){return sendServiceMail({'to':_0x37e981['body'][_0xcd2a('0x26')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xcd2a('0x3f')+_0xcd2a('0x40')+_0xcd2a('0x41')+_0x37e981[_0xcd2a('0x42')]['host']+_0xcd2a('0x43')+_0xef5d50+'\x0a\x0a'+_0xcd2a('0x44')});})[_0xcd2a('0xc')](function(){_0x1a6875[_0xcd2a('0x2d')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xcd2a('0x1d')](function(_0x3d08f5){return handleError(_0x1a6875,0x1f4,_0x3d08f5);});};exports['reset']=function(_0x3732a0,_0x6446e){return db[_0xcd2a('0x36')][_0xcd2a('0x37')]({'where':{'resetPasswordToken':_0x3732a0[_0xcd2a('0x45')][_0xcd2a('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xcd2a('0xc')](function(_0x11edca){if(!_0x11edca){throw new Error(_0xcd2a('0x47'));}return db['Setting']['findOne']({'attributes':['id',_0xcd2a('0x48'),_0xcd2a('0x49'),_0xcd2a('0x4a')]})[_0xcd2a('0xc')](function(_0x3f308d){if(_0x3f308d[_0xcd2a('0x48')])authService['validatePasswordPattern'](_0x3732a0[_0xcd2a('0x32')][_0xcd2a('0xf')]);if(!_0x3f308d[_0xcd2a('0x49')]||!_0x11edca['previousPasswords'])return _0x11edca;authService[_0xcd2a('0x4b')](_0x3732a0[_0xcd2a('0x32')][_0xcd2a('0xf')],_0x11edca[_0xcd2a('0x4c')],_0x3f308d[_0xcd2a('0x4a')]);return _0x11edca;})[_0xcd2a('0xc')](function(){_0x11edca['password']=_0x3732a0[_0xcd2a('0x32')]['password'];_0x11edca[_0xcd2a('0x3b')]=null;_0x11edca[_0xcd2a('0x3c')]=null;return _0x11edca['save']();});})['then'](function(){_0x6446e['status'](0xc8)['send']({'message':_0xcd2a('0x4d')});})[_0xcd2a('0x1d')](function(_0x29aadf){return handleError(_0x6446e,0x1f4,_0x29aadf);});};passport['use'](_0xcd2a('0x4e'),new LocalStrategy({'usernameField':_0xcd2a('0xe'),'passwordField':'password'},function(_0x14bf5c,_0x6343d9,_0x170fe6){return localAuthenticate(db[_0xcd2a('0x36')],_0x14bf5c,_0x6343d9,_0x170fe6);}));
\ No newline at end of file
+var _0xf527=['json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','catch','reset','params','token','now','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','blockDuration','add','clearBlockUser','minutes','getLicense','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x4d91d7,_0x296f97){var _0x42552e=function(_0x170abe){while(--_0x170abe){_0x4d91d7['push'](_0x4d91d7['shift']());}};_0x42552e(++_0x296f97);}(_0xf527,0x16e));var _0x7f52=function(_0x5e5d04,_0x1cafb2){_0x5e5d04=_0x5e5d04-0x0;var _0x5dfb76=_0xf527[_0x5e5d04];return _0x5dfb76;};'use strict';var util=require(_0x7f52('0x0'));var passport=require(_0x7f52('0x1'));var LocalStrategy=require(_0x7f52('0x2'))['Strategy'];var jayson=require(_0x7f52('0x3'));var _=require('lodash');var rs=require(_0x7f52('0x4'));var moment=require('moment');var db=require(_0x7f52('0x5'))['db'];var authService=require(_0x7f52('0x6'));var utils=require(_0x7f52('0x7'));var client=jayson['client'][_0x7f52('0x8')]({'port':0x232b});function localAuthenticate(_0x3e6468,_0x403009,_0x234283,_0x409d29){var _0x4f8e5f,_0x1aafdc;return db[_0x7f52('0x9')][_0x7f52('0xa')]({'where':{'id':0x1},'attributes':[_0x7f52('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x216438){_0x4f8e5f=_0x216438;return _0x3e6468[_0x7f52('0xa')]({'attributes':['id','name',_0x7f52('0xc'),_0x7f52('0xd'),_0x7f52('0xe'),_0x7f52('0xf'),_0x7f52('0x10'),_0x7f52('0x11'),_0x7f52('0x12')],'where':{'name':_0x403009,'role':{'$or':[_0x7f52('0x13'),_0x7f52('0x14'),'agent']}}});})['then'](function(_0x2937d9){if(!_0x2937d9||_0x2937d9&&_0x2937d9[_0x7f52('0x15')]!==_0x403009){throw new Error(_0x7f52('0x16'));}else{_0x1aafdc=_0x2937d9;return _0x1aafdc;}})[_0x7f52('0x17')](function(){_0x1aafdc['authenticate'](_0x234283,function(_0x58d408,_0x7f68b8){var _0x43212c=_0x1aafdc[_0x7f52('0x12')]+0x1;if(_0x58d408){return _0x409d29(_0x58d408);}else if(!_0x7f68b8){if(_0x1aafdc['disabled']){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else if(_0x4f8e5f[_0x7f52('0xb')]>0x0){if(_0x1aafdc[_0x7f52('0x10')]){if(_0x4f8e5f[_0x7f52('0x18')]>0x0){if(moment(_0x1aafdc[_0x7f52('0x11')])[_0x7f52('0x19')](_0x4f8e5f[_0x7f52('0x18')],'minutes')>moment()){return _0x409d29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7f52('0x1a')](_0x1aafdc,_0x43212c,![],null)['then'](function(){return _0x409d29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x409d29(null,![],{'message':_0x7f52('0x16')});}}else{if(_0x43212c>=_0x4f8e5f[_0x7f52('0xb')]){return utils[_0x7f52('0x1a')](_0x1aafdc,0x0,!![],moment())[_0x7f52('0x17')](function(){return _0x409d29(null,![],{'message':_0x7f52('0x16')});});}else{return utils[_0x7f52('0x1a')](_0x1aafdc,_0x43212c,![],null)[_0x7f52('0x17')](function(){return _0x409d29(null,![],{'message':_0x7f52('0x16')});});}}}else{return _0x409d29(null,![],{'message':_0x7f52('0x16')});}}else{if(_0x1aafdc[_0x7f52('0xf')]){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else if(_0x4f8e5f['allowedLoginAttempts']>0x0){if(_0x1aafdc[_0x7f52('0x10')]){if(_0x4f8e5f['blockDuration']>0x0){if(moment(_0x1aafdc[_0x7f52('0x11')])[_0x7f52('0x19')](_0x4f8e5f['blockDuration'],_0x7f52('0x1b'))>moment()){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else{return utils[_0x7f52('0x1a')](_0x1aafdc,0x0,![],null)[_0x7f52('0x17')](function(){return utils['getLicense'](_0x1aafdc);})[_0x7f52('0x17')](function(){return _0x409d29(null,_0x1aafdc);});}}else{return _0x409d29(null,![],{'message':_0x7f52('0x16')});}}else{return utils[_0x7f52('0x1a')](_0x1aafdc,0x0,![],null)[_0x7f52('0x17')](function(){return utils[_0x7f52('0x1c')](_0x1aafdc);})[_0x7f52('0x17')](function(){return _0x409d29(null,_0x1aafdc);})['catch'](function(_0x38c146){return _0x409d29(null,![],_0x38c146);});}}else{if(_0x1aafdc[_0x7f52('0x10')]){return _0x409d29(null,![],{'message':_0x7f52('0x16')});}else{return utils[_0x7f52('0x1c')](_0x1aafdc)['then'](function(){return _0x409d29(null,_0x1aafdc);});}}}});})['catch'](function(_0xb4e9ac){return _0x409d29(null,![],_0xb4e9ac);});}function sendServiceMail(_0x707fbf){return db[_0x7f52('0x1d')][_0x7f52('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x7f52('0x15'),'email'],'include':[{'model':db[_0x7f52('0x1f')],'as':_0x7f52('0x20'),'include':[{'model':db[_0x7f52('0x21')],'as':_0x7f52('0x21')}]}]})[_0x7f52('0x17')](function(_0x839b18){if(!_0x839b18){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4a6862=_0x839b18[_0x7f52('0x22')]();var _0x5d233c={'account':_0x4a6862,'message':_[_0x7f52('0x23')]({'from':util['format'](_0x7f52('0x24'),_0x839b18[_0x7f52('0x15')],_0x839b18[_0x7f52('0x25')]||_0x839b18[_0x7f52('0x20')][_0x7f52('0x14')])},_0x707fbf)};return client[_0x7f52('0x26')](_0x7f52('0x27'),_0x5d233c);})[_0x7f52('0x17')](function(_0x5b67a1){if(_0x5b67a1[_0x7f52('0x28')]){throw new Error(util[_0x7f52('0x29')](_0x7f52('0x2a'),_0x5b67a1[_0x7f52('0x28')]['message']||JSON[_0x7f52('0x2b')](_0x5b67a1[_0x7f52('0x28')])));}return!![];});}function handleError(_0x7500ca,_0x2621f4,_0x32883f){return _0x7500ca['status'](_0x2621f4||0x1f4)[_0x7f52('0x2c')]({'message':_0x32883f?_0x32883f[_0x7f52('0x2d')]||_0x32883f:''});}exports[_0x7f52('0x2e')]=function(_0x55f004,_0x13330f,_0x533234){passport['authenticate'](_0x7f52('0x2f'),function(_0x596dcd,_0x3c3e11,_0x426ed5){var _0x4b2f2b=_0x596dcd||_0x426ed5;if(_0x4b2f2b){return handleError(_0x13330f,0x191,_0x4b2f2b);}if(!_0x3c3e11){return handleError(_0x13330f,0x194,{'message':_0x7f52('0x30')});}else{var _0x3435cb={'payload':{'id':_0x3c3e11['id'],'role':_0x3c3e11[_0x7f52('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3435cb)[_0x7f52('0x17')](function(_0x9d535f){_0x13330f[_0x7f52('0x31')]({'id':_0x3c3e11['id'],'token':_0x9d535f,'statusCall':'','isAlreadyLogged':_0x3c3e11['online']});});}})(_0x55f004,_0x13330f,_0x533234);};exports[_0x7f52('0x32')]=function(_0x49c76f,_0x4d4430){if(!_0x49c76f['body']['email']){return handleError(_0x4d4430,0x1f4,{'message':_0x7f52('0x33')});}var _0x18e398=rs[_0x7f52('0x34')]();_0x49c76f[_0x7f52('0x35')][_0x7f52('0x25')]=_0x49c76f['body'][_0x7f52('0x25')][_0x7f52('0x36')]()[_0x7f52('0x37')]();var _0x7a3ec0;return db[_0x7f52('0x9')][_0x7f52('0xa')]({'where':{'id':0x1},'attributes':[_0x7f52('0xb'),_0x7f52('0x18')],'raw':!![]})['then'](function(_0x4520a9){_0x7a3ec0=_0x4520a9;return db[_0x7f52('0x38')]['find']({'where':{'email':_0x49c76f[_0x7f52('0x35')]['email']}});})[_0x7f52('0x17')](function(_0x1b9911){if(!_0x1b9911){throw new Error(_0x7f52('0x39'));}if(_0x1b9911['disabled']){throw new Error(_0x7f52('0x3a'));}if(_0x1b9911[_0x7f52('0x10')]){if(moment(_0x1b9911[_0x7f52('0x11')])[_0x7f52('0x19')](_0x7a3ec0[_0x7f52('0x18')],_0x7f52('0x1b'))>moment()){throw new Error(_0x7f52('0x3b'));}else{_0x1b9911[_0x7f52('0x10')]=![];_0x1b9911['blockedAt']=null;}}_0x1b9911[_0x7f52('0x3c')]=_0x18e398;_0x1b9911[_0x7f52('0x3d')]=Date['now']()+0x36ee80;return _0x1b9911[_0x7f52('0x3e')]();})[_0x7f52('0x17')](function(){return sendServiceMail({'to':_0x49c76f[_0x7f52('0x35')][_0x7f52('0x25')],'subject':_0x7f52('0x3f'),'text':_0x7f52('0x40')+_0x7f52('0x41')+_0x7f52('0x42')+_0x49c76f['headers'][_0x7f52('0x43')]+_0x7f52('0x44')+_0x18e398+'\x0a\x0a'+_0x7f52('0x45')});})[_0x7f52('0x17')](function(){_0x4d4430['status'](0xc8)[_0x7f52('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0x7f52('0x46')](function(_0x52b226){return handleError(_0x4d4430,0x1f4,_0x52b226);});};exports[_0x7f52('0x47')]=function(_0x55ba74,_0x104b83){return db[_0x7f52('0x38')][_0x7f52('0x1e')]({'where':{'resetPasswordToken':_0x55ba74[_0x7f52('0x48')][_0x7f52('0x49')],'resetPasswordExpires':{'$gt':Date[_0x7f52('0x4a')]()}}})[_0x7f52('0x17')](function(_0x3f2f62){if(!_0x3f2f62){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x7f52('0x9')][_0x7f52('0xa')]({'attributes':['id',_0x7f52('0x4b'),'enforcePasswordHistory',_0x7f52('0x4c')]})['then'](function(_0x4c68de){if(_0x4c68de[_0x7f52('0x4b')])authService[_0x7f52('0x4d')](_0x55ba74[_0x7f52('0x35')][_0x7f52('0xc')]);if(!_0x4c68de[_0x7f52('0x4e')]||!_0x3f2f62[_0x7f52('0x4f')])return _0x3f2f62;authService[_0x7f52('0x50')](_0x55ba74[_0x7f52('0x35')][_0x7f52('0xc')],_0x3f2f62[_0x7f52('0x4f')],_0x4c68de[_0x7f52('0x4c')]);return _0x3f2f62;})[_0x7f52('0x17')](function(){_0x3f2f62[_0x7f52('0xc')]=_0x55ba74[_0x7f52('0x35')][_0x7f52('0xc')];_0x3f2f62[_0x7f52('0x3c')]=null;_0x3f2f62[_0x7f52('0x3d')]=null;return _0x3f2f62['save']();});})[_0x7f52('0x17')](function(){_0x104b83['status'](0xc8)[_0x7f52('0x2c')]({'message':_0x7f52('0x51')});})[_0x7f52('0x46')](function(_0x4a813c){return handleError(_0x104b83,0x1f4,_0x4a813c);});};passport[_0x7f52('0x52')](_0x7f52('0x2f'),new LocalStrategy({'usernameField':_0x7f52('0x15'),'passwordField':'password'},function(_0x8a8c62,_0x5b5614,_0x1a91a7){return localAuthenticate(db[_0x7f52('0x38')],_0x8a8c62,_0x5b5614,_0x1a91a7);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 7643b9c..73f4580 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 _0x9bf3=['post','login','/forgot','forgot','/reset/:token','reset','express','./authLocal.controller'];(function(_0x2cc0f7,_0xa3e47f){var _0x5aeaeb=function(_0x501b4f){while(--_0x501b4f){_0x2cc0f7['push'](_0x2cc0f7['shift']());}};_0x5aeaeb(++_0xa3e47f);}(_0x9bf3,0x15e));var _0x39bf=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x9bf3[_0x38fb8b];return _0x1ec681;};'use strict';var express=require(_0x39bf('0x0'));var router=express['Router']();var controller=require(_0x39bf('0x1'));router[_0x39bf('0x2')]('/',controller[_0x39bf('0x3')]);router[_0x39bf('0x2')](_0x39bf('0x4'),controller[_0x39bf('0x5')]);router['post'](_0x39bf('0x6'),controller[_0x39bf('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x1da4=['Router','./authLocal.controller','login','/forgot','forgot','exports','express'];(function(_0xd2caa4,_0x1b0832){var _0x529077=function(_0x63898c){while(--_0x63898c){_0xd2caa4['push'](_0xd2caa4['shift']());}};_0x529077(++_0x1b0832);}(_0x1da4,0x92));var _0x41da=function(_0x34ccfb,_0x5c1fe4){_0x34ccfb=_0x34ccfb-0x0;var _0x50b1f7=_0x1da4[_0x34ccfb];return _0x50b1f7;};'use strict';var express=require(_0x41da('0x0'));var router=express[_0x41da('0x1')]();var controller=require(_0x41da('0x2'));router['post']('/',controller[_0x41da('0x3')]);router['post'](_0x41da('0x4'),controller[_0x41da('0x5')]);router['post']('/reset/:token',controller['reset']);module[_0x41da('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7040f57..9aa0c6e 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 _0xb889=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x3af704,_0x58486b){var _0x4ac16c=function(_0x1a49b8){while(--_0x1a49b8){_0x3af704['push'](_0x3af704['shift']());}};_0x4ac16c(++_0x58486b);}(_0xb889,0x74));var _0x9b88=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb889[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x9b88('0x0'));module[_0x9b88('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9b88('0x2')]},'description':{'type':Sequelize[_0x9b88('0x2')]},'status':{'type':Sequelize[_0x9b88('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9b88('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa8a3=['INTEGER','sequelize','STRING'];(function(_0x3f9ec3,_0x3dfd37){var _0xe85b13=function(_0x10e8ed){while(--_0x10e8ed){_0x3f9ec3['push'](_0x3f9ec3['shift']());}};_0xe85b13(++_0x3dfd37);}(_0xa8a3,0x100));var _0x3a8a=function(_0x53d71c,_0x1a3859){_0x53d71c=_0x53d71c-0x0;var _0x555efb=_0xa8a3[_0x53d71c];return _0x555efb;};'use strict';var Sequelize=require(_0x3a8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a8a('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3a8a('0x2')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 1f1a8f5..9b82575 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 _0xbae9=['squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','catch','create','update','body','find','addConditions','Condition','ids','getConditions','findOne','nolimit','addActions','omit','getActions','Action','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbae9,0xf1));var _0x9bae=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0xbae9[_0x190ff6];return _0x5356d2;};'use strict';var emlformat=require(_0x9bae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bae('0x1'));var jsonpatch=require(_0x9bae('0x2'));var rp=require(_0x9bae('0x3'));var moment=require(_0x9bae('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9bae('0x5'));var path=require(_0x9bae('0x6'));var sox=require(_0x9bae('0x7'));var csv=require('to-csv');var ejs=require(_0x9bae('0x8'));var fs=require('fs');var fs_extra=require(_0x9bae('0x9'));var _=require(_0x9bae('0xa'));var squel=require(_0x9bae('0xb'));var crypto=require(_0x9bae('0xc'));var jsforce=require(_0x9bae('0xd'));var deskjs=require(_0x9bae('0xe'));var toCsv=require(_0x9bae('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9bae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9bae('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bae('0x12'));var logger=require(_0x9bae('0x13'))('api');var utils=require(_0x9bae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9bae('0x15'))['db'];function respondWithStatusCode(_0xb5468b,_0x4cc90f){_0x4cc90f=_0x4cc90f||0xcc;return function(_0x394241){if(_0x394241){return _0xb5468b[_0x9bae('0x16')](_0x4cc90f);}return _0xb5468b[_0x9bae('0x17')](_0x4cc90f)['end']();};}function respondWithResult(_0x350607,_0xbc2672){_0xbc2672=_0xbc2672||0xc8;return function(_0x50a96d){if(_0x50a96d){return _0x350607['status'](_0xbc2672)['json'](_0x50a96d);}};}function respondWithFilteredResult(_0x47608d,_0x4f6386){return function(_0x3a74e4){if(_0x3a74e4){var _0x38958f=typeof _0x4f6386[_0x9bae('0x18')]===_0x9bae('0x19')&&typeof _0x4f6386[_0x9bae('0x1a')]==='undefined';var _0xb28449=_0x3a74e4[_0x9bae('0x1b')];var _0x1622e3=_0x38958f?0x0:_0x4f6386['offset'];var _0x5331c0=_0x38958f?_0x3a74e4[_0x9bae('0x1b')]:_0x4f6386[_0x9bae('0x18')]+_0x4f6386[_0x9bae('0x1a')];var _0x3b5c64;if(_0x5331c0>=_0xb28449){_0x5331c0=_0xb28449;_0x3b5c64=0xc8;}else{_0x3b5c64=0xce;}_0x47608d[_0x9bae('0x17')](_0x3b5c64);return _0x47608d[_0x9bae('0x1c')](_0x9bae('0x1d'),_0x1622e3+'-'+_0x5331c0+'/'+_0xb28449)['json'](_0x3a74e4);}return null;};}function patchUpdates(_0x1c8000){return function(_0x4f50f8){try{jsonpatch[_0x9bae('0x1e')](_0x4f50f8,_0x1c8000,!![]);}catch(_0x2cab56){return BPromise[_0x9bae('0x1f')](_0x2cab56);}return _0x4f50f8[_0x9bae('0x20')]();};}function saveUpdates(_0x4892fe,_0x195a7a){return function(_0x3b972c){if(_0x3b972c){return _0x3b972c['update'](_0x4892fe)[_0x9bae('0x21')](function(_0x255124){return _0x255124;});}return null;};}function removeEntity(_0x53bb32,_0x1afb0c){return function(_0x3050b4){if(_0x3050b4){return _0x3050b4[_0x9bae('0x22')]()[_0x9bae('0x21')](function(){_0x53bb32[_0x9bae('0x17')](0xcc)[_0x9bae('0x23')]();});}};}function handleEntityNotFound(_0x46e4dd,_0x44086d){return function(_0x19acbc){if(!_0x19acbc){_0x46e4dd['sendStatus'](0x194);}return _0x19acbc;};}function handleError(_0x13f074,_0x2d227a){_0x2d227a=_0x2d227a||0x1f4;return function(_0x24fa78){logger[_0x9bae('0x24')](_0x24fa78[_0x9bae('0x25')]);if(_0x24fa78[_0x9bae('0x26')]){delete _0x24fa78[_0x9bae('0x26')];}_0x13f074[_0x9bae('0x17')](_0x2d227a)[_0x9bae('0x27')](_0x24fa78);};}exports[_0x9bae('0x28')]=function(_0x54a9e0,_0x56aae3){var _0xfa36ab={},_0x19a780={},_0x91bb34={'count':0x0,'rows':[]};var _0x73643c=_[_0x9bae('0x29')](db[_0x9bae('0x2a')][_0x9bae('0x2b')],function(_0x8cf7dd){return{'name':_0x8cf7dd['fieldName'],'type':_0x8cf7dd[_0x9bae('0x2c')][_0x9bae('0x2d')]};});_0x19a780[_0x9bae('0x2e')]=_[_0x9bae('0x29')](_0x73643c,'name');_0x19a780[_0x9bae('0x2f')]=_['keys'](_0x54a9e0['query']);_0x19a780['filters']=_[_0x9bae('0x30')](_0x19a780[_0x9bae('0x2e')],_0x19a780['query']);_0xfa36ab[_0x9bae('0x31')]=_[_0x9bae('0x30')](_0x19a780[_0x9bae('0x2e')],qs[_0x9bae('0x32')](_0x54a9e0[_0x9bae('0x2f')][_0x9bae('0x32')]));_0xfa36ab['attributes']=_0xfa36ab[_0x9bae('0x31')]['length']?_0xfa36ab[_0x9bae('0x31')]:_0x19a780[_0x9bae('0x2e')];if(!_0x54a9e0[_0x9bae('0x2f')][_0x9bae('0x33')]('nolimit')){_0xfa36ab['limit']=qs['limit'](_0x54a9e0[_0x9bae('0x2f')][_0x9bae('0x1a')]);_0xfa36ab[_0x9bae('0x18')]=qs[_0x9bae('0x18')](_0x54a9e0['query'][_0x9bae('0x18')]);}_0xfa36ab['order']=qs[_0x9bae('0x34')](_0x54a9e0[_0x9bae('0x2f')][_0x9bae('0x34')]);_0xfa36ab[_0x9bae('0x35')]=qs['filters'](_[_0x9bae('0x36')](_0x54a9e0['query'],_0x19a780[_0x9bae('0x37')]),_0x73643c);if(_0x54a9e0[_0x9bae('0x2f')][_0x9bae('0x38')]){_0xfa36ab['where']=_[_0x9bae('0x39')](_0xfa36ab[_0x9bae('0x35')],{'$or':_[_0x9bae('0x29')](_0x73643c,function(_0x3dabd4){if(_0x3dabd4[_0x9bae('0x2c')]!==_0x9bae('0x3a')){var _0x365b83={};_0x365b83[_0x3dabd4[_0x9bae('0x26')]]={'$like':'%'+_0x54a9e0[_0x9bae('0x2f')]['filter']+'%'};return _0x365b83;}})});}_0xfa36ab=_['merge']({},_0xfa36ab,_0x54a9e0[_0x9bae('0x3b')]);var _0x49b376={'where':_0xfa36ab['where']};return db[_0x9bae('0x2a')][_0x9bae('0x1b')](_0x49b376)[_0x9bae('0x21')](function(_0xc615c){_0x91bb34[_0x9bae('0x1b')]=_0xc615c;if(_0x54a9e0[_0x9bae('0x2f')][_0x9bae('0x3c')]){_0xfa36ab[_0x9bae('0x3d')]=[{'all':!![]}];}return db[_0x9bae('0x2a')][_0x9bae('0x3e')](_0xfa36ab);})[_0x9bae('0x21')](function(_0x1cc5b0){_0x91bb34[_0x9bae('0x3f')]=_0x1cc5b0;return _0x91bb34;})['then'](respondWithFilteredResult(_0x56aae3,_0xfa36ab))['catch'](handleError(_0x56aae3,null));};exports[_0x9bae('0x40')]=function(_0x1c2362,_0x2c1c84){var _0x2a8628={'raw':![],'where':{'id':_0x1c2362[_0x9bae('0x41')]['id']}},_0x808c88={};_0x808c88[_0x9bae('0x2e')]=_['keys'](db[_0x9bae('0x2a')]['rawAttributes']);_0x808c88[_0x9bae('0x2f')]=_[_0x9bae('0x42')](_0x1c2362[_0x9bae('0x2f')]);_0x808c88[_0x9bae('0x37')]=_[_0x9bae('0x30')](_0x808c88[_0x9bae('0x2e')],_0x808c88[_0x9bae('0x2f')]);_0x2a8628[_0x9bae('0x31')]=_[_0x9bae('0x30')](_0x808c88[_0x9bae('0x2e')],qs[_0x9bae('0x32')](_0x1c2362[_0x9bae('0x2f')][_0x9bae('0x32')]));_0x2a8628[_0x9bae('0x31')]=_0x2a8628[_0x9bae('0x31')][_0x9bae('0x43')]?_0x2a8628['attributes']:_0x808c88[_0x9bae('0x2e')];if(_0x1c2362[_0x9bae('0x2f')]['includeAll']){_0x2a8628[_0x9bae('0x3d')]=[{'all':!![]}];}_0x2a8628=_[_0x9bae('0x39')]({},_0x2a8628,_0x1c2362[_0x9bae('0x3b')]);return db[_0x9bae('0x2a')]['find'](_0x2a8628)['then'](handleEntityNotFound(_0x2c1c84,null))[_0x9bae('0x21')](respondWithResult(_0x2c1c84,null))[_0x9bae('0x44')](handleError(_0x2c1c84,null));};exports[_0x9bae('0x45')]=function(_0x5972e7,_0x1b8988){return db[_0x9bae('0x2a')]['create'](_0x5972e7['body'],{})[_0x9bae('0x21')](respondWithResult(_0x1b8988,0xc9))[_0x9bae('0x44')](handleError(_0x1b8988,null));};exports[_0x9bae('0x46')]=function(_0x4a7cbb,_0x299373){if(_0x4a7cbb[_0x9bae('0x47')]['id']){delete _0x4a7cbb[_0x9bae('0x47')]['id'];}return db[_0x9bae('0x2a')]['find']({'where':{'id':_0x4a7cbb[_0x9bae('0x41')]['id']}})[_0x9bae('0x21')](handleEntityNotFound(_0x299373,null))[_0x9bae('0x21')](saveUpdates(_0x4a7cbb[_0x9bae('0x47')],null))[_0x9bae('0x21')](respondWithResult(_0x299373,null))[_0x9bae('0x44')](handleError(_0x299373,null));};exports['destroy']=function(_0xecb3b8,_0x4a2d2a){return db[_0x9bae('0x2a')][_0x9bae('0x48')]({'where':{'id':_0xecb3b8[_0x9bae('0x41')]['id']}})['then'](handleEntityNotFound(_0x4a2d2a,null))[_0x9bae('0x21')](removeEntity(_0x4a2d2a,null))[_0x9bae('0x44')](handleError(_0x4a2d2a,null));};exports[_0x9bae('0x49')]=function(_0x532fae,_0x2e7cb5,_0x219caf){return db[_0x9bae('0x4a')][_0x9bae('0x48')]({'where':{'id':_0x532fae['params']['id']}})[_0x9bae('0x21')](handleEntityNotFound(_0x2e7cb5,null))['then'](function(_0x8720a3){if(_0x8720a3){return _0x8720a3[_0x9bae('0x49')](_0x532fae[_0x9bae('0x47')][_0x9bae('0x4b')],_['omit'](_0x532fae[_0x9bae('0x47')],[_0x9bae('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x2e7cb5,null))[_0x9bae('0x44')](handleError(_0x2e7cb5,null));};exports[_0x9bae('0x4c')]=function(_0x26543b,_0x4ade92,_0x355df4){var _0x9aa7b4={};var _0x599cc6={};var _0x4b1944;var _0x53d600;return db[_0x9bae('0x2a')][_0x9bae('0x4d')]({'where':{'id':_0x26543b['params']['id']}})[_0x9bae('0x21')](handleEntityNotFound(_0x4ade92,null))[_0x9bae('0x21')](function(_0x3f65ec){if(_0x3f65ec){_0x4b1944=_0x3f65ec;_0x599cc6['model']=_[_0x9bae('0x42')](db[_0x9bae('0x4a')][_0x9bae('0x2b')]);_0x599cc6['query']=_[_0x9bae('0x42')](_0x26543b[_0x9bae('0x2f')]);_0x599cc6[_0x9bae('0x37')]=_['intersection'](_0x599cc6[_0x9bae('0x2e')],_0x599cc6[_0x9bae('0x2f')]);_0x9aa7b4['attributes']=_[_0x9bae('0x30')](_0x599cc6[_0x9bae('0x2e')],qs[_0x9bae('0x32')](_0x26543b[_0x9bae('0x2f')]['fields']));_0x9aa7b4[_0x9bae('0x31')]=_0x9aa7b4[_0x9bae('0x31')][_0x9bae('0x43')]?_0x9aa7b4[_0x9bae('0x31')]:_0x599cc6[_0x9bae('0x2e')];_0x9aa7b4['order']=qs[_0x9bae('0x34')](_0x26543b['query'][_0x9bae('0x34')]);_0x9aa7b4[_0x9bae('0x35')]=qs[_0x9bae('0x37')](_[_0x9bae('0x36')](_0x26543b[_0x9bae('0x2f')],_0x599cc6[_0x9bae('0x37')]));if(_0x26543b['query'][_0x9bae('0x38')]){_0x9aa7b4[_0x9bae('0x35')]=_['merge'](_0x9aa7b4[_0x9bae('0x35')],{'$or':_[_0x9bae('0x29')](_0x9aa7b4[_0x9bae('0x31')],function(_0x3a3261){var _0x373e34={};_0x373e34[_0x3a3261]={'$like':'%'+_0x26543b['query'][_0x9bae('0x38')]+'%'};return _0x373e34;})});}_0x9aa7b4=_[_0x9bae('0x39')]({},_0x9aa7b4,_0x26543b[_0x9bae('0x3b')]);return _0x4b1944[_0x9bae('0x4c')](_0x9aa7b4);}})[_0x9bae('0x21')](function(_0x343f9c){if(_0x343f9c){_0x53d600=_0x343f9c[_0x9bae('0x43')];if(!_0x26543b['query']['hasOwnProperty'](_0x9bae('0x4e'))){_0x9aa7b4[_0x9bae('0x1a')]=qs[_0x9bae('0x1a')](_0x26543b[_0x9bae('0x2f')]['limit']);_0x9aa7b4[_0x9bae('0x18')]=qs[_0x9bae('0x18')](_0x26543b[_0x9bae('0x2f')][_0x9bae('0x18')]);}return _0x4b1944['getConditions'](_0x9aa7b4);}})[_0x9bae('0x21')](function(_0x1cb316){if(_0x1cb316){return _0x1cb316?{'count':_0x53d600,'rows':_0x1cb316}:null;}})[_0x9bae('0x21')](respondWithResult(_0x4ade92,null))[_0x9bae('0x44')](handleError(_0x4ade92,null));};exports[_0x9bae('0x4f')]=function(_0x38d4ab,_0x2b48dc,_0x50fb14){return db['Action'][_0x9bae('0x48')]({'where':{'id':_0x38d4ab[_0x9bae('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b48dc,null))[_0x9bae('0x21')](function(_0x419d06){if(_0x419d06){return _0x419d06[_0x9bae('0x4f')](_0x38d4ab[_0x9bae('0x47')][_0x9bae('0x4b')],_[_0x9bae('0x50')](_0x38d4ab['body'],[_0x9bae('0x4b'),'id'])||{});}})[_0x9bae('0x21')](respondWithResult(_0x2b48dc,null))[_0x9bae('0x44')](handleError(_0x2b48dc,null));};exports[_0x9bae('0x51')]=function(_0x5bc871,_0x41e813,_0x599d66){var _0x543fce={};var _0x4004dc={};var _0x2847aa;var _0x142d43;return db[_0x9bae('0x2a')][_0x9bae('0x4d')]({'where':{'id':_0x5bc871[_0x9bae('0x41')]['id']}})[_0x9bae('0x21')](handleEntityNotFound(_0x41e813,null))[_0x9bae('0x21')](function(_0x51b548){if(_0x51b548){_0x2847aa=_0x51b548;_0x4004dc[_0x9bae('0x2e')]=_['keys'](db[_0x9bae('0x52')][_0x9bae('0x2b')]);_0x4004dc[_0x9bae('0x2f')]=_[_0x9bae('0x42')](_0x5bc871['query']);_0x4004dc[_0x9bae('0x37')]=_[_0x9bae('0x30')](_0x4004dc[_0x9bae('0x2e')],_0x4004dc[_0x9bae('0x2f')]);_0x543fce[_0x9bae('0x31')]=_['intersection'](_0x4004dc[_0x9bae('0x2e')],qs[_0x9bae('0x32')](_0x5bc871[_0x9bae('0x2f')]['fields']));_0x543fce[_0x9bae('0x31')]=_0x543fce[_0x9bae('0x31')][_0x9bae('0x43')]?_0x543fce['attributes']:_0x4004dc[_0x9bae('0x2e')];_0x543fce[_0x9bae('0x53')]=qs[_0x9bae('0x34')](_0x5bc871[_0x9bae('0x2f')]['sort']);_0x543fce[_0x9bae('0x35')]=qs[_0x9bae('0x37')](_[_0x9bae('0x36')](_0x5bc871[_0x9bae('0x2f')],_0x4004dc[_0x9bae('0x37')]));if(_0x5bc871[_0x9bae('0x2f')][_0x9bae('0x38')]){_0x543fce['where']=_[_0x9bae('0x39')](_0x543fce[_0x9bae('0x35')],{'$or':_[_0x9bae('0x29')](_0x543fce[_0x9bae('0x31')],function(_0x60f905){var _0x26e8dc={};_0x26e8dc[_0x60f905]={'$like':'%'+_0x5bc871[_0x9bae('0x2f')]['filter']+'%'};return _0x26e8dc;})});}_0x543fce=_[_0x9bae('0x39')]({},_0x543fce,_0x5bc871[_0x9bae('0x3b')]);return _0x2847aa['getActions'](_0x543fce);}})['then'](function(_0x50cb51){if(_0x50cb51){_0x142d43=_0x50cb51['length'];if(!_0x5bc871['query']['hasOwnProperty'](_0x9bae('0x4e'))){_0x543fce[_0x9bae('0x1a')]=qs['limit'](_0x5bc871[_0x9bae('0x2f')][_0x9bae('0x1a')]);_0x543fce[_0x9bae('0x18')]=qs['offset'](_0x5bc871['query'][_0x9bae('0x18')]);}return _0x2847aa[_0x9bae('0x51')](_0x543fce);}})['then'](function(_0x24575d){if(_0x24575d){return _0x24575d?{'count':_0x142d43,'rows':_0x24575d}:null;}})[_0x9bae('0x21')](respondWithResult(_0x41e813,null))['catch'](handleError(_0x41e813,null));};
\ No newline at end of file
+var _0x142c=['mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','Automation','includeAll','findAll','catch','show','params','keys','rawAttributes','include','find','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5f5d43,_0x11535a){var _0x80703a=function(_0x56e764){while(--_0x56e764){_0x5f5d43['push'](_0x5f5d43['shift']());}};_0x80703a(++_0x11535a);}(_0x142c,0x14a));var _0xc142=function(_0x444ce3,_0x5e680d){_0x444ce3=_0x444ce3-0x0;var _0x242542=_0x142c[_0x444ce3];return _0x242542;};'use strict';var emlformat=require(_0xc142('0x0'));var rimraf=require(_0xc142('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc142('0x2'));var rp=require(_0xc142('0x3'));var moment=require(_0xc142('0x4'));var BPromise=require(_0xc142('0x5'));var Mustache=require(_0xc142('0x6'));var util=require(_0xc142('0x7'));var path=require(_0xc142('0x8'));var sox=require(_0xc142('0x9'));var csv=require(_0xc142('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc142('0xb'));var _=require(_0xc142('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc142('0xd'));var deskjs=require(_0xc142('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc142('0xf'));var Papa=require(_0xc142('0x10'));var Redis=require(_0xc142('0x11'));var authService=require(_0xc142('0x12'));var qs=require(_0xc142('0x13'));var as=require(_0xc142('0x14'));var hardwareService=require(_0xc142('0x15'));var logger=require('../../config/logger')(_0xc142('0x16'));var utils=require('../../config/utils');var config=require(_0xc142('0x17'));var licenseUtil=require(_0xc142('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22d456,_0x3a598e){_0x3a598e=_0x3a598e||0xcc;return function(_0x565676){if(_0x565676){return _0x22d456[_0xc142('0x19')](_0x3a598e);}return _0x22d456[_0xc142('0x1a')](_0x3a598e)['end']();};}function respondWithResult(_0x5344f9,_0x29a9ec){_0x29a9ec=_0x29a9ec||0xc8;return function(_0x292ea0){if(_0x292ea0){return _0x5344f9['status'](_0x29a9ec)[_0xc142('0x1b')](_0x292ea0);}};}function respondWithFilteredResult(_0x1ddeef,_0x75769d){return function(_0x107a80){if(_0x107a80){var _0x4dcc9a=typeof _0x75769d[_0xc142('0x1c')]===_0xc142('0x1d')&&typeof _0x75769d[_0xc142('0x1e')]===_0xc142('0x1d');var _0xa9955b=_0x107a80[_0xc142('0x1f')];var _0x502b1b=_0x4dcc9a?0x0:_0x75769d[_0xc142('0x1c')];var _0x1b276f=_0x4dcc9a?_0x107a80[_0xc142('0x1f')]:_0x75769d[_0xc142('0x1c')]+_0x75769d[_0xc142('0x1e')];var _0xadce74;if(_0x1b276f>=_0xa9955b){_0x1b276f=_0xa9955b;_0xadce74=0xc8;}else{_0xadce74=0xce;}_0x1ddeef[_0xc142('0x1a')](_0xadce74);return _0x1ddeef['set']('Content-Range',_0x502b1b+'-'+_0x1b276f+'/'+_0xa9955b)[_0xc142('0x1b')](_0x107a80);}return null;};}function patchUpdates(_0x190e38){return function(_0xbce09d){try{jsonpatch[_0xc142('0x20')](_0xbce09d,_0x190e38,!![]);}catch(_0x498519){return BPromise[_0xc142('0x21')](_0x498519);}return _0xbce09d[_0xc142('0x22')]();};}function saveUpdates(_0x57a3f8,_0x3f1665){return function(_0x1917ff){if(_0x1917ff){return _0x1917ff['update'](_0x57a3f8)[_0xc142('0x23')](function(_0x531a4f){return _0x531a4f;});}return null;};}function removeEntity(_0x33d85c,_0x2f455d){return function(_0x3d8d9b){if(_0x3d8d9b){return _0x3d8d9b[_0xc142('0x24')]()['then'](function(){_0x33d85c['status'](0xcc)[_0xc142('0x25')]();});}};}function handleEntityNotFound(_0x43508e,_0x4c298a){return function(_0x20595a){if(!_0x20595a){_0x43508e[_0xc142('0x19')](0x194);}return _0x20595a;};}function handleError(_0x137b5e,_0x214df2){_0x214df2=_0x214df2||0x1f4;return function(_0x393d30){logger[_0xc142('0x26')](_0x393d30['stack']);if(_0x393d30[_0xc142('0x27')]){delete _0x393d30[_0xc142('0x27')];}_0x137b5e['status'](_0x214df2)[_0xc142('0x28')](_0x393d30);};}exports[_0xc142('0x29')]=function(_0xece255,_0x2be855){var _0x3dc47c={},_0x597ecf={},_0x46f631={'count':0x0,'rows':[]};var _0x42d2e6=_[_0xc142('0x2a')](db['Automation']['rawAttributes'],function(_0x467c4f){return{'name':_0x467c4f[_0xc142('0x2b')],'type':_0x467c4f[_0xc142('0x2c')][_0xc142('0x2d')]};});_0x597ecf[_0xc142('0x2e')]=_[_0xc142('0x2a')](_0x42d2e6,_0xc142('0x27'));_0x597ecf['query']=_['keys'](_0xece255[_0xc142('0x2f')]);_0x597ecf[_0xc142('0x30')]=_[_0xc142('0x31')](_0x597ecf[_0xc142('0x2e')],_0x597ecf[_0xc142('0x2f')]);_0x3dc47c[_0xc142('0x32')]=_['intersection'](_0x597ecf[_0xc142('0x2e')],qs[_0xc142('0x33')](_0xece255['query']['fields']));_0x3dc47c[_0xc142('0x32')]=_0x3dc47c[_0xc142('0x32')][_0xc142('0x34')]?_0x3dc47c[_0xc142('0x32')]:_0x597ecf[_0xc142('0x2e')];if(!_0xece255[_0xc142('0x2f')][_0xc142('0x35')](_0xc142('0x36'))){_0x3dc47c[_0xc142('0x1e')]=qs[_0xc142('0x1e')](_0xece255[_0xc142('0x2f')]['limit']);_0x3dc47c[_0xc142('0x1c')]=qs[_0xc142('0x1c')](_0xece255[_0xc142('0x2f')][_0xc142('0x1c')]);}_0x3dc47c[_0xc142('0x37')]=qs[_0xc142('0x38')](_0xece255['query'][_0xc142('0x38')]);_0x3dc47c['where']=qs[_0xc142('0x30')](_[_0xc142('0x39')](_0xece255['query'],_0x597ecf['filters']),_0x42d2e6);if(_0xece255[_0xc142('0x2f')][_0xc142('0x3a')]){_0x3dc47c['where']=_[_0xc142('0x3b')](_0x3dc47c[_0xc142('0x3c')],{'$or':_['map'](_0x42d2e6,function(_0x2e37f6){if(_0x2e37f6[_0xc142('0x2c')]!=='VIRTUAL'){var _0x306422={};_0x306422[_0x2e37f6[_0xc142('0x27')]]={'$like':'%'+_0xece255['query']['filter']+'%'};return _0x306422;}})});}_0x3dc47c=_[_0xc142('0x3b')]({},_0x3dc47c,_0xece255[_0xc142('0x3d')]);var _0x4bf33c={'where':_0x3dc47c[_0xc142('0x3c')]};return db[_0xc142('0x3e')][_0xc142('0x1f')](_0x4bf33c)[_0xc142('0x23')](function(_0x74e3cc){_0x46f631['count']=_0x74e3cc;if(_0xece255[_0xc142('0x2f')][_0xc142('0x3f')]){_0x3dc47c['include']=[{'all':!![]}];}return db[_0xc142('0x3e')][_0xc142('0x40')](_0x3dc47c);})[_0xc142('0x23')](function(_0x2ef735){_0x46f631['rows']=_0x2ef735;return _0x46f631;})[_0xc142('0x23')](respondWithFilteredResult(_0x2be855,_0x3dc47c))[_0xc142('0x41')](handleError(_0x2be855,null));};exports[_0xc142('0x42')]=function(_0x3c90d1,_0x3b51ae){var _0x55c889={'raw':![],'where':{'id':_0x3c90d1[_0xc142('0x43')]['id']}},_0x1fe92d={};_0x1fe92d[_0xc142('0x2e')]=_[_0xc142('0x44')](db[_0xc142('0x3e')][_0xc142('0x45')]);_0x1fe92d['query']=_[_0xc142('0x44')](_0x3c90d1['query']);_0x1fe92d[_0xc142('0x30')]=_[_0xc142('0x31')](_0x1fe92d['model'],_0x1fe92d[_0xc142('0x2f')]);_0x55c889['attributes']=_[_0xc142('0x31')](_0x1fe92d[_0xc142('0x2e')],qs[_0xc142('0x33')](_0x3c90d1['query'][_0xc142('0x33')]));_0x55c889['attributes']=_0x55c889[_0xc142('0x32')][_0xc142('0x34')]?_0x55c889[_0xc142('0x32')]:_0x1fe92d[_0xc142('0x2e')];if(_0x3c90d1['query'][_0xc142('0x3f')]){_0x55c889[_0xc142('0x46')]=[{'all':!![]}];}_0x55c889=_[_0xc142('0x3b')]({},_0x55c889,_0x3c90d1['options']);return db[_0xc142('0x3e')][_0xc142('0x47')](_0x55c889)[_0xc142('0x23')](handleEntityNotFound(_0x3b51ae,null))[_0xc142('0x23')](respondWithResult(_0x3b51ae,null))[_0xc142('0x41')](handleError(_0x3b51ae,null));};exports[_0xc142('0x48')]=function(_0x1ed373,_0x17022b){return db[_0xc142('0x3e')]['create'](_0x1ed373[_0xc142('0x49')],{})[_0xc142('0x23')](respondWithResult(_0x17022b,0xc9))[_0xc142('0x41')](handleError(_0x17022b,null));};exports[_0xc142('0x4a')]=function(_0x5e3b49,_0x25fa77){if(_0x5e3b49['body']['id']){delete _0x5e3b49[_0xc142('0x49')]['id'];}return db[_0xc142('0x3e')][_0xc142('0x47')]({'where':{'id':_0x5e3b49['params']['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x25fa77,null))['then'](saveUpdates(_0x5e3b49['body'],null))['then'](respondWithResult(_0x25fa77,null))[_0xc142('0x41')](handleError(_0x25fa77,null));};exports[_0xc142('0x24')]=function(_0x5cbe71,_0x38b096){return db[_0xc142('0x3e')][_0xc142('0x47')]({'where':{'id':_0x5cbe71[_0xc142('0x43')]['id']}})['then'](handleEntityNotFound(_0x38b096,null))[_0xc142('0x23')](removeEntity(_0x38b096,null))[_0xc142('0x41')](handleError(_0x38b096,null));};exports[_0xc142('0x4b')]=function(_0x10efba,_0x44dcd0,_0x4ef07d){return db[_0xc142('0x4c')][_0xc142('0x47')]({'where':{'id':_0x10efba[_0xc142('0x43')]['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x44dcd0,null))[_0xc142('0x23')](function(_0x46c9cf){if(_0x46c9cf){return _0x46c9cf[_0xc142('0x4b')](_0x10efba['body'][_0xc142('0x4d')],_[_0xc142('0x4e')](_0x10efba[_0xc142('0x49')],[_0xc142('0x4d'),'id'])||{});}})[_0xc142('0x23')](respondWithResult(_0x44dcd0,null))[_0xc142('0x41')](handleError(_0x44dcd0,null));};exports[_0xc142('0x4f')]=function(_0x200598,_0x978059,_0x234787){var _0x172e3b={};var _0xcf91d2={};var _0x282e10;var _0x4ffffd;return db[_0xc142('0x3e')][_0xc142('0x50')]({'where':{'id':_0x200598[_0xc142('0x43')]['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x978059,null))['then'](function(_0x370216){if(_0x370216){_0x282e10=_0x370216;_0xcf91d2[_0xc142('0x2e')]=_[_0xc142('0x44')](db[_0xc142('0x4c')][_0xc142('0x45')]);_0xcf91d2[_0xc142('0x2f')]=_[_0xc142('0x44')](_0x200598[_0xc142('0x2f')]);_0xcf91d2[_0xc142('0x30')]=_[_0xc142('0x31')](_0xcf91d2['model'],_0xcf91d2[_0xc142('0x2f')]);_0x172e3b[_0xc142('0x32')]=_['intersection'](_0xcf91d2[_0xc142('0x2e')],qs[_0xc142('0x33')](_0x200598['query'][_0xc142('0x33')]));_0x172e3b[_0xc142('0x32')]=_0x172e3b[_0xc142('0x32')][_0xc142('0x34')]?_0x172e3b[_0xc142('0x32')]:_0xcf91d2[_0xc142('0x2e')];_0x172e3b[_0xc142('0x37')]=qs[_0xc142('0x38')](_0x200598[_0xc142('0x2f')][_0xc142('0x38')]);_0x172e3b[_0xc142('0x3c')]=qs[_0xc142('0x30')](_[_0xc142('0x39')](_0x200598['query'],_0xcf91d2['filters']));if(_0x200598['query'][_0xc142('0x3a')]){_0x172e3b[_0xc142('0x3c')]=_[_0xc142('0x3b')](_0x172e3b[_0xc142('0x3c')],{'$or':_[_0xc142('0x2a')](_0x172e3b[_0xc142('0x32')],function(_0x4d319c){var _0x2a6de7={};_0x2a6de7[_0x4d319c]={'$like':'%'+_0x200598[_0xc142('0x2f')][_0xc142('0x3a')]+'%'};return _0x2a6de7;})});}_0x172e3b=_[_0xc142('0x3b')]({},_0x172e3b,_0x200598[_0xc142('0x3d')]);return _0x282e10[_0xc142('0x4f')](_0x172e3b);}})['then'](function(_0x2144eb){if(_0x2144eb){_0x4ffffd=_0x2144eb['length'];if(!_0x200598[_0xc142('0x2f')]['hasOwnProperty'](_0xc142('0x36'))){_0x172e3b['limit']=qs[_0xc142('0x1e')](_0x200598['query'][_0xc142('0x1e')]);_0x172e3b['offset']=qs[_0xc142('0x1c')](_0x200598['query'][_0xc142('0x1c')]);}return _0x282e10[_0xc142('0x4f')](_0x172e3b);}})[_0xc142('0x23')](function(_0xfdafcb){if(_0xfdafcb){return _0xfdafcb?{'count':_0x4ffffd,'rows':_0xfdafcb}:null;}})[_0xc142('0x23')](respondWithResult(_0x978059,null))[_0xc142('0x41')](handleError(_0x978059,null));};exports[_0xc142('0x51')]=function(_0x8833ab,_0x18ea96,_0xe1c2c3){return db['Action'][_0xc142('0x47')]({'where':{'id':_0x8833ab[_0xc142('0x43')]['id']}})['then'](handleEntityNotFound(_0x18ea96,null))[_0xc142('0x23')](function(_0x5d00a8){if(_0x5d00a8){return _0x5d00a8[_0xc142('0x51')](_0x8833ab[_0xc142('0x49')][_0xc142('0x4d')],_[_0xc142('0x4e')](_0x8833ab['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x18ea96,null))['catch'](handleError(_0x18ea96,null));};exports[_0xc142('0x52')]=function(_0x388861,_0x68a067,_0x2897d9){var _0x539988={};var _0xaae866={};var _0x2b4003;var _0x594b4e;return db['Automation'][_0xc142('0x50')]({'where':{'id':_0x388861[_0xc142('0x43')]['id']}})[_0xc142('0x23')](handleEntityNotFound(_0x68a067,null))[_0xc142('0x23')](function(_0xe9c650){if(_0xe9c650){_0x2b4003=_0xe9c650;_0xaae866[_0xc142('0x2e')]=_[_0xc142('0x44')](db[_0xc142('0x53')][_0xc142('0x45')]);_0xaae866[_0xc142('0x2f')]=_['keys'](_0x388861[_0xc142('0x2f')]);_0xaae866[_0xc142('0x30')]=_[_0xc142('0x31')](_0xaae866[_0xc142('0x2e')],_0xaae866[_0xc142('0x2f')]);_0x539988['attributes']=_[_0xc142('0x31')](_0xaae866['model'],qs['fields'](_0x388861[_0xc142('0x2f')][_0xc142('0x33')]));_0x539988['attributes']=_0x539988['attributes'][_0xc142('0x34')]?_0x539988[_0xc142('0x32')]:_0xaae866[_0xc142('0x2e')];_0x539988['order']=qs[_0xc142('0x38')](_0x388861['query'][_0xc142('0x38')]);_0x539988[_0xc142('0x3c')]=qs[_0xc142('0x30')](_[_0xc142('0x39')](_0x388861[_0xc142('0x2f')],_0xaae866[_0xc142('0x30')]));if(_0x388861[_0xc142('0x2f')]['filter']){_0x539988[_0xc142('0x3c')]=_[_0xc142('0x3b')](_0x539988[_0xc142('0x3c')],{'$or':_[_0xc142('0x2a')](_0x539988['attributes'],function(_0x4a6050){var _0x2cef83={};_0x2cef83[_0x4a6050]={'$like':'%'+_0x388861['query'][_0xc142('0x3a')]+'%'};return _0x2cef83;})});}_0x539988=_[_0xc142('0x3b')]({},_0x539988,_0x388861['options']);return _0x2b4003['getActions'](_0x539988);}})[_0xc142('0x23')](function(_0xf009da){if(_0xf009da){_0x594b4e=_0xf009da[_0xc142('0x34')];if(!_0x388861['query']['hasOwnProperty'](_0xc142('0x36'))){_0x539988[_0xc142('0x1e')]=qs[_0xc142('0x1e')](_0x388861[_0xc142('0x2f')][_0xc142('0x1e')]);_0x539988[_0xc142('0x1c')]=qs[_0xc142('0x1c')](_0x388861['query'][_0xc142('0x1c')]);}return _0x2b4003['getActions'](_0x539988);}})[_0xc142('0x23')](function(_0xb5b51a){if(_0xb5b51a){return _0xb5b51a?{'count':_0x594b4e,'rows':_0xb5b51a}:null;}})[_0xc142('0x23')](respondWithResult(_0x68a067,null))[_0xc142('0x41')](handleError(_0x68a067,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 057740e..1c63791 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 _0x3024=['rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','moment','path'];(function(_0x211a26,_0x3a1b48){var _0x2fc33f=function(_0x252d04){while(--_0x252d04){_0x211a26['push'](_0x211a26['shift']());}};_0x2fc33f(++_0x3a1b48);}(_0x3024,0x13a));var _0x4302=function(_0x462213,_0x36a1f8){_0x462213=_0x462213-0x0;var _0x510a8d=_0x3024[_0x462213];return _0x510a8d;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var logger=require(_0x4302('0x2'))('api');var moment=require(_0x4302('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4302('0x4'));var rimraf=require(_0x4302('0x5'));var config=require(_0x4302('0x6'));var attributes=require(_0x4302('0x7'));module['exports']=function(_0x3903d7,_0x4e9cb4){return _0x3903d7[_0x4302('0x8')](_0x4302('0x9'),attributes,{'tableName':_0x4302('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x31e6=['tools_automations','lodash','request-promise','path','rimraf','define','Automation'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x31e6,0x182));var _0x631e=function(_0xf185d9,_0x42e8e9){_0xf185d9=_0xf185d9-0x0;var _0x1a1abc=_0x31e6[_0xf185d9];return _0x1a1abc;};'use strict';var _=require(_0x631e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x631e('0x1'));var fs=require('fs');var path=require(_0x631e('0x2'));var rimraf=require(_0x631e('0x3'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x4fdfe1,_0xb5cd89){return _0x4fdfe1[_0x631e('0x4')](_0x631e('0x5'),attributes,{'tableName':_0x631e('0x6'),'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 aa8f96f..1260d9e 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 _0xe35d=['rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x359955,_0x5089e8){var _0xe5175f=function(_0xab88ec){while(--_0xab88ec){_0x359955['push'](_0x359955['shift']());}};_0xe5175f(++_0x5089e8);}(_0xe35d,0xd5));var _0xde35=function(_0x3656a7,_0x229eff){_0x3656a7=_0x3656a7-0x0;var _0xc1cad8=_0xe35d[_0x3656a7];return _0xc1cad8;};'use strict';var _=require(_0xde35('0x0'));var util=require(_0xde35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde35('0x2'));var fs=require('fs');var Redis=require(_0xde35('0x3'));var db=require(_0xde35('0x4'))['db'];var utils=require(_0xde35('0x5'));var logger=require(_0xde35('0x6'))(_0xde35('0x7'));var config=require(_0xde35('0x8'));var jayson=require(_0xde35('0x9'));var client=jayson[_0xde35('0xa')][_0xde35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57c5a7,_0x1f0541,_0xe542e){return new BPromise(function(_0x3200e1,_0x25c8a1){return client[_0xde35('0xc')](_0x57c5a7,_0xe542e)['then'](function(_0xa3af60){logger[_0xde35('0xd')](_0xde35('0xe'),_0x1f0541,'request\x20sent');logger[_0xde35('0xf')](_0xde35('0x10'),_0x1f0541,'request\x20sent',JSON[_0xde35('0x11')](_0xa3af60));if(_0xa3af60['error']){if(_0xa3af60[_0xde35('0x12')]['code']===0x1f4){logger[_0xde35('0x12')]('Automation,\x20%s,\x20%s',_0x1f0541,_0xa3af60['error']['message']);return _0x25c8a1(_0xa3af60['error']['message']);}logger[_0xde35('0x12')](_0xde35('0xe'),_0x1f0541,_0xa3af60['error']['message']);return _0x3200e1(_0xa3af60[_0xde35('0x12')][_0xde35('0x13')]);}else{logger[_0xde35('0xd')](_0xde35('0xe'),_0x1f0541,_0xde35('0x14'));_0x3200e1(_0xa3af60['result'][_0xde35('0x13')]);}})[_0xde35('0x15')](function(_0x274de6){logger[_0xde35('0x12')](_0xde35('0xe'),_0x1f0541,_0x274de6);_0x25c8a1(_0x274de6);});});}
\ No newline at end of file
+var _0x7334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment'];(function(_0x26fd1e,_0x3f465f){var _0x359dab=function(_0x386c96){while(--_0x386c96){_0x26fd1e['push'](_0x26fd1e['shift']());}};_0x359dab(++_0x3f465f);}(_0x7334,0x184));var _0x4733=function(_0x2550fe,_0x3072fd){_0x2550fe=_0x2550fe-0x0;var _0x2b5c47=_0x7334[_0x2550fe];return _0x2b5c47;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('Automation,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('Automation,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d9e6cf7..afb7102 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 _0x6fb8=['../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions','addActions','put','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x53b37c,_0x1e3dae){var _0x912a5=function(_0x3e0a92){while(--_0x3e0a92){_0x53b37c['push'](_0x53b37c['shift']());}};_0x912a5(++_0x1e3dae);}(_0x6fb8,0x104));var _0x86fb=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x6fb8[_0x5ca353];return _0x4f2fe5;};'use strict';var multer=require(_0x86fb('0x0'));var util=require('util');var path=require(_0x86fb('0x1'));var timeout=require(_0x86fb('0x2'));var express=require('express');var router=express[_0x86fb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86fb('0x4'));var config=require(_0x86fb('0x5'));var controller=require(_0x86fb('0x6'));router[_0x86fb('0x7')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0x9')]);router[_0x86fb('0x7')](_0x86fb('0xa'),auth[_0x86fb('0x8')](),controller[_0x86fb('0xb')]);router[_0x86fb('0x7')](_0x86fb('0xc'),auth[_0x86fb('0x8')](),controller['getConditions']);router[_0x86fb('0x7')]('/:id/actions',auth[_0x86fb('0x8')](),controller[_0x86fb('0xd')]);router[_0x86fb('0xe')]('/',auth['isAuthenticated'](),controller[_0x86fb('0xf')]);router['post'](_0x86fb('0xc'),auth[_0x86fb('0x8')](),controller[_0x86fb('0x10')]);router[_0x86fb('0xe')](_0x86fb('0x11'),auth[_0x86fb('0x8')](),controller[_0x86fb('0x12')]);router[_0x86fb('0x13')](_0x86fb('0xa'),auth[_0x86fb('0x8')](),controller['update']);router[_0x86fb('0x14')]('/:id',auth[_0x86fb('0x8')](),controller[_0x86fb('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x635c=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','destroy','exports'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x635c,0xa1));var _0xc635=function(_0x38a4a5,_0x151bc6){_0x38a4a5=_0x38a4a5-0x0;var _0x7daa9f=_0x635c[_0x38a4a5];return _0x7daa9f;};'use strict';var multer=require('multer');var util=require(_0xc635('0x0'));var path=require(_0xc635('0x1'));var timeout=require(_0xc635('0x2'));var express=require(_0xc635('0x3'));var router=express['Router']();var fs_extra=require(_0xc635('0x4'));var auth=require(_0xc635('0x5'));var interaction=require(_0xc635('0x6'));var config=require(_0xc635('0x7'));var controller=require(_0xc635('0x8'));router[_0xc635('0x9')]('/',auth[_0xc635('0xa')](),controller['index']);router[_0xc635('0x9')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller['show']);router[_0xc635('0x9')](_0xc635('0xc'),auth[_0xc635('0xa')](),controller[_0xc635('0xd')]);router[_0xc635('0x9')](_0xc635('0xe'),auth[_0xc635('0xa')](),controller[_0xc635('0xf')]);router[_0xc635('0x10')]('/',auth[_0xc635('0xa')](),controller['create']);router[_0xc635('0x10')](_0xc635('0xc'),auth[_0xc635('0xa')](),controller[_0xc635('0x11')]);router['post'](_0xc635('0xe'),auth[_0xc635('0xa')](),controller[_0xc635('0x12')]);router['put']('/:id',auth[_0xc635('0xa')](),controller[_0xc635('0x13')]);router[_0xc635('0x14')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller[_0xc635('0x15')]);module[_0xc635('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 015db94..d54324d 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 _0xe334=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','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)'];(function(_0x1cf1c7,_0x1e0f72){var _0x362b0a=function(_0xfec7cd){while(--_0xfec7cd){_0x1cf1c7['push'](_0x1cf1c7['shift']());}};_0x362b0a(++_0x1e0f72);}(_0xe334,0x1aa));var _0x4e33=function(_0x5f5901,_0x5ba3d8){_0x5f5901=_0x5f5901-0x0;var _0x333406=_0xe334[_0x5f5901];return _0x333406;};'use strict';var Sequelize=require('sequelize');module[_0x4e33('0x0')]={'name':{'type':Sequelize[_0x4e33('0x1')],'unique':_0x4e33('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x4e33('0x3')](_0x4e33('0x4')),'allowNull':![],'defaultValue':_0x4e33('0x4')},'description':{'type':Sequelize[_0x4e33('0x1')]},'active':{'type':Sequelize[_0x4e33('0x5')],'defaultValue':0x0,'comment':_0x4e33('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x4e33('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4e33('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4e33('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x4e33('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4e33('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e33('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e33('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4e33('0x7')],'defaultValue':0x3,'comment':_0x4e33('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4e33('0x9')](0x3)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4e33('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4e33('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x4e33('0x3')](_0x4e33('0x11'),_0x4e33('0x12'),_0x4e33('0x13')),'defaultValue':_0x4e33('0x11')},'dialAMDActive':{'type':Sequelize[_0x4e33('0x5')],'defaultValue':0x0,'comment':_0x4e33('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4e33('0x9')](0x9)[_0x4e33('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4e33('0x9')](0x9)[_0x4e33('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4e33('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4e33('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4e33('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x4e33('0x9')](0x9)[_0x4e33('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4e33('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4e33('0x9')](0x9)[_0x4e33('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4e33('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4e33('0x9')](0x9)[_0x4e33('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4e33('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4e33('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4e33('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4e33('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4e33('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4e33('0x3')]('DESC',_0x4e33('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4e33('0x9')](0x3)[_0x4e33('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4e33('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4e33('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e33('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4e33('0x9')](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x4e33('0x9')](0x3)[_0x4e33('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e33('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x4e33('0x9')](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4e33('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e33('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4e33('0x9')](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4e33('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e33('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4e33('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4e33('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4e33('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e33('0x27')}};
\ No newline at end of file
+var _0x1c31=['#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,*,*,*','ENUM','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','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\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1c31,0x1a0));var _0x11c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1c31[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x11c3('0x0'));module['exports']={'name':{'type':Sequelize[_0x11c3('0x1')],'unique':_0x11c3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x11c3('0x3')),'allowNull':![],'defaultValue':_0x11c3('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x11c3('0x4')],'defaultValue':0x0,'comment':_0x11c3('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x11c3('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x11c3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x11c3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x11c3('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x11c3('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x11c3('0x1')],'defaultValue':_0x11c3('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x11c3('0x11')]('always',_0x11c3('0x12'),_0x11c3('0x13')),'defaultValue':_0x11c3('0x14')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x11c3('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x11c3('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x11c3('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x11c3('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11c3('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x11c3('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x11c3('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x11c3('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x11c3('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x11c3('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x11c3('0x7')](0x9)[_0x11c3('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11c3('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x11c3('0x11')]('DESC',_0x11c3('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x11c3('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11c3('0x1f')},'dialCutDigit':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11c3('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x11c3('0x7')](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x11c3('0x7')](0x3)[_0x11c3('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11c3('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11c3('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index a62b8e7..c018ec0 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 _0x33b0=['clone','params','omit','createdAt','updatedAt','body','role','autoAssociation','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','sequelize','getBlackLists','addBlackLists','spread','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','destroy','name','index','Campaign','fieldName','type','key','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3186ae,_0x5d615c){var _0x247818=function(_0x33e528){while(--_0x33e528){_0x3186ae['push'](_0x3186ae['shift']());}};_0x247818(++_0x5d615c);}(_0x33b0,0x149));var _0x033b=function(_0x960c1b,_0x1b8c95){_0x960c1b=_0x960c1b-0x0;var _0x53d799=_0x33b0[_0x960c1b];return _0x53d799;};'use strict';var emlformat=require(_0x033b('0x0'));var rimraf=require(_0x033b('0x1'));var zipdir=require(_0x033b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x033b('0x3'));var BPromise=require(_0x033b('0x4'));var Mustache=require(_0x033b('0x5'));var util=require(_0x033b('0x6'));var path=require(_0x033b('0x7'));var sox=require(_0x033b('0x8'));var csv=require(_0x033b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x033b('0xa'));var _=require(_0x033b('0xb'));var squel=require(_0x033b('0xc'));var crypto=require(_0x033b('0xd'));var jsforce=require(_0x033b('0xe'));var deskjs=require(_0x033b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x033b('0x10'));var Papa=require(_0x033b('0x11'));var Redis=require(_0x033b('0x12'));var authService=require(_0x033b('0x13'));var qs=require(_0x033b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x033b('0x15'));var logger=require(_0x033b('0x16'))(_0x033b('0x17'));var utils=require('../../config/utils');var config=require(_0x033b('0x18'));var licenseUtil=require(_0x033b('0x19'));var db=require(_0x033b('0x1a'))['db'];function respondWithStatusCode(_0xaad7fc,_0x76a1f0){_0x76a1f0=_0x76a1f0||0xcc;return function(_0x4e3bbd){if(_0x4e3bbd){return _0xaad7fc[_0x033b('0x1b')](_0x76a1f0);}return _0xaad7fc[_0x033b('0x1c')](_0x76a1f0)[_0x033b('0x1d')]();};}function respondWithResult(_0x142b86,_0x482879){_0x482879=_0x482879||0xc8;return function(_0x2dbb10){if(_0x2dbb10){return _0x142b86[_0x033b('0x1c')](_0x482879)[_0x033b('0x1e')](_0x2dbb10);}};}function respondWithFilteredResult(_0x36be2c,_0x5301e8){return function(_0x1462b1){if(_0x1462b1){var _0x571717=typeof _0x5301e8['offset']==='undefined'&&typeof _0x5301e8[_0x033b('0x1f')]===_0x033b('0x20');var _0x3c1ccc=_0x1462b1[_0x033b('0x21')];var _0x13c819=_0x571717?0x0:_0x5301e8[_0x033b('0x22')];var _0x17e3a5=_0x571717?_0x1462b1[_0x033b('0x21')]:_0x5301e8[_0x033b('0x22')]+_0x5301e8[_0x033b('0x1f')];var _0x43e68a;if(_0x17e3a5>=_0x3c1ccc){_0x17e3a5=_0x3c1ccc;_0x43e68a=0xc8;}else{_0x43e68a=0xce;}_0x36be2c[_0x033b('0x1c')](_0x43e68a);return _0x36be2c[_0x033b('0x23')](_0x033b('0x24'),_0x13c819+'-'+_0x17e3a5+'/'+_0x3c1ccc)[_0x033b('0x1e')](_0x1462b1);}return null;};}function patchUpdates(_0x27b4ae){return function(_0x4d9491){try{jsonpatch[_0x033b('0x25')](_0x4d9491,_0x27b4ae,!![]);}catch(_0x4fdb56){return BPromise[_0x033b('0x26')](_0x4fdb56);}return _0x4d9491[_0x033b('0x27')]();};}function saveUpdates(_0x165d9c,_0x463ba6){return function(_0x301b12){if(_0x301b12){return _0x301b12[_0x033b('0x28')](_0x165d9c)[_0x033b('0x29')](function(_0x498fb2){return _0x498fb2;});}return null;};}function removeEntity(_0x3ebe37,_0x418fa3){return function(_0x4b6b6c){if(_0x4b6b6c){return _0x4b6b6c['destroy']()[_0x033b('0x29')](function(){var _0xa8008b=_0x4b6b6c[_0x033b('0x2a')]({'plain':!![]});var _0x4ff8eb=_0x033b('0x2b');return db['UserProfileResource'][_0x033b('0x2c')]({'where':{'type':_0x4ff8eb,'resourceId':_0xa8008b['id']}})[_0x033b('0x29')](function(){return _0x4b6b6c;});})['then'](function(){_0x3ebe37[_0x033b('0x1c')](0xcc)[_0x033b('0x1d')]();});}};}function handleEntityNotFound(_0x1ba0da,_0x544cd4){return function(_0x6c7039){if(!_0x6c7039){_0x1ba0da[_0x033b('0x1b')](0x194);}return _0x6c7039;};}function handleError(_0xd1f817,_0x2c55db){_0x2c55db=_0x2c55db||0x1f4;return function(_0x521e05){logger['error'](_0x521e05['stack']);if(_0x521e05[_0x033b('0x2d')]){delete _0x521e05[_0x033b('0x2d')];}_0xd1f817[_0x033b('0x1c')](_0x2c55db)['send'](_0x521e05);};}exports[_0x033b('0x2e')]=function(_0x476f35,_0x42ef93){var _0x3453f8={},_0x4ea6e6={},_0x5d58ef={'count':0x0,'rows':[]};var _0x293f17=_['map'](db[_0x033b('0x2f')]['rawAttributes'],function(_0x2b8578){return{'name':_0x2b8578[_0x033b('0x30')],'type':_0x2b8578[_0x033b('0x31')][_0x033b('0x32')]};});_0x4ea6e6['model']=_['map'](_0x293f17,_0x033b('0x2d'));_0x4ea6e6[_0x033b('0x33')]=_[_0x033b('0x34')](_0x476f35[_0x033b('0x33')]);_0x4ea6e6['filters']=_[_0x033b('0x35')](_0x4ea6e6['model'],_0x4ea6e6[_0x033b('0x33')]);_0x3453f8['attributes']=_[_0x033b('0x35')](_0x4ea6e6[_0x033b('0x36')],qs[_0x033b('0x37')](_0x476f35[_0x033b('0x33')][_0x033b('0x37')]));_0x3453f8['attributes']=_0x3453f8[_0x033b('0x38')]['length']?_0x3453f8[_0x033b('0x38')]:_0x4ea6e6[_0x033b('0x36')];if(!_0x476f35[_0x033b('0x33')]['hasOwnProperty'](_0x033b('0x39'))){_0x3453f8['limit']=qs[_0x033b('0x1f')](_0x476f35[_0x033b('0x33')][_0x033b('0x1f')]);_0x3453f8['offset']=qs[_0x033b('0x22')](_0x476f35[_0x033b('0x33')]['offset']);}_0x3453f8[_0x033b('0x3a')]=qs['sort'](_0x476f35[_0x033b('0x33')][_0x033b('0x3b')]);_0x3453f8[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_[_0x033b('0x3e')](_0x476f35['query'],_0x4ea6e6['filters']),_0x293f17);if(_0x476f35[_0x033b('0x33')][_0x033b('0x3f')]){_0x3453f8['where']=_[_0x033b('0x40')](_0x3453f8['where'],{'$or':_[_0x033b('0x41')](_0x293f17,function(_0x327438){if(_0x327438[_0x033b('0x31')]!==_0x033b('0x42')){var _0x2e8bf3={};_0x2e8bf3[_0x327438['name']]={'$like':'%'+_0x476f35[_0x033b('0x33')]['filter']+'%'};return _0x2e8bf3;}})});}_0x3453f8=_[_0x033b('0x40')]({},_0x3453f8,_0x476f35[_0x033b('0x43')]);var _0x3d9019={'where':_0x3453f8[_0x033b('0x3c')]};return db['Campaign'][_0x033b('0x21')](_0x3d9019)['then'](function(_0x37ea1e){_0x5d58ef[_0x033b('0x21')]=_0x37ea1e;if(_0x476f35[_0x033b('0x33')][_0x033b('0x44')]){_0x3453f8[_0x033b('0x45')]=[{'all':!![]}];}return db[_0x033b('0x2f')][_0x033b('0x46')](_0x3453f8);})[_0x033b('0x29')](function(_0x56599f){_0x5d58ef[_0x033b('0x47')]=_0x56599f;return _0x5d58ef;})[_0x033b('0x29')](respondWithFilteredResult(_0x42ef93,_0x3453f8))[_0x033b('0x48')](handleError(_0x42ef93,null));};exports[_0x033b('0x49')]=function(_0x2a38a7,_0x1ffc32){var _0x3dc260={'raw':![],'where':{'id':_0x2a38a7['params']['id']}},_0x35051c={};_0x35051c['model']=_[_0x033b('0x34')](db['Campaign'][_0x033b('0x4a')]);_0x35051c[_0x033b('0x33')]=_[_0x033b('0x34')](_0x2a38a7[_0x033b('0x33')]);_0x35051c['filters']=_[_0x033b('0x35')](_0x35051c[_0x033b('0x36')],_0x35051c[_0x033b('0x33')]);_0x3dc260[_0x033b('0x38')]=_[_0x033b('0x35')](_0x35051c[_0x033b('0x36')],qs[_0x033b('0x37')](_0x2a38a7[_0x033b('0x33')][_0x033b('0x37')]));_0x3dc260[_0x033b('0x38')]=_0x3dc260['attributes'][_0x033b('0x4b')]?_0x3dc260[_0x033b('0x38')]:_0x35051c['model'];if(_0x2a38a7['query']['includeAll']){_0x3dc260[_0x033b('0x45')]=[{'all':!![]}];}_0x3dc260=_[_0x033b('0x40')]({},_0x3dc260,_0x2a38a7[_0x033b('0x43')]);return db[_0x033b('0x2f')][_0x033b('0x4c')](_0x3dc260)[_0x033b('0x29')](handleEntityNotFound(_0x1ffc32,null))[_0x033b('0x29')](respondWithResult(_0x1ffc32,null))[_0x033b('0x48')](handleError(_0x1ffc32,null));};exports[_0x033b('0x4d')]=function(_0xec76a3,_0x435ff5){return db[_0x033b('0x2f')][_0x033b('0x4d')](_0xec76a3['body'],{})[_0x033b('0x29')](function(_0x16ddff){var _0x43a9bf=_0xec76a3[_0x033b('0x4e')]['get']({'plain':!![]});if(!_0x43a9bf)throw new Error(_0x033b('0x4f'));if(_0x43a9bf['role']===_0x033b('0x4e')){var _0x1c73ce=_0x16ddff['get']({'plain':!![]});var _0xfa4498=_0x033b('0x2b');return db[_0x033b('0x50')]['find']({'where':{'name':_0xfa4498,'userProfileId':_0x43a9bf[_0x033b('0x51')]},'raw':!![]})['then'](function(_0x206d7d){if(_0x206d7d&&_0x206d7d['autoAssociation']===0x0){return db[_0x033b('0x52')][_0x033b('0x4d')]({'name':_0x1c73ce[_0x033b('0x2d')],'resourceId':_0x1c73ce['id'],'type':_0x206d7d[_0x033b('0x2d')],'sectionId':_0x206d7d['id']},{})[_0x033b('0x29')](function(){return _0x16ddff;});}else{return _0x16ddff;}})[_0x033b('0x48')](function(_0x2ec740){logger[_0x033b('0x53')](_0x033b('0x54'),_0x2ec740);throw _0x2ec740;});}return _0x16ddff;})[_0x033b('0x29')](respondWithResult(_0x435ff5,0xc9))[_0x033b('0x48')](handleError(_0x435ff5,null));};exports[_0x033b('0x55')]=function(_0x33b969,_0x4d8841){var _0x12f25b={'where':{'id':_0x33b969[_0x033b('0x56')]['id']}},_0x442a55={};_0x442a55[_0x033b('0x36')]=_[_0x033b('0x34')](db[_0x033b('0x2f')][_0x033b('0x4a')]);_0x12f25b[_0x033b('0x38')]=_[_0x033b('0x35')](_0x442a55[_0x033b('0x36')],qs['fields'](_0x33b969[_0x033b('0x33')][_0x033b('0x37')]));_0x12f25b['attributes']=_0x12f25b[_0x033b('0x38')][_0x033b('0x4b')]?_0x12f25b[_0x033b('0x38')]:_0x442a55[_0x033b('0x36')];if(_0x33b969['query'][_0x033b('0x44')]){_0x12f25b[_0x033b('0x45')]=[{'all':!![]}];}_0x12f25b=_[_0x033b('0x40')]({},_0x12f25b,_0x33b969[_0x033b('0x43')]);return db[_0x033b('0x2f')][_0x033b('0x4c')](_0x12f25b)[_0x033b('0x29')](handleEntityNotFound(_0x4d8841,null))[_0x033b('0x29')](function(_0x51bf7e){if(_0x51bf7e){var _0x5938f8=_0x51bf7e[_0x033b('0x2a')]({'plain':!![]});_0x5938f8=qs[_0x033b('0x57')](_0x5938f8,['id',_0x033b('0x58'),_0x033b('0x59')]);_0x33b969[_0x033b('0x5a')]=_[_0x033b('0x57')](_0x33b969[_0x033b('0x5a')],['id',_0x033b('0x58'),_0x033b('0x59')]);return db[_0x033b('0x2f')][_0x033b('0x4d')](_[_0x033b('0x40')](_0x5938f8,_0x33b969[_0x033b('0x5a')]),{'include':_0x33b969[_0x033b('0x33')][_0x033b('0x44')]?[{'all':!![]}]:undefined})[_0x033b('0x29')](function(_0x3f8d84){var _0x5368e5=_0x33b969[_0x033b('0x4e')][_0x033b('0x2a')]({'plain':!![]});if(!_0x5368e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5368e5[_0x033b('0x5b')]===_0x033b('0x4e')){var _0x5bf95e=_0x3f8d84[_0x033b('0x2a')]({'plain':!![]});var _0x4d12d2=_0x033b('0x2b');return db[_0x033b('0x50')][_0x033b('0x4c')]({'where':{'name':_0x4d12d2,'userProfileId':_0x5368e5[_0x033b('0x51')]},'raw':!![]})['then'](function(_0x6b6cfc){if(_0x6b6cfc&&_0x6b6cfc[_0x033b('0x5c')]===0x0){return db[_0x033b('0x52')][_0x033b('0x4d')]({'name':_0x5bf95e[_0x033b('0x2d')],'resourceId':_0x5bf95e['id'],'type':_0x6b6cfc[_0x033b('0x2d')],'sectionId':_0x6b6cfc['id']},{})[_0x033b('0x29')](function(){return _0x3f8d84;});}else{return _0x3f8d84;}})['catch'](function(_0x1144b2){logger[_0x033b('0x53')](_0x033b('0x54'),_0x1144b2);throw _0x1144b2;});}return _0x3f8d84;});}})[_0x033b('0x29')](respondWithResult(_0x4d8841,0xc9))['catch'](handleError(_0x4d8841,null));};exports[_0x033b('0x28')]=function(_0x569a55,_0x5c2ead){if(_0x569a55['body']['id']){delete _0x569a55[_0x033b('0x5a')]['id'];}return db[_0x033b('0x2f')][_0x033b('0x4c')]({'where':{'id':_0x569a55[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x5c2ead,null))[_0x033b('0x29')](saveUpdates(_0x569a55[_0x033b('0x5a')],null))[_0x033b('0x29')](respondWithResult(_0x5c2ead,null))['catch'](handleError(_0x5c2ead,null));};exports[_0x033b('0x2c')]=function(_0x1ebcf8,_0x1eddbf){return db[_0x033b('0x2f')][_0x033b('0x4c')]({'where':{'id':_0x1ebcf8[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x1eddbf,null))[_0x033b('0x29')](removeEntity(_0x1eddbf,null))[_0x033b('0x48')](handleError(_0x1eddbf,null));};exports['getHoppers']=function(_0xb7c5ca,_0x3c5c7d,_0x5cd34d){var _0x42a7a8={'raw':!![],'where':{}};var _0xdda402={};var _0x3edf5a={'count':0x0,'rows':[]};return db[_0x033b('0x2f')][_0x033b('0x5d')]({'where':{'id':_0xb7c5ca[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x3c5c7d,null))['then'](function(_0x2f9919){if(_0x2f9919){_0xdda402[_0x033b('0x36')]=_[_0x033b('0x34')](db[_0x033b('0x5e')][_0x033b('0x4a')]);_0xdda402[_0x033b('0x33')]=_[_0x033b('0x34')](_0xb7c5ca[_0x033b('0x33')]);_0xdda402['filters']=_['intersection'](_0xdda402[_0x033b('0x36')],_0xdda402[_0x033b('0x33')]);_0x42a7a8[_0x033b('0x38')]=_[_0x033b('0x35')](_0xdda402['model'],qs[_0x033b('0x37')](_0xb7c5ca[_0x033b('0x33')][_0x033b('0x37')]));_0x42a7a8['attributes']=_0x42a7a8[_0x033b('0x38')][_0x033b('0x4b')]?_0x42a7a8['attributes']:_0xdda402[_0x033b('0x36')];if(!_0xb7c5ca[_0x033b('0x33')][_0x033b('0x5f')]('nolimit')){_0x42a7a8[_0x033b('0x1f')]=qs['limit'](_0xb7c5ca[_0x033b('0x33')][_0x033b('0x1f')]);_0x42a7a8['offset']=qs[_0x033b('0x22')](_0xb7c5ca[_0x033b('0x33')]['offset']);}_0x42a7a8[_0x033b('0x3a')]=qs[_0x033b('0x3b')](_0xb7c5ca[_0x033b('0x33')][_0x033b('0x3b')]);_0x42a7a8[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_['pick'](_0xb7c5ca[_0x033b('0x33')],_0xdda402[_0x033b('0x3d')]));_0x42a7a8[_0x033b('0x3c')][_0x033b('0x60')]=_0x2f9919['id'];if(_0xb7c5ca['query']['filter']){_0x42a7a8[_0x033b('0x3c')]=_[_0x033b('0x40')](_0x42a7a8[_0x033b('0x3c')],{'$or':_[_0x033b('0x41')](_0x42a7a8[_0x033b('0x38')],function(_0x58645f){var _0x542948={};_0x542948[_0x58645f]={'$like':'%'+_0xb7c5ca[_0x033b('0x33')][_0x033b('0x3f')]+'%'};return _0x542948;})});}_0x42a7a8=_[_0x033b('0x40')]({},_0x42a7a8,_0xb7c5ca[_0x033b('0x43')]);return db[_0x033b('0x5e')][_0x033b('0x21')]({'where':_0x42a7a8[_0x033b('0x3c')]})['then'](function(_0x4bafe0){_0x3edf5a[_0x033b('0x21')]=_0x4bafe0;if(_0xb7c5ca['query']['includeAll']){_0x42a7a8['include']=[{'all':!![]}];}return db['CmHopper'][_0x033b('0x46')](_0x42a7a8);})[_0x033b('0x29')](function(_0x19007a){_0x3edf5a['rows']=_0x19007a;return _0x3edf5a;});}})[_0x033b('0x29')](respondWithFilteredResult(_0x3c5c7d,_0x42a7a8))[_0x033b('0x48')](handleError(_0x3c5c7d,null));};exports[_0x033b('0x61')]=function(_0x5e0e38,_0x5408ab,_0x46400d){var _0x5bc85a={'raw':!![],'where':{}};var _0x145f61={};var _0x4fcd49={'count':0x0,'rows':[]};return db[_0x033b('0x2f')][_0x033b('0x5d')]({'where':{'id':_0x5e0e38[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x5408ab,null))[_0x033b('0x29')](function(_0x12c01e){if(_0x12c01e){_0x145f61[_0x033b('0x36')]=_[_0x033b('0x34')](db['CmHopperHistory'][_0x033b('0x4a')]);_0x145f61[_0x033b('0x33')]=_['keys'](_0x5e0e38['query']);_0x145f61[_0x033b('0x3d')]=_['intersection'](_0x145f61[_0x033b('0x36')],_0x145f61['query']);_0x5bc85a[_0x033b('0x38')]=_[_0x033b('0x35')](_0x145f61[_0x033b('0x36')],qs[_0x033b('0x37')](_0x5e0e38[_0x033b('0x33')][_0x033b('0x37')]));_0x5bc85a[_0x033b('0x38')]=_0x5bc85a[_0x033b('0x38')][_0x033b('0x4b')]?_0x5bc85a[_0x033b('0x38')]:_0x145f61[_0x033b('0x36')];if(!_0x5e0e38[_0x033b('0x33')][_0x033b('0x5f')](_0x033b('0x39'))){_0x5bc85a[_0x033b('0x1f')]=qs['limit'](_0x5e0e38[_0x033b('0x33')][_0x033b('0x1f')]);_0x5bc85a['offset']=qs[_0x033b('0x22')](_0x5e0e38['query'][_0x033b('0x22')]);}_0x5bc85a[_0x033b('0x3a')]=qs[_0x033b('0x3b')](_0x5e0e38['query'][_0x033b('0x3b')]);_0x5bc85a[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_[_0x033b('0x3e')](_0x5e0e38[_0x033b('0x33')],_0x145f61[_0x033b('0x3d')]));_0x5bc85a['where'][_0x033b('0x60')]=_0x12c01e['id'];if(_0x5e0e38[_0x033b('0x33')]['filter']){_0x5bc85a[_0x033b('0x3c')]=_[_0x033b('0x40')](_0x5bc85a[_0x033b('0x3c')],{'$or':_['map'](_0x5bc85a[_0x033b('0x38')],function(_0x1ccb4f){var _0x248065={};_0x248065[_0x1ccb4f]={'$like':'%'+_0x5e0e38['query'][_0x033b('0x3f')]+'%'};return _0x248065;})});}_0x5bc85a=_[_0x033b('0x40')]({},_0x5bc85a,_0x5e0e38[_0x033b('0x43')]);return db[_0x033b('0x62')][_0x033b('0x21')]({'where':_0x5bc85a[_0x033b('0x3c')]})[_0x033b('0x29')](function(_0x3da31e){_0x4fcd49[_0x033b('0x21')]=_0x3da31e;if(_0x5e0e38[_0x033b('0x33')]['includeAll']){_0x5bc85a['include']=[{'all':!![]}];}return db[_0x033b('0x62')][_0x033b('0x46')](_0x5bc85a);})[_0x033b('0x29')](function(_0x5282fe){_0x4fcd49[_0x033b('0x47')]=_0x5282fe;return _0x4fcd49;});}})[_0x033b('0x29')](respondWithFilteredResult(_0x5408ab,_0x5bc85a))[_0x033b('0x48')](handleError(_0x5408ab,null));};exports['getHopperFinals']=function(_0x2e7a48,_0x5e1500,_0x2d634b){var _0x23fc5e={'raw':!![],'where':{}};var _0x82414b={};var _0x44acf6={'count':0x0,'rows':[]};return db['Campaign'][_0x033b('0x5d')]({'where':{'id':_0x2e7a48[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x5e1500,null))[_0x033b('0x29')](function(_0x43572c){if(_0x43572c){_0x82414b['model']=_[_0x033b('0x34')](db['CmHopperFinal']['rawAttributes']);_0x82414b[_0x033b('0x33')]=_[_0x033b('0x34')](_0x2e7a48[_0x033b('0x33')]);_0x82414b[_0x033b('0x3d')]=_[_0x033b('0x35')](_0x82414b['model'],_0x82414b[_0x033b('0x33')]);_0x23fc5e[_0x033b('0x38')]=_['intersection'](_0x82414b['model'],qs['fields'](_0x2e7a48[_0x033b('0x33')][_0x033b('0x37')]));_0x23fc5e['attributes']=_0x23fc5e[_0x033b('0x38')]['length']?_0x23fc5e['attributes']:_0x82414b['model'];if(!_0x2e7a48[_0x033b('0x33')][_0x033b('0x5f')](_0x033b('0x39'))){_0x23fc5e[_0x033b('0x1f')]=qs['limit'](_0x2e7a48[_0x033b('0x33')][_0x033b('0x1f')]);_0x23fc5e[_0x033b('0x22')]=qs['offset'](_0x2e7a48[_0x033b('0x33')][_0x033b('0x22')]);}_0x23fc5e[_0x033b('0x3a')]=qs[_0x033b('0x3b')](_0x2e7a48[_0x033b('0x33')][_0x033b('0x3b')]);_0x23fc5e[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_[_0x033b('0x3e')](_0x2e7a48[_0x033b('0x33')],_0x82414b['filters']));_0x23fc5e[_0x033b('0x3c')]['CampaignId']=_0x43572c['id'];if(_0x2e7a48[_0x033b('0x33')]['filter']){_0x23fc5e[_0x033b('0x3c')]=_['merge'](_0x23fc5e[_0x033b('0x3c')],{'$or':_[_0x033b('0x41')](_0x23fc5e['attributes'],function(_0xd0aa38){var _0x4b2d86={};_0x4b2d86[_0xd0aa38]={'$like':'%'+_0x2e7a48[_0x033b('0x33')][_0x033b('0x3f')]+'%'};return _0x4b2d86;})});}_0x23fc5e=_[_0x033b('0x40')]({},_0x23fc5e,_0x2e7a48['options']);return db[_0x033b('0x63')]['count']({'where':_0x23fc5e['where']})[_0x033b('0x29')](function(_0x41b26f){_0x44acf6[_0x033b('0x21')]=_0x41b26f;if(_0x2e7a48[_0x033b('0x33')]['includeAll']){_0x23fc5e['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x033b('0x46')](_0x23fc5e);})['then'](function(_0x9feb75){_0x44acf6[_0x033b('0x47')]=_0x9feb75;return _0x44acf6;});}})[_0x033b('0x29')](respondWithFilteredResult(_0x5e1500,_0x23fc5e))[_0x033b('0x48')](handleError(_0x5e1500,null));};exports[_0x033b('0x64')]=function(_0x13d378,_0x499af1,_0x592761){var _0x210cde={'raw':!![],'where':{}};var _0x57f845={};var _0x5833dd={'count':0x0,'rows':[]};return db['Campaign'][_0x033b('0x5d')]({'where':{'id':_0x13d378['params']['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x499af1,null))['then'](function(_0x56b39a){if(_0x56b39a){_0x57f845[_0x033b('0x36')]=_[_0x033b('0x34')](db[_0x033b('0x65')]['rawAttributes']);_0x57f845[_0x033b('0x33')]=_[_0x033b('0x34')](_0x13d378[_0x033b('0x33')]);_0x57f845[_0x033b('0x3d')]=_[_0x033b('0x35')](_0x57f845[_0x033b('0x36')],_0x57f845[_0x033b('0x33')]);_0x210cde['attributes']=_[_0x033b('0x35')](_0x57f845['model'],qs[_0x033b('0x37')](_0x13d378['query'][_0x033b('0x37')]));_0x210cde[_0x033b('0x38')]=_0x210cde[_0x033b('0x38')][_0x033b('0x4b')]?_0x210cde[_0x033b('0x38')]:_0x57f845['model'];if(!_0x13d378[_0x033b('0x33')][_0x033b('0x5f')](_0x033b('0x39'))){_0x210cde[_0x033b('0x1f')]=qs[_0x033b('0x1f')](_0x13d378[_0x033b('0x33')][_0x033b('0x1f')]);_0x210cde[_0x033b('0x22')]=qs['offset'](_0x13d378['query'][_0x033b('0x22')]);}_0x210cde[_0x033b('0x3a')]=qs['sort'](_0x13d378[_0x033b('0x33')]['sort']);_0x210cde[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_[_0x033b('0x3e')](_0x13d378[_0x033b('0x33')],_0x57f845[_0x033b('0x3d')]));_0x210cde[_0x033b('0x3c')][_0x033b('0x60')]=_0x56b39a['id'];if(_0x13d378[_0x033b('0x33')][_0x033b('0x3f')]){_0x210cde[_0x033b('0x3c')]=_[_0x033b('0x40')](_0x210cde[_0x033b('0x3c')],{'$or':_[_0x033b('0x41')](_0x210cde[_0x033b('0x38')],function(_0x3d7bf2){var _0x5e2e99={};_0x5e2e99[_0x3d7bf2]={'$like':'%'+_0x13d378['query'][_0x033b('0x3f')]+'%'};return _0x5e2e99;})});}_0x210cde=_[_0x033b('0x40')]({},_0x210cde,_0x13d378[_0x033b('0x43')]);return db[_0x033b('0x65')][_0x033b('0x21')]({'where':_0x210cde[_0x033b('0x3c')]})['then'](function(_0x5d586c){_0x5833dd['count']=_0x5d586c;if(_0x13d378[_0x033b('0x33')][_0x033b('0x44')]){_0x210cde[_0x033b('0x45')]=[{'all':!![]}];}return db[_0x033b('0x65')][_0x033b('0x46')](_0x210cde);})[_0x033b('0x29')](function(_0x3df327){_0x5833dd['rows']=_0x3df327;return _0x5833dd;});}})[_0x033b('0x29')](respondWithFilteredResult(_0x499af1,_0x210cde))[_0x033b('0x48')](handleError(_0x499af1,null));};exports[_0x033b('0x66')]=function(_0x5ad04f,_0x56536f,_0x533c58){var _0x5cc4e5={};var _0x3fbf94={};var _0x217c13;var _0x17c6dc;return db[_0x033b('0x2f')][_0x033b('0x5d')]({'where':{'id':_0x5ad04f[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x56536f,null))[_0x033b('0x29')](function(_0x3ac415){if(_0x3ac415){_0x217c13=_0x3ac415;_0x3fbf94[_0x033b('0x36')]=_[_0x033b('0x34')](db[_0x033b('0x67')][_0x033b('0x4a')]);_0x3fbf94[_0x033b('0x33')]=_[_0x033b('0x34')](_0x5ad04f['query']);_0x3fbf94['filters']=_['intersection'](_0x3fbf94[_0x033b('0x36')],_0x3fbf94['query']);_0x5cc4e5[_0x033b('0x38')]=_[_0x033b('0x35')](_0x3fbf94[_0x033b('0x36')],qs[_0x033b('0x37')](_0x5ad04f['query'][_0x033b('0x37')]));_0x5cc4e5[_0x033b('0x38')]=_0x5cc4e5[_0x033b('0x38')][_0x033b('0x4b')]?_0x5cc4e5[_0x033b('0x38')]:_0x3fbf94[_0x033b('0x36')];_0x5cc4e5[_0x033b('0x3a')]=qs['sort'](_0x5ad04f[_0x033b('0x33')][_0x033b('0x3b')]);_0x5cc4e5[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_[_0x033b('0x3e')](_0x5ad04f[_0x033b('0x33')],_0x3fbf94[_0x033b('0x3d')]));if(_0x5ad04f[_0x033b('0x33')][_0x033b('0x3f')]){_0x5cc4e5['where']=_['merge'](_0x5cc4e5[_0x033b('0x3c')],{'$or':_[_0x033b('0x41')](_0x5cc4e5[_0x033b('0x38')],function(_0x66c41b){var _0x207261={};_0x207261[_0x66c41b]={'$like':'%'+_0x5ad04f[_0x033b('0x33')][_0x033b('0x3f')]+'%'};return _0x207261;})});}_0x5cc4e5=_[_0x033b('0x40')]({},_0x5cc4e5,_0x5ad04f[_0x033b('0x43')]);return _0x217c13['getLists'](_0x5cc4e5);}})[_0x033b('0x29')](function(_0x47fa2b){if(_0x47fa2b){_0x17c6dc=_0x47fa2b[_0x033b('0x4b')];if(!_0x5ad04f['query'][_0x033b('0x5f')]('nolimit')){_0x5cc4e5['limit']=qs[_0x033b('0x1f')](_0x5ad04f['query'][_0x033b('0x1f')]);_0x5cc4e5[_0x033b('0x22')]=qs['offset'](_0x5ad04f['query'][_0x033b('0x22')]);}return _0x217c13[_0x033b('0x66')](_0x5cc4e5);}})['then'](function(_0x12451c){if(_0x12451c){return _0x12451c?{'count':_0x17c6dc,'rows':_0x12451c}:null;}})[_0x033b('0x29')](respondWithResult(_0x56536f,null))[_0x033b('0x48')](handleError(_0x56536f,null));};exports[_0x033b('0x68')]=function(_0x2d1768,_0x4ce3ae,_0x49f997){var _0x10aab7,_0x3c8cda;return db[_0x033b('0x2f')][_0x033b('0x4c')]({'where':{'id':_0x2d1768[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x4ce3ae,null))[_0x033b('0x29')](function(_0x1b096d){if(_0x1b096d){_0x3c8cda=_0x1b096d;return _0x1b096d[_0x033b('0x68')](_0x2d1768[_0x033b('0x5a')][_0x033b('0x69')],_[_0x033b('0x57')](_0x2d1768[_0x033b('0x5a')],[_0x033b('0x69'),'id'])||{});}return null;})['spread'](function(_0x181811){var _0x291216;_0x10aab7=_0x181811||[];var _0x219c12=[];if(_0x181811){for(var _0x31af24=0x0;_0x31af24<_0x181811[_0x033b('0x4b')];_0x31af24+=0x1){var _0x360111=_0x181811[_0x31af24][_0x033b('0x2a')]({'plain':!![]});_0x3c8cda[_0x033b('0x6a')]=_0x2d1768['body'][_0x033b('0x6a')]?_0x2d1768[_0x033b('0x5a')][_0x033b('0x6a')]:_0x3c8cda[_0x033b('0x6a')];switch(_0x3c8cda[_0x033b('0x6a')]){case _0x033b('0x6b'):_0x291216=squel[_0x033b('0x6c')]()[_0x033b('0x6d')]('cm_hopper')[_0x033b('0x6e')]([_0x033b('0x6f'),_0x033b('0x70'),'ContactId',_0x033b('0x71'),_0x033b('0x60'),_0x033b('0x58'),_0x033b('0x59')],squel[_0x033b('0x72')]()[_0x033b('0x73')](_0x033b('0x6f'),_0x033b('0x6f'))[_0x033b('0x73')](_0x033b('0x74'),_0x033b('0x70'))['field']('id',_0x033b('0x75'))['field'](_0x360111['CmListId'][_0x033b('0x76')](),_0x033b('0x71'))['field'](_0x2d1768[_0x033b('0x56')]['id'][_0x033b('0x76')](),'CampaignId')[_0x033b('0x73')](_0x033b('0x74'),_0x033b('0x58'))[_0x033b('0x73')]('NOW()',_0x033b('0x59'))[_0x033b('0x77')]('cm_contacts')['where'](_0x033b('0x78'))[_0x033b('0x3c')](_0x033b('0x79'),_0x360111[_0x033b('0x7a')][_0x033b('0x76')]())[_0x033b('0x3c')](_0x033b('0x7b'))[_0x033b('0x3c')](_0x033b('0x7c'),squel[_0x033b('0x72')]()['field'](_0x033b('0x7d'))[_0x033b('0x77')]('cm_hopper_final')[_0x033b('0x3c')](_0x033b('0x7e'),_0x2d1768[_0x033b('0x56')]['id'][_0x033b('0x76')]()))['where'](_0x033b('0x7c'),squel['select']()['field'](_0x033b('0x7f'))['from'](_0x033b('0x80'))[_0x033b('0x3c')](_0x033b('0x7e'),_0x2d1768[_0x033b('0x56')]['id'][_0x033b('0x76')]())))[_0x033b('0x76')]();break;case _0x033b('0x81'):_0x291216=squel[_0x033b('0x6c')]()[_0x033b('0x6d')](_0x033b('0x80'))[_0x033b('0x6e')](['phone','scheduledAt',_0x033b('0x75'),_0x033b('0x71'),_0x033b('0x60'),_0x033b('0x58'),_0x033b('0x59')],squel['select']()[_0x033b('0x73')](_0x033b('0x6f'),_0x033b('0x6f'))[_0x033b('0x73')](_0x033b('0x74'),'scheduledAt')['field']('id',_0x033b('0x75'))[_0x033b('0x73')](_0x360111[_0x033b('0x7a')][_0x033b('0x76')](),_0x033b('0x71'))[_0x033b('0x73')](_0x2d1768[_0x033b('0x56')]['id']['toString'](),_0x033b('0x60'))[_0x033b('0x73')]('NOW()','createdAt')['field'](_0x033b('0x74'),_0x033b('0x59'))[_0x033b('0x77')]('cm_contacts')[_0x033b('0x3c')]('deletedAt\x20IS\x20NULL')[_0x033b('0x3c')](_0x033b('0x79'),_0x360111[_0x033b('0x7a')]['toString']())[_0x033b('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x033b('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x033b('0x7f'))['from'](_0x033b('0x80'))[_0x033b('0x3c')](_0x033b('0x7e'),_0x2d1768[_0x033b('0x56')]['id'][_0x033b('0x76')]())))[_0x033b('0x76')]();break;default:_0x291216=squel['insert']()[_0x033b('0x6d')](_0x033b('0x80'))[_0x033b('0x6e')]([_0x033b('0x6f'),_0x033b('0x70'),_0x033b('0x75'),_0x033b('0x71'),'CampaignId',_0x033b('0x58'),'updatedAt'],squel[_0x033b('0x72')]()[_0x033b('0x73')](_0x033b('0x6f'),_0x033b('0x6f'))['field'](_0x033b('0x74'),_0x033b('0x70'))[_0x033b('0x73')]('id','ContactId')[_0x033b('0x73')](_0x360111['CmListId'][_0x033b('0x76')](),_0x033b('0x71'))[_0x033b('0x73')](_0x2d1768[_0x033b('0x56')]['id'][_0x033b('0x76')](),'CampaignId')[_0x033b('0x73')](_0x033b('0x74'),'createdAt')[_0x033b('0x73')]('NOW()',_0x033b('0x59'))[_0x033b('0x77')](_0x033b('0x82'))[_0x033b('0x3c')](_0x033b('0x78'))[_0x033b('0x3c')](_0x033b('0x79'),_0x360111['CmListId'][_0x033b('0x76')]())[_0x033b('0x3c')](_0x033b('0x7b')))[_0x033b('0x76')]();}_0x219c12['push'](db[_0x033b('0x83')]['query'](_0x291216));}return BPromise['all'](_0x219c12);}})[_0x033b('0x29')](function(){return _0x10aab7;})[_0x033b('0x29')](respondWithResult(_0x4ce3ae,null))['catch'](handleError(_0x4ce3ae,null));};exports['removeLists']=function(_0x13e21c,_0x39531e,_0x3fa510){return db[_0x033b('0x2f')][_0x033b('0x4c')]({'where':{'id':_0x13e21c[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x39531e,null))['then'](function(_0xec3bbe){if(_0xec3bbe){return _0xec3bbe['removeLists'](_0x13e21c[_0x033b('0x33')][_0x033b('0x69')]);}})['then'](function(_0x1421fc){if(_0x1421fc){return db[_0x033b('0x5e')][_0x033b('0x2c')]({'where':{'ListId':_0x13e21c['query'][_0x033b('0x69')],'CampaignId':_0x13e21c[_0x033b('0x56')]['id']}})[_0x033b('0x29')](function(){return _0x1421fc;});}})[_0x033b('0x29')](respondWithStatusCode(_0x39531e,null))[_0x033b('0x48')](handleError(_0x39531e,null));};exports[_0x033b('0x84')]=function(_0x25063b,_0x3345da,_0x3527f0){var _0x3f1ec3={};var _0xe7ac12={};var _0x55ad22;var _0x30085c;return db[_0x033b('0x2f')][_0x033b('0x5d')]({'where':{'id':_0x25063b['params']['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x3345da,null))[_0x033b('0x29')](function(_0xe43395){if(_0xe43395){_0x55ad22=_0xe43395;_0xe7ac12['model']=_[_0x033b('0x34')](db[_0x033b('0x67')]['rawAttributes']);_0xe7ac12[_0x033b('0x33')]=_[_0x033b('0x34')](_0x25063b['query']);_0xe7ac12['filters']=_['intersection'](_0xe7ac12[_0x033b('0x36')],_0xe7ac12[_0x033b('0x33')]);_0x3f1ec3[_0x033b('0x38')]=_[_0x033b('0x35')](_0xe7ac12['model'],qs[_0x033b('0x37')](_0x25063b['query']['fields']));_0x3f1ec3[_0x033b('0x38')]=_0x3f1ec3[_0x033b('0x38')][_0x033b('0x4b')]?_0x3f1ec3[_0x033b('0x38')]:_0xe7ac12[_0x033b('0x36')];_0x3f1ec3[_0x033b('0x3a')]=qs[_0x033b('0x3b')](_0x25063b[_0x033b('0x33')]['sort']);_0x3f1ec3[_0x033b('0x3c')]=qs[_0x033b('0x3d')](_[_0x033b('0x3e')](_0x25063b[_0x033b('0x33')],_0xe7ac12['filters']));if(_0x25063b[_0x033b('0x33')][_0x033b('0x3f')]){_0x3f1ec3[_0x033b('0x3c')]=_[_0x033b('0x40')](_0x3f1ec3[_0x033b('0x3c')],{'$or':_['map'](_0x3f1ec3[_0x033b('0x38')],function(_0x242204){var _0x271227={};_0x271227[_0x242204]={'$like':'%'+_0x25063b['query'][_0x033b('0x3f')]+'%'};return _0x271227;})});}_0x3f1ec3=_[_0x033b('0x40')]({},_0x3f1ec3,_0x25063b[_0x033b('0x43')]);return _0x55ad22[_0x033b('0x84')](_0x3f1ec3);}})['then'](function(_0x2467f4){if(_0x2467f4){_0x30085c=_0x2467f4['length'];if(!_0x25063b[_0x033b('0x33')][_0x033b('0x5f')](_0x033b('0x39'))){_0x3f1ec3[_0x033b('0x1f')]=qs[_0x033b('0x1f')](_0x25063b[_0x033b('0x33')][_0x033b('0x1f')]);_0x3f1ec3[_0x033b('0x22')]=qs[_0x033b('0x22')](_0x25063b[_0x033b('0x33')]['offset']);}return _0x55ad22[_0x033b('0x84')](_0x3f1ec3);}})['then'](function(_0x59168f){if(_0x59168f){return _0x59168f?{'count':_0x30085c,'rows':_0x59168f}:null;}})[_0x033b('0x29')](respondWithResult(_0x3345da,null))[_0x033b('0x48')](handleError(_0x3345da,null));};exports[_0x033b('0x85')]=function(_0x586a66,_0x4b827f,_0x2370c9){var _0x28e637,_0x4443e9;return db[_0x033b('0x2f')][_0x033b('0x4c')]({'where':{'id':_0x586a66[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x4b827f,null))[_0x033b('0x29')](function(_0x2c3998){if(_0x2c3998){_0x4443e9=_0x2c3998;return _0x2c3998[_0x033b('0x85')](_0x586a66[_0x033b('0x5a')]['ids'],_[_0x033b('0x57')](_0x586a66[_0x033b('0x5a')],[_0x033b('0x69'),'id'])||{});}return null;})[_0x033b('0x86')](function(_0x4b839c){var _0x2f236c;_0x28e637=_0x4b839c||[];var _0x174bb4=[];if(_0x4b839c){for(var _0x740e6b=0x0;_0x740e6b<_0x4b839c['length'];_0x740e6b+=0x1){var _0x1e8852=_0x4b839c[_0x740e6b]['get']({'plain':!![]});_0x2f236c=squel[_0x033b('0x6c')]()[_0x033b('0x6d')](_0x033b('0x87'))[_0x033b('0x6e')]([_0x033b('0x6f'),_0x033b('0x75'),_0x033b('0x71'),_0x033b('0x60'),_0x033b('0x58'),'updatedAt'],squel['select']()[_0x033b('0x73')](_0x033b('0x6f'),_0x033b('0x6f'))[_0x033b('0x73')]('id','ContactId')[_0x033b('0x73')](_0x1e8852['CmListId'][_0x033b('0x76')](),_0x033b('0x71'))[_0x033b('0x73')](_0x586a66[_0x033b('0x56')]['id']['toString'](),_0x033b('0x60'))[_0x033b('0x73')](_0x033b('0x74'),_0x033b('0x58'))[_0x033b('0x73')](_0x033b('0x74'),_0x033b('0x59'))['from'](_0x033b('0x82'))[_0x033b('0x3c')]('deletedAt\x20IS\x20NULL')[_0x033b('0x3c')](_0x033b('0x79'),_0x1e8852['CmListId'][_0x033b('0x76')]())['where'](_0x033b('0x7b')))[_0x033b('0x76')]();_0x174bb4['push'](db[_0x033b('0x83')][_0x033b('0x33')](_0x2f236c));}return BPromise[_0x033b('0x88')](_0x174bb4);}})[_0x033b('0x29')](function(){return _0x28e637;})[_0x033b('0x29')](respondWithResult(_0x4b827f,null))[_0x033b('0x48')](handleError(_0x4b827f,null));};exports[_0x033b('0x89')]=function(_0x17dd5b,_0x44c556,_0x2b7865){return db['Campaign'][_0x033b('0x4c')]({'where':{'id':_0x17dd5b[_0x033b('0x56')]['id']}})[_0x033b('0x29')](handleEntityNotFound(_0x44c556,null))[_0x033b('0x29')](function(_0x501f84){if(_0x501f84){return _0x501f84[_0x033b('0x89')](_0x17dd5b['query'][_0x033b('0x69')]);}})[_0x033b('0x29')](function(_0x19721e){if(_0x19721e){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x17dd5b['query'][_0x033b('0x69')],'CampaignId':_0x17dd5b['params']['id']}})[_0x033b('0x29')](function(){return _0x19721e;});}})[_0x033b('0x29')](respondWithStatusCode(_0x44c556,null))[_0x033b('0x48')](handleError(_0x44c556,null));};
\ No newline at end of file
+var _0x4a4f=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','includeAll','include','findAll','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','rows','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','cm_contacts','push','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x21cc4e,_0x24a7ac){var _0x3b7125=function(_0x1f37db){while(--_0x1f37db){_0x21cc4e['push'](_0x21cc4e['shift']());}};_0x3b7125(++_0x24a7ac);}(_0x4a4f,0x71));var _0xf4a4=function(_0x3f6778,_0x10ffb7){_0x3f6778=_0x3f6778-0x0;var _0x5546ed=_0x4a4f[_0x3f6778];return _0x5546ed;};'use strict';var emlformat=require(_0xf4a4('0x0'));var rimraf=require(_0xf4a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4a4('0x2'));var rp=require(_0xf4a4('0x3'));var moment=require(_0xf4a4('0x4'));var BPromise=require(_0xf4a4('0x5'));var Mustache=require(_0xf4a4('0x6'));var util=require('util');var path=require(_0xf4a4('0x7'));var sox=require('sox');var csv=require(_0xf4a4('0x8'));var ejs=require(_0xf4a4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4a4('0xa'));var squel=require(_0xf4a4('0xb'));var crypto=require('crypto');var jsforce=require(_0xf4a4('0xc'));var deskjs=require(_0xf4a4('0xd'));var toCsv=require(_0xf4a4('0x8'));var querystring=require(_0xf4a4('0xe'));var Papa=require(_0xf4a4('0xf'));var Redis=require(_0xf4a4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4a4('0x12'))(_0xf4a4('0x13'));var utils=require('../../config/utils');var config=require(_0xf4a4('0x14'));var licenseUtil=require(_0xf4a4('0x15'));var db=require(_0xf4a4('0x16'))['db'];function respondWithStatusCode(_0x4ac45e,_0x3a3510){_0x3a3510=_0x3a3510||0xcc;return function(_0x46075b){if(_0x46075b){return _0x4ac45e[_0xf4a4('0x17')](_0x3a3510);}return _0x4ac45e[_0xf4a4('0x18')](_0x3a3510)[_0xf4a4('0x19')]();};}function respondWithResult(_0x2dce2c,_0x5bc8ba){_0x5bc8ba=_0x5bc8ba||0xc8;return function(_0x4d3f39){if(_0x4d3f39){return _0x2dce2c[_0xf4a4('0x18')](_0x5bc8ba)['json'](_0x4d3f39);}};}function respondWithFilteredResult(_0x1bc583,_0x2b7c9b){return function(_0x4f0d35){if(_0x4f0d35){var _0x157b60=typeof _0x2b7c9b[_0xf4a4('0x1a')]===_0xf4a4('0x1b')&&typeof _0x2b7c9b['limit']==='undefined';var _0x32ca28=_0x4f0d35[_0xf4a4('0x1c')];var _0x5473c0=_0x157b60?0x0:_0x2b7c9b[_0xf4a4('0x1a')];var _0x1b8b03=_0x157b60?_0x4f0d35[_0xf4a4('0x1c')]:_0x2b7c9b[_0xf4a4('0x1a')]+_0x2b7c9b[_0xf4a4('0x1d')];var _0x55d8bf;if(_0x1b8b03>=_0x32ca28){_0x1b8b03=_0x32ca28;_0x55d8bf=0xc8;}else{_0x55d8bf=0xce;}_0x1bc583[_0xf4a4('0x18')](_0x55d8bf);return _0x1bc583[_0xf4a4('0x1e')](_0xf4a4('0x1f'),_0x5473c0+'-'+_0x1b8b03+'/'+_0x32ca28)[_0xf4a4('0x20')](_0x4f0d35);}return null;};}function patchUpdates(_0x4e8fec){return function(_0x325d1c){try{jsonpatch[_0xf4a4('0x21')](_0x325d1c,_0x4e8fec,!![]);}catch(_0x28f968){return BPromise['reject'](_0x28f968);}return _0x325d1c[_0xf4a4('0x22')]();};}function saveUpdates(_0x775e85,_0x33e9f8){return function(_0xd3a626){if(_0xd3a626){return _0xd3a626[_0xf4a4('0x23')](_0x775e85)['then'](function(_0x34a647){return _0x34a647;});}return null;};}function removeEntity(_0x40f068,_0xf48cb1){return function(_0x385bc0){if(_0x385bc0){return _0x385bc0[_0xf4a4('0x24')]()[_0xf4a4('0x25')](function(){var _0x2282f7=_0x385bc0[_0xf4a4('0x26')]({'plain':!![]});var _0x2c1ffc=_0xf4a4('0x27');return db[_0xf4a4('0x28')][_0xf4a4('0x24')]({'where':{'type':_0x2c1ffc,'resourceId':_0x2282f7['id']}})[_0xf4a4('0x25')](function(){return _0x385bc0;});})[_0xf4a4('0x25')](function(){_0x40f068[_0xf4a4('0x18')](0xcc)[_0xf4a4('0x19')]();});}};}function handleEntityNotFound(_0x348af3,_0x262f16){return function(_0x504e74){if(!_0x504e74){_0x348af3['sendStatus'](0x194);}return _0x504e74;};}function handleError(_0x2f785d,_0x223137){_0x223137=_0x223137||0x1f4;return function(_0x18a194){logger[_0xf4a4('0x29')](_0x18a194[_0xf4a4('0x2a')]);if(_0x18a194['name']){delete _0x18a194[_0xf4a4('0x2b')];}_0x2f785d[_0xf4a4('0x18')](_0x223137)['send'](_0x18a194);};}exports[_0xf4a4('0x2c')]=function(_0x183531,_0x36a50b){var _0xb01ef5={},_0x2be6c0={},_0xa3e891={'count':0x0,'rows':[]};var _0x43fafa=_[_0xf4a4('0x2d')](db[_0xf4a4('0x2e')][_0xf4a4('0x2f')],function(_0x402bac){return{'name':_0x402bac['fieldName'],'type':_0x402bac['type']['key']};});_0x2be6c0['model']=_[_0xf4a4('0x2d')](_0x43fafa,_0xf4a4('0x2b'));_0x2be6c0[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x183531[_0xf4a4('0x30')]);_0x2be6c0['filters']=_[_0xf4a4('0x32')](_0x2be6c0[_0xf4a4('0x33')],_0x2be6c0['query']);_0xb01ef5[_0xf4a4('0x34')]=_['intersection'](_0x2be6c0[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x183531['query'][_0xf4a4('0x35')]));_0xb01ef5[_0xf4a4('0x34')]=_0xb01ef5[_0xf4a4('0x34')]['length']?_0xb01ef5[_0xf4a4('0x34')]:_0x2be6c0[_0xf4a4('0x33')];if(!_0x183531[_0xf4a4('0x30')]['hasOwnProperty'](_0xf4a4('0x36'))){_0xb01ef5[_0xf4a4('0x1d')]=qs['limit'](_0x183531[_0xf4a4('0x30')][_0xf4a4('0x1d')]);_0xb01ef5['offset']=qs[_0xf4a4('0x1a')](_0x183531[_0xf4a4('0x30')]['offset']);}_0xb01ef5[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x183531[_0xf4a4('0x30')][_0xf4a4('0x38')]);_0xb01ef5[_0xf4a4('0x39')]=qs['filters'](_[_0xf4a4('0x3a')](_0x183531['query'],_0x2be6c0[_0xf4a4('0x3b')]),_0x43fafa);if(_0x183531['query'][_0xf4a4('0x3c')]){_0xb01ef5[_0xf4a4('0x39')]=_['merge'](_0xb01ef5['where'],{'$or':_[_0xf4a4('0x2d')](_0x43fafa,function(_0x2474d5){if(_0x2474d5[_0xf4a4('0x3d')]!==_0xf4a4('0x3e')){var _0x1f5ef1={};_0x1f5ef1[_0x2474d5[_0xf4a4('0x2b')]]={'$like':'%'+_0x183531['query'][_0xf4a4('0x3c')]+'%'};return _0x1f5ef1;}})});}_0xb01ef5=_[_0xf4a4('0x3f')]({},_0xb01ef5,_0x183531['options']);var _0x59da31={'where':_0xb01ef5[_0xf4a4('0x39')]};return db[_0xf4a4('0x2e')]['count'](_0x59da31)[_0xf4a4('0x25')](function(_0x6ad47f){_0xa3e891[_0xf4a4('0x1c')]=_0x6ad47f;if(_0x183531['query'][_0xf4a4('0x40')]){_0xb01ef5[_0xf4a4('0x41')]=[{'all':!![]}];}return db[_0xf4a4('0x2e')][_0xf4a4('0x42')](_0xb01ef5);})[_0xf4a4('0x25')](function(_0x11a8d6){_0xa3e891['rows']=_0x11a8d6;return _0xa3e891;})[_0xf4a4('0x25')](respondWithFilteredResult(_0x36a50b,_0xb01ef5))['catch'](handleError(_0x36a50b,null));};exports['show']=function(_0x2ba8ba,_0x8b9f37){var _0x383a76={'raw':![],'where':{'id':_0x2ba8ba[_0xf4a4('0x43')]['id']}},_0x14993f={};_0x14993f[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db[_0xf4a4('0x2e')][_0xf4a4('0x2f')]);_0x14993f[_0xf4a4('0x30')]=_['keys'](_0x2ba8ba[_0xf4a4('0x30')]);_0x14993f['filters']=_[_0xf4a4('0x32')](_0x14993f['model'],_0x14993f[_0xf4a4('0x30')]);_0x383a76['attributes']=_[_0xf4a4('0x32')](_0x14993f[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x2ba8ba[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x383a76[_0xf4a4('0x34')]=_0x383a76[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x383a76['attributes']:_0x14993f[_0xf4a4('0x33')];if(_0x2ba8ba[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x383a76['include']=[{'all':!![]}];}_0x383a76=_[_0xf4a4('0x3f')]({},_0x383a76,_0x2ba8ba[_0xf4a4('0x45')]);return db[_0xf4a4('0x2e')][_0xf4a4('0x46')](_0x383a76)[_0xf4a4('0x25')](handleEntityNotFound(_0x8b9f37,null))[_0xf4a4('0x25')](respondWithResult(_0x8b9f37,null))[_0xf4a4('0x47')](handleError(_0x8b9f37,null));};exports[_0xf4a4('0x48')]=function(_0x4b6ee5,_0x2fe282){return db[_0xf4a4('0x2e')]['create'](_0x4b6ee5[_0xf4a4('0x49')],{})[_0xf4a4('0x25')](function(_0xc39e4d){var _0x5b6413=_0x4b6ee5[_0xf4a4('0x4a')][_0xf4a4('0x26')]({'plain':!![]});if(!_0x5b6413)throw new Error(_0xf4a4('0x4b'));if(_0x5b6413['role']===_0xf4a4('0x4a')){var _0x3903bd=_0xc39e4d['get']({'plain':!![]});var _0x5d31a5=_0xf4a4('0x27');return db[_0xf4a4('0x4c')][_0xf4a4('0x46')]({'where':{'name':_0x5d31a5,'userProfileId':_0x5b6413[_0xf4a4('0x4d')]},'raw':!![]})[_0xf4a4('0x25')](function(_0x4450da){if(_0x4450da&&_0x4450da[_0xf4a4('0x4e')]===0x0){return db[_0xf4a4('0x28')][_0xf4a4('0x48')]({'name':_0x3903bd['name'],'resourceId':_0x3903bd['id'],'type':_0x4450da[_0xf4a4('0x2b')],'sectionId':_0x4450da['id']},{})[_0xf4a4('0x25')](function(){return _0xc39e4d;});}else{return _0xc39e4d;}})['catch'](function(_0xaf8a0b){logger[_0xf4a4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaf8a0b);throw _0xaf8a0b;});}return _0xc39e4d;})[_0xf4a4('0x25')](respondWithResult(_0x2fe282,0xc9))['catch'](handleError(_0x2fe282,null));};exports['clone']=function(_0x321364,_0x25a12c){var _0x47f104={'where':{'id':_0x321364['params']['id']}},_0x1adee7={};_0x1adee7[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db[_0xf4a4('0x2e')][_0xf4a4('0x2f')]);_0x47f104['attributes']=_[_0xf4a4('0x32')](_0x1adee7[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x321364[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x47f104[_0xf4a4('0x34')]=_0x47f104[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x47f104['attributes']:_0x1adee7[_0xf4a4('0x33')];if(_0x321364[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x47f104[_0xf4a4('0x41')]=[{'all':!![]}];}_0x47f104=_[_0xf4a4('0x3f')]({},_0x47f104,_0x321364['options']);return db[_0xf4a4('0x2e')][_0xf4a4('0x46')](_0x47f104)['then'](handleEntityNotFound(_0x25a12c,null))[_0xf4a4('0x25')](function(_0x3119bf){if(_0x3119bf){var _0x40fc53=_0x3119bf[_0xf4a4('0x26')]({'plain':!![]});_0x40fc53=qs[_0xf4a4('0x4f')](_0x40fc53,['id',_0xf4a4('0x50'),_0xf4a4('0x51')]);_0x321364['body']=_['omit'](_0x321364['body'],['id','createdAt',_0xf4a4('0x51')]);return db[_0xf4a4('0x2e')][_0xf4a4('0x48')](_[_0xf4a4('0x3f')](_0x40fc53,_0x321364[_0xf4a4('0x49')]),{'include':_0x321364[_0xf4a4('0x30')][_0xf4a4('0x40')]?[{'all':!![]}]:undefined})[_0xf4a4('0x25')](function(_0x5b5e9f){var _0x21f4a2=_0x321364[_0xf4a4('0x4a')][_0xf4a4('0x26')]({'plain':!![]});if(!_0x21f4a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21f4a2[_0xf4a4('0x52')]===_0xf4a4('0x4a')){var _0x4c8712=_0x5b5e9f['get']({'plain':!![]});var _0x100de1='IvrCampaigns';return db[_0xf4a4('0x4c')][_0xf4a4('0x46')]({'where':{'name':_0x100de1,'userProfileId':_0x21f4a2[_0xf4a4('0x4d')]},'raw':!![]})[_0xf4a4('0x25')](function(_0x50f895){if(_0x50f895&&_0x50f895[_0xf4a4('0x4e')]===0x0){return db['UserProfileResource'][_0xf4a4('0x48')]({'name':_0x4c8712[_0xf4a4('0x2b')],'resourceId':_0x4c8712['id'],'type':_0x50f895[_0xf4a4('0x2b')],'sectionId':_0x50f895['id']},{})['then'](function(){return _0x5b5e9f;});}else{return _0x5b5e9f;}})['catch'](function(_0x3a2fd1){logger[_0xf4a4('0x29')](_0xf4a4('0x53'),_0x3a2fd1);throw _0x3a2fd1;});}return _0x5b5e9f;});}})[_0xf4a4('0x25')](respondWithResult(_0x25a12c,0xc9))[_0xf4a4('0x47')](handleError(_0x25a12c,null));};exports['update']=function(_0x5306cc,_0x25e045){if(_0x5306cc[_0xf4a4('0x49')]['id']){delete _0x5306cc[_0xf4a4('0x49')]['id'];}return db[_0xf4a4('0x2e')][_0xf4a4('0x46')]({'where':{'id':_0x5306cc[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x25e045,null))[_0xf4a4('0x25')](saveUpdates(_0x5306cc[_0xf4a4('0x49')],null))['then'](respondWithResult(_0x25e045,null))[_0xf4a4('0x47')](handleError(_0x25e045,null));};exports[_0xf4a4('0x24')]=function(_0x21abc2,_0x5ec908){return db[_0xf4a4('0x2e')][_0xf4a4('0x46')]({'where':{'id':_0x21abc2['params']['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x5ec908,null))['then'](removeEntity(_0x5ec908,null))[_0xf4a4('0x47')](handleError(_0x5ec908,null));};exports[_0xf4a4('0x54')]=function(_0x3f8e9e,_0x2b77b2,_0x37bd80){var _0x562305={'raw':!![],'where':{}};var _0x119740={};var _0x320cd9={'count':0x0,'rows':[]};return db['Campaign'][_0xf4a4('0x55')]({'where':{'id':_0x3f8e9e[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x2b77b2,null))[_0xf4a4('0x25')](function(_0x1c6efa){if(_0x1c6efa){_0x119740[_0xf4a4('0x33')]=_['keys'](db['CmHopper'][_0xf4a4('0x2f')]);_0x119740[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x3f8e9e[_0xf4a4('0x30')]);_0x119740[_0xf4a4('0x3b')]=_[_0xf4a4('0x32')](_0x119740[_0xf4a4('0x33')],_0x119740[_0xf4a4('0x30')]);_0x562305[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x119740[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x3f8e9e['query'][_0xf4a4('0x35')]));_0x562305[_0xf4a4('0x34')]=_0x562305[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x562305[_0xf4a4('0x34')]:_0x119740[_0xf4a4('0x33')];if(!_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x562305[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x3f8e9e[_0xf4a4('0x30')]['limit']);_0x562305[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x1a')]);}_0x562305[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x38')]);_0x562305[_0xf4a4('0x39')]=qs[_0xf4a4('0x3b')](_[_0xf4a4('0x3a')](_0x3f8e9e[_0xf4a4('0x30')],_0x119740[_0xf4a4('0x3b')]));_0x562305[_0xf4a4('0x39')][_0xf4a4('0x57')]=_0x1c6efa['id'];if(_0x3f8e9e[_0xf4a4('0x30')][_0xf4a4('0x3c')]){_0x562305['where']=_[_0xf4a4('0x3f')](_0x562305[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x562305[_0xf4a4('0x34')],function(_0x327b2a){var _0x1167ea={};_0x1167ea[_0x327b2a]={'$like':'%'+_0x3f8e9e['query'][_0xf4a4('0x3c')]+'%'};return _0x1167ea;})});}_0x562305=_[_0xf4a4('0x3f')]({},_0x562305,_0x3f8e9e[_0xf4a4('0x45')]);return db[_0xf4a4('0x58')]['count']({'where':_0x562305[_0xf4a4('0x39')]})[_0xf4a4('0x25')](function(_0x447706){_0x320cd9[_0xf4a4('0x1c')]=_0x447706;if(_0x3f8e9e[_0xf4a4('0x30')]['includeAll']){_0x562305['include']=[{'all':!![]}];}return db[_0xf4a4('0x58')][_0xf4a4('0x42')](_0x562305);})[_0xf4a4('0x25')](function(_0x50c7bd){_0x320cd9['rows']=_0x50c7bd;return _0x320cd9;});}})['then'](respondWithFilteredResult(_0x2b77b2,_0x562305))['catch'](handleError(_0x2b77b2,null));};exports[_0xf4a4('0x59')]=function(_0x290624,_0x2e67a0,_0x3cb8d6){var _0x85a959={'raw':!![],'where':{}};var _0x276e32={};var _0x40a14c={'count':0x0,'rows':[]};return db[_0xf4a4('0x2e')][_0xf4a4('0x55')]({'where':{'id':_0x290624[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x2e67a0,null))[_0xf4a4('0x25')](function(_0x2cae52){if(_0x2cae52){_0x276e32[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db[_0xf4a4('0x5a')][_0xf4a4('0x2f')]);_0x276e32['query']=_[_0xf4a4('0x31')](_0x290624[_0xf4a4('0x30')]);_0x276e32[_0xf4a4('0x3b')]=_[_0xf4a4('0x32')](_0x276e32['model'],_0x276e32[_0xf4a4('0x30')]);_0x85a959[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x276e32[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x290624[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x85a959['attributes']=_0x85a959[_0xf4a4('0x34')]['length']?_0x85a959[_0xf4a4('0x34')]:_0x276e32[_0xf4a4('0x33')];if(!_0x290624['query'][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x85a959[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x290624[_0xf4a4('0x30')]['limit']);_0x85a959[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x290624[_0xf4a4('0x30')][_0xf4a4('0x1a')]);}_0x85a959[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x290624[_0xf4a4('0x30')]['sort']);_0x85a959[_0xf4a4('0x39')]=qs[_0xf4a4('0x3b')](_[_0xf4a4('0x3a')](_0x290624['query'],_0x276e32[_0xf4a4('0x3b')]));_0x85a959[_0xf4a4('0x39')][_0xf4a4('0x57')]=_0x2cae52['id'];if(_0x290624[_0xf4a4('0x30')]['filter']){_0x85a959[_0xf4a4('0x39')]=_[_0xf4a4('0x3f')](_0x85a959[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x85a959[_0xf4a4('0x34')],function(_0x3f61a4){var _0x5bcc99={};_0x5bcc99[_0x3f61a4]={'$like':'%'+_0x290624[_0xf4a4('0x30')][_0xf4a4('0x3c')]+'%'};return _0x5bcc99;})});}_0x85a959=_['merge']({},_0x85a959,_0x290624[_0xf4a4('0x45')]);return db[_0xf4a4('0x5a')][_0xf4a4('0x1c')]({'where':_0x85a959[_0xf4a4('0x39')]})[_0xf4a4('0x25')](function(_0x12427a){_0x40a14c[_0xf4a4('0x1c')]=_0x12427a;if(_0x290624[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x85a959['include']=[{'all':!![]}];}return db[_0xf4a4('0x5a')]['findAll'](_0x85a959);})[_0xf4a4('0x25')](function(_0xae49df){_0x40a14c['rows']=_0xae49df;return _0x40a14c;});}})[_0xf4a4('0x25')](respondWithFilteredResult(_0x2e67a0,_0x85a959))[_0xf4a4('0x47')](handleError(_0x2e67a0,null));};exports['getHopperFinals']=function(_0x3e872e,_0x2ec432,_0x295843){var _0x2646fa={'raw':!![],'where':{}};var _0x4005f1={};var _0x16102a={'count':0x0,'rows':[]};return db[_0xf4a4('0x2e')]['findOne']({'where':{'id':_0x3e872e['params']['id']}})['then'](handleEntityNotFound(_0x2ec432,null))[_0xf4a4('0x25')](function(_0x69b45a){if(_0x69b45a){_0x4005f1[_0xf4a4('0x33')]=_[_0xf4a4('0x31')](db['CmHopperFinal'][_0xf4a4('0x2f')]);_0x4005f1[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x3e872e[_0xf4a4('0x30')]);_0x4005f1['filters']=_['intersection'](_0x4005f1[_0xf4a4('0x33')],_0x4005f1['query']);_0x2646fa[_0xf4a4('0x34')]=_['intersection'](_0x4005f1[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x3e872e['query'][_0xf4a4('0x35')]));_0x2646fa[_0xf4a4('0x34')]=_0x2646fa[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x2646fa[_0xf4a4('0x34')]:_0x4005f1[_0xf4a4('0x33')];if(!_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x2646fa['limit']=qs[_0xf4a4('0x1d')](_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x1d')]);_0x2646fa['offset']=qs[_0xf4a4('0x1a')](_0x3e872e['query'][_0xf4a4('0x1a')]);}_0x2646fa['order']=qs['sort'](_0x3e872e['query'][_0xf4a4('0x38')]);_0x2646fa[_0xf4a4('0x39')]=qs['filters'](_[_0xf4a4('0x3a')](_0x3e872e[_0xf4a4('0x30')],_0x4005f1[_0xf4a4('0x3b')]));_0x2646fa[_0xf4a4('0x39')]['CampaignId']=_0x69b45a['id'];if(_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x3c')]){_0x2646fa['where']=_[_0xf4a4('0x3f')](_0x2646fa['where'],{'$or':_[_0xf4a4('0x2d')](_0x2646fa['attributes'],function(_0x1f5d4d){var _0x15f02a={};_0x15f02a[_0x1f5d4d]={'$like':'%'+_0x3e872e[_0xf4a4('0x30')]['filter']+'%'};return _0x15f02a;})});}_0x2646fa=_[_0xf4a4('0x3f')]({},_0x2646fa,_0x3e872e[_0xf4a4('0x45')]);return db[_0xf4a4('0x5b')]['count']({'where':_0x2646fa['where']})[_0xf4a4('0x25')](function(_0x41e2c0){_0x16102a['count']=_0x41e2c0;if(_0x3e872e[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x2646fa[_0xf4a4('0x41')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2646fa);})[_0xf4a4('0x25')](function(_0x1785b5){_0x16102a[_0xf4a4('0x5c')]=_0x1785b5;return _0x16102a;});}})['then'](respondWithFilteredResult(_0x2ec432,_0x2646fa))[_0xf4a4('0x47')](handleError(_0x2ec432,null));};exports['getHopperBlacks']=function(_0x26ab64,_0x419e16,_0x215178){var _0x3e435e={'raw':!![],'where':{}};var _0xa462e9={};var _0x26cb36={'count':0x0,'rows':[]};return db['Campaign'][_0xf4a4('0x55')]({'where':{'id':_0x26ab64['params']['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x419e16,null))[_0xf4a4('0x25')](function(_0x12db4b){if(_0x12db4b){_0xa462e9[_0xf4a4('0x33')]=_['keys'](db[_0xf4a4('0x5d')][_0xf4a4('0x2f')]);_0xa462e9[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x26ab64[_0xf4a4('0x30')]);_0xa462e9['filters']=_[_0xf4a4('0x32')](_0xa462e9[_0xf4a4('0x33')],_0xa462e9[_0xf4a4('0x30')]);_0x3e435e[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0xa462e9[_0xf4a4('0x33')],qs['fields'](_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x3e435e[_0xf4a4('0x34')]=_0x3e435e[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x3e435e[_0xf4a4('0x34')]:_0xa462e9[_0xf4a4('0x33')];if(!_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x3e435e[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x26ab64[_0xf4a4('0x30')]['limit']);_0x3e435e[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x26ab64['query'][_0xf4a4('0x1a')]);}_0x3e435e[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x26ab64['query'][_0xf4a4('0x38')]);_0x3e435e['where']=qs['filters'](_[_0xf4a4('0x3a')](_0x26ab64[_0xf4a4('0x30')],_0xa462e9[_0xf4a4('0x3b')]));_0x3e435e[_0xf4a4('0x39')][_0xf4a4('0x57')]=_0x12db4b['id'];if(_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x3c')]){_0x3e435e['where']=_[_0xf4a4('0x3f')](_0x3e435e[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x3e435e[_0xf4a4('0x34')],function(_0x2a6775){var _0x49efd8={};_0x49efd8[_0x2a6775]={'$like':'%'+_0x26ab64['query'][_0xf4a4('0x3c')]+'%'};return _0x49efd8;})});}_0x3e435e=_[_0xf4a4('0x3f')]({},_0x3e435e,_0x26ab64[_0xf4a4('0x45')]);return db[_0xf4a4('0x5d')][_0xf4a4('0x1c')]({'where':_0x3e435e['where']})['then'](function(_0x13cc31){_0x26cb36[_0xf4a4('0x1c')]=_0x13cc31;if(_0x26ab64[_0xf4a4('0x30')][_0xf4a4('0x40')]){_0x3e435e[_0xf4a4('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf4a4('0x42')](_0x3e435e);})['then'](function(_0x453f67){_0x26cb36[_0xf4a4('0x5c')]=_0x453f67;return _0x26cb36;});}})[_0xf4a4('0x25')](respondWithFilteredResult(_0x419e16,_0x3e435e))[_0xf4a4('0x47')](handleError(_0x419e16,null));};exports[_0xf4a4('0x5e')]=function(_0x5a4509,_0x46999b,_0x229bde){var _0x3b6750={};var _0x2cf6a1={};var _0x5c88e6;var _0x3b3ba;return db['Campaign'][_0xf4a4('0x55')]({'where':{'id':_0x5a4509[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x46999b,null))['then'](function(_0x5c404b){if(_0x5c404b){_0x5c88e6=_0x5c404b;_0x2cf6a1[_0xf4a4('0x33')]=_['keys'](db[_0xf4a4('0x5f')][_0xf4a4('0x2f')]);_0x2cf6a1[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0x5a4509[_0xf4a4('0x30')]);_0x2cf6a1['filters']=_[_0xf4a4('0x32')](_0x2cf6a1['model'],_0x2cf6a1[_0xf4a4('0x30')]);_0x3b6750[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x2cf6a1[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0x5a4509['query'][_0xf4a4('0x35')]));_0x3b6750[_0xf4a4('0x34')]=_0x3b6750[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x3b6750[_0xf4a4('0x34')]:_0x2cf6a1[_0xf4a4('0x33')];_0x3b6750[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x38')]);_0x3b6750[_0xf4a4('0x39')]=qs[_0xf4a4('0x3b')](_['pick'](_0x5a4509[_0xf4a4('0x30')],_0x2cf6a1['filters']));if(_0x5a4509[_0xf4a4('0x30')]['filter']){_0x3b6750[_0xf4a4('0x39')]=_['merge'](_0x3b6750[_0xf4a4('0x39')],{'$or':_[_0xf4a4('0x2d')](_0x3b6750[_0xf4a4('0x34')],function(_0x347768){var _0x533e6b={};_0x533e6b[_0x347768]={'$like':'%'+_0x5a4509[_0xf4a4('0x30')]['filter']+'%'};return _0x533e6b;})});}_0x3b6750=_[_0xf4a4('0x3f')]({},_0x3b6750,_0x5a4509[_0xf4a4('0x45')]);return _0x5c88e6[_0xf4a4('0x5e')](_0x3b6750);}})['then'](function(_0x2c1fd5){if(_0x2c1fd5){_0x3b3ba=_0x2c1fd5[_0xf4a4('0x44')];if(!_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x56')](_0xf4a4('0x36'))){_0x3b6750[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x1d')]);_0x3b6750[_0xf4a4('0x1a')]=qs[_0xf4a4('0x1a')](_0x5a4509[_0xf4a4('0x30')][_0xf4a4('0x1a')]);}return _0x5c88e6[_0xf4a4('0x5e')](_0x3b6750);}})[_0xf4a4('0x25')](function(_0x506a46){if(_0x506a46){return _0x506a46?{'count':_0x3b3ba,'rows':_0x506a46}:null;}})['then'](respondWithResult(_0x46999b,null))[_0xf4a4('0x47')](handleError(_0x46999b,null));};exports[_0xf4a4('0x60')]=function(_0x9dbfa4,_0x26c334,_0x24b3a6){var _0x531f9c,_0x4a98ab;return db['Campaign'][_0xf4a4('0x46')]({'where':{'id':_0x9dbfa4[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x26c334,null))[_0xf4a4('0x25')](function(_0x35e2ef){if(_0x35e2ef){_0x4a98ab=_0x35e2ef;return _0x35e2ef[_0xf4a4('0x60')](_0x9dbfa4['body'][_0xf4a4('0x61')],_[_0xf4a4('0x4f')](_0x9dbfa4[_0xf4a4('0x49')],[_0xf4a4('0x61'),'id'])||{});}return null;})[_0xf4a4('0x62')](function(_0x3e9bd5){var _0x25bbbe;_0x531f9c=_0x3e9bd5||[];var _0x32b298=[];if(_0x3e9bd5){for(var _0xcfb159=0x0;_0xcfb159<_0x3e9bd5['length'];_0xcfb159+=0x1){var _0x36c674=_0x3e9bd5[_0xcfb159]['get']({'plain':!![]});_0x4a98ab[_0xf4a4('0x63')]=_0x9dbfa4[_0xf4a4('0x49')]['dialCheckDuplicateType']?_0x9dbfa4[_0xf4a4('0x49')]['dialCheckDuplicateType']:_0x4a98ab[_0xf4a4('0x63')];switch(_0x4a98ab[_0xf4a4('0x63')]){case _0xf4a4('0x64'):_0x25bbbe=squel[_0xf4a4('0x65')]()[_0xf4a4('0x66')](_0xf4a4('0x67'))[_0xf4a4('0x68')]([_0xf4a4('0x69'),_0xf4a4('0x6a'),_0xf4a4('0x6b'),_0xf4a4('0x6c'),_0xf4a4('0x57'),_0xf4a4('0x50'),_0xf4a4('0x51')],squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')](_0xf4a4('0x69'),_0xf4a4('0x69'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x6a'))[_0xf4a4('0x6e')]('id',_0xf4a4('0x6b'))['field'](_0x36c674['CmListId'][_0xf4a4('0x70')](),_0xf4a4('0x6c'))['field'](_0x9dbfa4[_0xf4a4('0x43')]['id']['toString'](),_0xf4a4('0x57'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x50'))[_0xf4a4('0x6e')]('NOW()',_0xf4a4('0x51'))[_0xf4a4('0x71')]('cm_contacts')[_0xf4a4('0x39')](_0xf4a4('0x72'))[_0xf4a4('0x39')](_0xf4a4('0x73'),_0x36c674['CmListId']['toString']())[_0xf4a4('0x39')](_0xf4a4('0x74'))[_0xf4a4('0x39')](_0xf4a4('0x75'),squel[_0xf4a4('0x6d')]()['field'](_0xf4a4('0x76'))['from'](_0xf4a4('0x77'))[_0xf4a4('0x39')](_0xf4a4('0x78'),_0x9dbfa4[_0xf4a4('0x43')]['id']['toString']()))[_0xf4a4('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')](_0xf4a4('0x79'))[_0xf4a4('0x71')](_0xf4a4('0x67'))['where']('CampaignId\x20=\x20?',_0x9dbfa4['params']['id'][_0xf4a4('0x70')]())))[_0xf4a4('0x70')]();break;case _0xf4a4('0x7a'):_0x25bbbe=squel[_0xf4a4('0x65')]()[_0xf4a4('0x66')](_0xf4a4('0x67'))[_0xf4a4('0x68')]([_0xf4a4('0x69'),'scheduledAt',_0xf4a4('0x6b'),_0xf4a4('0x6c'),_0xf4a4('0x57'),_0xf4a4('0x50'),_0xf4a4('0x51')],squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')]('phone','phone')[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x6a'))[_0xf4a4('0x6e')]('id',_0xf4a4('0x6b'))['field'](_0x36c674[_0xf4a4('0x7b')][_0xf4a4('0x70')](),_0xf4a4('0x6c'))[_0xf4a4('0x6e')](_0x9dbfa4['params']['id'][_0xf4a4('0x70')](),_0xf4a4('0x57'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x50'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x51'))[_0xf4a4('0x71')](_0xf4a4('0x7c'))[_0xf4a4('0x39')]('deletedAt\x20IS\x20NULL')[_0xf4a4('0x39')](_0xf4a4('0x73'),_0x36c674['CmListId'][_0xf4a4('0x70')]())[_0xf4a4('0x39')](_0xf4a4('0x74'))[_0xf4a4('0x39')](_0xf4a4('0x75'),squel[_0xf4a4('0x6d')]()[_0xf4a4('0x6e')]('COALESCE(phone,\x27\x27)')[_0xf4a4('0x71')](_0xf4a4('0x67'))[_0xf4a4('0x39')]('CampaignId\x20=\x20?',_0x9dbfa4['params']['id'][_0xf4a4('0x70')]())))[_0xf4a4('0x70')]();break;default:_0x25bbbe=squel[_0xf4a4('0x65')]()['into'](_0xf4a4('0x67'))[_0xf4a4('0x68')]([_0xf4a4('0x69'),_0xf4a4('0x6a'),_0xf4a4('0x6b'),_0xf4a4('0x6c'),'CampaignId',_0xf4a4('0x50'),_0xf4a4('0x51')],squel[_0xf4a4('0x6d')]()['field']('phone',_0xf4a4('0x69'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x6a'))[_0xf4a4('0x6e')]('id','ContactId')[_0xf4a4('0x6e')](_0x36c674['CmListId']['toString'](),_0xf4a4('0x6c'))[_0xf4a4('0x6e')](_0x9dbfa4[_0xf4a4('0x43')]['id'][_0xf4a4('0x70')](),'CampaignId')[_0xf4a4('0x6e')]('NOW()',_0xf4a4('0x50'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),_0xf4a4('0x51'))[_0xf4a4('0x71')](_0xf4a4('0x7c'))[_0xf4a4('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0xf4a4('0x73'),_0x36c674[_0xf4a4('0x7b')][_0xf4a4('0x70')]())[_0xf4a4('0x39')](_0xf4a4('0x74')))['toString']();}_0x32b298[_0xf4a4('0x7d')](db[_0xf4a4('0x7e')][_0xf4a4('0x30')](_0x25bbbe));}return BPromise[_0xf4a4('0x7f')](_0x32b298);}})[_0xf4a4('0x25')](function(){return _0x531f9c;})[_0xf4a4('0x25')](respondWithResult(_0x26c334,null))[_0xf4a4('0x47')](handleError(_0x26c334,null));};exports[_0xf4a4('0x80')]=function(_0x570cd4,_0x3eee73,_0x51f8ad){return db[_0xf4a4('0x2e')]['find']({'where':{'id':_0x570cd4['params']['id']}})['then'](handleEntityNotFound(_0x3eee73,null))['then'](function(_0x2d29ca){if(_0x2d29ca){return _0x2d29ca['removeLists'](_0x570cd4['query'][_0xf4a4('0x61')]);}})['then'](function(_0x2b15de){if(_0x2b15de){return db[_0xf4a4('0x58')][_0xf4a4('0x24')]({'where':{'ListId':_0x570cd4[_0xf4a4('0x30')]['ids'],'CampaignId':_0x570cd4[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](function(){return _0x2b15de;});}})[_0xf4a4('0x25')](respondWithStatusCode(_0x3eee73,null))['catch'](handleError(_0x3eee73,null));};exports[_0xf4a4('0x81')]=function(_0xe51cfe,_0x4e9dfe,_0x1194fb){var _0x8c0ab7={};var _0x4fcd09={};var _0x2febb;var _0x5cb703;return db['Campaign']['findOne']({'where':{'id':_0xe51cfe[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x4e9dfe,null))['then'](function(_0x4a61d2){if(_0x4a61d2){_0x2febb=_0x4a61d2;_0x4fcd09[_0xf4a4('0x33')]=_['keys'](db[_0xf4a4('0x5f')]['rawAttributes']);_0x4fcd09[_0xf4a4('0x30')]=_[_0xf4a4('0x31')](_0xe51cfe['query']);_0x4fcd09[_0xf4a4('0x3b')]=_[_0xf4a4('0x32')](_0x4fcd09['model'],_0x4fcd09[_0xf4a4('0x30')]);_0x8c0ab7[_0xf4a4('0x34')]=_[_0xf4a4('0x32')](_0x4fcd09[_0xf4a4('0x33')],qs[_0xf4a4('0x35')](_0xe51cfe[_0xf4a4('0x30')][_0xf4a4('0x35')]));_0x8c0ab7[_0xf4a4('0x34')]=_0x8c0ab7[_0xf4a4('0x34')][_0xf4a4('0x44')]?_0x8c0ab7[_0xf4a4('0x34')]:_0x4fcd09['model'];_0x8c0ab7[_0xf4a4('0x37')]=qs[_0xf4a4('0x38')](_0xe51cfe['query'][_0xf4a4('0x38')]);_0x8c0ab7[_0xf4a4('0x39')]=qs['filters'](_['pick'](_0xe51cfe[_0xf4a4('0x30')],_0x4fcd09[_0xf4a4('0x3b')]));if(_0xe51cfe['query'][_0xf4a4('0x3c')]){_0x8c0ab7['where']=_['merge'](_0x8c0ab7['where'],{'$or':_[_0xf4a4('0x2d')](_0x8c0ab7[_0xf4a4('0x34')],function(_0x3db656){var _0x31b6b2={};_0x31b6b2[_0x3db656]={'$like':'%'+_0xe51cfe[_0xf4a4('0x30')][_0xf4a4('0x3c')]+'%'};return _0x31b6b2;})});}_0x8c0ab7=_['merge']({},_0x8c0ab7,_0xe51cfe['options']);return _0x2febb['getBlackLists'](_0x8c0ab7);}})[_0xf4a4('0x25')](function(_0x12a08e){if(_0x12a08e){_0x5cb703=_0x12a08e[_0xf4a4('0x44')];if(!_0xe51cfe[_0xf4a4('0x30')]['hasOwnProperty'](_0xf4a4('0x36'))){_0x8c0ab7[_0xf4a4('0x1d')]=qs[_0xf4a4('0x1d')](_0xe51cfe[_0xf4a4('0x30')]['limit']);_0x8c0ab7['offset']=qs[_0xf4a4('0x1a')](_0xe51cfe['query'][_0xf4a4('0x1a')]);}return _0x2febb[_0xf4a4('0x81')](_0x8c0ab7);}})['then'](function(_0x3e138e){if(_0x3e138e){return _0x3e138e?{'count':_0x5cb703,'rows':_0x3e138e}:null;}})[_0xf4a4('0x25')](respondWithResult(_0x4e9dfe,null))[_0xf4a4('0x47')](handleError(_0x4e9dfe,null));};exports['addBlackLists']=function(_0x18c74a,_0x9b9e41,_0x506f46){var _0x3a17c0,_0x1656e6;return db[_0xf4a4('0x2e')]['find']({'where':{'id':_0x18c74a[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x9b9e41,null))[_0xf4a4('0x25')](function(_0x5a0d76){if(_0x5a0d76){_0x1656e6=_0x5a0d76;return _0x5a0d76['addBlackLists'](_0x18c74a[_0xf4a4('0x49')][_0xf4a4('0x61')],_[_0xf4a4('0x4f')](_0x18c74a['body'],[_0xf4a4('0x61'),'id'])||{});}return null;})[_0xf4a4('0x62')](function(_0x42b022){var _0x1ab53c;_0x3a17c0=_0x42b022||[];var _0xc2ccdc=[];if(_0x42b022){for(var _0x12790a=0x0;_0x12790a<_0x42b022[_0xf4a4('0x44')];_0x12790a+=0x1){var _0x5c95b0=_0x42b022[_0x12790a]['get']({'plain':!![]});_0x1ab53c=squel[_0xf4a4('0x65')]()['into'](_0xf4a4('0x82'))['fromQuery'](['phone',_0xf4a4('0x6b'),_0xf4a4('0x6c'),_0xf4a4('0x57'),'createdAt',_0xf4a4('0x51')],squel['select']()[_0xf4a4('0x6e')](_0xf4a4('0x69'),'phone')[_0xf4a4('0x6e')]('id',_0xf4a4('0x6b'))[_0xf4a4('0x6e')](_0x5c95b0[_0xf4a4('0x7b')][_0xf4a4('0x70')](),_0xf4a4('0x6c'))[_0xf4a4('0x6e')](_0x18c74a[_0xf4a4('0x43')]['id'][_0xf4a4('0x70')](),_0xf4a4('0x57'))[_0xf4a4('0x6e')](_0xf4a4('0x6f'),'createdAt')['field'](_0xf4a4('0x6f'),_0xf4a4('0x51'))[_0xf4a4('0x71')]('cm_contacts')[_0xf4a4('0x39')](_0xf4a4('0x72'))['where'](_0xf4a4('0x73'),_0x5c95b0[_0xf4a4('0x7b')][_0xf4a4('0x70')]())[_0xf4a4('0x39')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0xc2ccdc[_0xf4a4('0x7d')](db[_0xf4a4('0x7e')]['query'](_0x1ab53c));}return BPromise[_0xf4a4('0x7f')](_0xc2ccdc);}})[_0xf4a4('0x25')](function(){return _0x3a17c0;})[_0xf4a4('0x25')](respondWithResult(_0x9b9e41,null))['catch'](handleError(_0x9b9e41,null));};exports[_0xf4a4('0x83')]=function(_0x136cba,_0x4913c4,_0x327eac){return db['Campaign'][_0xf4a4('0x46')]({'where':{'id':_0x136cba[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](handleEntityNotFound(_0x4913c4,null))[_0xf4a4('0x25')](function(_0x45a2c9){if(_0x45a2c9){return _0x45a2c9[_0xf4a4('0x83')](_0x136cba[_0xf4a4('0x30')][_0xf4a4('0x61')]);}})[_0xf4a4('0x25')](function(_0x46df67){if(_0x46df67){return db['CmHopperBlack'][_0xf4a4('0x24')]({'where':{'ListId':_0x136cba['query'][_0xf4a4('0x61')],'CampaignId':_0x136cba[_0xf4a4('0x43')]['id']}})[_0xf4a4('0x25')](function(){return _0x46df67;});}})[_0xf4a4('0x25')](respondWithStatusCode(_0x4913c4,null))['catch'](handleError(_0x4913c4,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 4c1699c..d8e4f58 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index adc4603..209da94 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 _0x61a1=['error','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c9f2d,_0xeee094){var _0x4007f0=function(_0xf9dac4){while(--_0xf9dac4){_0x5c9f2d['push'](_0x5c9f2d['shift']());}};_0x4007f0(++_0xeee094);}(_0x61a1,0x127));var _0x161a=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x61a1[_0x810e4d];return _0x13f01c;};'use strict';var _=require(_0x161a('0x0'));var util=require(_0x161a('0x1'));var moment=require(_0x161a('0x2'));var BPromise=require(_0x161a('0x3'));var rs=require(_0x161a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x161a('0x5'))['db'];var utils=require(_0x161a('0x6'));var logger=require('../../config/logger')(_0x161a('0x7'));var config=require(_0x161a('0x8'));var jayson=require(_0x161a('0x9'));var client=jayson[_0x161a('0xa')][_0x161a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b1e8,_0x3b7d68,_0x182e6c){return new BPromise(function(_0x3e07e5,_0x15cde9){return client[_0x161a('0xc')](_0x45b1e8,_0x182e6c)[_0x161a('0xd')](function(_0x405108){logger[_0x161a('0xe')](_0x161a('0xf'),_0x3b7d68,_0x161a('0x10'));logger[_0x161a('0x11')](_0x161a('0x12'),_0x3b7d68,_0x161a('0x10'),JSON[_0x161a('0x13')](_0x405108));if(_0x405108['error']){if(_0x405108['error']['code']===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x3b7d68,_0x405108[_0x161a('0x14')][_0x161a('0x15')]);return _0x15cde9(_0x405108[_0x161a('0x14')][_0x161a('0x15')]);}logger[_0x161a('0x14')](_0x161a('0xf'),_0x3b7d68,_0x405108[_0x161a('0x14')]['message']);return _0x3e07e5(_0x405108['error']['message']);}else{logger[_0x161a('0xe')](_0x161a('0xf'),_0x3b7d68,'request\x20sent');_0x3e07e5(_0x405108[_0x161a('0x16')][_0x161a('0x15')]);}})['catch'](function(_0x31dcc6){logger[_0x161a('0x14')](_0x161a('0xf'),_0x3b7d68,_0x31dcc6);_0x15cde9(_0x31dcc6);});});}exports[_0x161a('0x17')]=function(_0x28c9bf){var _0x12075e=this;return new Promise(function(_0x25a286,_0x1491fa){return db[_0x161a('0x18')][_0x161a('0x19')]({'raw':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1b')]===undefined?!![]:![]:!![],'where':_0x28c9bf['options']?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1c')]||null:null,'attributes':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1d')]||null:null,'limit':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1e')]||null:null,'include':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')]['include']?_[_0x161a('0x1f')](_0x28c9bf['options'][_0x161a('0x20')],function(_0x2e7a46){return{'model':db[_0x2e7a46['model']],'as':_0x2e7a46['as'],'attributes':_0x2e7a46[_0x161a('0x1d')],'include':_0x2e7a46[_0x161a('0x20')]?_[_0x161a('0x1f')](_0x2e7a46[_0x161a('0x20')],function(_0x1541c6){return{'model':db[_0x1541c6[_0x161a('0x21')]],'as':_0x1541c6['as'],'attributes':_0x1541c6[_0x161a('0x1d')],'include':_0x1541c6[_0x161a('0x20')]?_['map'](_0x1541c6[_0x161a('0x20')],function(_0x1b10b0){return{'model':db[_0x1b10b0['model']],'as':_0x1b10b0['as'],'attributes':_0x1b10b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x161a('0xd')](function(_0x3b5779){logger['info'](_0x161a('0x17'),_0x28c9bf);logger['debug']('GetCampaign',_0x28c9bf,JSON[_0x161a('0x13')](_0x3b5779));_0x25a286(_0x3b5779);})[_0x161a('0x22')](function(_0x2c5039){logger[_0x161a('0x14')](_0x161a('0x17'),_0x2c5039[_0x161a('0x15')],_0x28c9bf);_0x1491fa(_0x12075e[_0x161a('0x14')](0x1f4,_0x2c5039['message']));});});};
\ No newline at end of file
+var _0xbf83=['debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','options','where','attributes','limit','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf83,0x11e));var _0x3bf8=function(_0x2ede98,_0x4b504a){_0x2ede98=_0x2ede98-0x0;var _0x8e6529=_0xbf83[_0x2ede98];return _0x8e6529;};'use strict';var _=require(_0x3bf8('0x0'));var util=require('util');var moment=require(_0x3bf8('0x1'));var BPromise=require(_0x3bf8('0x2'));var rs=require(_0x3bf8('0x3'));var fs=require('fs');var Redis=require(_0x3bf8('0x4'));var db=require(_0x3bf8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3bf8('0x6'));var config=require(_0x3bf8('0x7'));var jayson=require(_0x3bf8('0x8'));var client=jayson[_0x3bf8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b0c12,_0x168a20,_0x2df7c9){return new BPromise(function(_0x4adc52,_0x27c23f){return client['request'](_0x5b0c12,_0x2df7c9)[_0x3bf8('0xa')](function(_0x2eca24){logger[_0x3bf8('0xb')](_0x3bf8('0xc'),_0x168a20,_0x3bf8('0xd'));logger[_0x3bf8('0xe')](_0x3bf8('0xf'),_0x168a20,'request\x20sent',JSON[_0x3bf8('0x10')](_0x2eca24));if(_0x2eca24[_0x3bf8('0x11')]){if(_0x2eca24['error'][_0x3bf8('0x12')]===0x1f4){logger[_0x3bf8('0x11')](_0x3bf8('0xc'),_0x168a20,_0x2eca24[_0x3bf8('0x11')][_0x3bf8('0x13')]);return _0x27c23f(_0x2eca24[_0x3bf8('0x11')][_0x3bf8('0x13')]);}logger[_0x3bf8('0x11')](_0x3bf8('0xc'),_0x168a20,_0x2eca24[_0x3bf8('0x11')]['message']);return _0x4adc52(_0x2eca24['error'][_0x3bf8('0x13')]);}else{logger[_0x3bf8('0xb')](_0x3bf8('0xc'),_0x168a20,_0x3bf8('0xd'));_0x4adc52(_0x2eca24['result'][_0x3bf8('0x13')]);}})[_0x3bf8('0x14')](function(_0x1a77fc){logger[_0x3bf8('0x11')](_0x3bf8('0xc'),_0x168a20,_0x1a77fc);_0x27c23f(_0x1a77fc);});});}exports[_0x3bf8('0x15')]=function(_0x857603){var _0x2c942e=this;return new Promise(function(_0x2f80fa,_0x262752){return db[_0x3bf8('0x16')]['findAll']({'raw':_0x857603[_0x3bf8('0x17')]?_0x857603[_0x3bf8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x857603[_0x3bf8('0x17')]?_0x857603['options'][_0x3bf8('0x18')]||null:null,'attributes':_0x857603['options']?_0x857603[_0x3bf8('0x17')][_0x3bf8('0x19')]||null:null,'limit':_0x857603['options']?_0x857603[_0x3bf8('0x17')][_0x3bf8('0x1a')]||null:null,'include':_0x857603[_0x3bf8('0x17')]?_0x857603[_0x3bf8('0x17')]['include']?_[_0x3bf8('0x1b')](_0x857603['options'][_0x3bf8('0x1c')],function(_0x583d62){return{'model':db[_0x583d62['model']],'as':_0x583d62['as'],'attributes':_0x583d62[_0x3bf8('0x19')],'include':_0x583d62[_0x3bf8('0x1c')]?_[_0x3bf8('0x1b')](_0x583d62[_0x3bf8('0x1c')],function(_0x3245e2){return{'model':db[_0x3245e2[_0x3bf8('0x1d')]],'as':_0x3245e2['as'],'attributes':_0x3245e2[_0x3bf8('0x19')],'include':_0x3245e2[_0x3bf8('0x1c')]?_[_0x3bf8('0x1b')](_0x3245e2[_0x3bf8('0x1c')],function(_0x143e8a){return{'model':db[_0x143e8a[_0x3bf8('0x1d')]],'as':_0x143e8a['as'],'attributes':_0x143e8a[_0x3bf8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3bf8('0xa')](function(_0x25442d){logger['info'](_0x3bf8('0x15'),_0x857603);logger[_0x3bf8('0xe')]('GetCampaign',_0x857603,JSON[_0x3bf8('0x10')](_0x25442d));_0x2f80fa(_0x25442d);})[_0x3bf8('0x14')](function(_0x55cccc){logger['error'](_0x3bf8('0x15'),_0x55cccc[_0x3bf8('0x13')],_0x857603);_0x262752(_0x2c942e[_0x3bf8('0x11')](0x1f4,_0x55cccc['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 30f6034..3020a8d 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 _0xc570=['removeLists','removeBlackLists','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy'];(function(_0x42b9dd,_0x1645d6){var _0x54ce8e=function(_0x2819dc){while(--_0x2819dc){_0x42b9dd['push'](_0x42b9dd['shift']());}};_0x54ce8e(++_0x1645d6);}(_0xc570,0x142));var _0x0c57=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xc570[_0x28d18d];return _0x470640;};'use strict';var multer=require('multer');var util=require(_0x0c57('0x0'));var path=require(_0x0c57('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c57('0x2')]();var fs_extra=require(_0x0c57('0x3'));var auth=require(_0x0c57('0x4'));var interaction=require(_0x0c57('0x5'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0c57('0x6')]);router[_0x0c57('0x7')](_0x0c57('0x8'),auth[_0x0c57('0x9')](),controller[_0x0c57('0xa')]);router[_0x0c57('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x0c57('0x7')](_0x0c57('0xb'),auth[_0x0c57('0x9')](),controller['getHopperHistories']);router[_0x0c57('0x7')](_0x0c57('0xc'),auth[_0x0c57('0x9')](),controller[_0x0c57('0xd')]);router[_0x0c57('0x7')](_0x0c57('0xe'),auth[_0x0c57('0x9')](),controller['getHopperBlacks']);router[_0x0c57('0x7')](_0x0c57('0xf'),auth['isAuthenticated'](),controller[_0x0c57('0x10')]);router['get'](_0x0c57('0x11'),auth[_0x0c57('0x9')](),controller['getBlackLists']);router[_0x0c57('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c57('0x12')](_0x0c57('0x13'),auth[_0x0c57('0x9')](),controller[_0x0c57('0x14')]);router[_0x0c57('0x12')](_0x0c57('0xf'),auth[_0x0c57('0x9')](),controller[_0x0c57('0x15')]);router[_0x0c57('0x12')](_0x0c57('0x11'),auth[_0x0c57('0x9')](),controller[_0x0c57('0x16')]);router['put'](_0x0c57('0x8'),auth['isAuthenticated'](),controller[_0x0c57('0x17')]);router[_0x0c57('0x18')](_0x0c57('0x8'),auth['isAuthenticated'](),controller[_0x0c57('0x19')]);router[_0x0c57('0x18')](_0x0c57('0xf'),auth[_0x0c57('0x9')](),controller[_0x0c57('0x1a')]);router[_0x0c57('0x18')](_0x0c57('0x11'),auth[_0x0c57('0x9')](),controller[_0x0c57('0x1b')]);module[_0x0c57('0x1c')]=router;
\ No newline at end of file
+var _0xc2a8=['/:id/blacklists','create','post','addLists','addBlackLists','put','update','delete','destroy','removeLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists'];(function(_0x3a06c0,_0x1b5b3a){var _0x8529cc=function(_0x353f5d){while(--_0x353f5d){_0x3a06c0['push'](_0x3a06c0['shift']());}};_0x8529cc(++_0x1b5b3a);}(_0xc2a8,0x1bc));var _0x8c2a=function(_0x1ff880,_0x325511){_0x1ff880=_0x1ff880-0x0;var _0x56fa82=_0xc2a8[_0x1ff880];return _0x56fa82;};'use strict';var multer=require(_0x8c2a('0x0'));var util=require(_0x8c2a('0x1'));var path=require(_0x8c2a('0x2'));var timeout=require(_0x8c2a('0x3'));var express=require(_0x8c2a('0x4'));var router=express[_0x8c2a('0x5')]();var fs_extra=require(_0x8c2a('0x6'));var auth=require(_0x8c2a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8c2a('0x8'));var controller=require(_0x8c2a('0x9'));router[_0x8c2a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8c2a('0xb'),auth[_0x8c2a('0xc')](),controller['show']);router['get']('/:id/hoppers',auth[_0x8c2a('0xc')](),controller[_0x8c2a('0xd')]);router['get'](_0x8c2a('0xe'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0xf')]);router['get'](_0x8c2a('0x10'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x11')]);router[_0x8c2a('0xa')](_0x8c2a('0x12'),auth[_0x8c2a('0xc')](),controller['getHopperBlacks']);router[_0x8c2a('0xa')](_0x8c2a('0x13'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x14')]);router[_0x8c2a('0xa')](_0x8c2a('0x15'),auth[_0x8c2a('0xc')](),controller['getBlackLists']);router['post']('/',auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x16')]);router[_0x8c2a('0x17')]('/:id/clone',auth[_0x8c2a('0xc')](),controller['clone']);router[_0x8c2a('0x17')](_0x8c2a('0x13'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x18')]);router['post']('/:id/blacklists',auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x19')]);router[_0x8c2a('0x1a')](_0x8c2a('0xb'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x1b')]);router[_0x8c2a('0x1c')](_0x8c2a('0xb'),auth[_0x8c2a('0xc')](),controller[_0x8c2a('0x1d')]);router[_0x8c2a('0x1c')](_0x8c2a('0x13'),auth['isAuthenticated'](),controller[_0x8c2a('0x1e')]);router[_0x8c2a('0x1c')](_0x8c2a('0x15'),auth[_0x8c2a('0xc')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 61f1726..28c201a 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 _0x9852=['getDataValue','key','sequelize','exports','TEXT','STRING'];(function(_0x2b53fe,_0x2df467){var _0x1a94c4=function(_0x356b75){while(--_0x356b75){_0x2b53fe['push'](_0x2b53fe['shift']());}};_0x1a94c4(++_0x2df467);}(_0x9852,0x98));var _0x2985=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x9852[_0x5c14f6];return _0x4949b3;};'use strict';var Sequelize=require(_0x2985('0x0'));module[_0x2985('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2985('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2985('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2985('0x4')](_0x2985('0x5'));}}};
\ No newline at end of file
+var _0xbf11=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xbf11,0xe9));var _0x1bf1=function(_0x53d147,_0x259f9e){_0x53d147=_0x53d147-0x0;var _0x3bc064=_0xbf11[_0x53d147];return _0x3bc064;};'use strict';var Sequelize=require(_0x1bf1('0x0'));module[_0x1bf1('0x1')]={'key':{'type':Sequelize[_0x1bf1('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1bf1('0x2')]},'name':{'type':Sequelize[_0x1bf1('0x3')],'get':function(){return this[_0x1bf1('0x4')](_0x1bf1('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b6e6b7a..30af309 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 _0x1882=['sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','options','includeAll','include','CannedAnswer','catch','show','params','keys','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x318c08,_0x5972e1){var _0x3509a8=function(_0x41f7df){while(--_0x41f7df){_0x318c08['push'](_0x318c08['shift']());}};_0x3509a8(++_0x5972e1);}(_0x1882,0x92));var _0x2188=function(_0x18184d,_0x53b17e){_0x18184d=_0x18184d-0x0;var _0x461e19=_0x1882[_0x18184d];return _0x461e19;};'use strict';var emlformat=require(_0x2188('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2188('0x1'));var jsonpatch=require(_0x2188('0x2'));var rp=require(_0x2188('0x3'));var moment=require(_0x2188('0x4'));var BPromise=require(_0x2188('0x5'));var Mustache=require('mustache');var util=require(_0x2188('0x6'));var path=require(_0x2188('0x7'));var sox=require(_0x2188('0x8'));var csv=require(_0x2188('0x9'));var ejs=require(_0x2188('0xa'));var fs=require('fs');var fs_extra=require(_0x2188('0xb'));var _=require(_0x2188('0xc'));var squel=require(_0x2188('0xd'));var crypto=require(_0x2188('0xe'));var jsforce=require(_0x2188('0xf'));var deskjs=require(_0x2188('0x10'));var toCsv=require(_0x2188('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2188('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2188('0x12'));var as=require(_0x2188('0x13'));var hardwareService=require(_0x2188('0x14'));var logger=require(_0x2188('0x15'))(_0x2188('0x16'));var utils=require(_0x2188('0x17'));var config=require(_0x2188('0x18'));var licenseUtil=require(_0x2188('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x379136,_0x44d7ff){_0x44d7ff=_0x44d7ff||0xcc;return function(_0x3abb3d){if(_0x3abb3d){return _0x379136[_0x2188('0x1a')](_0x44d7ff);}return _0x379136[_0x2188('0x1b')](_0x44d7ff)[_0x2188('0x1c')]();};}function respondWithResult(_0x8b95fd,_0x4307a6){_0x4307a6=_0x4307a6||0xc8;return function(_0x500498){if(_0x500498){return _0x8b95fd[_0x2188('0x1b')](_0x4307a6)['json'](_0x500498);}};}function respondWithFilteredResult(_0xf502c4,_0x56c67e){return function(_0x2c058e){if(_0x2c058e){var _0x29c2c1=typeof _0x56c67e['offset']===_0x2188('0x1d')&&typeof _0x56c67e['limit']===_0x2188('0x1d');var _0x47ee43=_0x2c058e[_0x2188('0x1e')];var _0x70b93=_0x29c2c1?0x0:_0x56c67e[_0x2188('0x1f')];var _0x818b96=_0x29c2c1?_0x2c058e[_0x2188('0x1e')]:_0x56c67e[_0x2188('0x1f')]+_0x56c67e[_0x2188('0x20')];var _0x2d1e10;if(_0x818b96>=_0x47ee43){_0x818b96=_0x47ee43;_0x2d1e10=0xc8;}else{_0x2d1e10=0xce;}_0xf502c4['status'](_0x2d1e10);return _0xf502c4[_0x2188('0x21')](_0x2188('0x22'),_0x70b93+'-'+_0x818b96+'/'+_0x47ee43)['json'](_0x2c058e);}return null;};}function patchUpdates(_0x28f94a){return function(_0x3d1b50){try{jsonpatch[_0x2188('0x23')](_0x3d1b50,_0x28f94a,!![]);}catch(_0x556d43){return BPromise['reject'](_0x556d43);}return _0x3d1b50['save']();};}function saveUpdates(_0x25554d,_0x2d871b){return function(_0x535762){if(_0x535762){return _0x535762[_0x2188('0x24')](_0x25554d)[_0x2188('0x25')](function(_0x5a7396){return _0x5a7396;});}return null;};}function removeEntity(_0x5d8722,_0x426e1b){return function(_0x346ae8){if(_0x346ae8){return _0x346ae8[_0x2188('0x26')]()['then'](function(){var _0x346e1d=_0x346ae8[_0x2188('0x27')]({'plain':!![]});var _0x983ac8=_0x2188('0x28');return db[_0x2188('0x29')][_0x2188('0x26')]({'where':{'type':_0x983ac8,'resourceId':_0x346e1d['id']}})[_0x2188('0x25')](function(){return _0x346ae8;});})[_0x2188('0x25')](function(){_0x5d8722[_0x2188('0x1b')](0xcc)[_0x2188('0x1c')]();});}};}function handleEntityNotFound(_0x24a964,_0x52f0e2){return function(_0x2021ca){if(!_0x2021ca){_0x24a964[_0x2188('0x1a')](0x194);}return _0x2021ca;};}function handleError(_0xe6a992,_0x3ab6b2){_0x3ab6b2=_0x3ab6b2||0x1f4;return function(_0x70881){logger['error'](_0x70881[_0x2188('0x2a')]);if(_0x70881[_0x2188('0x2b')]){delete _0x70881['name'];}_0xe6a992[_0x2188('0x1b')](_0x3ab6b2)[_0x2188('0x2c')](_0x70881);};}exports[_0x2188('0x2d')]=function(_0x2b4292,_0x13652c){var _0x526b05={},_0x2d53eb={},_0x468668={'count':0x0,'rows':[]};var _0x320714=_[_0x2188('0x2e')](db['CannedAnswer'][_0x2188('0x2f')],function(_0x584ada){return{'name':_0x584ada[_0x2188('0x30')],'type':_0x584ada['type'][_0x2188('0x31')]};});_0x2d53eb[_0x2188('0x32')]=_[_0x2188('0x2e')](_0x320714,'name');_0x2d53eb[_0x2188('0x33')]=_['keys'](_0x2b4292['query']);_0x2d53eb['filters']=_[_0x2188('0x34')](_0x2d53eb[_0x2188('0x32')],_0x2d53eb[_0x2188('0x33')]);_0x526b05[_0x2188('0x35')]=_[_0x2188('0x34')](_0x2d53eb['model'],qs[_0x2188('0x36')](_0x2b4292[_0x2188('0x33')][_0x2188('0x36')]));_0x526b05[_0x2188('0x35')]=_0x526b05['attributes']['length']?_0x526b05[_0x2188('0x35')]:_0x2d53eb['model'];if(!_0x2b4292['query'][_0x2188('0x37')]('nolimit')){_0x526b05[_0x2188('0x20')]=qs[_0x2188('0x20')](_0x2b4292['query'][_0x2188('0x20')]);_0x526b05[_0x2188('0x1f')]=qs['offset'](_0x2b4292[_0x2188('0x33')][_0x2188('0x1f')]);}_0x526b05['order']=qs[_0x2188('0x38')](_0x2b4292[_0x2188('0x33')][_0x2188('0x38')]);_0x526b05[_0x2188('0x39')]=qs[_0x2188('0x3a')](_[_0x2188('0x3b')](_0x2b4292[_0x2188('0x33')],_0x2d53eb[_0x2188('0x3a')]),_0x320714);if(_0x2b4292[_0x2188('0x33')][_0x2188('0x3c')]){_0x526b05[_0x2188('0x39')]=_['merge'](_0x526b05[_0x2188('0x39')],{'$or':[{'key':{'$like':'%'+_0x2b4292[_0x2188('0x33')][_0x2188('0x3c')]+'%'}},{'value':{'$like':'%'+_0x2b4292[_0x2188('0x33')][_0x2188('0x3c')]+'%'}}]});}_0x526b05=_['merge']({},_0x526b05,_0x2b4292[_0x2188('0x3d')]);var _0x1d4ad8={'where':_0x526b05[_0x2188('0x39')]};return db['CannedAnswer']['count'](_0x1d4ad8)['then'](function(_0x114dde){_0x468668['count']=_0x114dde;if(_0x2b4292[_0x2188('0x33')][_0x2188('0x3e')]){_0x526b05[_0x2188('0x3f')]=[{'all':!![]}];}return db[_0x2188('0x40')]['findAll'](_0x526b05);})[_0x2188('0x25')](function(_0x1141f9){_0x468668['rows']=_0x1141f9;return _0x468668;})['then'](respondWithFilteredResult(_0x13652c,_0x526b05))[_0x2188('0x41')](handleError(_0x13652c,null));};exports[_0x2188('0x42')]=function(_0x1814b6,_0xf7d67e){var _0x1abb4c={'raw':!![],'where':{'id':_0x1814b6[_0x2188('0x43')]['id']}},_0x2e49d0={};_0x2e49d0[_0x2188('0x32')]=_[_0x2188('0x44')](db[_0x2188('0x40')][_0x2188('0x2f')]);_0x2e49d0['query']=_[_0x2188('0x44')](_0x1814b6[_0x2188('0x33')]);_0x2e49d0[_0x2188('0x3a')]=_[_0x2188('0x34')](_0x2e49d0[_0x2188('0x32')],_0x2e49d0['query']);_0x1abb4c[_0x2188('0x35')]=_[_0x2188('0x34')](_0x2e49d0[_0x2188('0x32')],qs['fields'](_0x1814b6[_0x2188('0x33')]['fields']));_0x1abb4c[_0x2188('0x35')]=_0x1abb4c[_0x2188('0x35')]['length']?_0x1abb4c[_0x2188('0x35')]:_0x2e49d0[_0x2188('0x32')];if(_0x1814b6['query'][_0x2188('0x3e')]){_0x1abb4c[_0x2188('0x3f')]=[{'all':!![]}];}_0x1abb4c=_['merge']({},_0x1abb4c,_0x1814b6[_0x2188('0x3d')]);return db[_0x2188('0x40')]['find'](_0x1abb4c)[_0x2188('0x25')](handleEntityNotFound(_0xf7d67e,null))[_0x2188('0x25')](respondWithResult(_0xf7d67e,null))[_0x2188('0x41')](handleError(_0xf7d67e,null));};exports[_0x2188('0x24')]=function(_0xef1a41,_0x2f30e9){if(_0xef1a41[_0x2188('0x45')]['id']){delete _0xef1a41['body']['id'];}return db[_0x2188('0x40')]['find']({'where':{'id':_0xef1a41[_0x2188('0x43')]['id']}})[_0x2188('0x25')](handleEntityNotFound(_0x2f30e9,null))['then'](saveUpdates(_0xef1a41[_0x2188('0x45')],null))[_0x2188('0x25')](respondWithResult(_0x2f30e9,null))[_0x2188('0x41')](handleError(_0x2f30e9,null));};exports[_0x2188('0x26')]=function(_0x29b162,_0x246916){return db[_0x2188('0x40')]['find']({'where':{'id':_0x29b162[_0x2188('0x43')]['id']}})[_0x2188('0x25')](handleEntityNotFound(_0x246916,null))['then'](removeEntity(_0x246916,null))[_0x2188('0x41')](handleError(_0x246916,null));};exports[_0x2188('0x46')]=function(_0x3aef45,_0x45d4cb){var _0x763dce={'key':_0x3aef45[_0x2188('0x45')][_0x2188('0x31')]};if(_0x3aef45[_0x2188('0x45')][_0x2188('0x47')]){_0x763dce[_0x2188('0x47')]=_0x3aef45[_0x2188('0x45')][_0x2188('0x47')];}else if(_0x3aef45['body'][_0x2188('0x48')]){_0x763dce[_0x2188('0x48')]=_0x3aef45[_0x2188('0x45')][_0x2188('0x48')];}else if(_0x3aef45[_0x2188('0x45')][_0x2188('0x49')]){_0x763dce[_0x2188('0x49')]=_0x3aef45[_0x2188('0x45')][_0x2188('0x49')];}else if(_0x3aef45['body'][_0x2188('0x4a')]){_0x763dce[_0x2188('0x4a')]=_0x3aef45[_0x2188('0x45')][_0x2188('0x4a')];}return db[_0x2188('0x40')][_0x2188('0x4b')]({'where':_0x763dce})[_0x2188('0x25')](function(_0x132840){if(_0x132840){throw new db[(_0x2188('0x4c'))][(_0x2188('0x4d'))](_0x2188('0x4e'));}return db[_0x2188('0x40')][_0x2188('0x46')](_0x3aef45[_0x2188('0x45')]);})['then'](function(_0x520235){var _0x15447e=_0x3aef45[_0x2188('0x4f')]['get']({'plain':!![]});if(!_0x15447e)throw new Error(_0x2188('0x50'));if(_0x15447e[_0x2188('0x51')]===_0x2188('0x4f')){var _0x45e49f=_0x520235[_0x2188('0x27')]({'plain':!![]});return db[_0x2188('0x52')][_0x2188('0x4b')]({'where':{'name':_0x2188('0x28'),'userProfileId':_0x15447e['userProfileId']},'raw':!![]})['then'](function(_0x4e4f15){if(_0x4e4f15&&_0x4e4f15[_0x2188('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x45e49f[_0x2188('0x2b')],'resourceId':_0x45e49f['id'],'type':_0x4e4f15[_0x2188('0x2b')],'sectionId':_0x4e4f15['id']},{})['then'](function(){return _0x520235;});}else{return _0x520235;}})[_0x2188('0x41')](function(_0x57edb3){logger[_0x2188('0x54')](_0x2188('0x55'),_0x57edb3);throw _0x57edb3;});}return _0x520235;})[_0x2188('0x25')](respondWithResult(_0x45d4cb,0xc9))[_0x2188('0x41')](handleError(_0x45d4cb,null));};
\ No newline at end of file
+var _0xc8e9=['index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','show','params','options','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send'];(function(_0x3f946b,_0xbd1ebe){var _0x2a2ea1=function(_0x3c3397){while(--_0x3c3397){_0x3f946b['push'](_0x3f946b['shift']());}};_0x2a2ea1(++_0xbd1ebe);}(_0xc8e9,0x83));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9c8e('0x0'));var rimraf=require(_0x9c8e('0x1'));var zipdir=require(_0x9c8e('0x2'));var jsonpatch=require(_0x9c8e('0x3'));var rp=require(_0x9c8e('0x4'));var moment=require(_0x9c8e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c8e('0x6'));var util=require(_0x9c8e('0x7'));var path=require(_0x9c8e('0x8'));var sox=require(_0x9c8e('0x9'));var csv=require(_0x9c8e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c8e('0xb'));var squel=require(_0x9c8e('0xc'));var crypto=require(_0x9c8e('0xd'));var jsforce=require(_0x9c8e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c8e('0xa'));var querystring=require(_0x9c8e('0xf'));var Papa=require(_0x9c8e('0x10'));var Redis=require('ioredis');var authService=require(_0x9c8e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9c8e('0x12'));var hardwareService=require(_0x9c8e('0x13'));var logger=require(_0x9c8e('0x14'))(_0x9c8e('0x15'));var utils=require(_0x9c8e('0x16'));var config=require(_0x9c8e('0x17'));var licenseUtil=require(_0x9c8e('0x18'));var db=require(_0x9c8e('0x19'))['db'];function respondWithStatusCode(_0x4b3842,_0x5eae01){_0x5eae01=_0x5eae01||0xcc;return function(_0x85d777){if(_0x85d777){return _0x4b3842[_0x9c8e('0x1a')](_0x5eae01);}return _0x4b3842['status'](_0x5eae01)[_0x9c8e('0x1b')]();};}function respondWithResult(_0x4a2e81,_0x2aadd4){_0x2aadd4=_0x2aadd4||0xc8;return function(_0x47400c){if(_0x47400c){return _0x4a2e81['status'](_0x2aadd4)[_0x9c8e('0x1c')](_0x47400c);}};}function respondWithFilteredResult(_0x44b4f3,_0x5e8630){return function(_0x250a0a){if(_0x250a0a){var _0x44feaf=typeof _0x5e8630[_0x9c8e('0x1d')]===_0x9c8e('0x1e')&&typeof _0x5e8630['limit']===_0x9c8e('0x1e');var _0x533708=_0x250a0a['count'];var _0x2aeaaa=_0x44feaf?0x0:_0x5e8630[_0x9c8e('0x1d')];var _0x535990=_0x44feaf?_0x250a0a[_0x9c8e('0x1f')]:_0x5e8630[_0x9c8e('0x1d')]+_0x5e8630[_0x9c8e('0x20')];var _0x5a415f;if(_0x535990>=_0x533708){_0x535990=_0x533708;_0x5a415f=0xc8;}else{_0x5a415f=0xce;}_0x44b4f3[_0x9c8e('0x21')](_0x5a415f);return _0x44b4f3['set'](_0x9c8e('0x22'),_0x2aeaaa+'-'+_0x535990+'/'+_0x533708)[_0x9c8e('0x1c')](_0x250a0a);}return null;};}function patchUpdates(_0x313df){return function(_0x1d6a06){try{jsonpatch[_0x9c8e('0x23')](_0x1d6a06,_0x313df,!![]);}catch(_0x49131c){return BPromise['reject'](_0x49131c);}return _0x1d6a06['save']();};}function saveUpdates(_0x39c112,_0x4cb075){return function(_0x114df4){if(_0x114df4){return _0x114df4[_0x9c8e('0x24')](_0x39c112)[_0x9c8e('0x25')](function(_0x5fa2a6){return _0x5fa2a6;});}return null;};}function removeEntity(_0x15bf20,_0x37774d){return function(_0x54c9f4){if(_0x54c9f4){return _0x54c9f4[_0x9c8e('0x26')]()['then'](function(){var _0x1c9b90=_0x54c9f4[_0x9c8e('0x27')]({'plain':!![]});var _0x4d5473=_0x9c8e('0x28');return db[_0x9c8e('0x29')][_0x9c8e('0x26')]({'where':{'type':_0x4d5473,'resourceId':_0x1c9b90['id']}})[_0x9c8e('0x25')](function(){return _0x54c9f4;});})[_0x9c8e('0x25')](function(){_0x15bf20[_0x9c8e('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf67946,_0x9a67b7){return function(_0x3fe862){if(!_0x3fe862){_0xf67946['sendStatus'](0x194);}return _0x3fe862;};}function handleError(_0x34e2b6,_0x2293aa){_0x2293aa=_0x2293aa||0x1f4;return function(_0x585910){logger['error'](_0x585910[_0x9c8e('0x2a')]);if(_0x585910[_0x9c8e('0x2b')]){delete _0x585910[_0x9c8e('0x2b')];}_0x34e2b6[_0x9c8e('0x21')](_0x2293aa)[_0x9c8e('0x2c')](_0x585910);};}exports[_0x9c8e('0x2d')]=function(_0x3c5150,_0x3d553a){var _0x357f34={},_0x4a217c={},_0xda4bd8={'count':0x0,'rows':[]};var _0x6c6c02=_[_0x9c8e('0x2e')](db[_0x9c8e('0x2f')][_0x9c8e('0x30')],function(_0x4be6c4){return{'name':_0x4be6c4[_0x9c8e('0x31')],'type':_0x4be6c4[_0x9c8e('0x32')][_0x9c8e('0x33')]};});_0x4a217c[_0x9c8e('0x34')]=_[_0x9c8e('0x2e')](_0x6c6c02,_0x9c8e('0x2b'));_0x4a217c[_0x9c8e('0x35')]=_[_0x9c8e('0x36')](_0x3c5150[_0x9c8e('0x35')]);_0x4a217c[_0x9c8e('0x37')]=_['intersection'](_0x4a217c['model'],_0x4a217c[_0x9c8e('0x35')]);_0x357f34['attributes']=_[_0x9c8e('0x38')](_0x4a217c[_0x9c8e('0x34')],qs[_0x9c8e('0x39')](_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x39')]));_0x357f34[_0x9c8e('0x3a')]=_0x357f34[_0x9c8e('0x3a')][_0x9c8e('0x3b')]?_0x357f34['attributes']:_0x4a217c[_0x9c8e('0x34')];if(!_0x3c5150['query'][_0x9c8e('0x3c')](_0x9c8e('0x3d'))){_0x357f34[_0x9c8e('0x20')]=qs[_0x9c8e('0x20')](_0x3c5150['query'][_0x9c8e('0x20')]);_0x357f34[_0x9c8e('0x1d')]=qs[_0x9c8e('0x1d')](_0x3c5150[_0x9c8e('0x35')]['offset']);}_0x357f34[_0x9c8e('0x3e')]=qs[_0x9c8e('0x3f')](_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x3f')]);_0x357f34['where']=qs[_0x9c8e('0x37')](_[_0x9c8e('0x40')](_0x3c5150[_0x9c8e('0x35')],_0x4a217c[_0x9c8e('0x37')]),_0x6c6c02);if(_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x41')]){_0x357f34[_0x9c8e('0x42')]=_['merge'](_0x357f34[_0x9c8e('0x42')],{'$or':[{'key':{'$like':'%'+_0x3c5150['query'][_0x9c8e('0x41')]+'%'}},{'value':{'$like':'%'+_0x3c5150['query']['filter']+'%'}}]});}_0x357f34=_[_0x9c8e('0x43')]({},_0x357f34,_0x3c5150['options']);var _0xf03a24={'where':_0x357f34[_0x9c8e('0x42')]};return db[_0x9c8e('0x2f')][_0x9c8e('0x1f')](_0xf03a24)[_0x9c8e('0x25')](function(_0x46cedf){_0xda4bd8['count']=_0x46cedf;if(_0x3c5150[_0x9c8e('0x35')][_0x9c8e('0x44')]){_0x357f34[_0x9c8e('0x45')]=[{'all':!![]}];}return db[_0x9c8e('0x2f')]['findAll'](_0x357f34);})['then'](function(_0x16c886){_0xda4bd8[_0x9c8e('0x46')]=_0x16c886;return _0xda4bd8;})[_0x9c8e('0x25')](respondWithFilteredResult(_0x3d553a,_0x357f34))['catch'](handleError(_0x3d553a,null));};exports[_0x9c8e('0x47')]=function(_0x496eeb,_0x1f7988){var _0x264982={'raw':!![],'where':{'id':_0x496eeb[_0x9c8e('0x48')]['id']}},_0x5a8688={};_0x5a8688[_0x9c8e('0x34')]=_[_0x9c8e('0x36')](db[_0x9c8e('0x2f')][_0x9c8e('0x30')]);_0x5a8688[_0x9c8e('0x35')]=_[_0x9c8e('0x36')](_0x496eeb[_0x9c8e('0x35')]);_0x5a8688[_0x9c8e('0x37')]=_[_0x9c8e('0x38')](_0x5a8688[_0x9c8e('0x34')],_0x5a8688[_0x9c8e('0x35')]);_0x264982[_0x9c8e('0x3a')]=_[_0x9c8e('0x38')](_0x5a8688[_0x9c8e('0x34')],qs[_0x9c8e('0x39')](_0x496eeb['query'][_0x9c8e('0x39')]));_0x264982['attributes']=_0x264982['attributes'][_0x9c8e('0x3b')]?_0x264982[_0x9c8e('0x3a')]:_0x5a8688[_0x9c8e('0x34')];if(_0x496eeb[_0x9c8e('0x35')][_0x9c8e('0x44')]){_0x264982[_0x9c8e('0x45')]=[{'all':!![]}];}_0x264982=_[_0x9c8e('0x43')]({},_0x264982,_0x496eeb[_0x9c8e('0x49')]);return db['CannedAnswer'][_0x9c8e('0x4a')](_0x264982)[_0x9c8e('0x25')](handleEntityNotFound(_0x1f7988,null))['then'](respondWithResult(_0x1f7988,null))['catch'](handleError(_0x1f7988,null));};exports[_0x9c8e('0x24')]=function(_0x41f917,_0x294a98){if(_0x41f917['body']['id']){delete _0x41f917[_0x9c8e('0x4b')]['id'];}return db['CannedAnswer'][_0x9c8e('0x4a')]({'where':{'id':_0x41f917[_0x9c8e('0x48')]['id']}})[_0x9c8e('0x25')](handleEntityNotFound(_0x294a98,null))[_0x9c8e('0x25')](saveUpdates(_0x41f917[_0x9c8e('0x4b')],null))[_0x9c8e('0x25')](respondWithResult(_0x294a98,null))[_0x9c8e('0x4c')](handleError(_0x294a98,null));};exports[_0x9c8e('0x26')]=function(_0x54eca1,_0x59af42){return db[_0x9c8e('0x2f')][_0x9c8e('0x4a')]({'where':{'id':_0x54eca1[_0x9c8e('0x48')]['id']}})['then'](handleEntityNotFound(_0x59af42,null))[_0x9c8e('0x25')](removeEntity(_0x59af42,null))[_0x9c8e('0x4c')](handleError(_0x59af42,null));};exports['create']=function(_0x224e31,_0x84a3c9){var _0x4bc8a0={'key':_0x224e31[_0x9c8e('0x4b')]['key']};if(_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x4d')]){_0x4bc8a0['MailAccountId']=_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x4d')];}else if(_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x4e')]){_0x4bc8a0[_0x9c8e('0x4e')]=_0x224e31['body'][_0x9c8e('0x4e')];}else if(_0x224e31['body']['OpenchannelAccountId']){_0x4bc8a0[_0x9c8e('0x4f')]=_0x224e31['body'][_0x9c8e('0x4f')];}else if(_0x224e31[_0x9c8e('0x4b')][_0x9c8e('0x50')]){_0x4bc8a0[_0x9c8e('0x50')]=_0x224e31['body'][_0x9c8e('0x50')];}return db['CannedAnswer'][_0x9c8e('0x4a')]({'where':_0x4bc8a0})['then'](function(_0x2e7d1d){if(_0x2e7d1d){throw new db['Sequelize'][(_0x9c8e('0x51'))](_0x9c8e('0x52'));}return db[_0x9c8e('0x2f')]['create'](_0x224e31[_0x9c8e('0x4b')]);})[_0x9c8e('0x25')](function(_0x5ce237){var _0x3b7e59=_0x224e31[_0x9c8e('0x53')][_0x9c8e('0x27')]({'plain':!![]});if(!_0x3b7e59)throw new Error(_0x9c8e('0x54'));if(_0x3b7e59[_0x9c8e('0x55')]===_0x9c8e('0x53')){var _0x387b21=_0x5ce237[_0x9c8e('0x27')]({'plain':!![]});return db[_0x9c8e('0x56')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x3b7e59['userProfileId']},'raw':!![]})[_0x9c8e('0x25')](function(_0x3e6fe5){if(_0x3e6fe5&&_0x3e6fe5['autoAssociation']===0x0){return db[_0x9c8e('0x29')]['create']({'name':_0x387b21['name'],'resourceId':_0x387b21['id'],'type':_0x3e6fe5[_0x9c8e('0x2b')],'sectionId':_0x3e6fe5['id']},{})[_0x9c8e('0x25')](function(){return _0x5ce237;});}else{return _0x5ce237;}})[_0x9c8e('0x4c')](function(_0x4f121f){logger['error'](_0x9c8e('0x57'),_0x4f121f);throw _0x4f121f;});}return _0x5ce237;})[_0x9c8e('0x25')](respondWithResult(_0x84a3c9,0xc9))[_0x9c8e('0x4c')](handleError(_0x84a3c9,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 73be085..9413ad2 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 _0xc98d=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x3ea61c,_0x42150f){var _0x5a9497=function(_0x454713){while(--_0x454713){_0x3ea61c['push'](_0x3ea61c['shift']());}};_0x5a9497(++_0x42150f);}(_0xc98d,0x82));var _0xdc98=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xc98d[_0x3207aa];return _0x51758f;};'use strict';var _=require(_0xdc98('0x0'));var util=require(_0xdc98('0x1'));var logger=require('../../config/logger')(_0xdc98('0x2'));var moment=require(_0xdc98('0x3'));var BPromise=require(_0xdc98('0x4'));var rp=require(_0xdc98('0x5'));var fs=require('fs');var path=require(_0xdc98('0x6'));var rimraf=require('rimraf');var config=require(_0xdc98('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0xdc98('0x8')]=function(_0x4ab428,_0x119359){return _0x4ab428[_0xdc98('0x9')](_0xdc98('0xa'),attributes,{'tableName':_0xdc98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc98('0xc'),'collate':_0xdc98('0xd')});};
\ No newline at end of file
+var _0x0028=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0028,0x15b));var _0x8002=function(_0x3a0633,_0x120c59){_0x3a0633=_0x3a0633-0x0;var _0x58341e=_0x0028[_0x3a0633];return _0x58341e;};'use strict';var _=require('lodash');var util=require(_0x8002('0x0'));var logger=require('../../config/logger')(_0x8002('0x1'));var moment=require(_0x8002('0x2'));var BPromise=require(_0x8002('0x3'));var rp=require(_0x8002('0x4'));var fs=require('fs');var path=require(_0x8002('0x5'));var rimraf=require(_0x8002('0x6'));var config=require(_0x8002('0x7'));var attributes=require(_0x8002('0x8'));module[_0x8002('0x9')]=function(_0x57d062,_0x42df7f){return _0x57d062[_0x8002('0xa')](_0x8002('0xb'),attributes,{'tableName':_0x8002('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8002('0xd'),'collate':_0x8002('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 4511c4e..f3347d7 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(_0x148190,_0x3bd53a){var _0x22fae9=function(_0x51df25){while(--_0x51df25){_0x148190['push'](_0x148190['shift']());}};_0x22fae9(++_0x3bd53a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x2766fc,_0x5b3b21){var _0x3708d1=function(_0x7ae279){while(--_0x7ae279){_0x2766fc['push'](_0x2766fc['shift']());}};_0x3708d1(++_0x5b3b21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 281e841..303dda9 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 _0xd950=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','/:id'];(function(_0x433271,_0x5ecd19){var _0x5ce799=function(_0x41af75){while(--_0x41af75){_0x433271['push'](_0x433271['shift']());}};_0x5ce799(++_0x5ecd19);}(_0xd950,0xaf));var _0x0d95=function(_0x26cc6b,_0x817a09){_0x26cc6b=_0x26cc6b-0x0;var _0x313cdd=_0xd950[_0x26cc6b];return _0x313cdd;};'use strict';var multer=require(_0x0d95('0x0'));var util=require(_0x0d95('0x1'));var path=require(_0x0d95('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d95('0x3'));var router=express[_0x0d95('0x4')]();var fs_extra=require(_0x0d95('0x5'));var auth=require(_0x0d95('0x6'));var interaction=require(_0x0d95('0x7'));var config=require(_0x0d95('0x8'));var controller=require(_0x0d95('0x9'));router[_0x0d95('0xa')]('/',auth[_0x0d95('0xb')](),controller[_0x0d95('0xc')]);router[_0x0d95('0xa')]('/:id',auth[_0x0d95('0xb')](),controller[_0x0d95('0xd')]);router['post']('/',auth[_0x0d95('0xb')](),controller['create']);router['put'](_0x0d95('0xe'),auth[_0x0d95('0xb')](),controller[_0x0d95('0xf')]);router[_0x0d95('0x10')]('/:id',auth[_0x0d95('0xb')](),controller[_0x0d95('0x11')]);module[_0x0d95('0x12')]=router;
\ No newline at end of file
+var _0x4166=['fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util','path','express'];(function(_0x25a8ac,_0x485530){var _0x49dcb7=function(_0x2d8032){while(--_0x2d8032){_0x25a8ac['push'](_0x25a8ac['shift']());}};_0x49dcb7(++_0x485530);}(_0x4166,0xa6));var _0x6416=function(_0x752ec7,_0x41675b){_0x752ec7=_0x752ec7-0x0;var _0x30e825=_0x4166[_0x752ec7];return _0x30e825;};'use strict';var multer=require(_0x6416('0x0'));var util=require(_0x6416('0x1'));var path=require(_0x6416('0x2'));var timeout=require('connect-timeout');var express=require(_0x6416('0x3'));var router=express['Router']();var fs_extra=require(_0x6416('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6416('0x5'));var config=require(_0x6416('0x6'));var controller=require(_0x6416('0x7'));router[_0x6416('0x8')]('/',auth[_0x6416('0x9')](),controller[_0x6416('0xa')]);router[_0x6416('0x8')](_0x6416('0xb'),auth[_0x6416('0x9')](),controller[_0x6416('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6416('0xd')]);router['put']('/:id',auth[_0x6416('0x9')](),controller[_0x6416('0xe')]);router[_0x6416('0xf')]('/:id',auth[_0x6416('0x9')](),controller[_0x6416('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 0d45437..06ac14e 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 _0x9de3=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9de3,0xea));var _0x39de=function(_0x315813,_0x533869){_0x315813=_0x315813-0x0;var _0x38c9da=_0x9de3[_0x315813];return _0x38c9da;};'use strict';var Sequelize=require(_0x39de('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x39de('0x1')],'allowNull':![],'defaultValue':_0x39de('0x2')},'clid':{'type':Sequelize[_0x39de('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x39de('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x39de('0x3')]},'dstchannel':{'type':Sequelize[_0x39de('0x3')]},'lastapp':{'type':Sequelize[_0x39de('0x3')]},'lastdata':{'type':Sequelize[_0x39de('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x39de('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x39de('0x3')]},'amaflags':{'type':Sequelize[_0x39de('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x39de('0x3')]},'userfield':{'type':Sequelize[_0x39de('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x39de('0x3')]},'type':{'type':Sequelize[_0x39de('0x3')]},'tag':{'type':Sequelize[_0x39de('0x3')]}};
\ No newline at end of file
+var _0xd820=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x2a6571,_0xf1567c){var _0xdf7731=function(_0x43a5c4){while(--_0x43a5c4){_0x2a6571['push'](_0x2a6571['shift']());}};_0xdf7731(++_0xf1567c);}(_0xd820,0x16f));var _0x0d82=function(_0x130536,_0x543ea0){_0x130536=_0x130536-0x0;var _0x31b0cb=_0xd820[_0x130536];return _0x31b0cb;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0d82('0x2')},'clid':{'type':Sequelize[_0x0d82('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0d82('0x3')]},'channel':{'type':Sequelize[_0x0d82('0x3')]},'dstchannel':{'type':Sequelize[_0x0d82('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d82('0x3')]},'amaflags':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0d82('0x3')]},'uniqueid':{'type':Sequelize[_0x0d82('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0d82('0x3')]},'type':{'type':Sequelize[_0x0d82('0x3')]},'tag':{'type':Sequelize[_0x0d82('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 822e84a..a3beb9a 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 _0x0e85=['json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x300fc2,_0x37b5d8){var _0x5750d8=function(_0x3c7e4b){while(--_0x3c7e4b){_0x300fc2['push'](_0x300fc2['shift']());}};_0x5750d8(++_0x37b5d8);}(_0x0e85,0x7c));var _0x50e8=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x0e85[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['map'](_0x126c99,'name');_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x30fedf[_0x50e8('0x2e')]);_0x4f0b88['filters']=_['intersection'](_0x4f0b88[_0x50e8('0x2d')],_0x4f0b88[_0x50e8('0x2e')]);_0x42bbef['attributes']=_[_0x50e8('0x30')](_0x4f0b88[_0x50e8('0x2d')],qs[_0x50e8('0x31')](_0x30fedf[_0x50e8('0x2e')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef['attributes'][_0x50e8('0x33')]?_0x42bbef[_0x50e8('0x32')]:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf['query'][_0x50e8('0x34')](_0x50e8('0x35'))){_0x42bbef['limit']=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1d')]);_0x42bbef[_0x50e8('0x1b')]=qs['offset'](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1b')]);}_0x42bbef[_0x50e8('0x36')]=qs[_0x50e8('0x37')](_0x30fedf['query'][_0x50e8('0x37')]);_0x42bbef[_0x50e8('0x38')]=qs[_0x50e8('0x39')](_['pick'](_0x30fedf['query'],_0x4f0b88['filters']),_0x126c99);if(_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]){_0x42bbef[_0x50e8('0x38')]=_[_0x50e8('0x3b')](_0x42bbef[_0x50e8('0x38')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0xb566c2){if(_0xb566c2[_0x50e8('0x3c')]!==_0x50e8('0x3d')){var _0x3a1b4d={};_0x3a1b4d[_0xb566c2['name']]={'$like':'%'+_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]+'%'};return _0x3a1b4d;}})});}_0x42bbef=_[_0x50e8('0x3b')]({},_0x42bbef,_0x30fedf[_0x50e8('0x3e')]);var _0x5dbbe1={'where':_0x42bbef[_0x50e8('0x38')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x5dbbe1)[_0x50e8('0x23')](function(_0x8e8a97){_0x1041b9['count']=_0x8e8a97;if(_0x30fedf['query'][_0x50e8('0x3f')]){_0x42bbef[_0x50e8('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x50e8('0x41')](_0x42bbef);})[_0x50e8('0x23')](function(_0x3db1ab){_0x1041b9[_0x50e8('0x42')]=_0x3db1ab;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x43')](handleError(_0x39c0c6,null));};exports[_0x50e8('0x44')]=function(_0x172049,_0x5e9da3){var _0x3d26bd={'raw':!![],'where':{'id':_0x172049[_0x50e8('0x45')]['id']}},_0x44e0ca={};_0x44e0ca[_0x50e8('0x2d')]=_['keys'](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x44e0ca[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x172049['query']);_0x44e0ca[_0x50e8('0x39')]=_['intersection'](_0x44e0ca['model'],_0x44e0ca['query']);_0x3d26bd[_0x50e8('0x32')]=_[_0x50e8('0x30')](_0x44e0ca['model'],qs[_0x50e8('0x31')](_0x172049[_0x50e8('0x2e')][_0x50e8('0x31')]));_0x3d26bd[_0x50e8('0x32')]=_0x3d26bd[_0x50e8('0x32')][_0x50e8('0x33')]?_0x3d26bd['attributes']:_0x44e0ca[_0x50e8('0x2d')];if(_0x172049['query'][_0x50e8('0x3f')]){_0x3d26bd[_0x50e8('0x40')]=[{'all':!![]}];}_0x3d26bd=_['merge']({},_0x3d26bd,_0x172049[_0x50e8('0x3e')]);return db['Cdr'][_0x50e8('0x46')](_0x3d26bd)[_0x50e8('0x23')](handleEntityNotFound(_0x5e9da3,null))[_0x50e8('0x23')](respondWithResult(_0x5e9da3,null))[_0x50e8('0x43')](handleError(_0x5e9da3,null));};exports[_0x50e8('0x47')]=function(_0x3f72ea,_0x229d60){return db[_0x50e8('0x29')][_0x50e8('0x47')](_0x3f72ea[_0x50e8('0x48')],{})[_0x50e8('0x23')](respondWithResult(_0x229d60,0xc9))['catch'](handleError(_0x229d60,null));};exports[_0x50e8('0x22')]=function(_0x275a1b,_0x479431){if(_0x275a1b[_0x50e8('0x48')]['id']){delete _0x275a1b['body']['id'];}return db[_0x50e8('0x29')]['find']({'where':{'id':_0x275a1b[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x479431,null))[_0x50e8('0x23')](saveUpdates(_0x275a1b[_0x50e8('0x48')],null))[_0x50e8('0x23')](respondWithResult(_0x479431,null))[_0x50e8('0x43')](handleError(_0x479431,null));};exports[_0x50e8('0x49')]=function(_0x5f256a,_0x3410f3){return db[_0x50e8('0x29')][_0x50e8('0x46')]({'where':{'id':_0x5f256a[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x3410f3,null))[_0x50e8('0x23')](removeEntity(_0x3410f3,null))['catch'](handleError(_0x3410f3,null));};exports[_0x50e8('0x4a')]=function(_0x250b28,_0xff2e24){return db[_0x50e8('0x29')]['describe']()[_0x50e8('0x23')](respondWithResult(_0xff2e24,null))[_0x50e8('0x43')](handleError(_0xff2e24,null));};
\ No newline at end of file
+var _0xd6d6=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type'];(function(_0x545ccb,_0x260809){var _0x4b02f8=function(_0x35e203){while(--_0x35e203){_0x545ccb['push'](_0x545ccb['shift']());}};_0x4b02f8(++_0x260809);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2450b8,_0x3d37e1){_0x2450b8=_0x2450b8-0x0;var _0x31db98=_0xd6d6[_0x2450b8];return _0x31db98;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x553645['query'][_0x6d6d('0x38')]));_0x5273cd[_0x6d6d('0x37')]=_0x5273cd[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x5273cd[_0x6d6d('0x37')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs['offset'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3d')](_0x553645['query']['sort']);_0x5273cd[_0x6d6d('0x3e')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x3f')](_0x553645['query'],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x5273cd[_0x6d6d('0x3e')]=_['merge'](_0x5273cd['where'],{'$or':_['map'](_0xde3272,function(_0x62620d){if(_0x62620d[_0x6d6d('0x31')]!==_0x6d6d('0x41')){var _0x22a49a={};_0x22a49a[_0x62620d['name']]={'$like':'%'+_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x22a49a;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x3d632c={'where':_0x5273cd[_0x6d6d('0x3e')]};return db['Cdr'][_0x6d6d('0x20')](_0x3d632c)[_0x6d6d('0x27')](function(_0x42aff0){_0x57341f[_0x6d6d('0x20')]=_0x42aff0;if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x5273cd[_0x6d6d('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x6d6d('0x46')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x16e177){_0x57341f[_0x6d6d('0x47')]=_0x16e177;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))['catch'](handleError(_0x3edcce,null));};exports[_0x6d6d('0x48')]=function(_0x39f2a9,_0x55dba8){var _0x452de2={'raw':!![],'where':{'id':_0x39f2a9[_0x6d6d('0x49')]['id']}},_0x50dc17={};_0x50dc17[_0x6d6d('0x33')]=_['keys'](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x50dc17[_0x6d6d('0x34')]=_[_0x6d6d('0x4a')](_0x39f2a9[_0x6d6d('0x34')]);_0x50dc17['filters']=_['intersection'](_0x50dc17[_0x6d6d('0x33')],_0x50dc17['query']);_0x452de2['attributes']=_[_0x6d6d('0x36')](_0x50dc17[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x39f2a9['query'][_0x6d6d('0x38')]));_0x452de2['attributes']=_0x452de2[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x452de2[_0x6d6d('0x37')]:_0x50dc17[_0x6d6d('0x33')];if(_0x39f2a9[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x452de2[_0x6d6d('0x45')]=[{'all':!![]}];}_0x452de2=_['merge']({},_0x452de2,_0x39f2a9[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')](_0x452de2)[_0x6d6d('0x27')](handleEntityNotFound(_0x55dba8,null))[_0x6d6d('0x27')](respondWithResult(_0x55dba8,null))[_0x6d6d('0x4c')](handleError(_0x55dba8,null));};exports[_0x6d6d('0x4d')]=function(_0x1d2b20,_0x24cec2){return db['Cdr']['create'](_0x1d2b20[_0x6d6d('0x4e')],{})[_0x6d6d('0x27')](respondWithResult(_0x24cec2,0xc9))[_0x6d6d('0x4c')](handleError(_0x24cec2,null));};exports[_0x6d6d('0x26')]=function(_0xe2a20e,_0x492834){if(_0xe2a20e[_0x6d6d('0x4e')]['id']){delete _0xe2a20e[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0xe2a20e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x492834,null))[_0x6d6d('0x27')](saveUpdates(_0xe2a20e[_0x6d6d('0x4e')],null))[_0x6d6d('0x27')](respondWithResult(_0x492834,null))[_0x6d6d('0x4c')](handleError(_0x492834,null));};exports[_0x6d6d('0x28')]=function(_0x175e26,_0x4d9811){return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0x175e26[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x4d9811,null))[_0x6d6d('0x27')](removeEntity(_0x4d9811,null))['catch'](handleError(_0x4d9811,null));};exports[_0x6d6d('0x4f')]=function(_0x36bc5a,_0x45340b){return db['Cdr']['describe']()[_0x6d6d('0x27')](respondWithResult(_0x45340b,null))['catch'](handleError(_0x45340b,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 1361c75..36bd906 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(_0x1a6561,_0x18c449){var _0x531a9c=function(_0x57cfe4){while(--_0x57cfe4){_0x1a6561['push'](_0x1a6561['shift']());}};_0x531a9c(++_0x18c449);}(_0x7a54,0x106));var _0x47a5=function(_0x50ee68,_0x1bed7d){_0x50ee68=_0x50ee68-0x0;var _0x3b1cc2=_0x7a54[_0x50ee68];return _0x3b1cc2;};'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(_0x2172ef,_0x46b33c){var _0x2b877e=function(_0x2b4e59){while(--_0x2b4e59){_0x2172ef['push'](_0x2172ef['shift']());}};_0x2b877e(++_0x46b33c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 bcc1afd..bac65d7 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 _0xba5c=['code','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error'];(function(_0x359d68,_0x1f5351){var _0x4a8d4e=function(_0x50dd44){while(--_0x50dd44){_0x359d68['push'](_0x359d68['shift']());}};_0x4a8d4e(++_0x1f5351);}(_0xba5c,0x67));var _0xcba5=function(_0x1ad85e,_0x34b90a){_0x1ad85e=_0x1ad85e-0x0;var _0x23d9a2=_0xba5c[_0x1ad85e];return _0x23d9a2;};'use strict';var _=require(_0xcba5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcba5('0x1'));var rs=require(_0xcba5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcba5('0x3'))['db'];var utils=require(_0xcba5('0x4'));var logger=require(_0xcba5('0x5'))(_0xcba5('0x6'));var config=require(_0xcba5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcba5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16eadd,_0x50859f,_0x112275){return new BPromise(function(_0x34fa9a,_0x515a65){return client[_0xcba5('0x9')](_0x16eadd,_0x112275)[_0xcba5('0xa')](function(_0x171b7a){logger[_0xcba5('0xb')](_0xcba5('0xc'),_0x50859f,_0xcba5('0xd'));logger[_0xcba5('0xe')](_0xcba5('0xf'),_0x50859f,_0xcba5('0xd'),JSON['stringify'](_0x171b7a));if(_0x171b7a['error']){if(_0x171b7a[_0xcba5('0x10')][_0xcba5('0x11')]===0x1f4){logger[_0xcba5('0x10')](_0xcba5('0xc'),_0x50859f,_0x171b7a[_0xcba5('0x10')]['message']);return _0x515a65(_0x171b7a[_0xcba5('0x10')][_0xcba5('0x12')]);}logger[_0xcba5('0x10')]('Cdr,\x20%s,\x20%s',_0x50859f,_0x171b7a['error'][_0xcba5('0x12')]);return _0x34fa9a(_0x171b7a['error'][_0xcba5('0x12')]);}else{logger[_0xcba5('0xb')](_0xcba5('0xc'),_0x50859f,_0xcba5('0xd'));_0x34fa9a(_0x171b7a['result']['message']);}})[_0xcba5('0x13')](function(_0x131cf4){logger[_0xcba5('0x10')](_0xcba5('0xc'),_0x50859f,_0x131cf4);_0x515a65(_0x131cf4);});});}
\ No newline at end of file
+var _0x213f=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xa5ac1a,_0x11d10f){var _0x445c64=function(_0x5287e7){while(--_0x5287e7){_0xa5ac1a['push'](_0xa5ac1a['shift']());}};_0x445c64(++_0x11d10f);}(_0x213f,0x8d));var _0xf213=function(_0x1ac216,_0x2d5593){_0x1ac216=_0x1ac216-0x0;var _0x2e887f=_0x213f[_0x1ac216];return _0x2e887f;};'use strict';var _=require(_0xf213('0x0'));var util=require(_0xf213('0x1'));var moment=require(_0xf213('0x2'));var BPromise=require(_0xf213('0x3'));var rs=require(_0xf213('0x4'));var fs=require('fs');var Redis=require(_0xf213('0x5'));var db=require(_0xf213('0x6'))['db'];var utils=require(_0xf213('0x7'));var logger=require(_0xf213('0x8'))(_0xf213('0x9'));var config=require(_0xf213('0xa'));var jayson=require(_0xf213('0xb'));var client=jayson[_0xf213('0xc')][_0xf213('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20a00a,_0x104749,_0x1cdb7e){return new BPromise(function(_0x1d38d8,_0x3882f3){return client[_0xf213('0xe')](_0x20a00a,_0x1cdb7e)['then'](function(_0x850555){logger[_0xf213('0xf')](_0xf213('0x10'),_0x104749,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x104749,_0xf213('0x11'),JSON[_0xf213('0x12')](_0x850555));if(_0x850555['error']){if(_0x850555[_0xf213('0x13')][_0xf213('0x14')]===0x1f4){logger[_0xf213('0x13')](_0xf213('0x10'),_0x104749,_0x850555[_0xf213('0x13')][_0xf213('0x15')]);return _0x3882f3(_0x850555['error']['message']);}logger[_0xf213('0x13')](_0xf213('0x10'),_0x104749,_0x850555['error'][_0xf213('0x15')]);return _0x1d38d8(_0x850555['error'][_0xf213('0x15')]);}else{logger[_0xf213('0xf')]('Cdr,\x20%s,\x20%s',_0x104749,_0xf213('0x11'));_0x1d38d8(_0x850555['result'][_0xf213('0x15')]);}})[_0xf213('0x16')](function(_0x562be5){logger['error'](_0xf213('0x10'),_0x104749,_0x562be5);_0x3882f3(_0x562be5);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 899e80c..91d5fe8 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+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(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 5b1129d..7430cbc 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 _0xde25=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde25,0x1bf));var _0x5de2=function(_0x55defa,_0x4cd9df){_0x55defa=_0x55defa-0x0;var _0x39fc0f=_0xde25[_0x55defa];return _0x39fc0f;};'use strict';var Sequelize=require(_0x5de2('0x0'));module[_0x5de2('0x1')]={'priority':{'type':Sequelize[_0x5de2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5de2('0x3')],'allowNull':![],'defaultValue':_0x5de2('0x4')},'appdata':{'type':Sequelize[_0x5de2('0x5')]()},'description':{'type':Sequelize[_0x5de2('0x3')]},'interval':{'type':Sequelize[_0x5de2('0x3')],'defaultValue':_0x5de2('0x6')}};
\ No newline at end of file
+var _0x5878=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x5878,0xd8));var _0x8587=function(_0x2bb6fa,_0x25c421){_0x2bb6fa=_0x2bb6fa-0x0;var _0x5f4e5b=_0x5878[_0x2bb6fa];return _0x5f4e5b;};'use strict';var Sequelize=require('sequelize');module[_0x8587('0x0')]={'priority':{'type':Sequelize[_0x8587('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8587('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8587('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8587('0x2')],'defaultValue':_0x8587('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index d61abec..90d25f3 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 _0xc2af=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','params','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x55e58d,_0x2a90e0){var _0x1a61ae=function(_0xae95c){while(--_0xae95c){_0x55e58d['push'](_0x55e58d['shift']());}};_0x1a61ae(++_0x2a90e0);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x4fe370,_0x13cb3b){_0x4fe370=_0x4fe370-0x0;var _0x59801a=_0xc2af[_0x4fe370];return _0x59801a;};'use strict';var emlformat=require(_0xfc2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var BPromise=require(_0xfc2a('0x4'));var Mustache=require(_0xfc2a('0x5'));var util=require(_0xfc2a('0x6'));var path=require(_0xfc2a('0x7'));var sox=require(_0xfc2a('0x8'));var csv=require(_0xfc2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc2a('0xa'));var _=require('lodash');var squel=require(_0xfc2a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc2a('0xc'));var deskjs=require(_0xfc2a('0xd'));var toCsv=require(_0xfc2a('0x9'));var querystring=require(_0xfc2a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc2a('0x11'));var logger=require(_0xfc2a('0x12'))(_0xfc2a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc2a('0x14'));var db=require(_0xfc2a('0x15'))['db'];function respondWithStatusCode(_0x771766,_0x41395e){_0x41395e=_0x41395e||0xcc;return function(_0x268993){if(_0x268993){return _0x771766[_0xfc2a('0x16')](_0x41395e);}return _0x771766[_0xfc2a('0x17')](_0x41395e)[_0xfc2a('0x18')]();};}function respondWithResult(_0xe4b058,_0x55574a){_0x55574a=_0x55574a||0xc8;return function(_0x4e6b7e){if(_0x4e6b7e){return _0xe4b058[_0xfc2a('0x17')](_0x55574a)[_0xfc2a('0x19')](_0x4e6b7e);}};}function respondWithFilteredResult(_0x594a59,_0x12dd07){return function(_0x2f311c){if(_0x2f311c){var _0x21654f=typeof _0x12dd07[_0xfc2a('0x1a')]===_0xfc2a('0x1b')&&typeof _0x12dd07[_0xfc2a('0x1c')]===_0xfc2a('0x1b');var _0x678f8d=_0x2f311c[_0xfc2a('0x1d')];var _0x1e1524=_0x21654f?0x0:_0x12dd07[_0xfc2a('0x1a')];var _0x39bcb2=_0x21654f?_0x2f311c[_0xfc2a('0x1d')]:_0x12dd07['offset']+_0x12dd07[_0xfc2a('0x1c')];var _0x15ff6d;if(_0x39bcb2>=_0x678f8d){_0x39bcb2=_0x678f8d;_0x15ff6d=0xc8;}else{_0x15ff6d=0xce;}_0x594a59['status'](_0x15ff6d);return _0x594a59[_0xfc2a('0x1e')]('Content-Range',_0x1e1524+'-'+_0x39bcb2+'/'+_0x678f8d)['json'](_0x2f311c);}return null;};}function patchUpdates(_0x3e88fe){return function(_0x2b7f5c){try{jsonpatch[_0xfc2a('0x1f')](_0x2b7f5c,_0x3e88fe,!![]);}catch(_0x40ed0b){return BPromise[_0xfc2a('0x20')](_0x40ed0b);}return _0x2b7f5c['save']();};}function saveUpdates(_0x722009,_0x4908d7){return function(_0x5432f2){if(_0x5432f2){return _0x5432f2['update'](_0x722009)[_0xfc2a('0x21')](function(_0x57b67c){return _0x57b67c;});}return null;};}function removeEntity(_0x4d6b68,_0x43e237){return function(_0x10396d){if(_0x10396d){return _0x10396d[_0xfc2a('0x22')]()[_0xfc2a('0x21')](function(){_0x4d6b68['status'](0xcc)[_0xfc2a('0x18')]();});}};}function handleEntityNotFound(_0x192f0b,_0x33574a){return function(_0x5ea9f8){if(!_0x5ea9f8){_0x192f0b[_0xfc2a('0x16')](0x194);}return _0x5ea9f8;};}function handleError(_0x24ff4e,_0x542c9e){_0x542c9e=_0x542c9e||0x1f4;return function(_0x55c0bc){logger[_0xfc2a('0x23')](_0x55c0bc['stack']);if(_0x55c0bc[_0xfc2a('0x24')]){delete _0x55c0bc[_0xfc2a('0x24')];}_0x24ff4e[_0xfc2a('0x17')](_0x542c9e)[_0xfc2a('0x25')](_0x55c0bc);};}exports['show']=function(_0x4fe30d,_0x5f4165){var _0x3bf69f={'raw':!![],'where':{'id':_0x4fe30d['params']['id']}},_0x1f91f5={};_0x1f91f5[_0xfc2a('0x26')]=_[_0xfc2a('0x27')](db[_0xfc2a('0x28')][_0xfc2a('0x29')]);_0x1f91f5[_0xfc2a('0x2a')]=_[_0xfc2a('0x27')](_0x4fe30d[_0xfc2a('0x2a')]);_0x1f91f5[_0xfc2a('0x2b')]=_[_0xfc2a('0x2c')](_0x1f91f5['model'],_0x1f91f5[_0xfc2a('0x2a')]);_0x3bf69f[_0xfc2a('0x2d')]=_[_0xfc2a('0x2c')](_0x1f91f5[_0xfc2a('0x26')],qs[_0xfc2a('0x2e')](_0x4fe30d[_0xfc2a('0x2a')][_0xfc2a('0x2e')]));_0x3bf69f[_0xfc2a('0x2d')]=_0x3bf69f[_0xfc2a('0x2d')][_0xfc2a('0x2f')]?_0x3bf69f[_0xfc2a('0x2d')]:_0x1f91f5[_0xfc2a('0x26')];if(_0x4fe30d['query'][_0xfc2a('0x30')]){_0x3bf69f[_0xfc2a('0x31')]=[{'all':!![]}];}_0x3bf69f=_[_0xfc2a('0x32')]({},_0x3bf69f,_0x4fe30d[_0xfc2a('0x33')]);return db['ChatApplication'][_0xfc2a('0x34')](_0x3bf69f)['then'](handleEntityNotFound(_0x5f4165,null))[_0xfc2a('0x21')](respondWithResult(_0x5f4165,null))['catch'](handleError(_0x5f4165,null));};exports[_0xfc2a('0x35')]=function(_0x1a423d,_0x53491a){if(_0x1a423d['body']['id']){delete _0x1a423d['body']['id'];}return db['ChatApplication'][_0xfc2a('0x34')]({'where':{'id':_0x1a423d[_0xfc2a('0x36')]['id']}})['then'](handleEntityNotFound(_0x53491a,null))['then'](saveUpdates(_0x1a423d[_0xfc2a('0x37')],null))[_0xfc2a('0x21')](respondWithResult(_0x53491a,null))[_0xfc2a('0x38')](handleError(_0x53491a,null));};exports[_0xfc2a('0x22')]=function(_0x30a32a,_0x5dde47){return db[_0xfc2a('0x28')][_0xfc2a('0x34')]({'where':{'id':_0x30a32a['params']['id']}})[_0xfc2a('0x21')](handleEntityNotFound(_0x5dde47,null))[_0xfc2a('0x21')](removeEntity(_0x5dde47,null))[_0xfc2a('0x38')](handleError(_0x5dde47,null));};
\ No newline at end of file
+var _0xa769=['update','then','destroy','error','stack','name','send','params','keys','ChatApplication','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject'];(function(_0x594d34,_0x4eaa08){var _0x56e972=function(_0x4870ae){while(--_0x4870ae){_0x594d34['push'](_0x594d34['shift']());}};_0x56e972(++_0x4eaa08);}(_0xa769,0xfb));var _0x9a76=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa769[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x9a76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a76('0x1'));var jsonpatch=require(_0x9a76('0x2'));var rp=require(_0x9a76('0x3'));var moment=require('moment');var BPromise=require(_0x9a76('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a76('0x5'));var sox=require(_0x9a76('0x6'));var csv=require('to-csv');var ejs=require(_0x9a76('0x7'));var fs=require('fs');var fs_extra=require(_0x9a76('0x8'));var _=require(_0x9a76('0x9'));var squel=require(_0x9a76('0xa'));var crypto=require(_0x9a76('0xb'));var jsforce=require(_0x9a76('0xc'));var deskjs=require(_0x9a76('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9a76('0xe'));var Papa=require(_0x9a76('0xf'));var Redis=require(_0x9a76('0x10'));var authService=require(_0x9a76('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a76('0x12'));var logger=require('../../config/logger')(_0x9a76('0x13'));var utils=require(_0x9a76('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a76('0x15'));var db=require(_0x9a76('0x16'))['db'];function respondWithStatusCode(_0x5852f9,_0x34b7c9){_0x34b7c9=_0x34b7c9||0xcc;return function(_0x30d1be){if(_0x30d1be){return _0x5852f9[_0x9a76('0x17')](_0x34b7c9);}return _0x5852f9[_0x9a76('0x18')](_0x34b7c9)[_0x9a76('0x19')]();};}function respondWithResult(_0xbb0dda,_0x204e33){_0x204e33=_0x204e33||0xc8;return function(_0x28ebac){if(_0x28ebac){return _0xbb0dda[_0x9a76('0x18')](_0x204e33)[_0x9a76('0x1a')](_0x28ebac);}};}function respondWithFilteredResult(_0x42cd61,_0x259664){return function(_0x1e687a){if(_0x1e687a){var _0x54028e=typeof _0x259664[_0x9a76('0x1b')]==='undefined'&&typeof _0x259664[_0x9a76('0x1c')]===_0x9a76('0x1d');var _0x140b08=_0x1e687a[_0x9a76('0x1e')];var _0x38e509=_0x54028e?0x0:_0x259664[_0x9a76('0x1b')];var _0x58a964=_0x54028e?_0x1e687a['count']:_0x259664[_0x9a76('0x1b')]+_0x259664[_0x9a76('0x1c')];var _0x248dcb;if(_0x58a964>=_0x140b08){_0x58a964=_0x140b08;_0x248dcb=0xc8;}else{_0x248dcb=0xce;}_0x42cd61[_0x9a76('0x18')](_0x248dcb);return _0x42cd61[_0x9a76('0x1f')](_0x9a76('0x20'),_0x38e509+'-'+_0x58a964+'/'+_0x140b08)['json'](_0x1e687a);}return null;};}function patchUpdates(_0x17de93){return function(_0x3ebe6c){try{jsonpatch['apply'](_0x3ebe6c,_0x17de93,!![]);}catch(_0x2e9dcf){return BPromise[_0x9a76('0x21')](_0x2e9dcf);}return _0x3ebe6c['save']();};}function saveUpdates(_0x3adc8e,_0x35b608){return function(_0x3e978f){if(_0x3e978f){return _0x3e978f[_0x9a76('0x22')](_0x3adc8e)[_0x9a76('0x23')](function(_0x4a40bf){return _0x4a40bf;});}return null;};}function removeEntity(_0x1a4667,_0x5c3afa){return function(_0x523727){if(_0x523727){return _0x523727[_0x9a76('0x24')]()[_0x9a76('0x23')](function(){_0x1a4667[_0x9a76('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d7f2b,_0x4d8d8d){return function(_0x57d6d7){if(!_0x57d6d7){_0x3d7f2b[_0x9a76('0x17')](0x194);}return _0x57d6d7;};}function handleError(_0x5941bc,_0xa848f){_0xa848f=_0xa848f||0x1f4;return function(_0x33707a){logger[_0x9a76('0x25')](_0x33707a[_0x9a76('0x26')]);if(_0x33707a[_0x9a76('0x27')]){delete _0x33707a[_0x9a76('0x27')];}_0x5941bc[_0x9a76('0x18')](_0xa848f)[_0x9a76('0x28')](_0x33707a);};}exports['show']=function(_0x42c35b,_0x49cc2f){var _0xd81bb8={'raw':!![],'where':{'id':_0x42c35b[_0x9a76('0x29')]['id']}},_0x328458={};_0x328458['model']=_[_0x9a76('0x2a')](db[_0x9a76('0x2b')][_0x9a76('0x2c')]);_0x328458[_0x9a76('0x2d')]=_[_0x9a76('0x2a')](_0x42c35b[_0x9a76('0x2d')]);_0x328458['filters']=_[_0x9a76('0x2e')](_0x328458[_0x9a76('0x2f')],_0x328458[_0x9a76('0x2d')]);_0xd81bb8[_0x9a76('0x30')]=_['intersection'](_0x328458[_0x9a76('0x2f')],qs[_0x9a76('0x31')](_0x42c35b[_0x9a76('0x2d')]['fields']));_0xd81bb8[_0x9a76('0x30')]=_0xd81bb8[_0x9a76('0x30')][_0x9a76('0x32')]?_0xd81bb8['attributes']:_0x328458[_0x9a76('0x2f')];if(_0x42c35b[_0x9a76('0x2d')][_0x9a76('0x33')]){_0xd81bb8[_0x9a76('0x34')]=[{'all':!![]}];}_0xd81bb8=_[_0x9a76('0x35')]({},_0xd81bb8,_0x42c35b['options']);return db[_0x9a76('0x2b')]['find'](_0xd81bb8)[_0x9a76('0x23')](handleEntityNotFound(_0x49cc2f,null))[_0x9a76('0x23')](respondWithResult(_0x49cc2f,null))[_0x9a76('0x36')](handleError(_0x49cc2f,null));};exports['update']=function(_0x4ba311,_0x53fea2){if(_0x4ba311[_0x9a76('0x37')]['id']){delete _0x4ba311[_0x9a76('0x37')]['id'];}return db['ChatApplication'][_0x9a76('0x38')]({'where':{'id':_0x4ba311[_0x9a76('0x29')]['id']}})[_0x9a76('0x23')](handleEntityNotFound(_0x53fea2,null))[_0x9a76('0x23')](saveUpdates(_0x4ba311[_0x9a76('0x37')],null))[_0x9a76('0x23')](respondWithResult(_0x53fea2,null))['catch'](handleError(_0x53fea2,null));};exports[_0x9a76('0x24')]=function(_0x5f1d3d,_0x166623){return db['ChatApplication'][_0x9a76('0x38')]({'where':{'id':_0x5f1d3d['params']['id']}})[_0x9a76('0x23')](handleEntityNotFound(_0x166623,null))[_0x9a76('0x23')](removeEntity(_0x166623,null))[_0x9a76('0x36')](handleError(_0x166623,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 3bc7eb4..177a4e4 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 _0x45ea=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x45ea,0x1f0));var _0xa45e=function(_0x485d77,_0x6edfca){_0x485d77=_0x485d77-0x0;var _0x33c32c=_0x45ea[_0x485d77];return _0x33c32c;};'use strict';var _=require(_0xa45e('0x0'));var util=require(_0xa45e('0x1'));var logger=require(_0xa45e('0x2'))(_0xa45e('0x3'));var moment=require(_0xa45e('0x4'));var BPromise=require(_0xa45e('0x5'));var rp=require(_0xa45e('0x6'));var fs=require('fs');var path=require(_0xa45e('0x7'));var rimraf=require(_0xa45e('0x8'));var config=require(_0xa45e('0x9'));var attributes=require(_0xa45e('0xa'));module['exports']=function(_0x418a41,_0x3ee60d){return _0x418a41['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa45e('0xb'),'collate':_0xa45e('0xc')});};
\ No newline at end of file
+var _0x2e89=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5aeacb,_0x1b9944){var _0x40861c=function(_0x28c29a){while(--_0x28c29a){_0x5aeacb['push'](_0x5aeacb['shift']());}};_0x40861c(++_0x1b9944);}(_0x2e89,0x1e9));var _0x92e8=function(_0x599d6b,_0x50b07d){_0x599d6b=_0x599d6b-0x0;var _0x38cac5=_0x2e89[_0x599d6b];return _0x38cac5;};'use strict';var _=require(_0x92e8('0x0'));var util=require(_0x92e8('0x1'));var logger=require(_0x92e8('0x2'))(_0x92e8('0x3'));var moment=require('moment');var BPromise=require(_0x92e8('0x4'));var rp=require(_0x92e8('0x5'));var fs=require('fs');var path=require(_0x92e8('0x6'));var rimraf=require(_0x92e8('0x7'));var config=require('../../config/environment');var attributes=require(_0x92e8('0x8'));module['exports']=function(_0x1fc289,_0x5bdac5){return _0x1fc289[_0x92e8('0x9')](_0x92e8('0xa'),attributes,{'tableName':_0x92e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x92e8('0xc'),'collate':_0x92e8('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5a43238..3473fa4 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 _0xb1de=['code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57a430,_0x281e18){var _0x533e30=function(_0x30f094){while(--_0x30f094){_0x57a430['push'](_0x57a430['shift']());}};_0x533e30(++_0x281e18);}(_0xb1de,0x108));var _0xeb1d=function(_0x554f52,_0x56c7ba){_0x554f52=_0x554f52-0x0;var _0x1c99c4=_0xb1de[_0x554f52];return _0x1c99c4;};'use strict';var _=require('lodash');var util=require(_0xeb1d('0x0'));var moment=require(_0xeb1d('0x1'));var BPromise=require(_0xeb1d('0x2'));var rs=require(_0xeb1d('0x3'));var fs=require('fs');var Redis=require(_0xeb1d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeb1d('0x5'))(_0xeb1d('0x6'));var config=require(_0xeb1d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb1d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x438630,_0x3b8287,_0x3c1d4c){return new BPromise(function(_0x34fd16,_0x24ce24){return client['request'](_0x438630,_0x3c1d4c)[_0xeb1d('0x9')](function(_0x5e8f14){logger[_0xeb1d('0xa')](_0xeb1d('0xb'),_0x3b8287,'request\x20sent');logger[_0xeb1d('0xc')](_0xeb1d('0xd'),_0x3b8287,'request\x20sent',JSON[_0xeb1d('0xe')](_0x5e8f14));if(_0x5e8f14[_0xeb1d('0xf')]){if(_0x5e8f14[_0xeb1d('0xf')][_0xeb1d('0x10')]===0x1f4){logger[_0xeb1d('0xf')](_0xeb1d('0xb'),_0x3b8287,_0x5e8f14[_0xeb1d('0xf')]['message']);return _0x24ce24(_0x5e8f14[_0xeb1d('0xf')][_0xeb1d('0x11')]);}logger[_0xeb1d('0xf')](_0xeb1d('0xb'),_0x3b8287,_0x5e8f14[_0xeb1d('0xf')]['message']);return _0x34fd16(_0x5e8f14[_0xeb1d('0xf')][_0xeb1d('0x11')]);}else{logger[_0xeb1d('0xa')](_0xeb1d('0xb'),_0x3b8287,_0xeb1d('0x12'));_0x34fd16(_0x5e8f14['result'][_0xeb1d('0x11')]);}})[_0xeb1d('0x13')](function(_0x176436){logger[_0xeb1d('0xf')](_0xeb1d('0xb'),_0x3b8287,_0x176436);_0x24ce24(_0x176436);});});}
\ No newline at end of file
+var _0x66bf=['jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e15a6,_0x2b88cf){var _0xcaee13=function(_0x4fa1e1){while(--_0x4fa1e1){_0x3e15a6['push'](_0x3e15a6['shift']());}};_0xcaee13(++_0x2b88cf);}(_0x66bf,0xad));var _0xf66b=function(_0xcbacee,_0x1ecdb2){_0xcbacee=_0xcbacee-0x0;var _0x54e9b6=_0x66bf[_0xcbacee];return _0x54e9b6;};'use strict';var _=require(_0xf66b('0x0'));var util=require(_0xf66b('0x1'));var moment=require(_0xf66b('0x2'));var BPromise=require(_0xf66b('0x3'));var rs=require(_0xf66b('0x4'));var fs=require('fs');var Redis=require(_0xf66b('0x5'));var db=require(_0xf66b('0x6'))['db'];var utils=require(_0xf66b('0x7'));var logger=require(_0xf66b('0x8'))(_0xf66b('0x9'));var config=require(_0xf66b('0xa'));var jayson=require(_0xf66b('0xb'));var client=jayson['client'][_0xf66b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3670f4,_0x4913da,_0x4f4d9c){return new BPromise(function(_0x4523af,_0x242ef4){return client[_0xf66b('0xd')](_0x3670f4,_0x4f4d9c)[_0xf66b('0xe')](function(_0x24ef18){logger[_0xf66b('0xf')](_0xf66b('0x10'),_0x4913da,_0xf66b('0x11'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4913da,_0xf66b('0x11'),JSON[_0xf66b('0x12')](_0x24ef18));if(_0x24ef18[_0xf66b('0x13')]){if(_0x24ef18[_0xf66b('0x13')]['code']===0x1f4){logger['error'](_0xf66b('0x10'),_0x4913da,_0x24ef18[_0xf66b('0x13')][_0xf66b('0x14')]);return _0x242ef4(_0x24ef18['error'][_0xf66b('0x14')]);}logger[_0xf66b('0x13')]('ChatApplication,\x20%s,\x20%s',_0x4913da,_0x24ef18['error'][_0xf66b('0x14')]);return _0x4523af(_0x24ef18[_0xf66b('0x13')][_0xf66b('0x14')]);}else{logger['info'](_0xf66b('0x10'),_0x4913da,'request\x20sent');_0x4523af(_0x24ef18[_0xf66b('0x15')][_0xf66b('0x14')]);}})[_0xf66b('0x16')](function(_0x21eb67){logger[_0xf66b('0x13')]('ChatApplication,\x20%s,\x20%s',_0x4913da,_0x21eb67);_0x242ef4(_0x21eb67);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index a28a6d3..f6fb035 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 _0x7322=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x53a7f7,_0x2d59fe){var _0x3f7e26=function(_0x260d4d){while(--_0x260d4d){_0x53a7f7['push'](_0x53a7f7['shift']());}};_0x3f7e26(++_0x2d59fe);}(_0x7322,0x154));var _0x2732=function(_0x41a4bb,_0x36b115){_0x41a4bb=_0x41a4bb-0x0;var _0x4d4239=_0x7322[_0x41a4bb];return _0x4d4239;};'use strict';var multer=require(_0x2732('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2732('0x1'));var express=require(_0x2732('0x2'));var router=express[_0x2732('0x3')]();var fs_extra=require(_0x2732('0x4'));var auth=require(_0x2732('0x5'));var interaction=require(_0x2732('0x6'));var config=require(_0x2732('0x7'));var controller=require(_0x2732('0x8'));router['get'](_0x2732('0x9'),auth[_0x2732('0xa')](),controller[_0x2732('0xb')]);router['put'](_0x2732('0x9'),auth[_0x2732('0xa')](),controller[_0x2732('0xc')]);router[_0x2732('0xd')]('/:id',auth[_0x2732('0xa')](),controller[_0x2732('0xe')]);module[_0x2732('0xf')]=router;
\ No newline at end of file
+var _0xa295=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','delete','multer','util','express'];(function(_0x603961,_0xdc5cdd){var _0x247340=function(_0x3f3ae0){while(--_0x3f3ae0){_0x603961['push'](_0x603961['shift']());}};_0x247340(++_0xdc5cdd);}(_0xa295,0x10e));var _0x5a29=function(_0x25e266,_0x3f2a25){_0x25e266=_0x25e266-0x0;var _0x5472a6=_0xa295[_0x25e266];return _0x5472a6;};'use strict';var multer=require(_0x5a29('0x0'));var util=require(_0x5a29('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5a29('0x2'));var router=express[_0x5a29('0x3')]();var fs_extra=require(_0x5a29('0x4'));var auth=require(_0x5a29('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5a29('0x6'));var controller=require(_0x5a29('0x7'));router['get'](_0x5a29('0x8'),auth[_0x5a29('0x9')](),controller[_0x5a29('0xa')]);router[_0x5a29('0xb')]('/:id',auth[_0x5a29('0x9')](),controller['update']);router[_0x5a29('0xc')](_0x5a29('0x8'),auth[_0x5a29('0x9')](),controller['destroy']);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 7a26b1e..5a29a08 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 _0x8a62=['sequelize','STRING','BOOLEAN'];(function(_0x30aadd,_0x20a265){var _0x428865=function(_0x40e630){while(--_0x40e630){_0x30aadd['push'](_0x30aadd['shift']());}};_0x428865(++_0x20a265);}(_0x8a62,0x18f));var _0x28a6=function(_0x5e4486,_0xe9e19){_0x5e4486=_0x5e4486-0x0;var _0x203b57=_0x8a62[_0x5e4486];return _0x203b57;};'use strict';var Sequelize=require(_0x28a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x28a6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x28a6('0x1')]},'write':{'type':Sequelize[_0x28a6('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x50c1=['sequelize','STRING','BOOLEAN'];(function(_0x471bd3,_0x4ebe71){var _0x17d4d5=function(_0x65cb43){while(--_0x65cb43){_0x471bd3['push'](_0x471bd3['shift']());}};_0x17d4d5(++_0x4ebe71);}(_0x50c1,0x171));var _0x150c=function(_0x123db8,_0x33173f){_0x123db8=_0x123db8-0x0;var _0x158432=_0x50c1[_0x123db8];return _0x158432;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize[_0x150c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x150c('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 0553c9b..742af9c 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 _0x2196=['save','update','then','destroy','sendStatus','stack','name','index','map','ChatGroup','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','getMessages','findOne','order','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0x2196,0x155));var _0x6219=function(_0x242091,_0x30f1d9){_0x242091=_0x242091-0x0;var _0x13574d=_0x2196[_0x242091];return _0x13574d;};'use strict';var emlformat=require(_0x6219('0x0'));var rimraf=require(_0x6219('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6219('0x2'));var BPromise=require(_0x6219('0x3'));var Mustache=require(_0x6219('0x4'));var util=require(_0x6219('0x5'));var path=require(_0x6219('0x6'));var sox=require(_0x6219('0x7'));var csv=require(_0x6219('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6219('0x9'));var squel=require(_0x6219('0xa'));var crypto=require(_0x6219('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6219('0xc'));var toCsv=require(_0x6219('0x8'));var querystring=require(_0x6219('0xd'));var Papa=require(_0x6219('0xe'));var Redis=require(_0x6219('0xf'));var authService=require(_0x6219('0x10'));var qs=require(_0x6219('0x11'));var as=require(_0x6219('0x12'));var hardwareService=require(_0x6219('0x13'));var logger=require(_0x6219('0x14'))(_0x6219('0x15'));var utils=require(_0x6219('0x16'));var config=require(_0x6219('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6219('0x18'))['db'];config['redis']=_[_0x6219('0x19')](config[_0x6219('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6219('0x1b'))(new Redis(config[_0x6219('0x1a')]));require(_0x6219('0x1c'))['register'](socket);function respondWithStatusCode(_0x1cfa96,_0x5a0f7b){_0x5a0f7b=_0x5a0f7b||0xcc;return function(_0xa0b4f0){if(_0xa0b4f0){return _0x1cfa96['sendStatus'](_0x5a0f7b);}return _0x1cfa96[_0x6219('0x1d')](_0x5a0f7b)[_0x6219('0x1e')]();};}function respondWithResult(_0x591fdd,_0x6fe4ec){_0x6fe4ec=_0x6fe4ec||0xc8;return function(_0x139894){if(_0x139894){return _0x591fdd['status'](_0x6fe4ec)['json'](_0x139894);}};}function respondWithFilteredResult(_0x49d63a,_0x361027){return function(_0x521163){if(_0x521163){var _0x57b485=typeof _0x361027[_0x6219('0x1f')]===_0x6219('0x20')&&typeof _0x361027[_0x6219('0x21')]===_0x6219('0x20');var _0x43f870=_0x521163[_0x6219('0x22')];var _0x523e01=_0x57b485?0x0:_0x361027['offset'];var _0x2c63ad=_0x57b485?_0x521163[_0x6219('0x22')]:_0x361027[_0x6219('0x1f')]+_0x361027['limit'];var _0x41b588;if(_0x2c63ad>=_0x43f870){_0x2c63ad=_0x43f870;_0x41b588=0xc8;}else{_0x41b588=0xce;}_0x49d63a[_0x6219('0x1d')](_0x41b588);return _0x49d63a['set'](_0x6219('0x23'),_0x523e01+'-'+_0x2c63ad+'/'+_0x43f870)[_0x6219('0x24')](_0x521163);}return null;};}function patchUpdates(_0x47b9a4){return function(_0xdc5477){try{jsonpatch[_0x6219('0x25')](_0xdc5477,_0x47b9a4,!![]);}catch(_0x47fa09){return BPromise[_0x6219('0x26')](_0x47fa09);}return _0xdc5477[_0x6219('0x27')]();};}function saveUpdates(_0x2f70df,_0x18559d){return function(_0xd0f0b4){if(_0xd0f0b4){return _0xd0f0b4[_0x6219('0x28')](_0x2f70df)[_0x6219('0x29')](function(_0x287143){return _0x287143;});}return null;};}function removeEntity(_0x22d012,_0xb672dd){return function(_0x31a14f){if(_0x31a14f){return _0x31a14f[_0x6219('0x2a')]()[_0x6219('0x29')](function(){_0x22d012[_0x6219('0x1d')](0xcc)[_0x6219('0x1e')]();});}};}function handleEntityNotFound(_0x5555d2,_0xdd89e){return function(_0x154a98){if(!_0x154a98){_0x5555d2[_0x6219('0x2b')](0x194);}return _0x154a98;};}function handleError(_0x208fbb,_0x14ad8a){_0x14ad8a=_0x14ad8a||0x1f4;return function(_0x2ab088){logger['error'](_0x2ab088[_0x6219('0x2c')]);if(_0x2ab088[_0x6219('0x2d')]){delete _0x2ab088[_0x6219('0x2d')];}_0x208fbb[_0x6219('0x1d')](_0x14ad8a)['send'](_0x2ab088);};}exports[_0x6219('0x2e')]=function(_0x24a9d7,_0x25dad0){var _0xf2aa2={},_0x3c6f49={},_0x20157e={'count':0x0,'rows':[]};var _0x18de17=_[_0x6219('0x2f')](db[_0x6219('0x30')]['rawAttributes'],function(_0x5cfbd1){return{'name':_0x5cfbd1['fieldName'],'type':_0x5cfbd1[_0x6219('0x31')][_0x6219('0x32')]};});_0x3c6f49['model']=_[_0x6219('0x2f')](_0x18de17,_0x6219('0x2d'));_0x3c6f49[_0x6219('0x33')]=_[_0x6219('0x34')](_0x24a9d7[_0x6219('0x33')]);_0x3c6f49[_0x6219('0x35')]=_['intersection'](_0x3c6f49['model'],_0x3c6f49[_0x6219('0x33')]);_0xf2aa2['attributes']=_[_0x6219('0x36')](_0x3c6f49['model'],qs[_0x6219('0x37')](_0x24a9d7[_0x6219('0x33')][_0x6219('0x37')]));_0xf2aa2['attributes']=_0xf2aa2[_0x6219('0x38')][_0x6219('0x39')]?_0xf2aa2[_0x6219('0x38')]:_0x3c6f49[_0x6219('0x3a')];if(!_0x24a9d7[_0x6219('0x33')][_0x6219('0x3b')](_0x6219('0x3c'))){_0xf2aa2[_0x6219('0x21')]=qs[_0x6219('0x21')](_0x24a9d7[_0x6219('0x33')][_0x6219('0x21')]);_0xf2aa2['offset']=qs[_0x6219('0x1f')](_0x24a9d7[_0x6219('0x33')]['offset']);}_0xf2aa2['order']=qs['sort'](_0x24a9d7[_0x6219('0x33')][_0x6219('0x3d')]);_0xf2aa2['where']=qs[_0x6219('0x35')](_[_0x6219('0x3e')](_0x24a9d7[_0x6219('0x33')],_0x3c6f49[_0x6219('0x35')]),_0x18de17);if(_0x24a9d7[_0x6219('0x33')][_0x6219('0x3f')]){_0xf2aa2['where']=_[_0x6219('0x40')](_0xf2aa2[_0x6219('0x41')],{'$or':_[_0x6219('0x2f')](_0x18de17,function(_0x4219f4){if(_0x4219f4[_0x6219('0x31')]!=='VIRTUAL'){var _0x5a2a33={};_0x5a2a33[_0x4219f4[_0x6219('0x2d')]]={'$like':'%'+_0x24a9d7[_0x6219('0x33')]['filter']+'%'};return _0x5a2a33;}})});}_0xf2aa2=_[_0x6219('0x40')]({},_0xf2aa2,_0x24a9d7['options']);var _0x17e9f5={'where':_0xf2aa2[_0x6219('0x41')]};return db[_0x6219('0x30')][_0x6219('0x22')](_0x17e9f5)[_0x6219('0x29')](function(_0x32b8c4){_0x20157e[_0x6219('0x22')]=_0x32b8c4;if(_0x24a9d7[_0x6219('0x33')][_0x6219('0x42')]){_0xf2aa2['include']=[{'all':!![]}];}return db[_0x6219('0x30')][_0x6219('0x43')](_0xf2aa2);})[_0x6219('0x29')](function(_0x10e856){_0x20157e[_0x6219('0x44')]=_0x10e856;return _0x20157e;})[_0x6219('0x29')](respondWithFilteredResult(_0x25dad0,_0xf2aa2))[_0x6219('0x45')](handleError(_0x25dad0,null));};exports[_0x6219('0x46')]=function(_0x395e75,_0x56cd95){var _0x5bd8e8={'raw':!![],'where':{'id':_0x395e75[_0x6219('0x47')]['id']}},_0x25ca88={};_0x25ca88[_0x6219('0x3a')]=_[_0x6219('0x34')](db[_0x6219('0x30')][_0x6219('0x48')]);_0x25ca88[_0x6219('0x33')]=_[_0x6219('0x34')](_0x395e75[_0x6219('0x33')]);_0x25ca88[_0x6219('0x35')]=_[_0x6219('0x36')](_0x25ca88[_0x6219('0x3a')],_0x25ca88['query']);_0x5bd8e8[_0x6219('0x38')]=_['intersection'](_0x25ca88[_0x6219('0x3a')],qs[_0x6219('0x37')](_0x395e75[_0x6219('0x33')][_0x6219('0x37')]));_0x5bd8e8['attributes']=_0x5bd8e8['attributes'][_0x6219('0x39')]?_0x5bd8e8[_0x6219('0x38')]:_0x25ca88[_0x6219('0x3a')];if(_0x395e75[_0x6219('0x33')][_0x6219('0x42')]){_0x5bd8e8['include']=[{'all':!![]}];}_0x5bd8e8=_['merge']({},_0x5bd8e8,_0x395e75[_0x6219('0x49')]);return db['ChatGroup'][_0x6219('0x4a')](_0x5bd8e8)[_0x6219('0x29')](handleEntityNotFound(_0x56cd95,null))[_0x6219('0x29')](respondWithResult(_0x56cd95,null))['catch'](handleError(_0x56cd95,null));};exports[_0x6219('0x4b')]=function(_0x52f804,_0x467c4b){return db[_0x6219('0x30')][_0x6219('0x4b')](_0x52f804[_0x6219('0x4c')],{})['then'](respondWithResult(_0x467c4b,0xc9))['catch'](handleError(_0x467c4b,null));};exports[_0x6219('0x28')]=function(_0x583e38,_0x5e10f4){if(_0x583e38[_0x6219('0x4c')]['id']){delete _0x583e38[_0x6219('0x4c')]['id'];}return db[_0x6219('0x30')][_0x6219('0x4a')]({'where':{'id':_0x583e38[_0x6219('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e10f4,null))[_0x6219('0x29')](saveUpdates(_0x583e38[_0x6219('0x4c')],null))[_0x6219('0x29')](respondWithResult(_0x5e10f4,null))[_0x6219('0x45')](handleError(_0x5e10f4,null));};exports[_0x6219('0x2a')]=function(_0x274cbd,_0x2f9db9){return db[_0x6219('0x30')][_0x6219('0x4a')]({'where':{'id':_0x274cbd[_0x6219('0x47')]['id']}})[_0x6219('0x29')](handleEntityNotFound(_0x2f9db9,null))[_0x6219('0x29')](removeEntity(_0x2f9db9,null))[_0x6219('0x45')](handleError(_0x2f9db9,null));};exports[_0x6219('0x4d')]=function(_0x5111a1,_0x33348c){return db['ChatGroup'][_0x6219('0x4d')]()[_0x6219('0x29')](respondWithResult(_0x33348c,null))[_0x6219('0x45')](handleError(_0x33348c,null));};exports[_0x6219('0x4e')]=function(_0x2ea7d5,_0x40b900,_0x40b43a){return db[_0x6219('0x4f')][_0x6219('0x22')]({'where':{'ChatGroupId':_0x2ea7d5['params']['id'],'ToId':_0x2ea7d5[_0x6219('0x50')]['id'],'read':![]}})[_0x6219('0x29')](function(_0x1eb3f0){return{'id':_[_0x6219('0x51')](_0x2ea7d5[_0x6219('0x47')]['id']),'count':_0x1eb3f0};})['then'](respondWithResult(_0x40b900,null))[_0x6219('0x45')](handleError(_0x40b900,null));};exports[_0x6219('0x52')]=function(_0x545695,_0x16e852,_0x57240f){return db[_0x6219('0x30')][_0x6219('0x4a')]({'where':{'id':_0x545695[_0x6219('0x47')]['id']}})['then'](handleEntityNotFound(_0x16e852,null))[_0x6219('0x29')](function(_0x231b2b){if(_0x231b2b){return _0x231b2b[_0x6219('0x52')](_0x545695[_0x6219('0x4c')][_0x6219('0x53')],_[_0x6219('0x54')](_0x545695['body'],[_0x6219('0x53'),'id'])||{});}})['then'](respondWithResult(_0x16e852,null))[_0x6219('0x45')](handleError(_0x16e852,null));};exports[_0x6219('0x55')]=function(_0x6c8703,_0x490e81,_0x196997){var _0x53e4c5={};var _0x22ffc0={};var _0x3448c4;var _0x9459bc;return db[_0x6219('0x30')]['findOne']({'where':{'id':_0x6c8703['params']['id']}})[_0x6219('0x29')](handleEntityNotFound(_0x490e81,null))[_0x6219('0x29')](function(_0x57e604){if(_0x57e604){_0x3448c4=_0x57e604;_0x22ffc0[_0x6219('0x3a')]=_[_0x6219('0x34')](db[_0x6219('0x56')][_0x6219('0x48')]);_0x22ffc0[_0x6219('0x33')]=_['keys'](_0x6c8703['query']);_0x22ffc0[_0x6219('0x35')]=_['intersection'](_0x22ffc0[_0x6219('0x3a')],_0x22ffc0[_0x6219('0x33')]);_0x53e4c5['attributes']=_[_0x6219('0x36')](_0x22ffc0[_0x6219('0x3a')],qs['fields'](_0x6c8703['query']['fields']));_0x53e4c5[_0x6219('0x38')]=_0x53e4c5['attributes'][_0x6219('0x39')]?_0x53e4c5[_0x6219('0x38')]:_0x22ffc0[_0x6219('0x3a')];_0x53e4c5['order']=qs['sort'](_0x6c8703['query']['sort']);_0x53e4c5['where']=qs[_0x6219('0x35')](_[_0x6219('0x3e')](_0x6c8703[_0x6219('0x33')],_0x22ffc0[_0x6219('0x35')]));if(_0x6c8703['query']['filter']){_0x53e4c5['where']=_[_0x6219('0x40')](_0x53e4c5[_0x6219('0x41')],{'$or':_[_0x6219('0x2f')](_0x53e4c5[_0x6219('0x38')],function(_0x5a539e){var _0x387cc7={};_0x387cc7[_0x5a539e]={'$like':'%'+_0x6c8703['query'][_0x6219('0x3f')]+'%'};return _0x387cc7;})});}_0x53e4c5=_[_0x6219('0x40')]({},_0x53e4c5,_0x6c8703['options']);return _0x3448c4[_0x6219('0x55')](_0x53e4c5);}})[_0x6219('0x29')](function(_0x50aa0d){if(_0x50aa0d){_0x9459bc=_0x50aa0d['length'];if(!_0x6c8703[_0x6219('0x33')][_0x6219('0x3b')](_0x6219('0x3c'))){_0x53e4c5['limit']=qs[_0x6219('0x21')](_0x6c8703[_0x6219('0x33')][_0x6219('0x21')]);_0x53e4c5['offset']=qs[_0x6219('0x1f')](_0x6c8703[_0x6219('0x33')][_0x6219('0x1f')]);}return _0x3448c4[_0x6219('0x55')](_0x53e4c5);}})[_0x6219('0x29')](function(_0x1832d9){if(_0x1832d9){return _0x1832d9?{'count':_0x9459bc,'rows':_0x1832d9}:null;}})[_0x6219('0x29')](respondWithResult(_0x490e81,null))[_0x6219('0x45')](handleError(_0x490e81,null));};exports['removeMembers']=function(_0x5d5dbb,_0x390144,_0x52a47d){return db['ChatGroup'][_0x6219('0x4a')]({'where':{'id':_0x5d5dbb[_0x6219('0x47')]['id']}})[_0x6219('0x29')](handleEntityNotFound(_0x390144,null))[_0x6219('0x29')](function(_0x5b2e35){if(_0x5b2e35){return _0x5b2e35[_0x6219('0x57')](_0x5d5dbb[_0x6219('0x33')]['ids']);}})[_0x6219('0x29')](respondWithStatusCode(_0x390144,null))[_0x6219('0x45')](handleError(_0x390144,null));};exports[_0x6219('0x58')]=function(_0x18861d,_0x525f64,_0x318211){if(_0x18861d['body']['id']){delete _0x18861d[_0x6219('0x4c')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x18861d[_0x6219('0x47')]['id']}})[_0x6219('0x29')](handleEntityNotFound(_0x525f64,null))[_0x6219('0x29')](function(_0x31244d){if(_0x31244d){_0x18861d[_0x6219('0x4c')]['ChatGroupId']=_0x31244d['id'];return db[_0x6219('0x4f')][_0x6219('0x4b')](_0x18861d[_0x6219('0x4c')]);}})['then'](respondWithResult(_0x525f64,null))[_0x6219('0x45')](handleError(_0x525f64,null));};exports[_0x6219('0x59')]=function(_0x24561d,_0x370032,_0x4d1c5d){var _0x35b668={};var _0xa90194={};var _0xf9c65e;var _0x53eaa5;return db[_0x6219('0x30')][_0x6219('0x5a')]({'where':{'id':_0x24561d[_0x6219('0x47')]['id']}})[_0x6219('0x29')](handleEntityNotFound(_0x370032,null))[_0x6219('0x29')](function(_0x4217f9){if(_0x4217f9){_0xf9c65e=_0x4217f9;_0xa90194['model']=_[_0x6219('0x34')](db[_0x6219('0x4f')][_0x6219('0x48')]);_0xa90194[_0x6219('0x33')]=_[_0x6219('0x34')](_0x24561d[_0x6219('0x33')]);_0xa90194['filters']=_['intersection'](_0xa90194[_0x6219('0x3a')],_0xa90194['query']);_0x35b668[_0x6219('0x38')]=_[_0x6219('0x36')](_0xa90194['model'],qs['fields'](_0x24561d['query']['fields']));_0x35b668['attributes']=_0x35b668[_0x6219('0x38')][_0x6219('0x39')]?_0x35b668['attributes']:_0xa90194[_0x6219('0x3a')];_0x35b668[_0x6219('0x5b')]=qs['sort'](_0x24561d['query'][_0x6219('0x3d')]);_0x35b668[_0x6219('0x41')]=qs[_0x6219('0x35')](_[_0x6219('0x3e')](_0x24561d[_0x6219('0x33')],_0xa90194['filters']));if(_0x24561d['query'][_0x6219('0x3f')]){_0x35b668[_0x6219('0x41')]=_[_0x6219('0x40')](_0x35b668[_0x6219('0x41')],{'$or':_[_0x6219('0x2f')](_0x35b668[_0x6219('0x38')],function(_0x238728){var _0x3beec5={};_0x3beec5[_0x238728]={'$like':'%'+_0x24561d[_0x6219('0x33')]['filter']+'%'};return _0x3beec5;})});}if(_0x24561d[_0x6219('0x33')][_0x6219('0x5c')]){var _0x1e86d4=_0x24561d['query'][_0x6219('0x5c')]['split'](',');var _0x125dd2={};_0x125dd2[_0x1e86d4[0x0]]={'$gte':moment(_0x1e86d4[0x1])[_0x6219('0x5d')](_0x6219('0x5e'))};_0x35b668[_0x6219('0x41')]=_[_0x6219('0x40')](_0x35b668[_0x6219('0x41')],_0x125dd2);}_0x35b668=_[_0x6219('0x40')]({},_0x35b668,_0x24561d[_0x6219('0x49')]);return _0xf9c65e[_0x6219('0x59')](_0x35b668);}})[_0x6219('0x29')](function(_0x37e18a){if(_0x37e18a){_0x53eaa5=_0x37e18a[_0x6219('0x39')];if(!_0x24561d[_0x6219('0x33')]['hasOwnProperty'](_0x6219('0x3c'))){_0x35b668[_0x6219('0x21')]=qs[_0x6219('0x21')](_0x24561d['query'][_0x6219('0x21')]);_0x35b668['offset']=qs[_0x6219('0x1f')](_0x24561d['query'][_0x6219('0x1f')]);}return _0xf9c65e[_0x6219('0x59')](_0x35b668);}})['then'](function(_0x3daef6){if(_0x3daef6){return _0x3daef6?{'count':_0x53eaa5,'rows':_0x3daef6}:null;}})[_0x6219('0x29')](respondWithResult(_0x370032,null))[_0x6219('0x45')](handleError(_0x370032,null));};
\ No newline at end of file
+var _0x27dd=['query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','ChatGroup','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','length','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x27dd,0x8d));var _0xd27d=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x27dd[_0x45783c];return _0x1161da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd27d('0x0'));var zipdir=require(_0xd27d('0x1'));var jsonpatch=require(_0xd27d('0x2'));var rp=require(_0xd27d('0x3'));var moment=require(_0xd27d('0x4'));var BPromise=require(_0xd27d('0x5'));var Mustache=require(_0xd27d('0x6'));var util=require(_0xd27d('0x7'));var path=require('path');var sox=require(_0xd27d('0x8'));var csv=require(_0xd27d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd27d('0xa'));var _=require('lodash');var squel=require(_0xd27d('0xb'));var crypto=require(_0xd27d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd27d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd27d('0xe'));var Redis=require(_0xd27d('0xf'));var authService=require(_0xd27d('0x10'));var qs=require(_0xd27d('0x11'));var as=require(_0xd27d('0x12'));var hardwareService=require(_0xd27d('0x13'));var logger=require('../../config/logger')(_0xd27d('0x14'));var utils=require('../../config/utils');var config=require(_0xd27d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd27d('0x16')]=_[_0xd27d('0x17')](config[_0xd27d('0x16')],{'host':_0xd27d('0x18'),'port':0x18eb});var socket=require(_0xd27d('0x19'))(new Redis(config[_0xd27d('0x16')]));require(_0xd27d('0x1a'))[_0xd27d('0x1b')](socket);function respondWithStatusCode(_0x135301,_0x140eb8){_0x140eb8=_0x140eb8||0xcc;return function(_0x1b11ea){if(_0x1b11ea){return _0x135301[_0xd27d('0x1c')](_0x140eb8);}return _0x135301['status'](_0x140eb8)[_0xd27d('0x1d')]();};}function respondWithResult(_0x5abe19,_0x3e6074){_0x3e6074=_0x3e6074||0xc8;return function(_0x59de4a){if(_0x59de4a){return _0x5abe19['status'](_0x3e6074)[_0xd27d('0x1e')](_0x59de4a);}};}function respondWithFilteredResult(_0x273655,_0x575878){return function(_0x499f30){if(_0x499f30){var _0x465aa6=typeof _0x575878[_0xd27d('0x1f')]===_0xd27d('0x20')&&typeof _0x575878[_0xd27d('0x21')]===_0xd27d('0x20');var _0x1d303f=_0x499f30[_0xd27d('0x22')];var _0x1de0dc=_0x465aa6?0x0:_0x575878[_0xd27d('0x1f')];var _0x29081b=_0x465aa6?_0x499f30['count']:_0x575878['offset']+_0x575878['limit'];var _0x95bc10;if(_0x29081b>=_0x1d303f){_0x29081b=_0x1d303f;_0x95bc10=0xc8;}else{_0x95bc10=0xce;}_0x273655[_0xd27d('0x23')](_0x95bc10);return _0x273655[_0xd27d('0x24')](_0xd27d('0x25'),_0x1de0dc+'-'+_0x29081b+'/'+_0x1d303f)[_0xd27d('0x1e')](_0x499f30);}return null;};}function patchUpdates(_0x351aee){return function(_0x39d9be){try{jsonpatch[_0xd27d('0x26')](_0x39d9be,_0x351aee,!![]);}catch(_0x225cec){return BPromise[_0xd27d('0x27')](_0x225cec);}return _0x39d9be[_0xd27d('0x28')]();};}function saveUpdates(_0x47bab0,_0x9ffd22){return function(_0x3d9494){if(_0x3d9494){return _0x3d9494[_0xd27d('0x29')](_0x47bab0)[_0xd27d('0x2a')](function(_0x57d6f2){return _0x57d6f2;});}return null;};}function removeEntity(_0x5e61bd,_0x586d6c){return function(_0xd3a3be){if(_0xd3a3be){return _0xd3a3be[_0xd27d('0x2b')]()['then'](function(){_0x5e61bd[_0xd27d('0x23')](0xcc)[_0xd27d('0x1d')]();});}};}function handleEntityNotFound(_0x151226,_0x366511){return function(_0x1dae81){if(!_0x1dae81){_0x151226['sendStatus'](0x194);}return _0x1dae81;};}function handleError(_0x2db729,_0x5c1c04){_0x5c1c04=_0x5c1c04||0x1f4;return function(_0x3bcddd){logger[_0xd27d('0x2c')](_0x3bcddd[_0xd27d('0x2d')]);if(_0x3bcddd[_0xd27d('0x2e')]){delete _0x3bcddd[_0xd27d('0x2e')];}_0x2db729[_0xd27d('0x23')](_0x5c1c04)[_0xd27d('0x2f')](_0x3bcddd);};}exports[_0xd27d('0x30')]=function(_0x95ba8a,_0x3b27d9){var _0x157fb6={},_0x413036={},_0x551787={'count':0x0,'rows':[]};var _0x466895=_['map'](db['ChatGroup'][_0xd27d('0x31')],function(_0x2e1f89){return{'name':_0x2e1f89[_0xd27d('0x32')],'type':_0x2e1f89[_0xd27d('0x33')][_0xd27d('0x34')]};});_0x413036[_0xd27d('0x35')]=_[_0xd27d('0x36')](_0x466895,_0xd27d('0x2e'));_0x413036[_0xd27d('0x37')]=_['keys'](_0x95ba8a[_0xd27d('0x37')]);_0x413036['filters']=_[_0xd27d('0x38')](_0x413036[_0xd27d('0x35')],_0x413036[_0xd27d('0x37')]);_0x157fb6[_0xd27d('0x39')]=_[_0xd27d('0x38')](_0x413036[_0xd27d('0x35')],qs[_0xd27d('0x3a')](_0x95ba8a[_0xd27d('0x37')]['fields']));_0x157fb6[_0xd27d('0x39')]=_0x157fb6[_0xd27d('0x39')]['length']?_0x157fb6['attributes']:_0x413036[_0xd27d('0x35')];if(!_0x95ba8a[_0xd27d('0x37')]['hasOwnProperty'](_0xd27d('0x3b'))){_0x157fb6['limit']=qs[_0xd27d('0x21')](_0x95ba8a[_0xd27d('0x37')]['limit']);_0x157fb6[_0xd27d('0x1f')]=qs[_0xd27d('0x1f')](_0x95ba8a['query'][_0xd27d('0x1f')]);}_0x157fb6[_0xd27d('0x3c')]=qs[_0xd27d('0x3d')](_0x95ba8a[_0xd27d('0x37')][_0xd27d('0x3d')]);_0x157fb6['where']=qs[_0xd27d('0x3e')](_[_0xd27d('0x3f')](_0x95ba8a[_0xd27d('0x37')],_0x413036[_0xd27d('0x3e')]),_0x466895);if(_0x95ba8a[_0xd27d('0x37')][_0xd27d('0x40')]){_0x157fb6[_0xd27d('0x41')]=_['merge'](_0x157fb6[_0xd27d('0x41')],{'$or':_['map'](_0x466895,function(_0x94f5ac){if(_0x94f5ac['type']!==_0xd27d('0x42')){var _0x12f96b={};_0x12f96b[_0x94f5ac[_0xd27d('0x2e')]]={'$like':'%'+_0x95ba8a[_0xd27d('0x37')][_0xd27d('0x40')]+'%'};return _0x12f96b;}})});}_0x157fb6=_[_0xd27d('0x43')]({},_0x157fb6,_0x95ba8a['options']);var _0x583b4c={'where':_0x157fb6[_0xd27d('0x41')]};return db[_0xd27d('0x44')]['count'](_0x583b4c)[_0xd27d('0x2a')](function(_0x15f144){_0x551787[_0xd27d('0x22')]=_0x15f144;if(_0x95ba8a['query'][_0xd27d('0x45')]){_0x157fb6[_0xd27d('0x46')]=[{'all':!![]}];}return db[_0xd27d('0x44')][_0xd27d('0x47')](_0x157fb6);})[_0xd27d('0x2a')](function(_0x5152b3){_0x551787[_0xd27d('0x48')]=_0x5152b3;return _0x551787;})[_0xd27d('0x2a')](respondWithFilteredResult(_0x3b27d9,_0x157fb6))['catch'](handleError(_0x3b27d9,null));};exports[_0xd27d('0x49')]=function(_0x114063,_0x1f9de8){var _0x1bb88c={'raw':!![],'where':{'id':_0x114063[_0xd27d('0x4a')]['id']}},_0x4905d8={};_0x4905d8[_0xd27d('0x35')]=_['keys'](db[_0xd27d('0x44')]['rawAttributes']);_0x4905d8['query']=_[_0xd27d('0x4b')](_0x114063[_0xd27d('0x37')]);_0x4905d8[_0xd27d('0x3e')]=_['intersection'](_0x4905d8[_0xd27d('0x35')],_0x4905d8[_0xd27d('0x37')]);_0x1bb88c[_0xd27d('0x39')]=_[_0xd27d('0x38')](_0x4905d8[_0xd27d('0x35')],qs['fields'](_0x114063[_0xd27d('0x37')][_0xd27d('0x3a')]));_0x1bb88c[_0xd27d('0x39')]=_0x1bb88c[_0xd27d('0x39')]['length']?_0x1bb88c[_0xd27d('0x39')]:_0x4905d8[_0xd27d('0x35')];if(_0x114063[_0xd27d('0x37')][_0xd27d('0x45')]){_0x1bb88c['include']=[{'all':!![]}];}_0x1bb88c=_[_0xd27d('0x43')]({},_0x1bb88c,_0x114063[_0xd27d('0x4c')]);return db['ChatGroup']['find'](_0x1bb88c)['then'](handleEntityNotFound(_0x1f9de8,null))[_0xd27d('0x2a')](respondWithResult(_0x1f9de8,null))[_0xd27d('0x4d')](handleError(_0x1f9de8,null));};exports['create']=function(_0x13476a,_0x1cfae9){return db[_0xd27d('0x44')][_0xd27d('0x4e')](_0x13476a['body'],{})['then'](respondWithResult(_0x1cfae9,0xc9))[_0xd27d('0x4d')](handleError(_0x1cfae9,null));};exports[_0xd27d('0x29')]=function(_0x5d70b3,_0x19d723){if(_0x5d70b3[_0xd27d('0x4f')]['id']){delete _0x5d70b3[_0xd27d('0x4f')]['id'];}return db[_0xd27d('0x44')][_0xd27d('0x50')]({'where':{'id':_0x5d70b3[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x19d723,null))[_0xd27d('0x2a')](saveUpdates(_0x5d70b3['body'],null))[_0xd27d('0x2a')](respondWithResult(_0x19d723,null))[_0xd27d('0x4d')](handleError(_0x19d723,null));};exports[_0xd27d('0x2b')]=function(_0x38e469,_0x42a59e){return db['ChatGroup'][_0xd27d('0x50')]({'where':{'id':_0x38e469[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x42a59e,null))['then'](removeEntity(_0x42a59e,null))['catch'](handleError(_0x42a59e,null));};exports['describe']=function(_0x52a03a,_0x50ab90){return db[_0xd27d('0x44')][_0xd27d('0x51')]()[_0xd27d('0x2a')](respondWithResult(_0x50ab90,null))[_0xd27d('0x4d')](handleError(_0x50ab90,null));};exports['getUnread']=function(_0x356af6,_0x439751,_0x140f88){return db[_0xd27d('0x52')]['count']({'where':{'ChatGroupId':_0x356af6[_0xd27d('0x4a')]['id'],'ToId':_0x356af6[_0xd27d('0x53')]['id'],'read':![]}})[_0xd27d('0x2a')](function(_0x594453){return{'id':_[_0xd27d('0x54')](_0x356af6[_0xd27d('0x4a')]['id']),'count':_0x594453};})[_0xd27d('0x2a')](respondWithResult(_0x439751,null))[_0xd27d('0x4d')](handleError(_0x439751,null));};exports[_0xd27d('0x55')]=function(_0xbd71c3,_0x287320,_0x567ee4){return db[_0xd27d('0x44')][_0xd27d('0x50')]({'where':{'id':_0xbd71c3['params']['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x287320,null))[_0xd27d('0x2a')](function(_0x1de5f0){if(_0x1de5f0){return _0x1de5f0['addMembers'](_0xbd71c3[_0xd27d('0x4f')][_0xd27d('0x56')],_[_0xd27d('0x57')](_0xbd71c3[_0xd27d('0x4f')],['ids','id'])||{});}})[_0xd27d('0x2a')](respondWithResult(_0x287320,null))[_0xd27d('0x4d')](handleError(_0x287320,null));};exports[_0xd27d('0x58')]=function(_0x2476c5,_0x41ecb4,_0x32c96e){var _0x52c573={};var _0x3fe97c={};var _0x2f69d7;var _0x1dad8f;return db['ChatGroup'][_0xd27d('0x59')]({'where':{'id':_0x2476c5[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x41ecb4,null))[_0xd27d('0x2a')](function(_0x59f7a2){if(_0x59f7a2){_0x2f69d7=_0x59f7a2;_0x3fe97c[_0xd27d('0x35')]=_[_0xd27d('0x4b')](db['User'][_0xd27d('0x31')]);_0x3fe97c['query']=_[_0xd27d('0x4b')](_0x2476c5['query']);_0x3fe97c[_0xd27d('0x3e')]=_['intersection'](_0x3fe97c[_0xd27d('0x35')],_0x3fe97c[_0xd27d('0x37')]);_0x52c573[_0xd27d('0x39')]=_['intersection'](_0x3fe97c[_0xd27d('0x35')],qs[_0xd27d('0x3a')](_0x2476c5[_0xd27d('0x37')][_0xd27d('0x3a')]));_0x52c573['attributes']=_0x52c573[_0xd27d('0x39')][_0xd27d('0x5a')]?_0x52c573[_0xd27d('0x39')]:_0x3fe97c[_0xd27d('0x35')];_0x52c573[_0xd27d('0x3c')]=qs[_0xd27d('0x3d')](_0x2476c5['query'][_0xd27d('0x3d')]);_0x52c573[_0xd27d('0x41')]=qs[_0xd27d('0x3e')](_[_0xd27d('0x3f')](_0x2476c5[_0xd27d('0x37')],_0x3fe97c[_0xd27d('0x3e')]));if(_0x2476c5[_0xd27d('0x37')][_0xd27d('0x40')]){_0x52c573[_0xd27d('0x41')]=_[_0xd27d('0x43')](_0x52c573[_0xd27d('0x41')],{'$or':_[_0xd27d('0x36')](_0x52c573['attributes'],function(_0xbc4a53){var _0x818232={};_0x818232[_0xbc4a53]={'$like':'%'+_0x2476c5['query'][_0xd27d('0x40')]+'%'};return _0x818232;})});}_0x52c573=_[_0xd27d('0x43')]({},_0x52c573,_0x2476c5[_0xd27d('0x4c')]);return _0x2f69d7[_0xd27d('0x58')](_0x52c573);}})[_0xd27d('0x2a')](function(_0x12e5a7){if(_0x12e5a7){_0x1dad8f=_0x12e5a7[_0xd27d('0x5a')];if(!_0x2476c5[_0xd27d('0x37')][_0xd27d('0x5b')](_0xd27d('0x3b'))){_0x52c573[_0xd27d('0x21')]=qs[_0xd27d('0x21')](_0x2476c5[_0xd27d('0x37')][_0xd27d('0x21')]);_0x52c573[_0xd27d('0x1f')]=qs[_0xd27d('0x1f')](_0x2476c5['query'][_0xd27d('0x1f')]);}return _0x2f69d7[_0xd27d('0x58')](_0x52c573);}})['then'](function(_0x479199){if(_0x479199){return _0x479199?{'count':_0x1dad8f,'rows':_0x479199}:null;}})[_0xd27d('0x2a')](respondWithResult(_0x41ecb4,null))[_0xd27d('0x4d')](handleError(_0x41ecb4,null));};exports[_0xd27d('0x5c')]=function(_0x1e48ae,_0x237d5a,_0x4c9ed1){return db[_0xd27d('0x44')]['find']({'where':{'id':_0x1e48ae['params']['id']}})['then'](handleEntityNotFound(_0x237d5a,null))['then'](function(_0x25e1d1){if(_0x25e1d1){return _0x25e1d1[_0xd27d('0x5c')](_0x1e48ae[_0xd27d('0x37')][_0xd27d('0x56')]);}})[_0xd27d('0x2a')](respondWithStatusCode(_0x237d5a,null))[_0xd27d('0x4d')](handleError(_0x237d5a,null));};exports[_0xd27d('0x5d')]=function(_0x4eeb5d,_0x1b697e,_0x270183){if(_0x4eeb5d['body']['id']){delete _0x4eeb5d['body']['id'];}return db['ChatGroup'][_0xd27d('0x50')]({'where':{'id':_0x4eeb5d[_0xd27d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b697e,null))['then'](function(_0x47cd8c){if(_0x47cd8c){_0x4eeb5d[_0xd27d('0x4f')][_0xd27d('0x5e')]=_0x47cd8c['id'];return db[_0xd27d('0x52')][_0xd27d('0x4e')](_0x4eeb5d['body']);}})[_0xd27d('0x2a')](respondWithResult(_0x1b697e,null))[_0xd27d('0x4d')](handleError(_0x1b697e,null));};exports[_0xd27d('0x5f')]=function(_0x49e18f,_0x27e4c3,_0x2cf0a7){var _0x848df0={};var _0x560d6d={};var _0x4f869f;var _0x4eb88b;return db[_0xd27d('0x44')]['findOne']({'where':{'id':_0x49e18f[_0xd27d('0x4a')]['id']}})[_0xd27d('0x2a')](handleEntityNotFound(_0x27e4c3,null))[_0xd27d('0x2a')](function(_0x9f2a18){if(_0x9f2a18){_0x4f869f=_0x9f2a18;_0x560d6d[_0xd27d('0x35')]=_[_0xd27d('0x4b')](db['ChatInternalMessage'][_0xd27d('0x31')]);_0x560d6d[_0xd27d('0x37')]=_[_0xd27d('0x4b')](_0x49e18f[_0xd27d('0x37')]);_0x560d6d[_0xd27d('0x3e')]=_[_0xd27d('0x38')](_0x560d6d['model'],_0x560d6d['query']);_0x848df0[_0xd27d('0x39')]=_[_0xd27d('0x38')](_0x560d6d[_0xd27d('0x35')],qs[_0xd27d('0x3a')](_0x49e18f[_0xd27d('0x37')][_0xd27d('0x3a')]));_0x848df0['attributes']=_0x848df0['attributes'][_0xd27d('0x5a')]?_0x848df0[_0xd27d('0x39')]:_0x560d6d[_0xd27d('0x35')];_0x848df0[_0xd27d('0x3c')]=qs[_0xd27d('0x3d')](_0x49e18f[_0xd27d('0x37')][_0xd27d('0x3d')]);_0x848df0[_0xd27d('0x41')]=qs[_0xd27d('0x3e')](_[_0xd27d('0x3f')](_0x49e18f[_0xd27d('0x37')],_0x560d6d['filters']));if(_0x49e18f['query'][_0xd27d('0x40')]){_0x848df0['where']=_[_0xd27d('0x43')](_0x848df0['where'],{'$or':_[_0xd27d('0x36')](_0x848df0[_0xd27d('0x39')],function(_0x46f53a){var _0x1a4077={};_0x1a4077[_0x46f53a]={'$like':'%'+_0x49e18f['query']['filter']+'%'};return _0x1a4077;})});}if(_0x49e18f['query']['$gte']){var _0x40ee69=_0x49e18f['query']['$gte'][_0xd27d('0x60')](',');var _0xf736ec={};_0xf736ec[_0x40ee69[0x0]]={'$gte':moment(_0x40ee69[0x1])['format'](_0xd27d('0x61'))};_0x848df0[_0xd27d('0x41')]=_[_0xd27d('0x43')](_0x848df0['where'],_0xf736ec);}_0x848df0=_[_0xd27d('0x43')]({},_0x848df0,_0x49e18f[_0xd27d('0x4c')]);return _0x4f869f[_0xd27d('0x5f')](_0x848df0);}})['then'](function(_0x52de3f){if(_0x52de3f){_0x4eb88b=_0x52de3f[_0xd27d('0x5a')];if(!_0x49e18f[_0xd27d('0x37')][_0xd27d('0x5b')](_0xd27d('0x3b'))){_0x848df0[_0xd27d('0x21')]=qs[_0xd27d('0x21')](_0x49e18f[_0xd27d('0x37')]['limit']);_0x848df0[_0xd27d('0x1f')]=qs[_0xd27d('0x1f')](_0x49e18f[_0xd27d('0x37')][_0xd27d('0x1f')]);}return _0x4f869f['getMessages'](_0x848df0);}})[_0xd27d('0x2a')](function(_0x1058aa){if(_0x1058aa){return _0x1058aa?{'count':_0x4eb88b,'rows':_0x1058aa}:null;}})['then'](respondWithResult(_0x27e4c3,null))[_0xd27d('0x4d')](handleError(_0x27e4c3,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a21378c..7967ea2 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 _0x99e7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup'];(function(_0x37904b,_0x3bd1f3){var _0x2bc6e5=function(_0xadc0dc){while(--_0xadc0dc){_0x37904b['push'](_0x37904b['shift']());}};_0x2bc6e5(++_0x3bd1f3);}(_0x99e7,0x1b5));var _0x799e=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x99e7[_0x359bbe];return _0x1b3353;};'use strict';var EventEmitter=require(_0x799e('0x0'));var ChatGroup=require(_0x799e('0x1'))['db'][_0x799e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x799e('0x3')](0x0);var events={'afterCreate':_0x799e('0x4'),'afterUpdate':_0x799e('0x5'),'afterDestroy':_0x799e('0x6')};function emitEvent(_0x2f2c31){return function(_0x28a499,_0x59fd40,_0x5600e0){ChatGroupEvents[_0x799e('0x7')](_0x2f2c31+':'+_0x28a499['id'],_0x28a499);ChatGroupEvents['emit'](_0x2f2c31,_0x28a499);_0x5600e0(null);};}for(var e in events){if(events[_0x799e('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x799e('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf198=['setMaxListeners','save','update','emit','hook','exports','../../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf198,0xd1));var _0x8f19=function(_0x499da2,_0x6f2789){_0x499da2=_0x499da2-0x0;var _0x5efb1f=_0xf198[_0x499da2];return _0x5efb1f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8f19('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8f19('0x1')](0x0);var events={'afterCreate':_0x8f19('0x2'),'afterUpdate':_0x8f19('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4226fd){return function(_0x390135,_0x3a7997,_0x3d85ab){ChatGroupEvents[_0x8f19('0x4')](_0x4226fd+':'+_0x390135['id'],_0x390135);ChatGroupEvents[_0x8f19('0x4')](_0x4226fd,_0x390135);_0x3d85ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x8f19('0x5')](e,emitEvent(event));}}module[_0x8f19('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 ea836c5..08f2679 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 _0x63d0=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','../../config/logger','moment','request-promise','path'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x63d0,0x196));var _0x063d=function(_0x1b7236,_0x5de39d){_0x1b7236=_0x1b7236-0x0;var _0x34d6cb=_0x63d0[_0x1b7236];return _0x34d6cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x063d('0x0'))('api');var moment=require(_0x063d('0x1'));var BPromise=require('bluebird');var rp=require(_0x063d('0x2'));var fs=require('fs');var path=require(_0x063d('0x3'));var rimraf=require(_0x063d('0x4'));var config=require(_0x063d('0x5'));var attributes=require(_0x063d('0x6'));module[_0x063d('0x7')]=function(_0x4d2440,_0x499c70){return _0x4d2440[_0x063d('0x8')]('ChatGroup',attributes,{'tableName':_0x063d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76a1=['exports','ChatGroup','api','request-promise','../../config/environment'];(function(_0x3d571f,_0x5ac9d0){var _0x3b3d4f=function(_0x334403){while(--_0x334403){_0x3d571f['push'](_0x3d571f['shift']());}};_0x3b3d4f(++_0x5ac9d0);}(_0x76a1,0x142));var _0x176a=function(_0x2b4bd1,_0x4e9f04){_0x2b4bd1=_0x2b4bd1-0x0;var _0x1e7352=_0x76a1[_0x2b4bd1];return _0x1e7352;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x176a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x176a('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x176a('0x2'));var attributes=require('./chatGroup.attributes');module[_0x176a('0x3')]=function(_0x44c8d1,_0x7f7014){return _0x44c8d1['define'](_0x176a('0x4'),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 dcbef9a..22d7ec6 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 _0x1e14=['code','ChatGroup,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x401701,_0x149dce){var _0x3da178=function(_0x48b110){while(--_0x48b110){_0x401701['push'](_0x401701['shift']());}};_0x3da178(++_0x149dce);}(_0x1e14,0xef));var _0x41e1=function(_0xb35322,_0x57f126){_0xb35322=_0xb35322-0x0;var _0x16c002=_0x1e14[_0xb35322];return _0x16c002;};'use strict';var _=require(_0x41e1('0x0'));var util=require(_0x41e1('0x1'));var moment=require(_0x41e1('0x2'));var BPromise=require(_0x41e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x41e1('0x4'));var logger=require('../../config/logger')(_0x41e1('0x5'));var config=require(_0x41e1('0x6'));var jayson=require(_0x41e1('0x7'));var client=jayson[_0x41e1('0x8')][_0x41e1('0x9')]({'port':0x232a});config[_0x41e1('0xa')]=_[_0x41e1('0xb')](config[_0x41e1('0xa')],{'host':_0x41e1('0xc'),'port':0x18eb});var socket=require(_0x41e1('0xd'))(new Redis(config[_0x41e1('0xa')]));require(_0x41e1('0xe'))[_0x41e1('0xf')](socket);function respondWithRpcPromise(_0x5abe3c,_0x205b4a,_0x3abb63){return new BPromise(function(_0x33db39,_0xaefd72){return client[_0x41e1('0x10')](_0x5abe3c,_0x3abb63)['then'](function(_0x58eb59){logger['info']('ChatGroup,\x20%s,\x20%s',_0x205b4a,_0x41e1('0x11'));logger['debug'](_0x41e1('0x12'),_0x205b4a,'request\x20sent',JSON[_0x41e1('0x13')](_0x58eb59));if(_0x58eb59[_0x41e1('0x14')]){if(_0x58eb59['error'][_0x41e1('0x15')]===0x1f4){logger[_0x41e1('0x14')](_0x41e1('0x16'),_0x205b4a,_0x58eb59['error']['message']);return _0xaefd72(_0x58eb59[_0x41e1('0x14')]['message']);}logger[_0x41e1('0x14')](_0x41e1('0x16'),_0x205b4a,_0x58eb59['error']['message']);return _0x33db39(_0x58eb59[_0x41e1('0x14')][_0x41e1('0x17')]);}else{logger[_0x41e1('0x18')](_0x41e1('0x16'),_0x205b4a,_0x41e1('0x11'));_0x33db39(_0x58eb59[_0x41e1('0x19')]['message']);}})['catch'](function(_0x9da56){logger[_0x41e1('0x14')](_0x41e1('0x16'),_0x205b4a,_0x9da56);_0xaefd72(_0x9da56);});});}
\ No newline at end of file
+var _0xd1f9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatGroup,\x20%s,\x20%s','message','moment','bluebird','randomstring','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd1f9,0x88));var _0x9d1f=function(_0x1b08d4,_0x8a710c){_0x1b08d4=_0x1b08d4-0x0;var _0x9aef3e=_0xd1f9[_0x1b08d4];return _0x9aef3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d1f('0x0'));var BPromise=require(_0x9d1f('0x1'));var rs=require(_0x9d1f('0x2'));var fs=require('fs');var Redis=require(_0x9d1f('0x3'));var db=require(_0x9d1f('0x4'))['db'];var utils=require(_0x9d1f('0x5'));var logger=require(_0x9d1f('0x6'))(_0x9d1f('0x7'));var config=require(_0x9d1f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d1f('0x9')][_0x9d1f('0xa')]({'port':0x232a});config[_0x9d1f('0xb')]=_[_0x9d1f('0xc')](config[_0x9d1f('0xb')],{'host':_0x9d1f('0xd'),'port':0x18eb});var socket=require(_0x9d1f('0xe'))(new Redis(config[_0x9d1f('0xb')]));require(_0x9d1f('0xf'))[_0x9d1f('0x10')](socket);function respondWithRpcPromise(_0x153ef3,_0x1d960c,_0x1c5446){return new BPromise(function(_0x27480b,_0x34e67a){return client[_0x9d1f('0x11')](_0x153ef3,_0x1c5446)[_0x9d1f('0x12')](function(_0x1dcf5f){logger[_0x9d1f('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1d960c,_0x9d1f('0x14'));logger[_0x9d1f('0x15')](_0x9d1f('0x16'),_0x1d960c,'request\x20sent',JSON[_0x9d1f('0x17')](_0x1dcf5f));if(_0x1dcf5f['error']){if(_0x1dcf5f['error'][_0x9d1f('0x18')]===0x1f4){logger[_0x9d1f('0x19')](_0x9d1f('0x1a'),_0x1d960c,_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);return _0x34e67a(_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);}logger[_0x9d1f('0x19')](_0x9d1f('0x1a'),_0x1d960c,_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);return _0x27480b(_0x1dcf5f[_0x9d1f('0x19')][_0x9d1f('0x1b')]);}else{logger['info'](_0x9d1f('0x1a'),_0x1d960c,_0x9d1f('0x14'));_0x27480b(_0x1dcf5f['result'][_0x9d1f('0x1b')]);}})['catch'](function(_0x4ab476){logger['error'](_0x9d1f('0x1a'),_0x1d960c,_0x4ab476);_0x34e67a(_0x4ab476);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 2f2b2d9..68485c5 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 _0x7118=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7118,0x7b));var _0x8711=function(_0x185949,_0x1d89ff){_0x185949=_0x185949-0x0;var _0x4b337a=_0x7118[_0x185949];return _0x4b337a;};'use strict';var ChatGroupEvents=require(_0x8711('0x0'));var events=[_0x8711('0x1'),_0x8711('0x2'),_0x8711('0x3')];function createListener(_0x2a7ea0,_0x50681a){return function(_0x5e645c){_0x50681a[_0x8711('0x4')](_0x2a7ea0,_0x5e645c);};}function removeListener(_0x3da295,_0x1e6583){return function(){ChatGroupEvents[_0x8711('0x5')](_0x3da295,_0x1e6583);};}exports['register']=function(_0x1c1f76){for(var _0x3841ee=0x0,_0x1d34a0=events[_0x8711('0x6')];_0x3841ee<_0x1d34a0;_0x3841ee++){var _0x555019=events[_0x3841ee];var _0x5c55df=createListener(_0x8711('0x7')+_0x555019,_0x1c1f76);ChatGroupEvents['on'](_0x555019,_0x5c55df);}};
\ No newline at end of file
+var _0x1aee=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x35640f,_0x3351bb){var _0x508de1=function(_0x4efcbf){while(--_0x4efcbf){_0x35640f['push'](_0x35640f['shift']());}};_0x508de1(++_0x3351bb);}(_0x1aee,0x84));var _0xe1ae=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0x1aee[_0x533528];return _0x3189f1;};'use strict';var ChatGroupEvents=require(_0xe1ae('0x0'));var events=[_0xe1ae('0x1'),_0xe1ae('0x2'),_0xe1ae('0x3')];function createListener(_0x545742,_0x49ed90){return function(_0x273b1f){_0x49ed90[_0xe1ae('0x4')](_0x545742,_0x273b1f);};}function removeListener(_0x3f74da,_0xc57bc){return function(){ChatGroupEvents[_0xe1ae('0x5')](_0x3f74da,_0xc57bc);};}exports['register']=function(_0x3a65cc){for(var _0x3543d7=0x0,_0x1f850c=events[_0xe1ae('0x6')];_0x3543d7<_0x1f850c;_0x3543d7++){var _0x597fc5=events[_0x3543d7];var _0xf42a93=createListener(_0xe1ae('0x7')+_0x597fc5,_0x3a65cc);ChatGroupEvents['on'](_0x597fc5,_0xf42a93);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index b348df6..91c8f5e 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 _0xa78d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xa78d,0xe3));var _0xda78=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xa78d[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0xda78('0x0'));var util=require(_0xda78('0x1'));var path=require(_0xda78('0x2'));var timeout=require(_0xda78('0x3'));var express=require(_0xda78('0x4'));var router=express[_0xda78('0x5')]();var fs_extra=require(_0xda78('0x6'));var auth=require(_0xda78('0x7'));var interaction=require(_0xda78('0x8'));var config=require(_0xda78('0x9'));var controller=require(_0xda78('0xa'));router[_0xda78('0xb')]('/',auth[_0xda78('0xc')](),controller[_0xda78('0xd')]);router[_0xda78('0xb')](_0xda78('0xe'),auth[_0xda78('0xc')](),controller[_0xda78('0xf')]);router[_0xda78('0xb')](_0xda78('0x10'),auth['isAuthenticated'](),controller[_0xda78('0x11')]);router['get'](_0xda78('0x12'),auth[_0xda78('0xc')](),controller[_0xda78('0x13')]);router[_0xda78('0xb')](_0xda78('0x14'),auth[_0xda78('0xc')](),controller[_0xda78('0x15')]);router[_0xda78('0xb')](_0xda78('0x16'),auth[_0xda78('0xc')](),controller[_0xda78('0x17')]);router['post']('/',auth[_0xda78('0xc')](),controller[_0xda78('0x18')]);router[_0xda78('0x19')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router['post'](_0xda78('0x16'),auth['isAuthenticated'](),controller[_0xda78('0x1a')]);router[_0xda78('0x1b')]('/:id',auth[_0xda78('0xc')](),controller[_0xda78('0x1c')]);router[_0xda78('0x1d')](_0xda78('0x10'),auth[_0xda78('0xc')](),controller[_0xda78('0x1e')]);router[_0xda78('0x1d')](_0xda78('0x14'),auth[_0xda78('0xc')](),controller[_0xda78('0x1f')]);module[_0xda78('0x20')]=router;
\ No newline at end of file
+var _0x22e1=['/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put','update','delete','removeMembers','exports','multer','util','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread'];(function(_0x368d89,_0x47556e){var _0x16a007=function(_0x3ffffb){while(--_0x3ffffb){_0x368d89['push'](_0x368d89['shift']());}};_0x16a007(++_0x47556e);}(_0x22e1,0x1c6));var _0x122e=function(_0x401ad6,_0x392d17){_0x401ad6=_0x401ad6-0x0;var _0x159ef3=_0x22e1[_0x401ad6];return _0x159ef3;};'use strict';var multer=require(_0x122e('0x0'));var util=require(_0x122e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x122e('0x2'));var router=express[_0x122e('0x3')]();var fs_extra=require(_0x122e('0x4'));var auth=require(_0x122e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x122e('0x6'));router[_0x122e('0x7')]('/',auth[_0x122e('0x8')](),controller[_0x122e('0x9')]);router[_0x122e('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x122e('0xa')]);router[_0x122e('0x7')](_0x122e('0xb'),auth['isAuthenticated'](),controller[_0x122e('0xc')]);router[_0x122e('0x7')](_0x122e('0xd'),auth['isAuthenticated'](),controller['getUnread']);router[_0x122e('0x7')](_0x122e('0xe'),auth['isAuthenticated'](),controller[_0x122e('0xf')]);router[_0x122e('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x122e('0x10')]);router[_0x122e('0x11')]('/',auth[_0x122e('0x8')](),controller[_0x122e('0x12')]);router[_0x122e('0x11')](_0x122e('0xe'),auth['isAuthenticated'](),controller['addMembers']);router[_0x122e('0x11')](_0x122e('0x13'),auth[_0x122e('0x8')](),controller[_0x122e('0x14')]);router[_0x122e('0x15')](_0x122e('0xb'),auth['isAuthenticated'](),controller[_0x122e('0x16')]);router[_0x122e('0x17')](_0x122e('0xb'),auth[_0x122e('0x8')](),controller['destroy']);router[_0x122e('0x17')]('/:id/members',auth['isAuthenticated'](),controller[_0x122e('0x18')]);module[_0x122e('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 ad1f5f5..f804ba0 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14b7=['TEXT','STRING','long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0xfeb486,_0x283204){var _0x2ceb84=function(_0xdb2bf){while(--_0xdb2bf){_0xfeb486['push'](_0xfeb486['shift']());}};_0x2ceb84(++_0x283204);}(_0x14b7,0x144));var _0x714b=function(_0x5bad8f,_0x3a51ef){_0x5bad8f=_0x5bad8f-0x0;var _0x2f643a=_0x14b7[_0x5bad8f];return _0x2f643a;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'closed':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x714b('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x714b('0x4'),_0x714b('0x5')),'defaultValue':_0x714b('0x4')},'ratingMessage':{'type':Sequelize[_0x714b('0x6')]},'pathTranscript':{'type':Sequelize[_0x714b('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x714b('0x7')]},'secondDisposition':{'type':Sequelize[_0x714b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x714b('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x714b('0x7')]},'browserVersion':{'type':Sequelize[_0x714b('0x7')]},'osName':{'type':Sequelize[_0x714b('0x7')]},'osVersion':{'type':Sequelize[_0x714b('0x7')]},'deviceModel':{'type':Sequelize[_0x714b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x714b('0x7')]},'referer':{'type':Sequelize[_0x714b('0x6')]},'customerIp':{'type':Sequelize[_0x714b('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x714b('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x714b('0x9')]('in',_0x714b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x714b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x714b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x714b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6215=['out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','long','DATE'];(function(_0x162552,_0x3c93d7){var _0x59bf76=function(_0x68c61d){while(--_0x68c61d){_0x162552['push'](_0x162552['shift']());}};_0x59bf76(++_0x3c93d7);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'closed':{'type':Sequelize[_0x5621('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x5621('0x3')](_0x5621('0x4'),_0x5621('0x5')),'defaultValue':_0x5621('0x4')},'ratingMessage':{'type':Sequelize[_0x5621('0x6')]},'pathTranscript':{'type':Sequelize[_0x5621('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5621('0x7')]},'note':{'type':Sequelize[_0x5621('0x7')]},'browserName':{'type':Sequelize[_0x5621('0x7')]},'browserVersion':{'type':Sequelize[_0x5621('0x7')]},'osName':{'type':Sequelize[_0x5621('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x5621('0x7')]},'deviceVendor':{'type':Sequelize[_0x5621('0x7')]},'deviceType':{'type':Sequelize[_0x5621('0x7')]},'referer':{'type':Sequelize[_0x5621('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5621('0x6')](_0x5621('0x8'))},'read1stAt':{'type':Sequelize[_0x5621('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5621('0x3')]('in',_0x5621('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5621('0x7')]},'customerPort':{'type':Sequelize[_0x5621('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x5621('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x5621('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 61a03ad..be728ff 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 _0xda55=['fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','AbandonInteraction','file','basename','filename','Attachment','attachmentDownload','Unauthorized','join','root','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','CmContact','%s%d','agentAlias','customer','Visitor','website_alias','agent_alias','System','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','sort','filter','merge','include','findAll','rows','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','views','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','ejs','squel','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','offset','undefined','count','limit','Content-Range','destroy','then','stack','name','send','render','body','contact','agent','interaction','account','Users','map','TagIds','split','forEach','Tags','push','waiting','unmanaged','abandoned','total','closed','UserId','talking','disposition','answered','index','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','keyBy','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooMetadata'];(function(_0x39b21d,_0x1baef9){var _0x73b4dc=function(_0x34a737){while(--_0x34a737){_0x39b21d['push'](_0x39b21d['shift']());}};_0x73b4dc(++_0x1baef9);}(_0xda55,0x6d));var _0x5da5=function(_0xdbcb8b,_0x10a202){_0xdbcb8b=_0xdbcb8b-0x0;var _0x557287=_0xda55[_0xdbcb8b];return _0x557287;};'use strict';var rimraf=require(_0x5da5('0x0'));var zipdir=require(_0x5da5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5da5('0x2'));var Mustache=require(_0x5da5('0x3'));var util=require(_0x5da5('0x4'));var path=require(_0x5da5('0x5'));var ejs=require(_0x5da5('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5da5('0x7'));var Redis=require('ioredis');var qs=require(_0x5da5('0x8'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x5da5('0x9'));var logger=require(_0x5da5('0xa'))(_0x5da5('0xb'));var config=require(_0x5da5('0xc'));var db=require(_0x5da5('0xd'))['db'];config[_0x5da5('0xe')]=_[_0x5da5('0xf')](config[_0x5da5('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5da5('0x10'))(new Redis(config[_0x5da5('0xe')]));require(_0x5da5('0x11'))[_0x5da5('0x12')](socket);var jayson=require(_0x5da5('0x13'));var client=jayson[_0x5da5('0x14')][_0x5da5('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x5da5('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x3b5ff9,_0x4f813b,_0x37aeb0,_0x31366e){return new BPromise(function(_0x3ced00,_0x43d526){var _0x1877d4=_0x31366e||client;return _0x1877d4[_0x5da5('0x16')](_0x3b5ff9,_0x37aeb0)['then'](function(_0x489b60){logger['info'](_0x5da5('0x17'),_0x4f813b,_0x5da5('0x18'));logger[_0x5da5('0x19')](_0x5da5('0x1a'),_0x4f813b,_0x5da5('0x18'),JSON[_0x5da5('0x1b')](_0x489b60));if(_0x489b60[_0x5da5('0x1c')]){if(_0x489b60['error'][_0x5da5('0x1d')]===0x1f4){logger[_0x5da5('0x1c')](_0x5da5('0x17'),_0x4f813b,_0x489b60[_0x5da5('0x1c')][_0x5da5('0x1e')]);return _0x43d526(_0x489b60[_0x5da5('0x1c')]['message']);}logger[_0x5da5('0x1c')](_0x5da5('0x17'),_0x4f813b,_0x489b60[_0x5da5('0x1c')][_0x5da5('0x1e')]);return _0x3ced00(_0x489b60[_0x5da5('0x1c')]['message']);}else{logger[_0x5da5('0x1f')](_0x5da5('0x17'),_0x4f813b,_0x5da5('0x18'));_0x3ced00(_0x489b60['result'][_0x5da5('0x1e')]);}})[_0x5da5('0x20')](function(_0x20c8a6){logger[_0x5da5('0x1c')](_0x5da5('0x17'),_0x4f813b,_0x20c8a6);_0x43d526(_0x20c8a6);});});}function respondWithStatusCode(_0x436960,_0x47d4e8){_0x47d4e8=_0x47d4e8||0xcc;return function(_0x1a6bd7){if(_0x1a6bd7){return _0x436960['sendStatus'](_0x47d4e8);}return _0x436960[_0x5da5('0x21')](_0x47d4e8)[_0x5da5('0x22')]();};}function respondWithResult(_0x2dd138,_0x5d983c){_0x5d983c=_0x5d983c||0xc8;return function(_0x31c6ed){if(_0x31c6ed){return _0x2dd138[_0x5da5('0x21')](_0x5d983c)[_0x5da5('0x23')](_0x31c6ed);}};}function respondWithFilteredResult(_0x21e795,_0x55d517){return function(_0x5b0b43){if(_0x5b0b43){var _0x50aadc=typeof _0x55d517[_0x5da5('0x24')]==='undefined'&&typeof _0x55d517['limit']===_0x5da5('0x25');var _0x3974d8=_0x5b0b43['count'];var _0x1798ae=_0x50aadc?0x0:_0x55d517[_0x5da5('0x24')];var _0x558b12=_0x50aadc?_0x5b0b43[_0x5da5('0x26')]:_0x55d517[_0x5da5('0x24')]+_0x55d517[_0x5da5('0x27')];var _0x42292d;if(_0x558b12>=_0x3974d8){_0x558b12=_0x3974d8;_0x42292d=0xc8;}else{_0x42292d=0xce;}_0x21e795[_0x5da5('0x21')](_0x42292d);return _0x21e795['set'](_0x5da5('0x28'),_0x1798ae+'-'+_0x558b12+'/'+_0x3974d8)[_0x5da5('0x23')](_0x5b0b43);}return null;};}function saveUpdates(_0x31cb5f){return function(_0x15a0c0){if(_0x15a0c0){return _0x15a0c0['update'](_0x31cb5f)['then'](function(_0x4cb022){return _0x4cb022;});}return null;};}function removeEntity(_0x245273){return function(_0x27ed41){if(_0x27ed41){return _0x27ed41[_0x5da5('0x29')]()[_0x5da5('0x2a')](function(){_0x245273['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e115){return function(_0x4afb58){if(!_0x4afb58){_0x24e115['sendStatus'](0x194);}return _0x4afb58;};}function handleError(_0x2dd4b6,_0x4c6cce){_0x4c6cce=_0x4c6cce||0x1f4;return function(_0x42dc92){logger[_0x5da5('0x1c')](_0x42dc92[_0x5da5('0x2b')]);if(_0x42dc92[_0x5da5('0x2c')]){delete _0x42dc92[_0x5da5('0x2c')];}_0x2dd4b6[_0x5da5('0x21')](_0x4c6cce)[_0x5da5('0x2d')](_0x42dc92);};}function getMustacheRender(_0x3dc66a,_0x52ce3c){return Mustache[_0x5da5('0x2e')](_0x3dc66a,_['merge'](_0x52ce3c[_0x5da5('0x2f')],{'contact':_0x52ce3c[_0x5da5('0x30')],'message':_0x52ce3c[_0x5da5('0x1e')],'agent':_0x52ce3c[_0x5da5('0x31')],'interaction':_0x52ce3c[_0x5da5('0x32')],'account':_0x52ce3c[_0x5da5('0x33')]}))||'';}function getInteractionUsers(_0x325ccd,_0x117610){return new BPromise(function(_0xf6c5c9,_0x1828e9){try{if(_0x117610[_0x325ccd['id']]){_0x325ccd[_0x5da5('0x34')]=_[_0x5da5('0x35')](_0x117610[_0x325ccd['id']],function(_0x3ba804){return{'id':_0x3ba804['id'],'fullname':_0x3ba804['fullname']};});}}catch(_0x43686c){_0x1828e9(_0x43686c);}_0xf6c5c9(_0x325ccd);});}function getInteractionTags(_0x4cf3ad,_0x2d6280){return new BPromise(function(_0x40f6c6,_0x29d6aa){try{if(_0x4cf3ad[_0x5da5('0x36')]){_0x4cf3ad['Tags']=[];_0x4cf3ad[_0x5da5('0x36')][_0x5da5('0x37')](',')[_0x5da5('0x38')](function(_0x56fd57){_0x4cf3ad[_0x5da5('0x39')][_0x5da5('0x3a')](_0x2d6280[_0x56fd57]);});}delete _0x4cf3ad['TagIds'];}catch(_0x18d00b){_0x29d6aa(_0x18d00b);}_0x40f6c6(_0x4cf3ad);});}function updateChatInteraction(_0xa90d5,_0xe9888e,_0x38a974){return new BPromise(function(_0x2c9b00,_0x664a8d){return getInteractionUsers(_0xa90d5,_0x38a974)['then'](function(_0x1ab02){return getInteractionTags(_0x1ab02,_0xe9888e);})[_0x5da5('0x2a')](function(_0x14c3f5){return getStateInteraction(_0x14c3f5);})[_0x5da5('0x2a')](function(_0x4466b2){_0x2c9b00(_0x4466b2);})['catch'](function(_0x472e9f){_0x664a8d(_0x472e9f);});});}function getStateInteraction(_0x21ffa1){return new BPromise(function(_0x5a189e){_0x21ffa1[_0x5da5('0x3b')]=0x0;_0x21ffa1['talking']=0x0;_0x21ffa1['answered']=0x0;_0x21ffa1[_0x5da5('0x3c')]=0x0;_0x21ffa1[_0x5da5('0x3d')]=0x0;_0x21ffa1[_0x5da5('0x3e')]=0x0;if(!_0x21ffa1[_0x5da5('0x3f')]&&!_0x21ffa1[_0x5da5('0x40')]){_0x21ffa1[_0x5da5('0x3b')]+=0x1;}if(!_0x21ffa1[_0x5da5('0x3f')]&&_0x21ffa1[_0x5da5('0x40')]){_0x21ffa1[_0x5da5('0x41')]+=0x1;if(_0x21ffa1[_0x5da5('0x3b')]){_0x21ffa1[_0x5da5('0x3b')]-=0x1;}}if(_0x21ffa1[_0x5da5('0x3f')]&&_0x21ffa1[_0x5da5('0x42')]===_0x5da5('0x3d')){_0x21ffa1[_0x5da5('0x3d')]+=0x1;if(_0x21ffa1[_0x5da5('0x3b')]){_0x21ffa1[_0x5da5('0x3b')]-=0x1;}}else if(_0x21ffa1[_0x5da5('0x3f')]&&!_0x21ffa1[_0x5da5('0x40')]&&_0x21ffa1[_0x5da5('0x42')]){_0x21ffa1['unmanaged']+=0x1;if(_0x21ffa1['waiting']){_0x21ffa1[_0x5da5('0x3b')]-=0x1;}}else if(_0x21ffa1[_0x5da5('0x3f')]&&_0x21ffa1['UserId']){_0x21ffa1[_0x5da5('0x43')]+=0x1;if(_0x21ffa1[_0x5da5('0x41')]){_0x21ffa1[_0x5da5('0x41')]-=0x1;}}_0x21ffa1[_0x5da5('0x3e')]+=0x1;_0x5a189e(_0x21ffa1);});}exports[_0x5da5('0x44')]=function(_0x207a7c,_0x2775da){var _0x362028={},_0x3cb7a9={},_0x44de08={'count':0x0,'rows':[]};var _0x4fc584=_[_0x5da5('0x35')](db['ChatInteraction']['rawAttributes'],function(_0x2a0fb6){return{'name':_0x2a0fb6[_0x5da5('0x45')],'type':_0x2a0fb6[_0x5da5('0x46')][_0x5da5('0x47')]};});_0x3cb7a9[_0x5da5('0x48')]=_[_0x5da5('0x35')](_0x4fc584,'name');_0x3cb7a9[_0x5da5('0x49')]=_['keys'](_0x207a7c['query']);_0x3cb7a9[_0x5da5('0x4a')]=_[_0x5da5('0x4b')](_0x3cb7a9['model'],_0x3cb7a9[_0x5da5('0x49')]);_0x362028[_0x5da5('0x4c')]=_[_0x5da5('0x4b')](_0x3cb7a9[_0x5da5('0x48')],qs[_0x5da5('0x4d')](_0x207a7c['query'][_0x5da5('0x4d')]));_0x362028['attributes']=_0x362028['attributes'][_0x5da5('0x4e')]?_0x362028['attributes']:_0x3cb7a9[_0x5da5('0x48')];if(!_0x207a7c[_0x5da5('0x49')][_0x5da5('0x4f')](_0x5da5('0x50'))){_0x362028[_0x5da5('0x27')]=qs[_0x5da5('0x27')](_0x207a7c['query']['limit']);_0x362028[_0x5da5('0x24')]=qs[_0x5da5('0x24')](_0x207a7c['query']['offset']);}_0x362028[_0x5da5('0x51')]=qs['sort'](_0x207a7c[_0x5da5('0x49')]['sort']);_0x362028['where']=qs[_0x5da5('0x4a')](_[_0x5da5('0x52')](_0x207a7c[_0x5da5('0x49')],_0x3cb7a9[_0x5da5('0x4a')]),_0x4fc584);var _0x4c654c=[];var _0x267b07=squel[_0x5da5('0x53')]()[_0x5da5('0x54')]('id')['field'](_0x5da5('0x2c'))[_0x5da5('0x54')](_0x5da5('0x55'))[_0x5da5('0x56')](_0x5da5('0x57'));var _0x2e6460=squel[_0x5da5('0x53')]()[_0x5da5('0x54')](_0x5da5('0x58'))[_0x5da5('0x54')](_0x5da5('0x59'))[_0x5da5('0x54')](_0x5da5('0x5a'))[_0x5da5('0x56')](_0x5da5('0x5b'),'ui')[_0x5da5('0x5c')](_0x5da5('0x5d'),'u',_0x5da5('0x5e'));var _0x191691=squel[_0x5da5('0x53')]()[_0x5da5('0x56')]('chat_interactions','i')[_0x5da5('0x5c')](_0x5da5('0x5f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x5da5('0x60'))[_0x5da5('0x5c')](_0x5da5('0x61'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x5da5('0x62'),'me',_0x5da5('0x63'))[_0x5da5('0x5c')](_0x5da5('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x5da5('0x5c')](_0x5da5('0x57'),'t',_0x5da5('0x65'));var _0x4e4ffa=squel[_0x5da5('0x66')]();var _0x5913b3=[];var _0x107211=squel[_0x5da5('0x66')]();var _0x4f0e51;if(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x67')]){_0x4f0e51=as[_0x5da5('0x68')](_0x207a7c[_0x5da5('0x49')][_0x5da5('0x67')]);var _0x1252b4=_0x4f0e51[_0x5da5('0x69')];for(var _0x2f9f72=0x0;_0x2f9f72<_0x4f0e51[_0x5da5('0x6a')][_0x5da5('0x4e')];_0x2f9f72++){var _0xb3a7a3=_0x4f0e51[_0x5da5('0x6a')][_0x2f9f72];var _0xd7f04d='i';var _0x1a7f01=_[_0x5da5('0x6b')](_0x4fc584,[_0x5da5('0x2c'),_0xb3a7a3[_0x5da5('0x54')]]);if(!_0x1a7f01){switch(_0xb3a7a3[_0x5da5('0x54')]){case'unreadMessages':if(_0xb3a7a3['value']==0x1){_0x191691[_0x5da5('0x6c')]('`'+_0xb3a7a3[_0x5da5('0x54')]+_0x5da5('0x6d'));}else{_0x191691['having']('`'+_0xb3a7a3[_0x5da5('0x54')]+_0x5da5('0x6e'));}break;case _0x5da5('0x6f'):if(_0xb3a7a3[_0x5da5('0x70')]==='$substring'){if(_0xb3a7a3[_0x5da5('0x71')]['split']('\x20')[_0x5da5('0x4e')]>0x1){_0x4e4ffa[_0x1252b4](_0x5da5('0x72'),qs[_0x5da5('0x73')](_0xb3a7a3[_0x5da5('0x71')]),null);}else{var _0x57966d='%'+_0xb3a7a3[_0x5da5('0x71')]+'%';_0x4e4ffa[_0x1252b4](_0x5da5('0x74'),_0x57966d,_0x57966d,_0x57966d);}}else{_0x1a7f01=_['find'](_0x4fc584,['name','ContactId']);_0xb3a7a3[_0x5da5('0x54')]=_0x5da5('0x75');_0x74801a=as[_0x5da5('0x76')](_0xd7f04d,_0x1a7f01[_0x5da5('0x46')],_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')]['end']);}break;case _0x5da5('0x79'):var _0x444b99=_0xb3a7a3['value']['split'](',')[_0x5da5('0x35')](function(_0x5b48e5){return Number(_0x5b48e5);});_0x444b99[_0x5da5('0x38')](function(_0x4f7e64){_0x107211['or'](_0x5da5('0x7a'),'%,'+_0x4f7e64+',%');});_0x5913b3=_[_0x5da5('0x7b')](_0x5913b3,_0x444b99);break;case _0x5da5('0x7c'):if(_0xb3a7a3[_0x5da5('0x70')]===_0x5da5('0x7d')){_0x4e4ffa[_0x1252b4](_0x5da5('0x7e'),'%'+_0xb3a7a3[_0x5da5('0x71')]+'%',null);}else{_0x1a7f01=_[_0x5da5('0x6b')](_0x4fc584,[_0x5da5('0x2c'),_0x5da5('0x40')]);_0xb3a7a3[_0x5da5('0x54')]=_0x5da5('0x40');_0x74801a=as['buildExpression'](_0xd7f04d,_0x1a7f01['type'],_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')]['end']);}break;case'body':_0x74801a=as['buildExpression']('me',null,_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x22')]);break;}}else{var _0x74801a=as[_0x5da5('0x76')](_0xd7f04d,_0x1a7f01[_0x5da5('0x46')],_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x22')]);}}}else{var _0x3852bf=_(_0x207a7c[_0x5da5('0x49')])[_0x5da5('0x7f')]()[_0x5da5('0x35')](function(_0x242ca9){return _[_0x5da5('0x80')](_0x4fc584,[_0x5da5('0x2c'),_0x242ca9])?_0x242ca9:undefined;})[_0x5da5('0x81')]()['value']();if(!_[_0x5da5('0x82')](_0x3852bf)){_0x3852bf[_0x5da5('0x38')](function(_0x3fc27e){if(_0x3fc27e===_0x5da5('0x83')){_0x191691['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x5da5('0x84')](_0x207a7c['query'][_0x3fc27e]));}else if(_0x3fc27e===_0x5da5('0x85')){var _0x2b2856=JSON[_0x5da5('0x86')](_0x207a7c[_0x5da5('0x49')][_0x3fc27e])[_0x5da5('0x87')];var _0x3b0282=JSON[_0x5da5('0x86')](_0x207a7c[_0x5da5('0x49')][_0x3fc27e])[_0x5da5('0x88')];_0x191691['where'](_0x5da5('0x89'),_0x2b2856,_0x3b0282);}else{if(_0x207a7c['query'][_0x3fc27e]===_0x5da5('0x8a')){_0x191691[_0x5da5('0x8b')]('i.'+_0x3fc27e+'\x20IS\x20NULL');}else{_0x191691[_0x5da5('0x8b')]('i.'+_0x3fc27e+'\x20=\x20?',_0x207a7c[_0x5da5('0x49')][_0x3fc27e]);}}});}if(_0x207a7c['query'][_0x5da5('0x8c')]){if(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8c')]==0x1){_0x191691[_0x5da5('0x6c')](_0x5da5('0x8d'));}else{_0x191691[_0x5da5('0x6c')](_0x5da5('0x8e'));}}if(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8f')]){_0x5913b3=_['isArray'](_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8f')])?_0x207a7c['query']['tag']:new Array(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8f')]);_0x5913b3[_0x5da5('0x38')](function(_0xcc15e9){_0x107211['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xcc15e9+',%');});}if(_0x207a7c[_0x5da5('0x49')]['filter']){var _0x26aa9f=_0x207a7c['query']['filter'][_0x5da5('0x90')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x26aa9f)){_0x4e4ffa['or'](_0x5da5('0x91'),_0x26aa9f+'%');}else{_0x4e4ffa['or'](_0x5da5('0x92'),qs[_0x5da5('0x73')](_0x26aa9f))['or'](_0x5da5('0x93'),_0x26aa9f+'%');}}}_0x191691[_0x5da5('0x8b')](_0x4e4ffa);_0x191691[_0x5da5('0x94')](_0x5da5('0x95'));var _0x2bdcc1={'type':db['Sequelize'][_0x5da5('0x96')][_0x5da5('0x97')],'raw':!![]};var _0x3fb2e9=_0x191691[_0x5da5('0x98')]();_0x3fb2e9[_0x5da5('0x54')](_0x5da5('0x95'));_0x3fb2e9[_0x5da5('0x54')](_0x5da5('0x99'),_0x5da5('0x9a'));if(_0x362028[_0x5da5('0x51')]){_0x362028[_0x5da5('0x51')][_0x5da5('0x38')](function(_0x104ae6){var _0xed45a1=_0x104ae6[0x0]===_0x5da5('0x9b')?_0x104ae6[0x0]:'i.'+_0x104ae6[0x0];_0x191691[_0x5da5('0x51')](_0xed45a1,_0x104ae6[0x1]===_0x5da5('0x9c')?![]:!![]);});}if(!_[_0x5da5('0x82')](_0x5913b3)){_0x191691[_0x5da5('0x6c')](_0x107211);_0x3fb2e9[_0x5da5('0x8b')](_0x5da5('0x9d'),_0x5913b3);}BPromise[_0x5da5('0x9e')]()[_0x5da5('0x2a')](function(){if(!_0x4f0e51){if(_0x207a7c[_0x5da5('0x49')]['ChatWebsiteId'])return;_0x3fb2e9[_0x5da5('0x8b')](_0x5da5('0x9f'));_0x191691['where'](_0x5da5('0x9f'));return;}if(_0x207a7c['user'][_0x5da5('0xa0')]!==_0x5da5('0x31'))return;return _0x207a7c[_0x5da5('0xa1')][_0x5da5('0xa2')]({'attributes':['id'],'raw':!![]})[_0x5da5('0x2a')](function(_0x16ceeb){if(_['isEmpty'](_0x16ceeb)){_0x3fb2e9[_0x5da5('0x8b')](_0x5da5('0xa3'));_0x191691['where'](_0x5da5('0xa3'));}else{_0x3fb2e9[_0x5da5('0x8b')]('i.ChatWebsiteId\x20IN\x20?',_[_0x5da5('0x35')](_0x16ceeb,'id'));_0x191691[_0x5da5('0x8b')](_0x5da5('0xa4'),_[_0x5da5('0x35')](_0x16ceeb,'id'));}});})[_0x5da5('0x2a')](function(){if(_0x207a7c[_0x5da5('0xa1')][_0x5da5('0xa0')]===_0x5da5('0x31')&&!_0x4f0e51&&!_0x207a7c[_0x5da5('0x49')][_0x5da5('0x83')])return[];return db['sequelize'][_0x5da5('0x49')](_0x3fb2e9[_0x5da5('0xa5')](),_0x2bdcc1);})[_0x5da5('0x2a')](function(_0x23c2a7){_0x44de08[_0x5da5('0x26')]=_0x23c2a7[_0x5da5('0x4e')];if(_0x44de08[_0x5da5('0x26')]===0x0)return[];return db['sequelize']['query'](_0x267b07[_0x5da5('0xa5')](),_0x2bdcc1)['then'](function(_0x5c8ec0){_0x4c654c=_[_0x5da5('0xa6')](_0x5c8ec0,'id');_0x2bdcc1=_['merge'](_0x2bdcc1,{'model':db[_0x5da5('0xa7')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x207a7c['query'][_0x5da5('0x4d')]){_0x362028[_0x5da5('0x4c')][_0x5da5('0x38')](function(_0x3b834f){_0x191691['field']('i.'+_0x3b834f);});}else{_0x191691[_0x5da5('0x54')](_0x5da5('0x99'),_0x5da5('0x9a'));_0x191691[_0x5da5('0x54')](_0x5da5('0xa8'),_0x5da5('0xa9'));_0x191691[_0x5da5('0x54')](_0x5da5('0xaa'),'Account.mandatoryDisposition');_0x191691[_0x5da5('0x54')](_0x5da5('0xab'),'contactName');_0x191691[_0x5da5('0x54')](_0x5da5('0xac'));_0x191691[_0x5da5('0x54')](_0x5da5('0xad'),'Contact.firstName');_0x191691['field'](_0x5da5('0xae'),_0x5da5('0xaf'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb0'),_0x5da5('0xb1'));_0x191691['field'](_0x5da5('0xb2'),_0x5da5('0xb3'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb4'),_0x5da5('0xb5'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb6'),_0x5da5('0xb7'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb8'),_0x5da5('0xb9'));_0x191691[_0x5da5('0x54')](_0x5da5('0xba'),_0x5da5('0xbb'));_0x191691[_0x5da5('0x54')](_0x5da5('0xbc'),_0x5da5('0x36'));}if(_0x362028[_0x5da5('0x27')])_0x191691[_0x5da5('0x27')](_0x362028['limit']);if(_0x362028[_0x5da5('0x24')])_0x191691['offset'](_0x362028[_0x5da5('0x24')]);return db[_0x5da5('0xbd')][_0x5da5('0x49')](_0x191691[_0x5da5('0xa5')](),_0x2bdcc1);})[_0x5da5('0x2a')](function(_0x5b1a72){if(_0x5b1a72[_0x5da5('0x4e')]>0x0)_0x2e6460[_0x5da5('0x8b')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x5b1a72,'id'));return db[_0x5da5('0xbd')]['query'](_0x2e6460[_0x5da5('0xa5')](),_0x2bdcc1)[_0x5da5('0x2a')](function(_0x1782a6){var _0x1b555f=_[_0x5da5('0xbe')](_0x1782a6,_0x5da5('0xbf'));var _0x341587=[];_0x5b1a72['forEach'](function(_0x57b6e4){_0x341587['push'](updateChatInteraction(_0x57b6e4,_0x4c654c,_0x1b555f));});return BPromise[_0x5da5('0xc0')](_0x341587);});});})[_0x5da5('0x2a')](function(_0x101cdc){_0x44de08['rows']=_0x101cdc;return _0x44de08;})[_0x5da5('0x2a')](respondWithFilteredResult(_0x2775da,_0x362028))[_0x5da5('0x20')](handleError(_0x2775da,null));};exports[_0x5da5('0xc1')]=function(_0xbe0ade,_0x3d6503){var _0xd56fa3={'raw':![],'where':{'id':_0xbe0ade[_0x5da5('0xc2')]['id']}},_0x51a597={};_0x51a597[_0x5da5('0x48')]=_[_0x5da5('0x7f')](db['ChatInteraction']['rawAttributes']);_0x51a597[_0x5da5('0x49')]=_[_0x5da5('0x7f')](_0xbe0ade['query']);_0x51a597[_0x5da5('0x4a')]=_[_0x5da5('0x4b')](_0x51a597['model'],_0x51a597[_0x5da5('0x49')]);_0xd56fa3['attributes']=_['intersection'](_0x51a597[_0x5da5('0x48')],qs['fields'](_0xbe0ade[_0x5da5('0x49')]['fields']));_0xd56fa3[_0x5da5('0x4c')]=_0xd56fa3[_0x5da5('0x4c')]['length']?_0xd56fa3[_0x5da5('0x4c')]:_0x51a597[_0x5da5('0x48')];if(_0xbe0ade[_0x5da5('0x49')][_0x5da5('0xc3')]){_0xd56fa3['include']=[{'all':!![]}];}_0xd56fa3=_['merge']({},_0xd56fa3,_0xbe0ade[_0x5da5('0xc4')]);return db[_0x5da5('0xa7')][_0x5da5('0x6b')](_0xd56fa3)[_0x5da5('0x2a')](handleEntityNotFound(_0x3d6503,null))[_0x5da5('0x2a')](respondWithResult(_0x3d6503,null))[_0x5da5('0x20')](handleError(_0x3d6503,null));};exports['create']=function(_0x2ddbcb,_0x314e83){return db[_0x5da5('0xa7')][_0x5da5('0xc5')](_0x2ddbcb['body'],{})['then'](respondWithResult(_0x314e83,0xc9))[_0x5da5('0x20')](handleError(_0x314e83,null));};exports[_0x5da5('0xc6')]=function(_0x44a307,_0x51cd21){if(_0x44a307['body']['id']){delete _0x44a307[_0x5da5('0x2f')]['id'];}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x44a307[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x51cd21,null))['then'](saveUpdates(_0x44a307['body'],null))[_0x5da5('0x2a')](respondWithResult(_0x51cd21,null))['catch'](handleError(_0x51cd21,null));};exports[_0x5da5('0x29')]=function(_0x449379,_0x24c565){return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x449379[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x24c565,null))[_0x5da5('0x2a')](removeEntity(_0x24c565,null))[_0x5da5('0x20')](handleError(_0x24c565,null));};exports[_0x5da5('0xc7')]=function(_0x2212b1,_0x401cad){return db['ChatInteraction'][_0x5da5('0xc7')]()[_0x5da5('0x2a')](respondWithResult(_0x401cad,null))['catch'](handleError(_0x401cad,null));};exports[_0x5da5('0xc8')]=function(_0x15ccd3,_0x1971c2){var _0x3385eb=_0x15ccd3[_0x5da5('0xc2')]['id'];var _0xe36532;var _0x3568ee;var _0x2daf1d;return db[_0x5da5('0xa7')][_0x5da5('0xc9')]({'where':{'id':_0x3385eb}})['then'](function(_0x3514b3){_0xe36532=_0x3514b3;return db[_0x5da5('0xca')][_0x5da5('0xc9')]({'where':{'id':_0x3514b3['ChatWebsiteId']},'attributes':['id',_0x5da5('0xcb'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x5da5('0xcc')],'raw':!![]});})[_0x5da5('0x2a')](function(_0x1f06ad){if(_0x1f06ad&&_0x1f06ad[_0x5da5('0xcb')]&&_0x1f06ad['vidaooEscalation']){_0x3568ee=_0x1f06ad;var _0x2e341c={'interaction':{'id':_0x3385eb},'agent':{'id':_0x15ccd3[_0x5da5('0xa1')]['id'],'name':_0x15ccd3[_0x5da5('0xa1')][_0x5da5('0x2c')],'fullname':_0x15ccd3[_0x5da5('0xa1')][_0x5da5('0xcd')],'email':_0x15ccd3[_0x5da5('0xa1')]['email']},'contact':_0x15ccd3[_0x5da5('0x2f')][_0x5da5('0x30')],'account':_0x15ccd3[_0x5da5('0x2f')][_0x5da5('0x33')]};var _0x5d85ff={'rejectUnauthorized':![],'method':_0x5da5('0xce'),'url':_0x5da5('0xcf'),'headers':{'X-APIKEY':_0x1f06ad['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x15ccd3[_0x5da5('0xa1')][_0x5da5('0xd0')]],'buttons':null,'topic':_0x3568ee[_0x5da5('0xd1')],'note':_[_0x5da5('0xd2')](_0x3568ee['vidaooNote'])?null:getMustacheRender(_0x3568ee['vidaooNote'],_0x2e341c),'metadata':null},'redirect':_0x5da5('0xd3'),'json':!![]};try{if(!_[_0x5da5('0xd2')](_0x3568ee[_0x5da5('0xcc')])){var _0x513dc5=getMustacheRender(_0x3568ee[_0x5da5('0xcc')],_0x2e341c);var _0x555728=JSON['parse'](_0x513dc5);_0x5d85ff[_0x5da5('0x2f')][_0x5da5('0xd4')]=_0x555728;}}catch(_0x2623e4){throw new db['Sequelize'][(_0x5da5('0xd5'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5d85ff);}else{throw new db['Sequelize'][(_0x5da5('0xd5'))](_0x5da5('0xd6'));}})[_0x5da5('0x2a')](function(_0x5a1bf4){_0x2daf1d=_0x5a1bf4;if(_0x2daf1d['id']){var _0x50d000={'body':_0x2daf1d[_0x5da5('0xd7')],'ChatWebsiteId':_0x3568ee['id'],'ChatInteractionId':_0xe36532['id'],'direction':_0x5da5('0xd8'),'UserId':_0x15ccd3['user']['id']};return db['ChatMessage'][_0x5da5('0xc5')](_0x50d000,{});}else{throw new db['Sequelize'][(_0x5da5('0xd5'))](_0x5da5('0xd9'));}})[_0x5da5('0x2a')](function(){return _0xe36532[_0x5da5('0xda')]({'vidaooSessionId':_0x2daf1d['id']});})[_0x5da5('0x2a')](respondWithResult(_0x1971c2,null))[_0x5da5('0x20')](handleError(_0x1971c2,null));};exports[_0x5da5('0xdb')]=function(_0x17c226,_0x41e33d){if(_0x17c226[_0x5da5('0x2f')]['id']){delete _0x17c226[_0x5da5('0x2f')]['id'];}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x17c226[_0x5da5('0xc2')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x5da5('0x2a')](handleEntityNotFound(_0x41e33d,null))[_0x5da5('0x2a')](saveUpdates(_0x17c226[_0x5da5('0x2f')],null))[_0x5da5('0x2a')](respondWithResult(_0x41e33d,null))[_0x5da5('0x20')](handleError(_0x41e33d,null));};exports['abandon']=function(_0x165bc8,_0x21c4f6){if(_0x165bc8[_0x5da5('0x2f')]['id']){delete _0x165bc8['body']['id'];}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x165bc8[_0x5da5('0xc2')]['id']}})[_0x5da5('0x2a')](function(_0x303676){if(!_0x303676){logger[_0x5da5('0x1c')](_0x5da5('0xdc'),_0x5da5('0xdd'),0x194,_0x5da5('0xde'));_0x21c4f6[_0x5da5('0xdf')](0x194);}else{if(_0x303676[_0x5da5('0x40')]){throw new db['Sequelize'][(_0x5da5('0xd5'))](_0x5da5('0xe0'));}}return _0x303676;})[_0x5da5('0x2a')](function(_0x4baa4b){if(_0x4baa4b){return _0x4baa4b[_0x5da5('0xc6')]({'closed':_0x165bc8['body'][_0x5da5('0x3f')],'disposition':_0x165bc8[_0x5da5('0x2f')][_0x5da5('0x42')]})['then'](function(_0x562291){return _0x562291;});}})[_0x5da5('0x2a')](function(){return respondWithRpcPromise(_0x5da5('0xe1'),_0x5da5('0xdd'),_0x165bc8[_0x5da5('0x2f')],client9004);})[_0x5da5('0x2a')](respondWithResult(_0x21c4f6,null))[_0x5da5('0x20')](handleError(_0x21c4f6,null));};exports['attachmentUpload']=function(_0x222950,_0x596940){_0x222950[_0x5da5('0x2f')][_0x5da5('0x2c')]=_0x222950[_0x5da5('0xe2')]['originalname'];_0x222950['body'][_0x5da5('0xe3')]=_0x222950[_0x5da5('0xe2')][_0x5da5('0xe4')];_0x222950[_0x5da5('0x2f')][_0x5da5('0x46')]=_0x222950['file']['mimetype'];return db[_0x5da5('0xe5')]['create'](_0x222950[_0x5da5('0x2f')])[_0x5da5('0x2a')](respondWithResult(_0x596940,0xc9))[_0x5da5('0x20')](handleError(_0x596940,null));};exports[_0x5da5('0xe6')]=function(_0x340b1d,_0x22c12d){return db[_0x5da5('0xa7')]['findOne']({'where':{'id':_0x340b1d[_0x5da5('0xc2')]['id']},'raw':!![]})[_0x5da5('0x2a')](handleEntityNotFound(_0x22c12d,null))[_0x5da5('0x2a')](function(_0x416760){if(_0x416760){if(_0x416760[_0x5da5('0x3f')]){return _0x22c12d['status'](0x193)[_0x5da5('0x23')]({'status':0x193,'message':_0x5da5('0xe7')});}return db[_0x5da5('0xe5')][_0x5da5('0xc9')]({'where':{'id':_0x340b1d[_0x5da5('0x49')]['attachId']},'raw':!![]})[_0x5da5('0x2a')](handleEntityNotFound(_0x22c12d,null));}})[_0x5da5('0x2a')](function(_0x4f32d7){if(_0x4f32d7){var _0x484c7f=_0x4f32d7['ChatOfflineMessageId']!==null;var _0x15c938=path[_0x5da5('0xe8')](config[_0x5da5('0xe9')],'server/files/attachments/');if(_0x484c7f){_0x15c938=path[_0x5da5('0xe8')](_0x15c938,_0x5da5('0xea'));}var _0x480b1e=path[_0x5da5('0xe8')](_0x15c938,_0x4f32d7[_0x5da5('0xe3')]);return _0x22c12d[_0x5da5('0xeb')](_0x480b1e);}})[_0x5da5('0x20')](handleError(_0x22c12d,null));};exports['close']=function(_0x22413b,_0x5e6bb4){var _0x1cce33=null;var _0x2199f2=null;var _0x563113=null;if(_0x22413b[_0x5da5('0x2f')]['id']){delete _0x22413b[_0x5da5('0x2f')]['id'];}if(_0x22413b[_0x5da5('0x2f')][_0x5da5('0xec')]){_0x563113=path[_0x5da5('0xe8')](config[_0x5da5('0xe9')],_0x5da5('0xed'),util[_0x5da5('0xee')](_0x5da5('0xef'),Date[_0x5da5('0xf0')]()));_0x22413b[_0x5da5('0x2f')][_0x5da5('0xf1')]=_0x563113;}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x22413b[_0x5da5('0xc2')]['id']},'include':[{'model':db[_0x5da5('0xf2')],'as':_0x5da5('0xf3'),'include':[{'model':db[_0x5da5('0x7c')],'as':_0x5da5('0x7c')}]}]})[_0x5da5('0x2a')](handleEntityNotFound(_0x5e6bb4,null))[_0x5da5('0x2a')](saveUpdates(_0x22413b[_0x5da5('0x2f')],null))[_0x5da5('0x2a')](function(_0x35b7e8){if(_0x35b7e8){_0x1cce33=_0x35b7e8;return db[_0x5da5('0xca')][_0x5da5('0x6b')]({'where':{'id':_0x1cce33[_0x5da5('0x83')]}});}})[_0x5da5('0x2a')](function(_0xafe658){if(_0xafe658){_0x2199f2=_0xafe658;return db[_0x5da5('0xf4')][_0x5da5('0x6b')]({'where':{'id':_0x1cce33[_0x5da5('0x75')]}});}})[_0x5da5('0x2a')](function(_0x2ab9ba){if(_0x2ab9ba){if(_0x563113){var _0x423431=null;for(var _0x231009=0x1;_0x231009<_0x1cce33[_0x5da5('0xf3')][_0x5da5('0x4e')];++_0x231009){_0x423431=_0x1cce33[_0x5da5('0xf3')][_0x231009];var _0x3453ce=_0x423431['UserId']?util['format'](_0x5da5('0xf5'),_0x2199f2[_0x5da5('0xf6')],_0x423431['UserId']):'System';var _0xd36fe0=_0x22413b[_0x5da5('0x2f')][_0x5da5('0xf7')]||util[_0x5da5('0xee')](_0x5da5('0xf5'),_0x5da5('0xf8'),_0x423431[_0x5da5('0x75')]);switch(_0x2199f2['agentIdentifier']){case _0x5da5('0xf9'):_0x3453ce=_0x423431[_0x5da5('0x40')]?util[_0x5da5('0xee')](_0x5da5('0xf5'),_0x2199f2[_0x5da5('0xf6')],_0x423431['UserId']):'System';break;case _0x5da5('0xfa'):_0x3453ce=_0x423431[_0x5da5('0x40')]?_0x423431['User']['alias']||_0x423431[_0x5da5('0x7c')][_0x5da5('0xcd')]:_0x5da5('0xfb');break;case'agent_fullname':_0x3453ce=_0x423431[_0x5da5('0x40')]?_0x423431[_0x5da5('0x7c')]['fullname']:'System';break;default:_0x3453ce=_0x423431[_0x5da5('0x40')]?util[_0x5da5('0xee')](_0x5da5('0xf5'),_0x2199f2[_0x5da5('0xf6')],_0x423431[_0x5da5('0x40')]):_0x5da5('0xfb');}var _0x3a5453=util['format'](_0x5da5('0xfc'),moment(_0x423431['createdAt'])[_0x5da5('0xee')](_0x5da5('0xfd')),_0x423431[_0x5da5('0xfe')]==='in'?_0xd36fe0:_0x3453ce,_0x423431[_0x5da5('0x2f')]);if(!_0x423431[_0x5da5('0xff')]){fs[_0x5da5('0x100')](_0x563113,_0x3a5453);}}return db[_0x5da5('0x101')][_0x5da5('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x5da5('0x102')],'as':_0x5da5('0x103'),'raw':!![],'include':[{'model':db[_0x5da5('0x104')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x5da5('0x2a')](function(_0x268871){if(!_0x268871||!_0x268871[_0x5da5('0x103')]||!_0x22413b['body'])return _0x1cce33;var _0x118647=_0x268871[_0x5da5('0x105')]();return respondWithRpcPromise(_0x5da5('0x106'),_0x5da5('0x107'),{'account':_0x118647,'message':{'from':util[_0x5da5('0xee')](_0x5da5('0x108'),_0x268871[_0x5da5('0x2c')],_0x268871['email']||_0x268871['Smtp'][_0x5da5('0xa1')]),'to':_0x22413b[_0x5da5('0x2f')][_0x5da5('0xec')],'subject':_0x5da5('0x109'),'text':util['format'](_0x5da5('0x10a'),_0x22413b[_0x5da5('0x2f')]['mailTranscript']),'attachments':[{'path':_0x563113}]}})[_0x5da5('0x2a')](function(){return _0x1cce33;})[_0x5da5('0x20')](function(_0xcfa153){logger['error'](_0xcfa153);});})[_0x5da5('0x2a')](respondWithStatusCode(_0x5e6bb4,0xc8))[_0x5da5('0x20')](handleError(_0x5e6bb4,null));};exports['addMessage']=function(_0x2143f0,_0x245338){return db[_0x5da5('0xf2')][_0x5da5('0x6b')]({'where':{'id':_0x2143f0[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x245338,null))[_0x5da5('0x2a')](function(_0x255556){if(_0x255556){return _0x255556[_0x5da5('0x10b')](_0x2143f0[_0x5da5('0x2f')][_0x5da5('0x10c')],_[_0x5da5('0x10d')](_0x2143f0[_0x5da5('0x2f')],['ids','id'])||{});}})['then'](respondWithResult(_0x245338,null))['catch'](handleError(_0x245338,null));};exports[_0x5da5('0x10e')]=function(_0xf685e2,_0x53f7d1){var _0x3c532e={'raw':![],'where':{}};var _0x5ab150={};var _0x58ef45={'count':0x0,'rows':[]};return db[_0x5da5('0xa7')]['findOne']({'where':{'id':_0xf685e2[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x53f7d1,null))[_0x5da5('0x2a')](function(_0x1da022){if(_0x1da022){_0x5ab150['model']=_[_0x5da5('0x7f')](db[_0x5da5('0xf2')][_0x5da5('0x10f')]);_0x5ab150[_0x5da5('0x49')]=_[_0x5da5('0x7f')](_0xf685e2[_0x5da5('0x49')]);_0x5ab150['filters']=_['intersection'](_0x5ab150[_0x5da5('0x48')],_0x5ab150[_0x5da5('0x49')]);_0x3c532e['attributes']=_[_0x5da5('0x4b')](_0x5ab150[_0x5da5('0x48')],qs[_0x5da5('0x4d')](_0xf685e2['query']['fields']));_0x3c532e['attributes']=_0x3c532e[_0x5da5('0x4c')][_0x5da5('0x4e')]?_0x3c532e[_0x5da5('0x4c')]:_0x5ab150[_0x5da5('0x48')];if(!_0xf685e2['query'][_0x5da5('0x4f')](_0x5da5('0x50'))){_0x3c532e[_0x5da5('0x27')]=qs[_0x5da5('0x27')](_0xf685e2['query']['limit']);_0x3c532e[_0x5da5('0x24')]=qs[_0x5da5('0x24')](_0xf685e2[_0x5da5('0x49')]['offset']);}_0x3c532e[_0x5da5('0x51')]=qs[_0x5da5('0x110')](_0xf685e2['query']['sort']);_0x3c532e[_0x5da5('0x8b')]=qs['filters'](_[_0x5da5('0x52')](_0xf685e2[_0x5da5('0x49')],_0x5ab150[_0x5da5('0x4a')]));_0x3c532e[_0x5da5('0x8b')]['ChatInteractionId']=_0x1da022['id'];if(_0xf685e2['query'][_0x5da5('0x111')]){_0x3c532e[_0x5da5('0x8b')]=_[_0x5da5('0x112')](_0x3c532e[_0x5da5('0x8b')],{'$or':_[_0x5da5('0x35')](_0x3c532e[_0x5da5('0x4c')],function(_0x5e81d){var _0x41cd89={};_0x41cd89[_0x5e81d]={'$like':'%'+_0xf685e2['query'][_0x5da5('0x111')]+'%'};return _0x41cd89;})});}if(_0xf685e2[_0x5da5('0x49')]['$gte']){var _0x4b0dcd=_0xf685e2[_0x5da5('0x49')][_0x5da5('0x87')]['split'](',');var _0x663647={};_0x663647[_0x4b0dcd[0x0]]={'$gte':moment(_0x4b0dcd[0x1])[_0x5da5('0xee')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3c532e[_0x5da5('0x8b')]=_['merge'](_0x3c532e[_0x5da5('0x8b')],_0x663647);}_0x3c532e=_[_0x5da5('0x112')]({},_0x3c532e,_0xf685e2[_0x5da5('0xc4')]);return db[_0x5da5('0xf2')]['count']({'where':_0x3c532e[_0x5da5('0x8b')]})[_0x5da5('0x2a')](function(_0x2226d4){_0x58ef45[_0x5da5('0x26')]=_0x2226d4;if(_0xf685e2['query'][_0x5da5('0xc3')]){_0x3c532e[_0x5da5('0x113')]=[{'all':!![]}];}return db['ChatMessage'][_0x5da5('0x114')](_0x3c532e);})[_0x5da5('0x2a')](function(_0x3c2680){_0x58ef45[_0x5da5('0x115')]=_0x3c2680;return _0x58ef45;});}})[_0x5da5('0x2a')](respondWithFilteredResult(_0x53f7d1,_0x3c532e))[_0x5da5('0x20')](handleError(_0x53f7d1,null));};exports[_0x5da5('0x116')]=function(_0x455bf5,_0x3215b8){var _0x93fc22={'where':{}},_0x29a452={},_0xc0ad3b={'count':0x0,'rows':[]};return db[_0x5da5('0xa7')]['findOne']({'where':{'id':_0x455bf5['params']['id']}})['then'](handleEntityNotFound(_0x3215b8,null))['then'](function(_0x2075f8){if(_0x2075f8){_0x29a452[_0x5da5('0x48')]=_['keys'](db['ChatMessage'][_0x5da5('0x10f')]);_0x29a452['query']=_[_0x5da5('0x7f')](_0x455bf5[_0x5da5('0x49')]);_0x29a452['filters']=_[_0x5da5('0x4b')](_0x29a452['model'],_0x29a452[_0x5da5('0x49')]);_0x93fc22[_0x5da5('0x4c')]=_[_0x5da5('0x4b')](_0x29a452['model'],qs['fields'](_0x455bf5[_0x5da5('0x49')][_0x5da5('0x4d')]));_0x93fc22[_0x5da5('0x4c')]=_0x93fc22[_0x5da5('0x4c')][_0x5da5('0x4e')]?_0x93fc22[_0x5da5('0x4c')]:_0x29a452[_0x5da5('0x48')];if(!_0x455bf5[_0x5da5('0x49')][_0x5da5('0x4f')](_0x5da5('0x50'))){_0x93fc22['limit']=qs[_0x5da5('0x27')](_0x455bf5[_0x5da5('0x49')][_0x5da5('0x27')]);_0x93fc22['offset']=qs[_0x5da5('0x24')](_0x455bf5[_0x5da5('0x49')]['offset']);}_0x93fc22[_0x5da5('0x51')]=qs['sort'](_0x455bf5[_0x5da5('0x49')][_0x5da5('0x110')]);_0x93fc22[_0x5da5('0x8b')]=qs[_0x5da5('0x4a')](_[_0x5da5('0x52')](_0x455bf5[_0x5da5('0x49')],_0x29a452['filters']));_0x93fc22['where'][_0x5da5('0xbf')]=_0x2075f8['id'];if(_0x455bf5[_0x5da5('0x49')]['filter']){_0x93fc22[_0x5da5('0x8b')]=_[_0x5da5('0x112')](_0x93fc22[_0x5da5('0x8b')],{'$or':_['map'](_0x93fc22[_0x5da5('0x4c')],function(_0x5b20d9){var _0x54df1a={};_0x54df1a[_0x5b20d9]={'$like':'%'+_0x455bf5[_0x5da5('0x49')][_0x5da5('0x111')]+'%'};return _0x54df1a;})});}_0x93fc22['where'][_0x5da5('0xff')]=![];if(_0x455bf5['query']['id']){_0x93fc22[_0x5da5('0x8b')]['id']={'$gt':_0x455bf5[_0x5da5('0x49')]['id']};}_0x93fc22=_[_0x5da5('0x112')]({},_0x93fc22,_0x455bf5[_0x5da5('0xc4')]);return db['ChatMessage'][_0x5da5('0x26')]({'where':_0x93fc22[_0x5da5('0x8b')]})[_0x5da5('0x2a')](function(_0x70f31d){_0xc0ad3b[_0x5da5('0x26')]=_0x70f31d;_0x93fc22['include']=[];if(_0x455bf5[_0x5da5('0x49')][_0x5da5('0x117')]){_0x93fc22[_0x5da5('0x113')][_0x5da5('0x3a')]({'model':db[_0x5da5('0x7c')],'as':'User','attributes':['id',_0x5da5('0xcd'),'alias']});}if(_0x455bf5['query'][_0x5da5('0xc3')]){_0x93fc22['include']=[{'all':!![]}];}return db[_0x5da5('0xf2')][_0x5da5('0x114')](_0x93fc22);})[_0x5da5('0x2a')](function(_0x21d019){_0xc0ad3b[_0x5da5('0x115')]=_0x21d019;return _0xc0ad3b;});}})[_0x5da5('0x2a')](respondWithFilteredResult(_0x3215b8,_0x93fc22))[_0x5da5('0x20')](handleError(_0x3215b8,null));};exports[_0x5da5('0x118')]=function(_0x199ab0,_0x38f596){return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x199ab0[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x38f596,null))['then'](function(_0x5f4410){if(_0x5f4410){return _0x5f4410[_0x5da5('0x119')](_0x199ab0[_0x5da5('0x2f')][_0x5da5('0x10c')],_[_0x5da5('0x10d')](_0x199ab0[_0x5da5('0x2f')],['ids','id'])||{})[_0x5da5('0x11a')](function(){return db[_0x5da5('0x79')][_0x5da5('0x114')]({'attributes':['id',_0x5da5('0x2c'),_0x5da5('0x55')],'where':{'id':_0x199ab0['body'][_0x5da5('0x10c')]}});})[_0x5da5('0x2a')](function(_0xb897d){socket[_0x5da5('0x11b')]('chatInteractionTags:save',{'id':Number(_0x199ab0[_0x5da5('0xc2')]['id']),'tags':_0xb897d||[]});return{'id':Number(_0x199ab0[_0x5da5('0xc2')]['id']),'tags':_0xb897d||[]};});}})[_0x5da5('0x2a')](respondWithResult(_0x38f596,null))[_0x5da5('0x20')](handleError(_0x38f596,null));};exports['removeTags']=function(_0x2fd629,_0x3213c8){return db['ChatInteraction'][_0x5da5('0x6b')]({'where':{'id':_0x2fd629[_0x5da5('0xc2')]['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x3213c8,null))[_0x5da5('0x2a')](function(_0x58fe7d){if(_0x58fe7d){return _0x58fe7d[_0x5da5('0x11c')](_0x2fd629[_0x5da5('0x49')][_0x5da5('0x10c')]);}})[_0x5da5('0x2a')](respondWithStatusCode(_0x3213c8,null))[_0x5da5('0x20')](handleError(_0x3213c8,null));};exports[_0x5da5('0xeb')]=function(_0x10e296,_0x3a6962){var _0xe1a9c2=moment()[_0x5da5('0x11d')]()[_0x5da5('0xa5')]();var _0x13950f=path[_0x5da5('0xe8')](config['root'],_0x5da5('0x11e'),_0x5da5('0x11f'),_0x5da5('0x120'));var _0x1800d0=path[_0x5da5('0xe8')](config[_0x5da5('0xe9')],_0x5da5('0x11e'),_0x5da5('0x11f'),_0x5da5('0x121'));var _0x454639=path[_0x5da5('0xe8')](_0x13950f,_0xe1a9c2);var _0x1cddaf=util[_0x5da5('0xee')](_0x5da5('0x122'),_0x10e296[_0x5da5('0xc2')]['id'],_0xe1a9c2);var _0x11394e=path[_0x5da5('0xe8')](_0x13950f,_0x1cddaf);var _0x4413c3=[];_0x4413c3[_0x5da5('0x3a')]({'model':db[_0x5da5('0x7c')],'as':_0x5da5('0x7c'),'attributes':['id',_0x5da5('0xcd')],'raw':!![]});_0x4413c3[_0x5da5('0x3a')]({'model':db[_0x5da5('0xf4')],'as':_0x5da5('0x6f'),'attributes':['id',_0x5da5('0x123'),_0x5da5('0x124')],'raw':!![]});if(_0x10e296[_0x5da5('0x49')][_0x5da5('0x121')]){_0x4413c3[_0x5da5('0x3a')]({'model':db['Attachment'],'as':_0x5da5('0xe5'),'raw':!![]});}var _0x3203e7=[{'model':db[_0x5da5('0xf2')],'as':'Messages','attributes':['id',_0x5da5('0x2f'),_0x5da5('0x85'),_0x5da5('0xfe'),'secret',_0x5da5('0x8c')],'include':_0x4413c3}];_0x3203e7[_0x5da5('0x3a')]({'model':db[_0x5da5('0xca')],'as':_0x5da5('0x125'),'attributes':['id',_0x5da5('0x2c')]});_0x3203e7[_0x5da5('0x3a')]({'model':db[_0x5da5('0x7c')],'as':_0x5da5('0x126'),'attributes':['id',_0x5da5('0xcd')]});return db['ChatInteraction'][_0x5da5('0x6b')]({'where':{'id':_0x10e296[_0x5da5('0xc2')]['id']},'include':_0x3203e7})[_0x5da5('0x2a')](handleEntityNotFound(_0x3a6962,null))[_0x5da5('0x2a')](function(_0x512d10){if(_0x512d10){var _0x2b7834=_0x512d10[_0x5da5('0x127')]({'plain':!![]});fs[_0x5da5('0x128')](_0x454639);var _0x182053={'channel':_0x5da5('0x129'),'account':_0x2b7834[_0x5da5('0x125')]['name'],'agent':_0x2b7834['Owner']?_0x2b7834[_0x5da5('0x126')][_0x5da5('0xcd')]:_0x5da5('0x12a'),'createdAt':moment(_0x2b7834['createdAt'])[_0x5da5('0xee')](_0x5da5('0x12b'))[_0x5da5('0xa5')](),'closedAt':_0x2b7834[_0x5da5('0x3f')]?moment(_0x2b7834[_0x5da5('0x12c')])[_0x5da5('0xee')](_0x5da5('0x12b'))[_0x5da5('0xa5')]():'','disposition':_0x2b7834[_0x5da5('0x42')],'chatInfo':{'browser':_0x2b7834[_0x5da5('0x12d')],'os':_0x2b7834[_0x5da5('0x12e')],'referer':_0x2b7834[_0x5da5('0x12f')],'customerIp':_0x2b7834[_0x5da5('0x130')],'customerPort':_0x2b7834[_0x5da5('0x131')]?_0x2b7834[_0x5da5('0x131')]:'N.A.'},'messages':_(_0x2b7834[_0x5da5('0xf3')])[_0x5da5('0x132')]()[_0x5da5('0x111')]({'secret':![]})[_0x5da5('0x35')](function(_0x4aeb17){if(_0x4aeb17[_0x5da5('0xe5')]){var _0x35c55f=path[_0x5da5('0xe8')](_0x1800d0,_0x4aeb17['Attachment'][_0x5da5('0xe3')]);if(fs[_0x5da5('0x133')](_0x35c55f)){fs[_0x5da5('0x134')](_0x35c55f)['pipe'](fs[_0x5da5('0x135')](path['join'](_0x454639,_0x4aeb17[_0x5da5('0xe5')][_0x5da5('0xe3')])));}}return{'date':moment(_0x4aeb17[_0x5da5('0x85')])[_0x5da5('0xee')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5da5('0xa5')](),'sender':_0x4aeb17[_0x5da5('0xfe')]==='out'?_0x4aeb17[_0x5da5('0x7c')]?_0x4aeb17[_0x5da5('0x7c')][_0x5da5('0xcd')]:_0x5da5('0xfb'):_0x4aeb17[_0x5da5('0x6f')][_0x5da5('0x123')]+(_0x4aeb17[_0x5da5('0x6f')][_0x5da5('0x124')]?'\x20'+_0x4aeb17[_0x5da5('0x6f')][_0x5da5('0x124')]:''),'body':_0x4aeb17['Attachment']?_0x4aeb17[_0x5da5('0xe5')][_0x5da5('0xe3')]:_0x4aeb17['body'],'direction':_0x4aeb17[_0x5da5('0xfe')]===_0x5da5('0xd8')?'A':'C','secret':_0x4aeb17[_0x5da5('0xff')],'read':_0x4aeb17[_0x5da5('0x8c')],'attachment':_0x4aeb17['Attachment']};})[_0x5da5('0x71')]()};return ejs['renderFile'](path[_0x5da5('0xe8')](config['root'],_0x5da5('0x11e'),_0x5da5('0x136'),'downloadInteraction.ejs'),{'interaction':_0x182053})[_0x5da5('0x2a')](function(_0x4c13d8){var _0x15e4f9=path['join'](_0x454639,_0x5da5('0x137')+_0x2b7834['id']+'-'+_0xe1a9c2+'.pdf');var _0x5c31c7={'path':_0x15e4f9,'channel':_0x5da5('0x129'),'interactionId':_0x2b7834['id']};return pdf[_0x5da5('0x138')](_0x4c13d8,_0x5c31c7);})[_0x5da5('0x2a')](function(){return new Promise(function(_0x344da7,_0x44774c){zipdir(_0x454639,{'saveTo':_0x11394e},function(_0x1c3d84,_0x2e06f4){if(_0x1c3d84)return _0x44774c(_0x1c3d84);return _0x344da7(_0x2e06f4);});})[_0x5da5('0x2a')](function(){return new BPromise(function(_0xc2e222,_0x1560a5){rimraf(_0x454639,function(_0x464cd6){if(_0x464cd6)_0x1560a5(_0x464cd6);return _0xc2e222();});});})[_0x5da5('0x2a')](function(){return _0x3a6962['download'](_0x11394e,_0x1cddaf,function(_0x5bb2be){if(_0x5bb2be){logger[_0x5da5('0x1c')]('err',_0x5bb2be);}else{fs[_0x5da5('0x139')](_0x11394e);}});});});}else{return _0x3a6962[_0x5da5('0xdf')](0xc8);}})[_0x5da5('0x20')](handleError(_0x3a6962,null));};
\ No newline at end of file
+var _0x9bde=['pick','filters','field','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','length','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','text','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','sequelize','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','show','params','includeAll','include','options','create','ChatInteraction','describe','createVidaooSession','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','format','now','ChatWebsite','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','Tag','color','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','N.A.','closedAt','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','zip-dir','moment','mustache','util','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','client','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','then','name','send','render','merge','body','contact','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','catch','talking','unmanaged','abandoned','total','UserId','waiting','closed','disposition','answered','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where'];(function(_0x955e5f,_0x48fd81){var _0x25515e=function(_0x17b565){while(--_0x17b565){_0x955e5f['push'](_0x955e5f['shift']());}};_0x25515e(++_0x48fd81);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1856c5,_0x3955a8){_0x1856c5=_0x1856c5-0x0;var _0x526423=_0x9bde[_0x1856c5];return _0x526423;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe9bd('0x0'));var rp=require('request-promise');var moment=require(_0xe9bd('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe9bd('0x2'));var util=require(_0xe9bd('0x3'));var path=require(_0xe9bd('0x4'));var ejs=require(_0xe9bd('0x5'));var fs=require('fs');var _=require(_0xe9bd('0x6'));var squel=require(_0xe9bd('0x7'));var Redis=require(_0xe9bd('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x9'));var pdf=require(_0xe9bd('0xa'));var logger=require(_0xe9bd('0xb'))(_0xe9bd('0xc'));var config=require(_0xe9bd('0xd'));var db=require(_0xe9bd('0xe'))['db'];config[_0xe9bd('0xf')]=_[_0xe9bd('0x10')](config[_0xe9bd('0xf')],{'host':_0xe9bd('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe9bd('0x12'))[_0xe9bd('0x13')](socket);var jayson=require(_0xe9bd('0x14'));var client=jayson['client'][_0xe9bd('0x15')]({'port':0x232b});var client9004=jayson[_0xe9bd('0x16')][_0xe9bd('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x141587,_0x5e022a,_0x2c1d98,_0x4ac319){return new BPromise(function(_0x220d07,_0x429e88){var _0x3435b4=_0x4ac319||client;return _0x3435b4['request'](_0x141587,_0x2c1d98)['then'](function(_0x46a95e){logger[_0xe9bd('0x17')](_0xe9bd('0x18'),_0x5e022a,_0xe9bd('0x19'));logger[_0xe9bd('0x1a')](_0xe9bd('0x1b'),_0x5e022a,_0xe9bd('0x19'),JSON['stringify'](_0x46a95e));if(_0x46a95e[_0xe9bd('0x1c')]){if(_0x46a95e[_0xe9bd('0x1c')][_0xe9bd('0x1d')]===0x1f4){logger['error'](_0xe9bd('0x18'),_0x5e022a,_0x46a95e[_0xe9bd('0x1c')][_0xe9bd('0x1e')]);return _0x429e88(_0x46a95e[_0xe9bd('0x1c')]['message']);}logger[_0xe9bd('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x5e022a,_0x46a95e[_0xe9bd('0x1c')]['message']);return _0x220d07(_0x46a95e[_0xe9bd('0x1c')][_0xe9bd('0x1e')]);}else{logger[_0xe9bd('0x17')](_0xe9bd('0x18'),_0x5e022a,_0xe9bd('0x19'));_0x220d07(_0x46a95e[_0xe9bd('0x1f')][_0xe9bd('0x1e')]);}})['catch'](function(_0x133318){logger[_0xe9bd('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x5e022a,_0x133318);_0x429e88(_0x133318);});});}function respondWithStatusCode(_0x37aec1,_0x505c23){_0x505c23=_0x505c23||0xcc;return function(_0x238ab1){if(_0x238ab1){return _0x37aec1[_0xe9bd('0x20')](_0x505c23);}return _0x37aec1[_0xe9bd('0x21')](_0x505c23)[_0xe9bd('0x22')]();};}function respondWithResult(_0x5bc4bf,_0x24cf25){_0x24cf25=_0x24cf25||0xc8;return function(_0x1e3cbb){if(_0x1e3cbb){return _0x5bc4bf[_0xe9bd('0x21')](_0x24cf25)[_0xe9bd('0x23')](_0x1e3cbb);}};}function respondWithFilteredResult(_0x2641be,_0xb52d45){return function(_0x399f3c){if(_0x399f3c){var _0x43ea90=typeof _0xb52d45[_0xe9bd('0x24')]==='undefined'&&typeof _0xb52d45[_0xe9bd('0x25')]===_0xe9bd('0x26');var _0x5ba1d6=_0x399f3c[_0xe9bd('0x27')];var _0xc25248=_0x43ea90?0x0:_0xb52d45[_0xe9bd('0x24')];var _0x429055=_0x43ea90?_0x399f3c[_0xe9bd('0x27')]:_0xb52d45[_0xe9bd('0x24')]+_0xb52d45['limit'];var _0x5b7f1d;if(_0x429055>=_0x5ba1d6){_0x429055=_0x5ba1d6;_0x5b7f1d=0xc8;}else{_0x5b7f1d=0xce;}_0x2641be[_0xe9bd('0x21')](_0x5b7f1d);return _0x2641be['set'](_0xe9bd('0x28'),_0xc25248+'-'+_0x429055+'/'+_0x5ba1d6)[_0xe9bd('0x23')](_0x399f3c);}return null;};}function saveUpdates(_0x27f80c){return function(_0x36aa80){if(_0x36aa80){return _0x36aa80[_0xe9bd('0x29')](_0x27f80c)['then'](function(_0x4b7bc2){return _0x4b7bc2;});}return null;};}function removeEntity(_0x7f2c5){return function(_0x3b6682){if(_0x3b6682){return _0x3b6682[_0xe9bd('0x2a')]()[_0xe9bd('0x2b')](function(){_0x7f2c5[_0xe9bd('0x21')](0xcc)[_0xe9bd('0x22')]();});}};}function handleEntityNotFound(_0x3c31ee){return function(_0x66213a){if(!_0x66213a){_0x3c31ee[_0xe9bd('0x20')](0x194);}return _0x66213a;};}function handleError(_0x4ec15c,_0x426004){_0x426004=_0x426004||0x1f4;return function(_0x81a31f){logger[_0xe9bd('0x1c')](_0x81a31f['stack']);if(_0x81a31f['name']){delete _0x81a31f[_0xe9bd('0x2c')];}_0x4ec15c[_0xe9bd('0x21')](_0x426004)[_0xe9bd('0x2d')](_0x81a31f);};}function getMustacheRender(_0x3ed60a,_0x1dda43){return Mustache[_0xe9bd('0x2e')](_0x3ed60a,_[_0xe9bd('0x2f')](_0x1dda43[_0xe9bd('0x30')],{'contact':_0x1dda43[_0xe9bd('0x31')],'message':_0x1dda43[_0xe9bd('0x1e')],'agent':_0x1dda43[_0xe9bd('0x32')],'interaction':_0x1dda43[_0xe9bd('0x33')],'account':_0x1dda43[_0xe9bd('0x34')]}))||'';}function getInteractionUsers(_0x199477,_0xc50476){return new BPromise(function(_0x8ff624,_0x264ba0){try{if(_0xc50476[_0x199477['id']]){_0x199477[_0xe9bd('0x35')]=_['map'](_0xc50476[_0x199477['id']],function(_0x3f3cf5){return{'id':_0x3f3cf5['id'],'fullname':_0x3f3cf5[_0xe9bd('0x36')]};});}}catch(_0x56b4a5){_0x264ba0(_0x56b4a5);}_0x8ff624(_0x199477);});}function getInteractionTags(_0x404a7d,_0x264c87){return new BPromise(function(_0x4c7d47,_0x4b1da0){try{if(_0x404a7d[_0xe9bd('0x37')]){_0x404a7d[_0xe9bd('0x38')]=[];_0x404a7d['TagIds'][_0xe9bd('0x39')](',')[_0xe9bd('0x3a')](function(_0x14927c){_0x404a7d['Tags'][_0xe9bd('0x3b')](_0x264c87[_0x14927c]);});}delete _0x404a7d['TagIds'];}catch(_0x3c8f7e){_0x4b1da0(_0x3c8f7e);}_0x4c7d47(_0x404a7d);});}function updateChatInteraction(_0x42238a,_0x63d67c,_0x1366f2){return new BPromise(function(_0x4e1538,_0x41f2d4){return getInteractionUsers(_0x42238a,_0x1366f2)[_0xe9bd('0x2b')](function(_0x327e1a){return getInteractionTags(_0x327e1a,_0x63d67c);})[_0xe9bd('0x2b')](function(_0x253359){return getStateInteraction(_0x253359);})[_0xe9bd('0x2b')](function(_0x3647d8){_0x4e1538(_0x3647d8);})[_0xe9bd('0x3c')](function(_0x2b5a71){_0x41f2d4(_0x2b5a71);});});}function getStateInteraction(_0x1d5d93){return new BPromise(function(_0x4e8565){_0x1d5d93['waiting']=0x0;_0x1d5d93[_0xe9bd('0x3d')]=0x0;_0x1d5d93['answered']=0x0;_0x1d5d93[_0xe9bd('0x3e')]=0x0;_0x1d5d93[_0xe9bd('0x3f')]=0x0;_0x1d5d93[_0xe9bd('0x40')]=0x0;if(!_0x1d5d93['closed']&&!_0x1d5d93[_0xe9bd('0x41')]){_0x1d5d93[_0xe9bd('0x42')]+=0x1;}if(!_0x1d5d93[_0xe9bd('0x43')]&&_0x1d5d93['UserId']){_0x1d5d93[_0xe9bd('0x3d')]+=0x1;if(_0x1d5d93[_0xe9bd('0x42')]){_0x1d5d93[_0xe9bd('0x42')]-=0x1;}}if(_0x1d5d93[_0xe9bd('0x43')]&&_0x1d5d93[_0xe9bd('0x44')]===_0xe9bd('0x3f')){_0x1d5d93[_0xe9bd('0x3f')]+=0x1;if(_0x1d5d93[_0xe9bd('0x42')]){_0x1d5d93[_0xe9bd('0x42')]-=0x1;}}else if(_0x1d5d93[_0xe9bd('0x43')]&&!_0x1d5d93[_0xe9bd('0x41')]&&_0x1d5d93[_0xe9bd('0x44')]){_0x1d5d93[_0xe9bd('0x3e')]+=0x1;if(_0x1d5d93[_0xe9bd('0x42')]){_0x1d5d93[_0xe9bd('0x42')]-=0x1;}}else if(_0x1d5d93['closed']&&_0x1d5d93['UserId']){_0x1d5d93[_0xe9bd('0x45')]+=0x1;if(_0x1d5d93[_0xe9bd('0x3d')]){_0x1d5d93[_0xe9bd('0x3d')]-=0x1;}}_0x1d5d93['total']+=0x1;_0x4e8565(_0x1d5d93);});}exports['index']=function(_0x43cf7d,_0x3f6f22){var _0x165942={},_0x15da40={},_0x39fb61={'count':0x0,'rows':[]};var _0x3d4b58=_[_0xe9bd('0x46')](db['ChatInteraction'][_0xe9bd('0x47')],function(_0x4cc146){return{'name':_0x4cc146[_0xe9bd('0x48')],'type':_0x4cc146[_0xe9bd('0x49')][_0xe9bd('0x4a')]};});_0x15da40[_0xe9bd('0x4b')]=_[_0xe9bd('0x46')](_0x3d4b58,'name');_0x15da40[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x43cf7d[_0xe9bd('0x4c')]);_0x15da40['filters']=_[_0xe9bd('0x4e')](_0x15da40[_0xe9bd('0x4b')],_0x15da40[_0xe9bd('0x4c')]);_0x165942['attributes']=_[_0xe9bd('0x4e')](_0x15da40[_0xe9bd('0x4b')],qs[_0xe9bd('0x4f')](_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x4f')]));_0x165942['attributes']=_0x165942[_0xe9bd('0x50')]['length']?_0x165942[_0xe9bd('0x50')]:_0x15da40[_0xe9bd('0x4b')];if(!_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x51')](_0xe9bd('0x52'))){_0x165942['limit']=qs[_0xe9bd('0x25')](_0x43cf7d['query'][_0xe9bd('0x25')]);_0x165942[_0xe9bd('0x24')]=qs['offset'](_0x43cf7d['query'][_0xe9bd('0x24')]);}_0x165942['order']=qs[_0xe9bd('0x53')](_0x43cf7d['query'][_0xe9bd('0x53')]);_0x165942[_0xe9bd('0x54')]=qs['filters'](_[_0xe9bd('0x55')](_0x43cf7d['query'],_0x15da40[_0xe9bd('0x56')]),_0x3d4b58);var _0x2d9a94=[];var _0x321050=squel['select']()[_0xe9bd('0x57')]('id')[_0xe9bd('0x57')](_0xe9bd('0x2c'))[_0xe9bd('0x57')]('color')['from'](_0xe9bd('0x58'));var _0x493aae=squel[_0xe9bd('0x59')]()[_0xe9bd('0x57')](_0xe9bd('0x5a'))[_0xe9bd('0x57')](_0xe9bd('0x5b'))[_0xe9bd('0x57')](_0xe9bd('0x5c'))[_0xe9bd('0x5d')](_0xe9bd('0x5e'),'ui')[_0xe9bd('0x5f')](_0xe9bd('0x60'),'u',_0xe9bd('0x61'));var _0x51500d=squel['select']()['from'](_0xe9bd('0x62'),'i')['left_join'](_0xe9bd('0x63'),'c',_0xe9bd('0x64'))[_0xe9bd('0x5f')](_0xe9bd('0x60'),'o',_0xe9bd('0x65'))[_0xe9bd('0x5f')](_0xe9bd('0x66'),'a',_0xe9bd('0x67'))[_0xe9bd('0x5f')]('chat_messages','me',_0xe9bd('0x68'))[_0xe9bd('0x5f')](_0xe9bd('0x69'),'it',_0xe9bd('0x6a'))['left_join'](_0xe9bd('0x58'),'t',_0xe9bd('0x6b'));var _0x34bd38=squel['expr']();var _0x3e6f63=[];var _0x204ea9=squel[_0xe9bd('0x6c')]();var _0xfe82f7;if(_0x43cf7d['query']['search']){_0xfe82f7=as[_0xe9bd('0x6d')](_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x6e')]);var _0xf02c5d=_0xfe82f7['sqlOperator'];for(var _0x49add9=0x0;_0x49add9<_0xfe82f7[_0xe9bd('0x6f')][_0xe9bd('0x70')];_0x49add9++){var _0x3ea0cc=_0xfe82f7[_0xe9bd('0x6f')][_0x49add9];var _0x1fd2b5='i';var _0x23f476=_['find'](_0x3d4b58,[_0xe9bd('0x2c'),_0x3ea0cc['field']]);if(!_0x23f476){switch(_0x3ea0cc[_0xe9bd('0x57')]){case _0xe9bd('0x71'):if(_0x3ea0cc[_0xe9bd('0x72')]==0x1){_0x51500d[_0xe9bd('0x73')]('`'+_0x3ea0cc['field']+_0xe9bd('0x74'));}else{_0x51500d[_0xe9bd('0x73')]('`'+_0x3ea0cc[_0xe9bd('0x57')]+'`\x20>\x200');}break;case _0xe9bd('0x75'):if(_0x3ea0cc[_0xe9bd('0x76')]===_0xe9bd('0x77')){if(_0x3ea0cc[_0xe9bd('0x72')][_0xe9bd('0x39')]('\x20')[_0xe9bd('0x70')]>0x1){_0x34bd38[_0xf02c5d](_0xe9bd('0x78'),qs[_0xe9bd('0x79')](_0x3ea0cc[_0xe9bd('0x72')]),null);}else{var _0x37bb08='%'+_0x3ea0cc[_0xe9bd('0x72')]+'%';_0x34bd38[_0xf02c5d](_0xe9bd('0x7a'),_0x37bb08,_0x37bb08,_0x37bb08);}}else{_0x23f476=_['find'](_0x3d4b58,[_0xe9bd('0x2c'),_0xe9bd('0x7b')]);_0x3ea0cc['field']=_0xe9bd('0x7b');_0x5d7257=as[_0xe9bd('0x7c')](_0x1fd2b5,_0x23f476['type'],_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257['text'],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257['value']['end']);}break;case'Tag':var _0x246487=_0x3ea0cc['value']['split'](',')['map'](function(_0x4bcf2b){return Number(_0x4bcf2b);});_0x246487[_0xe9bd('0x3a')](function(_0x46da33){_0x204ea9['or'](_0xe9bd('0x7e'),'%,'+_0x46da33+',%');});_0x3e6f63=_['union'](_0x3e6f63,_0x246487);break;case _0xe9bd('0x7f'):if(_0x3ea0cc[_0xe9bd('0x76')]===_0xe9bd('0x77')){_0x34bd38[_0xf02c5d](_0xe9bd('0x80'),'%'+_0x3ea0cc['value']+'%',null);}else{_0x23f476=_[_0xe9bd('0x81')](_0x3d4b58,[_0xe9bd('0x2c'),_0xe9bd('0x41')]);_0x3ea0cc['field']='UserId';_0x5d7257=as[_0xe9bd('0x7c')](_0x1fd2b5,_0x23f476[_0xe9bd('0x49')],_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257[_0xe9bd('0x82')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x22')]);}break;case _0xe9bd('0x30'):_0x5d7257=as['buildExpression']('me',null,_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257[_0xe9bd('0x82')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x22')]);break;}}else{var _0x5d7257=as[_0xe9bd('0x7c')](_0x1fd2b5,_0x23f476['type'],_0x3ea0cc);_0x34bd38[_0xf02c5d](_0x5d7257['text'],_0x5d7257[_0xe9bd('0x72')][_0xe9bd('0x7d')],_0x5d7257['value'][_0xe9bd('0x22')]);}}}else{var _0x2d1e63=_(_0x43cf7d[_0xe9bd('0x4c')])[_0xe9bd('0x4d')]()['map'](function(_0x3c1ab9){return _[_0xe9bd('0x83')](_0x3d4b58,['name',_0x3c1ab9])?_0x3c1ab9:undefined;})[_0xe9bd('0x84')]()[_0xe9bd('0x72')]();if(!_[_0xe9bd('0x85')](_0x2d1e63)){_0x2d1e63[_0xe9bd('0x3a')](function(_0x2e63c7){if(_0x2e63c7===_0xe9bd('0x86')){_0x51500d[_0xe9bd('0x54')]('i.ChatWebsiteId\x20IN\x20?',[][_0xe9bd('0x87')](_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7]));}else if(_0x2e63c7===_0xe9bd('0x88')){var _0x421533=JSON[_0xe9bd('0x89')](_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7])[_0xe9bd('0x8a')];var _0x2adc49=JSON[_0xe9bd('0x89')](_0x43cf7d['query'][_0x2e63c7])[_0xe9bd('0x8b')];_0x51500d[_0xe9bd('0x54')](_0xe9bd('0x8c'),_0x421533,_0x2adc49);}else{if(_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7]===_0xe9bd('0x8d')){_0x51500d[_0xe9bd('0x54')]('i.'+_0x2e63c7+_0xe9bd('0x8e'));}else{_0x51500d['where']('i.'+_0x2e63c7+_0xe9bd('0x8f'),_0x43cf7d[_0xe9bd('0x4c')][_0x2e63c7]);}}});}if(_0x43cf7d['query'][_0xe9bd('0x90')]){if(_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x90')]==0x1){_0x51500d[_0xe9bd('0x73')](_0xe9bd('0x91'));}else{_0x51500d[_0xe9bd('0x73')](_0xe9bd('0x92'));}}if(_0x43cf7d['query']['tag']){_0x3e6f63=_[_0xe9bd('0x93')](_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x94')])?_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x94')]:new Array(_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x94')]);_0x3e6f63['forEach'](function(_0x35390a){_0x204ea9['or'](_0xe9bd('0x7e'),'%,'+_0x35390a+',%');});}if(_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x95')]){var _0x14cdd5=_0x43cf7d[_0xe9bd('0x4c')][_0xe9bd('0x95')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x14cdd5)){_0x34bd38['or'](_0xe9bd('0x96'),_0x14cdd5+'%');}else{_0x34bd38['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14cdd5))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x14cdd5+'%');}}}_0x51500d[_0xe9bd('0x54')](_0x34bd38);_0x51500d[_0xe9bd('0x97')](_0xe9bd('0x98'));var _0xa8b335={'type':db[_0xe9bd('0x99')][_0xe9bd('0x9a')][_0xe9bd('0x9b')],'raw':!![]};var _0x27ca62=_0x51500d[_0xe9bd('0x9c')]();_0x27ca62['field'](_0xe9bd('0x98'));_0x27ca62['field'](_0xe9bd('0x9d'),_0xe9bd('0x71'));if(_0x165942[_0xe9bd('0x9e')]){_0x165942[_0xe9bd('0x9e')][_0xe9bd('0x3a')](function(_0x5d8c24){var _0x5b14e5=_0x5d8c24[0x0]==='contactName'?_0x5d8c24[0x0]:'i.'+_0x5d8c24[0x0];_0x51500d[_0xe9bd('0x9e')](_0x5b14e5,_0x5d8c24[0x1]===_0xe9bd('0x9f')?![]:!![]);});}if(!_['isEmpty'](_0x3e6f63)){_0x51500d[_0xe9bd('0x73')](_0x204ea9);_0x27ca62[_0xe9bd('0x54')](_0xe9bd('0xa0'),_0x3e6f63);}BPromise[_0xe9bd('0xa1')]()[_0xe9bd('0x2b')](function(){if(!_0xfe82f7){if(_0x43cf7d['query'][_0xe9bd('0x86')])return;_0x27ca62[_0xe9bd('0x54')](_0xe9bd('0xa2'));_0x51500d[_0xe9bd('0x54')](_0xe9bd('0xa2'));return;}if(_0x43cf7d[_0xe9bd('0xa3')][_0xe9bd('0xa4')]!==_0xe9bd('0x32'))return;return _0x43cf7d[_0xe9bd('0xa3')][_0xe9bd('0xa5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d5288){if(_['isEmpty'](_0x4d5288)){_0x27ca62['where'](_0xe9bd('0xa6'));_0x51500d[_0xe9bd('0x54')](_0xe9bd('0xa6'));}else{_0x27ca62['where'](_0xe9bd('0xa7'),_[_0xe9bd('0x46')](_0x4d5288,'id'));_0x51500d['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xe9bd('0x46')](_0x4d5288,'id'));}});})[_0xe9bd('0x2b')](function(){if(_0x43cf7d[_0xe9bd('0xa3')][_0xe9bd('0xa4')]===_0xe9bd('0x32')&&!_0xfe82f7&&!_0x43cf7d['query']['ChatWebsiteId'])return[];return db['sequelize'][_0xe9bd('0x4c')](_0x27ca62[_0xe9bd('0xa8')](),_0xa8b335);})[_0xe9bd('0x2b')](function(_0x140678){_0x39fb61[_0xe9bd('0x27')]=_0x140678[_0xe9bd('0x70')];if(_0x39fb61[_0xe9bd('0x27')]===0x0)return[];return db[_0xe9bd('0xa9')][_0xe9bd('0x4c')](_0x321050[_0xe9bd('0xa8')](),_0xa8b335)['then'](function(_0xb1203d){_0x2d9a94=_['keyBy'](_0xb1203d,'id');_0xa8b335=_[_0xe9bd('0x2f')](_0xa8b335,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43cf7d['query'][_0xe9bd('0x4f')]){_0x165942['attributes'][_0xe9bd('0x3a')](function(_0x5cdaa8){_0x51500d[_0xe9bd('0x57')]('i.'+_0x5cdaa8);});}else{_0x51500d[_0xe9bd('0x57')](_0xe9bd('0x9d'),_0xe9bd('0x71'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xaa'),'Account.key');_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xab'),'Account.mandatoryDisposition');_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xac'),_0xe9bd('0xad'));_0x51500d['field'](_0xe9bd('0xae'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xaf'),_0xe9bd('0xb0'));_0x51500d[_0xe9bd('0x57')]('c.lastName',_0xe9bd('0xb1'));_0x51500d[_0xe9bd('0x57')]('c.email',_0xe9bd('0xb2'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xb3'),_0xe9bd('0xb4'));_0x51500d['field'](_0xe9bd('0xb5'),_0xe9bd('0xb6'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xb7'),_0xe9bd('0xb8'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xb9'),'Owner.fullname');_0x51500d[_0xe9bd('0x57')]('o.internal',_0xe9bd('0xba'));_0x51500d[_0xe9bd('0x57')](_0xe9bd('0xbb'),'TagIds');}if(_0x165942[_0xe9bd('0x25')])_0x51500d['limit'](_0x165942[_0xe9bd('0x25')]);if(_0x165942[_0xe9bd('0x24')])_0x51500d[_0xe9bd('0x24')](_0x165942[_0xe9bd('0x24')]);return db[_0xe9bd('0xa9')][_0xe9bd('0x4c')](_0x51500d[_0xe9bd('0xa8')](),_0xa8b335);})[_0xe9bd('0x2b')](function(_0x14db25){if(_0x14db25[_0xe9bd('0x70')]>0x0)_0x493aae[_0xe9bd('0x54')]('ui.ChatInteractionId\x20IN\x20?',_[_0xe9bd('0x46')](_0x14db25,'id'));return db[_0xe9bd('0xa9')][_0xe9bd('0x4c')](_0x493aae['toString'](),_0xa8b335)[_0xe9bd('0x2b')](function(_0x16bcce){var _0x581727=_['groupBy'](_0x16bcce,'ChatInteractionId');var _0x52df8f=[];_0x14db25[_0xe9bd('0x3a')](function(_0x3b32a9){_0x52df8f[_0xe9bd('0x3b')](updateChatInteraction(_0x3b32a9,_0x2d9a94,_0x581727));});return BPromise['all'](_0x52df8f);});});})[_0xe9bd('0x2b')](function(_0x3b72cd){_0x39fb61['rows']=_0x3b72cd;return _0x39fb61;})[_0xe9bd('0x2b')](respondWithFilteredResult(_0x3f6f22,_0x165942))[_0xe9bd('0x3c')](handleError(_0x3f6f22,null));};exports[_0xe9bd('0xbc')]=function(_0x8c8261,_0x3700f6){var _0x5eee5c={'raw':![],'where':{'id':_0x8c8261[_0xe9bd('0xbd')]['id']}},_0x1fcc3a={};_0x1fcc3a['model']=_['keys'](db['ChatInteraction']['rawAttributes']);_0x1fcc3a[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x8c8261[_0xe9bd('0x4c')]);_0x1fcc3a[_0xe9bd('0x56')]=_['intersection'](_0x1fcc3a['model'],_0x1fcc3a[_0xe9bd('0x4c')]);_0x5eee5c[_0xe9bd('0x50')]=_[_0xe9bd('0x4e')](_0x1fcc3a['model'],qs[_0xe9bd('0x4f')](_0x8c8261[_0xe9bd('0x4c')]['fields']));_0x5eee5c['attributes']=_0x5eee5c[_0xe9bd('0x50')][_0xe9bd('0x70')]?_0x5eee5c[_0xe9bd('0x50')]:_0x1fcc3a[_0xe9bd('0x4b')];if(_0x8c8261[_0xe9bd('0x4c')][_0xe9bd('0xbe')]){_0x5eee5c[_0xe9bd('0xbf')]=[{'all':!![]}];}_0x5eee5c=_[_0xe9bd('0x2f')]({},_0x5eee5c,_0x8c8261[_0xe9bd('0xc0')]);return db['ChatInteraction'][_0xe9bd('0x81')](_0x5eee5c)[_0xe9bd('0x2b')](handleEntityNotFound(_0x3700f6,null))[_0xe9bd('0x2b')](respondWithResult(_0x3700f6,null))[_0xe9bd('0x3c')](handleError(_0x3700f6,null));};exports[_0xe9bd('0xc1')]=function(_0x3145e8,_0x55f0d3){return db[_0xe9bd('0xc2')]['create'](_0x3145e8[_0xe9bd('0x30')],{})['then'](respondWithResult(_0x55f0d3,0xc9))[_0xe9bd('0x3c')](handleError(_0x55f0d3,null));};exports[_0xe9bd('0x29')]=function(_0x555a98,_0x343479){if(_0x555a98[_0xe9bd('0x30')]['id']){delete _0x555a98['body']['id'];}return db[_0xe9bd('0xc2')][_0xe9bd('0x81')]({'where':{'id':_0x555a98[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x343479,null))['then'](saveUpdates(_0x555a98[_0xe9bd('0x30')],null))[_0xe9bd('0x2b')](respondWithResult(_0x343479,null))['catch'](handleError(_0x343479,null));};exports[_0xe9bd('0x2a')]=function(_0x1dab51,_0x2d5601){return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x1dab51[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x2d5601,null))[_0xe9bd('0x2b')](removeEntity(_0x2d5601,null))[_0xe9bd('0x3c')](handleError(_0x2d5601,null));};exports[_0xe9bd('0xc3')]=function(_0x136aa0,_0x4d1288){return db[_0xe9bd('0xc2')][_0xe9bd('0xc3')]()[_0xe9bd('0x2b')](respondWithResult(_0x4d1288,null))['catch'](handleError(_0x4d1288,null));};exports[_0xe9bd('0xc4')]=function(_0x57c26d,_0x5ba105){var _0x4e1eb8=_0x57c26d[_0xe9bd('0xbd')]['id'];var _0x48af68;var _0x516080;var _0xd7ea2f;return db[_0xe9bd('0xc2')]['findOne']({'where':{'id':_0x4e1eb8}})[_0xe9bd('0x2b')](function(_0x48f4cd){_0x48af68=_0x48f4cd;return db['ChatWebsite']['findOne']({'where':{'id':_0x48f4cd[_0xe9bd('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe9bd('0xc5'),_0xe9bd('0xc6'),_0xe9bd('0xc7')],'raw':!![]});})[_0xe9bd('0x2b')](function(_0x276374){if(_0x276374&&_0x276374[_0xe9bd('0xc8')]&&_0x276374[_0xe9bd('0xc9')]){_0x516080=_0x276374;var _0x5ebe24={'interaction':{'id':_0x4e1eb8},'agent':{'id':_0x57c26d[_0xe9bd('0xa3')]['id'],'name':_0x57c26d['user']['name'],'fullname':_0x57c26d[_0xe9bd('0xa3')][_0xe9bd('0x36')],'email':_0x57c26d[_0xe9bd('0xa3')][_0xe9bd('0xca')]},'contact':_0x57c26d[_0xe9bd('0x30')]['contact'],'account':_0x57c26d[_0xe9bd('0x30')][_0xe9bd('0x34')]};var _0x460eb8={'rejectUnauthorized':![],'method':_0xe9bd('0xcb'),'url':_0xe9bd('0xcc'),'headers':{'X-APIKEY':_0x276374[_0xe9bd('0xc8')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57c26d['user'][_0xe9bd('0xca')]],'buttons':null,'topic':_0x516080[_0xe9bd('0xc5')],'note':_[_0xe9bd('0xcd')](_0x516080[_0xe9bd('0xc6')])?null:getMustacheRender(_0x516080[_0xe9bd('0xc6')],_0x5ebe24),'metadata':null},'redirect':_0xe9bd('0xce'),'json':!![]};try{if(!_['isNull'](_0x516080[_0xe9bd('0xc7')])){var _0x16c3e1=getMustacheRender(_0x516080['vidaooMetadata'],_0x5ebe24);var _0x1e5c54=JSON[_0xe9bd('0x89')](_0x16c3e1);_0x460eb8[_0xe9bd('0x30')][_0xe9bd('0xcf')]=_0x1e5c54;}}catch(_0x5befe7){throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd1'));}return rp(_0x460eb8);}else{throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd2'));}})[_0xe9bd('0x2b')](function(_0x1940e7){_0xd7ea2f=_0x1940e7;if(_0xd7ea2f['id']){var _0x41506b={'body':_0xd7ea2f['join_url'],'ChatWebsiteId':_0x516080['id'],'ChatInteractionId':_0x48af68['id'],'direction':_0xe9bd('0xd3'),'UserId':_0x57c26d[_0xe9bd('0xa3')]['id']};return db[_0xe9bd('0xd4')][_0xe9bd('0xc1')](_0x41506b,{});}else{throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xd5'));}})['then'](function(){return _0x48af68[_0xe9bd('0xd6')]({'vidaooSessionId':_0xd7ea2f['id']});})['then'](respondWithResult(_0x5ba105,null))[_0xe9bd('0x3c')](handleError(_0x5ba105,null));};exports[_0xe9bd('0xd7')]=function(_0x2db271,_0x1c2d6d){if(_0x2db271[_0xe9bd('0x30')]['id']){delete _0x2db271[_0xe9bd('0x30')]['id'];}return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x2db271[_0xe9bd('0xbd')]['id']},'include':[{'model':db[_0xe9bd('0xd8')],'as':'Contact'}]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x1c2d6d,null))[_0xe9bd('0x2b')](saveUpdates(_0x2db271[_0xe9bd('0x30')],null))[_0xe9bd('0x2b')](respondWithResult(_0x1c2d6d,null))[_0xe9bd('0x3c')](handleError(_0x1c2d6d,null));};exports[_0xe9bd('0xd9')]=function(_0x1e5a3f,_0x1c3af9){if(_0x1e5a3f[_0xe9bd('0x30')]['id']){delete _0x1e5a3f[_0xe9bd('0x30')]['id'];}return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x1e5a3f[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](function(_0x517b10){if(!_0x517b10){logger[_0xe9bd('0x1c')](_0xe9bd('0xda'),_0xe9bd('0xd9'),0x194,'entity\x20not\x20found');_0x1c3af9['sendStatus'](0x194);}else{if(_0x517b10[_0xe9bd('0x41')]){throw new db[(_0xe9bd('0x99'))][(_0xe9bd('0xd0'))](_0xe9bd('0xdb'));}}return _0x517b10;})[_0xe9bd('0x2b')](function(_0x464102){if(_0x464102){return _0x464102[_0xe9bd('0x29')]({'closed':_0x1e5a3f['body'][_0xe9bd('0x43')],'disposition':_0x1e5a3f[_0xe9bd('0x30')]['disposition']})[_0xe9bd('0x2b')](function(_0x3335a4){return _0x3335a4;});}})[_0xe9bd('0x2b')](function(){return respondWithRpcPromise(_0xe9bd('0xdc'),_0xe9bd('0xd9'),_0x1e5a3f[_0xe9bd('0x30')],client9004);})[_0xe9bd('0x2b')](respondWithResult(_0x1c3af9,null))[_0xe9bd('0x3c')](handleError(_0x1c3af9,null));};exports[_0xe9bd('0xdd')]=function(_0x10dfc8,_0x38ce72){_0x10dfc8[_0xe9bd('0x30')][_0xe9bd('0x2c')]=_0x10dfc8[_0xe9bd('0xde')][_0xe9bd('0xdf')];_0x10dfc8['body'][_0xe9bd('0xe0')]=_0x10dfc8[_0xe9bd('0xde')][_0xe9bd('0xe1')];_0x10dfc8[_0xe9bd('0x30')][_0xe9bd('0x49')]=_0x10dfc8['file'][_0xe9bd('0xe2')];return db[_0xe9bd('0xe3')][_0xe9bd('0xc1')](_0x10dfc8[_0xe9bd('0x30')])[_0xe9bd('0x2b')](respondWithResult(_0x38ce72,0xc9))[_0xe9bd('0x3c')](handleError(_0x38ce72,null));};exports[_0xe9bd('0xe4')]=function(_0x463d54,_0x3c1785){return db[_0xe9bd('0xc2')][_0xe9bd('0xe5')]({'where':{'id':_0x463d54[_0xe9bd('0xbd')]['id']},'raw':!![]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x3c1785,null))['then'](function(_0x1412ed){if(_0x1412ed){if(_0x1412ed[_0xe9bd('0x43')]){return _0x3c1785[_0xe9bd('0x21')](0x193)[_0xe9bd('0x23')]({'status':0x193,'message':_0xe9bd('0xe6')});}return db[_0xe9bd('0xe3')][_0xe9bd('0xe5')]({'where':{'id':_0x463d54[_0xe9bd('0x4c')][_0xe9bd('0xe7')]},'raw':!![]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x3c1785,null));}})[_0xe9bd('0x2b')](function(_0x2abe2a){if(_0x2abe2a){var _0x5da417=_0x2abe2a[_0xe9bd('0xe8')]!==null;var _0x38e43f=path[_0xe9bd('0xe9')](config[_0xe9bd('0xea')],_0xe9bd('0xeb'));if(_0x5da417){_0x38e43f=path['join'](_0x38e43f,_0xe9bd('0xec'));}var _0x43579b=path[_0xe9bd('0xe9')](_0x38e43f,_0x2abe2a['basename']);return _0x3c1785[_0xe9bd('0xed')](_0x43579b);}})[_0xe9bd('0x3c')](handleError(_0x3c1785,null));};exports['close']=function(_0x4efce6,_0x4b8f8e){var _0x28e51a=null;var _0x46017e=null;var _0x48cd92=null;if(_0x4efce6[_0xe9bd('0x30')]['id']){delete _0x4efce6[_0xe9bd('0x30')]['id'];}if(_0x4efce6[_0xe9bd('0x30')]['mailTranscript']){_0x48cd92=path[_0xe9bd('0xe9')](config[_0xe9bd('0xea')],_0xe9bd('0xee'),util[_0xe9bd('0xef')]('transcript-%s.txt',Date[_0xe9bd('0xf0')]()));_0x4efce6[_0xe9bd('0x30')]['pathTranscript']=_0x48cd92;}return db[_0xe9bd('0xc2')][_0xe9bd('0x81')]({'where':{'id':_0x4efce6[_0xe9bd('0xbd')]['id']},'include':[{'model':db[_0xe9bd('0xd4')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0xe9bd('0x2b')](handleEntityNotFound(_0x4b8f8e,null))['then'](saveUpdates(_0x4efce6[_0xe9bd('0x30')],null))[_0xe9bd('0x2b')](function(_0xff728b){if(_0xff728b){_0x28e51a=_0xff728b;return db[_0xe9bd('0xf1')][_0xe9bd('0x81')]({'where':{'id':_0x28e51a[_0xe9bd('0x86')]}});}})['then'](function(_0x117c16){if(_0x117c16){_0x46017e=_0x117c16;return db[_0xe9bd('0xd8')][_0xe9bd('0x81')]({'where':{'id':_0x28e51a[_0xe9bd('0x7b')]}});}})[_0xe9bd('0x2b')](function(_0x27740c){if(_0x27740c){if(_0x48cd92){var _0x25def7=null;for(var _0x552ea8=0x1;_0x552ea8<_0x28e51a[_0xe9bd('0xf2')][_0xe9bd('0x70')];++_0x552ea8){_0x25def7=_0x28e51a[_0xe9bd('0xf2')][_0x552ea8];var _0x1b5b7c=_0x25def7['UserId']?util[_0xe9bd('0xef')](_0xe9bd('0xf3'),_0x46017e[_0xe9bd('0xf4')],_0x25def7[_0xe9bd('0x41')]):_0xe9bd('0xf5');var _0x101aa0=_0x4efce6[_0xe9bd('0x30')][_0xe9bd('0xf6')]||util[_0xe9bd('0xef')](_0xe9bd('0xf3'),_0xe9bd('0xf7'),_0x25def7[_0xe9bd('0x7b')]);switch(_0x46017e[_0xe9bd('0xf8')]){case'website_alias':_0x1b5b7c=_0x25def7[_0xe9bd('0x41')]?util[_0xe9bd('0xef')]('%s%d',_0x46017e[_0xe9bd('0xf4')],_0x25def7[_0xe9bd('0x41')]):_0xe9bd('0xf5');break;case'agent_alias':_0x1b5b7c=_0x25def7[_0xe9bd('0x41')]?_0x25def7[_0xe9bd('0x7f')][_0xe9bd('0xf9')]||_0x25def7[_0xe9bd('0x7f')]['fullname']:_0xe9bd('0xf5');break;case _0xe9bd('0xfa'):_0x1b5b7c=_0x25def7[_0xe9bd('0x41')]?_0x25def7[_0xe9bd('0x7f')][_0xe9bd('0x36')]:_0xe9bd('0xf5');break;default:_0x1b5b7c=_0x25def7['UserId']?util[_0xe9bd('0xef')]('%s%d',_0x46017e['agentAlias'],_0x25def7[_0xe9bd('0x41')]):'System';}var _0x1ab3f2=util['format'](_0xe9bd('0xfb'),moment(_0x25def7[_0xe9bd('0x88')])['format'](_0xe9bd('0xfc')),_0x25def7[_0xe9bd('0xfd')]==='in'?_0x101aa0:_0x1b5b7c,_0x25def7[_0xe9bd('0x30')]);if(!_0x25def7[_0xe9bd('0xfe')]){fs[_0xe9bd('0xff')](_0x48cd92,_0x1ab3f2);}}return db[_0xe9bd('0x100')][_0xe9bd('0xe5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe9bd('0x101'),'raw':!![],'include':[{'model':db[_0xe9bd('0x102')],'as':_0xe9bd('0x102'),'raw':!![]}]}]});}}})[_0xe9bd('0x2b')](function(_0x33f143){if(!_0x33f143||!_0x33f143[_0xe9bd('0x101')]||!_0x4efce6['body'])return _0x28e51a;var _0xb82cb2=_0x33f143[_0xe9bd('0x103')]();return respondWithRpcPromise(_0xe9bd('0x104'),_0xe9bd('0x105'),{'account':_0xb82cb2,'message':{'from':util[_0xe9bd('0xef')]('\x22%s\x22\x20<%s>',_0x33f143['name'],_0x33f143['email']||_0x33f143[_0xe9bd('0x101')]['user']),'to':_0x4efce6[_0xe9bd('0x30')][_0xe9bd('0x106')],'subject':'Mail\x20Transcript','text':util[_0xe9bd('0xef')](_0xe9bd('0x107'),_0x4efce6[_0xe9bd('0x30')][_0xe9bd('0x106')]),'attachments':[{'path':_0x48cd92}]}})[_0xe9bd('0x2b')](function(){return _0x28e51a;})[_0xe9bd('0x3c')](function(_0x914313){logger['error'](_0x914313);});})['then'](respondWithStatusCode(_0x4b8f8e,0xc8))[_0xe9bd('0x3c')](handleError(_0x4b8f8e,null));};exports['addMessage']=function(_0x54b3e9,_0x453d10){return db[_0xe9bd('0xd4')][_0xe9bd('0x81')]({'where':{'id':_0x54b3e9[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x453d10,null))[_0xe9bd('0x2b')](function(_0x3a9bc4){if(_0x3a9bc4){return _0x3a9bc4[_0xe9bd('0x108')](_0x54b3e9[_0xe9bd('0x30')][_0xe9bd('0x109')],_[_0xe9bd('0x10a')](_0x54b3e9['body'],[_0xe9bd('0x109'),'id'])||{});}})['then'](respondWithResult(_0x453d10,null))[_0xe9bd('0x3c')](handleError(_0x453d10,null));};exports[_0xe9bd('0x10b')]=function(_0x33e998,_0x38f3ae){var _0x56541e={'raw':![],'where':{}};var _0x22ca72={};var _0x3bae9d={'count':0x0,'rows':[]};return db[_0xe9bd('0xc2')]['findOne']({'where':{'id':_0x33e998['params']['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x38f3ae,null))[_0xe9bd('0x2b')](function(_0x6e1fd3){if(_0x6e1fd3){_0x22ca72[_0xe9bd('0x4b')]=_[_0xe9bd('0x4d')](db[_0xe9bd('0xd4')]['rawAttributes']);_0x22ca72[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x33e998[_0xe9bd('0x4c')]);_0x22ca72[_0xe9bd('0x56')]=_['intersection'](_0x22ca72[_0xe9bd('0x4b')],_0x22ca72[_0xe9bd('0x4c')]);_0x56541e[_0xe9bd('0x50')]=_['intersection'](_0x22ca72[_0xe9bd('0x4b')],qs[_0xe9bd('0x4f')](_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x4f')]));_0x56541e[_0xe9bd('0x50')]=_0x56541e[_0xe9bd('0x50')][_0xe9bd('0x70')]?_0x56541e['attributes']:_0x22ca72['model'];if(!_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x51')](_0xe9bd('0x52'))){_0x56541e['limit']=qs['limit'](_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x25')]);_0x56541e[_0xe9bd('0x24')]=qs['offset'](_0x33e998[_0xe9bd('0x4c')]['offset']);}_0x56541e[_0xe9bd('0x9e')]=qs[_0xe9bd('0x53')](_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x53')]);_0x56541e[_0xe9bd('0x54')]=qs[_0xe9bd('0x56')](_[_0xe9bd('0x55')](_0x33e998[_0xe9bd('0x4c')],_0x22ca72[_0xe9bd('0x56')]));_0x56541e['where']['ChatInteractionId']=_0x6e1fd3['id'];if(_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x95')]){_0x56541e[_0xe9bd('0x54')]=_[_0xe9bd('0x2f')](_0x56541e[_0xe9bd('0x54')],{'$or':_[_0xe9bd('0x46')](_0x56541e[_0xe9bd('0x50')],function(_0xdfc5ca){var _0x593e55={};_0x593e55[_0xdfc5ca]={'$like':'%'+_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x95')]+'%'};return _0x593e55;})});}if(_0x33e998['query'][_0xe9bd('0x8a')]){var _0x4c4890=_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0x8a')][_0xe9bd('0x39')](',');var _0x5a7a61={};_0x5a7a61[_0x4c4890[0x0]]={'$gte':moment(_0x4c4890[0x1])[_0xe9bd('0xef')](_0xe9bd('0x10c'))};_0x56541e['where']=_[_0xe9bd('0x2f')](_0x56541e[_0xe9bd('0x54')],_0x5a7a61);}_0x56541e=_[_0xe9bd('0x2f')]({},_0x56541e,_0x33e998[_0xe9bd('0xc0')]);return db[_0xe9bd('0xd4')]['count']({'where':_0x56541e[_0xe9bd('0x54')]})[_0xe9bd('0x2b')](function(_0x993518){_0x3bae9d[_0xe9bd('0x27')]=_0x993518;if(_0x33e998[_0xe9bd('0x4c')][_0xe9bd('0xbe')]){_0x56541e['include']=[{'all':!![]}];}return db[_0xe9bd('0xd4')]['findAll'](_0x56541e);})[_0xe9bd('0x2b')](function(_0x560ed7){_0x3bae9d[_0xe9bd('0x10d')]=_0x560ed7;return _0x3bae9d;});}})[_0xe9bd('0x2b')](respondWithFilteredResult(_0x38f3ae,_0x56541e))['catch'](handleError(_0x38f3ae,null));};exports[_0xe9bd('0x10e')]=function(_0x170bf0,_0x5a8d1a){var _0xd2c2a1={'where':{}},_0x4b269d={},_0x557cf5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe9bd('0xe5')]({'where':{'id':_0x170bf0[_0xe9bd('0xbd')]['id']}})['then'](handleEntityNotFound(_0x5a8d1a,null))['then'](function(_0x367dcc){if(_0x367dcc){_0x4b269d['model']=_[_0xe9bd('0x4d')](db[_0xe9bd('0xd4')]['rawAttributes']);_0x4b269d[_0xe9bd('0x4c')]=_[_0xe9bd('0x4d')](_0x170bf0[_0xe9bd('0x4c')]);_0x4b269d[_0xe9bd('0x56')]=_[_0xe9bd('0x4e')](_0x4b269d[_0xe9bd('0x4b')],_0x4b269d[_0xe9bd('0x4c')]);_0xd2c2a1[_0xe9bd('0x50')]=_[_0xe9bd('0x4e')](_0x4b269d[_0xe9bd('0x4b')],qs[_0xe9bd('0x4f')](_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x4f')]));_0xd2c2a1['attributes']=_0xd2c2a1[_0xe9bd('0x50')][_0xe9bd('0x70')]?_0xd2c2a1[_0xe9bd('0x50')]:_0x4b269d[_0xe9bd('0x4b')];if(!_0x170bf0[_0xe9bd('0x4c')]['hasOwnProperty'](_0xe9bd('0x52'))){_0xd2c2a1[_0xe9bd('0x25')]=qs[_0xe9bd('0x25')](_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x25')]);_0xd2c2a1[_0xe9bd('0x24')]=qs[_0xe9bd('0x24')](_0x170bf0['query'][_0xe9bd('0x24')]);}_0xd2c2a1[_0xe9bd('0x9e')]=qs['sort'](_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x53')]);_0xd2c2a1[_0xe9bd('0x54')]=qs[_0xe9bd('0x56')](_[_0xe9bd('0x55')](_0x170bf0[_0xe9bd('0x4c')],_0x4b269d[_0xe9bd('0x56')]));_0xd2c2a1[_0xe9bd('0x54')]['ChatInteractionId']=_0x367dcc['id'];if(_0x170bf0[_0xe9bd('0x4c')][_0xe9bd('0x95')]){_0xd2c2a1[_0xe9bd('0x54')]=_['merge'](_0xd2c2a1[_0xe9bd('0x54')],{'$or':_[_0xe9bd('0x46')](_0xd2c2a1['attributes'],function(_0x48dc13){var _0xebabdd={};_0xebabdd[_0x48dc13]={'$like':'%'+_0x170bf0['query'][_0xe9bd('0x95')]+'%'};return _0xebabdd;})});}_0xd2c2a1[_0xe9bd('0x54')][_0xe9bd('0xfe')]=![];if(_0x170bf0[_0xe9bd('0x4c')]['id']){_0xd2c2a1[_0xe9bd('0x54')]['id']={'$gt':_0x170bf0[_0xe9bd('0x4c')]['id']};}_0xd2c2a1=_[_0xe9bd('0x2f')]({},_0xd2c2a1,_0x170bf0[_0xe9bd('0xc0')]);return db['ChatMessage'][_0xe9bd('0x27')]({'where':_0xd2c2a1[_0xe9bd('0x54')]})[_0xe9bd('0x2b')](function(_0x351791){_0x557cf5[_0xe9bd('0x27')]=_0x351791;_0xd2c2a1[_0xe9bd('0xbf')]=[];if(_0x170bf0['query'][_0xe9bd('0x10f')]){_0xd2c2a1[_0xe9bd('0xbf')][_0xe9bd('0x3b')]({'model':db[_0xe9bd('0x7f')],'as':_0xe9bd('0x7f'),'attributes':['id',_0xe9bd('0x36'),_0xe9bd('0xf9')]});}if(_0x170bf0[_0xe9bd('0x4c')]['includeAll']){_0xd2c2a1['include']=[{'all':!![]}];}return db[_0xe9bd('0xd4')][_0xe9bd('0x110')](_0xd2c2a1);})[_0xe9bd('0x2b')](function(_0xc219e9){_0x557cf5[_0xe9bd('0x10d')]=_0xc219e9;return _0x557cf5;});}})[_0xe9bd('0x2b')](respondWithFilteredResult(_0x5a8d1a,_0xd2c2a1))[_0xe9bd('0x3c')](handleError(_0x5a8d1a,null));};exports[_0xe9bd('0x111')]=function(_0x432aea,_0x2301ce){return db['ChatInteraction'][_0xe9bd('0x81')]({'where':{'id':_0x432aea[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x2301ce,null))[_0xe9bd('0x2b')](function(_0x2e6329){if(_0x2e6329){return _0x2e6329[_0xe9bd('0x112')](_0x432aea[_0xe9bd('0x30')]['ids'],_[_0xe9bd('0x10a')](_0x432aea[_0xe9bd('0x30')],[_0xe9bd('0x109'),'id'])||{})[_0xe9bd('0x113')](function(){return db[_0xe9bd('0x114')]['findAll']({'attributes':['id',_0xe9bd('0x2c'),_0xe9bd('0x115')],'where':{'id':_0x432aea[_0xe9bd('0x30')][_0xe9bd('0x109')]}});})[_0xe9bd('0x2b')](function(_0x47d0d5){socket[_0xe9bd('0x116')]('chatInteractionTags:save',{'id':Number(_0x432aea[_0xe9bd('0xbd')]['id']),'tags':_0x47d0d5||[]});return{'id':Number(_0x432aea[_0xe9bd('0xbd')]['id']),'tags':_0x47d0d5||[]};});}})[_0xe9bd('0x2b')](respondWithResult(_0x2301ce,null))['catch'](handleError(_0x2301ce,null));};exports['removeTags']=function(_0x38096d,_0x3ad097){return db[_0xe9bd('0xc2')]['find']({'where':{'id':_0x38096d[_0xe9bd('0xbd')]['id']}})[_0xe9bd('0x2b')](handleEntityNotFound(_0x3ad097,null))[_0xe9bd('0x2b')](function(_0x1d6363){if(_0x1d6363){return _0x1d6363[_0xe9bd('0x117')](_0x38096d[_0xe9bd('0x4c')][_0xe9bd('0x109')]);}})[_0xe9bd('0x2b')](respondWithStatusCode(_0x3ad097,null))[_0xe9bd('0x3c')](handleError(_0x3ad097,null));};exports[_0xe9bd('0xed')]=function(_0x1bae64,_0x23f104){var _0x3b5bca=moment()[_0xe9bd('0x118')]()['toString']();var _0x3fe9ca=path[_0xe9bd('0xe9')](config['root'],_0xe9bd('0x119'),_0xe9bd('0x11a'),_0xe9bd('0x11b'));var _0x4335ad=path['join'](config[_0xe9bd('0xea')],_0xe9bd('0x119'),_0xe9bd('0x11a'),_0xe9bd('0x11c'));var _0x52d59e=path['join'](_0x3fe9ca,_0x3b5bca);var _0x3107f0=util['format'](_0xe9bd('0x11d'),_0x1bae64[_0xe9bd('0xbd')]['id'],_0x3b5bca);var _0x8f8874=path[_0xe9bd('0xe9')](_0x3fe9ca,_0x3107f0);var _0x240cd0=[];_0x240cd0['push']({'model':db[_0xe9bd('0x7f')],'as':_0xe9bd('0x7f'),'attributes':['id',_0xe9bd('0x36')],'raw':!![]});_0x240cd0[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0xd8')],'as':_0xe9bd('0x75'),'attributes':['id',_0xe9bd('0x11e'),'lastName'],'raw':!![]});if(_0x1bae64[_0xe9bd('0x4c')][_0xe9bd('0x11c')]){_0x240cd0[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0xe3')],'as':_0xe9bd('0xe3'),'raw':!![]});}var _0x5f3e76=[{'model':db[_0xe9bd('0xd4')],'as':_0xe9bd('0xf2'),'attributes':['id',_0xe9bd('0x30'),_0xe9bd('0x88'),_0xe9bd('0xfd'),_0xe9bd('0xfe'),_0xe9bd('0x90')],'include':_0x240cd0}];_0x5f3e76[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0xf1')],'as':_0xe9bd('0x11f'),'attributes':['id',_0xe9bd('0x2c')]});_0x5f3e76[_0xe9bd('0x3b')]({'model':db[_0xe9bd('0x7f')],'as':_0xe9bd('0x120'),'attributes':['id',_0xe9bd('0x36')]});return db[_0xe9bd('0xc2')][_0xe9bd('0x81')]({'where':{'id':_0x1bae64[_0xe9bd('0xbd')]['id']},'include':_0x5f3e76})[_0xe9bd('0x2b')](handleEntityNotFound(_0x23f104,null))[_0xe9bd('0x2b')](function(_0x5e6e02){if(_0x5e6e02){var _0xa3e69c=_0x5e6e02[_0xe9bd('0x121')]({'plain':!![]});fs[_0xe9bd('0x122')](_0x52d59e);var _0x126e47={'channel':'Chat','account':_0xa3e69c[_0xe9bd('0x11f')]['name'],'agent':_0xa3e69c['Owner']?_0xa3e69c['Owner']['fullname']:_0xe9bd('0x123'),'createdAt':moment(_0xa3e69c[_0xe9bd('0x88')])[_0xe9bd('0xef')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9bd('0xa8')](),'closedAt':_0xa3e69c['closed']?moment(_0xa3e69c[_0xe9bd('0x124')])[_0xe9bd('0xef')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9bd('0xa8')]():'','disposition':_0xa3e69c['disposition'],'chatInfo':{'browser':_0xa3e69c['browserName'],'os':_0xa3e69c[_0xe9bd('0x125')],'referer':_0xa3e69c[_0xe9bd('0x126')],'customerIp':_0xa3e69c[_0xe9bd('0x127')],'customerPort':_0xa3e69c['customerPort']?_0xa3e69c[_0xe9bd('0x128')]:'N.A.'},'messages':_(_0xa3e69c[_0xe9bd('0xf2')])['tail']()[_0xe9bd('0x95')]({'secret':![]})[_0xe9bd('0x46')](function(_0x38aa10){if(_0x38aa10['Attachment']){var _0x1402d0=path['join'](_0x4335ad,_0x38aa10[_0xe9bd('0xe3')][_0xe9bd('0xe0')]);if(fs[_0xe9bd('0x129')](_0x1402d0)){fs[_0xe9bd('0x12a')](_0x1402d0)[_0xe9bd('0x12b')](fs[_0xe9bd('0x12c')](path[_0xe9bd('0xe9')](_0x52d59e,_0x38aa10[_0xe9bd('0xe3')][_0xe9bd('0xe0')])));}}return{'date':moment(_0x38aa10[_0xe9bd('0x88')])[_0xe9bd('0xef')](_0xe9bd('0x10c'))[_0xe9bd('0xa8')](),'sender':_0x38aa10[_0xe9bd('0xfd')]===_0xe9bd('0xd3')?_0x38aa10[_0xe9bd('0x7f')]?_0x38aa10[_0xe9bd('0x7f')][_0xe9bd('0x36')]:_0xe9bd('0xf5'):_0x38aa10[_0xe9bd('0x75')][_0xe9bd('0x11e')]+(_0x38aa10['Contact'][_0xe9bd('0x12d')]?'\x20'+_0x38aa10[_0xe9bd('0x75')]['lastName']:''),'body':_0x38aa10[_0xe9bd('0xe3')]?_0x38aa10[_0xe9bd('0xe3')][_0xe9bd('0xe0')]:_0x38aa10[_0xe9bd('0x30')],'direction':_0x38aa10[_0xe9bd('0xfd')]==='out'?'A':'C','secret':_0x38aa10[_0xe9bd('0xfe')],'read':_0x38aa10[_0xe9bd('0x90')],'attachment':_0x38aa10[_0xe9bd('0xe3')]};})[_0xe9bd('0x72')]()};return ejs[_0xe9bd('0x12e')](path[_0xe9bd('0xe9')](config[_0xe9bd('0xea')],_0xe9bd('0x119'),_0xe9bd('0x12f'),_0xe9bd('0x130')),{'interaction':_0x126e47})['then'](function(_0x14f61d){var _0x271116=path[_0xe9bd('0xe9')](_0x52d59e,_0xe9bd('0x131')+_0xa3e69c['id']+'-'+_0x3b5bca+_0xe9bd('0x132'));var _0x45da6a={'path':_0x271116,'channel':_0xe9bd('0x133'),'interactionId':_0xa3e69c['id']};return pdf[_0xe9bd('0x134')](_0x14f61d,_0x45da6a);})['then'](function(){return new Promise(function(_0x34c5f,_0x25b453){zipdir(_0x52d59e,{'saveTo':_0x8f8874},function(_0x2d9878,_0x10ea33){if(_0x2d9878)return _0x25b453(_0x2d9878);return _0x34c5f(_0x10ea33);});})['then'](function(){return new BPromise(function(_0x138630,_0x3682d1){rimraf(_0x52d59e,function(_0x298c03){if(_0x298c03)_0x3682d1(_0x298c03);return _0x138630();});});})[_0xe9bd('0x2b')](function(){return _0x23f104[_0xe9bd('0xed')](_0x8f8874,_0x3107f0,function(_0x3f4426){if(_0x3f4426){logger[_0xe9bd('0x1c')](_0xe9bd('0x135'),_0x3f4426);}else{fs['unlinkSync'](_0x8f8874);}});});});}else{return _0x23f104[_0xe9bd('0x20')](0xc8);}})['catch'](handleError(_0x23f104,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7b4f055..be57f97 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 _0x6577=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x222261,_0x43c2fd){var _0x2df777=function(_0x1299f8){while(--_0x1299f8){_0x222261['push'](_0x222261['shift']());}};_0x2df777(++_0x43c2fd);}(_0x6577,0x17d));var _0x7657=function(_0x2ad674,_0x2e5407){_0x2ad674=_0x2ad674-0x0;var _0x1e89c1=_0x6577[_0x2ad674];return _0x1e89c1;};'use strict';var EventEmitter=require(_0x7657('0x0'));var ChatInteraction=require(_0x7657('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x7657('0x1'))['db'][_0x7657('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7657('0x3')](0x0);var events={'afterCreate':_0x7657('0x4'),'afterUpdate':_0x7657('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e8b31){return function(_0x777d5,_0x418744,_0x3b5c33){_0x777d5[_0x7657('0x6')]({'attributes':['id'],'raw':!![]})[_0x7657('0x7')](function(_0x4d4ec3){_0x777d5[_0x7657('0x8')](_0x7657('0x9'),_0x4d4ec3['map'](function(_0x3e0bee){return{'id':_0x3e0bee['id']};}));return ChatMessage[_0x7657('0xa')]({'where':{'ChatInteractionId':_0x777d5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7657('0x7')](function(_0x439fd1){_0x777d5[_0x7657('0x8')](_0x7657('0xb'),_0x439fd1[_0x7657('0xc')]);ChatInteractionEvents[_0x7657('0xd')](_0x4e8b31+':'+_0x777d5['id'],_0x777d5);ChatInteractionEvents['emit'](_0x4e8b31,_0x777d5);_0x3b5c33(null);})[_0x7657('0xe')](_0x3b5c33(null));};}for(var e in events){if(events[_0x7657('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x7657('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb0da=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x56dc1f,_0x17f87f){var _0x30f9b9=function(_0x158ff5){while(--_0x158ff5){_0x56dc1f['push'](_0x56dc1f['shift']());}};_0x30f9b9(++_0x17f87f);}(_0xb0da,0x8e));var _0xab0d=function(_0x1532fb,_0x2e6b6f){_0x1532fb=_0x1532fb-0x0;var _0x379876=_0xb0da[_0x1532fb];return _0x379876;};'use strict';var EventEmitter=require(_0xab0d('0x0'));var ChatInteraction=require(_0xab0d('0x1'))['db'][_0xab0d('0x2')];var ChatMessage=require(_0xab0d('0x1'))['db'][_0xab0d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xab0d('0x4')](0x0);var events={'afterCreate':_0xab0d('0x5'),'afterUpdate':_0xab0d('0x6'),'afterDestroy':_0xab0d('0x7')};function emitEvent(_0x4f6b6b){return function(_0x1e7c2b,_0x4330f6,_0x2d7100){_0x1e7c2b[_0xab0d('0x8')]({'attributes':['id'],'raw':!![]})[_0xab0d('0x9')](function(_0x136123){_0x1e7c2b[_0xab0d('0xa')](_0xab0d('0xb'),_0x136123['map'](function(_0x58cc82){return{'id':_0x58cc82['id']};}));return ChatMessage[_0xab0d('0xc')]({'where':{'ChatInteractionId':_0x1e7c2b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xab0d('0x9')](function(_0x42e687){_0x1e7c2b[_0xab0d('0xa')](_0xab0d('0xd'),_0x42e687[_0xab0d('0xe')]);ChatInteractionEvents[_0xab0d('0xf')](_0x4f6b6b+':'+_0x1e7c2b['id'],_0x1e7c2b);ChatInteractionEvents[_0xab0d('0xf')](_0x4f6b6b,_0x1e7c2b);_0x2d7100(null);})[_0xab0d('0x10')](_0x2d7100(null));};}for(var e in events){if(events[_0xab0d('0x11')](e)){var event=events[e];ChatInteraction[_0xab0d('0x12')](e,emitEvent(event));}}module[_0xab0d('0x13')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index f5efefa..da9c92b 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 _0xbcd9=['define','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x2787ed,_0xdc2719){var _0x3c34d7=function(_0x32cb14){while(--_0x32cb14){_0x2787ed['push'](_0x2787ed['shift']());}};_0x3c34d7(++_0xdc2719);}(_0xbcd9,0x8d));var _0x9bcd=function(_0x351c82,_0x226be4){_0x351c82=_0x351c82-0x0;var _0x145079=_0xbcd9[_0x351c82];return _0x145079;};'use strict';var _=require(_0x9bcd('0x0'));var util=require(_0x9bcd('0x1'));var logger=require(_0x9bcd('0x2'))('api');var moment=require(_0x9bcd('0x3'));var BPromise=require(_0x9bcd('0x4'));var rp=require(_0x9bcd('0x5'));var fs=require('fs');var path=require(_0x9bcd('0x6'));var rimraf=require(_0x9bcd('0x7'));var config=require(_0x9bcd('0x8'));var attributes=require(_0x9bcd('0x9'));module[_0x9bcd('0xa')]=function(_0x4e89b5,_0xe77d93){return _0x4e89b5[_0x9bcd('0xb')](_0x9bcd('0xc'),attributes,{'tableName':_0x9bcd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f2318,_0x1780e2,_0x55d1ac){if(_0x3f2318['changed']('closed')){_0x3f2318[_0x9bcd('0xe')]=moment()[_0x9bcd('0xf')](_0x9bcd('0x10'));}_0x55d1ac(null,_0x3f2318);}},'charset':_0x9bcd('0x11'),'collate':_0x9bcd('0x12')});};
\ No newline at end of file
+var _0x56d7=['rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x30a6ce,_0x2f3243){var _0x59fedc=function(_0x48627a){while(--_0x48627a){_0x30a6ce['push'](_0x30a6ce['shift']());}};_0x59fedc(++_0x2f3243);}(_0x56d7,0x7f));var _0x756d=function(_0x425541,_0x5dec0e){_0x425541=_0x425541-0x0;var _0x455616=_0x56d7[_0x425541];return _0x455616;};'use strict';var _=require(_0x756d('0x0'));var util=require('util');var logger=require(_0x756d('0x1'))(_0x756d('0x2'));var moment=require(_0x756d('0x3'));var BPromise=require('bluebird');var rp=require(_0x756d('0x4'));var fs=require('fs');var path=require(_0x756d('0x5'));var rimraf=require(_0x756d('0x6'));var config=require(_0x756d('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x756d('0x8')]=function(_0x5a6e0a,_0xdf79a){return _0x5a6e0a[_0x756d('0x9')](_0x756d('0xa'),attributes,{'tableName':_0x756d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22891a,_0x418c4f,_0x22111d){if(_0x22891a[_0x756d('0xc')](_0x756d('0xd'))){_0x22891a[_0x756d('0xe')]=moment()[_0x756d('0xf')](_0x756d('0x10'));}_0x22111d(null,_0x22891a);}},'charset':_0x756d('0x11'),'collate':_0x756d('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index bb8526f..3bdc645 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 _0xd902=['result','catch','update','body','options','raw','attributes','limit','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','find','where','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3afcb6,_0x4320ea){var _0x4ec015=function(_0x1dff63){while(--_0x1dff63){_0x3afcb6['push'](_0x3afcb6['shift']());}};_0x4ec015(++_0x4320ea);}(_0xd902,0x19e));var _0x2d90=function(_0x43a4c2,_0x4e400f){_0x43a4c2=_0x43a4c2-0x0;var _0x3cd4fb=_0xd902[_0x43a4c2];return _0x3cd4fb;};'use strict';var _=require('lodash');var util=require(_0x2d90('0x0'));var moment=require(_0x2d90('0x1'));var BPromise=require(_0x2d90('0x2'));var rs=require(_0x2d90('0x3'));var fs=require('fs');var Redis=require(_0x2d90('0x4'));var db=require(_0x2d90('0x5'))['db'];var utils=require(_0x2d90('0x6'));var logger=require(_0x2d90('0x7'))(_0x2d90('0x8'));var config=require('../../config/environment');var jayson=require(_0x2d90('0x9'));var client=jayson[_0x2d90('0xa')][_0x2d90('0xb')]({'port':0x232a});config[_0x2d90('0xc')]=_['defaults'](config[_0x2d90('0xc')],{'host':_0x2d90('0xd'),'port':0x18eb});var socket=require(_0x2d90('0xe'))(new Redis(config[_0x2d90('0xc')]));require(_0x2d90('0xf'))[_0x2d90('0x10')](socket);function respondWithRpcPromise(_0x598b02,_0x118dca,_0x33480a){return new BPromise(function(_0x3f0a73,_0x8fa7d3){return client[_0x2d90('0x11')](_0x598b02,_0x33480a)[_0x2d90('0x12')](function(_0x2f25fb){logger[_0x2d90('0x13')](_0x2d90('0x14'),_0x118dca,_0x2d90('0x15'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x118dca,_0x2d90('0x15'),JSON[_0x2d90('0x16')](_0x2f25fb));if(_0x2f25fb[_0x2d90('0x17')]){if(_0x2f25fb[_0x2d90('0x17')][_0x2d90('0x18')]===0x1f4){logger[_0x2d90('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x118dca,_0x2f25fb[_0x2d90('0x17')][_0x2d90('0x19')]);return _0x8fa7d3(_0x2f25fb['error']['message']);}logger['error'](_0x2d90('0x14'),_0x118dca,_0x2f25fb[_0x2d90('0x17')]['message']);return _0x3f0a73(_0x2f25fb['error'][_0x2d90('0x19')]);}else{logger[_0x2d90('0x13')](_0x2d90('0x14'),_0x118dca,_0x2d90('0x15'));_0x3f0a73(_0x2f25fb[_0x2d90('0x1a')]['message']);}})[_0x2d90('0x1b')](function(_0x45670d){logger[_0x2d90('0x17')](_0x2d90('0x14'),_0x118dca,_0x45670d);_0x8fa7d3(_0x45670d);});});}exports['UpdateChatInteraction']=function(_0x43016c){var _0xc95225=this;return new Promise(function(_0x15a0f8,_0x25757c){return db['ChatInteraction'][_0x2d90('0x1c')](_0x43016c[_0x2d90('0x1d')],{'raw':_0x43016c[_0x2d90('0x1e')]?_0x43016c['options'][_0x2d90('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43016c['options']?_0x43016c['options']['where']||null:null,'attributes':_0x43016c[_0x2d90('0x1e')]?_0x43016c[_0x2d90('0x1e')][_0x2d90('0x20')]||null:null,'limit':_0x43016c[_0x2d90('0x1e')]?_0x43016c[_0x2d90('0x1e')][_0x2d90('0x21')]||null:null})['then'](function(_0x4aae1d){logger[_0x2d90('0x13')](_0x2d90('0x22'),_0x43016c);logger[_0x2d90('0x23')](_0x2d90('0x22'),_0x43016c,JSON[_0x2d90('0x16')](_0x4aae1d));_0x15a0f8(_0x4aae1d);})[_0x2d90('0x1b')](function(_0x2a884d){logger[_0x2d90('0x17')](_0x2d90('0x22'),_0x2a884d[_0x2d90('0x19')],_0x43016c);_0x25757c(_0xc95225[_0x2d90('0x17')](0x1f4,_0x2a884d['message']));});});};exports[_0x2d90('0x24')]=function(_0x4c011d){return new Promise(function(_0x43c9d1,_0x483545){return db[_0x2d90('0x25')][_0x2d90('0x26')]({'where':_0x4c011d[_0x2d90('0x1e')]?_0x4c011d[_0x2d90('0x1e')][_0x2d90('0x27')]||null:null})[_0x2d90('0x12')](function(_0x1c2f4e){if(_0x1c2f4e){return _0x1c2f4e[_0x2d90('0x28')](_0x4c011d['body'][_0x2d90('0x29')],_['omit'](_0x4c011d[_0x2d90('0x1d')],['ids','id'])||{});}})[_0x2d90('0x2a')](function(_0x5569d4){logger[_0x2d90('0x13')]('AddTags',_0x4c011d);logger[_0x2d90('0x23')](_0x2d90('0x2b'),_0x4c011d,JSON[_0x2d90('0x16')](_0x5569d4));_0x43c9d1(_0x5569d4);})[_0x2d90('0x1b')](function(_0x488083){logger['error'](_0x2d90('0x2b'),_0x488083['message'],_0x4c011d);_0x483545(_this[_0x2d90('0x17')](0x1f4,_0x488083[_0x2d90('0x19')]));});});};
\ No newline at end of file
+var _0x68b8=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','options','attributes','AddTagsToChatInteraction','where','body','ids','omit','spread','AddTags','lodash','util'];(function(_0x299b96,_0x243cb1){var _0x2ae4a5=function(_0x41493a){while(--_0x41493a){_0x299b96['push'](_0x299b96['shift']());}};_0x2ae4a5(++_0x243cb1);}(_0x68b8,0x9a));var _0x868b=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0x68b8[_0xb6a965];return _0x51d37d;};'use strict';var _=require(_0x868b('0x0'));var util=require(_0x868b('0x1'));var moment=require(_0x868b('0x2'));var BPromise=require(_0x868b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x868b('0x4'))['db'];var utils=require(_0x868b('0x5'));var logger=require(_0x868b('0x6'))(_0x868b('0x7'));var config=require(_0x868b('0x8'));var jayson=require(_0x868b('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x868b('0xa')]=_[_0x868b('0xb')](config[_0x868b('0xa')],{'host':_0x868b('0xc'),'port':0x18eb});var socket=require(_0x868b('0xd'))(new Redis(config[_0x868b('0xa')]));require(_0x868b('0xe'))[_0x868b('0xf')](socket);function respondWithRpcPromise(_0x54c441,_0x261473,_0x4b9fae){return new BPromise(function(_0x3ea358,_0x2916cf){return client[_0x868b('0x10')](_0x54c441,_0x4b9fae)[_0x868b('0x11')](function(_0x4283c5){logger[_0x868b('0x12')](_0x868b('0x13'),_0x261473,_0x868b('0x14'));logger[_0x868b('0x15')](_0x868b('0x16'),_0x261473,_0x868b('0x14'),JSON[_0x868b('0x17')](_0x4283c5));if(_0x4283c5[_0x868b('0x18')]){if(_0x4283c5[_0x868b('0x18')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x261473,_0x4283c5[_0x868b('0x18')]['message']);return _0x2916cf(_0x4283c5[_0x868b('0x18')][_0x868b('0x19')]);}logger[_0x868b('0x18')](_0x868b('0x13'),_0x261473,_0x4283c5[_0x868b('0x18')]['message']);return _0x3ea358(_0x4283c5[_0x868b('0x18')][_0x868b('0x19')]);}else{logger[_0x868b('0x12')](_0x868b('0x13'),_0x261473,_0x868b('0x14'));_0x3ea358(_0x4283c5[_0x868b('0x1a')]['message']);}})[_0x868b('0x1b')](function(_0x162f01){logger[_0x868b('0x18')](_0x868b('0x13'),_0x261473,_0x162f01);_0x2916cf(_0x162f01);});});}exports[_0x868b('0x1c')]=function(_0x34b71f){var _0x49a27d=this;return new Promise(function(_0x5302f7,_0x2df986){return db[_0x868b('0x1d')]['update'](_0x34b71f['body'],{'raw':_0x34b71f[_0x868b('0x1e')]?_0x34b71f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b71f['options']?_0x34b71f[_0x868b('0x1e')]['where']||null:null,'attributes':_0x34b71f[_0x868b('0x1e')]?_0x34b71f[_0x868b('0x1e')][_0x868b('0x1f')]||null:null,'limit':_0x34b71f['options']?_0x34b71f[_0x868b('0x1e')]['limit']||null:null})[_0x868b('0x11')](function(_0x175b23){logger[_0x868b('0x12')](_0x868b('0x1c'),_0x34b71f);logger[_0x868b('0x15')](_0x868b('0x1c'),_0x34b71f,JSON['stringify'](_0x175b23));_0x5302f7(_0x175b23);})[_0x868b('0x1b')](function(_0x2feeb5){logger['error'](_0x868b('0x1c'),_0x2feeb5['message'],_0x34b71f);_0x2df986(_0x49a27d[_0x868b('0x18')](0x1f4,_0x2feeb5[_0x868b('0x19')]));});});};exports[_0x868b('0x20')]=function(_0x48db48){return new Promise(function(_0x4f5707,_0x8986eb){return db[_0x868b('0x1d')]['find']({'where':_0x48db48['options']?_0x48db48['options'][_0x868b('0x21')]||null:null})['then'](function(_0x31189b){if(_0x31189b){return _0x31189b['addTags'](_0x48db48[_0x868b('0x22')][_0x868b('0x23')],_[_0x868b('0x24')](_0x48db48[_0x868b('0x22')],['ids','id'])||{});}})[_0x868b('0x25')](function(_0x521dd6){logger[_0x868b('0x12')](_0x868b('0x26'),_0x48db48);logger[_0x868b('0x15')](_0x868b('0x26'),_0x48db48,JSON[_0x868b('0x17')](_0x521dd6));_0x4f5707(_0x521dd6);})['catch'](function(_0x1ef97a){logger[_0x868b('0x18')]('AddTags',_0x1ef97a[_0x868b('0x19')],_0x48db48);_0x8986eb(_this[_0x868b('0x18')](0x1f4,_0x1ef97a['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8640bac..ca7a71b 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 _0x545e=['update','emit','removeListener','register','chatInteraction:','save'];(function(_0x1ea114,_0x7ec37d){var _0x277a81=function(_0x37fe4a){while(--_0x37fe4a){_0x1ea114['push'](_0x1ea114['shift']());}};_0x277a81(++_0x7ec37d);}(_0x545e,0x18b));var _0xe545=function(_0x1093dc,_0x3f01f4){_0x1093dc=_0x1093dc-0x0;var _0x42232d=_0x545e[_0x1093dc];return _0x42232d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xe545('0x0'),'remove',_0xe545('0x1')];function createListener(_0x3ca84d,_0x4a2d7b){return function(_0xea3f33){_0x4a2d7b[_0xe545('0x2')](_0x3ca84d,_0xea3f33);};}function removeListener(_0x1373dc,_0x38a2e3){return function(){ChatInteractionEvents[_0xe545('0x3')](_0x1373dc,_0x38a2e3);};}exports[_0xe545('0x4')]=function(_0x2f6b7c){for(var _0x1eb18d=0x0,_0x55250b=events['length'];_0x1eb18d<_0x55250b;_0x1eb18d++){var _0x18e14d=events[_0x1eb18d];var _0x53a533=createListener(_0xe545('0x5')+_0x18e14d,_0x2f6b7c);ChatInteractionEvents['on'](_0x18e14d,_0x53a533);}};
\ No newline at end of file
+var _0xd26d=['save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x296118,_0x39a635){var _0x2c6a98=function(_0x1d622d){while(--_0x1d622d){_0x296118['push'](_0x296118['shift']());}};_0x2c6a98(++_0x39a635);}(_0xd26d,0x108));var _0xdd26=function(_0x50abc4,_0x558d64){_0x50abc4=_0x50abc4-0x0;var _0x5a745d=_0xd26d[_0x50abc4];return _0x5a745d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xdd26('0x0'),_0xdd26('0x1'),_0xdd26('0x2')];function createListener(_0x247aba,_0xec5751){return function(_0x1e979c){_0xec5751[_0xdd26('0x3')](_0x247aba,_0x1e979c);};}function removeListener(_0xffa247,_0x5d7819){return function(){ChatInteractionEvents[_0xdd26('0x4')](_0xffa247,_0x5d7819);};}exports[_0xdd26('0x5')]=function(_0x27474f){for(var _0x412c84=0x0,_0x199761=events[_0xdd26('0x6')];_0x412c84<_0x199761;_0x412c84++){var _0x4c1d6b=events[_0x412c84];var _0x5097ca=createListener(_0xdd26('0x7')+_0x4c1d6b,_0x27474f);ChatInteractionEvents['on'](_0x4c1d6b,_0x5097ca);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index e3dddb6..6f7ab9a 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 _0x8027=['delete','chatinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','/:id/messages','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close'];(function(_0x1d451d,_0x19fa31){var _0x33805e=function(_0x1ff380){while(--_0x1ff380){_0x1d451d['push'](_0x1d451d['shift']());}};_0x33805e(++_0x19fa31);}(_0x8027,0x170));var _0x7802=function(_0x590f55,_0x314c3b){_0x590f55=_0x590f55-0x0;var _0x14142f=_0x8027[_0x590f55];return _0x14142f;};'use strict';var multer=require(_0x7802('0x0'));var util=require(_0x7802('0x1'));var path=require(_0x7802('0x2'));var timeout=require(_0x7802('0x3'));var express=require(_0x7802('0x4'));var router=express[_0x7802('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7802('0x6'));var interaction=require(_0x7802('0x7'));var config=require(_0x7802('0x8'));var controller=require('./chatInteraction.controller');router[_0x7802('0x9')]('/',auth[_0x7802('0xa')](),controller['index']);router['get'](_0x7802('0xb'),auth[_0x7802('0xa')](),controller[_0x7802('0xc')]);router[_0x7802('0x9')](_0x7802('0xd'),auth[_0x7802('0xe')](),controller[_0x7802('0xf')]);router[_0x7802('0x9')](_0x7802('0x10'),auth[_0x7802('0xe')](),controller[_0x7802('0x11')]);router['get']('/:id/messages',auth[_0x7802('0xa')](),controller[_0x7802('0x12')]);router['get'](_0x7802('0x13'),auth[_0x7802('0xe')](),controller[_0x7802('0x14')]);router[_0x7802('0x9')](_0x7802('0x15'),auth[_0x7802('0xa')](),controller['download']);router[_0x7802('0x16')]('/',auth['isAuthenticated'](),controller[_0x7802('0x17')]);router['post'](_0x7802('0x18'),auth[_0x7802('0xa')](),controller[_0x7802('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xff9ee6,_0x489c58,_0x57ab83){_0x57ab83(null,path[_0x7802('0x1a')](config[_0x7802('0x1b')],_0x7802('0x1c')));},'filename':function(_0x26ed9f,_0x2a80b2,_0x39702d){_0x39702d(null,util[_0x7802('0x1d')](_0x7802('0x1e'),Date[_0x7802('0x1f')](),_0x2a80b2['originalname'][_0x7802('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7802('0x16')](_0x7802('0x21'),upload[_0x7802('0x22')](_0x7802('0x23')),controller['attachmentUpload']);router[_0x7802('0x16')](_0x7802('0x24'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x7802('0x25'),auth[_0x7802('0xa')](),interaction[_0x7802('0x26')](_0x7802('0x27'),_0x7802('0x28')),controller['addTags']);router[_0x7802('0x29')](_0x7802('0xd'),auth[_0x7802('0xa')](),interaction['tracked']('chat',_0x7802('0x2a')),controller['update']);router[_0x7802('0x29')](_0x7802('0x2b'),controller[_0x7802('0x2c')]);router['put']('/:id/abandon',auth[_0x7802('0xe')](),controller[_0x7802('0x2d')]);router[_0x7802('0x29')](_0x7802('0x2e'),controller[_0x7802('0x2f')]);router[_0x7802('0x30')]('/:id',auth[_0x7802('0xa')](),interaction[_0x7802('0x26')](_0x7802('0x27'),_0x7802('0x31')),controller['destroy']);router[_0x7802('0x30')](_0x7802('0x25'),auth['isAuthenticated'](),controller[_0x7802('0x32')]);module[_0x7802('0x33')]=router;
\ No newline at end of file
+var _0x09ed=['show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id'];(function(_0x5ef2e5,_0x496362){var _0x2ddbb3=function(_0x43f82b){while(--_0x43f82b){_0x5ef2e5['push'](_0x5ef2e5['shift']());}};_0x2ddbb3(++_0x496362);}(_0x09ed,0x11a));var _0xd09e=function(_0x5b692c,_0x41b47c){_0x5b692c=_0x5b692c-0x0;var _0x34b91d=_0x09ed[_0x5b692c];return _0x34b91d;};'use strict';var multer=require(_0xd09e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd09e('0x1'));var router=express[_0xd09e('0x2')]();var fs_extra=require(_0xd09e('0x3'));var auth=require(_0xd09e('0x4'));var interaction=require(_0xd09e('0x5'));var config=require(_0xd09e('0x6'));var controller=require(_0xd09e('0x7'));router[_0xd09e('0x8')]('/',auth[_0xd09e('0x9')](),controller['index']);router[_0xd09e('0x8')](_0xd09e('0xa'),auth[_0xd09e('0x9')](),controller['describe']);router[_0xd09e('0x8')](_0xd09e('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xd09e('0xc')]);router['get'](_0xd09e('0xd'),auth[_0xd09e('0xe')](),controller[_0xd09e('0xf')]);router['get'](_0xd09e('0x10'),auth['isAuthenticated'](),controller[_0xd09e('0x11')]);router[_0xd09e('0x8')](_0xd09e('0x12'),auth[_0xd09e('0xe')](),controller['getMyMessages']);router[_0xd09e('0x8')]('/:id/download',auth[_0xd09e('0x9')](),controller['download']);router[_0xd09e('0x13')]('/',auth[_0xd09e('0x9')](),controller[_0xd09e('0x14')]);router[_0xd09e('0x13')](_0xd09e('0x15'),auth[_0xd09e('0x9')](),controller[_0xd09e('0x16')]);var upload=multer({'storage':multer[_0xd09e('0x17')]({'destination':function(_0x3767c5,_0x28069a,_0x458aef){_0x458aef(null,path[_0xd09e('0x18')](config[_0xd09e('0x19')],_0xd09e('0x1a')));},'filename':function(_0x277264,_0x174e99,_0x5b74ff){_0x5b74ff(null,util[_0xd09e('0x1b')]('%s-%s',Date[_0xd09e('0x1c')](),_0x174e99[_0xd09e('0x1d')][_0xd09e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd09e('0x1f'),upload[_0xd09e('0x20')]('file'),controller[_0xd09e('0x21')]);router[_0xd09e('0x13')](_0xd09e('0x10'),auth[_0xd09e('0xe')](),controller['addMessage']);router['post'](_0xd09e('0x22'),auth[_0xd09e('0x9')](),interaction[_0xd09e('0x23')](_0xd09e('0x24'),_0xd09e('0x25')),controller['addTags']);router[_0xd09e('0x26')](_0xd09e('0xb'),auth[_0xd09e('0x9')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0xd09e('0x27')]);router[_0xd09e('0x26')](_0xd09e('0x28'),controller[_0xd09e('0x29')]);router['put']('/:id/abandon',auth[_0xd09e('0xe')](),controller[_0xd09e('0x2a')]);router[_0xd09e('0x26')]('/:id/close',controller[_0xd09e('0x2b')]);router[_0xd09e('0x2c')](_0xd09e('0xb'),auth[_0xd09e('0x9')](),interaction['tracked'](_0xd09e('0x24'),_0xd09e('0x2d')),controller[_0xd09e('0x2e')]);router[_0xd09e('0x2c')](_0xd09e('0x22'),auth[_0xd09e('0x9')](),controller[_0xd09e('0x2f')]);module[_0xd09e('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7f7ee9c..a882184 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 _0x1303=['sequelize','TEXT','medium'];(function(_0x27495a,_0x21df92){var _0x3f781e=function(_0x3d4a11){while(--_0x3d4a11){_0x27495a['push'](_0x27495a['shift']());}};_0x3f781e(++_0x21df92);}(_0x1303,0x162));var _0x3130=function(_0x49eb06,_0x47d2b6){_0x49eb06=_0x49eb06-0x0;var _0x4b8d67=_0x1303[_0x49eb06];return _0x4b8d67;};'use strict';var Sequelize=require(_0x3130('0x0'));module['exports']={'body':{'type':Sequelize[_0x3130('0x1')](_0x3130('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x07c8=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x166a5f,_0x24d6e1){var _0x94b441=function(_0x2ded58){while(--_0x2ded58){_0x166a5f['push'](_0x166a5f['shift']());}};_0x94b441(++_0x24d6e1);}(_0x07c8,0x16a));var _0x807c=function(_0x3483f3,_0x4c9e96){_0x3483f3=_0x3483f3-0x0;var _0x10f710=_0x07c8[_0x3483f3];return _0x10f710;};'use strict';var Sequelize=require(_0x807c('0x0'));module[_0x807c('0x1')]={'body':{'type':Sequelize[_0x807c('0x2')](_0x807c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x807c('0x4')],'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 f228316..07fda30 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 _0xcd68=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3566de,_0x1bec4d){var _0x256439=function(_0xffc93d){while(--_0xffc93d){_0x3566de['push'](_0x3566de['shift']());}};_0x256439(++_0x1bec4d);}(_0xcd68,0xca));var _0x8cd6=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0xcd68[_0x2cd1fb];return _0x48fd2b;};'use strict';var emlformat=require(_0x8cd6('0x0'));var rimraf=require(_0x8cd6('0x1'));var zipdir=require(_0x8cd6('0x2'));var jsonpatch=require(_0x8cd6('0x3'));var rp=require(_0x8cd6('0x4'));var moment=require('moment');var BPromise=require(_0x8cd6('0x5'));var Mustache=require(_0x8cd6('0x6'));var util=require(_0x8cd6('0x7'));var path=require(_0x8cd6('0x8'));var sox=require(_0x8cd6('0x9'));var csv=require(_0x8cd6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cd6('0xb'));var squel=require(_0x8cd6('0xc'));var crypto=require('crypto');var jsforce=require(_0x8cd6('0xd'));var deskjs=require(_0x8cd6('0xe'));var toCsv=require(_0x8cd6('0xa'));var querystring=require(_0x8cd6('0xf'));var Papa=require(_0x8cd6('0x10'));var Redis=require(_0x8cd6('0x11'));var authService=require(_0x8cd6('0x12'));var qs=require(_0x8cd6('0x13'));var as=require(_0x8cd6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cd6('0x15'))(_0x8cd6('0x16'));var utils=require(_0x8cd6('0x17'));var config=require(_0x8cd6('0x18'));var licenseUtil=require(_0x8cd6('0x19'));var db=require('../../mysqldb')['db'];config[_0x8cd6('0x1a')]=_['defaults'](config['redis'],{'host':_0x8cd6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cd6('0x1a')]));require(_0x8cd6('0x1c'))[_0x8cd6('0x1d')](socket);function respondWithStatusCode(_0x206215,_0x460c6a){_0x460c6a=_0x460c6a||0xcc;return function(_0x1963d0){if(_0x1963d0){return _0x206215[_0x8cd6('0x1e')](_0x460c6a);}return _0x206215[_0x8cd6('0x1f')](_0x460c6a)[_0x8cd6('0x20')]();};}function respondWithResult(_0x1a38bb,_0x13adbf){_0x13adbf=_0x13adbf||0xc8;return function(_0x25d130){if(_0x25d130){return _0x1a38bb['status'](_0x13adbf)['json'](_0x25d130);}};}function respondWithFilteredResult(_0x25f82a,_0x3a60c8){return function(_0x4a27cb){if(_0x4a27cb){var _0x50d0c2=typeof _0x3a60c8[_0x8cd6('0x21')]===_0x8cd6('0x22')&&typeof _0x3a60c8[_0x8cd6('0x23')]===_0x8cd6('0x22');var _0x11c51f=_0x4a27cb[_0x8cd6('0x24')];var _0x2bef41=_0x50d0c2?0x0:_0x3a60c8['offset'];var _0x6690d3=_0x50d0c2?_0x4a27cb['count']:_0x3a60c8[_0x8cd6('0x21')]+_0x3a60c8[_0x8cd6('0x23')];var _0x4eab47;if(_0x6690d3>=_0x11c51f){_0x6690d3=_0x11c51f;_0x4eab47=0xc8;}else{_0x4eab47=0xce;}_0x25f82a[_0x8cd6('0x1f')](_0x4eab47);return _0x25f82a[_0x8cd6('0x25')](_0x8cd6('0x26'),_0x2bef41+'-'+_0x6690d3+'/'+_0x11c51f)[_0x8cd6('0x27')](_0x4a27cb);}return null;};}function patchUpdates(_0x15ef8d){return function(_0x58c0cf){try{jsonpatch[_0x8cd6('0x28')](_0x58c0cf,_0x15ef8d,!![]);}catch(_0xac9bfa){return BPromise[_0x8cd6('0x29')](_0xac9bfa);}return _0x58c0cf['save']();};}function saveUpdates(_0x1ae801,_0x6cbb99){return function(_0x204ded){if(_0x204ded){return _0x204ded[_0x8cd6('0x2a')](_0x1ae801)[_0x8cd6('0x2b')](function(_0x5ce440){return _0x5ce440;});}return null;};}function removeEntity(_0x18aaf5,_0x31127a){return function(_0x30ac82){if(_0x30ac82){return _0x30ac82[_0x8cd6('0x2c')]()[_0x8cd6('0x2b')](function(){_0x18aaf5[_0x8cd6('0x1f')](0xcc)[_0x8cd6('0x20')]();});}};}function handleEntityNotFound(_0x3ca2b9,_0xe81df2){return function(_0x24b258){if(!_0x24b258){_0x3ca2b9[_0x8cd6('0x1e')](0x194);}return _0x24b258;};}function handleError(_0x20ea3a,_0x490f11){_0x490f11=_0x490f11||0x1f4;return function(_0x16066e){logger[_0x8cd6('0x2d')](_0x16066e[_0x8cd6('0x2e')]);if(_0x16066e[_0x8cd6('0x2f')]){delete _0x16066e['name'];}_0x20ea3a['status'](_0x490f11)[_0x8cd6('0x30')](_0x16066e);};}exports[_0x8cd6('0x31')]=function(_0x213907,_0xc2cb1f){var _0x4862b5={},_0x276aa2={},_0x2ac641={'count':0x0,'rows':[]};var _0xc64043=_[_0x8cd6('0x32')](db[_0x8cd6('0x33')][_0x8cd6('0x34')],function(_0x34700c){return{'name':_0x34700c[_0x8cd6('0x35')],'type':_0x34700c[_0x8cd6('0x36')][_0x8cd6('0x37')]};});_0x276aa2['model']=_[_0x8cd6('0x32')](_0xc64043,_0x8cd6('0x2f'));_0x276aa2[_0x8cd6('0x38')]=_[_0x8cd6('0x39')](_0x213907['query']);_0x276aa2['filters']=_['intersection'](_0x276aa2[_0x8cd6('0x3a')],_0x276aa2[_0x8cd6('0x38')]);_0x4862b5[_0x8cd6('0x3b')]=_[_0x8cd6('0x3c')](_0x276aa2[_0x8cd6('0x3a')],qs[_0x8cd6('0x3d')](_0x213907['query']['fields']));_0x4862b5[_0x8cd6('0x3b')]=_0x4862b5[_0x8cd6('0x3b')][_0x8cd6('0x3e')]?_0x4862b5['attributes']:_0x276aa2[_0x8cd6('0x3a')];if(!_0x213907[_0x8cd6('0x38')]['hasOwnProperty']('nolimit')){_0x4862b5[_0x8cd6('0x23')]=qs[_0x8cd6('0x23')](_0x213907['query'][_0x8cd6('0x23')]);_0x4862b5['offset']=qs[_0x8cd6('0x21')](_0x213907[_0x8cd6('0x38')][_0x8cd6('0x21')]);}_0x4862b5['order']=qs[_0x8cd6('0x3f')](_0x213907[_0x8cd6('0x38')][_0x8cd6('0x3f')]);_0x4862b5[_0x8cd6('0x40')]=qs[_0x8cd6('0x41')](_['pick'](_0x213907[_0x8cd6('0x38')],_0x276aa2[_0x8cd6('0x41')]),_0xc64043);if(_0x213907[_0x8cd6('0x38')][_0x8cd6('0x42')]){_0x4862b5[_0x8cd6('0x40')]=_[_0x8cd6('0x43')](_0x4862b5['where'],{'$or':_[_0x8cd6('0x32')](_0xc64043,function(_0x40e241){if(_0x40e241[_0x8cd6('0x36')]!==_0x8cd6('0x44')){var _0xc95e18={};_0xc95e18[_0x40e241[_0x8cd6('0x2f')]]={'$like':'%'+_0x213907[_0x8cd6('0x38')][_0x8cd6('0x42')]+'%'};return _0xc95e18;}})});}_0x4862b5=_[_0x8cd6('0x43')]({},_0x4862b5,_0x213907['options']);var _0x60008c={'where':_0x4862b5[_0x8cd6('0x40')]};return db[_0x8cd6('0x33')][_0x8cd6('0x24')](_0x60008c)[_0x8cd6('0x2b')](function(_0x3a204a){_0x2ac641[_0x8cd6('0x24')]=_0x3a204a;if(_0x213907[_0x8cd6('0x38')][_0x8cd6('0x45')]){_0x4862b5['include']=[{'all':!![]}];}return db[_0x8cd6('0x33')][_0x8cd6('0x46')](_0x4862b5);})[_0x8cd6('0x2b')](function(_0x5717fe){_0x2ac641[_0x8cd6('0x47')]=_0x5717fe;return _0x2ac641;})['then'](respondWithFilteredResult(_0xc2cb1f,_0x4862b5))[_0x8cd6('0x48')](handleError(_0xc2cb1f,null));};exports[_0x8cd6('0x49')]=function(_0x243958,_0x3741a6){var _0x4f76c2={'raw':!![],'where':{'id':_0x243958[_0x8cd6('0x4a')]['id']}},_0x47520b={};_0x47520b[_0x8cd6('0x3a')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x47520b[_0x8cd6('0x38')]=_[_0x8cd6('0x39')](_0x243958['query']);_0x47520b[_0x8cd6('0x41')]=_[_0x8cd6('0x3c')](_0x47520b[_0x8cd6('0x3a')],_0x47520b[_0x8cd6('0x38')]);_0x4f76c2[_0x8cd6('0x3b')]=_[_0x8cd6('0x3c')](_0x47520b[_0x8cd6('0x3a')],qs[_0x8cd6('0x3d')](_0x243958[_0x8cd6('0x38')][_0x8cd6('0x3d')]));_0x4f76c2[_0x8cd6('0x3b')]=_0x4f76c2['attributes']['length']?_0x4f76c2[_0x8cd6('0x3b')]:_0x47520b[_0x8cd6('0x3a')];if(_0x243958['query']['includeAll']){_0x4f76c2[_0x8cd6('0x4b')]=[{'all':!![]}];}_0x4f76c2=_[_0x8cd6('0x43')]({},_0x4f76c2,_0x243958[_0x8cd6('0x4c')]);return db[_0x8cd6('0x33')]['find'](_0x4f76c2)[_0x8cd6('0x2b')](handleEntityNotFound(_0x3741a6,null))[_0x8cd6('0x2b')](respondWithResult(_0x3741a6,null))[_0x8cd6('0x48')](handleError(_0x3741a6,null));};exports[_0x8cd6('0x4d')]=function(_0x225557,_0x4baabb){return db[_0x8cd6('0x33')][_0x8cd6('0x4d')](_0x225557[_0x8cd6('0x4e')],{})[_0x8cd6('0x2b')](respondWithResult(_0x4baabb,0xc9))['catch'](handleError(_0x4baabb,null));};exports['update']=function(_0xa3a484,_0x517ca1){if(_0xa3a484[_0x8cd6('0x4e')]['id']){delete _0xa3a484[_0x8cd6('0x4e')]['id'];}return db[_0x8cd6('0x33')][_0x8cd6('0x4f')]({'where':{'id':_0xa3a484[_0x8cd6('0x4a')]['id']}})[_0x8cd6('0x2b')](handleEntityNotFound(_0x517ca1,null))[_0x8cd6('0x2b')](saveUpdates(_0xa3a484[_0x8cd6('0x4e')],null))['then'](respondWithResult(_0x517ca1,null))[_0x8cd6('0x48')](handleError(_0x517ca1,null));};exports[_0x8cd6('0x2c')]=function(_0x5dec7f,_0x543371){return db[_0x8cd6('0x33')][_0x8cd6('0x4f')]({'where':{'id':_0x5dec7f[_0x8cd6('0x4a')]['id']}})[_0x8cd6('0x2b')](handleEntityNotFound(_0x543371,null))[_0x8cd6('0x2b')](removeEntity(_0x543371,null))[_0x8cd6('0x48')](handleError(_0x543371,null));};exports[_0x8cd6('0x50')]=function(_0x1c072f,_0x2d7884){return db[_0x8cd6('0x33')][_0x8cd6('0x50')]()['then'](respondWithResult(_0x2d7884,null))['catch'](handleError(_0x2d7884,null));};function wrapUser(_0x7fe952){return function(_0x591b77){var _0x2af922=_0x7fe952['get']({'plain':!![]});_0x2af922[_0x8cd6('0x51')]=[];if(_0x591b77){_0x2af922[_0x8cd6('0x52')]=_0x591b77[_0x8cd6('0x53')];_0x2af922[_0x8cd6('0x54')]=_0x591b77;}else{_0x2af922[_0x8cd6('0x52')]=moment(0x0)[_0x8cd6('0x55')](_0x8cd6('0x56'));_0x2af922[_0x8cd6('0x54')]={};}return _0x2af922;};}exports[_0x8cd6('0x57')]=function(_0xf98d05,_0x51435b,_0x277827){var _0x4ec15c=[];return db[_0x8cd6('0x58')][_0x8cd6('0x46')]({'where':{'role':[_0x8cd6('0x59'),'admin',_0x8cd6('0x5a')]},'attributes':['id',_0x8cd6('0x5b'),_0x8cd6('0x2f'),_0x8cd6('0x5c'),'userpic','internal',_0x8cd6('0x5d'),_0x8cd6('0x5e'),_0x8cd6('0x5f'),_0x8cd6('0x60')],'order':qs['sort'](_0x8cd6('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x8cd6('0x62'),'attributes':['id',_0x8cd6('0x2f'),_0x8cd6('0x36')],'through':{'attributes':[]}}]})[_0x8cd6('0x2b')](function(_0x131433){if(_0x131433){var _0x51750d=_0xf98d05[_0x8cd6('0x5a')]['get']({'plain':!![]});if(!_0x51750d)throw new Error(_0x8cd6('0x63'));if(_0x51750d[_0x8cd6('0x5c')]===_0x8cd6('0x5a')){return db[_0x8cd6('0x64')][_0x8cd6('0x4f')]({'where':{'name':_0x8cd6('0x65'),'userProfileId':_0x51750d[_0x8cd6('0x66')]},'raw':!![]})[_0x8cd6('0x2b')](function(_0x480186){if(_0x480186){if(_0x480186[_0x8cd6('0x67')]===0x0){return db[_0x8cd6('0x68')][_0x8cd6('0x46')]({'where':{'sectionId':_0x480186['id']},'raw':!![]})[_0x8cd6('0x2b')](function(_0x4c021f){var _0x41a7e5=[];if(_['isEmpty'](_0x4c021f)){_0x41a7e5=_[_0x8cd6('0x42')](_0x131433,function(_0x1d53b7){if(_0x1d53b7[_0x8cd6('0x5c')]!=='agent'){return _0x1d53b7;}});return _0x41a7e5;}else{for(var _0x2b34b6=0x0;_0x2b34b6<_0x131433['length'];_0x2b34b6++){var _0xd7e6a2=_0x131433[_0x2b34b6];if(_0xd7e6a2[_0x8cd6('0x5c')]===_0x8cd6('0x59')){var _0x34566b=_[_0x8cd6('0x4f')](_0x4c021f,function(_0x160ce2){return _0x160ce2['resourceId']===_0xd7e6a2['id'];});if(_0x34566b)_0x41a7e5[_0x8cd6('0x69')](_0xd7e6a2);}else{_0x41a7e5[_0x8cd6('0x69')](_0xd7e6a2);}}return _0x41a7e5;}});}else{return _0x131433;}}else{var _0xbdf01b=_['filter'](_0x131433,function(_0x349187){if(_0x349187[_0x8cd6('0x5c')]!==_0x8cd6('0x59')){return _0x349187;}});return _0xbdf01b;}});}else{return _0x131433;}}})[_0x8cd6('0x2b')](function(_0x421c41){var _0x1d2be3=[];if(_0x421c41){_0x4ec15c=_0x421c41;for(var _0x31bb44=0x0;_0x31bb44<_0x421c41[_0x8cd6('0x3e')];_0x31bb44+=0x1){_0x4ec15c[_0x31bb44][_0x8cd6('0x51')]=[];_0x1d2be3[_0x8cd6('0x69')](db[_0x8cd6('0x33')][_0x8cd6('0x4f')]({'where':{'FromId':[_0xf98d05[_0x8cd6('0x5a')]['id'],_0x421c41[_0x31bb44]['id']],'ToId':[_0xf98d05[_0x8cd6('0x5a')]['id'],_0x421c41[_0x31bb44]['id']],'ChatGroupId':null},'attributes':['id',_0x8cd6('0x53'),_0x8cd6('0x6a'),_0x8cd6('0x6b'),_0x8cd6('0x6c'),_0x8cd6('0x4e')],'order':qs['sort'](_0x8cd6('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8cd6('0x2b')](wrapUser(_0x421c41[_0x31bb44])));}return BPromise['all'](_0x1d2be3);}return[];})['then'](function(_0x1d03da){return{'rows':_0x1d03da,'count':_0x1d03da[_0x8cd6('0x3e')]};})['then'](respondWithResult(_0x51435b,null))[_0x8cd6('0x48')](handleError(_0x51435b,null));};
\ No newline at end of file
+var _0x6ce6=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','map','ChatInternalMessage','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','filters','create','body','update','find','catch','get','messages','lastMessageAt','createdAt','lastMessage','agent','admin','user','fullname','role','online','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','all','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ce6,0x68));var _0x66ce=function(_0xff13e7,_0x3cbf81){_0xff13e7=_0xff13e7-0x0;var _0x4097a9=_0x6ce6[_0xff13e7];return _0x4097a9;};'use strict';var emlformat=require(_0x66ce('0x0'));var rimraf=require(_0x66ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66ce('0x2'));var rp=require(_0x66ce('0x3'));var moment=require(_0x66ce('0x4'));var BPromise=require(_0x66ce('0x5'));var Mustache=require(_0x66ce('0x6'));var util=require('util');var path=require(_0x66ce('0x7'));var sox=require(_0x66ce('0x8'));var csv=require(_0x66ce('0x9'));var ejs=require(_0x66ce('0xa'));var fs=require('fs');var fs_extra=require(_0x66ce('0xb'));var _=require(_0x66ce('0xc'));var squel=require(_0x66ce('0xd'));var crypto=require('crypto');var jsforce=require(_0x66ce('0xe'));var deskjs=require(_0x66ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x66ce('0x10'));var Papa=require(_0x66ce('0x11'));var Redis=require('ioredis');var authService=require(_0x66ce('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x66ce('0x13'));var hardwareService=require(_0x66ce('0x14'));var logger=require('../../config/logger')(_0x66ce('0x15'));var utils=require(_0x66ce('0x16'));var config=require(_0x66ce('0x17'));var licenseUtil=require(_0x66ce('0x18'));var db=require(_0x66ce('0x19'))['db'];config['redis']=_[_0x66ce('0x1a')](config[_0x66ce('0x1b')],{'host':_0x66ce('0x1c'),'port':0x18eb});var socket=require(_0x66ce('0x1d'))(new Redis(config[_0x66ce('0x1b')]));require('./chatInternalMessage.socket')[_0x66ce('0x1e')](socket);function respondWithStatusCode(_0x37bfb3,_0x67b14f){_0x67b14f=_0x67b14f||0xcc;return function(_0x2daaea){if(_0x2daaea){return _0x37bfb3[_0x66ce('0x1f')](_0x67b14f);}return _0x37bfb3[_0x66ce('0x20')](_0x67b14f)[_0x66ce('0x21')]();};}function respondWithResult(_0x17a593,_0x435ce4){_0x435ce4=_0x435ce4||0xc8;return function(_0x2ac5a9){if(_0x2ac5a9){return _0x17a593[_0x66ce('0x20')](_0x435ce4)[_0x66ce('0x22')](_0x2ac5a9);}};}function respondWithFilteredResult(_0x5a5a04,_0x2b0ab9){return function(_0x18d9f3){if(_0x18d9f3){var _0x4a53ae=typeof _0x2b0ab9[_0x66ce('0x23')]===_0x66ce('0x24')&&typeof _0x2b0ab9[_0x66ce('0x25')]==='undefined';var _0x29d2a1=_0x18d9f3[_0x66ce('0x26')];var _0x14d3f7=_0x4a53ae?0x0:_0x2b0ab9[_0x66ce('0x23')];var _0x888f9b=_0x4a53ae?_0x18d9f3['count']:_0x2b0ab9['offset']+_0x2b0ab9[_0x66ce('0x25')];var _0x1c44b6;if(_0x888f9b>=_0x29d2a1){_0x888f9b=_0x29d2a1;_0x1c44b6=0xc8;}else{_0x1c44b6=0xce;}_0x5a5a04[_0x66ce('0x20')](_0x1c44b6);return _0x5a5a04[_0x66ce('0x27')]('Content-Range',_0x14d3f7+'-'+_0x888f9b+'/'+_0x29d2a1)[_0x66ce('0x22')](_0x18d9f3);}return null;};}function patchUpdates(_0x421c52){return function(_0x3f0f09){try{jsonpatch[_0x66ce('0x28')](_0x3f0f09,_0x421c52,!![]);}catch(_0xe0ce13){return BPromise[_0x66ce('0x29')](_0xe0ce13);}return _0x3f0f09[_0x66ce('0x2a')]();};}function saveUpdates(_0x4dca7b,_0x89b119){return function(_0x501695){if(_0x501695){return _0x501695['update'](_0x4dca7b)[_0x66ce('0x2b')](function(_0x4cfd59){return _0x4cfd59;});}return null;};}function removeEntity(_0x13129f,_0x35d667){return function(_0x2103a7){if(_0x2103a7){return _0x2103a7[_0x66ce('0x2c')]()[_0x66ce('0x2b')](function(){_0x13129f['status'](0xcc)[_0x66ce('0x21')]();});}};}function handleEntityNotFound(_0x143022,_0x1ae3f2){return function(_0x1f8731){if(!_0x1f8731){_0x143022[_0x66ce('0x1f')](0x194);}return _0x1f8731;};}function handleError(_0x166f4a,_0x854656){_0x854656=_0x854656||0x1f4;return function(_0x201ba8){logger[_0x66ce('0x2d')](_0x201ba8[_0x66ce('0x2e')]);if(_0x201ba8['name']){delete _0x201ba8[_0x66ce('0x2f')];}_0x166f4a[_0x66ce('0x20')](_0x854656)[_0x66ce('0x30')](_0x201ba8);};}exports['index']=function(_0x1cc0cc,_0x39a19e){var _0x27071d={},_0x136256={},_0x96d965={'count':0x0,'rows':[]};var _0x2fa51f=_[_0x66ce('0x31')](db[_0x66ce('0x32')][_0x66ce('0x33')],function(_0x3761b2){return{'name':_0x3761b2['fieldName'],'type':_0x3761b2[_0x66ce('0x34')][_0x66ce('0x35')]};});_0x136256['model']=_[_0x66ce('0x31')](_0x2fa51f,'name');_0x136256[_0x66ce('0x36')]=_[_0x66ce('0x37')](_0x1cc0cc[_0x66ce('0x36')]);_0x136256['filters']=_['intersection'](_0x136256[_0x66ce('0x38')],_0x136256[_0x66ce('0x36')]);_0x27071d[_0x66ce('0x39')]=_[_0x66ce('0x3a')](_0x136256[_0x66ce('0x38')],qs[_0x66ce('0x3b')](_0x1cc0cc[_0x66ce('0x36')]['fields']));_0x27071d[_0x66ce('0x39')]=_0x27071d[_0x66ce('0x39')][_0x66ce('0x3c')]?_0x27071d[_0x66ce('0x39')]:_0x136256[_0x66ce('0x38')];if(!_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x3d')](_0x66ce('0x3e'))){_0x27071d[_0x66ce('0x25')]=qs[_0x66ce('0x25')](_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x25')]);_0x27071d[_0x66ce('0x23')]=qs[_0x66ce('0x23')](_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x23')]);}_0x27071d[_0x66ce('0x3f')]=qs[_0x66ce('0x40')](_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x40')]);_0x27071d[_0x66ce('0x41')]=qs['filters'](_['pick'](_0x1cc0cc['query'],_0x136256['filters']),_0x2fa51f);if(_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x42')]){_0x27071d[_0x66ce('0x41')]=_[_0x66ce('0x43')](_0x27071d[_0x66ce('0x41')],{'$or':_[_0x66ce('0x31')](_0x2fa51f,function(_0x10b1ae){if(_0x10b1ae[_0x66ce('0x34')]!==_0x66ce('0x44')){var _0x206e50={};_0x206e50[_0x10b1ae['name']]={'$like':'%'+_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x42')]+'%'};return _0x206e50;}})});}_0x27071d=_[_0x66ce('0x43')]({},_0x27071d,_0x1cc0cc[_0x66ce('0x45')]);var _0xb8c5f={'where':_0x27071d['where']};return db[_0x66ce('0x32')][_0x66ce('0x26')](_0xb8c5f)[_0x66ce('0x2b')](function(_0x2791f9){_0x96d965['count']=_0x2791f9;if(_0x1cc0cc[_0x66ce('0x36')][_0x66ce('0x46')]){_0x27071d[_0x66ce('0x47')]=[{'all':!![]}];}return db[_0x66ce('0x32')][_0x66ce('0x48')](_0x27071d);})['then'](function(_0x1350a7){_0x96d965['rows']=_0x1350a7;return _0x96d965;})[_0x66ce('0x2b')](respondWithFilteredResult(_0x39a19e,_0x27071d))['catch'](handleError(_0x39a19e,null));};exports['show']=function(_0x356262,_0x93d1b1){var _0x3eb017={'raw':!![],'where':{'id':_0x356262[_0x66ce('0x49')]['id']}},_0x468493={};_0x468493[_0x66ce('0x38')]=_[_0x66ce('0x37')](db[_0x66ce('0x32')]['rawAttributes']);_0x468493[_0x66ce('0x36')]=_['keys'](_0x356262['query']);_0x468493[_0x66ce('0x4a')]=_['intersection'](_0x468493[_0x66ce('0x38')],_0x468493[_0x66ce('0x36')]);_0x3eb017[_0x66ce('0x39')]=_[_0x66ce('0x3a')](_0x468493[_0x66ce('0x38')],qs[_0x66ce('0x3b')](_0x356262['query']['fields']));_0x3eb017[_0x66ce('0x39')]=_0x3eb017[_0x66ce('0x39')]['length']?_0x3eb017[_0x66ce('0x39')]:_0x468493[_0x66ce('0x38')];if(_0x356262[_0x66ce('0x36')]['includeAll']){_0x3eb017[_0x66ce('0x47')]=[{'all':!![]}];}_0x3eb017=_[_0x66ce('0x43')]({},_0x3eb017,_0x356262[_0x66ce('0x45')]);return db[_0x66ce('0x32')]['find'](_0x3eb017)['then'](handleEntityNotFound(_0x93d1b1,null))['then'](respondWithResult(_0x93d1b1,null))['catch'](handleError(_0x93d1b1,null));};exports[_0x66ce('0x4b')]=function(_0x578eb2,_0x5e040d){return db[_0x66ce('0x32')][_0x66ce('0x4b')](_0x578eb2[_0x66ce('0x4c')],{})[_0x66ce('0x2b')](respondWithResult(_0x5e040d,0xc9))['catch'](handleError(_0x5e040d,null));};exports[_0x66ce('0x4d')]=function(_0x47c661,_0x11f80e){if(_0x47c661[_0x66ce('0x4c')]['id']){delete _0x47c661['body']['id'];}return db['ChatInternalMessage'][_0x66ce('0x4e')]({'where':{'id':_0x47c661[_0x66ce('0x49')]['id']}})[_0x66ce('0x2b')](handleEntityNotFound(_0x11f80e,null))[_0x66ce('0x2b')](saveUpdates(_0x47c661[_0x66ce('0x4c')],null))['then'](respondWithResult(_0x11f80e,null))[_0x66ce('0x4f')](handleError(_0x11f80e,null));};exports[_0x66ce('0x2c')]=function(_0x44b09b,_0x7166a5){return db[_0x66ce('0x32')]['find']({'where':{'id':_0x44b09b[_0x66ce('0x49')]['id']}})[_0x66ce('0x2b')](handleEntityNotFound(_0x7166a5,null))[_0x66ce('0x2b')](removeEntity(_0x7166a5,null))[_0x66ce('0x4f')](handleError(_0x7166a5,null));};exports['describe']=function(_0x4159d0,_0x4b0d4d){return db[_0x66ce('0x32')]['describe']()['then'](respondWithResult(_0x4b0d4d,null))[_0x66ce('0x4f')](handleError(_0x4b0d4d,null));};function wrapUser(_0x1e04de){return function(_0x48aa97){var _0x2f761a=_0x1e04de[_0x66ce('0x50')]({'plain':!![]});_0x2f761a[_0x66ce('0x51')]=[];if(_0x48aa97){_0x2f761a[_0x66ce('0x52')]=_0x48aa97[_0x66ce('0x53')];_0x2f761a['lastMessage']=_0x48aa97;}else{_0x2f761a[_0x66ce('0x52')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f761a[_0x66ce('0x54')]={};}return _0x2f761a;};}exports['getUsers']=function(_0x471048,_0x5987c0,_0x22c39b){var _0x256983=[];return db['User']['findAll']({'where':{'role':[_0x66ce('0x55'),_0x66ce('0x56'),_0x66ce('0x57')]},'attributes':['id',_0x66ce('0x58'),_0x66ce('0x2f'),_0x66ce('0x59'),'userpic','internal',_0x66ce('0x5a'),'lastLoginAt',_0x66ce('0x5b'),_0x66ce('0x5c')],'order':qs[_0x66ce('0x40')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x66ce('0x5d'),'attributes':['id',_0x66ce('0x2f'),_0x66ce('0x34')],'through':{'attributes':[]}}]})[_0x66ce('0x2b')](function(_0x14e3d5){if(_0x14e3d5){var _0x98543b=_0x471048[_0x66ce('0x57')][_0x66ce('0x50')]({'plain':!![]});if(!_0x98543b)throw new Error(_0x66ce('0x5e'));if(_0x98543b[_0x66ce('0x59')]===_0x66ce('0x57')){return db['UserProfileSection']['find']({'where':{'name':_0x66ce('0x5f'),'userProfileId':_0x98543b[_0x66ce('0x60')]},'raw':!![]})[_0x66ce('0x2b')](function(_0x5a315b){if(_0x5a315b){if(_0x5a315b[_0x66ce('0x61')]===0x0){return db[_0x66ce('0x62')][_0x66ce('0x48')]({'where':{'sectionId':_0x5a315b['id']},'raw':!![]})[_0x66ce('0x2b')](function(_0xcdecb){var _0x8caf4e=[];if(_[_0x66ce('0x63')](_0xcdecb)){_0x8caf4e=_['filter'](_0x14e3d5,function(_0x11f361){if(_0x11f361[_0x66ce('0x59')]!==_0x66ce('0x55')){return _0x11f361;}});return _0x8caf4e;}else{for(var _0x4a7b1e=0x0;_0x4a7b1e<_0x14e3d5[_0x66ce('0x3c')];_0x4a7b1e++){var _0x3720a4=_0x14e3d5[_0x4a7b1e];if(_0x3720a4[_0x66ce('0x59')]===_0x66ce('0x55')){var _0x5de155=_[_0x66ce('0x4e')](_0xcdecb,function(_0x221459){return _0x221459['resourceId']===_0x3720a4['id'];});if(_0x5de155)_0x8caf4e[_0x66ce('0x64')](_0x3720a4);}else{_0x8caf4e[_0x66ce('0x64')](_0x3720a4);}}return _0x8caf4e;}});}else{return _0x14e3d5;}}else{var _0x78d276=_[_0x66ce('0x42')](_0x14e3d5,function(_0x1f7825){if(_0x1f7825[_0x66ce('0x59')]!==_0x66ce('0x55')){return _0x1f7825;}});return _0x78d276;}});}else{return _0x14e3d5;}}})[_0x66ce('0x2b')](function(_0x1dd055){var _0x3cab70=[];if(_0x1dd055){_0x256983=_0x1dd055;for(var _0x4556ae=0x0;_0x4556ae<_0x1dd055['length'];_0x4556ae+=0x1){_0x256983[_0x4556ae][_0x66ce('0x51')]=[];_0x3cab70[_0x66ce('0x64')](db[_0x66ce('0x32')]['find']({'where':{'FromId':[_0x471048[_0x66ce('0x57')]['id'],_0x1dd055[_0x4556ae]['id']],'ToId':[_0x471048[_0x66ce('0x57')]['id'],_0x1dd055[_0x4556ae]['id']],'ChatGroupId':null},'attributes':['id',_0x66ce('0x53'),_0x66ce('0x65'),_0x66ce('0x66'),_0x66ce('0x67'),_0x66ce('0x4c')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x66ce('0x2b')](wrapUser(_0x1dd055[_0x4556ae])));}return BPromise[_0x66ce('0x68')](_0x3cab70);}return[];})[_0x66ce('0x2b')](function(_0x2218c8){return{'rows':_0x2218c8,'count':_0x2218c8[_0x66ce('0x3c')]};})[_0x66ce('0x2b')](respondWithResult(_0x5987c0,null))[_0x66ce('0x4f')](handleError(_0x5987c0,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 949e7ec..a8e1f95 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 _0x22c2=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x22c2,0xbc));var _0x222c=function(_0x2cae99,_0x2c4acb){_0x2cae99=_0x2cae99-0x0;var _0x2748b6=_0x22c2[_0x2cae99];return _0x2748b6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x222c('0x0'))['db'][_0x222c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x222c('0x2'),'afterUpdate':_0x222c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37428a){return function(_0x47324b,_0x4d6f1a,_0x2ebfeb){ChatInternalMessageEvents[_0x222c('0x4')](_0x37428a+':'+_0x47324b['id'],_0x47324b);ChatInternalMessageEvents[_0x222c('0x4')](_0x37428a,_0x47324b);_0x2ebfeb(null);};}for(var e in events){if(events[_0x222c('0x5')](e)){var event=events[e];ChatInternalMessage[_0x222c('0x6')](e,emitEvent(event));}}module[_0x222c('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x7eca=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x3b8a89,_0x1ad92b){var _0x3ca0e5=function(_0x1a4136){while(--_0x1a4136){_0x3b8a89['push'](_0x3b8a89['shift']());}};_0x3ca0e5(++_0x1ad92b);}(_0x7eca,0x1ba));var _0xa7ec=function(_0x522251,_0x5606eb){_0x522251=_0x522251-0x0;var _0x4fc802=_0x7eca[_0x522251];return _0x4fc802;};'use strict';var EventEmitter=require(_0xa7ec('0x0'));var ChatInternalMessage=require(_0xa7ec('0x1'))['db'][_0xa7ec('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa7ec('0x3')](0x0);var events={'afterCreate':_0xa7ec('0x4'),'afterUpdate':_0xa7ec('0x5'),'afterDestroy':_0xa7ec('0x6')};function emitEvent(_0x55d909){return function(_0x3c37cf,_0x3aab25,_0x1fe689){ChatInternalMessageEvents[_0xa7ec('0x7')](_0x55d909+':'+_0x3c37cf['id'],_0x3c37cf);ChatInternalMessageEvents['emit'](_0x55d909,_0x3c37cf);_0x1fe689(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa7ec('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 207701f..5262ebc 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 _0x9191=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','exports','chat_internal_messages'];(function(_0x28db0d,_0x126dad){var _0x88be28=function(_0x5400a3){while(--_0x5400a3){_0x28db0d['push'](_0x28db0d['shift']());}};_0x88be28(++_0x126dad);}(_0x9191,0x1ec));var _0x1919=function(_0x59ab65,_0x410a52){_0x59ab65=_0x59ab65-0x0;var _0x57db9b=_0x9191[_0x59ab65];return _0x57db9b;};'use strict';var _=require(_0x1919('0x0'));var util=require(_0x1919('0x1'));var logger=require(_0x1919('0x2'))(_0x1919('0x3'));var moment=require('moment');var BPromise=require(_0x1919('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1919('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x1919('0x6')]=function(_0x2cea99,_0x46bd43){return _0x2cea99['define']('ChatInternalMessage',attributes,{'tableName':_0x1919('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1919('0x8'),'collate':_0x1919('0x9')});};
\ No newline at end of file
+var _0x39c0=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x3e1415,_0x2ad5ee){var _0x2e1ec7=function(_0x4beb31){while(--_0x4beb31){_0x3e1415['push'](_0x3e1415['shift']());}};_0x2e1ec7(++_0x2ad5ee);}(_0x39c0,0x14c));var _0x039c=function(_0x267923,_0x1f1a68){_0x267923=_0x267923-0x0;var _0x2e6dc0=_0x39c0[_0x267923];return _0x2e6dc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x039c('0x0'))(_0x039c('0x1'));var moment=require(_0x039c('0x2'));var BPromise=require(_0x039c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x039c('0x4'));var rimraf=require(_0x039c('0x5'));var config=require(_0x039c('0x6'));var attributes=require(_0x039c('0x7'));module[_0x039c('0x8')]=function(_0x4fa0ad,_0x1391b2){return _0x4fa0ad['define'](_0x039c('0x9'),attributes,{'tableName':_0x039c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x039c('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 33eb72d..6d02a89 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 _0x23ea=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xb70749,_0x28c7b4){var _0x59685c=function(_0x26e7c6){while(--_0x26e7c6){_0xb70749['push'](_0xb70749['shift']());}};_0x59685c(++_0x28c7b4);}(_0x23ea,0xc3));var _0xa23e=function(_0x5f58bb,_0x3f0bad){_0x5f58bb=_0x5f58bb-0x0;var _0xcc672d=_0x23ea[_0x5f58bb];return _0xcc672d;};'use strict';var _=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var moment=require(_0xa23e('0x2'));var BPromise=require(_0xa23e('0x3'));var rs=require(_0xa23e('0x4'));var fs=require('fs');var Redis=require(_0xa23e('0x5'));var db=require(_0xa23e('0x6'))['db'];var utils=require(_0xa23e('0x7'));var logger=require(_0xa23e('0x8'))(_0xa23e('0x9'));var config=require(_0xa23e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa23e('0xb')][_0xa23e('0xc')]({'port':0x232a});config[_0xa23e('0xd')]=_[_0xa23e('0xe')](config[_0xa23e('0xd')],{'host':_0xa23e('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa23e('0x10'))[_0xa23e('0x11')](socket);function respondWithRpcPromise(_0x9855c4,_0x3ef0f5,_0x4cd1be){return new BPromise(function(_0x4cb2bb,_0x1d4a1f){return client[_0xa23e('0x12')](_0x9855c4,_0x4cd1be)['then'](function(_0xcd22b9){logger[_0xa23e('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x3ef0f5,_0xa23e('0x14'));logger[_0xa23e('0x15')](_0xa23e('0x16'),_0x3ef0f5,_0xa23e('0x14'),JSON['stringify'](_0xcd22b9));if(_0xcd22b9[_0xa23e('0x17')]){if(_0xcd22b9[_0xa23e('0x17')][_0xa23e('0x18')]===0x1f4){logger['error'](_0xa23e('0x19'),_0x3ef0f5,_0xcd22b9[_0xa23e('0x17')][_0xa23e('0x1a')]);return _0x1d4a1f(_0xcd22b9[_0xa23e('0x17')][_0xa23e('0x1a')]);}logger[_0xa23e('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3ef0f5,_0xcd22b9[_0xa23e('0x17')]['message']);return _0x4cb2bb(_0xcd22b9[_0xa23e('0x17')][_0xa23e('0x1a')]);}else{logger['info'](_0xa23e('0x19'),_0x3ef0f5,_0xa23e('0x14'));_0x4cb2bb(_0xcd22b9[_0xa23e('0x1b')]['message']);}})[_0xa23e('0x1c')](function(_0x10bf3e){logger[_0xa23e('0x17')](_0xa23e('0x19'),_0x3ef0f5,_0x10bf3e);_0x1d4a1f(_0x10bf3e);});});}
\ No newline at end of file
+var _0x465c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xaec179,_0x25e560){var _0x48c8f7=function(_0x90bdd9){while(--_0x90bdd9){_0xaec179['push'](_0xaec179['shift']());}};_0x48c8f7(++_0x25e560);}(_0x465c,0x1ae));var _0xc465=function(_0x40680c,_0x3b6297){_0x40680c=_0x40680c-0x0;var _0x4e6ac5=_0x465c[_0x40680c];return _0x4e6ac5;};'use strict';var _=require(_0xc465('0x0'));var util=require(_0xc465('0x1'));var moment=require('moment');var BPromise=require(_0xc465('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc465('0x3'))['db'];var utils=require(_0xc465('0x4'));var logger=require(_0xc465('0x5'))(_0xc465('0x6'));var config=require(_0xc465('0x7'));var jayson=require(_0xc465('0x8'));var client=jayson[_0xc465('0x9')][_0xc465('0xa')]({'port':0x232a});config[_0xc465('0xb')]=_[_0xc465('0xc')](config[_0xc465('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc465('0xd'))(new Redis(config[_0xc465('0xb')]));require(_0xc465('0xe'))[_0xc465('0xf')](socket);function respondWithRpcPromise(_0x53e607,_0x1fecb0,_0x42a6d0){return new BPromise(function(_0x14a426,_0x3f1287){return client[_0xc465('0x10')](_0x53e607,_0x42a6d0)[_0xc465('0x11')](function(_0x15250a){logger[_0xc465('0x12')](_0xc465('0x13'),_0x1fecb0,'request\x20sent');logger[_0xc465('0x14')](_0xc465('0x15'),_0x1fecb0,_0xc465('0x16'),JSON[_0xc465('0x17')](_0x15250a));if(_0x15250a[_0xc465('0x18')]){if(_0x15250a[_0xc465('0x18')][_0xc465('0x19')]===0x1f4){logger['error'](_0xc465('0x13'),_0x1fecb0,_0x15250a[_0xc465('0x18')][_0xc465('0x1a')]);return _0x3f1287(_0x15250a['error'][_0xc465('0x1a')]);}logger['error'](_0xc465('0x13'),_0x1fecb0,_0x15250a[_0xc465('0x18')][_0xc465('0x1a')]);return _0x14a426(_0x15250a[_0xc465('0x18')][_0xc465('0x1a')]);}else{logger[_0xc465('0x12')](_0xc465('0x13'),_0x1fecb0,_0xc465('0x16'));_0x14a426(_0x15250a[_0xc465('0x1b')][_0xc465('0x1a')]);}})[_0xc465('0x1c')](function(_0x39365b){logger[_0xc465('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x1fecb0,_0x39365b);_0x3f1287(_0x39365b);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 27070c3..32de680 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 _0x0f44=['save','remove','update','removeListener','length','chatInternalMessage:'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0f44,0x8a));var _0x40f4=function(_0x5ecc81,_0x177e15){_0x5ecc81=_0x5ecc81-0x0;var _0x31901b=_0x0f44[_0x5ecc81];return _0x31901b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x40f4('0x0'),_0x40f4('0x1'),_0x40f4('0x2')];function createListener(_0x338447,_0x515d98){return function(_0x5ae2e7){_0x515d98['emit'](_0x338447,_0x5ae2e7);};}function removeListener(_0x3a1b77,_0x50f3f6){return function(){ChatInternalMessageEvents[_0x40f4('0x3')](_0x3a1b77,_0x50f3f6);};}exports['register']=function(_0x2a036a){for(var _0x208d84=0x0,_0x5a98df=events[_0x40f4('0x4')];_0x208d84<_0x5a98df;_0x208d84++){var _0x2e03d6=events[_0x208d84];var _0xbae51d=createListener(_0x40f4('0x5')+_0x2e03d6,_0x2a036a);ChatInternalMessageEvents['on'](_0x2e03d6,_0xbae51d);}};
\ No newline at end of file
+var _0x938b=['./chatInternalMessage.events','save','update','removeListener','register','length','chatInternalMessage:'];(function(_0x117b4b,_0x5168fe){var _0x5c7e57=function(_0x177727){while(--_0x177727){_0x117b4b['push'](_0x117b4b['shift']());}};_0x5c7e57(++_0x5168fe);}(_0x938b,0x142));var _0xb938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xb938('0x0'));var events=[_0xb938('0x1'),'remove',_0xb938('0x2')];function createListener(_0x28a95c,_0x47b7ab){return function(_0xa300c7){_0x47b7ab['emit'](_0x28a95c,_0xa300c7);};}function removeListener(_0x362a41,_0x46eacf){return function(){ChatInternalMessageEvents[_0xb938('0x3')](_0x362a41,_0x46eacf);};}exports[_0xb938('0x4')]=function(_0x2d1199){for(var _0xf26fd6=0x0,_0x5d8ca3=events[_0xb938('0x5')];_0xf26fd6<_0x5d8ca3;_0xf26fd6++){var _0x5d35b4=events[_0xf26fd6];var _0x5bce6b=createListener(_0xb938('0x6')+_0x5d35b4,_0x2d1199);ChatInternalMessageEvents['on'](_0x5d35b4,_0x5bce6b);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 379ba19..7c6830e 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 _0x64c0=['/users','show','post','create','put','delete','/:id','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x64c0,0x8d));var _0x064c=function(_0x597e38,_0x551ac2){_0x597e38=_0x597e38-0x0;var _0x5305d2=_0x64c0[_0x597e38];return _0x5305d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x064c('0x0'));var timeout=require('connect-timeout');var express=require(_0x064c('0x1'));var router=express[_0x064c('0x2')]();var fs_extra=require(_0x064c('0x3'));var auth=require(_0x064c('0x4'));var interaction=require(_0x064c('0x5'));var config=require(_0x064c('0x6'));var controller=require(_0x064c('0x7'));router[_0x064c('0x8')]('/',auth[_0x064c('0x9')](),controller[_0x064c('0xa')]);router[_0x064c('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x064c('0x8')](_0x064c('0xb'),auth[_0x064c('0x9')](),controller['getUsers']);router[_0x064c('0x8')]('/:id',auth[_0x064c('0x9')](),controller[_0x064c('0xc')]);router[_0x064c('0xd')]('/',auth[_0x064c('0x9')](),controller[_0x064c('0xe')]);router[_0x064c('0xf')]('/:id',controller['update']);router[_0x064c('0x10')](_0x064c('0x11'),auth[_0x064c('0x9')](),controller['destroy']);module[_0x064c('0x12')]=router;
\ No newline at end of file
+var _0x7de4=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','describe','/users','getUsers','get','/:id','show','create','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7de4,0x16a));var _0x47de=function(_0x3fe111,_0x4b34f7){_0x3fe111=_0x3fe111-0x0;var _0x82f9fb=_0x7de4[_0x3fe111];return _0x82f9fb;};'use strict';var multer=require(_0x47de('0x0'));var util=require(_0x47de('0x1'));var path=require(_0x47de('0x2'));var timeout=require(_0x47de('0x3'));var express=require(_0x47de('0x4'));var router=express[_0x47de('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x47de('0x6'));var controller=require(_0x47de('0x7'));router['get']('/',auth[_0x47de('0x8')](),controller[_0x47de('0x9')]);router['get']('/describe',auth[_0x47de('0x8')](),controller[_0x47de('0xa')]);router['get'](_0x47de('0xb'),auth[_0x47de('0x8')](),controller[_0x47de('0xc')]);router[_0x47de('0xd')](_0x47de('0xe'),auth[_0x47de('0x8')](),controller[_0x47de('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47de('0x10')]);router['put'](_0x47de('0xe'),controller[_0x47de('0x11')]);router['delete']('/:id',auth[_0x47de('0x8')](),controller[_0x47de('0x12')]);module[_0x47de('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index b60529f..fe28433 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 _0xb9be=['out','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xb9be,0xc5));var _0xeb9b=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xb9be[_0x28aea5];return _0x6a55f9;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'body':{'type':Sequelize[_0xeb9b('0x2')](_0xeb9b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb9b('0x5')]('in',_0xeb9b('0x6')),'defaultValue':_0xeb9b('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xeb9b('0x2')]}};
\ No newline at end of file
+var _0x0bb4=['sequelize','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x387c60,_0x20cfff){var _0x1f738f=function(_0x400243){while(--_0x400243){_0x387c60['push'](_0x387c60['shift']());}};_0x1f738f(++_0x20cfff);}(_0x0bb4,0x77));var _0x40bb=function(_0x14ba82,_0x2725a6){_0x14ba82=_0x14ba82-0x0;var _0x42b676=_0x0bb4[_0x14ba82];return _0x42b676;};'use strict';var Sequelize=require(_0x40bb('0x0'));module[_0x40bb('0x1')]={'body':{'type':Sequelize['TEXT'](_0x40bb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x40bb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x40bb('0x4')]('in','out'),'defaultValue':_0x40bb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x40bb('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index ac21d81..c48026a 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 _0xa363=['register','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','limit','count','Content-Range','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','ChatMessage','includeAll','include','findAll','show','params','intersection','merge','create','body','catch','find','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteraction','ChatInteractionId','interaction','get','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x44a411,_0x204a01){var _0x1a7521=function(_0x3fe898){while(--_0x3fe898){_0x44a411['push'](_0x44a411['shift']());}};_0x1a7521(++_0x204a01);}(_0xa363,0x1e5));var _0x3a36=function(_0x2fd21f,_0x104a24){_0x2fd21f=_0x2fd21f-0x0;var _0x50d9de=_0xa363[_0x2fd21f];return _0x50d9de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3a36('0x0'));var jsonpatch=require(_0x3a36('0x1'));var rp=require(_0x3a36('0x2'));var moment=require(_0x3a36('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3a36('0x4'));var util=require(_0x3a36('0x5'));var path=require(_0x3a36('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a36('0x7'));var squel=require('squel');var crypto=require(_0x3a36('0x8'));var jsforce=require(_0x3a36('0x9'));var deskjs=require(_0x3a36('0xa'));var toCsv=require(_0x3a36('0xb'));var querystring=require(_0x3a36('0xc'));var Papa=require(_0x3a36('0xd'));var Redis=require(_0x3a36('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3a36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a36('0x10'));var logger=require('../../config/logger')(_0x3a36('0x11'));var utils=require(_0x3a36('0x12'));var config=require(_0x3a36('0x13'));var licenseUtil=require(_0x3a36('0x14'));var db=require(_0x3a36('0x15'))['db'];config[_0x3a36('0x16')]=_[_0x3a36('0x17')](config[_0x3a36('0x16')],{'host':_0x3a36('0x18'),'port':0x18eb});var socket=require(_0x3a36('0x19'))(new Redis(config[_0x3a36('0x16')]));require(_0x3a36('0x1a'))[_0x3a36('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3a36('0x1c')][_0x3a36('0x1d')]({'port':0x232c});var client9002=jayson[_0x3a36('0x1c')][_0x3a36('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1bafb9,_0x3cbc9a,_0x3ab65a,_0x3adeaf){return new BPromise(function(_0x1e54b6,_0x317f3a){var _0x1a2d51=_0x3adeaf||client;return _0x1a2d51[_0x3a36('0x1e')](_0x1bafb9,_0x3ab65a)['then'](function(_0x13cfb1){logger[_0x3a36('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x3cbc9a,_0x3a36('0x20'));logger[_0x3a36('0x21')](_0x3a36('0x22'),_0x3cbc9a,'request\x20sent',JSON[_0x3a36('0x23')](_0x13cfb1));if(_0x13cfb1[_0x3a36('0x24')]){if(_0x13cfb1[_0x3a36('0x24')][_0x3a36('0x25')]===0x1f4){logger['error'](_0x3a36('0x26'),_0x3cbc9a,_0x13cfb1['error'][_0x3a36('0x27')]);return _0x317f3a(_0x13cfb1[_0x3a36('0x24')]['message']);}logger[_0x3a36('0x24')](_0x3a36('0x26'),_0x3cbc9a,_0x13cfb1[_0x3a36('0x24')][_0x3a36('0x27')]);return _0x1e54b6(_0x13cfb1[_0x3a36('0x24')]['message']);}else{logger['info'](_0x3a36('0x26'),_0x3cbc9a,_0x3a36('0x20'));_0x1e54b6(_0x13cfb1['result'][_0x3a36('0x27')]);}})['catch'](function(_0x3f9e6d){logger[_0x3a36('0x24')](_0x3a36('0x26'),_0x3cbc9a,_0x3f9e6d);_0x317f3a(_0x3f9e6d);});});}function respondWithStatusCode(_0x44b937,_0x39a59b){_0x39a59b=_0x39a59b||0xcc;return function(_0x18c927){if(_0x18c927){return _0x44b937[_0x3a36('0x28')](_0x39a59b);}return _0x44b937[_0x3a36('0x29')](_0x39a59b)[_0x3a36('0x2a')]();};}function respondWithResult(_0x26d2d9,_0x29dc5c){_0x29dc5c=_0x29dc5c||0xc8;return function(_0x2145cd){if(_0x2145cd){return _0x26d2d9['status'](_0x29dc5c)[_0x3a36('0x2b')](_0x2145cd);}};}function respondWithFilteredResult(_0x579ec4,_0x3cfc5b){return function(_0x3e89d1){if(_0x3e89d1){var _0x121cfc=typeof _0x3cfc5b[_0x3a36('0x2c')]==='undefined'&&typeof _0x3cfc5b[_0x3a36('0x2d')]==='undefined';var _0x5ebd95=_0x3e89d1['count'];var _0x3ac5d1=_0x121cfc?0x0:_0x3cfc5b[_0x3a36('0x2c')];var _0x45a518=_0x121cfc?_0x3e89d1[_0x3a36('0x2e')]:_0x3cfc5b['offset']+_0x3cfc5b[_0x3a36('0x2d')];var _0x53550e;if(_0x45a518>=_0x5ebd95){_0x45a518=_0x5ebd95;_0x53550e=0xc8;}else{_0x53550e=0xce;}_0x579ec4['status'](_0x53550e);return _0x579ec4['set'](_0x3a36('0x2f'),_0x3ac5d1+'-'+_0x45a518+'/'+_0x5ebd95)[_0x3a36('0x2b')](_0x3e89d1);}return null;};}function patchUpdates(_0x1ad9e3){return function(_0x1d9b25){try{jsonpatch['apply'](_0x1d9b25,_0x1ad9e3,!![]);}catch(_0x4e3180){return BPromise['reject'](_0x4e3180);}return _0x1d9b25[_0x3a36('0x30')]();};}function saveUpdates(_0x57b323,_0xed09e){return function(_0x4538a7){if(_0x4538a7){return _0x4538a7[_0x3a36('0x31')](_0x57b323)[_0x3a36('0x32')](function(_0x1f45a4){return _0x1f45a4;});}return null;};}function removeEntity(_0x471bda,_0x4a8b81){return function(_0x3fe0d7){if(_0x3fe0d7){return _0x3fe0d7[_0x3a36('0x33')]()[_0x3a36('0x32')](function(){_0x471bda[_0x3a36('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4cfb,_0x94fcc0){return function(_0x47ce97){if(!_0x47ce97){_0x1b4cfb[_0x3a36('0x28')](0x194);}return _0x47ce97;};}function handleError(_0x5cbb51,_0x347577){_0x347577=_0x347577||0x1f4;return function(_0x28a91f){logger[_0x3a36('0x24')](_0x28a91f[_0x3a36('0x34')]);if(_0x28a91f[_0x3a36('0x35')]){delete _0x28a91f[_0x3a36('0x35')];}_0x5cbb51[_0x3a36('0x29')](_0x347577)['send'](_0x28a91f);};}exports[_0x3a36('0x36')]=function(_0xeccfe3,_0xf9de6e){var _0x305c0e={},_0x4a7577={},_0x1e8579={'count':0x0,'rows':[]};var _0x3e3fd4=_[_0x3a36('0x37')](db['ChatMessage'][_0x3a36('0x38')],function(_0x1668d5){return{'name':_0x1668d5[_0x3a36('0x39')],'type':_0x1668d5[_0x3a36('0x3a')]['key']};});_0x4a7577[_0x3a36('0x3b')]=_[_0x3a36('0x37')](_0x3e3fd4,_0x3a36('0x35'));_0x4a7577[_0x3a36('0x3c')]=_[_0x3a36('0x3d')](_0xeccfe3['query']);_0x4a7577[_0x3a36('0x3e')]=_['intersection'](_0x4a7577[_0x3a36('0x3b')],_0x4a7577[_0x3a36('0x3c')]);_0x305c0e['attributes']=_['intersection'](_0x4a7577['model'],qs[_0x3a36('0x3f')](_0xeccfe3[_0x3a36('0x3c')][_0x3a36('0x3f')]));_0x305c0e[_0x3a36('0x40')]=_0x305c0e['attributes'][_0x3a36('0x41')]?_0x305c0e[_0x3a36('0x40')]:_0x4a7577[_0x3a36('0x3b')];if(!_0xeccfe3[_0x3a36('0x3c')][_0x3a36('0x42')](_0x3a36('0x43'))){_0x305c0e[_0x3a36('0x2d')]=qs[_0x3a36('0x2d')](_0xeccfe3[_0x3a36('0x3c')][_0x3a36('0x2d')]);_0x305c0e[_0x3a36('0x2c')]=qs['offset'](_0xeccfe3[_0x3a36('0x3c')][_0x3a36('0x2c')]);}_0x305c0e['order']=qs[_0x3a36('0x44')](_0xeccfe3[_0x3a36('0x3c')]['sort']);_0x305c0e[_0x3a36('0x45')]=qs[_0x3a36('0x3e')](_[_0x3a36('0x46')](_0xeccfe3[_0x3a36('0x3c')],_0x4a7577[_0x3a36('0x3e')]),_0x3e3fd4);if(_0xeccfe3['query'][_0x3a36('0x47')]){_0x305c0e['where']=_['merge'](_0x305c0e[_0x3a36('0x45')],{'$or':_[_0x3a36('0x37')](_0x3e3fd4,function(_0x1d8f39){if(_0x1d8f39[_0x3a36('0x3a')]!==_0x3a36('0x48')){var _0x3cfc8a={};_0x3cfc8a[_0x1d8f39[_0x3a36('0x35')]]={'$like':'%'+_0xeccfe3[_0x3a36('0x3c')][_0x3a36('0x47')]+'%'};return _0x3cfc8a;}})});}_0x305c0e=_['merge']({},_0x305c0e,_0xeccfe3[_0x3a36('0x49')]);var _0x53e9d4={'where':_0x305c0e['where']};return db[_0x3a36('0x4a')][_0x3a36('0x2e')](_0x53e9d4)[_0x3a36('0x32')](function(_0xfad8a2){_0x1e8579[_0x3a36('0x2e')]=_0xfad8a2;if(_0xeccfe3[_0x3a36('0x3c')][_0x3a36('0x4b')]){_0x305c0e[_0x3a36('0x4c')]=[{'all':!![]}];}return db[_0x3a36('0x4a')][_0x3a36('0x4d')](_0x305c0e);})[_0x3a36('0x32')](function(_0x4a7f52){_0x1e8579['rows']=_0x4a7f52;return _0x1e8579;})['then'](respondWithFilteredResult(_0xf9de6e,_0x305c0e))['catch'](handleError(_0xf9de6e,null));};exports[_0x3a36('0x4e')]=function(_0x1b39dc,_0x338eb1){var _0x1d2da9={'raw':!![],'where':{'id':_0x1b39dc[_0x3a36('0x4f')]['id']}},_0x1a1d39={};_0x1a1d39['model']=_[_0x3a36('0x3d')](db[_0x3a36('0x4a')][_0x3a36('0x38')]);_0x1a1d39['query']=_[_0x3a36('0x3d')](_0x1b39dc['query']);_0x1a1d39[_0x3a36('0x3e')]=_[_0x3a36('0x50')](_0x1a1d39[_0x3a36('0x3b')],_0x1a1d39['query']);_0x1d2da9[_0x3a36('0x40')]=_['intersection'](_0x1a1d39['model'],qs[_0x3a36('0x3f')](_0x1b39dc[_0x3a36('0x3c')][_0x3a36('0x3f')]));_0x1d2da9[_0x3a36('0x40')]=_0x1d2da9[_0x3a36('0x40')][_0x3a36('0x41')]?_0x1d2da9[_0x3a36('0x40')]:_0x1a1d39[_0x3a36('0x3b')];if(_0x1b39dc['query'][_0x3a36('0x4b')]){_0x1d2da9[_0x3a36('0x4c')]=[{'all':!![]}];}_0x1d2da9=_[_0x3a36('0x51')]({},_0x1d2da9,_0x1b39dc[_0x3a36('0x49')]);return db[_0x3a36('0x4a')]['find'](_0x1d2da9)[_0x3a36('0x32')](handleEntityNotFound(_0x338eb1,null))['then'](respondWithResult(_0x338eb1,null))['catch'](handleError(_0x338eb1,null));};exports['create']=function(_0x368257,_0x5850ed){return db[_0x3a36('0x4a')][_0x3a36('0x52')](_0x368257[_0x3a36('0x53')],{})[_0x3a36('0x32')](respondWithResult(_0x5850ed,0xc9))[_0x3a36('0x54')](handleError(_0x5850ed,null));};exports['update']=function(_0x362b62,_0x52df00){if(_0x362b62[_0x3a36('0x53')]['id']){delete _0x362b62[_0x3a36('0x53')]['id'];}return db['ChatMessage'][_0x3a36('0x55')]({'where':{'id':_0x362b62['params']['id']}})[_0x3a36('0x32')](handleEntityNotFound(_0x52df00,null))['then'](saveUpdates(_0x362b62[_0x3a36('0x53')],null))[_0x3a36('0x32')](respondWithResult(_0x52df00,null))['catch'](handleError(_0x52df00,null));};exports[_0x3a36('0x33')]=function(_0x5a8de2,_0x48da66){return db['ChatMessage'][_0x3a36('0x55')]({'where':{'id':_0x5a8de2[_0x3a36('0x4f')]['id']}})[_0x3a36('0x32')](handleEntityNotFound(_0x48da66,null))[_0x3a36('0x32')](removeEntity(_0x48da66,null))[_0x3a36('0x54')](handleError(_0x48da66,null));};exports[_0x3a36('0x56')]=function(_0x243680,_0x1f50fa){return db[_0x3a36('0x4a')][_0x3a36('0x56')]()[_0x3a36('0x32')](respondWithResult(_0x1f50fa,null))[_0x3a36('0x54')](handleError(_0x1f50fa,null));};var interaction_log=require(_0x3a36('0x57'))(_0x3a36('0x58'));exports[_0x3a36('0x59')]=function(_0x41d880,_0x4c76e9,_0x2202ea){var _0x368311={'agent':{},'channel':_0x3a36('0x5a')};if(_0x41d880['body']['id']){delete _0x41d880[_0x3a36('0x53')]['id'];}_0x41d880[_0x3a36('0x53')][_0x3a36('0x5b')]=!![];_0x41d880[_0x3a36('0x53')][_0x3a36('0x5c')]=moment()[_0x3a36('0x5d')](_0x3a36('0x5e'));_0x41d880[_0x3a36('0x53')][_0x3a36('0x5f')]=_0x41d880[_0x3a36('0x53')]['UserId']||_0x41d880['user']['id'];_0x368311['agent']['id']=_0x41d880[_0x3a36('0x53')][_0x3a36('0x5f')];return db[_0x3a36('0x4a')][_0x3a36('0x55')]({'where':{'id':_0x41d880[_0x3a36('0x4f')]['id'],'UserId':null}})[_0x3a36('0x32')](handleEntityNotFound(_0x4c76e9,null))['then'](saveUpdates(_0x41d880[_0x3a36('0x53')],null))[_0x3a36('0x32')](function(_0x320025){if(_0x320025){_0x368311[_0x3a36('0x27')]=_0x320025['get']({'plain':!![]});return db[_0x3a36('0x60')][_0x3a36('0x55')]({'where':{'id':_0x320025[_0x3a36('0x61')]}});}return null;})[_0x3a36('0x32')](handleEntityNotFound(_0x4c76e9,null))[_0x3a36('0x32')](function(_0x2c6b5a){if(_0x2c6b5a){return _0x2c6b5a[_0x3a36('0x31')]({'UserId':_0x41d880[_0x3a36('0x53')][_0x3a36('0x5f')],'read1stAt':_['isNil'](_0x2c6b5a['read1stAt'])?moment()[_0x3a36('0x5d')](_0x3a36('0x5e')):undefined});}return null;})[_0x3a36('0x32')](function(_0x5cecba){if(_0x5cecba){_0x368311[_0x3a36('0x62')]=_0x5cecba[_0x3a36('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41d880[_0x3a36('0x64')]['id'],_0x41d880['user'][_0x3a36('0x35')],_0x41d880[_0x3a36('0x64')][_0x3a36('0x65')],_0x368311['interaction']['id'],_0x41d880[_0x3a36('0x53')]?JSON[_0x3a36('0x23')](_0x41d880[_0x3a36('0x53')]):'null');return respondWithRpcPromise(_0x3a36('0x66'),_0x3a36('0x67'),_0x368311);}return null;})[_0x3a36('0x32')](function(_0x46a1c4){var _0x21d2d4=_0x3a36('0x68')+_0x46a1c4[_0x3a36('0x27')][_0x3a36('0x69')];return db[_0x3a36('0x6a')][_0x3a36('0x3c')](_0x21d2d4,{'type':db[_0x3a36('0x6b')]['QueryTypes'][_0x3a36('0x6c')],'raw':!![]})['then'](function(_0x55adfe){return _0x55adfe;});})[_0x3a36('0x32')](function(_0x523ef6){if(_0x523ef6){_0x368311[_0x3a36('0x27')][_0x3a36('0x6d')]=_0x523ef6[0x0];if(!_0x41d880['body'][_0x3a36('0x5f')])return;return db[_0x3a36('0x6e')][_0x3a36('0x55')]({'where':{'id':_0x41d880[_0x3a36('0x53')][_0x3a36('0x5f')],'role':'agent'},'attributes':['id','name',_0x3a36('0x6f'),_0x3a36('0x70'),_0x3a36('0x71')],'raw':!![]});}return null;})[_0x3a36('0x32')](function(_0x5304f1){if(!_0x5304f1)return null;_0x368311[_0x3a36('0x27')][_0x3a36('0x72')]=_0x5304f1;return _0x368311;})[_0x3a36('0x32')](function(_0x171b5c){if(_0x171b5c){if(_0x41d880[_0x3a36('0x53')][_0x3a36('0x73')]){_0x368311[_0x3a36('0x27')]['interface']=util[_0x3a36('0x5d')](_0x3a36('0x74'),_0x41d880[_0x3a36('0x64')][_0x3a36('0x35')]);_0x368311[_0x3a36('0x27')]['channel']=_0x368311[_0x3a36('0x75')];_0x368311[_0x3a36('0x27')][_0x3a36('0x76')]=_0x368311[_0x3a36('0x75')];_0x368311['message'][_0x3a36('0x77')]='accept';return respondWithRpcPromise('EventManager',_0x3a36('0x78'),{'event':_0x3a36('0x79'),'message':_[_0x3a36('0x51')](_0x368311['message'],JSON['parse'](_0x368311['interaction'][_0x3a36('0x7a')]))},client9002)[_0x3a36('0x32')](function(){return _0x368311;});}return _0x368311;}return null;})['then'](respondWithResult(_0x4c76e9,null))['catch'](handleError(_0x4c76e9,null));};var interaction_log=require(_0x3a36('0x57'))(_0x3a36('0x58'));exports[_0x3a36('0x7b')]=function(_0x233d29,_0x3a0633,_0x2f7f9a){var _0x546879={'agent':{},'channel':_0x3a36('0x5a')};if(_0x233d29[_0x3a36('0x53')]['id']){delete _0x233d29['body']['id'];}_0x233d29[_0x3a36('0x53')][_0x3a36('0x5f')]=_0x233d29[_0x3a36('0x53')]['UserId']||_0x233d29[_0x3a36('0x64')]['id'];_0x546879[_0x3a36('0x72')]['id']=_0x233d29[_0x3a36('0x53')]['UserId'];return db[_0x3a36('0x4a')]['find']({'where':{'id':_0x233d29[_0x3a36('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a0633,null))[_0x3a36('0x32')](function(_0x25bbc3){if(_0x25bbc3){_0x546879[_0x3a36('0x27')]=_0x25bbc3[_0x3a36('0x63')]({'plain':!![]});return db[_0x3a36('0x60')][_0x3a36('0x55')]({'where':{'id':_0x25bbc3['ChatInteractionId']}});}return null;})[_0x3a36('0x32')](handleEntityNotFound(_0x3a0633,null))[_0x3a36('0x32')](function(_0x8860a6){if(_0x8860a6){_0x546879[_0x3a36('0x62')]=_0x8860a6[_0x3a36('0x63')]({'plain':!![]});interaction_log['info'](_0x3a36('0x7c'),_0x233d29[_0x3a36('0x64')]['id'],_0x233d29['user'][_0x3a36('0x35')],_0x233d29[_0x3a36('0x64')][_0x3a36('0x65')],_0x546879[_0x3a36('0x62')]['id'],_0x233d29[_0x3a36('0x53')]?JSON[_0x3a36('0x23')](_0x233d29[_0x3a36('0x53')]):_0x3a36('0x7d'));return respondWithRpcPromise('RejectMessage',_0x3a36('0x7e'),_0x546879);}return null;})['then'](function(_0x272b06){var _0x539843=_0x3a36('0x68')+_0x272b06[_0x3a36('0x27')]['ContactId'];return db['sequelize']['query'](_0x539843,{'type':db[_0x3a36('0x6b')]['QueryTypes'][_0x3a36('0x6c')],'raw':!![]})[_0x3a36('0x32')](function(_0x3e3f95){return _0x3e3f95;});})[_0x3a36('0x32')](function(_0x4141f3){if(_0x4141f3){_0x546879[_0x3a36('0x27')][_0x3a36('0x6d')]=_0x4141f3[0x0];if(!_0x233d29[_0x3a36('0x53')][_0x3a36('0x5f')])return;return db[_0x3a36('0x6e')][_0x3a36('0x55')]({'where':{'id':_0x233d29['body'][_0x3a36('0x5f')],'role':_0x3a36('0x72')},'attributes':['id',_0x3a36('0x35'),'fullname',_0x3a36('0x70'),'internal'],'raw':!![]});}return null;})[_0x3a36('0x32')](function(_0x75060d){if(!_0x75060d)return null;_0x546879[_0x3a36('0x27')][_0x3a36('0x72')]=_0x75060d;return _0x546879;})[_0x3a36('0x32')](function(_0x589dc1){if(_0x589dc1){_0x589dc1[_0x3a36('0x27')]['interface']=util[_0x3a36('0x5d')]('SIP/%s',_0x233d29[_0x3a36('0x64')]['name']);_0x589dc1[_0x3a36('0x27')][_0x3a36('0x75')]=_0x546879[_0x3a36('0x75')];_0x589dc1[_0x3a36('0x27')][_0x3a36('0x76')]=_0x546879[_0x3a36('0x75')];_0x589dc1[_0x3a36('0x27')][_0x3a36('0x77')]=_0x3a36('0x7b');respondWithRpcPromise(_0x3a36('0x78'),_0x3a36('0x78'),{'event':_0x3a36('0x7f'),'message':_[_0x3a36('0x51')](_0x546879[_0x3a36('0x27')],JSON['parse'](_0x546879[_0x3a36('0x62')][_0x3a36('0x7a')]))},client9002);return _0x546879;}return null;})[_0x3a36('0x32')](respondWithResult(_0x3a0633,null))[_0x3a36('0x54')](handleError(_0x3a0633,null));};
\ No newline at end of file
+var _0x3596=['internal','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','interface','event','rejectmessage','parse','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','ChatMessage','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','show','params','rawAttributes','length','include','options','find','create','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x3596,0x122));var _0x6359=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x3596[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6359('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6359('0x1'));var rp=require(_0x6359('0x2'));var moment=require(_0x6359('0x3'));var BPromise=require(_0x6359('0x4'));var Mustache=require(_0x6359('0x5'));var util=require(_0x6359('0x6'));var path=require('path');var sox=require(_0x6359('0x7'));var csv=require('to-csv');var ejs=require(_0x6359('0x8'));var fs=require('fs');var fs_extra=require(_0x6359('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6359('0xa'));var jsforce=require(_0x6359('0xb'));var deskjs=require(_0x6359('0xc'));var toCsv=require(_0x6359('0xd'));var querystring=require('querystring');var Papa=require(_0x6359('0xe'));var Redis=require(_0x6359('0xf'));var authService=require(_0x6359('0x10'));var qs=require(_0x6359('0x11'));var as=require(_0x6359('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6359('0x13'))(_0x6359('0x14'));var utils=require(_0x6359('0x15'));var config=require(_0x6359('0x16'));var licenseUtil=require(_0x6359('0x17'));var db=require(_0x6359('0x18'))['db'];config['redis']=_[_0x6359('0x19')](config[_0x6359('0x1a')],{'host':_0x6359('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6359('0x1a')]));require(_0x6359('0x1c'))[_0x6359('0x1d')](socket);var jayson=require(_0x6359('0x1e'));var client=jayson['client'][_0x6359('0x1f')]({'port':0x232c});var client9002=jayson[_0x6359('0x20')][_0x6359('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5c652b,_0x1e2cd8,_0x93bac8,_0x545fb1){return new BPromise(function(_0x19a63b,_0x184031){var _0x330367=_0x545fb1||client;return _0x330367[_0x6359('0x21')](_0x5c652b,_0x93bac8)[_0x6359('0x22')](function(_0x1fc23a){logger['info'](_0x6359('0x23'),_0x1e2cd8,_0x6359('0x24'));logger[_0x6359('0x25')](_0x6359('0x26'),_0x1e2cd8,_0x6359('0x24'),JSON[_0x6359('0x27')](_0x1fc23a));if(_0x1fc23a['error']){if(_0x1fc23a[_0x6359('0x28')][_0x6359('0x29')]===0x1f4){logger['error'](_0x6359('0x23'),_0x1e2cd8,_0x1fc23a[_0x6359('0x28')][_0x6359('0x2a')]);return _0x184031(_0x1fc23a[_0x6359('0x28')][_0x6359('0x2a')]);}logger['error'](_0x6359('0x23'),_0x1e2cd8,_0x1fc23a[_0x6359('0x28')][_0x6359('0x2a')]);return _0x19a63b(_0x1fc23a['error'][_0x6359('0x2a')]);}else{logger[_0x6359('0x2b')](_0x6359('0x23'),_0x1e2cd8,_0x6359('0x24'));_0x19a63b(_0x1fc23a['result']['message']);}})[_0x6359('0x2c')](function(_0x2a071b){logger[_0x6359('0x28')](_0x6359('0x23'),_0x1e2cd8,_0x2a071b);_0x184031(_0x2a071b);});});}function respondWithStatusCode(_0x1f7635,_0x5b84f4){_0x5b84f4=_0x5b84f4||0xcc;return function(_0x47a10c){if(_0x47a10c){return _0x1f7635['sendStatus'](_0x5b84f4);}return _0x1f7635[_0x6359('0x2d')](_0x5b84f4)[_0x6359('0x2e')]();};}function respondWithResult(_0x3ca5ab,_0x16a37f){_0x16a37f=_0x16a37f||0xc8;return function(_0x290cc0){if(_0x290cc0){return _0x3ca5ab['status'](_0x16a37f)[_0x6359('0x2f')](_0x290cc0);}};}function respondWithFilteredResult(_0x265275,_0x45a8c3){return function(_0x167f3d){if(_0x167f3d){var _0xe5d114=typeof _0x45a8c3[_0x6359('0x30')]==='undefined'&&typeof _0x45a8c3[_0x6359('0x31')]===_0x6359('0x32');var _0x803d2=_0x167f3d[_0x6359('0x33')];var _0x594406=_0xe5d114?0x0:_0x45a8c3['offset'];var _0x33f126=_0xe5d114?_0x167f3d['count']:_0x45a8c3[_0x6359('0x30')]+_0x45a8c3['limit'];var _0x19ebca;if(_0x33f126>=_0x803d2){_0x33f126=_0x803d2;_0x19ebca=0xc8;}else{_0x19ebca=0xce;}_0x265275[_0x6359('0x2d')](_0x19ebca);return _0x265275[_0x6359('0x34')](_0x6359('0x35'),_0x594406+'-'+_0x33f126+'/'+_0x803d2)[_0x6359('0x2f')](_0x167f3d);}return null;};}function patchUpdates(_0xfed7e6){return function(_0x3eb5e7){try{jsonpatch[_0x6359('0x36')](_0x3eb5e7,_0xfed7e6,!![]);}catch(_0x41078f){return BPromise[_0x6359('0x37')](_0x41078f);}return _0x3eb5e7[_0x6359('0x38')]();};}function saveUpdates(_0x4894a6,_0x4a2a7f){return function(_0xfa6c25){if(_0xfa6c25){return _0xfa6c25[_0x6359('0x39')](_0x4894a6)[_0x6359('0x22')](function(_0x1d66e6){return _0x1d66e6;});}return null;};}function removeEntity(_0x26c3e9,_0xbafef6){return function(_0x4c8a1c){if(_0x4c8a1c){return _0x4c8a1c[_0x6359('0x3a')]()[_0x6359('0x22')](function(){_0x26c3e9['status'](0xcc)[_0x6359('0x2e')]();});}};}function handleEntityNotFound(_0x3d80d9,_0x35eccb){return function(_0x2bd0d0){if(!_0x2bd0d0){_0x3d80d9[_0x6359('0x3b')](0x194);}return _0x2bd0d0;};}function handleError(_0x22bb40,_0x3e7245){_0x3e7245=_0x3e7245||0x1f4;return function(_0x1f0cd4){logger['error'](_0x1f0cd4[_0x6359('0x3c')]);if(_0x1f0cd4['name']){delete _0x1f0cd4[_0x6359('0x3d')];}_0x22bb40[_0x6359('0x2d')](_0x3e7245)[_0x6359('0x3e')](_0x1f0cd4);};}exports[_0x6359('0x3f')]=function(_0x2afc0c,_0x41910e){var _0x2aacc0={},_0x585998={},_0x575f55={'count':0x0,'rows':[]};var _0x2bbaf8=_[_0x6359('0x40')](db[_0x6359('0x41')]['rawAttributes'],function(_0x3a5d05){return{'name':_0x3a5d05['fieldName'],'type':_0x3a5d05[_0x6359('0x42')][_0x6359('0x43')]};});_0x585998[_0x6359('0x44')]=_[_0x6359('0x40')](_0x2bbaf8,'name');_0x585998[_0x6359('0x45')]=_[_0x6359('0x46')](_0x2afc0c[_0x6359('0x45')]);_0x585998[_0x6359('0x47')]=_[_0x6359('0x48')](_0x585998[_0x6359('0x44')],_0x585998[_0x6359('0x45')]);_0x2aacc0['attributes']=_[_0x6359('0x48')](_0x585998[_0x6359('0x44')],qs['fields'](_0x2afc0c['query'][_0x6359('0x49')]));_0x2aacc0[_0x6359('0x4a')]=_0x2aacc0[_0x6359('0x4a')]['length']?_0x2aacc0[_0x6359('0x4a')]:_0x585998[_0x6359('0x44')];if(!_0x2afc0c[_0x6359('0x45')][_0x6359('0x4b')](_0x6359('0x4c'))){_0x2aacc0[_0x6359('0x31')]=qs[_0x6359('0x31')](_0x2afc0c[_0x6359('0x45')][_0x6359('0x31')]);_0x2aacc0[_0x6359('0x30')]=qs[_0x6359('0x30')](_0x2afc0c[_0x6359('0x45')]['offset']);}_0x2aacc0[_0x6359('0x4d')]=qs[_0x6359('0x4e')](_0x2afc0c[_0x6359('0x45')]['sort']);_0x2aacc0[_0x6359('0x4f')]=qs['filters'](_[_0x6359('0x50')](_0x2afc0c[_0x6359('0x45')],_0x585998[_0x6359('0x47')]),_0x2bbaf8);if(_0x2afc0c[_0x6359('0x45')]['filter']){_0x2aacc0[_0x6359('0x4f')]=_[_0x6359('0x51')](_0x2aacc0[_0x6359('0x4f')],{'$or':_['map'](_0x2bbaf8,function(_0x5a005e){if(_0x5a005e[_0x6359('0x42')]!==_0x6359('0x52')){var _0x3014c7={};_0x3014c7[_0x5a005e[_0x6359('0x3d')]]={'$like':'%'+_0x2afc0c[_0x6359('0x45')][_0x6359('0x53')]+'%'};return _0x3014c7;}})});}_0x2aacc0=_[_0x6359('0x51')]({},_0x2aacc0,_0x2afc0c['options']);var _0x2b9dcb={'where':_0x2aacc0[_0x6359('0x4f')]};return db[_0x6359('0x41')][_0x6359('0x33')](_0x2b9dcb)[_0x6359('0x22')](function(_0x21a7d7){_0x575f55[_0x6359('0x33')]=_0x21a7d7;if(_0x2afc0c[_0x6359('0x45')][_0x6359('0x54')]){_0x2aacc0['include']=[{'all':!![]}];}return db[_0x6359('0x41')]['findAll'](_0x2aacc0);})[_0x6359('0x22')](function(_0x431062){_0x575f55[_0x6359('0x55')]=_0x431062;return _0x575f55;})[_0x6359('0x22')](respondWithFilteredResult(_0x41910e,_0x2aacc0))[_0x6359('0x2c')](handleError(_0x41910e,null));};exports[_0x6359('0x56')]=function(_0xde33ea,_0x3c97fd){var _0x15cbab={'raw':!![],'where':{'id':_0xde33ea[_0x6359('0x57')]['id']}},_0x1b79f9={};_0x1b79f9[_0x6359('0x44')]=_[_0x6359('0x46')](db[_0x6359('0x41')][_0x6359('0x58')]);_0x1b79f9['query']=_[_0x6359('0x46')](_0xde33ea['query']);_0x1b79f9[_0x6359('0x47')]=_[_0x6359('0x48')](_0x1b79f9[_0x6359('0x44')],_0x1b79f9[_0x6359('0x45')]);_0x15cbab[_0x6359('0x4a')]=_[_0x6359('0x48')](_0x1b79f9[_0x6359('0x44')],qs[_0x6359('0x49')](_0xde33ea[_0x6359('0x45')][_0x6359('0x49')]));_0x15cbab['attributes']=_0x15cbab['attributes'][_0x6359('0x59')]?_0x15cbab[_0x6359('0x4a')]:_0x1b79f9[_0x6359('0x44')];if(_0xde33ea[_0x6359('0x45')][_0x6359('0x54')]){_0x15cbab[_0x6359('0x5a')]=[{'all':!![]}];}_0x15cbab=_[_0x6359('0x51')]({},_0x15cbab,_0xde33ea[_0x6359('0x5b')]);return db[_0x6359('0x41')][_0x6359('0x5c')](_0x15cbab)[_0x6359('0x22')](handleEntityNotFound(_0x3c97fd,null))[_0x6359('0x22')](respondWithResult(_0x3c97fd,null))[_0x6359('0x2c')](handleError(_0x3c97fd,null));};exports[_0x6359('0x5d')]=function(_0x5a9fce,_0x4088ec){return db[_0x6359('0x41')][_0x6359('0x5d')](_0x5a9fce[_0x6359('0x5e')],{})[_0x6359('0x22')](respondWithResult(_0x4088ec,0xc9))[_0x6359('0x2c')](handleError(_0x4088ec,null));};exports[_0x6359('0x39')]=function(_0x47116d,_0x8c8d7a){if(_0x47116d['body']['id']){delete _0x47116d[_0x6359('0x5e')]['id'];}return db[_0x6359('0x41')][_0x6359('0x5c')]({'where':{'id':_0x47116d[_0x6359('0x57')]['id']}})['then'](handleEntityNotFound(_0x8c8d7a,null))[_0x6359('0x22')](saveUpdates(_0x47116d['body'],null))[_0x6359('0x22')](respondWithResult(_0x8c8d7a,null))[_0x6359('0x2c')](handleError(_0x8c8d7a,null));};exports[_0x6359('0x3a')]=function(_0x5e4a96,_0x5ac571){return db[_0x6359('0x41')][_0x6359('0x5c')]({'where':{'id':_0x5e4a96[_0x6359('0x57')]['id']}})[_0x6359('0x22')](handleEntityNotFound(_0x5ac571,null))[_0x6359('0x22')](removeEntity(_0x5ac571,null))[_0x6359('0x2c')](handleError(_0x5ac571,null));};exports[_0x6359('0x5f')]=function(_0x608d7d,_0x528725){return db[_0x6359('0x41')][_0x6359('0x5f')]()[_0x6359('0x22')](respondWithResult(_0x528725,null))[_0x6359('0x2c')](handleError(_0x528725,null));};var interaction_log=require('../../config/logger')(_0x6359('0x60'));exports['accept']=function(_0x49c1dd,_0x25da9a,_0x13f300){var _0xdad47a={'agent':{},'channel':_0x6359('0x61')};if(_0x49c1dd['body']['id']){delete _0x49c1dd[_0x6359('0x5e')]['id'];}_0x49c1dd[_0x6359('0x5e')][_0x6359('0x62')]=!![];_0x49c1dd[_0x6359('0x5e')][_0x6359('0x63')]=moment()[_0x6359('0x64')](_0x6359('0x65'));_0x49c1dd[_0x6359('0x5e')]['UserId']=_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')]||_0x49c1dd['user']['id'];_0xdad47a[_0x6359('0x67')]['id']=_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')];return db[_0x6359('0x41')][_0x6359('0x5c')]({'where':{'id':_0x49c1dd[_0x6359('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x25da9a,null))[_0x6359('0x22')](saveUpdates(_0x49c1dd['body'],null))['then'](function(_0x152d41){if(_0x152d41){_0xdad47a['message']=_0x152d41[_0x6359('0x68')]({'plain':!![]});return db[_0x6359('0x69')][_0x6359('0x5c')]({'where':{'id':_0x152d41['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x25da9a,null))[_0x6359('0x22')](function(_0x216d94){if(_0x216d94){return _0x216d94['update']({'UserId':_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')],'read1stAt':_['isNil'](_0x216d94[_0x6359('0x6a')])?moment()[_0x6359('0x64')](_0x6359('0x65')):undefined});}return null;})[_0x6359('0x22')](function(_0xac8bf1){if(_0xac8bf1){_0xdad47a[_0x6359('0x6b')]=_0xac8bf1[_0x6359('0x68')]({'plain':!![]});interaction_log['info'](_0x6359('0x6c'),_0x49c1dd[_0x6359('0x6d')]['id'],_0x49c1dd[_0x6359('0x6d')][_0x6359('0x3d')],_0x49c1dd[_0x6359('0x6d')][_0x6359('0x6e')],_0xdad47a[_0x6359('0x6b')]['id'],_0x49c1dd[_0x6359('0x5e')]?JSON[_0x6359('0x27')](_0x49c1dd[_0x6359('0x5e')]):_0x6359('0x6f'));return respondWithRpcPromise(_0x6359('0x70'),_0x6359('0x71'),_0xdad47a);}return null;})['then'](function(_0x5e8882){var _0x2b88e7=_0x6359('0x72')+_0x5e8882[_0x6359('0x2a')]['ContactId'];return db[_0x6359('0x73')][_0x6359('0x45')](_0x2b88e7,{'type':db['Sequelize'][_0x6359('0x74')][_0x6359('0x75')],'raw':!![]})[_0x6359('0x22')](function(_0x3ea707){return _0x3ea707;});})['then'](function(_0xf0c1ca){if(_0xf0c1ca){_0xdad47a[_0x6359('0x2a')]['contact']=_0xf0c1ca[0x0];if(!_0x49c1dd[_0x6359('0x5e')]['UserId'])return;return db[_0x6359('0x76')][_0x6359('0x5c')]({'where':{'id':_0x49c1dd[_0x6359('0x5e')][_0x6359('0x66')],'role':_0x6359('0x67')},'attributes':['id','name',_0x6359('0x77'),_0x6359('0x78'),_0x6359('0x79')],'raw':!![]});}return null;})[_0x6359('0x22')](function(_0x116b45){if(!_0x116b45)return null;_0xdad47a['message'][_0x6359('0x67')]=_0x116b45;return _0xdad47a;})[_0x6359('0x22')](function(_0x247bf0){if(_0x247bf0){if(_0x49c1dd[_0x6359('0x5e')]['manual']){_0xdad47a['message']['interface']=util[_0x6359('0x64')](_0x6359('0x7a'),_0x49c1dd[_0x6359('0x6d')][_0x6359('0x3d')]);_0xdad47a[_0x6359('0x2a')][_0x6359('0x7b')]=_0xdad47a[_0x6359('0x7b')];_0xdad47a[_0x6359('0x2a')][_0x6359('0x7c')]=_0xdad47a[_0x6359('0x7b')];_0xdad47a[_0x6359('0x2a')]['event']=_0x6359('0x7d');return respondWithRpcPromise(_0x6359('0x7e'),_0x6359('0x7e'),{'event':_0x6359('0x7f'),'message':_[_0x6359('0x51')](_0xdad47a[_0x6359('0x2a')],JSON['parse'](_0xdad47a[_0x6359('0x6b')][_0x6359('0x80')]))},client9002)[_0x6359('0x22')](function(){return _0xdad47a;});}return _0xdad47a;}return null;})['then'](respondWithResult(_0x25da9a,null))[_0x6359('0x2c')](handleError(_0x25da9a,null));};var interaction_log=require(_0x6359('0x13'))(_0x6359('0x60'));exports[_0x6359('0x37')]=function(_0x52d0a6,_0x1f60c6,_0x3c9dbc){var _0x31d578={'agent':{},'channel':_0x6359('0x61')};if(_0x52d0a6[_0x6359('0x5e')]['id']){delete _0x52d0a6['body']['id'];}_0x52d0a6[_0x6359('0x5e')]['UserId']=_0x52d0a6['body']['UserId']||_0x52d0a6[_0x6359('0x6d')]['id'];_0x31d578['agent']['id']=_0x52d0a6[_0x6359('0x5e')][_0x6359('0x66')];return db[_0x6359('0x41')]['find']({'where':{'id':_0x52d0a6[_0x6359('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1f60c6,null))['then'](function(_0x3160de){if(_0x3160de){_0x31d578[_0x6359('0x2a')]=_0x3160de[_0x6359('0x68')]({'plain':!![]});return db[_0x6359('0x69')]['find']({'where':{'id':_0x3160de[_0x6359('0x81')]}});}return null;})[_0x6359('0x22')](handleEntityNotFound(_0x1f60c6,null))[_0x6359('0x22')](function(_0x126158){if(_0x126158){_0x31d578['interaction']=_0x126158[_0x6359('0x68')]({'plain':!![]});interaction_log['info'](_0x6359('0x82'),_0x52d0a6[_0x6359('0x6d')]['id'],_0x52d0a6[_0x6359('0x6d')][_0x6359('0x3d')],_0x52d0a6[_0x6359('0x6d')][_0x6359('0x6e')],_0x31d578['interaction']['id'],_0x52d0a6['body']?JSON[_0x6359('0x27')](_0x52d0a6[_0x6359('0x5e')]):_0x6359('0x6f'));return respondWithRpcPromise('RejectMessage',_0x6359('0x83'),_0x31d578);}return null;})[_0x6359('0x22')](function(_0x5f1520){var _0x2a1eee=_0x6359('0x72')+_0x5f1520[_0x6359('0x2a')]['ContactId'];return db[_0x6359('0x73')]['query'](_0x2a1eee,{'type':db['Sequelize'][_0x6359('0x74')][_0x6359('0x75')],'raw':!![]})[_0x6359('0x22')](function(_0x5b60e){return _0x5b60e;});})[_0x6359('0x22')](function(_0x3a1e88){if(_0x3a1e88){_0x31d578[_0x6359('0x2a')][_0x6359('0x84')]=_0x3a1e88[0x0];if(!_0x52d0a6[_0x6359('0x5e')][_0x6359('0x66')])return;return db[_0x6359('0x76')][_0x6359('0x5c')]({'where':{'id':_0x52d0a6[_0x6359('0x5e')][_0x6359('0x66')],'role':'agent'},'attributes':['id',_0x6359('0x3d'),_0x6359('0x77'),'email',_0x6359('0x79')],'raw':!![]});}return null;})[_0x6359('0x22')](function(_0x1118cc){if(!_0x1118cc)return null;_0x31d578[_0x6359('0x2a')][_0x6359('0x67')]=_0x1118cc;return _0x31d578;})[_0x6359('0x22')](function(_0x308609){if(_0x308609){_0x308609['message'][_0x6359('0x85')]=util[_0x6359('0x64')]('SIP/%s',_0x52d0a6[_0x6359('0x6d')][_0x6359('0x3d')]);_0x308609[_0x6359('0x2a')][_0x6359('0x7b')]=_0x31d578[_0x6359('0x7b')];_0x308609['message'][_0x6359('0x7c')]=_0x31d578['channel'];_0x308609[_0x6359('0x2a')][_0x6359('0x86')]='reject';respondWithRpcPromise('EventManager',_0x6359('0x7e'),{'event':_0x6359('0x87'),'message':_[_0x6359('0x51')](_0x31d578[_0x6359('0x2a')],JSON[_0x6359('0x88')](_0x31d578[_0x6359('0x6b')][_0x6359('0x80')]))},client9002);return _0x31d578;}return null;})[_0x6359('0x22')](respondWithResult(_0x1f60c6,null))[_0x6359('0x2c')](handleError(_0x1f60c6,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b31a11b..8adbaeb 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 _0x0e76=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','ChatMessage'];(function(_0x5d8d1d,_0xd0512c){var _0x59a460=function(_0x1e83b0){while(--_0x1e83b0){_0x5d8d1d['push'](_0x5d8d1d['shift']());}};_0x59a460(++_0xd0512c);}(_0x0e76,0x1e6));var _0x60e7=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x0e76[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x60e7('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x60e7('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x60e7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x60e7('0x3')};function emitEvent(_0x4e7e14){return function(_0x14fc9e,_0x608df,_0x2abe02){ChatMessageEvents[_0x60e7('0x4')](_0x4e7e14+':'+_0x14fc9e['id'],_0x14fc9e);ChatMessageEvents[_0x60e7('0x4')](_0x4e7e14,_0x14fc9e);_0x2abe02(null);};}for(var e in events){if(events[_0x60e7('0x5')](e)){var event=events[e];ChatMessage[_0x60e7('0x6')](e,emitEvent(event));}}module[_0x60e7('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x9b68=['remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5e6c86,_0x404a95){var _0x1e9cff=function(_0x440607){while(--_0x440607){_0x5e6c86['push'](_0x5e6c86['shift']());}};_0x1e9cff(++_0x404a95);}(_0x9b68,0xf9));var _0x89b6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x9b68[_0x5834bc];return _0x3e183a;};'use strict';var EventEmitter=require(_0x89b6('0x0'));var ChatMessage=require(_0x89b6('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x89b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x89b6('0x3')};function emitEvent(_0x33bf4b){return function(_0x5cceae,_0x131407,_0x2409aa){ChatMessageEvents[_0x89b6('0x4')](_0x33bf4b+':'+_0x5cceae['id'],_0x5cceae);ChatMessageEvents[_0x89b6('0x4')](_0x33bf4b,_0x5cceae);_0x2409aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x89b6('0x5')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 7fc0cf4..6c80e67 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 _0x8cdd=['api','moment','request-promise','path','rimraf','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','direction','error','utf8mb4','util','../../config/logger'];(function(_0x5650b4,_0x2723ba){var _0x297a62=function(_0x4ceedf){while(--_0x4ceedf){_0x5650b4['push'](_0x5650b4['shift']());}};_0x297a62(++_0x2723ba);}(_0x8cdd,0x1ec));var _0xd8cd=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x8cdd[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xd8cd('0x0'));var logger=require(_0xd8cd('0x1'))(_0xd8cd('0x2'));var moment=require(_0xd8cd('0x3'));var BPromise=require('bluebird');var rp=require(_0xd8cd('0x4'));var fs=require('fs');var path=require(_0xd8cd('0x5'));var rimraf=require(_0xd8cd('0x6'));var config=require('../../config/environment');var attributes=require(_0xd8cd('0x7'));module[_0xd8cd('0x8')]=function(_0x48fdfc,_0x1b46ad){return _0x48fdfc['define']('ChatMessage',attributes,{'tableName':_0xd8cd('0x9'),'paranoid':![],'indexes':[{'name':_0xd8cd('0xa'),'fields':[_0xd8cd('0xb')],'type':_0xd8cd('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4bf22f,_0x2f59ff,_0x50f52b){var _0x20c93c=_0x48fdfc[_0xd8cd('0xd')];var _0x172cb5=_0x4bf22f[_0xd8cd('0xe')]({'plain':!![]});if(_0x172cb5['direction']['toLowerCase']()==='in'||_0x172cb5['direction']['toLowerCase']()===_0xd8cd('0xf')&&!_0x172cb5[_0xd8cd('0x10')]&&!_['isNil'](_0x172cb5[_0xd8cd('0x11')])){_0x20c93c[_0xd8cd('0x12')]['findOne']({'where':{'id':_0x172cb5[_0xd8cd('0x13')]}})[_0xd8cd('0x14')](function(_0x51d5cb){if(_0x51d5cb){_0x51d5cb[_0xd8cd('0x15')]({'lastMsgAt':_0x172cb5[_0xd8cd('0x16')],'lastMsgDirection':_0x172cb5[_0xd8cd('0x17')]['toLowerCase']()});}})['catch'](function(_0x2e161d){console[_0xd8cd('0x18')](_0x2e161d);});}_0x50f52b();}},'charset':_0xd8cd('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8c8a=['get','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','util','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models'];(function(_0x107179,_0x46e138){var _0x31f40e=function(_0x5973c1){while(--_0x5973c1){_0x107179['push'](_0x107179['shift']());}};_0x31f40e(++_0x46e138);}(_0x8c8a,0x17a));var _0xa8c8=function(_0x1e24f8,_0x52070f){_0x1e24f8=_0x1e24f8-0x0;var _0x5c4446=_0x8c8a[_0x1e24f8];return _0x5c4446;};'use strict';var _=require('lodash');var util=require(_0xa8c8('0x0'));var logger=require('../../config/logger')(_0xa8c8('0x1'));var moment=require('moment');var BPromise=require(_0xa8c8('0x2'));var rp=require(_0xa8c8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8c8('0x4'));var config=require(_0xa8c8('0x5'));var attributes=require('./chatMessage.attributes');module[_0xa8c8('0x6')]=function(_0x106dbf,_0x584775){return _0x106dbf[_0xa8c8('0x7')](_0xa8c8('0x8'),attributes,{'tableName':_0xa8c8('0x9'),'paranoid':![],'indexes':[{'name':_0xa8c8('0xa'),'fields':[_0xa8c8('0xb')],'type':_0xa8c8('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x219e0f,_0x534f76,_0x44a4fd){var _0x37faea=_0x106dbf[_0xa8c8('0xd')];var _0x482360=_0x219e0f[_0xa8c8('0xe')]({'plain':!![]});if(_0x482360[_0xa8c8('0xf')]['toLowerCase']()==='in'||_0x482360[_0xa8c8('0xf')]['toLowerCase']()==='out'&&!_0x482360[_0xa8c8('0x10')]&&!_[_0xa8c8('0x11')](_0x482360[_0xa8c8('0x12')])){_0x37faea[_0xa8c8('0x13')][_0xa8c8('0x14')]({'where':{'id':_0x482360[_0xa8c8('0x15')]}})[_0xa8c8('0x16')](function(_0xc50ca7){if(_0xc50ca7){_0xc50ca7[_0xa8c8('0x17')]({'lastMsgAt':_0x482360[_0xa8c8('0x18')],'lastMsgDirection':_0x482360[_0xa8c8('0xf')]['toLowerCase']()});}})[_0xa8c8('0x19')](function(_0x391f2a){console[_0xa8c8('0x1a')](_0x391f2a);});}_0x44a4fd();}},'charset':_0xa8c8('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 0489ac4..d9e3e4d 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 _0xbd85=['redis','register','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5b3767,_0x1ffdbc){var _0x159358=function(_0x11b0b8){while(--_0x11b0b8){_0x5b3767['push'](_0x5b3767['shift']());}};_0x159358(++_0x1ffdbc);}(_0xbd85,0x1f4));var _0x5bd8=function(_0x45dafa,_0x171e29){_0x45dafa=_0x45dafa-0x0;var _0xeb385a=_0xbd85[_0x45dafa];return _0xeb385a;};'use strict';var _=require('lodash');var util=require(_0x5bd8('0x0'));var moment=require(_0x5bd8('0x1'));var BPromise=require(_0x5bd8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bd8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bd8('0x4'));var logger=require(_0x5bd8('0x5'))('rpc');var config=require(_0x5bd8('0x6'));var jayson=require(_0x5bd8('0x7'));var client=jayson[_0x5bd8('0x8')][_0x5bd8('0x9')]({'port':0x232a});config[_0x5bd8('0xa')]=_['defaults'](config[_0x5bd8('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5bd8('0xa')]));require('./chatMessage.socket')[_0x5bd8('0xb')](socket);function respondWithRpcPromise(_0x47b1d0,_0x277474,_0x49b8d0){return new BPromise(function(_0x1f23cd,_0x57dc30){return client[_0x5bd8('0xc')](_0x47b1d0,_0x49b8d0)[_0x5bd8('0xd')](function(_0x5d7fa4){logger['info']('ChatMessage,\x20%s,\x20%s',_0x277474,_0x5bd8('0xe'));logger[_0x5bd8('0xf')](_0x5bd8('0x10'),_0x277474,_0x5bd8('0xe'),JSON[_0x5bd8('0x11')](_0x5d7fa4));if(_0x5d7fa4['error']){if(_0x5d7fa4[_0x5bd8('0x12')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x277474,_0x5d7fa4[_0x5bd8('0x12')]['message']);return _0x57dc30(_0x5d7fa4[_0x5bd8('0x12')][_0x5bd8('0x13')]);}logger['error'](_0x5bd8('0x14'),_0x277474,_0x5d7fa4[_0x5bd8('0x12')][_0x5bd8('0x13')]);return _0x1f23cd(_0x5d7fa4[_0x5bd8('0x12')][_0x5bd8('0x13')]);}else{logger[_0x5bd8('0x15')](_0x5bd8('0x14'),_0x277474,_0x5bd8('0xe'));_0x1f23cd(_0x5d7fa4[_0x5bd8('0x16')][_0x5bd8('0x13')]);}})[_0x5bd8('0x17')](function(_0x5c6631){logger['error']('ChatMessage,\x20%s,\x20%s',_0x277474,_0x5c6631);_0x57dc30(_0x5c6631);});});}exports[_0x5bd8('0x18')]=function(_0x32ebb9){var _0x364738=this;return new Promise(function(_0x3883fe,_0x4c0d29){return db[_0x5bd8('0x19')][_0x5bd8('0x1a')](_0x32ebb9[_0x5bd8('0x1b')],{'raw':_0x32ebb9[_0x5bd8('0x1c')]?_0x32ebb9['options'][_0x5bd8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x35a49f){logger[_0x5bd8('0x15')](_0x5bd8('0x18'),_0x32ebb9);logger[_0x5bd8('0xf')](_0x5bd8('0x18'),_0x32ebb9,JSON[_0x5bd8('0x11')](_0x35a49f));_0x3883fe(_0x35a49f);})['catch'](function(_0x5621c6){logger[_0x5bd8('0x12')](_0x5bd8('0x18'),_0x5621c6[_0x5bd8('0x13')],_0x32ebb9);_0x4c0d29(_0x364738[_0x5bd8('0x12')](0x1f4,_0x5621c6[_0x5bd8('0x13')]));});});};
\ No newline at end of file
+var _0x15b3=['redis','defaults','localhost','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x8efe18,_0x138ad9){var _0x87719f=function(_0xdd4675){while(--_0xdd4675){_0x8efe18['push'](_0x8efe18['shift']());}};_0x87719f(++_0x138ad9);}(_0x15b3,0x1b5));var _0x315b=function(_0x146be9,_0xe85bf1){_0x146be9=_0x146be9-0x0;var _0x44bf49=_0x15b3[_0x146be9];return _0x44bf49;};'use strict';var _=require(_0x315b('0x0'));var util=require(_0x315b('0x1'));var moment=require(_0x315b('0x2'));var BPromise=require(_0x315b('0x3'));var rs=require(_0x315b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x315b('0x5'));var logger=require('../../config/logger')(_0x315b('0x6'));var config=require(_0x315b('0x7'));var jayson=require(_0x315b('0x8'));var client=jayson[_0x315b('0x9')][_0x315b('0xa')]({'port':0x232a});config[_0x315b('0xb')]=_[_0x315b('0xc')](config[_0x315b('0xb')],{'host':_0x315b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x315b('0xb')]));require('./chatMessage.socket')[_0x315b('0xe')](socket);function respondWithRpcPromise(_0x565b6b,_0x2549dc,_0x5493cf){return new BPromise(function(_0x1bb67d,_0x7128ed){return client[_0x315b('0xf')](_0x565b6b,_0x5493cf)[_0x315b('0x10')](function(_0x44eac2){logger[_0x315b('0x11')]('ChatMessage,\x20%s,\x20%s',_0x2549dc,_0x315b('0x12'));logger['debug'](_0x315b('0x13'),_0x2549dc,_0x315b('0x12'),JSON['stringify'](_0x44eac2));if(_0x44eac2[_0x315b('0x14')]){if(_0x44eac2[_0x315b('0x14')][_0x315b('0x15')]===0x1f4){logger[_0x315b('0x14')](_0x315b('0x16'),_0x2549dc,_0x44eac2[_0x315b('0x14')][_0x315b('0x17')]);return _0x7128ed(_0x44eac2['error'][_0x315b('0x17')]);}logger[_0x315b('0x14')](_0x315b('0x16'),_0x2549dc,_0x44eac2[_0x315b('0x14')][_0x315b('0x17')]);return _0x1bb67d(_0x44eac2[_0x315b('0x14')][_0x315b('0x17')]);}else{logger[_0x315b('0x11')](_0x315b('0x16'),_0x2549dc,_0x315b('0x12'));_0x1bb67d(_0x44eac2[_0x315b('0x18')][_0x315b('0x17')]);}})[_0x315b('0x19')](function(_0x48ea03){logger[_0x315b('0x14')]('ChatMessage,\x20%s,\x20%s',_0x2549dc,_0x48ea03);_0x7128ed(_0x48ea03);});});}exports[_0x315b('0x1a')]=function(_0x30980b){var _0x2f1d01=this;return new Promise(function(_0x239347,_0x75b1fc){return db[_0x315b('0x1b')][_0x315b('0x1c')](_0x30980b['body'],{'raw':_0x30980b[_0x315b('0x1d')]?_0x30980b[_0x315b('0x1d')][_0x315b('0x1e')]===undefined?!![]:![]:!![]})[_0x315b('0x10')](function(_0x4d1e1c){logger['info'](_0x315b('0x1a'),_0x30980b);logger[_0x315b('0x1f')](_0x315b('0x1a'),_0x30980b,JSON['stringify'](_0x4d1e1c));_0x239347(_0x4d1e1c);})['catch'](function(_0x3869da){logger[_0x315b('0x14')](_0x315b('0x1a'),_0x3869da[_0x315b('0x17')],_0x30980b);_0x75b1fc(_0x2f1d01[_0x315b('0x14')](0x1f4,_0x3869da['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ecadc4c..49b1aee 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 _0x6075=['remove','update','emit','register','chatMessage:','save'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0x6075,0x191));var _0x5607=function(_0x4ade50,_0x372294){_0x4ade50=_0x4ade50-0x0;var _0x1d1628=_0x6075[_0x4ade50];return _0x1d1628;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5607('0x0'),_0x5607('0x1'),_0x5607('0x2')];function createListener(_0x24427f,_0x2bcf4e){return function(_0x120ba2){_0x2bcf4e[_0x5607('0x3')](_0x24427f,_0x120ba2);};}function removeListener(_0x100852,_0x2a1c03){return function(){ChatMessageEvents['removeListener'](_0x100852,_0x2a1c03);};}exports[_0x5607('0x4')]=function(_0xabf691){for(var _0x14b9f4=0x0,_0x5ab18d=events['length'];_0x14b9f4<_0x5ab18d;_0x14b9f4++){var _0x3dc860=events[_0x14b9f4];var _0x25107d=createListener(_0x5607('0x5')+_0x3dc860,_0xabf691);ChatMessageEvents['on'](_0x3dc860,_0x25107d);}};
\ No newline at end of file
+var _0x3edc=['remove','update','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3edc,0x1ae));var _0xc3ed=function(_0xdb50e1,_0x112a80){_0xdb50e1=_0xdb50e1-0x0;var _0x2a50fc=_0x3edc[_0xdb50e1];return _0x2a50fc;};'use strict';var ChatMessageEvents=require(_0xc3ed('0x0'));var events=[_0xc3ed('0x1'),_0xc3ed('0x2'),_0xc3ed('0x3')];function createListener(_0xae2b4f,_0x47a242){return function(_0x2a8714){_0x47a242['emit'](_0xae2b4f,_0x2a8714);};}function removeListener(_0x3519ab,_0x19d8dc){return function(){ChatMessageEvents[_0xc3ed('0x4')](_0x3519ab,_0x19d8dc);};}exports[_0xc3ed('0x5')]=function(_0x3f8468){for(var _0x50b95c=0x0,_0x1b28d4=events[_0xc3ed('0x6')];_0x50b95c<_0x1b28d4;_0x50b95c++){var _0x14d194=events[_0x50b95c];var _0x2f28ce=createListener(_0xc3ed('0x7')+_0x14d194,_0x3f8468);ChatMessageEvents['on'](_0x14d194,_0x2f28ce);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 6cc5b30..b6b82dc 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 _0x2f0b=['get','/describe','describe','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x2f0b,0x197));var _0xb2f0=function(_0x3b3eaa,_0x487e77){_0x3b3eaa=_0x3b3eaa-0x0;var _0x1c8f7d=_0x2f0b[_0x3b3eaa];return _0x1c8f7d;};'use strict';var multer=require(_0xb2f0('0x0'));var util=require(_0xb2f0('0x1'));var path=require(_0xb2f0('0x2'));var timeout=require(_0xb2f0('0x3'));var express=require('express');var router=express[_0xb2f0('0x4')]();var fs_extra=require(_0xb2f0('0x5'));var auth=require(_0xb2f0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb2f0('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xb2f0('0x8')](),controller['index']);router[_0xb2f0('0x9')](_0xb2f0('0xa'),auth[_0xb2f0('0x8')](),controller[_0xb2f0('0xb')]);router[_0xb2f0('0x9')]('/:id',auth[_0xb2f0('0x8')](),controller['show']);router[_0xb2f0('0xc')]('/',auth[_0xb2f0('0x8')](),interaction['tracked'](_0xb2f0('0xd'),_0xb2f0('0xe')),controller[_0xb2f0('0xf')]);router[_0xb2f0('0x10')]('/:id',controller[_0xb2f0('0x11')]);router[_0xb2f0('0x10')](_0xb2f0('0x12'),auth['isAuthenticated'](),controller[_0xb2f0('0x13')]);router[_0xb2f0('0x10')](_0xb2f0('0x14'),auth[_0xb2f0('0x8')](),controller[_0xb2f0('0x15')]);router[_0xb2f0('0x16')](_0xb2f0('0x17'),auth[_0xb2f0('0x8')](),controller[_0xb2f0('0x18')]);module[_0xb2f0('0x19')]=router;
\ No newline at end of file
+var _0x4906=['put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chatmessage:create'];(function(_0x5cc61d,_0x4fe17b){var _0x2e25d0=function(_0x265dd8){while(--_0x265dd8){_0x5cc61d['push'](_0x5cc61d['shift']());}};_0x2e25d0(++_0x4fe17b);}(_0x4906,0x128));var _0x6490=function(_0x3bcfa9,_0x45a831){_0x3bcfa9=_0x3bcfa9-0x0;var _0x171c6f=_0x4906[_0x3bcfa9];return _0x171c6f;};'use strict';var multer=require(_0x6490('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6490('0x1'));var express=require(_0x6490('0x2'));var router=express[_0x6490('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6490('0x4'));var interaction=require(_0x6490('0x5'));var config=require('../../config/environment');var controller=require(_0x6490('0x6'));router[_0x6490('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6490('0x8'),auth[_0x6490('0x9')](),controller[_0x6490('0xa')]);router[_0x6490('0x7')](_0x6490('0xb'),auth[_0x6490('0x9')](),controller[_0x6490('0xc')]);router[_0x6490('0xd')]('/',auth[_0x6490('0x9')](),interaction[_0x6490('0xe')]('chat',_0x6490('0xf')),controller['create']);router[_0x6490('0x10')](_0x6490('0xb'),controller[_0x6490('0x11')]);router['put'](_0x6490('0x12'),auth[_0x6490('0x9')](),controller[_0x6490('0x13')]);router[_0x6490('0x10')](_0x6490('0x14'),auth[_0x6490('0x9')](),controller[_0x6490('0x15')]);router['delete'](_0x6490('0xb'),auth[_0x6490('0x9')](),controller[_0x6490('0x16')]);module[_0x6490('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f69b5e7..21ad6a7 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 _0x2032=['medium','exports','TEXT'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0x2032,0xd9));var _0x2203=function(_0x5dedcd,_0x535ff0){_0x5dedcd=_0x5dedcd-0x0;var _0x547e63=_0x2032[_0x5dedcd];return _0x547e63;};'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
+var _0xadb5=['medium','TEXT','exports'];(function(_0x5412c2,_0x2f3149){var _0x5766d0=function(_0xc6de7d){while(--_0xc6de7d){_0x5412c2['push'](_0x5412c2['shift']());}};_0x5766d0(++_0x2f3149);}(_0xadb5,0xad));var _0x5adb=function(_0x30fb89,_0x21e625){_0x30fb89=_0x30fb89-0x0;var _0xafff15=_0xadb5[_0x30fb89];return _0xafff15;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index fff4f67..adfaa89 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x58ffc0,_0xb0152a){_0x58ffc0=_0x58ffc0-0x0;var _0x5e3c87=_0x7a54[_0x58ffc0];return _0x5e3c87;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x17c160,_0x19ff78){var _0x2a0a56=function(_0x566147){while(--_0x566147){_0x17c160['push'](_0x17c160['shift']());}};_0x2a0a56(++_0x19ff78);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 836501b..2669b2b 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 _0x8b24=['ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8b24,0x178));var _0x48b2=function(_0x31b14a,_0x5c13a9){_0x31b14a=_0x31b14a-0x0;var _0x13c886=_0x8b24[_0x31b14a];return _0x13c886;};'use strict';var EventEmitter=require(_0x48b2('0x0'));var ChatOfflineMessage=require(_0x48b2('0x1'))['db'][_0x48b2('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48b2('0x3'),'afterUpdate':_0x48b2('0x4'),'afterDestroy':_0x48b2('0x5')};function emitEvent(_0x24e29c){return function(_0x3e5599,_0xeacf72,_0x308999){ChatOfflineMessageEvents[_0x48b2('0x6')](_0x24e29c+':'+_0x3e5599['id'],_0x3e5599);ChatOfflineMessageEvents[_0x48b2('0x6')](_0x24e29c,_0x3e5599);_0x308999(null);};}for(var e in events){if(events[_0x48b2('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x48b2('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x8e19=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x8e19,0x75));var _0x98e1=function(_0x3a00eb,_0x112cb5){_0x3a00eb=_0x3a00eb-0x0;var _0x55f40f=_0x8e19[_0x3a00eb];return _0x55f40f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x98e1('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98e1('0x1'),'afterUpdate':_0x98e1('0x2'),'afterDestroy':_0x98e1('0x3')};function emitEvent(_0x19576b){return function(_0x301693,_0x5e63fd,_0x365436){ChatOfflineMessageEvents[_0x98e1('0x4')](_0x19576b+':'+_0x301693['id'],_0x301693);ChatOfflineMessageEvents[_0x98e1('0x4')](_0x19576b,_0x301693);_0x365436(null);};}for(var e in events){if(events[_0x98e1('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x98e1('0x6')](e,emitEvent(event));}}module[_0x98e1('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3655298..7c01135 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 _0xc55a=['./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4ae06a,_0x4147ad){var _0x28fc9e=function(_0x1b04f8){while(--_0x1b04f8){_0x4ae06a['push'](_0x4ae06a['shift']());}};_0x28fc9e(++_0x4147ad);}(_0xc55a,0x1b0));var _0xac55=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xc55a[_0x9c2427];return _0x51984f;};'use strict';var attributes=require(_0xac55('0x0'));module['exports']=function(_0x405627){return _0x405627[_0xac55('0x1')](_0xac55('0x2'),attributes,{'tableName':_0xac55('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xac55('0x4'),'collate':_0xac55('0x5')});};
\ No newline at end of file
+var _0x2bff=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x50675b,_0xba75bf){var _0x4b2d1b=function(_0x1922f8){while(--_0x1922f8){_0x50675b['push'](_0x50675b['shift']());}};_0x4b2d1b(++_0xba75bf);}(_0x2bff,0x118));var _0xf2bf=function(_0x256c93,_0x357a06){_0x256c93=_0x256c93-0x0;var _0x27f763=_0x2bff[_0x256c93];return _0x27f763;};'use strict';var attributes=require(_0xf2bf('0x0'));module[_0xf2bf('0x1')]=function(_0x1af7b6){return _0x1af7b6[_0xf2bf('0x2')](_0xf2bf('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2bf('0x4'),'collate':_0xf2bf('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index c7db123..bfa5e28 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 _0x2b0a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xf1c911,_0xc36b00){var _0x5c8d10=function(_0xf6ad00){while(--_0xf6ad00){_0xf1c911['push'](_0xf1c911['shift']());}};_0x5c8d10(++_0xc36b00);}(_0x2b0a,0x73));var _0xa2b0=function(_0x1cfb17,_0x5f4e13){_0x1cfb17=_0x1cfb17-0x0;var _0x2e2379=_0x2b0a[_0x1cfb17];return _0x2e2379;};'use strict';var _=require(_0xa2b0('0x0'));var util=require(_0xa2b0('0x1'));var moment=require(_0xa2b0('0x2'));var BPromise=require('bluebird');var rs=require(_0xa2b0('0x3'));var fs=require('fs');var Redis=require(_0xa2b0('0x4'));var db=require(_0xa2b0('0x5'))['db'];var utils=require(_0xa2b0('0x6'));var logger=require(_0xa2b0('0x7'))(_0xa2b0('0x8'));var config=require(_0xa2b0('0x9'));var jayson=require(_0xa2b0('0xa'));var client=jayson[_0xa2b0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1914a3,_0xcaf641,_0xc8d2d7){return new BPromise(function(_0x460174,_0x39abfc){return client[_0xa2b0('0xc')](_0x1914a3,_0xc8d2d7)[_0xa2b0('0xd')](function(_0xbaeeaf){logger['info'](_0xa2b0('0xe'),_0xcaf641,_0xa2b0('0xf'));logger[_0xa2b0('0x10')](_0xa2b0('0x11'),_0xcaf641,_0xa2b0('0xf'),JSON[_0xa2b0('0x12')](_0xbaeeaf));if(_0xbaeeaf['error']){if(_0xbaeeaf[_0xa2b0('0x13')][_0xa2b0('0x14')]===0x1f4){logger[_0xa2b0('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0xcaf641,_0xbaeeaf[_0xa2b0('0x13')]['message']);return _0x39abfc(_0xbaeeaf['error'][_0xa2b0('0x15')]);}logger[_0xa2b0('0x13')](_0xa2b0('0xe'),_0xcaf641,_0xbaeeaf[_0xa2b0('0x13')][_0xa2b0('0x15')]);return _0x460174(_0xbaeeaf[_0xa2b0('0x13')][_0xa2b0('0x15')]);}else{logger['info'](_0xa2b0('0xe'),_0xcaf641,_0xa2b0('0xf'));_0x460174(_0xbaeeaf[_0xa2b0('0x16')][_0xa2b0('0x15')]);}})[_0xa2b0('0x17')](function(_0x3a43d8){logger[_0xa2b0('0x13')](_0xa2b0('0xe'),_0xcaf641,_0x3a43d8);_0x39abfc(_0x3a43d8);});});}
\ No newline at end of file
+var _0x6797=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5c85c0,_0x5c1ea4){var _0x55e215=function(_0x2bb588){while(--_0x2bb588){_0x5c85c0['push'](_0x5c85c0['shift']());}};_0x55e215(++_0x5c1ea4);}(_0x6797,0x94));var _0x7679=function(_0x592e90,_0x30ecc5){_0x592e90=_0x592e90-0x0;var _0x1eac0b=_0x6797[_0x592e90];return _0x1eac0b;};'use strict';var _=require(_0x7679('0x0'));var util=require(_0x7679('0x1'));var moment=require(_0x7679('0x2'));var BPromise=require(_0x7679('0x3'));var rs=require(_0x7679('0x4'));var fs=require('fs');var Redis=require(_0x7679('0x5'));var db=require(_0x7679('0x6'))['db'];var utils=require(_0x7679('0x7'));var logger=require(_0x7679('0x8'))('rpc');var config=require(_0x7679('0x9'));var jayson=require(_0x7679('0xa'));var client=jayson['client'][_0x7679('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5326a8,_0x17cd0b,_0xa34325){return new BPromise(function(_0x423561,_0x52150b){return client[_0x7679('0xc')](_0x5326a8,_0xa34325)[_0x7679('0xd')](function(_0x47151a){logger[_0x7679('0xe')](_0x7679('0xf'),_0x17cd0b,_0x7679('0x10'));logger[_0x7679('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x17cd0b,_0x7679('0x10'),JSON[_0x7679('0x12')](_0x47151a));if(_0x47151a[_0x7679('0x13')]){if(_0x47151a[_0x7679('0x13')][_0x7679('0x14')]===0x1f4){logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x47151a[_0x7679('0x13')]['message']);return _0x52150b(_0x47151a[_0x7679('0x13')][_0x7679('0x15')]);}logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x47151a['error'][_0x7679('0x15')]);return _0x423561(_0x47151a[_0x7679('0x13')]['message']);}else{logger[_0x7679('0xe')](_0x7679('0xf'),_0x17cd0b,_0x7679('0x10'));_0x423561(_0x47151a[_0x7679('0x16')][_0x7679('0x15')]);}})[_0x7679('0x17')](function(_0x16eba5){logger[_0x7679('0x13')](_0x7679('0xf'),_0x17cd0b,_0x16eba5);_0x52150b(_0x16eba5);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d736626..b85bad5 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 _0xacca=['/describe','/:id','show','post','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3f8537,_0x59ea9a){var _0x1ce136=function(_0x4a38fe){while(--_0x4a38fe){_0x3f8537['push'](_0x3f8537['shift']());}};_0x1ce136(++_0x59ea9a);}(_0xacca,0x14a));var _0xaacc=function(_0x5dd0a8,_0x19b31f){_0x5dd0a8=_0x5dd0a8-0x0;var _0x246d30=_0xacca[_0x5dd0a8];return _0x246d30;};'use strict';var multer=require('multer');var util=require(_0xaacc('0x0'));var path=require(_0xaacc('0x1'));var timeout=require(_0xaacc('0x2'));var express=require('express');var router=express[_0xaacc('0x3')]();var fs_extra=require(_0xaacc('0x4'));var auth=require(_0xaacc('0x5'));var interaction=require(_0xaacc('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xaacc('0x7')]('/',auth[_0xaacc('0x8')](),controller[_0xaacc('0x9')]);router[_0xaacc('0x7')](_0xaacc('0xa'),auth[_0xaacc('0x8')](),controller['describe']);router[_0xaacc('0x7')](_0xaacc('0xb'),auth['isAuthenticated'](),controller[_0xaacc('0xc')]);router[_0xaacc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xaacc('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xaacc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xaacc('0xf')]);module[_0xaacc('0x10')]=router;
\ No newline at end of file
+var _0x7fd3=['/:id','post','create','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe'];(function(_0x1e13c1,_0x35f447){var _0x592ea4=function(_0x428b78){while(--_0x428b78){_0x1e13c1['push'](_0x1e13c1['shift']());}};_0x592ea4(++_0x35f447);}(_0x7fd3,0xd1));var _0x37fd=function(_0x39ad1d,_0x11d975){_0x39ad1d=_0x39ad1d-0x0;var _0x1f040c=_0x7fd3[_0x39ad1d];return _0x1f040c;};'use strict';var multer=require(_0x37fd('0x0'));var util=require(_0x37fd('0x1'));var path=require(_0x37fd('0x2'));var timeout=require('connect-timeout');var express=require(_0x37fd('0x3'));var router=express[_0x37fd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x37fd('0x5'));var interaction=require(_0x37fd('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x37fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x37fd('0x8')]);router[_0x37fd('0x7')](_0x37fd('0x9'),auth[_0x37fd('0xa')](),controller[_0x37fd('0xb')]);router[_0x37fd('0x7')](_0x37fd('0xc'),auth[_0x37fd('0xa')](),controller['show']);router[_0x37fd('0xd')]('/',auth[_0x37fd('0xa')](),controller[_0x37fd('0xe')]);router[_0x37fd('0xf')](_0x37fd('0xc'),auth[_0x37fd('0xa')](),controller['update']);router['delete'](_0x37fd('0xc'),auth['isAuthenticated'](),controller[_0x37fd('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index d7aaabf..d8a27cb 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 _0xd045=['INTEGER','sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xd045,0xf7));var _0x5d04=function(_0x20ba4b,_0xf578c0){_0x20ba4b=_0x20ba4b-0x0;var _0x1857f0=_0xd045[_0x20ba4b];return _0x1857f0;};'use strict';var Sequelize=require(_0x5d04('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d04('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5d04('0x2')](_0x5d04('0x3'),_0x5d04('0x4')),'defaultValue':_0x5d04('0x3')},'selector':{'type':Sequelize[_0x5d04('0x1')]},'timeout':{'type':Sequelize[_0x5d04('0x5')]}};
\ No newline at end of file
+var _0x3282=['STRING','mouseOver','timeout','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3282,0x8c));var _0x2328=function(_0xf23ae0,_0x13041f){_0xf23ae0=_0xf23ae0-0x0;var _0x441c81=_0x3282[_0xf23ae0];return _0x441c81;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2328('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2328('0x1'),_0x2328('0x2')),'defaultValue':_0x2328('0x1')},'selector':{'type':Sequelize[_0x2328('0x0')]},'timeout':{'type':Sequelize[_0x2328('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d6a19bc..0e7ebe6 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 _0xc627=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','include','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc627,0x14a));var _0x7c62=function(_0x3e7540,_0x318c3b){_0x3e7540=_0x3e7540-0x0;var _0x482a87=_0xc627[_0x3e7540];return _0x482a87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c62('0x0'));var zipdir=require(_0x7c62('0x1'));var jsonpatch=require(_0x7c62('0x2'));var rp=require('request-promise');var moment=require(_0x7c62('0x3'));var BPromise=require(_0x7c62('0x4'));var Mustache=require(_0x7c62('0x5'));var util=require(_0x7c62('0x6'));var path=require(_0x7c62('0x7'));var sox=require(_0x7c62('0x8'));var csv=require(_0x7c62('0x9'));var ejs=require(_0x7c62('0xa'));var fs=require('fs');var fs_extra=require(_0x7c62('0xb'));var _=require(_0x7c62('0xc'));var squel=require(_0x7c62('0xd'));var crypto=require(_0x7c62('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c62('0x9'));var querystring=require(_0x7c62('0xf'));var Papa=require(_0x7c62('0x10'));var Redis=require(_0x7c62('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c62('0x12'));var logger=require('../../config/logger')(_0x7c62('0x13'));var utils=require(_0x7c62('0x14'));var config=require(_0x7c62('0x15'));var licenseUtil=require(_0x7c62('0x16'));var db=require(_0x7c62('0x17'))['db'];function respondWithStatusCode(_0x115166,_0x42ea47){_0x42ea47=_0x42ea47||0xcc;return function(_0x293706){if(_0x293706){return _0x115166[_0x7c62('0x18')](_0x42ea47);}return _0x115166[_0x7c62('0x19')](_0x42ea47)[_0x7c62('0x1a')]();};}function respondWithResult(_0xe9af8b,_0x35b36d){_0x35b36d=_0x35b36d||0xc8;return function(_0x34228b){if(_0x34228b){return _0xe9af8b[_0x7c62('0x19')](_0x35b36d)['json'](_0x34228b);}};}function respondWithFilteredResult(_0x1a721e,_0x4c71c5){return function(_0x386420){if(_0x386420){var _0x53b7a4=typeof _0x4c71c5[_0x7c62('0x1b')]===_0x7c62('0x1c')&&typeof _0x4c71c5[_0x7c62('0x1d')]===_0x7c62('0x1c');var _0x2a3fd1=_0x386420['count'];var _0x5a0443=_0x53b7a4?0x0:_0x4c71c5[_0x7c62('0x1b')];var _0x4841b8=_0x53b7a4?_0x386420[_0x7c62('0x1e')]:_0x4c71c5[_0x7c62('0x1b')]+_0x4c71c5[_0x7c62('0x1d')];var _0x430ff7;if(_0x4841b8>=_0x2a3fd1){_0x4841b8=_0x2a3fd1;_0x430ff7=0xc8;}else{_0x430ff7=0xce;}_0x1a721e[_0x7c62('0x19')](_0x430ff7);return _0x1a721e[_0x7c62('0x1f')]('Content-Range',_0x5a0443+'-'+_0x4841b8+'/'+_0x2a3fd1)['json'](_0x386420);}return null;};}function patchUpdates(_0x2ee729){return function(_0x232f28){try{jsonpatch[_0x7c62('0x20')](_0x232f28,_0x2ee729,!![]);}catch(_0x57b6fd){return BPromise[_0x7c62('0x21')](_0x57b6fd);}return _0x232f28[_0x7c62('0x22')]();};}function saveUpdates(_0x46bf7b,_0x43c0fb){return function(_0xd49d53){if(_0xd49d53){return _0xd49d53[_0x7c62('0x23')](_0x46bf7b)[_0x7c62('0x24')](function(_0x56d90b){return _0x56d90b;});}return null;};}function removeEntity(_0x4439cb,_0x2b86e0){return function(_0x37d960){if(_0x37d960){return _0x37d960[_0x7c62('0x25')]()[_0x7c62('0x24')](function(){_0x4439cb[_0x7c62('0x19')](0xcc)[_0x7c62('0x1a')]();});}};}function handleEntityNotFound(_0x3221f3,_0x35fc0a){return function(_0x332413){if(!_0x332413){_0x3221f3[_0x7c62('0x18')](0x194);}return _0x332413;};}function handleError(_0x413b2f,_0x45c051){_0x45c051=_0x45c051||0x1f4;return function(_0x1b4921){logger[_0x7c62('0x26')](_0x1b4921[_0x7c62('0x27')]);if(_0x1b4921[_0x7c62('0x28')]){delete _0x1b4921[_0x7c62('0x28')];}_0x413b2f[_0x7c62('0x19')](_0x45c051)['send'](_0x1b4921);};}exports[_0x7c62('0x29')]=function(_0x460bc4,_0x2abb7f){var _0xabd504={'raw':!![],'where':{'id':_0x460bc4[_0x7c62('0x2a')]['id']}},_0x3a753b={};_0x3a753b[_0x7c62('0x2b')]=_[_0x7c62('0x2c')](db['ChatProactiveAction'][_0x7c62('0x2d')]);_0x3a753b['query']=_[_0x7c62('0x2c')](_0x460bc4[_0x7c62('0x2e')]);_0x3a753b[_0x7c62('0x2f')]=_[_0x7c62('0x30')](_0x3a753b['model'],_0x3a753b[_0x7c62('0x2e')]);_0xabd504[_0x7c62('0x31')]=_[_0x7c62('0x30')](_0x3a753b['model'],qs['fields'](_0x460bc4[_0x7c62('0x2e')]['fields']));_0xabd504[_0x7c62('0x31')]=_0xabd504['attributes']['length']?_0xabd504[_0x7c62('0x31')]:_0x3a753b['model'];if(_0x460bc4['query']['includeAll']){_0xabd504[_0x7c62('0x32')]=[{'all':!![]}];}_0xabd504=_[_0x7c62('0x33')]({},_0xabd504,_0x460bc4[_0x7c62('0x34')]);return db[_0x7c62('0x35')][_0x7c62('0x36')](_0xabd504)[_0x7c62('0x24')](handleEntityNotFound(_0x2abb7f,null))[_0x7c62('0x24')](respondWithResult(_0x2abb7f,null))[_0x7c62('0x37')](handleError(_0x2abb7f,null));};exports[_0x7c62('0x38')]=function(_0xe1463e,_0x2729d8){return db[_0x7c62('0x35')][_0x7c62('0x38')](_0xe1463e[_0x7c62('0x39')],{})[_0x7c62('0x24')](respondWithResult(_0x2729d8,0xc9))[_0x7c62('0x37')](handleError(_0x2729d8,null));};exports[_0x7c62('0x23')]=function(_0x1133c2,_0x4bb63d){if(_0x1133c2[_0x7c62('0x39')]['id']){delete _0x1133c2[_0x7c62('0x39')]['id'];}return db[_0x7c62('0x35')][_0x7c62('0x36')]({'where':{'id':_0x1133c2['params']['id']}})[_0x7c62('0x24')](handleEntityNotFound(_0x4bb63d,null))[_0x7c62('0x24')](saveUpdates(_0x1133c2['body'],null))[_0x7c62('0x24')](respondWithResult(_0x4bb63d,null))[_0x7c62('0x37')](handleError(_0x4bb63d,null));};exports[_0x7c62('0x25')]=function(_0x1938ba,_0x400e2b){return db[_0x7c62('0x35')]['find']({'where':{'id':_0x1938ba['params']['id']}})[_0x7c62('0x24')](handleEntityNotFound(_0x400e2b,null))['then'](removeEntity(_0x400e2b,null))[_0x7c62('0x37')](handleError(_0x400e2b,null));};
\ No newline at end of file
+var _0xdb94=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','intersection','attributes','fields','include','merge','options','create','body','find','params','destroy','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x176913,_0x49691e){var _0x4a9400=function(_0xa294e1){while(--_0xa294e1){_0x176913['push'](_0x176913['shift']());}};_0x4a9400(++_0x49691e);}(_0xdb94,0xe5));var _0x4db9=function(_0x3ffdb2,_0x136414){_0x3ffdb2=_0x3ffdb2-0x0;var _0x403734=_0xdb94[_0x3ffdb2];return _0x403734;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={'raw':!![],'where':{'id':_0x384df5['params']['id']}},_0x373a7d={};_0x373a7d[_0x4db9('0x2d')]=_['keys'](db[_0x4db9('0x2e')][_0x4db9('0x2f')]);_0x373a7d[_0x4db9('0x30')]=_[_0x4db9('0x31')](_0x384df5[_0x4db9('0x30')]);_0x373a7d['filters']=_[_0x4db9('0x32')](_0x373a7d[_0x4db9('0x2d')],_0x373a7d[_0x4db9('0x30')]);_0x1d0dc2[_0x4db9('0x33')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x34')](_0x384df5[_0x4db9('0x30')]['fields']));_0x1d0dc2['attributes']=_0x1d0dc2[_0x4db9('0x33')]['length']?_0x1d0dc2['attributes']:_0x373a7d[_0x4db9('0x2d')];if(_0x384df5[_0x4db9('0x30')]['includeAll']){_0x1d0dc2[_0x4db9('0x35')]=[{'all':!![]}];}_0x1d0dc2=_[_0x4db9('0x36')]({},_0x1d0dc2,_0x384df5[_0x4db9('0x37')]);return db[_0x4db9('0x2e')]['find'](_0x1d0dc2)[_0x4db9('0x27')](handleEntityNotFound(_0x3c3fcf,null))['then'](respondWithResult(_0x3c3fcf,null))['catch'](handleError(_0x3c3fcf,null));};exports['create']=function(_0x2bc7df,_0x281e15){return db['ChatProactiveAction'][_0x4db9('0x38')](_0x2bc7df[_0x4db9('0x39')],{})['then'](respondWithResult(_0x281e15,0xc9))['catch'](handleError(_0x281e15,null));};exports['update']=function(_0x2c28fa,_0x52613e){if(_0x2c28fa[_0x4db9('0x39')]['id']){delete _0x2c28fa['body']['id'];}return db[_0x4db9('0x2e')][_0x4db9('0x3a')]({'where':{'id':_0x2c28fa[_0x4db9('0x3b')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x52613e,null))[_0x4db9('0x27')](saveUpdates(_0x2c28fa['body'],null))[_0x4db9('0x27')](respondWithResult(_0x52613e,null))['catch'](handleError(_0x52613e,null));};exports[_0x4db9('0x3c')]=function(_0x1608ae,_0x15929e){return db[_0x4db9('0x2e')][_0x4db9('0x3a')]({'where':{'id':_0x1608ae[_0x4db9('0x3b')]['id']}})['then'](handleEntityNotFound(_0x15929e,null))[_0x4db9('0x27')](removeEntity(_0x15929e,null))[_0x4db9('0x3d')](handleError(_0x15929e,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index de412a7..7826d1c 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 _0x375a=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0x197683,_0x343b43){var _0x494d23=function(_0x352dcf){while(--_0x352dcf){_0x197683['push'](_0x197683['shift']());}};_0x494d23(++_0x343b43);}(_0x375a,0x7e));var _0xa375=function(_0x461457,_0x1cb437){_0x461457=_0x461457-0x0;var _0x4a726f=_0x375a[_0x461457];return _0x4a726f;};'use strict';var _=require(_0xa375('0x0'));var util=require('util');var logger=require(_0xa375('0x1'))(_0xa375('0x2'));var moment=require(_0xa375('0x3'));var BPromise=require(_0xa375('0x4'));var rp=require(_0xa375('0x5'));var fs=require('fs');var path=require(_0xa375('0x6'));var rimraf=require(_0xa375('0x7'));var config=require(_0xa375('0x8'));var attributes=require(_0xa375('0x9'));module[_0xa375('0xa')]=function(_0x1cd314,_0x3b33a8){return _0x1cd314[_0xa375('0xb')]('ChatProactiveAction',attributes,{'tableName':_0xa375('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe25=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x3baa06,_0x515949){var _0x532961=function(_0x549732){while(--_0x549732){_0x3baa06['push'](_0x3baa06['shift']());}};_0x532961(++_0x515949);}(_0xbe25,0x177));var _0x5be2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xbe25[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x5be2('0x0'));var util=require(_0x5be2('0x1'));var logger=require(_0x5be2('0x2'))(_0x5be2('0x3'));var moment=require(_0x5be2('0x4'));var BPromise=require(_0x5be2('0x5'));var rp=require(_0x5be2('0x6'));var fs=require('fs');var path=require(_0x5be2('0x7'));var rimraf=require(_0x5be2('0x8'));var config=require(_0x5be2('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0x5be2('0xa')]=function(_0x194892,_0x5e612d){return _0x194892[_0x5be2('0xb')](_0x5be2('0xc'),attributes,{'tableName':_0x5be2('0xd'),'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 75804ab..174c9d1 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 _0x2952=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x5af436,_0x158fc6){var _0x14f2f4=function(_0x304657){while(--_0x304657){_0x5af436['push'](_0x5af436['shift']());}};_0x14f2f4(++_0x158fc6);}(_0x2952,0xc4));var _0x2295=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x2952[_0x45783c];return _0x1161da;};'use strict';var _=require('lodash');var util=require(_0x2295('0x0'));var moment=require(_0x2295('0x1'));var BPromise=require(_0x2295('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2295('0x3'));var db=require(_0x2295('0x4'))['db'];var utils=require(_0x2295('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2295('0x6'));var jayson=require(_0x2295('0x7'));var client=jayson[_0x2295('0x8')][_0x2295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x520e11,_0x4542ed,_0x1d77b2){return new BPromise(function(_0x1e2b6e,_0x3899ad){return client['request'](_0x520e11,_0x1d77b2)[_0x2295('0xa')](function(_0x5bd564){logger[_0x2295('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4542ed,_0x2295('0xc'));logger[_0x2295('0xd')](_0x2295('0xe'),_0x4542ed,_0x2295('0xc'),JSON[_0x2295('0xf')](_0x5bd564));if(_0x5bd564[_0x2295('0x10')]){if(_0x5bd564['error'][_0x2295('0x11')]===0x1f4){logger[_0x2295('0x10')](_0x2295('0x12'),_0x4542ed,_0x5bd564[_0x2295('0x10')]['message']);return _0x3899ad(_0x5bd564[_0x2295('0x10')][_0x2295('0x13')]);}logger[_0x2295('0x10')](_0x2295('0x12'),_0x4542ed,_0x5bd564['error']['message']);return _0x1e2b6e(_0x5bd564[_0x2295('0x10')]['message']);}else{logger[_0x2295('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4542ed,'request\x20sent');_0x1e2b6e(_0x5bd564[_0x2295('0x14')][_0x2295('0x13')]);}})[_0x2295('0x15')](function(_0xa2c96){logger[_0x2295('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x4542ed,_0xa2c96);_0x3899ad(_0xa2c96);});});}
\ No newline at end of file
+var _0x3bee=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x4d247d,_0x1706f8){var _0x55a1a7=function(_0x3f8e06){while(--_0x3f8e06){_0x4d247d['push'](_0x4d247d['shift']());}};_0x55a1a7(++_0x1706f8);}(_0x3bee,0x75));var _0xe3be=function(_0x360045,_0x3bc31f){_0x360045=_0x360045-0x0;var _0x47aa86=_0x3bee[_0x360045];return _0x47aa86;};'use strict';var _=require(_0xe3be('0x0'));var util=require(_0xe3be('0x1'));var moment=require(_0xe3be('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3be('0x3'));var fs=require('fs');var Redis=require(_0xe3be('0x4'));var db=require(_0xe3be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3be('0x6'))('rpc');var config=require(_0xe3be('0x7'));var jayson=require(_0xe3be('0x8'));var client=jayson[_0xe3be('0x9')][_0xe3be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2666,_0x130525,_0x17f6ef){return new BPromise(function(_0x58ed46,_0x585603){return client[_0xe3be('0xb')](_0x1b2666,_0x17f6ef)[_0xe3be('0xc')](function(_0x3768af){logger[_0xe3be('0xd')](_0xe3be('0xe'),_0x130525,_0xe3be('0xf'));logger[_0xe3be('0x10')](_0xe3be('0x11'),_0x130525,'request\x20sent',JSON['stringify'](_0x3768af));if(_0x3768af[_0xe3be('0x12')]){if(_0x3768af[_0xe3be('0x12')]['code']===0x1f4){logger[_0xe3be('0x12')](_0xe3be('0xe'),_0x130525,_0x3768af['error'][_0xe3be('0x13')]);return _0x585603(_0x3768af[_0xe3be('0x12')][_0xe3be('0x13')]);}logger[_0xe3be('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x130525,_0x3768af[_0xe3be('0x12')][_0xe3be('0x13')]);return _0x58ed46(_0x3768af['error'][_0xe3be('0x13')]);}else{logger['info'](_0xe3be('0xe'),_0x130525,_0xe3be('0xf'));_0x58ed46(_0x3768af[_0xe3be('0x14')][_0xe3be('0x13')]);}})[_0xe3be('0x15')](function(_0x583148){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x130525,_0x583148);_0x585603(_0x583148);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index caffdaa..ca9cdef 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 _0x7217=['Router','fs-extra','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3b8c09,_0x16d046){var _0x40c768=function(_0x240e2e){while(--_0x240e2e){_0x3b8c09['push'](_0x3b8c09['shift']());}};_0x40c768(++_0x16d046);}(_0x7217,0x19e));var _0x7721=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x7217[_0x373dee];return _0x46798f;};'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')](_0x7721('0x9'),auth[_0x7721('0xa')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0xa')](),controller[_0x7721('0xd')]);router[_0x7721('0xe')](_0x7721('0x9'),auth[_0x7721('0xa')](),controller[_0x7721('0xf')]);router[_0x7721('0x10')](_0x7721('0x9'),auth['isAuthenticated'](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
+var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2d042,_0x2892f1){_0x2d042=_0x2d042-0x0;var _0x2f59e3=_0x8d0e[_0x2d042];return _0x2f59e3;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);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 4608d19..b6a92a9 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 _0x5226=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x53f0bd,_0x119829){var _0x26825e=function(_0xfb2fac){while(--_0xfb2fac){_0x53f0bd['push'](_0x53f0bd['shift']());}};_0x26825e(++_0x119829);}(_0x5226,0xee));var _0x6522=function(_0x444da8,_0x21eaee){_0x444da8=_0x444da8-0x0;var _0x56e7b3=_0x5226[_0x444da8];return _0x56e7b3;};'use strict';var Sequelize=require('sequelize');module[_0x6522('0x0')]={'name':{'type':Sequelize[_0x6522('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6522('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6522('0x3')](_0x6522('0x4'),_0x6522('0x5'),_0x6522('0x6'))}};
\ No newline at end of file
+var _0x40bc=['rrmemory','sequelize','exports','STRING','name','INTEGER'];(function(_0x9a2978,_0x3b3ea4){var _0x5c74f5=function(_0xd5ce7d){while(--_0xd5ce7d){_0x9a2978['push'](_0x9a2978['shift']());}};_0x5c74f5(++_0x3b3ea4);}(_0x40bc,0x1d5));var _0xc40b=function(_0x1d8db1,_0x4900e3){_0x1d8db1=_0x1d8db1-0x0;var _0x52ef56=_0x40bc[_0x1d8db1];return _0x52ef56;};'use strict';var Sequelize=require(_0xc40b('0x0'));module[_0xc40b('0x1')]={'name':{'type':Sequelize[_0xc40b('0x2')],'unique':_0xc40b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc40b('0x2')]},'timeout':{'type':Sequelize[_0xc40b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc40b('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 7f45094..2d66784 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 _0x7440=['options','rows','show','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','update','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','union','compact','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x141d58,_0x4a9027){var _0x592ea1=function(_0x4e3b32){while(--_0x4e3b32){_0x141d58['push'](_0x141d58['shift']());}};_0x592ea1(++_0x4a9027);}(_0x7440,0x177));var _0x0744=function(_0x40804e,_0x2552ae){_0x40804e=_0x40804e-0x0;var _0x172825=_0x7440[_0x40804e];return _0x172825;};'use strict';var emlformat=require(_0x0744('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0744('0x1'));var jsonpatch=require(_0x0744('0x2'));var rp=require(_0x0744('0x3'));var moment=require(_0x0744('0x4'));var BPromise=require(_0x0744('0x5'));var Mustache=require('mustache');var util=require(_0x0744('0x6'));var path=require(_0x0744('0x7'));var sox=require('sox');var csv=require(_0x0744('0x8'));var ejs=require(_0x0744('0x9'));var fs=require('fs');var fs_extra=require(_0x0744('0xa'));var _=require(_0x0744('0xb'));var squel=require(_0x0744('0xc'));var crypto=require(_0x0744('0xd'));var jsforce=require(_0x0744('0xe'));var deskjs=require(_0x0744('0xf'));var toCsv=require(_0x0744('0x8'));var querystring=require('querystring');var Papa=require(_0x0744('0x10'));var Redis=require('ioredis');var authService=require(_0x0744('0x11'));var qs=require(_0x0744('0x12'));var as=require(_0x0744('0x13'));var hardwareService=require(_0x0744('0x14'));var logger=require(_0x0744('0x15'))(_0x0744('0x16'));var utils=require(_0x0744('0x17'));var config=require(_0x0744('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0744('0x19'))['db'];config[_0x0744('0x1a')]=_[_0x0744('0x1b')](config[_0x0744('0x1a')],{'host':_0x0744('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0744('0x1a')]));require(_0x0744('0x1d'))[_0x0744('0x1e')](socket);var jayson=require(_0x0744('0x1f'));var client=jayson[_0x0744('0x20')][_0x0744('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3f4c7c,_0x3b7fde,_0xe8a10,_0x501d19){return new BPromise(function(_0x4e173e,_0x291d5c){var _0x6aa393=_0x501d19||client;return _0x6aa393[_0x0744('0x22')](_0x3f4c7c,_0xe8a10)[_0x0744('0x23')](function(_0x2a27c7){logger[_0x0744('0x24')](_0x0744('0x25'),_0x3b7fde,_0x0744('0x26'));logger[_0x0744('0x27')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3b7fde,_0x0744('0x26'),JSON[_0x0744('0x28')](_0x2a27c7));if(_0x2a27c7['error']){if(_0x2a27c7[_0x0744('0x29')][_0x0744('0x2a')]===0x1f4){logger['error'](_0x0744('0x25'),_0x3b7fde,_0x2a27c7[_0x0744('0x29')][_0x0744('0x2b')]);return _0x291d5c(_0x2a27c7[_0x0744('0x29')][_0x0744('0x2b')]);}logger['error'](_0x0744('0x25'),_0x3b7fde,_0x2a27c7[_0x0744('0x29')]['message']);return _0x4e173e(_0x2a27c7[_0x0744('0x29')]['message']);}else{logger['info'](_0x0744('0x25'),_0x3b7fde,_0x0744('0x26'));_0x4e173e(_0x2a27c7[_0x0744('0x2c')][_0x0744('0x2b')]);}})[_0x0744('0x2d')](function(_0x289348){logger[_0x0744('0x29')](_0x0744('0x25'),_0x3b7fde,_0x289348);_0x291d5c(_0x289348);});});}function respondWithStatusCode(_0x160b8e,_0x269336){_0x269336=_0x269336||0xcc;return function(_0x5ee6d3){if(_0x5ee6d3){return _0x160b8e['sendStatus'](_0x269336);}return _0x160b8e[_0x0744('0x2e')](_0x269336)[_0x0744('0x2f')]();};}function respondWithResult(_0x18208a,_0x2f7e61){_0x2f7e61=_0x2f7e61||0xc8;return function(_0x253872){if(_0x253872){return _0x18208a['status'](_0x2f7e61)['json'](_0x253872);}};}function respondWithFilteredResult(_0x177f21,_0x3e5088){return function(_0x2165c2){if(_0x2165c2){var _0x1063b8=typeof _0x3e5088[_0x0744('0x30')]===_0x0744('0x31')&&typeof _0x3e5088['limit']===_0x0744('0x31');var _0x9f5caa=_0x2165c2['count'];var _0x217f44=_0x1063b8?0x0:_0x3e5088['offset'];var _0x4e8403=_0x1063b8?_0x2165c2[_0x0744('0x32')]:_0x3e5088['offset']+_0x3e5088[_0x0744('0x33')];var _0x3bf146;if(_0x4e8403>=_0x9f5caa){_0x4e8403=_0x9f5caa;_0x3bf146=0xc8;}else{_0x3bf146=0xce;}_0x177f21['status'](_0x3bf146);return _0x177f21['set'](_0x0744('0x34'),_0x217f44+'-'+_0x4e8403+'/'+_0x9f5caa)[_0x0744('0x35')](_0x2165c2);}return null;};}function patchUpdates(_0x1c32e4){return function(_0x52bff3){try{jsonpatch[_0x0744('0x36')](_0x52bff3,_0x1c32e4,!![]);}catch(_0x549670){return BPromise[_0x0744('0x37')](_0x549670);}return _0x52bff3[_0x0744('0x38')]();};}function saveUpdates(_0x552240,_0x40471f){return function(_0x12415f){if(_0x12415f){return _0x12415f['update'](_0x552240)[_0x0744('0x23')](function(_0x3bb082){return _0x3bb082;});}return null;};}function removeEntity(_0x163798,_0x40e525){return function(_0x27e591){if(_0x27e591){return _0x27e591[_0x0744('0x39')]()['then'](function(){var _0x450a6b=_0x27e591[_0x0744('0x3a')]({'plain':!![]});var _0x594ff7=_0x0744('0x3b');return db[_0x0744('0x3c')][_0x0744('0x39')]({'where':{'type':_0x594ff7,'resourceId':_0x450a6b['id']}})['then'](function(){return _0x27e591;});})[_0x0744('0x23')](function(){_0x163798[_0x0744('0x2e')](0xcc)[_0x0744('0x2f')]();});}};}function handleEntityNotFound(_0x3517c3,_0x31cf24){return function(_0x3c3eac){if(!_0x3c3eac){_0x3517c3['sendStatus'](0x194);}return _0x3c3eac;};}function handleError(_0x2de492,_0xe437b5){_0xe437b5=_0xe437b5||0x1f4;return function(_0x1941de){logger[_0x0744('0x29')](_0x1941de['stack']);if(_0x1941de['name']){delete _0x1941de[_0x0744('0x3d')];}_0x2de492[_0x0744('0x2e')](_0xe437b5)['send'](_0x1941de);};}exports[_0x0744('0x3e')]=function(_0x3c19bf,_0x50bbbf){var _0x543ec2={},_0x59b193={},_0x30fb9d={'count':0x0,'rows':[]};var _0xd37e7d=_[_0x0744('0x3f')](db[_0x0744('0x40')][_0x0744('0x41')],function(_0xc18abb){return{'name':_0xc18abb['fieldName'],'type':_0xc18abb[_0x0744('0x42')]['key']};});_0x59b193['model']=_[_0x0744('0x3f')](_0xd37e7d,_0x0744('0x3d'));_0x59b193['query']=_[_0x0744('0x43')](_0x3c19bf['query']);_0x59b193[_0x0744('0x44')]=_[_0x0744('0x45')](_0x59b193[_0x0744('0x46')],_0x59b193['query']);_0x543ec2[_0x0744('0x47')]=_[_0x0744('0x45')](_0x59b193[_0x0744('0x46')],qs[_0x0744('0x48')](_0x3c19bf[_0x0744('0x49')][_0x0744('0x48')]));_0x543ec2['attributes']=_0x543ec2[_0x0744('0x47')][_0x0744('0x4a')]?_0x543ec2[_0x0744('0x47')]:_0x59b193[_0x0744('0x46')];if(!_0x3c19bf[_0x0744('0x49')][_0x0744('0x4b')](_0x0744('0x4c'))){_0x543ec2[_0x0744('0x33')]=qs[_0x0744('0x33')](_0x3c19bf[_0x0744('0x49')][_0x0744('0x33')]);_0x543ec2[_0x0744('0x30')]=qs['offset'](_0x3c19bf[_0x0744('0x49')][_0x0744('0x30')]);}_0x543ec2[_0x0744('0x4d')]=qs[_0x0744('0x4e')](_0x3c19bf[_0x0744('0x49')][_0x0744('0x4e')]);_0x543ec2[_0x0744('0x4f')]=qs[_0x0744('0x44')](_[_0x0744('0x50')](_0x3c19bf[_0x0744('0x49')],_0x59b193['filters']),_0xd37e7d);if(_0x3c19bf[_0x0744('0x49')][_0x0744('0x51')]){_0x543ec2[_0x0744('0x4f')]=_[_0x0744('0x52')](_0x543ec2[_0x0744('0x4f')],{'$or':_[_0x0744('0x3f')](_0xd37e7d,function(_0x4c583d){if(_0x4c583d[_0x0744('0x42')]!==_0x0744('0x53')){var _0x1684a4={};_0x1684a4[_0x4c583d[_0x0744('0x3d')]]={'$like':'%'+_0x3c19bf[_0x0744('0x49')][_0x0744('0x51')]+'%'};return _0x1684a4;}})});}_0x543ec2=_[_0x0744('0x52')]({},_0x543ec2,_0x3c19bf[_0x0744('0x54')]);var _0x798f9f={'where':_0x543ec2[_0x0744('0x4f')]};return db[_0x0744('0x40')][_0x0744('0x32')](_0x798f9f)['then'](function(_0x3f33c3){_0x30fb9d[_0x0744('0x32')]=_0x3f33c3;if(_0x3c19bf[_0x0744('0x49')]['includeAll']){_0x543ec2['include']=[{'all':!![]}];}return db[_0x0744('0x40')]['findAll'](_0x543ec2);})[_0x0744('0x23')](function(_0x2d2112){_0x30fb9d[_0x0744('0x55')]=_0x2d2112;return _0x30fb9d;})['then'](respondWithFilteredResult(_0x50bbbf,_0x543ec2))[_0x0744('0x2d')](handleError(_0x50bbbf,null));};exports[_0x0744('0x56')]=function(_0x3dfa2e,_0x52f03b){var _0x454f4e={'raw':!![],'where':{'id':_0x3dfa2e['params']['id']}},_0x5eb71a={};_0x5eb71a[_0x0744('0x46')]=_[_0x0744('0x43')](db[_0x0744('0x40')][_0x0744('0x41')]);_0x5eb71a[_0x0744('0x49')]=_['keys'](_0x3dfa2e[_0x0744('0x49')]);_0x5eb71a['filters']=_[_0x0744('0x45')](_0x5eb71a[_0x0744('0x46')],_0x5eb71a[_0x0744('0x49')]);_0x454f4e[_0x0744('0x47')]=_[_0x0744('0x45')](_0x5eb71a[_0x0744('0x46')],qs[_0x0744('0x48')](_0x3dfa2e[_0x0744('0x49')][_0x0744('0x48')]));_0x454f4e[_0x0744('0x47')]=_0x454f4e[_0x0744('0x47')][_0x0744('0x4a')]?_0x454f4e[_0x0744('0x47')]:_0x5eb71a[_0x0744('0x46')];if(_0x3dfa2e[_0x0744('0x49')][_0x0744('0x57')]){_0x454f4e[_0x0744('0x58')]=[{'all':!![]}];}_0x454f4e=_[_0x0744('0x52')]({},_0x454f4e,_0x3dfa2e[_0x0744('0x54')]);return db[_0x0744('0x40')][_0x0744('0x59')](_0x454f4e)[_0x0744('0x23')](handleEntityNotFound(_0x52f03b,null))[_0x0744('0x23')](respondWithResult(_0x52f03b,null))[_0x0744('0x2d')](handleError(_0x52f03b,null));};exports[_0x0744('0x5a')]=function(_0x36103c,_0x227bcc){return db['ChatQueue'][_0x0744('0x5a')](_0x36103c[_0x0744('0x5b')],{})[_0x0744('0x23')](function(_0x37217c){var _0x584847=_0x36103c[_0x0744('0x5c')][_0x0744('0x3a')]({'plain':!![]});if(!_0x584847)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x584847[_0x0744('0x5d')]===_0x0744('0x5c')){var _0x238225=_0x37217c[_0x0744('0x3a')]({'plain':!![]});var _0x199cb9=_0x0744('0x3b');return db[_0x0744('0x5e')][_0x0744('0x59')]({'where':{'name':_0x199cb9,'userProfileId':_0x584847[_0x0744('0x5f')]},'raw':!![]})['then'](function(_0x19a29e){if(_0x19a29e&&_0x19a29e[_0x0744('0x60')]===0x0){return db['UserProfileResource'][_0x0744('0x5a')]({'name':_0x238225['name'],'resourceId':_0x238225['id'],'type':_0x19a29e[_0x0744('0x3d')],'sectionId':_0x19a29e['id']},{})['then'](function(){return _0x37217c;});}else{return _0x37217c;}})['catch'](function(_0x34d1f0){logger[_0x0744('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34d1f0);throw _0x34d1f0;});}return _0x37217c;})[_0x0744('0x23')](respondWithResult(_0x227bcc,0xc9))[_0x0744('0x2d')](handleError(_0x227bcc,null));};exports[_0x0744('0x61')]=function(_0x4fb220,_0x4885d6){if(_0x4fb220[_0x0744('0x5b')]['id']){delete _0x4fb220[_0x0744('0x5b')]['id'];}return db[_0x0744('0x40')][_0x0744('0x59')]({'where':{'id':_0x4fb220[_0x0744('0x62')]['id']}})[_0x0744('0x23')](handleEntityNotFound(_0x4885d6,null))[_0x0744('0x23')](saveUpdates(_0x4fb220[_0x0744('0x5b')],null))[_0x0744('0x23')](respondWithResult(_0x4885d6,null))[_0x0744('0x2d')](handleError(_0x4885d6,null));};exports[_0x0744('0x39')]=function(_0x337958,_0x2af206){return db['ChatQueue'][_0x0744('0x59')]({'where':{'id':_0x337958[_0x0744('0x62')]['id']}})[_0x0744('0x23')](handleEntityNotFound(_0x2af206,null))[_0x0744('0x23')](removeEntity(_0x2af206,null))[_0x0744('0x2d')](handleError(_0x2af206,null));};exports[_0x0744('0x63')]=function(_0x26a898,_0x2a2ffb){return db[_0x0744('0x40')][_0x0744('0x63')]()['then'](respondWithResult(_0x2a2ffb,null))['catch'](handleError(_0x2a2ffb,null));};exports[_0x0744('0x64')]=function(_0x320fc7,_0x13d30c,_0x30d45c){var _0x3afdef={'raw':!![],'where':{}},_0x2cb443={},_0x4d069e;return db[_0x0744('0x40')][_0x0744('0x65')]({'where':{'id':_0x320fc7[_0x0744('0x62')]['id']}})['then'](handleEntityNotFound(_0x13d30c,null))['then'](function(_0xd9c168){if(_0xd9c168){_0x4d069e=_0xd9c168[_0x0744('0x3a')]({'plain':!![]});_0x2cb443[_0x0744('0x46')]=_['keys'](db[_0x0744('0x66')][_0x0744('0x41')]);_0x2cb443[_0x0744('0x49')]=_['keys'](_0x320fc7['query']);_0x2cb443['filters']=_['intersection'](_0x2cb443['model'],_0x2cb443[_0x0744('0x49')]);_0x3afdef[_0x0744('0x47')]=_[_0x0744('0x45')](_0x2cb443['model'],qs[_0x0744('0x48')](_0x320fc7[_0x0744('0x49')][_0x0744('0x48')]));_0x3afdef[_0x0744('0x47')]=_0x3afdef[_0x0744('0x47')][_0x0744('0x4a')]?_0x3afdef[_0x0744('0x47')]:_0x2cb443[_0x0744('0x46')];if(!_0x320fc7['query'][_0x0744('0x4b')]('nolimit')){_0x3afdef['limit']=qs[_0x0744('0x33')](_0x320fc7[_0x0744('0x49')][_0x0744('0x33')]);_0x3afdef['offset']=qs[_0x0744('0x30')](_0x320fc7[_0x0744('0x49')][_0x0744('0x30')]);}_0x3afdef[_0x0744('0x4d')]=qs['sort'](_0x320fc7['query'][_0x0744('0x4e')]);_0x3afdef[_0x0744('0x4f')]=qs[_0x0744('0x44')](_[_0x0744('0x50')](_0x320fc7[_0x0744('0x49')],_0x2cb443[_0x0744('0x44')]));_0x3afdef[_0x0744('0x4f')][_0x0744('0x67')]=_0xd9c168['id'];if(_0x320fc7[_0x0744('0x49')]['filter']){_0x3afdef['where']=_[_0x0744('0x52')](_0x3afdef['where'],{'$or':_[_0x0744('0x3f')](_0x3afdef[_0x0744('0x47')],function(_0x13776b){var _0x3b3d0f={};_0x3b3d0f[_0x13776b]={'$like':'%'+_0x320fc7[_0x0744('0x49')][_0x0744('0x51')]+'%'};return _0x3b3d0f;})});}_0x3afdef=_[_0x0744('0x52')]({},_0x3afdef,_0x320fc7[_0x0744('0x54')]);return db[_0x0744('0x66')][_0x0744('0x68')](_0x3afdef);}})[_0x0744('0x23')](function(_0x3ec90e){if(_0x3ec90e){return db[_0x0744('0x69')][_0x0744('0x6a')]({'where':{'id':_[_0x0744('0x3f')](_0x3ec90e,_0x0744('0x6b')),'role':_0x0744('0x6c')},'attributes':['id',_0x0744('0x3d'),_0x0744('0x6d'),_0x0744('0x6e'),_0x0744('0x6f')]});}})[_0x0744('0x23')](function(_0x1f4f24){if(_0x1f4f24){return{'count':_0x1f4f24[_0x0744('0x32')],'rows':_[_0x0744('0x3f')](_0x1f4f24[_0x0744('0x55')],function(_0x1e6c19){return{'membername':_0x1e6c19[_0x0744('0x3d')],'UserId':_0x1e6c19['id'],'queue_name':_0x4d069e['name'],'ChatQueueId':_0x4d069e['id'],'interface':util[_0x0744('0x70')]('%s/%s',_0x0744('0x71'),_0x1e6c19['name']),'penalty':0x0,'paused':_0x1e6c19[_0x0744('0x6d')],'createdAt':_0x1e6c19[_0x0744('0x6f')],'updatedAt':_0x1e6c19[_0x0744('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x13d30c,_0x3afdef))['catch'](handleError(_0x13d30c,null));};exports[_0x0744('0x72')]=function(_0xd1426b,_0xf4907,_0x202665){var _0x5821a9={};var _0x2f1e83={};var _0x945053;var _0x45f284;return db['ChatQueue']['findOne']({'where':{'id':_0xd1426b[_0x0744('0x62')]['id']}})[_0x0744('0x23')](handleEntityNotFound(_0xf4907,null))[_0x0744('0x23')](function(_0x139729){if(_0x139729){_0x945053=_0x139729;_0x2f1e83[_0x0744('0x46')]=_[_0x0744('0x43')](db[_0x0744('0x73')][_0x0744('0x41')]);_0x2f1e83['query']=_[_0x0744('0x43')](_0xd1426b[_0x0744('0x49')]);_0x2f1e83[_0x0744('0x44')]=_[_0x0744('0x45')](_0x2f1e83[_0x0744('0x46')],_0x2f1e83[_0x0744('0x49')]);_0x5821a9['attributes']=_[_0x0744('0x45')](_0x2f1e83[_0x0744('0x46')],qs[_0x0744('0x48')](_0xd1426b[_0x0744('0x49')][_0x0744('0x48')]));_0x5821a9[_0x0744('0x47')]=_0x5821a9[_0x0744('0x47')][_0x0744('0x4a')]?_0x5821a9[_0x0744('0x47')]:_0x2f1e83[_0x0744('0x46')];_0x5821a9[_0x0744('0x4d')]=qs[_0x0744('0x4e')](_0xd1426b['query'][_0x0744('0x4e')]);_0x5821a9['where']=qs['filters'](_[_0x0744('0x50')](_0xd1426b['query'],_0x2f1e83['filters']));if(_0xd1426b[_0x0744('0x49')][_0x0744('0x51')]){_0x5821a9[_0x0744('0x4f')]=_['merge'](_0x5821a9['where'],{'$or':_[_0x0744('0x3f')](_0x5821a9[_0x0744('0x47')],function(_0x3a2a1d){var _0x59cb8e={};_0x59cb8e[_0x3a2a1d]={'$like':'%'+_0xd1426b['query'][_0x0744('0x51')]+'%'};return _0x59cb8e;})});}_0x5821a9=_[_0x0744('0x52')]({},_0x5821a9,_0xd1426b[_0x0744('0x54')]);return _0x945053[_0x0744('0x72')](_0x5821a9);}})[_0x0744('0x23')](function(_0x5af6c9){if(_0x5af6c9){_0x45f284=_0x5af6c9['length'];if(!_0xd1426b[_0x0744('0x49')][_0x0744('0x4b')]('nolimit')){_0x5821a9[_0x0744('0x33')]=qs[_0x0744('0x33')](_0xd1426b['query'][_0x0744('0x33')]);_0x5821a9[_0x0744('0x30')]=qs['offset'](_0xd1426b[_0x0744('0x49')][_0x0744('0x30')]);}return _0x945053[_0x0744('0x72')](_0x5821a9);}})[_0x0744('0x23')](function(_0x86fb53){if(_0x86fb53){return _0x86fb53?{'count':_0x45f284,'rows':_0x86fb53}:null;}})[_0x0744('0x23')](respondWithResult(_0xf4907,null))[_0x0744('0x2d')](handleError(_0xf4907,null));};exports[_0x0744('0x74')]=function(_0x359334,_0x51d015,_0xa9a135){var _0x39e449=_0x359334[_0x0744('0x5b')][_0x0744('0x75')];return db['Team'][_0x0744('0x68')]({'where':{'id':_0x39e449},'attributes':['id'],'include':[{'model':db[_0x0744('0x69')],'as':_0x0744('0x76'),'attributes':['id',_0x0744('0x3d'),_0x0744('0x77'),'voicePause',_0x0744('0x78')],'raw':!![]}]})[_0x0744('0x23')](function(_0x5c473c){if(_0x5c473c){var _0x43d470=_['flatMap'](_0x5c473c,function(_0x50bbac){var _0x5b0af9=_0x50bbac['get']({'plain':!![]});return _0x5b0af9[_0x0744('0x76')];});return db[_0x0744('0x40')][_0x0744('0x59')]({'where':{'id':_0x359334[_0x0744('0x62')]['id']}})[_0x0744('0x23')](function(_0x6e8fab){return db[_0x0744('0x79')][_0x0744('0x7a')](function(_0x115000){return _0x6e8fab['addTeams'](_0x39e449,{'transaction':_0x115000})['then'](function(){return BPromise[_0x0744('0x7b')](_0x43d470,function(_0x3745fb){return db[_0x0744('0x66')][_0x0744('0x7c')]({'where':{'UserId':_0x3745fb['id'],'ChatQueueId':_0x359334['params']['id']},'transaction':_0x115000});});})['then'](function(){_0x43d470['forEach'](function(_0x1b1106){socket[_0x0744('0x7d')](_0x0744('0x7e'),{'UserId':_0x1b1106['id'],'ChatQueueId':_0x6e8fab['id']});});});});});}})[_0x0744('0x23')](respondWithStatusCode(_0x51d015,null))[_0x0744('0x2d')](handleError(_0x51d015,null));};exports[_0x0744('0x7f')]=function(_0x815ab9,_0x23d5d1,_0x4010b0){return db[_0x0744('0x73')]['findAll']({'where':{'id':_0x815ab9[_0x0744('0x49')][_0x0744('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0744('0x23')](handleEntityNotFound(_0x23d5d1,null))[_0x0744('0x23')](function(_0x3643fb){var _0x186a28=_[_0x0744('0x3f')](_0x3643fb,'id');var _0x3361f5=[];var _0x181088=[];var _0x41d771=squel[_0x0744('0x80')]();_0x41d771[_0x0744('0x81')](_0x0744('0x82'))[_0x0744('0x83')](_0x0744('0x84'),'tq')[_0x0744('0x85')](_0x0744('0x86'),'ut',_0x0744('0x87'))[_0x0744('0x4f')](_0x0744('0x88'),_0x815ab9[_0x0744('0x62')]['id']);for(var _0x331c5b=0x0;_0x331c5b<_0x3643fb[_0x0744('0x4a')];_0x331c5b+=0x1){let _0x38d619=_0x3643fb[_0x331c5b];for(var _0xb84a95=0x0;_0xb84a95<_0x38d619['Agents'][_0x0744('0x4a')];_0xb84a95+=0x1){let _0x458749=_0x38d619[_0x0744('0x76')][_0xb84a95];var _0x22fad3=_0x41d771[_0x0744('0x89')]();_0x22fad3[_0x0744('0x4f')](_0x0744('0x8a'),_0x458749['id']);_0x181088[_0x0744('0x8b')](db['sequelize'][_0x0744('0x49')](_0x22fad3['toString'](),{'type':db[_0x0744('0x79')][_0x0744('0x8c')]['SELECT']})['then'](function(_0x4a5b04){if(_0x4a5b04[_0x0744('0x4a')]===0x1){return _0x458749['id'];}else{var _0x1f9705=_[_0x0744('0x8d')](_[_0x0744('0x3f')](_0x4a5b04,_0x0744('0x8e')),function(_0x151d81){return _[_0x0744('0x8f')](_0x186a28,_0x151d81);});if(_0x1f9705){return _0x458749['id'];}}}));}}return BPromise['all'](_0x181088)[_0x0744('0x23')](function(_0x46ea6e){_0x3361f5=_(_0x3361f5)[_0x0744('0x90')](_0x46ea6e)[_0x0744('0x91')]()['value']();return db[_0x0744('0x40')][_0x0744('0x59')]({'where':{'id':_0x815ab9[_0x0744('0x62')]['id']}})[_0x0744('0x23')](function(_0x4514af){return db[_0x0744('0x79')][_0x0744('0x7a')](function(_0x19d644){return _0x4514af[_0x0744('0x7f')](_0x815ab9[_0x0744('0x49')][_0x0744('0x75')],{'transaction':_0x19d644})['then'](function(){if(!_['isEmpty'](_0x3361f5)){return _0x4514af[_0x0744('0x92')](_0x3361f5,{'transaction':_0x19d644});}})[_0x0744('0x23')](function(){_0x3361f5[_0x0744('0x93')](function(_0x51fe36){socket[_0x0744('0x7d')](_0x0744('0x94'),{'UserId':_0x51fe36,'ChatQueueId':_0x4514af['id']});});});});});});})[_0x0744('0x23')](respondWithStatusCode(_0x23d5d1,null))[_0x0744('0x2d')](handleError(_0x23d5d1,null));};exports[_0x0744('0x95')]=function(_0x224abe,_0x1db075,_0x37ddff){return db[_0x0744('0x40')][_0x0744('0x59')]({'where':{'id':_0x224abe['params']['id']}})[_0x0744('0x23')](handleEntityNotFound(_0x1db075,null))[_0x0744('0x23')](function(_0x531e80){if(_0x531e80){return _0x531e80[_0x0744('0x95')](_0x224abe[_0x0744('0x5b')][_0x0744('0x75')],_[_0x0744('0x96')](_0x224abe[_0x0744('0x5b')],['ids','id'])||{})[_0x0744('0x97')](function(_0x65ecb1){for(var _0x334537=0x0;_0x334537<_0x224abe[_0x0744('0x5b')][_0x0744('0x75')][_0x0744('0x4a')];_0x334537+=0x1){socket[_0x0744('0x7d')](_0x0744('0x7e'),{'UserId':Number(_0x224abe[_0x0744('0x5b')][_0x0744('0x75')][_0x334537]),'ChatQueueId':Number(_0x224abe[_0x0744('0x62')]['id'])});}return _0x65ecb1;});}})[_0x0744('0x23')](respondWithResult(_0x1db075,null))['catch'](handleError(_0x1db075,null));};exports['removeAgents']=function(_0x148b2a,_0x3f1a04,_0x363a93){return db[_0x0744('0x40')][_0x0744('0x59')]({'where':{'id':_0x148b2a[_0x0744('0x62')]['id']}})['then'](handleEntityNotFound(_0x3f1a04,null))[_0x0744('0x23')](function(_0xcbfe21){if(_0xcbfe21){return _0xcbfe21[_0x0744('0x92')](_0x148b2a[_0x0744('0x49')][_0x0744('0x75')])['then'](function(){if(_[_0x0744('0x98')](_0x148b2a[_0x0744('0x49')][_0x0744('0x75')])){for(var _0x433662=0x0;_0x433662<_0x148b2a[_0x0744('0x49')][_0x0744('0x75')][_0x0744('0x4a')];_0x433662+=0x1){socket[_0x0744('0x7d')](_0x0744('0x94'),{'UserId':Number(_0x148b2a['query'][_0x0744('0x75')][_0x433662]),'ChatQueueId':Number(_0x148b2a['params']['id'])});}}else{socket['emit'](_0x0744('0x94'),{'UserId':Number(_0x148b2a['query']['ids']),'ChatQueueId':Number(_0x148b2a['params']['id'])});}});}})[_0x0744('0x23')](respondWithStatusCode(_0x3f1a04,null))[_0x0744('0x2d')](handleError(_0x3f1a04,null));};exports['getAgents']=function(_0x2f8f87,_0x274419,_0x1d0903){var _0x302714={};var _0x567e2c={};var _0x296d5d;var _0x3f9046;return db[_0x0744('0x40')][_0x0744('0x65')]({'where':{'id':_0x2f8f87['params']['id']}})['then'](handleEntityNotFound(_0x274419,null))[_0x0744('0x23')](function(_0x188d9b){if(_0x188d9b){_0x296d5d=_0x188d9b;_0x567e2c[_0x0744('0x46')]=_[_0x0744('0x43')](db[_0x0744('0x69')][_0x0744('0x41')]);_0x567e2c[_0x0744('0x49')]=_[_0x0744('0x43')](_0x2f8f87[_0x0744('0x49')]);_0x567e2c[_0x0744('0x44')]=_[_0x0744('0x45')](_0x567e2c[_0x0744('0x46')],_0x567e2c[_0x0744('0x49')]);_0x302714[_0x0744('0x47')]=_[_0x0744('0x45')](_0x567e2c[_0x0744('0x46')],qs['fields'](_0x2f8f87[_0x0744('0x49')]['fields']));_0x302714['attributes']=_0x302714[_0x0744('0x47')]['length']?_0x302714[_0x0744('0x47')]:_0x567e2c['model'];_0x302714[_0x0744('0x4d')]=qs['sort'](_0x2f8f87[_0x0744('0x49')]['sort']);_0x302714[_0x0744('0x4f')]=qs[_0x0744('0x44')](_['pick'](_0x2f8f87[_0x0744('0x49')],_0x567e2c[_0x0744('0x44')]));if(_0x2f8f87['query'][_0x0744('0x51')]){_0x302714[_0x0744('0x4f')]=_[_0x0744('0x52')](_0x302714[_0x0744('0x4f')],{'$or':_[_0x0744('0x3f')](_0x302714[_0x0744('0x47')],function(_0x23fe73){var _0x45c0cb={};_0x45c0cb[_0x23fe73]={'$like':'%'+_0x2f8f87[_0x0744('0x49')]['filter']+'%'};return _0x45c0cb;})});}_0x302714=_['merge']({},_0x302714,_0x2f8f87['options']);return _0x296d5d['getAgents'](_0x302714);}})[_0x0744('0x23')](function(_0x12b925){if(_0x12b925){_0x3f9046=_0x12b925[_0x0744('0x4a')];if(!_0x2f8f87[_0x0744('0x49')]['hasOwnProperty'](_0x0744('0x4c'))){_0x302714[_0x0744('0x33')]=qs[_0x0744('0x33')](_0x2f8f87[_0x0744('0x49')][_0x0744('0x33')]);_0x302714[_0x0744('0x30')]=qs[_0x0744('0x30')](_0x2f8f87[_0x0744('0x49')][_0x0744('0x30')]);}return _0x296d5d['getAgents'](_0x302714);}})[_0x0744('0x23')](function(_0x362e29){if(_0x362e29){return _0x362e29?{'count':_0x3f9046,'rows':_0x362e29}:null;}})[_0x0744('0x23')](respondWithResult(_0x274419,null))[_0x0744('0x2d')](handleError(_0x274419,null));};
\ No newline at end of file
+var _0xc405=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','index','map','ChatQueue','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','filter','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','chatPause','getTeams','Team','User','Agents','online','voicePause','interface','addTeams','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','transaction','isEmpty','forEach','userChatQueue:remove','addAgents','omit','ids','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5917f5,_0x6e3002){var _0xd2eb81=function(_0x3876ab){while(--_0x3876ab){_0x5917f5['push'](_0x5917f5['shift']());}};_0xd2eb81(++_0x6e3002);}(_0xc405,0x8c));var _0x5c40=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0xc405[_0x24697b];return _0x585b99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c40('0x0'));var jsonpatch=require(_0x5c40('0x1'));var rp=require(_0x5c40('0x2'));var moment=require(_0x5c40('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5c40('0x4'));var util=require(_0x5c40('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5c40('0x6'));var ejs=require(_0x5c40('0x7'));var fs=require('fs');var fs_extra=require(_0x5c40('0x8'));var _=require(_0x5c40('0x9'));var squel=require(_0x5c40('0xa'));var crypto=require(_0x5c40('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5c40('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5c40('0xd'));var Papa=require(_0x5c40('0xe'));var Redis=require(_0x5c40('0xf'));var authService=require(_0x5c40('0x10'));var qs=require(_0x5c40('0x11'));var as=require(_0x5c40('0x12'));var hardwareService=require(_0x5c40('0x13'));var logger=require(_0x5c40('0x14'))(_0x5c40('0x15'));var utils=require(_0x5c40('0x16'));var config=require(_0x5c40('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c40('0x18'))['db'];config['redis']=_['defaults'](config[_0x5c40('0x19')],{'host':_0x5c40('0x1a'),'port':0x18eb});var socket=require(_0x5c40('0x1b'))(new Redis(config[_0x5c40('0x19')]));require(_0x5c40('0x1c'))[_0x5c40('0x1d')](socket);var jayson=require(_0x5c40('0x1e'));var client=jayson[_0x5c40('0x1f')][_0x5c40('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1a838a,_0x2bf97b,_0x254c78,_0x5f3081){return new BPromise(function(_0x5f376f,_0x2d326e){var _0x55d591=_0x5f3081||client;return _0x55d591[_0x5c40('0x21')](_0x1a838a,_0x254c78)[_0x5c40('0x22')](function(_0x16c410){logger['info'](_0x5c40('0x23'),_0x2bf97b,_0x5c40('0x24'));logger['debug'](_0x5c40('0x25'),_0x2bf97b,_0x5c40('0x24'),JSON[_0x5c40('0x26')](_0x16c410));if(_0x16c410[_0x5c40('0x27')]){if(_0x16c410[_0x5c40('0x27')][_0x5c40('0x28')]===0x1f4){logger['error'](_0x5c40('0x23'),_0x2bf97b,_0x16c410[_0x5c40('0x27')]['message']);return _0x2d326e(_0x16c410[_0x5c40('0x27')][_0x5c40('0x29')]);}logger['error'](_0x5c40('0x23'),_0x2bf97b,_0x16c410[_0x5c40('0x27')][_0x5c40('0x29')]);return _0x5f376f(_0x16c410[_0x5c40('0x27')][_0x5c40('0x29')]);}else{logger[_0x5c40('0x2a')](_0x5c40('0x23'),_0x2bf97b,_0x5c40('0x24'));_0x5f376f(_0x16c410[_0x5c40('0x2b')][_0x5c40('0x29')]);}})[_0x5c40('0x2c')](function(_0x3afe39){logger[_0x5c40('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2bf97b,_0x3afe39);_0x2d326e(_0x3afe39);});});}function respondWithStatusCode(_0x10d64a,_0x366eeb){_0x366eeb=_0x366eeb||0xcc;return function(_0x33e6e5){if(_0x33e6e5){return _0x10d64a[_0x5c40('0x2d')](_0x366eeb);}return _0x10d64a[_0x5c40('0x2e')](_0x366eeb)[_0x5c40('0x2f')]();};}function respondWithResult(_0x4c8141,_0x2ff032){_0x2ff032=_0x2ff032||0xc8;return function(_0x200434){if(_0x200434){return _0x4c8141[_0x5c40('0x2e')](_0x2ff032)[_0x5c40('0x30')](_0x200434);}};}function respondWithFilteredResult(_0x30b5fd,_0x83cb86){return function(_0x5a7e83){if(_0x5a7e83){var _0x1d2b66=typeof _0x83cb86[_0x5c40('0x31')]==='undefined'&&typeof _0x83cb86[_0x5c40('0x32')]===_0x5c40('0x33');var _0x192fe2=_0x5a7e83[_0x5c40('0x34')];var _0x5a38c3=_0x1d2b66?0x0:_0x83cb86[_0x5c40('0x31')];var _0x5c50b1=_0x1d2b66?_0x5a7e83[_0x5c40('0x34')]:_0x83cb86['offset']+_0x83cb86[_0x5c40('0x32')];var _0xae1476;if(_0x5c50b1>=_0x192fe2){_0x5c50b1=_0x192fe2;_0xae1476=0xc8;}else{_0xae1476=0xce;}_0x30b5fd[_0x5c40('0x2e')](_0xae1476);return _0x30b5fd['set'](_0x5c40('0x35'),_0x5a38c3+'-'+_0x5c50b1+'/'+_0x192fe2)[_0x5c40('0x30')](_0x5a7e83);}return null;};}function patchUpdates(_0x12d214){return function(_0x3c7dcc){try{jsonpatch[_0x5c40('0x36')](_0x3c7dcc,_0x12d214,!![]);}catch(_0x4d1743){return BPromise[_0x5c40('0x37')](_0x4d1743);}return _0x3c7dcc[_0x5c40('0x38')]();};}function saveUpdates(_0x53eea3,_0x4ac451){return function(_0x1a5ef5){if(_0x1a5ef5){return _0x1a5ef5[_0x5c40('0x39')](_0x53eea3)[_0x5c40('0x22')](function(_0x3aed97){return _0x3aed97;});}return null;};}function removeEntity(_0x1d6672,_0x124eeb){return function(_0x3f2ae5){if(_0x3f2ae5){return _0x3f2ae5[_0x5c40('0x3a')]()[_0x5c40('0x22')](function(){var _0x40b4a0=_0x3f2ae5['get']({'plain':!![]});var _0x27c970=_0x5c40('0x3b');return db[_0x5c40('0x3c')]['destroy']({'where':{'type':_0x27c970,'resourceId':_0x40b4a0['id']}})[_0x5c40('0x22')](function(){return _0x3f2ae5;});})[_0x5c40('0x22')](function(){_0x1d6672[_0x5c40('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b5056,_0x159257){return function(_0x2ab9c0){if(!_0x2ab9c0){_0x7b5056[_0x5c40('0x2d')](0x194);}return _0x2ab9c0;};}function handleError(_0x2e8c20,_0x5771db){_0x5771db=_0x5771db||0x1f4;return function(_0x203e8e){logger[_0x5c40('0x27')](_0x203e8e[_0x5c40('0x3d')]);if(_0x203e8e['name']){delete _0x203e8e['name'];}_0x2e8c20['status'](_0x5771db)['send'](_0x203e8e);};}exports[_0x5c40('0x3e')]=function(_0x2b1103,_0x19eefa){var _0x54e7a5={},_0x449893={},_0x291d3a={'count':0x0,'rows':[]};var _0x2bfbe3=_[_0x5c40('0x3f')](db[_0x5c40('0x40')][_0x5c40('0x41')],function(_0x13ac1a){return{'name':_0x13ac1a[_0x5c40('0x42')],'type':_0x13ac1a[_0x5c40('0x43')][_0x5c40('0x44')]};});_0x449893['model']=_['map'](_0x2bfbe3,_0x5c40('0x45'));_0x449893['query']=_[_0x5c40('0x46')](_0x2b1103[_0x5c40('0x47')]);_0x449893[_0x5c40('0x48')]=_[_0x5c40('0x49')](_0x449893[_0x5c40('0x4a')],_0x449893[_0x5c40('0x47')]);_0x54e7a5[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x449893['model'],qs['fields'](_0x2b1103['query']['fields']));_0x54e7a5[_0x5c40('0x4b')]=_0x54e7a5[_0x5c40('0x4b')][_0x5c40('0x4c')]?_0x54e7a5[_0x5c40('0x4b')]:_0x449893['model'];if(!_0x2b1103[_0x5c40('0x47')][_0x5c40('0x4d')](_0x5c40('0x4e'))){_0x54e7a5[_0x5c40('0x32')]=qs[_0x5c40('0x32')](_0x2b1103[_0x5c40('0x47')]['limit']);_0x54e7a5[_0x5c40('0x31')]=qs[_0x5c40('0x31')](_0x2b1103[_0x5c40('0x47')][_0x5c40('0x31')]);}_0x54e7a5[_0x5c40('0x4f')]=qs[_0x5c40('0x50')](_0x2b1103['query'][_0x5c40('0x50')]);_0x54e7a5[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_[_0x5c40('0x52')](_0x2b1103[_0x5c40('0x47')],_0x449893[_0x5c40('0x48')]),_0x2bfbe3);if(_0x2b1103[_0x5c40('0x47')]['filter']){_0x54e7a5['where']=_[_0x5c40('0x53')](_0x54e7a5[_0x5c40('0x51')],{'$or':_[_0x5c40('0x3f')](_0x2bfbe3,function(_0x20afee){if(_0x20afee[_0x5c40('0x43')]!==_0x5c40('0x54')){var _0x4adab4={};_0x4adab4[_0x20afee[_0x5c40('0x45')]]={'$like':'%'+_0x2b1103[_0x5c40('0x47')]['filter']+'%'};return _0x4adab4;}})});}_0x54e7a5=_[_0x5c40('0x53')]({},_0x54e7a5,_0x2b1103[_0x5c40('0x55')]);var _0x35e4d4={'where':_0x54e7a5[_0x5c40('0x51')]};return db['ChatQueue']['count'](_0x35e4d4)[_0x5c40('0x22')](function(_0x27c178){_0x291d3a[_0x5c40('0x34')]=_0x27c178;if(_0x2b1103['query'][_0x5c40('0x56')]){_0x54e7a5['include']=[{'all':!![]}];}return db['ChatQueue'][_0x5c40('0x57')](_0x54e7a5);})[_0x5c40('0x22')](function(_0x3f722e){_0x291d3a[_0x5c40('0x58')]=_0x3f722e;return _0x291d3a;})['then'](respondWithFilteredResult(_0x19eefa,_0x54e7a5))[_0x5c40('0x2c')](handleError(_0x19eefa,null));};exports[_0x5c40('0x59')]=function(_0x5f5dce,_0x4aaeee){var _0x20328a={'raw':!![],'where':{'id':_0x5f5dce[_0x5c40('0x5a')]['id']}},_0x4d6951={};_0x4d6951[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x40')][_0x5c40('0x41')]);_0x4d6951[_0x5c40('0x47')]=_[_0x5c40('0x46')](_0x5f5dce[_0x5c40('0x47')]);_0x4d6951[_0x5c40('0x48')]=_['intersection'](_0x4d6951['model'],_0x4d6951[_0x5c40('0x47')]);_0x20328a[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x4d6951[_0x5c40('0x4a')],qs['fields'](_0x5f5dce[_0x5c40('0x47')][_0x5c40('0x5b')]));_0x20328a[_0x5c40('0x4b')]=_0x20328a['attributes']['length']?_0x20328a['attributes']:_0x4d6951[_0x5c40('0x4a')];if(_0x5f5dce[_0x5c40('0x47')][_0x5c40('0x56')]){_0x20328a[_0x5c40('0x5c')]=[{'all':!![]}];}_0x20328a=_[_0x5c40('0x53')]({},_0x20328a,_0x5f5dce[_0x5c40('0x55')]);return db['ChatQueue'][_0x5c40('0x5d')](_0x20328a)[_0x5c40('0x22')](handleEntityNotFound(_0x4aaeee,null))[_0x5c40('0x22')](respondWithResult(_0x4aaeee,null))[_0x5c40('0x2c')](handleError(_0x4aaeee,null));};exports[_0x5c40('0x5e')]=function(_0x22e37b,_0x8d0391){return db[_0x5c40('0x40')][_0x5c40('0x5e')](_0x22e37b['body'],{})[_0x5c40('0x22')](function(_0x314286){var _0x2bd78b=_0x22e37b[_0x5c40('0x5f')][_0x5c40('0x60')]({'plain':!![]});if(!_0x2bd78b)throw new Error(_0x5c40('0x61'));if(_0x2bd78b[_0x5c40('0x62')]===_0x5c40('0x5f')){var _0x2e4d6e=_0x314286[_0x5c40('0x60')]({'plain':!![]});var _0x4b3f9a=_0x5c40('0x3b');return db[_0x5c40('0x63')][_0x5c40('0x5d')]({'where':{'name':_0x4b3f9a,'userProfileId':_0x2bd78b[_0x5c40('0x64')]},'raw':!![]})[_0x5c40('0x22')](function(_0x8b148f){if(_0x8b148f&&_0x8b148f[_0x5c40('0x65')]===0x0){return db['UserProfileResource'][_0x5c40('0x5e')]({'name':_0x2e4d6e[_0x5c40('0x45')],'resourceId':_0x2e4d6e['id'],'type':_0x8b148f[_0x5c40('0x45')],'sectionId':_0x8b148f['id']},{})[_0x5c40('0x22')](function(){return _0x314286;});}else{return _0x314286;}})[_0x5c40('0x2c')](function(_0x1ff1a1){logger['error'](_0x5c40('0x66'),_0x1ff1a1);throw _0x1ff1a1;});}return _0x314286;})['then'](respondWithResult(_0x8d0391,0xc9))['catch'](handleError(_0x8d0391,null));};exports[_0x5c40('0x39')]=function(_0x14c8f7,_0x293392){if(_0x14c8f7[_0x5c40('0x67')]['id']){delete _0x14c8f7[_0x5c40('0x67')]['id'];}return db[_0x5c40('0x40')][_0x5c40('0x5d')]({'where':{'id':_0x14c8f7[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x293392,null))['then'](saveUpdates(_0x14c8f7['body'],null))[_0x5c40('0x22')](respondWithResult(_0x293392,null))[_0x5c40('0x2c')](handleError(_0x293392,null));};exports['destroy']=function(_0xb68835,_0x2d1aa1){return db[_0x5c40('0x40')]['find']({'where':{'id':_0xb68835['params']['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x2d1aa1,null))['then'](removeEntity(_0x2d1aa1,null))[_0x5c40('0x2c')](handleError(_0x2d1aa1,null));};exports[_0x5c40('0x68')]=function(_0x2a322a,_0x3cf3cb){return db[_0x5c40('0x40')]['describe']()[_0x5c40('0x22')](respondWithResult(_0x3cf3cb,null))[_0x5c40('0x2c')](handleError(_0x3cf3cb,null));};exports[_0x5c40('0x69')]=function(_0x4c28f2,_0x361956,_0x33e6bb){var _0x34ece2={'raw':!![],'where':{}},_0x3bc207={},_0x5cffa2;return db[_0x5c40('0x40')][_0x5c40('0x6a')]({'where':{'id':_0x4c28f2[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x361956,null))[_0x5c40('0x22')](function(_0x5c6f39){if(_0x5c6f39){_0x5cffa2=_0x5c6f39[_0x5c40('0x60')]({'plain':!![]});_0x3bc207[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x6b')]['rawAttributes']);_0x3bc207[_0x5c40('0x47')]=_[_0x5c40('0x46')](_0x4c28f2[_0x5c40('0x47')]);_0x3bc207[_0x5c40('0x48')]=_[_0x5c40('0x49')](_0x3bc207[_0x5c40('0x4a')],_0x3bc207[_0x5c40('0x47')]);_0x34ece2[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x3bc207[_0x5c40('0x4a')],qs[_0x5c40('0x5b')](_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x5b')]));_0x34ece2[_0x5c40('0x4b')]=_0x34ece2[_0x5c40('0x4b')]['length']?_0x34ece2['attributes']:_0x3bc207[_0x5c40('0x4a')];if(!_0x4c28f2[_0x5c40('0x47')]['hasOwnProperty'](_0x5c40('0x4e'))){_0x34ece2[_0x5c40('0x32')]=qs['limit'](_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x32')]);_0x34ece2[_0x5c40('0x31')]=qs[_0x5c40('0x31')](_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x31')]);}_0x34ece2[_0x5c40('0x4f')]=qs['sort'](_0x4c28f2['query'][_0x5c40('0x50')]);_0x34ece2[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_[_0x5c40('0x52')](_0x4c28f2['query'],_0x3bc207[_0x5c40('0x48')]));_0x34ece2[_0x5c40('0x51')][_0x5c40('0x6c')]=_0x5c6f39['id'];if(_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x6d')]){_0x34ece2[_0x5c40('0x51')]=_[_0x5c40('0x53')](_0x34ece2[_0x5c40('0x51')],{'$or':_['map'](_0x34ece2[_0x5c40('0x4b')],function(_0x8f6d36){var _0x14a154={};_0x14a154[_0x8f6d36]={'$like':'%'+_0x4c28f2[_0x5c40('0x47')][_0x5c40('0x6d')]+'%'};return _0x14a154;})});}_0x34ece2=_[_0x5c40('0x53')]({},_0x34ece2,_0x4c28f2[_0x5c40('0x55')]);return db[_0x5c40('0x6b')][_0x5c40('0x57')](_0x34ece2);}})[_0x5c40('0x22')](function(_0x317e2e){if(_0x317e2e){return db['User'][_0x5c40('0x6e')]({'where':{'id':_[_0x5c40('0x3f')](_0x317e2e,_0x5c40('0x6f')),'role':_0x5c40('0x70')},'attributes':['id',_0x5c40('0x45'),'chatPause',_0x5c40('0x71'),_0x5c40('0x72')]});}})[_0x5c40('0x22')](function(_0x231777){if(_0x231777){return{'count':_0x231777[_0x5c40('0x34')],'rows':_[_0x5c40('0x3f')](_0x231777[_0x5c40('0x58')],function(_0x1e2819){return{'membername':_0x1e2819['name'],'UserId':_0x1e2819['id'],'queue_name':_0x5cffa2[_0x5c40('0x45')],'ChatQueueId':_0x5cffa2['id'],'interface':util['format'](_0x5c40('0x73'),'SIP',_0x1e2819[_0x5c40('0x45')]),'penalty':0x0,'paused':_0x1e2819[_0x5c40('0x74')],'createdAt':_0x1e2819['createdAt'],'updatedAt':_0x1e2819[_0x5c40('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x361956,_0x34ece2))[_0x5c40('0x2c')](handleError(_0x361956,null));};exports[_0x5c40('0x75')]=function(_0x3b7b61,_0x59a888,_0x1e2161){var _0x13e8a3={};var _0x3e02b2={};var _0x2037d9;var _0x5b680b;return db['ChatQueue']['findOne']({'where':{'id':_0x3b7b61[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x59a888,null))['then'](function(_0x22e5ec){if(_0x22e5ec){_0x2037d9=_0x22e5ec;_0x3e02b2[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x76')][_0x5c40('0x41')]);_0x3e02b2['query']=_['keys'](_0x3b7b61[_0x5c40('0x47')]);_0x3e02b2['filters']=_[_0x5c40('0x49')](_0x3e02b2[_0x5c40('0x4a')],_0x3e02b2['query']);_0x13e8a3[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x3e02b2[_0x5c40('0x4a')],qs[_0x5c40('0x5b')](_0x3b7b61[_0x5c40('0x47')][_0x5c40('0x5b')]));_0x13e8a3['attributes']=_0x13e8a3[_0x5c40('0x4b')][_0x5c40('0x4c')]?_0x13e8a3['attributes']:_0x3e02b2[_0x5c40('0x4a')];_0x13e8a3[_0x5c40('0x4f')]=qs[_0x5c40('0x50')](_0x3b7b61[_0x5c40('0x47')][_0x5c40('0x50')]);_0x13e8a3[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_[_0x5c40('0x52')](_0x3b7b61[_0x5c40('0x47')],_0x3e02b2[_0x5c40('0x48')]));if(_0x3b7b61[_0x5c40('0x47')]['filter']){_0x13e8a3['where']=_[_0x5c40('0x53')](_0x13e8a3[_0x5c40('0x51')],{'$or':_[_0x5c40('0x3f')](_0x13e8a3[_0x5c40('0x4b')],function(_0x2cdcf8){var _0x4b77a0={};_0x4b77a0[_0x2cdcf8]={'$like':'%'+_0x3b7b61[_0x5c40('0x47')]['filter']+'%'};return _0x4b77a0;})});}_0x13e8a3=_['merge']({},_0x13e8a3,_0x3b7b61['options']);return _0x2037d9[_0x5c40('0x75')](_0x13e8a3);}})[_0x5c40('0x22')](function(_0x4cfd3c){if(_0x4cfd3c){_0x5b680b=_0x4cfd3c[_0x5c40('0x4c')];if(!_0x3b7b61['query'][_0x5c40('0x4d')](_0x5c40('0x4e'))){_0x13e8a3['limit']=qs[_0x5c40('0x32')](_0x3b7b61[_0x5c40('0x47')]['limit']);_0x13e8a3[_0x5c40('0x31')]=qs['offset'](_0x3b7b61[_0x5c40('0x47')]['offset']);}return _0x2037d9[_0x5c40('0x75')](_0x13e8a3);}})[_0x5c40('0x22')](function(_0x1731bc){if(_0x1731bc){return _0x1731bc?{'count':_0x5b680b,'rows':_0x1731bc}:null;}})[_0x5c40('0x22')](respondWithResult(_0x59a888,null))['catch'](handleError(_0x59a888,null));};exports['addTeams']=function(_0x8b7d44,_0x2c46ec,_0x56a851){var _0x46aa98=_0x8b7d44[_0x5c40('0x67')]['ids'];return db[_0x5c40('0x76')][_0x5c40('0x57')]({'where':{'id':_0x46aa98},'attributes':['id'],'include':[{'model':db[_0x5c40('0x77')],'as':_0x5c40('0x78'),'attributes':['id',_0x5c40('0x45'),_0x5c40('0x79'),_0x5c40('0x7a'),_0x5c40('0x7b')],'raw':!![]}]})[_0x5c40('0x22')](function(_0x3ed577){if(_0x3ed577){var _0x351fed=_['flatMap'](_0x3ed577,function(_0x1be058){var _0x430628=_0x1be058[_0x5c40('0x60')]({'plain':!![]});return _0x430628[_0x5c40('0x78')];});return db[_0x5c40('0x40')][_0x5c40('0x5d')]({'where':{'id':_0x8b7d44[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](function(_0x5ee73a){return db['sequelize']['transaction'](function(_0x75cae3){return _0x5ee73a[_0x5c40('0x7c')](_0x46aa98,{'transaction':_0x75cae3})['then'](function(){return BPromise[_0x5c40('0x7d')](_0x351fed,function(_0x3dec9c){return db[_0x5c40('0x6b')][_0x5c40('0x7e')]({'where':{'UserId':_0x3dec9c['id'],'ChatQueueId':_0x8b7d44['params']['id']},'transaction':_0x75cae3});});})['then'](function(){_0x351fed['forEach'](function(_0x26747d){socket[_0x5c40('0x7f')](_0x5c40('0x80'),{'UserId':_0x26747d['id'],'ChatQueueId':_0x5ee73a['id']});});});});});}})[_0x5c40('0x22')](respondWithStatusCode(_0x2c46ec,null))[_0x5c40('0x2c')](handleError(_0x2c46ec,null));};exports[_0x5c40('0x81')]=function(_0x58b8bd,_0x503146,_0x101776){return db[_0x5c40('0x76')]['findAll']({'where':{'id':_0x58b8bd[_0x5c40('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5c40('0x77')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x503146,null))[_0x5c40('0x22')](function(_0x65252b){var _0x207ffe=_[_0x5c40('0x3f')](_0x65252b,'id');var _0x22c950=[];var _0x500275=[];var _0x56b89f=squel[_0x5c40('0x82')]();_0x56b89f[_0x5c40('0x83')](_0x5c40('0x84'))[_0x5c40('0x85')]('team_has_chat_queues','tq')['join'](_0x5c40('0x86'),'ut',_0x5c40('0x87'))[_0x5c40('0x51')](_0x5c40('0x88'),_0x58b8bd[_0x5c40('0x5a')]['id']);for(var _0x151bc7=0x0;_0x151bc7<_0x65252b[_0x5c40('0x4c')];_0x151bc7+=0x1){let _0x2b5bb1=_0x65252b[_0x151bc7];for(var _0x642bb3=0x0;_0x642bb3<_0x2b5bb1['Agents'][_0x5c40('0x4c')];_0x642bb3+=0x1){let _0x51eaae=_0x2b5bb1['Agents'][_0x642bb3];var _0x2b864c=_0x56b89f['clone']();_0x2b864c[_0x5c40('0x51')](_0x5c40('0x89'),_0x51eaae['id']);_0x500275['push'](db[_0x5c40('0x8a')][_0x5c40('0x47')](_0x2b864c[_0x5c40('0x8b')](),{'type':db[_0x5c40('0x8a')][_0x5c40('0x8c')][_0x5c40('0x8d')]})[_0x5c40('0x22')](function(_0x3c4b8d){if(_0x3c4b8d['length']===0x1){return _0x51eaae['id'];}else{var _0x37d778=_[_0x5c40('0x8e')](_['map'](_0x3c4b8d,'TeamId'),function(_0x1ba464){return _[_0x5c40('0x8f')](_0x207ffe,_0x1ba464);});if(_0x37d778){return _0x51eaae['id'];}}}));}}return BPromise[_0x5c40('0x90')](_0x500275)[_0x5c40('0x22')](function(_0x134891){_0x22c950=_(_0x22c950)[_0x5c40('0x91')](_0x134891)['compact']()['value']();return db[_0x5c40('0x40')]['find']({'where':{'id':_0x58b8bd['params']['id']}})['then'](function(_0x43f195){return db[_0x5c40('0x8a')][_0x5c40('0x92')](function(_0x565b7e){return _0x43f195[_0x5c40('0x81')](_0x58b8bd['query']['ids'],{'transaction':_0x565b7e})[_0x5c40('0x22')](function(){if(!_[_0x5c40('0x93')](_0x22c950)){return _0x43f195['removeAgents'](_0x22c950,{'transaction':_0x565b7e});}})['then'](function(){_0x22c950[_0x5c40('0x94')](function(_0x84825b){socket[_0x5c40('0x7f')](_0x5c40('0x95'),{'UserId':_0x84825b,'ChatQueueId':_0x43f195['id']});});});});});});})[_0x5c40('0x22')](respondWithStatusCode(_0x503146,null))[_0x5c40('0x2c')](handleError(_0x503146,null));};exports[_0x5c40('0x96')]=function(_0x4328be,_0x16831a,_0x27329c){return db['ChatQueue'][_0x5c40('0x5d')]({'where':{'id':_0x4328be['params']['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0x16831a,null))['then'](function(_0x5d2e6a){if(_0x5d2e6a){return _0x5d2e6a[_0x5c40('0x96')](_0x4328be['body']['ids'],_[_0x5c40('0x97')](_0x4328be[_0x5c40('0x67')],[_0x5c40('0x98'),'id'])||{})[_0x5c40('0x99')](function(_0x49ede6){for(var _0x52f205=0x0;_0x52f205<_0x4328be[_0x5c40('0x67')]['ids'][_0x5c40('0x4c')];_0x52f205+=0x1){socket[_0x5c40('0x7f')](_0x5c40('0x80'),{'UserId':Number(_0x4328be[_0x5c40('0x67')][_0x5c40('0x98')][_0x52f205]),'ChatQueueId':Number(_0x4328be[_0x5c40('0x5a')]['id'])});}return _0x49ede6;});}})['then'](respondWithResult(_0x16831a,null))[_0x5c40('0x2c')](handleError(_0x16831a,null));};exports['removeAgents']=function(_0x413cd1,_0x1ab380,_0x34e9b8){return db[_0x5c40('0x40')][_0x5c40('0x5d')]({'where':{'id':_0x413cd1[_0x5c40('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ab380,null))[_0x5c40('0x22')](function(_0x580408){if(_0x580408){return _0x580408[_0x5c40('0x9a')](_0x413cd1[_0x5c40('0x47')]['ids'])['then'](function(){if(_[_0x5c40('0x9b')](_0x413cd1[_0x5c40('0x47')][_0x5c40('0x98')])){for(var _0xa89e28=0x0;_0xa89e28<_0x413cd1[_0x5c40('0x47')]['ids'][_0x5c40('0x4c')];_0xa89e28+=0x1){socket[_0x5c40('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x413cd1[_0x5c40('0x47')][_0x5c40('0x98')][_0xa89e28]),'ChatQueueId':Number(_0x413cd1[_0x5c40('0x5a')]['id'])});}}else{socket[_0x5c40('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x413cd1[_0x5c40('0x47')][_0x5c40('0x98')]),'ChatQueueId':Number(_0x413cd1[_0x5c40('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1ab380,null))[_0x5c40('0x2c')](handleError(_0x1ab380,null));};exports[_0x5c40('0x9c')]=function(_0x55863d,_0xd218b8,_0x32c5d1){var _0x19eab1={};var _0x183b12={};var _0x32a0d9;var _0x73dbd;return db['ChatQueue'][_0x5c40('0x6a')]({'where':{'id':_0x55863d[_0x5c40('0x5a')]['id']}})[_0x5c40('0x22')](handleEntityNotFound(_0xd218b8,null))[_0x5c40('0x22')](function(_0x3433b3){if(_0x3433b3){_0x32a0d9=_0x3433b3;_0x183b12[_0x5c40('0x4a')]=_[_0x5c40('0x46')](db[_0x5c40('0x77')][_0x5c40('0x41')]);_0x183b12[_0x5c40('0x47')]=_['keys'](_0x55863d[_0x5c40('0x47')]);_0x183b12[_0x5c40('0x48')]=_[_0x5c40('0x49')](_0x183b12[_0x5c40('0x4a')],_0x183b12[_0x5c40('0x47')]);_0x19eab1[_0x5c40('0x4b')]=_[_0x5c40('0x49')](_0x183b12[_0x5c40('0x4a')],qs['fields'](_0x55863d['query'][_0x5c40('0x5b')]));_0x19eab1[_0x5c40('0x4b')]=_0x19eab1['attributes'][_0x5c40('0x4c')]?_0x19eab1[_0x5c40('0x4b')]:_0x183b12[_0x5c40('0x4a')];_0x19eab1[_0x5c40('0x4f')]=qs['sort'](_0x55863d['query'][_0x5c40('0x50')]);_0x19eab1[_0x5c40('0x51')]=qs[_0x5c40('0x48')](_['pick'](_0x55863d[_0x5c40('0x47')],_0x183b12[_0x5c40('0x48')]));if(_0x55863d[_0x5c40('0x47')][_0x5c40('0x6d')]){_0x19eab1[_0x5c40('0x51')]=_['merge'](_0x19eab1['where'],{'$or':_[_0x5c40('0x3f')](_0x19eab1[_0x5c40('0x4b')],function(_0x5be81c){var _0x2dd1da={};_0x2dd1da[_0x5be81c]={'$like':'%'+_0x55863d[_0x5c40('0x47')][_0x5c40('0x6d')]+'%'};return _0x2dd1da;})});}_0x19eab1=_[_0x5c40('0x53')]({},_0x19eab1,_0x55863d[_0x5c40('0x55')]);return _0x32a0d9['getAgents'](_0x19eab1);}})[_0x5c40('0x22')](function(_0x112f95){if(_0x112f95){_0x73dbd=_0x112f95[_0x5c40('0x4c')];if(!_0x55863d['query'][_0x5c40('0x4d')](_0x5c40('0x4e'))){_0x19eab1['limit']=qs[_0x5c40('0x32')](_0x55863d[_0x5c40('0x47')]['limit']);_0x19eab1[_0x5c40('0x31')]=qs[_0x5c40('0x31')](_0x55863d[_0x5c40('0x47')][_0x5c40('0x31')]);}return _0x32a0d9['getAgents'](_0x19eab1);}})[_0x5c40('0x22')](function(_0x3b6f4c){if(_0x3b6f4c){return _0x3b6f4c?{'count':_0x73dbd,'rows':_0x3b6f4c}:null;}})['then'](respondWithResult(_0xd218b8,null))[_0x5c40('0x2c')](handleError(_0xd218b8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 7ca298d..87e8fa8 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 _0x3294=['setMaxListeners','update','remove','emit','exports'];(function(_0x459baf,_0x332707){var _0x4a5970=function(_0x28ac61){while(--_0x28ac61){_0x459baf['push'](_0x459baf['shift']());}};_0x4a5970(++_0x332707);}(_0x3294,0x1db));var _0x4329=function(_0x49c681,_0x18923b){_0x49c681=_0x49c681-0x0;var _0x43fa06=_0x3294[_0x49c681];return _0x43fa06;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4329('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4329('0x1'),'afterDestroy':_0x4329('0x2')};function emitEvent(_0x4a0626){return function(_0x3916c0,_0x441cf9,_0x432347){ChatQueueEvents[_0x4329('0x3')](_0x4a0626+':'+_0x3916c0['id'],_0x3916c0);ChatQueueEvents['emit'](_0x4a0626,_0x3916c0);_0x432347(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4329('0x4')]=ChatQueueEvents;
\ No newline at end of file
+var _0x1979=['events','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15b610,_0x3c3671){var _0x383a33=function(_0x2ff486){while(--_0x2ff486){_0x15b610['push'](_0x15b610['shift']());}};_0x383a33(++_0x3c3671);}(_0x1979,0xa2));var _0x9197=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0x1979[_0x197185];return _0x2c8af1;};'use strict';var EventEmitter=require(_0x9197('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x9197('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9197('0x2'),'afterUpdate':_0x9197('0x3'),'afterDestroy':_0x9197('0x4')};function emitEvent(_0x515cdc){return function(_0x57cf2b,_0x1c23e2,_0x355707){ChatQueueEvents[_0x9197('0x5')](_0x515cdc+':'+_0x57cf2b['id'],_0x57cf2b);ChatQueueEvents['emit'](_0x515cdc,_0x57cf2b);_0x355707(null);};}for(var e in events){if(events[_0x9197('0x6')](e)){var event=events[e];ChatQueue[_0x9197('0x7')](e,emitEvent(event));}}module[_0x9197('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index efa829a..ee34366 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 _0x4608=['moment','bluebird','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api'];(function(_0x35f8bb,_0x1edec0){var _0x3a8249=function(_0x17a1ab){while(--_0x17a1ab){_0x35f8bb['push'](_0x35f8bb['shift']());}};_0x3a8249(++_0x1edec0);}(_0x4608,0xc3));var _0x8460=function(_0x4ed298,_0x777ccd){_0x4ed298=_0x4ed298-0x0;var _0x38ccf7=_0x4608[_0x4ed298];return _0x38ccf7;};'use strict';var _=require(_0x8460('0x0'));var util=require('util');var logger=require(_0x8460('0x1'))(_0x8460('0x2'));var moment=require(_0x8460('0x3'));var BPromise=require(_0x8460('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8460('0x5'));var config=require('../../config/environment');var attributes=require(_0x8460('0x6'));module[_0x8460('0x7')]=function(_0x43c4f0,_0x3a24b3){return _0x43c4f0[_0x8460('0x8')](_0x8460('0x9'),attributes,{'tableName':_0x8460('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5110=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x382a50,_0x575e29){var _0x386eff=function(_0x3146b6){while(--_0x3146b6){_0x382a50['push'](_0x382a50['shift']());}};_0x386eff(++_0x575e29);}(_0x5110,0x10a));var _0x0511=function(_0x5d183f,_0x1b65a6){_0x5d183f=_0x5d183f-0x0;var _0x179134=_0x5110[_0x5d183f];return _0x179134;};'use strict';var _=require(_0x0511('0x0'));var util=require(_0x0511('0x1'));var logger=require(_0x0511('0x2'))(_0x0511('0x3'));var moment=require(_0x0511('0x4'));var BPromise=require(_0x0511('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0511('0x6'));var rimraf=require(_0x0511('0x7'));var config=require(_0x0511('0x8'));var attributes=require('./chatQueue.attributes');module[_0x0511('0x9')]=function(_0x5befa8,_0x1a204b){return _0x5befa8[_0x0511('0xa')]('ChatQueue',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 9e70faf..ad7d735 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 _0xd4dc=['GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','stringify','ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch'];(function(_0x2bc3cc,_0x392b48){var _0x11b7b=function(_0x23bd52){while(--_0x23bd52){_0x2bc3cc['push'](_0x2bc3cc['shift']());}};_0x11b7b(++_0x392b48);}(_0xd4dc,0xff));var _0xcd4d=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xd4dc[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xcd4d('0x0'));var util=require('util');var moment=require(_0xcd4d('0x1'));var BPromise=require(_0xcd4d('0x2'));var rs=require(_0xcd4d('0x3'));var fs=require('fs');var Redis=require(_0xcd4d('0x4'));var db=require(_0xcd4d('0x5'))['db'];var utils=require(_0xcd4d('0x6'));var logger=require(_0xcd4d('0x7'))('rpc');var config=require(_0xcd4d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd4d('0x9')]({'port':0x232a});config['redis']=_[_0xcd4d('0xa')](config[_0xcd4d('0xb')],{'host':_0xcd4d('0xc'),'port':0x18eb});var socket=require(_0xcd4d('0xd'))(new Redis(config[_0xcd4d('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1ca579,_0xb0b7d,_0x56f2fd){return new BPromise(function(_0x279607,_0x46e10f){return client[_0xcd4d('0xe')](_0x1ca579,_0x56f2fd)['then'](function(_0x1a8437){logger['info'](_0xcd4d('0xf'),_0xb0b7d,_0xcd4d('0x10'));logger[_0xcd4d('0x11')](_0xcd4d('0x12'),_0xb0b7d,_0xcd4d('0x10'),JSON['stringify'](_0x1a8437));if(_0x1a8437['error']){if(_0x1a8437['error'][_0xcd4d('0x13')]===0x1f4){logger[_0xcd4d('0x14')](_0xcd4d('0xf'),_0xb0b7d,_0x1a8437[_0xcd4d('0x14')][_0xcd4d('0x15')]);return _0x46e10f(_0x1a8437[_0xcd4d('0x14')][_0xcd4d('0x15')]);}logger[_0xcd4d('0x14')](_0xcd4d('0xf'),_0xb0b7d,_0x1a8437[_0xcd4d('0x14')]['message']);return _0x279607(_0x1a8437[_0xcd4d('0x14')][_0xcd4d('0x15')]);}else{logger[_0xcd4d('0x16')](_0xcd4d('0xf'),_0xb0b7d,_0xcd4d('0x10'));_0x279607(_0x1a8437[_0xcd4d('0x17')][_0xcd4d('0x15')]);}})[_0xcd4d('0x18')](function(_0x138d00){logger[_0xcd4d('0x14')](_0xcd4d('0xf'),_0xb0b7d,_0x138d00);_0x46e10f(_0x138d00);});});}exports[_0xcd4d('0x19')]=function(_0x346bd3){var _0x4b0eae=this;return new Promise(function(_0x6a6da1,_0x1d7cdf){return db[_0xcd4d('0x1a')][_0xcd4d('0x1b')]({'raw':_0x346bd3[_0xcd4d('0x1c')]?_0x346bd3[_0xcd4d('0x1c')][_0xcd4d('0x1d')]===undefined?!![]:![]:!![],'where':_0x346bd3[_0xcd4d('0x1c')]?_0x346bd3[_0xcd4d('0x1c')][_0xcd4d('0x1e')]||null:null,'attributes':_0x346bd3[_0xcd4d('0x1c')]?_0x346bd3['options'][_0xcd4d('0x1f')]||null:null,'limit':_0x346bd3['options']?_0x346bd3[_0xcd4d('0x1c')][_0xcd4d('0x20')]||null:null,'include':_0x346bd3['options']?_0x346bd3[_0xcd4d('0x1c')]['include']?_[_0xcd4d('0x21')](_0x346bd3[_0xcd4d('0x1c')][_0xcd4d('0x22')],function(_0x512774){return{'model':db[_0x512774['model']],'as':_0x512774['as'],'attributes':_0x512774['attributes'],'include':_0x512774[_0xcd4d('0x22')]?_[_0xcd4d('0x21')](_0x512774[_0xcd4d('0x22')],function(_0xf9e37e){return{'model':db[_0xf9e37e[_0xcd4d('0x23')]],'as':_0xf9e37e['as'],'attributes':_0xf9e37e['attributes'],'include':_0xf9e37e['include']?_[_0xcd4d('0x21')](_0xf9e37e[_0xcd4d('0x22')],function(_0x4adcb5){return{'model':db[_0x4adcb5[_0xcd4d('0x23')]],'as':_0x4adcb5['as'],'attributes':_0x4adcb5[_0xcd4d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd4d('0x24')](function(_0x310523){logger[_0xcd4d('0x16')](_0xcd4d('0x19'),_0x346bd3);logger[_0xcd4d('0x11')]('GetChatQueue',_0x346bd3,JSON[_0xcd4d('0x25')](_0x310523));_0x6a6da1(_0x310523);})[_0xcd4d('0x18')](function(_0x4a2cf4){logger[_0xcd4d('0x14')]('GetChatQueue',_0x4a2cf4['message'],_0x346bd3);_0x1d7cdf(_0x4b0eae[_0xcd4d('0x14')](0x1f4,_0x4a2cf4['message']));});});};exports[_0xcd4d('0x26')]=function(_0x86c7a4){var _0x9eae4b=this;return new Promise(function(_0x293d0e,_0xa68356){return db[_0xcd4d('0x1a')][_0xcd4d('0x27')]({'raw':_0x86c7a4[_0xcd4d('0x1c')]?_0x86c7a4[_0xcd4d('0x1c')][_0xcd4d('0x1d')]===undefined?!![]:![]:!![],'where':_0x86c7a4[_0xcd4d('0x1c')]?_0x86c7a4[_0xcd4d('0x1c')][_0xcd4d('0x1e')]||null:null,'attributes':_0x86c7a4[_0xcd4d('0x1c')]?_0x86c7a4[_0xcd4d('0x1c')][_0xcd4d('0x1f')]||null:null,'include':_0x86c7a4[_0xcd4d('0x1c')]?_0x86c7a4[_0xcd4d('0x1c')]['include']?_[_0xcd4d('0x21')](_0x86c7a4['options'][_0xcd4d('0x22')],function(_0x24d010){return{'model':db[_0x24d010[_0xcd4d('0x23')]],'as':_0x24d010['as'],'attributes':_0x24d010['attributes'],'include':_0x24d010['include']?_[_0xcd4d('0x21')](_0x24d010['include'],function(_0x340de1){return{'model':db[_0x340de1[_0xcd4d('0x23')]],'as':_0x340de1['as'],'attributes':_0x340de1[_0xcd4d('0x1f')],'include':_0x340de1[_0xcd4d('0x22')]?_[_0xcd4d('0x21')](_0x340de1[_0xcd4d('0x22')],function(_0x549cb2){return{'model':db[_0x549cb2[_0xcd4d('0x23')]],'as':_0x549cb2['as'],'attributes':_0x549cb2[_0xcd4d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd4d('0x24')](function(_0x51026c){logger[_0xcd4d('0x16')](_0xcd4d('0x26'),_0x86c7a4);logger[_0xcd4d('0x11')](_0xcd4d('0x26'),_0x86c7a4,JSON['stringify'](_0x51026c));_0x293d0e(_0x51026c);})[_0xcd4d('0x18')](function(_0x606c21){logger['error'](_0xcd4d('0x26'),_0x606c21[_0xcd4d('0x15')],_0x86c7a4);_0xa68356(_0x9eae4b['error'](0x1f4,_0x606c21['message']));});});};
\ No newline at end of file
+var _0x4f7a=['ShowChatQueue','debug','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','info','catch'];(function(_0x13cab0,_0x14d825){var _0x38804f=function(_0x1bffaf){while(--_0x1bffaf){_0x13cab0['push'](_0x13cab0['shift']());}};_0x38804f(++_0x14d825);}(_0x4f7a,0x105));var _0xa4f7=function(_0x5f10d6,_0xc92616){_0x5f10d6=_0x5f10d6-0x0;var _0x551a6f=_0x4f7a[_0x5f10d6];return _0x551a6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa4f7('0x0'));var BPromise=require(_0xa4f7('0x1'));var rs=require(_0xa4f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4f7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f7('0x4'))(_0xa4f7('0x5'));var config=require(_0xa4f7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4f7('0x7')][_0xa4f7('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa4f7('0x9')],{'host':_0xa4f7('0xa'),'port':0x18eb});var socket=require(_0xa4f7('0xb'))(new Redis(config[_0xa4f7('0x9')]));require(_0xa4f7('0xc'))['register'](socket);function respondWithRpcPromise(_0x390174,_0x2f1c78,_0x39ba56){return new BPromise(function(_0x404403,_0x1f23b9){return client[_0xa4f7('0xd')](_0x390174,_0x39ba56)[_0xa4f7('0xe')](function(_0x5ed421){logger['info'](_0xa4f7('0xf'),_0x2f1c78,_0xa4f7('0x10'));logger['debug'](_0xa4f7('0x11'),_0x2f1c78,_0xa4f7('0x10'),JSON[_0xa4f7('0x12')](_0x5ed421));if(_0x5ed421['error']){if(_0x5ed421[_0xa4f7('0x13')][_0xa4f7('0x14')]===0x1f4){logger[_0xa4f7('0x13')]('ChatQueue,\x20%s,\x20%s',_0x2f1c78,_0x5ed421[_0xa4f7('0x13')][_0xa4f7('0x15')]);return _0x1f23b9(_0x5ed421[_0xa4f7('0x13')][_0xa4f7('0x15')]);}logger['error'](_0xa4f7('0xf'),_0x2f1c78,_0x5ed421[_0xa4f7('0x13')]['message']);return _0x404403(_0x5ed421['error'][_0xa4f7('0x15')]);}else{logger['info'](_0xa4f7('0xf'),_0x2f1c78,_0xa4f7('0x10'));_0x404403(_0x5ed421['result'][_0xa4f7('0x15')]);}})['catch'](function(_0x143dac){logger[_0xa4f7('0x13')](_0xa4f7('0xf'),_0x2f1c78,_0x143dac);_0x1f23b9(_0x143dac);});});}exports[_0xa4f7('0x16')]=function(_0x181911){var _0x44a54c=this;return new Promise(function(_0x48ec43,_0x18bb7a){return db[_0xa4f7('0x17')][_0xa4f7('0x18')]({'raw':_0x181911[_0xa4f7('0x19')]?_0x181911['options'][_0xa4f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1b')]||null:null,'attributes':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1c')]||null:null,'limit':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1d')]||null:null,'include':_0x181911[_0xa4f7('0x19')]?_0x181911[_0xa4f7('0x19')]['include']?_[_0xa4f7('0x1e')](_0x181911[_0xa4f7('0x19')][_0xa4f7('0x1f')],function(_0x2b56fe){return{'model':db[_0x2b56fe[_0xa4f7('0x20')]],'as':_0x2b56fe['as'],'attributes':_0x2b56fe['attributes'],'include':_0x2b56fe['include']?_['map'](_0x2b56fe[_0xa4f7('0x1f')],function(_0x4e6c36){return{'model':db[_0x4e6c36[_0xa4f7('0x20')]],'as':_0x4e6c36['as'],'attributes':_0x4e6c36[_0xa4f7('0x1c')],'include':_0x4e6c36[_0xa4f7('0x1f')]?_['map'](_0x4e6c36[_0xa4f7('0x1f')],function(_0x5366dc){return{'model':db[_0x5366dc[_0xa4f7('0x20')]],'as':_0x5366dc['as'],'attributes':_0x5366dc['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4f7('0xe')](function(_0x1009d2){logger[_0xa4f7('0x21')](_0xa4f7('0x16'),_0x181911);logger['debug'](_0xa4f7('0x16'),_0x181911,JSON[_0xa4f7('0x12')](_0x1009d2));_0x48ec43(_0x1009d2);})[_0xa4f7('0x22')](function(_0x3e4d19){logger[_0xa4f7('0x13')]('GetChatQueue',_0x3e4d19[_0xa4f7('0x15')],_0x181911);_0x18bb7a(_0x44a54c[_0xa4f7('0x13')](0x1f4,_0x3e4d19['message']));});});};exports[_0xa4f7('0x23')]=function(_0x106c07){var _0x195943=this;return new Promise(function(_0x52f8d2,_0xe955a6){return db[_0xa4f7('0x17')]['find']({'raw':_0x106c07['options']?_0x106c07[_0xa4f7('0x19')][_0xa4f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x106c07[_0xa4f7('0x19')]?_0x106c07['options'][_0xa4f7('0x1b')]||null:null,'attributes':_0x106c07[_0xa4f7('0x19')]?_0x106c07[_0xa4f7('0x19')][_0xa4f7('0x1c')]||null:null,'include':_0x106c07[_0xa4f7('0x19')]?_0x106c07[_0xa4f7('0x19')][_0xa4f7('0x1f')]?_[_0xa4f7('0x1e')](_0x106c07[_0xa4f7('0x19')]['include'],function(_0x2cdb5d){return{'model':db[_0x2cdb5d[_0xa4f7('0x20')]],'as':_0x2cdb5d['as'],'attributes':_0x2cdb5d[_0xa4f7('0x1c')],'include':_0x2cdb5d[_0xa4f7('0x1f')]?_[_0xa4f7('0x1e')](_0x2cdb5d[_0xa4f7('0x1f')],function(_0x3f01fa){return{'model':db[_0x3f01fa[_0xa4f7('0x20')]],'as':_0x3f01fa['as'],'attributes':_0x3f01fa['attributes'],'include':_0x3f01fa[_0xa4f7('0x1f')]?_[_0xa4f7('0x1e')](_0x3f01fa['include'],function(_0x5ee074){return{'model':db[_0x5ee074[_0xa4f7('0x20')]],'as':_0x5ee074['as'],'attributes':_0x5ee074[_0xa4f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa4f7('0xe')](function(_0x57db76){logger[_0xa4f7('0x21')](_0xa4f7('0x23'),_0x106c07);logger[_0xa4f7('0x24')](_0xa4f7('0x23'),_0x106c07,JSON['stringify'](_0x57db76));_0x52f8d2(_0x57db76);})[_0xa4f7('0x22')](function(_0x32a25a){logger[_0xa4f7('0x13')](_0xa4f7('0x23'),_0x32a25a[_0xa4f7('0x15')],_0x106c07);_0xe955a6(_0x195943[_0xa4f7('0x13')](0x1f4,_0x32a25a[_0xa4f7('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8df5f77..9c72994 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 _0x57d4=['length','./chatQueue.events','save','update','emit','removeListener','register'];(function(_0xe5c1c8,_0x4a1b05){var _0x5b07cc=function(_0x2fcd21){while(--_0x2fcd21){_0xe5c1c8['push'](_0xe5c1c8['shift']());}};_0x5b07cc(++_0x4a1b05);}(_0x57d4,0x78));var _0x457d=function(_0x1a09a3,_0x316a5b){_0x1a09a3=_0x1a09a3-0x0;var _0x1bdc2f=_0x57d4[_0x1a09a3];return _0x1bdc2f;};'use strict';var ChatQueueEvents=require(_0x457d('0x0'));var events=[_0x457d('0x1'),'remove',_0x457d('0x2')];function createListener(_0xa408c8,_0x1e26ab){return function(_0x30a25c){_0x1e26ab[_0x457d('0x3')](_0xa408c8,_0x30a25c);};}function removeListener(_0x3c89b2,_0x3e2239){return function(){ChatQueueEvents[_0x457d('0x4')](_0x3c89b2,_0x3e2239);};}exports[_0x457d('0x5')]=function(_0x247ec7){for(var _0x3fd867=0x0,_0x5c6816=events[_0x457d('0x6')];_0x3fd867<_0x5c6816;_0x3fd867++){var _0x381e22=events[_0x3fd867];var _0x4e32c0=createListener('chatQueue:'+_0x381e22,_0x247ec7);ChatQueueEvents['on'](_0x381e22,_0x4e32c0);}};
\ No newline at end of file
+var _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x11204e,_0x19433e){var _0x3110f6=function(_0x41b7b7){while(--_0x41b7b7){_0x11204e['push'](_0x11204e['shift']());}};_0x3110f6(++_0x19433e);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xf2ace7,_0x13a339){_0xf2ace7=_0xf2ace7-0x0;var _0x78d892=_0xd6d6[_0xf2ace7];return _0x78d892;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 6fe0a1a..5e7b9ad 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0xa651d4,_0x5df6cb){var _0x1301be=function(_0x5aa409){while(--_0x5aa409){_0xa651d4['push'](_0xa651d4['shift']());}};_0x1301be(++_0x5df6cb);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0x5fc3[_0x4d7379];return _0x46d7cf;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 51853b3..fb28d52 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 _0xbcfe=['moment','exports','STRING','DATE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbcfe,0x128));var _0xebcf=function(_0x53549c,_0x56feb7){_0x53549c=_0x53549c-0x0;var _0x59330f=_0xbcfe[_0x53549c];return _0x59330f;};'use strict';var moment=require(_0xebcf('0x0'));var Sequelize=require('sequelize');module[_0xebcf('0x1')]={'uniqueid':{'type':Sequelize[_0xebcf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xebcf('0x2')]},'joinAt':{'type':Sequelize[_0xebcf('0x3')]},'leaveAt':{'type':Sequelize[_0xebcf('0x3')]},'acceptAt':{'type':Sequelize[_0xebcf('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xebcf('0x2')]}};
\ No newline at end of file
+var _0x6a42=['moment','sequelize','exports','STRING','DATE'];(function(_0x3f4512,_0x39f038){var _0x3c3c10=function(_0x4341ef){while(--_0x4341ef){_0x3f4512['push'](_0x3f4512['shift']());}};_0x3c3c10(++_0x39f038);}(_0x6a42,0x122));var _0x26a4=function(_0x14ef02,_0x18d327){_0x14ef02=_0x14ef02-0x0;var _0x5545eb=_0x6a42[_0x14ef02];return _0x5545eb;};'use strict';var moment=require(_0x26a4('0x0'));var Sequelize=require(_0x26a4('0x1'));module[_0x26a4('0x2')]={'uniqueid':{'type':Sequelize[_0x26a4('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x26a4('0x4')]},'leaveAt':{'type':Sequelize[_0x26a4('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x26a4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c431b8e..489f934 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 _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','ChatQueueReport','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x582187,_0x33920e){var _0x2b2f8c=function(_0x559889){while(--_0x559889){_0x582187['push'](_0x582187['shift']());}};_0x2b2f8c(++_0x33920e);}(_0x90b1,0x1bb));var _0x190b=function(_0x4c221d,_0x3bc12f){_0x4c221d=_0x4c221d-0x0;var _0x203a04=_0x90b1[_0x4c221d];return _0x203a04;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));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(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['ChatQueueReport'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['ChatQueueReport'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));};
\ No newline at end of file
+var _0x1c23=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty'];(function(_0x1b40d7,_0x27a2f5){var _0x4be1b1=function(_0x17ee87){while(--_0x17ee87){_0x1b40d7['push'](_0x1b40d7['shift']());}};_0x4be1b1(++_0x27a2f5);}(_0x1c23,0x1d5));var _0x31c2=function(_0x356778,_0x2292c1){_0x356778=_0x356778-0x0;var _0x3b1921=_0x1c23[_0x356778];return _0x3b1921;};'use strict';var emlformat=require(_0x31c2('0x0'));var rimraf=require(_0x31c2('0x1'));var zipdir=require(_0x31c2('0x2'));var jsonpatch=require(_0x31c2('0x3'));var rp=require(_0x31c2('0x4'));var moment=require(_0x31c2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31c2('0x6'));var util=require(_0x31c2('0x7'));var path=require('path');var sox=require(_0x31c2('0x8'));var csv=require(_0x31c2('0x9'));var ejs=require(_0x31c2('0xa'));var fs=require('fs');var fs_extra=require(_0x31c2('0xb'));var _=require(_0x31c2('0xc'));var squel=require('squel');var crypto=require(_0x31c2('0xd'));var jsforce=require(_0x31c2('0xe'));var deskjs=require(_0x31c2('0xf'));var toCsv=require(_0x31c2('0x9'));var querystring=require(_0x31c2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x31c2('0x11'));var qs=require(_0x31c2('0x12'));var as=require(_0x31c2('0x13'));var hardwareService=require(_0x31c2('0x14'));var logger=require(_0x31c2('0x15'))(_0x31c2('0x16'));var utils=require('../../config/utils');var config=require(_0x31c2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x31c2('0x18'))['db'];function respondWithStatusCode(_0x2df4e5,_0x1d8406){_0x1d8406=_0x1d8406||0xcc;return function(_0x5f573a){if(_0x5f573a){return _0x2df4e5[_0x31c2('0x19')](_0x1d8406);}return _0x2df4e5[_0x31c2('0x1a')](_0x1d8406)['end']();};}function respondWithResult(_0x14c25f,_0x44d874){_0x44d874=_0x44d874||0xc8;return function(_0x463881){if(_0x463881){return _0x14c25f[_0x31c2('0x1a')](_0x44d874)[_0x31c2('0x1b')](_0x463881);}};}function respondWithFilteredResult(_0x5fa42e,_0x1cf235){return function(_0x35f75b){if(_0x35f75b){var _0x3f1d79=typeof _0x1cf235[_0x31c2('0x1c')]===_0x31c2('0x1d')&&typeof _0x1cf235['limit']==='undefined';var _0x3bfa45=_0x35f75b[_0x31c2('0x1e')];var _0x1f7f83=_0x3f1d79?0x0:_0x1cf235['offset'];var _0x5055e7=_0x3f1d79?_0x35f75b[_0x31c2('0x1e')]:_0x1cf235['offset']+_0x1cf235[_0x31c2('0x1f')];var _0x3f2435;if(_0x5055e7>=_0x3bfa45){_0x5055e7=_0x3bfa45;_0x3f2435=0xc8;}else{_0x3f2435=0xce;}_0x5fa42e[_0x31c2('0x1a')](_0x3f2435);return _0x5fa42e[_0x31c2('0x20')]('Content-Range',_0x1f7f83+'-'+_0x5055e7+'/'+_0x3bfa45)[_0x31c2('0x1b')](_0x35f75b);}return null;};}function patchUpdates(_0x4ae7ad){return function(_0x35d945){try{jsonpatch[_0x31c2('0x21')](_0x35d945,_0x4ae7ad,!![]);}catch(_0x483c25){return BPromise['reject'](_0x483c25);}return _0x35d945[_0x31c2('0x22')]();};}function saveUpdates(_0x36ae8e,_0x4cd43e){return function(_0x133d0e){if(_0x133d0e){return _0x133d0e[_0x31c2('0x23')](_0x36ae8e)[_0x31c2('0x24')](function(_0x44a0bc){return _0x44a0bc;});}return null;};}function removeEntity(_0x5e10e7,_0x25bdc2){return function(_0x26939e){if(_0x26939e){return _0x26939e['destroy']()[_0x31c2('0x24')](function(){_0x5e10e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af6eb,_0x58f82d){return function(_0x37b749){if(!_0x37b749){_0x3af6eb[_0x31c2('0x19')](0x194);}return _0x37b749;};}function handleError(_0x18e3d8,_0x211a43){_0x211a43=_0x211a43||0x1f4;return function(_0x3ad658){logger['error'](_0x3ad658[_0x31c2('0x25')]);if(_0x3ad658[_0x31c2('0x26')]){delete _0x3ad658[_0x31c2('0x26')];}_0x18e3d8['status'](_0x211a43)[_0x31c2('0x27')](_0x3ad658);};}exports[_0x31c2('0x28')]=function(_0xf8879a,_0x2a936e){var _0x45aa60={},_0x2164d8={},_0x13c1ea={'count':0x0,'rows':[]};var _0x5d2a1a=_[_0x31c2('0x29')](db[_0x31c2('0x2a')][_0x31c2('0x2b')],function(_0x2488eb){return{'name':_0x2488eb[_0x31c2('0x2c')],'type':_0x2488eb[_0x31c2('0x2d')][_0x31c2('0x2e')]};});_0x2164d8['model']=_['map'](_0x5d2a1a,_0x31c2('0x26'));_0x2164d8['query']=_[_0x31c2('0x2f')](_0xf8879a[_0x31c2('0x30')]);_0x2164d8[_0x31c2('0x31')]=_[_0x31c2('0x32')](_0x2164d8['model'],_0x2164d8[_0x31c2('0x30')]);_0x45aa60['attributes']=_[_0x31c2('0x32')](_0x2164d8[_0x31c2('0x33')],qs[_0x31c2('0x34')](_0xf8879a[_0x31c2('0x30')]['fields']));_0x45aa60['attributes']=_0x45aa60['attributes'][_0x31c2('0x35')]?_0x45aa60[_0x31c2('0x36')]:_0x2164d8[_0x31c2('0x33')];if(!_0xf8879a[_0x31c2('0x30')][_0x31c2('0x37')](_0x31c2('0x38'))){_0x45aa60[_0x31c2('0x1f')]=qs[_0x31c2('0x1f')](_0xf8879a[_0x31c2('0x30')][_0x31c2('0x1f')]);_0x45aa60[_0x31c2('0x1c')]=qs[_0x31c2('0x1c')](_0xf8879a[_0x31c2('0x30')][_0x31c2('0x1c')]);}_0x45aa60[_0x31c2('0x39')]=qs['sort'](_0xf8879a['query'][_0x31c2('0x3a')]);_0x45aa60[_0x31c2('0x3b')]=qs[_0x31c2('0x31')](_[_0x31c2('0x3c')](_0xf8879a[_0x31c2('0x30')],_0x2164d8['filters']),_0x5d2a1a);if(_0xf8879a['query'][_0x31c2('0x3d')]){_0x45aa60[_0x31c2('0x3b')]=_[_0x31c2('0x3e')](_0x45aa60[_0x31c2('0x3b')],{'$or':_[_0x31c2('0x29')](_0x5d2a1a,function(_0x4855ef){if(_0x4855ef[_0x31c2('0x2d')]!==_0x31c2('0x3f')){var _0x592258={};_0x592258[_0x4855ef[_0x31c2('0x26')]]={'$like':'%'+_0xf8879a['query'][_0x31c2('0x3d')]+'%'};return _0x592258;}})});}_0x45aa60=_[_0x31c2('0x3e')]({},_0x45aa60,_0xf8879a[_0x31c2('0x40')]);var _0x158cca={'where':_0x45aa60['where']};return db[_0x31c2('0x2a')][_0x31c2('0x1e')](_0x158cca)[_0x31c2('0x24')](function(_0x412b5e){_0x13c1ea['count']=_0x412b5e;if(_0xf8879a[_0x31c2('0x30')][_0x31c2('0x41')]){_0x45aa60[_0x31c2('0x42')]=[{'all':!![]}];}return db[_0x31c2('0x2a')][_0x31c2('0x43')](_0x45aa60);})['then'](function(_0x17bb5e){_0x13c1ea['rows']=_0x17bb5e;return _0x13c1ea;})[_0x31c2('0x24')](respondWithFilteredResult(_0x2a936e,_0x45aa60))['catch'](handleError(_0x2a936e,null));};exports[_0x31c2('0x44')]=function(_0x36a7be,_0x149bd0){var _0x1932b5={'raw':!![],'where':{'id':_0x36a7be[_0x31c2('0x45')]['id']}},_0x32cfe3={};_0x32cfe3[_0x31c2('0x33')]=_['keys'](db[_0x31c2('0x2a')][_0x31c2('0x2b')]);_0x32cfe3[_0x31c2('0x30')]=_[_0x31c2('0x2f')](_0x36a7be[_0x31c2('0x30')]);_0x32cfe3[_0x31c2('0x31')]=_[_0x31c2('0x32')](_0x32cfe3[_0x31c2('0x33')],_0x32cfe3[_0x31c2('0x30')]);_0x1932b5[_0x31c2('0x36')]=_[_0x31c2('0x32')](_0x32cfe3[_0x31c2('0x33')],qs[_0x31c2('0x34')](_0x36a7be[_0x31c2('0x30')][_0x31c2('0x34')]));_0x1932b5[_0x31c2('0x36')]=_0x1932b5[_0x31c2('0x36')][_0x31c2('0x35')]?_0x1932b5['attributes']:_0x32cfe3[_0x31c2('0x33')];if(_0x36a7be[_0x31c2('0x30')]['includeAll']){_0x1932b5[_0x31c2('0x42')]=[{'all':!![]}];}_0x1932b5=_[_0x31c2('0x3e')]({},_0x1932b5,_0x36a7be[_0x31c2('0x40')]);return db[_0x31c2('0x2a')][_0x31c2('0x46')](_0x1932b5)[_0x31c2('0x24')](handleEntityNotFound(_0x149bd0,null))[_0x31c2('0x24')](respondWithResult(_0x149bd0,null))['catch'](handleError(_0x149bd0,null));};exports['create']=function(_0x583842,_0x29be6f){return db[_0x31c2('0x2a')]['create'](_0x583842['body'],{})[_0x31c2('0x24')](respondWithResult(_0x29be6f,0xc9))[_0x31c2('0x47')](handleError(_0x29be6f,null));};exports['update']=function(_0x2f935d,_0x28f9e7){if(_0x2f935d['body']['id']){delete _0x2f935d[_0x31c2('0x48')]['id'];}return db[_0x31c2('0x2a')]['find']({'where':{'id':_0x2f935d[_0x31c2('0x45')]['id']}})[_0x31c2('0x24')](handleEntityNotFound(_0x28f9e7,null))['then'](saveUpdates(_0x2f935d[_0x31c2('0x48')],null))[_0x31c2('0x24')](respondWithResult(_0x28f9e7,null))[_0x31c2('0x47')](handleError(_0x28f9e7,null));};exports[_0x31c2('0x49')]=function(_0x35d315,_0xa924bd){return db[_0x31c2('0x2a')][_0x31c2('0x46')]({'where':{'id':_0x35d315[_0x31c2('0x45')]['id']}})[_0x31c2('0x24')](handleEntityNotFound(_0xa924bd,null))['then'](removeEntity(_0xa924bd,null))['catch'](handleError(_0xa924bd,null));};exports[_0x31c2('0x4a')]=function(_0x41f7e6,_0x2b65ee){return db[_0x31c2('0x2a')][_0x31c2('0x4a')]()[_0x31c2('0x24')](respondWithResult(_0x2b65ee,null))[_0x31c2('0x47')](handleError(_0x2b65ee,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 301dd00..eff6469 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x272e73,_0x4304a9){var _0x45f6af=function(_0x5dcde6){while(--_0x5dcde6){_0x272e73['push'](_0x272e73['shift']());}};_0x45f6af(++_0x4304a9);}(_0x757a,0xde));var _0xa757=function(_0x2da358,_0x547276){_0x2da358=_0x2da358-0x0;var _0x177804=_0x757a[_0x2da358];return _0x177804;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x184f5f,_0x2034dd){var _0x467cd7=function(_0x5826b7){while(--_0x5826b7){_0x184f5f['push'](_0x184f5f['shift']());}};_0x467cd7(++_0x2034dd);}(_0xe706,0xa3));var _0x6e70=function(_0x348fec,_0x486f87){_0x348fec=_0x348fec-0x0;var _0x5914c7=_0xe706[_0x348fec];return _0x5914c7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 1d7c927..54d3dd8 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 _0x53f5=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x28f632,_0x19c6b5){var _0x1bbfa2=function(_0x403808){while(--_0x403808){_0x28f632['push'](_0x28f632['shift']());}};_0x1bbfa2(++_0x19c6b5);}(_0x53f5,0x1c0));var _0x553f=function(_0x27f496,_0x5dccc5){_0x27f496=_0x27f496-0x0;var _0x2e4d24=_0x53f5[_0x27f496];return _0x2e4d24;};'use strict';var _=require(_0x553f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x553f('0x1'));var rs=require(_0x553f('0x2'));var fs=require('fs');var Redis=require(_0x553f('0x3'));var db=require(_0x553f('0x4'))['db'];var utils=require(_0x553f('0x5'));var logger=require('../../config/logger')(_0x553f('0x6'));var config=require(_0x553f('0x7'));var jayson=require(_0x553f('0x8'));var client=jayson['client'][_0x553f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2383e2,_0x3d612e,_0xd883a1){return new BPromise(function(_0x4e635a,_0x40fd26){return client[_0x553f('0xa')](_0x2383e2,_0xd883a1)[_0x553f('0xb')](function(_0x21ba63){logger[_0x553f('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x3d612e,_0x553f('0xd'));logger[_0x553f('0xe')](_0x553f('0xf'),_0x3d612e,_0x553f('0xd'),JSON['stringify'](_0x21ba63));if(_0x21ba63[_0x553f('0x10')]){if(_0x21ba63[_0x553f('0x10')][_0x553f('0x11')]===0x1f4){logger[_0x553f('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x3d612e,_0x21ba63[_0x553f('0x10')]['message']);return _0x40fd26(_0x21ba63[_0x553f('0x10')][_0x553f('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3d612e,_0x21ba63[_0x553f('0x10')]['message']);return _0x4e635a(_0x21ba63[_0x553f('0x10')][_0x553f('0x12')]);}else{logger[_0x553f('0xc')](_0x553f('0x13'),_0x3d612e,_0x553f('0xd'));_0x4e635a(_0x21ba63[_0x553f('0x14')]['message']);}})[_0x553f('0x15')](function(_0x19152b){logger[_0x553f('0x10')](_0x553f('0x13'),_0x3d612e,_0x19152b);_0x40fd26(_0x19152b);});});}exports[_0x553f('0x16')]=function(_0xa8cfaf){var _0x1167a2=this;return new Promise(function(_0x2c1e5f,_0x1d6226){return db['ChatQueueReport'][_0x553f('0x17')](_0xa8cfaf[_0x553f('0x18')],{'raw':_0xa8cfaf[_0x553f('0x19')]?_0xa8cfaf[_0x553f('0x19')][_0x553f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1ac59c){logger['info'](_0x553f('0x16'),_0xa8cfaf);logger[_0x553f('0xe')](_0x553f('0x16'),_0xa8cfaf,JSON['stringify'](_0x1ac59c));_0x2c1e5f(_0x1ac59c);})[_0x553f('0x15')](function(_0x51bbf9){logger[_0x553f('0x10')](_0x553f('0x16'),_0x51bbf9[_0x553f('0x12')],_0xa8cfaf);_0x1d6226(_0x1167a2[_0x553f('0x10')](0x1f4,_0x51bbf9[_0x553f('0x12')]));});});};exports[_0x553f('0x1b')]=function(_0x3d9be8){var _0x224b8d=this;return new Promise(function(_0x12a913,_0x4346f9){return db[_0x553f('0x1c')][_0x553f('0x1d')](_0x3d9be8[_0x553f('0x18')],{'raw':_0x3d9be8[_0x553f('0x19')]?_0x3d9be8[_0x553f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d9be8[_0x553f('0x19')]?_0x3d9be8[_0x553f('0x19')][_0x553f('0x1e')]||null:null,'attributes':_0x3d9be8[_0x553f('0x19')]?_0x3d9be8['options'][_0x553f('0x1f')]||null:null,'limit':_0x3d9be8[_0x553f('0x19')]?_0x3d9be8[_0x553f('0x19')]['limit']||null:null})['then'](function(_0x558829){logger[_0x553f('0xc')](_0x553f('0x1b'),_0x3d9be8);logger[_0x553f('0xe')](_0x553f('0x1b'),_0x3d9be8,JSON[_0x553f('0x20')](_0x558829));_0x12a913(_0x558829);})[_0x553f('0x15')](function(_0xbc5177){logger[_0x553f('0x10')](_0x553f('0x1b'),_0xbc5177[_0x553f('0x12')],_0x3d9be8);_0x4346f9(_0x224b8d[_0x553f('0x10')](0x1f4,_0xbc5177[_0x553f('0x12')]));});});};
\ No newline at end of file
+var _0xdacd=['limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','attributes'];(function(_0x4d8710,_0x1b949e){var _0x27cd5f=function(_0x27370c){while(--_0x27370c){_0x4d8710['push'](_0x4d8710['shift']());}};_0x27cd5f(++_0x1b949e);}(_0xdacd,0xab));var _0xddac=function(_0x1b8c23,_0x1c0325){_0x1b8c23=_0x1b8c23-0x0;var _0x4da0e6=_0xdacd[_0x1b8c23];return _0x4da0e6;};'use strict';var _=require('lodash');var util=require(_0xddac('0x0'));var moment=require(_0xddac('0x1'));var BPromise=require(_0xddac('0x2'));var rs=require(_0xddac('0x3'));var fs=require('fs');var Redis=require(_0xddac('0x4'));var db=require(_0xddac('0x5'))['db'];var utils=require(_0xddac('0x6'));var logger=require(_0xddac('0x7'))('rpc');var config=require(_0xddac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xddac('0x9')][_0xddac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530754,_0x402b0b,_0x223d98){return new BPromise(function(_0x367730,_0x2ad0f5){return client[_0xddac('0xb')](_0x530754,_0x223d98)[_0xddac('0xc')](function(_0x42476f){logger[_0xddac('0xd')](_0xddac('0xe'),_0x402b0b,_0xddac('0xf'));logger['debug'](_0xddac('0x10'),_0x402b0b,_0xddac('0xf'),JSON[_0xddac('0x11')](_0x42476f));if(_0x42476f[_0xddac('0x12')]){if(_0x42476f[_0xddac('0x12')][_0xddac('0x13')]===0x1f4){logger[_0xddac('0x12')](_0xddac('0xe'),_0x402b0b,_0x42476f[_0xddac('0x12')]['message']);return _0x2ad0f5(_0x42476f[_0xddac('0x12')][_0xddac('0x14')]);}logger['error'](_0xddac('0xe'),_0x402b0b,_0x42476f[_0xddac('0x12')]['message']);return _0x367730(_0x42476f[_0xddac('0x12')][_0xddac('0x14')]);}else{logger[_0xddac('0xd')](_0xddac('0xe'),_0x402b0b,_0xddac('0xf'));_0x367730(_0x42476f[_0xddac('0x15')][_0xddac('0x14')]);}})[_0xddac('0x16')](function(_0x38161b){logger[_0xddac('0x12')](_0xddac('0xe'),_0x402b0b,_0x38161b);_0x2ad0f5(_0x38161b);});});}exports[_0xddac('0x17')]=function(_0x4ec904){var _0x5382f1=this;return new Promise(function(_0x28b2df,_0x52deb3){return db[_0xddac('0x18')][_0xddac('0x19')](_0x4ec904[_0xddac('0x1a')],{'raw':_0x4ec904[_0xddac('0x1b')]?_0x4ec904[_0xddac('0x1b')][_0xddac('0x1c')]===undefined?!![]:![]:!![]})[_0xddac('0xc')](function(_0x402dca){logger[_0xddac('0xd')]('CreateChatQueueReport',_0x4ec904);logger[_0xddac('0x1d')]('CreateChatQueueReport',_0x4ec904,JSON['stringify'](_0x402dca));_0x28b2df(_0x402dca);})['catch'](function(_0x6058c5){logger[_0xddac('0x12')](_0xddac('0x17'),_0x6058c5[_0xddac('0x14')],_0x4ec904);_0x52deb3(_0x5382f1[_0xddac('0x12')](0x1f4,_0x6058c5[_0xddac('0x14')]));});});};exports[_0xddac('0x1e')]=function(_0x1d61d4){var _0x1cc400=this;return new Promise(function(_0x440b95,_0x3b545e){return db[_0xddac('0x18')][_0xddac('0x1f')](_0x1d61d4['body'],{'raw':_0x1d61d4['options']?_0x1d61d4[_0xddac('0x1b')][_0xddac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d61d4[_0xddac('0x1b')]?_0x1d61d4[_0xddac('0x1b')]['where']||null:null,'attributes':_0x1d61d4[_0xddac('0x1b')]?_0x1d61d4['options'][_0xddac('0x20')]||null:null,'limit':_0x1d61d4[_0xddac('0x1b')]?_0x1d61d4[_0xddac('0x1b')][_0xddac('0x21')]||null:null})[_0xddac('0xc')](function(_0x32c033){logger[_0xddac('0xd')]('UpdateChatQueueReport',_0x1d61d4);logger['debug'](_0xddac('0x1e'),_0x1d61d4,JSON[_0xddac('0x11')](_0x32c033));_0x440b95(_0x32c033);})[_0xddac('0x16')](function(_0x542e9a){logger['error'](_0xddac('0x1e'),_0x542e9a[_0xddac('0x14')],_0x1d61d4);_0x3b545e(_0x1cc400[_0xddac('0x12')](0x1f4,_0x542e9a[_0xddac('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 63b9aef..231f102 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 _0xad97=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x80c639,_0x1e3797){var _0x34295d=function(_0x536b1f){while(--_0x536b1f){_0x80c639['push'](_0x80c639['shift']());}};_0x34295d(++_0x1e3797);}(_0xad97,0xff));var _0x7ad9=function(_0x41f6dc,_0x2bd02d){_0x41f6dc=_0x41f6dc-0x0;var _0x3ada9d=_0xad97[_0x41f6dc];return _0x3ada9d;};'use strict';var multer=require(_0x7ad9('0x0'));var util=require(_0x7ad9('0x1'));var path=require('path');var timeout=require(_0x7ad9('0x2'));var express=require('express');var router=express[_0x7ad9('0x3')]();var fs_extra=require(_0x7ad9('0x4'));var auth=require(_0x7ad9('0x5'));var interaction=require(_0x7ad9('0x6'));var config=require(_0x7ad9('0x7'));var controller=require('./chatQueueReport.controller');router[_0x7ad9('0x8')]('/',auth[_0x7ad9('0x9')](),controller[_0x7ad9('0xa')]);router[_0x7ad9('0x8')](_0x7ad9('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7ad9('0xc'),auth[_0x7ad9('0x9')](),controller[_0x7ad9('0xd')]);router[_0x7ad9('0xe')]('/',auth[_0x7ad9('0x9')](),controller['create']);router[_0x7ad9('0xf')](_0x7ad9('0xc'),auth[_0x7ad9('0x9')](),controller[_0x7ad9('0x10')]);router[_0x7ad9('0x11')](_0x7ad9('0xc'),auth[_0x7ad9('0x9')](),controller[_0x7ad9('0x12')]);module[_0x7ad9('0x13')]=router;
\ No newline at end of file
+var _0x85d4=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d4,0xca));var _0x485d=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x85d4[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require(_0x485d('0x0'));var path=require(_0x485d('0x1'));var timeout=require(_0x485d('0x2'));var express=require(_0x485d('0x3'));var router=express[_0x485d('0x4')]();var fs_extra=require(_0x485d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x485d('0x6'));var config=require(_0x485d('0x7'));var controller=require(_0x485d('0x8'));router[_0x485d('0x9')]('/',auth[_0x485d('0xa')](),controller[_0x485d('0xb')]);router[_0x485d('0x9')](_0x485d('0xc'),auth[_0x485d('0xa')](),controller[_0x485d('0xd')]);router['get']('/:id',auth[_0x485d('0xa')](),controller[_0x485d('0xe')]);router[_0x485d('0xf')]('/',auth[_0x485d('0xa')](),controller[_0x485d('0x10')]);router[_0x485d('0x11')](_0x485d('0x12'),auth[_0x485d('0xa')](),controller[_0x485d('0x13')]);router['delete'](_0x485d('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x485d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index ee0f3fa..147800f 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x463db8,_0xb21f22){var _0x220560=function(_0x3b9c50){while(--_0x3b9c50){_0x463db8['push'](_0x463db8['shift']());}};_0x220560(++_0xb21f22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x469409,_0x569b57){var _0x40a959=function(_0x348b2e){while(--_0x348b2e){_0x469409['push'](_0x469409['shift']());}};_0x40a959(++_0x569b57);}(_0xf4eb,0xec));var _0xbf4e=function(_0x37e475,_0x1625ab){_0x37e475=_0x37e475-0x0;var _0x1688f2=_0xf4eb[_0x37e475];return _0x1688f2;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 510155f..1b39a46 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 _0x8078=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8078,0x1b5));var _0x8807=function(_0x224826,_0x2ff305){_0x224826=_0x224826-0x0;var _0x334b6e=_0x8078[_0x224826];return _0x334b6e;};'use strict';var emlformat=require(_0x8807('0x0'));var rimraf=require(_0x8807('0x1'));var zipdir=require(_0x8807('0x2'));var jsonpatch=require(_0x8807('0x3'));var rp=require(_0x8807('0x4'));var moment=require('moment');var BPromise=require(_0x8807('0x5'));var Mustache=require(_0x8807('0x6'));var util=require(_0x8807('0x7'));var path=require(_0x8807('0x8'));var sox=require('sox');var csv=require(_0x8807('0x9'));var ejs=require(_0x8807('0xa'));var fs=require('fs');var fs_extra=require(_0x8807('0xb'));var _=require('lodash');var squel=require(_0x8807('0xc'));var crypto=require(_0x8807('0xd'));var jsforce=require(_0x8807('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8807('0x9'));var querystring=require('querystring');var Papa=require(_0x8807('0xf'));var Redis=require(_0x8807('0x10'));var authService=require(_0x8807('0x11'));var qs=require(_0x8807('0x12'));var as=require(_0x8807('0x13'));var hardwareService=require(_0x8807('0x14'));var logger=require('../../config/logger')(_0x8807('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8807('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x265d9c,_0x4ebc4c){_0x4ebc4c=_0x4ebc4c||0xcc;return function(_0x16732d){if(_0x16732d){return _0x265d9c[_0x8807('0x17')](_0x4ebc4c);}return _0x265d9c[_0x8807('0x18')](_0x4ebc4c)['end']();};}function respondWithResult(_0x2aa4f4,_0x1b420d){_0x1b420d=_0x1b420d||0xc8;return function(_0x45d087){if(_0x45d087){return _0x2aa4f4['status'](_0x1b420d)['json'](_0x45d087);}};}function respondWithFilteredResult(_0x1c5cfc,_0x31cb11){return function(_0xad6e61){if(_0xad6e61){var _0x31d960=typeof _0x31cb11[_0x8807('0x19')]==='undefined'&&typeof _0x31cb11[_0x8807('0x1a')]===_0x8807('0x1b');var _0x2e6e92=_0xad6e61['count'];var _0x592f28=_0x31d960?0x0:_0x31cb11[_0x8807('0x19')];var _0x2dbe81=_0x31d960?_0xad6e61[_0x8807('0x1c')]:_0x31cb11[_0x8807('0x19')]+_0x31cb11[_0x8807('0x1a')];var _0x20d1a3;if(_0x2dbe81>=_0x2e6e92){_0x2dbe81=_0x2e6e92;_0x20d1a3=0xc8;}else{_0x20d1a3=0xce;}_0x1c5cfc['status'](_0x20d1a3);return _0x1c5cfc[_0x8807('0x1d')](_0x8807('0x1e'),_0x592f28+'-'+_0x2dbe81+'/'+_0x2e6e92)['json'](_0xad6e61);}return null;};}function patchUpdates(_0x403d23){return function(_0x37f572){try{jsonpatch[_0x8807('0x1f')](_0x37f572,_0x403d23,!![]);}catch(_0x8389ef){return BPromise[_0x8807('0x20')](_0x8389ef);}return _0x37f572[_0x8807('0x21')]();};}function saveUpdates(_0x233953,_0x89e2bb){return function(_0x294c3e){if(_0x294c3e){return _0x294c3e['update'](_0x233953)[_0x8807('0x22')](function(_0x130ab8){return _0x130ab8;});}return null;};}function removeEntity(_0x23c00f,_0x42d6b3){return function(_0x124eba){if(_0x124eba){return _0x124eba[_0x8807('0x23')]()[_0x8807('0x22')](function(){_0x23c00f[_0x8807('0x18')](0xcc)[_0x8807('0x24')]();});}};}function handleEntityNotFound(_0x12180c,_0x99e614){return function(_0x534ead){if(!_0x534ead){_0x12180c[_0x8807('0x17')](0x194);}return _0x534ead;};}function handleError(_0x4fc2c4,_0x4ee04d){_0x4ee04d=_0x4ee04d||0x1f4;return function(_0x43f6b6){logger[_0x8807('0x25')](_0x43f6b6[_0x8807('0x26')]);if(_0x43f6b6[_0x8807('0x27')]){delete _0x43f6b6[_0x8807('0x27')];}_0x4fc2c4['status'](_0x4ee04d)[_0x8807('0x28')](_0x43f6b6);};}exports[_0x8807('0x29')]=function(_0x3d962b,_0x3342b7){var _0x27b91f={},_0x4e2c7b={},_0x4ef8f5={'count':0x0,'rows':[]};var _0x22d384=_[_0x8807('0x2a')](db[_0x8807('0x2b')]['rawAttributes'],function(_0x1cf755){return{'name':_0x1cf755[_0x8807('0x2c')],'type':_0x1cf755[_0x8807('0x2d')][_0x8807('0x2e')]};});_0x4e2c7b[_0x8807('0x2f')]=_[_0x8807('0x2a')](_0x22d384,_0x8807('0x27'));_0x4e2c7b[_0x8807('0x30')]=_['keys'](_0x3d962b[_0x8807('0x30')]);_0x4e2c7b[_0x8807('0x31')]=_['intersection'](_0x4e2c7b['model'],_0x4e2c7b['query']);_0x27b91f['attributes']=_[_0x8807('0x32')](_0x4e2c7b['model'],qs[_0x8807('0x33')](_0x3d962b[_0x8807('0x30')][_0x8807('0x33')]));_0x27b91f[_0x8807('0x34')]=_0x27b91f[_0x8807('0x34')][_0x8807('0x35')]?_0x27b91f[_0x8807('0x34')]:_0x4e2c7b[_0x8807('0x2f')];if(!_0x3d962b['query'][_0x8807('0x36')](_0x8807('0x37'))){_0x27b91f[_0x8807('0x1a')]=qs[_0x8807('0x1a')](_0x3d962b[_0x8807('0x30')][_0x8807('0x1a')]);_0x27b91f[_0x8807('0x19')]=qs[_0x8807('0x19')](_0x3d962b[_0x8807('0x30')][_0x8807('0x19')]);}_0x27b91f[_0x8807('0x38')]=qs[_0x8807('0x39')](_0x3d962b['query'][_0x8807('0x39')]);_0x27b91f['where']=qs['filters'](_['pick'](_0x3d962b[_0x8807('0x30')],_0x4e2c7b[_0x8807('0x31')]),_0x22d384);if(_0x3d962b[_0x8807('0x30')][_0x8807('0x3a')]){_0x27b91f[_0x8807('0x3b')]=_[_0x8807('0x3c')](_0x27b91f[_0x8807('0x3b')],{'$or':_[_0x8807('0x2a')](_0x22d384,function(_0x37975c){if(_0x37975c[_0x8807('0x2d')]!==_0x8807('0x3d')){var _0x49b877={};_0x49b877[_0x37975c[_0x8807('0x27')]]={'$like':'%'+_0x3d962b[_0x8807('0x30')][_0x8807('0x3a')]+'%'};return _0x49b877;}})});}_0x27b91f=_[_0x8807('0x3c')]({},_0x27b91f,_0x3d962b[_0x8807('0x3e')]);var _0x585e4a={'where':_0x27b91f[_0x8807('0x3b')]};return db['ChatTransferReport'][_0x8807('0x1c')](_0x585e4a)['then'](function(_0x477e09){_0x4ef8f5[_0x8807('0x1c')]=_0x477e09;if(_0x3d962b['query'][_0x8807('0x3f')]){_0x27b91f[_0x8807('0x40')]=[{'all':!![]}];}return db[_0x8807('0x2b')][_0x8807('0x41')](_0x27b91f);})[_0x8807('0x22')](function(_0x3b7b61){_0x4ef8f5[_0x8807('0x42')]=_0x3b7b61;return _0x4ef8f5;})['then'](respondWithFilteredResult(_0x3342b7,_0x27b91f))['catch'](handleError(_0x3342b7,null));};exports[_0x8807('0x43')]=function(_0x2608e6,_0x5d8afa){var _0x1986d7={'raw':!![],'where':{'id':_0x2608e6[_0x8807('0x44')]['id']}},_0x2e170d={};_0x2e170d[_0x8807('0x2f')]=_['keys'](db[_0x8807('0x2b')][_0x8807('0x45')]);_0x2e170d['query']=_[_0x8807('0x46')](_0x2608e6[_0x8807('0x30')]);_0x2e170d[_0x8807('0x31')]=_[_0x8807('0x32')](_0x2e170d[_0x8807('0x2f')],_0x2e170d[_0x8807('0x30')]);_0x1986d7[_0x8807('0x34')]=_[_0x8807('0x32')](_0x2e170d[_0x8807('0x2f')],qs[_0x8807('0x33')](_0x2608e6['query'][_0x8807('0x33')]));_0x1986d7[_0x8807('0x34')]=_0x1986d7[_0x8807('0x34')][_0x8807('0x35')]?_0x1986d7['attributes']:_0x2e170d[_0x8807('0x2f')];if(_0x2608e6[_0x8807('0x30')][_0x8807('0x3f')]){_0x1986d7['include']=[{'all':!![]}];}_0x1986d7=_[_0x8807('0x3c')]({},_0x1986d7,_0x2608e6[_0x8807('0x3e')]);return db[_0x8807('0x2b')][_0x8807('0x47')](_0x1986d7)[_0x8807('0x22')](handleEntityNotFound(_0x5d8afa,null))[_0x8807('0x22')](respondWithResult(_0x5d8afa,null))[_0x8807('0x48')](handleError(_0x5d8afa,null));};exports[_0x8807('0x49')]=function(_0x2801af,_0x2a9d5b){return db[_0x8807('0x2b')][_0x8807('0x49')](_0x2801af[_0x8807('0x4a')],{})[_0x8807('0x22')](respondWithResult(_0x2a9d5b,0xc9))[_0x8807('0x48')](handleError(_0x2a9d5b,null));};exports[_0x8807('0x4b')]=function(_0x2f2f7a,_0x15be91){if(_0x2f2f7a[_0x8807('0x4a')]['id']){delete _0x2f2f7a[_0x8807('0x4a')]['id'];}return db[_0x8807('0x2b')][_0x8807('0x47')]({'where':{'id':_0x2f2f7a[_0x8807('0x44')]['id']}})['then'](handleEntityNotFound(_0x15be91,null))['then'](saveUpdates(_0x2f2f7a[_0x8807('0x4a')],null))[_0x8807('0x22')](respondWithResult(_0x15be91,null))[_0x8807('0x48')](handleError(_0x15be91,null));};exports[_0x8807('0x23')]=function(_0x431d6e,_0x386021){return db['ChatTransferReport'][_0x8807('0x47')]({'where':{'id':_0x431d6e[_0x8807('0x44')]['id']}})[_0x8807('0x22')](handleEntityNotFound(_0x386021,null))[_0x8807('0x22')](removeEntity(_0x386021,null))[_0x8807('0x48')](handleError(_0x386021,null));};exports['describe']=function(_0xacf03a,_0x393b16){return db['ChatTransferReport'][_0x8807('0x4c')]()[_0x8807('0x22')](respondWithResult(_0x393b16,null))[_0x8807('0x48')](handleError(_0x393b16,null));};
\ No newline at end of file
+var _0xc71c=['stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xc71c,0x149));var _0xcc71=function(_0x2277cf,_0x420f63){_0x2277cf=_0x2277cf-0x0;var _0x2a0e2f=_0xc71c[_0x2277cf];return _0x2a0e2f;};'use strict';var emlformat=require(_0xcc71('0x0'));var rimraf=require(_0xcc71('0x1'));var zipdir=require(_0xcc71('0x2'));var jsonpatch=require(_0xcc71('0x3'));var rp=require(_0xcc71('0x4'));var moment=require(_0xcc71('0x5'));var BPromise=require(_0xcc71('0x6'));var Mustache=require(_0xcc71('0x7'));var util=require('util');var path=require(_0xcc71('0x8'));var sox=require(_0xcc71('0x9'));var csv=require('to-csv');var ejs=require(_0xcc71('0xa'));var fs=require('fs');var fs_extra=require(_0xcc71('0xb'));var _=require(_0xcc71('0xc'));var squel=require(_0xcc71('0xd'));var crypto=require(_0xcc71('0xe'));var jsforce=require(_0xcc71('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcc71('0x10'));var querystring=require('querystring');var Papa=require(_0xcc71('0x11'));var Redis=require(_0xcc71('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc71('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc71('0x14'))(_0xcc71('0x15'));var utils=require(_0xcc71('0x16'));var config=require(_0xcc71('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc71('0x18'))['db'];function respondWithStatusCode(_0x57dbb3,_0x13b56d){_0x13b56d=_0x13b56d||0xcc;return function(_0x4e51ad){if(_0x4e51ad){return _0x57dbb3[_0xcc71('0x19')](_0x13b56d);}return _0x57dbb3[_0xcc71('0x1a')](_0x13b56d)[_0xcc71('0x1b')]();};}function respondWithResult(_0x2a09c6,_0xc3ec5a){_0xc3ec5a=_0xc3ec5a||0xc8;return function(_0x4b2588){if(_0x4b2588){return _0x2a09c6[_0xcc71('0x1a')](_0xc3ec5a)['json'](_0x4b2588);}};}function respondWithFilteredResult(_0x216642,_0x4df5e8){return function(_0x11d25b){if(_0x11d25b){var _0x53b8fb=typeof _0x4df5e8[_0xcc71('0x1c')]===_0xcc71('0x1d')&&typeof _0x4df5e8[_0xcc71('0x1e')]===_0xcc71('0x1d');var _0x40c71f=_0x11d25b[_0xcc71('0x1f')];var _0x43a1b4=_0x53b8fb?0x0:_0x4df5e8[_0xcc71('0x1c')];var _0x2996e5=_0x53b8fb?_0x11d25b[_0xcc71('0x1f')]:_0x4df5e8[_0xcc71('0x1c')]+_0x4df5e8['limit'];var _0x3da3bf;if(_0x2996e5>=_0x40c71f){_0x2996e5=_0x40c71f;_0x3da3bf=0xc8;}else{_0x3da3bf=0xce;}_0x216642[_0xcc71('0x1a')](_0x3da3bf);return _0x216642[_0xcc71('0x20')](_0xcc71('0x21'),_0x43a1b4+'-'+_0x2996e5+'/'+_0x40c71f)[_0xcc71('0x22')](_0x11d25b);}return null;};}function patchUpdates(_0x581819){return function(_0x294e17){try{jsonpatch[_0xcc71('0x23')](_0x294e17,_0x581819,!![]);}catch(_0x1ead7b){return BPromise[_0xcc71('0x24')](_0x1ead7b);}return _0x294e17[_0xcc71('0x25')]();};}function saveUpdates(_0x21ea20,_0x5440b1){return function(_0x41c716){if(_0x41c716){return _0x41c716[_0xcc71('0x26')](_0x21ea20)[_0xcc71('0x27')](function(_0x534608){return _0x534608;});}return null;};}function removeEntity(_0x3f87bd,_0x328351){return function(_0x4fd76b){if(_0x4fd76b){return _0x4fd76b[_0xcc71('0x28')]()[_0xcc71('0x27')](function(){_0x3f87bd[_0xcc71('0x1a')](0xcc)[_0xcc71('0x1b')]();});}};}function handleEntityNotFound(_0x4b2b5a,_0x4bd3fd){return function(_0x316d8a){if(!_0x316d8a){_0x4b2b5a[_0xcc71('0x19')](0x194);}return _0x316d8a;};}function handleError(_0x1dec0b,_0x3fa1ca){_0x3fa1ca=_0x3fa1ca||0x1f4;return function(_0x28323b){logger['error'](_0x28323b[_0xcc71('0x29')]);if(_0x28323b[_0xcc71('0x2a')]){delete _0x28323b[_0xcc71('0x2a')];}_0x1dec0b[_0xcc71('0x1a')](_0x3fa1ca)[_0xcc71('0x2b')](_0x28323b);};}exports[_0xcc71('0x2c')]=function(_0x2ef389,_0x1ae9ab){var _0x56aab0={},_0x53d015={},_0x430cf4={'count':0x0,'rows':[]};var _0x4ab16c=_[_0xcc71('0x2d')](db[_0xcc71('0x2e')][_0xcc71('0x2f')],function(_0x4056f4){return{'name':_0x4056f4[_0xcc71('0x30')],'type':_0x4056f4[_0xcc71('0x31')]['key']};});_0x53d015[_0xcc71('0x32')]=_[_0xcc71('0x2d')](_0x4ab16c,'name');_0x53d015[_0xcc71('0x33')]=_[_0xcc71('0x34')](_0x2ef389[_0xcc71('0x33')]);_0x53d015[_0xcc71('0x35')]=_[_0xcc71('0x36')](_0x53d015[_0xcc71('0x32')],_0x53d015[_0xcc71('0x33')]);_0x56aab0[_0xcc71('0x37')]=_['intersection'](_0x53d015[_0xcc71('0x32')],qs[_0xcc71('0x38')](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x38')]));_0x56aab0[_0xcc71('0x37')]=_0x56aab0['attributes'][_0xcc71('0x39')]?_0x56aab0[_0xcc71('0x37')]:_0x53d015[_0xcc71('0x32')];if(!_0x2ef389[_0xcc71('0x33')][_0xcc71('0x3a')]('nolimit')){_0x56aab0['limit']=qs['limit'](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x1e')]);_0x56aab0['offset']=qs['offset'](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x1c')]);}_0x56aab0['order']=qs['sort'](_0x2ef389[_0xcc71('0x33')][_0xcc71('0x3b')]);_0x56aab0[_0xcc71('0x3c')]=qs[_0xcc71('0x35')](_[_0xcc71('0x3d')](_0x2ef389['query'],_0x53d015[_0xcc71('0x35')]),_0x4ab16c);if(_0x2ef389[_0xcc71('0x33')]['filter']){_0x56aab0[_0xcc71('0x3c')]=_[_0xcc71('0x3e')](_0x56aab0['where'],{'$or':_['map'](_0x4ab16c,function(_0x2742f5){if(_0x2742f5['type']!=='VIRTUAL'){var _0x13c122={};_0x13c122[_0x2742f5[_0xcc71('0x2a')]]={'$like':'%'+_0x2ef389[_0xcc71('0x33')][_0xcc71('0x3f')]+'%'};return _0x13c122;}})});}_0x56aab0=_[_0xcc71('0x3e')]({},_0x56aab0,_0x2ef389[_0xcc71('0x40')]);var _0x3f3d9f={'where':_0x56aab0['where']};return db['ChatTransferReport'][_0xcc71('0x1f')](_0x3f3d9f)[_0xcc71('0x27')](function(_0x58a108){_0x430cf4[_0xcc71('0x1f')]=_0x58a108;if(_0x2ef389[_0xcc71('0x33')]['includeAll']){_0x56aab0['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xcc71('0x41')](_0x56aab0);})[_0xcc71('0x27')](function(_0x4cd7a8){_0x430cf4[_0xcc71('0x42')]=_0x4cd7a8;return _0x430cf4;})['then'](respondWithFilteredResult(_0x1ae9ab,_0x56aab0))[_0xcc71('0x43')](handleError(_0x1ae9ab,null));};exports[_0xcc71('0x44')]=function(_0x6d763c,_0x2e2b3b){var _0x286f15={'raw':!![],'where':{'id':_0x6d763c[_0xcc71('0x45')]['id']}},_0x38de8e={};_0x38de8e['model']=_['keys'](db[_0xcc71('0x2e')][_0xcc71('0x2f')]);_0x38de8e[_0xcc71('0x33')]=_[_0xcc71('0x34')](_0x6d763c['query']);_0x38de8e['filters']=_['intersection'](_0x38de8e['model'],_0x38de8e[_0xcc71('0x33')]);_0x286f15[_0xcc71('0x37')]=_[_0xcc71('0x36')](_0x38de8e[_0xcc71('0x32')],qs[_0xcc71('0x38')](_0x6d763c['query']['fields']));_0x286f15[_0xcc71('0x37')]=_0x286f15[_0xcc71('0x37')][_0xcc71('0x39')]?_0x286f15[_0xcc71('0x37')]:_0x38de8e['model'];if(_0x6d763c[_0xcc71('0x33')]['includeAll']){_0x286f15[_0xcc71('0x46')]=[{'all':!![]}];}_0x286f15=_[_0xcc71('0x3e')]({},_0x286f15,_0x6d763c[_0xcc71('0x40')]);return db['ChatTransferReport'][_0xcc71('0x47')](_0x286f15)[_0xcc71('0x27')](handleEntityNotFound(_0x2e2b3b,null))[_0xcc71('0x27')](respondWithResult(_0x2e2b3b,null))[_0xcc71('0x43')](handleError(_0x2e2b3b,null));};exports[_0xcc71('0x48')]=function(_0x5143c7,_0x24bf55){return db[_0xcc71('0x2e')][_0xcc71('0x48')](_0x5143c7[_0xcc71('0x49')],{})['then'](respondWithResult(_0x24bf55,0xc9))[_0xcc71('0x43')](handleError(_0x24bf55,null));};exports[_0xcc71('0x26')]=function(_0x186a70,_0x342dbd){if(_0x186a70['body']['id']){delete _0x186a70[_0xcc71('0x49')]['id'];}return db['ChatTransferReport'][_0xcc71('0x47')]({'where':{'id':_0x186a70[_0xcc71('0x45')]['id']}})[_0xcc71('0x27')](handleEntityNotFound(_0x342dbd,null))['then'](saveUpdates(_0x186a70[_0xcc71('0x49')],null))[_0xcc71('0x27')](respondWithResult(_0x342dbd,null))['catch'](handleError(_0x342dbd,null));};exports[_0xcc71('0x28')]=function(_0x52d925,_0x5e8721){return db['ChatTransferReport'][_0xcc71('0x47')]({'where':{'id':_0x52d925[_0xcc71('0x45')]['id']}})[_0xcc71('0x27')](handleEntityNotFound(_0x5e8721,null))[_0xcc71('0x27')](removeEntity(_0x5e8721,null))[_0xcc71('0x43')](handleError(_0x5e8721,null));};exports['describe']=function(_0x73ccda,_0xbfc431){return db[_0xcc71('0x2e')]['describe']()[_0xcc71('0x27')](respondWithResult(_0xbfc431,null))['catch'](handleError(_0xbfc431,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 9def64a..575f51a 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 _0xd57d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','lodash','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd57d,0x1d1));var _0xdd57=function(_0x72df7d,_0x3596a8){_0x72df7d=_0x72df7d-0x0;var _0x3afe81=_0xd57d[_0x72df7d];return _0x3afe81;};'use strict';var _=require(_0xdd57('0x0'));var util=require('util');var logger=require(_0xdd57('0x1'))('api');var moment=require(_0xdd57('0x2'));var BPromise=require(_0xdd57('0x3'));var rp=require(_0xdd57('0x4'));var fs=require('fs');var path=require(_0xdd57('0x5'));var rimraf=require(_0xdd57('0x6'));var config=require(_0xdd57('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xdd57('0x8')]=function(_0x435b75,_0xef034c){return _0x435b75[_0xdd57('0x9')](_0xdd57('0xa'),attributes,{'tableName':_0xdd57('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf85=['rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','bluebird','path'];(function(_0x75bdf5,_0x51906f){var _0x8f5989=function(_0x4e9861){while(--_0x4e9861){_0x75bdf5['push'](_0x75bdf5['shift']());}};_0x8f5989(++_0x51906f);}(_0xcf85,0x127));var _0x5cf8=function(_0x8c6164,_0x1dc7db){_0x8c6164=_0x8c6164-0x0;var _0x1ca172=_0xcf85[_0x8c6164];return _0x1ca172;};'use strict';var _=require('lodash');var util=require(_0x5cf8('0x0'));var logger=require(_0x5cf8('0x1'))(_0x5cf8('0x2'));var moment=require('moment');var BPromise=require(_0x5cf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cf8('0x4'));var rimraf=require(_0x5cf8('0x5'));var config=require(_0x5cf8('0x6'));var attributes=require(_0x5cf8('0x7'));module['exports']=function(_0x56e76a,_0x123023){return _0x56e76a[_0x5cf8('0x8')](_0x5cf8('0x9'),attributes,{'tableName':_0x5cf8('0xa'),'paranoid':![],'indexes':[{'name':_0x5cf8('0xb'),'fields':[_0x5cf8('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 383a11e..fa4867c 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 _0x2971=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x2971,0x17b));var _0x1297=function(_0x2bd0ef,_0x1c51a1){_0x2bd0ef=_0x2bd0ef-0x0;var _0x6c9dc0=_0x2971[_0x2bd0ef];return _0x6c9dc0;};'use strict';var _=require(_0x1297('0x0'));var util=require('util');var moment=require(_0x1297('0x1'));var BPromise=require(_0x1297('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1297('0x3'));var db=require(_0x1297('0x4'))['db'];var utils=require(_0x1297('0x5'));var logger=require(_0x1297('0x6'))(_0x1297('0x7'));var config=require(_0x1297('0x8'));var jayson=require(_0x1297('0x9'));var client=jayson['client'][_0x1297('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29238e,_0xd50ab7,_0x553108){return new BPromise(function(_0x47faee,_0x21c13a){return client[_0x1297('0xb')](_0x29238e,_0x553108)[_0x1297('0xc')](function(_0x473c68){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xd50ab7,_0x1297('0xd'));logger[_0x1297('0xe')](_0x1297('0xf'),_0xd50ab7,_0x1297('0xd'),JSON[_0x1297('0x10')](_0x473c68));if(_0x473c68[_0x1297('0x11')]){if(_0x473c68['error'][_0x1297('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xd50ab7,_0x473c68[_0x1297('0x11')][_0x1297('0x13')]);return _0x21c13a(_0x473c68[_0x1297('0x11')][_0x1297('0x13')]);}logger[_0x1297('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0xd50ab7,_0x473c68[_0x1297('0x11')][_0x1297('0x13')]);return _0x47faee(_0x473c68['error']['message']);}else{logger[_0x1297('0x14')](_0x1297('0x15'),_0xd50ab7,_0x1297('0xd'));_0x47faee(_0x473c68[_0x1297('0x16')][_0x1297('0x13')]);}})[_0x1297('0x17')](function(_0x538eef){logger[_0x1297('0x11')](_0x1297('0x15'),_0xd50ab7,_0x538eef);_0x21c13a(_0x538eef);});});}
\ No newline at end of file
+var _0x4815=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4815,0xb5));var _0x5481=function(_0x29de0d,_0x24b4f8){_0x29de0d=_0x29de0d-0x0;var _0x4b7265=_0x4815[_0x29de0d];return _0x4b7265;};'use strict';var _=require(_0x5481('0x0'));var util=require(_0x5481('0x1'));var moment=require(_0x5481('0x2'));var BPromise=require(_0x5481('0x3'));var rs=require(_0x5481('0x4'));var fs=require('fs');var Redis=require(_0x5481('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5481('0x6'));var logger=require(_0x5481('0x7'))(_0x5481('0x8'));var config=require(_0x5481('0x9'));var jayson=require(_0x5481('0xa'));var client=jayson[_0x5481('0xb')][_0x5481('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x283eec,_0x2ae4ab,_0x27c6aa){return new BPromise(function(_0x4c4662,_0x894d8a){return client[_0x5481('0xd')](_0x283eec,_0x27c6aa)[_0x5481('0xe')](function(_0x37a03b){logger['info'](_0x5481('0xf'),_0x2ae4ab,_0x5481('0x10'));logger[_0x5481('0x11')](_0x5481('0x12'),_0x2ae4ab,_0x5481('0x10'),JSON[_0x5481('0x13')](_0x37a03b));if(_0x37a03b[_0x5481('0x14')]){if(_0x37a03b['error']['code']===0x1f4){logger[_0x5481('0x14')](_0x5481('0xf'),_0x2ae4ab,_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);return _0x894d8a(_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);}logger[_0x5481('0x14')](_0x5481('0xf'),_0x2ae4ab,_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);return _0x4c4662(_0x37a03b[_0x5481('0x14')][_0x5481('0x15')]);}else{logger[_0x5481('0x16')]('ChatTransferReport,\x20%s,\x20%s',_0x2ae4ab,_0x5481('0x10'));_0x4c4662(_0x37a03b[_0x5481('0x17')]['message']);}})[_0x5481('0x18')](function(_0x3e3d6a){logger[_0x5481('0x14')](_0x5481('0xf'),_0x2ae4ab,_0x3e3d6a);_0x894d8a(_0x3e3d6a);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ee3bddc..ccf6e4d 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 _0x3ced=['/:id','show','post','create','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x332bba,_0x5616ba){var _0x40747e=function(_0x450966){while(--_0x450966){_0x332bba['push'](_0x332bba['shift']());}};_0x40747e(++_0x5616ba);}(_0x3ced,0xf6));var _0xd3ce=function(_0x1c1d5d,_0x6e807e){_0x1c1d5d=_0x1c1d5d-0x0;var _0x3a7d23=_0x3ced[_0x1c1d5d];return _0x3a7d23;};'use strict';var multer=require('multer');var util=require(_0xd3ce('0x0'));var path=require(_0xd3ce('0x1'));var timeout=require('connect-timeout');var express=require(_0xd3ce('0x2'));var router=express[_0xd3ce('0x3')]();var fs_extra=require(_0xd3ce('0x4'));var auth=require(_0xd3ce('0x5'));var interaction=require(_0xd3ce('0x6'));var config=require(_0xd3ce('0x7'));var controller=require(_0xd3ce('0x8'));router[_0xd3ce('0x9')]('/',auth[_0xd3ce('0xa')](),controller[_0xd3ce('0xb')]);router[_0xd3ce('0x9')](_0xd3ce('0xc'),auth[_0xd3ce('0xa')](),controller[_0xd3ce('0xd')]);router[_0xd3ce('0x9')](_0xd3ce('0xe'),auth['isAuthenticated'](),controller[_0xd3ce('0xf')]);router[_0xd3ce('0x10')]('/',auth[_0xd3ce('0xa')](),controller[_0xd3ce('0x11')]);router['put']('/:id',auth[_0xd3ce('0xa')](),controller['update']);router[_0xd3ce('0x12')](_0xd3ce('0xe'),auth[_0xd3ce('0xa')](),controller['destroy']);module[_0xd3ce('0x13')]=router;
\ No newline at end of file
+var _0xe262=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','util'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0xe262,0xfb));var _0x2e26=function(_0x5a4f11,_0x46219f){_0x5a4f11=_0x5a4f11-0x0;var _0x32decf=_0xe262[_0x5a4f11];return _0x32decf;};'use strict';var multer=require('multer');var util=require(_0x2e26('0x0'));var path=require('path');var timeout=require(_0x2e26('0x1'));var express=require(_0x2e26('0x2'));var router=express[_0x2e26('0x3')]();var fs_extra=require(_0x2e26('0x4'));var auth=require(_0x2e26('0x5'));var interaction=require(_0x2e26('0x6'));var config=require(_0x2e26('0x7'));var controller=require(_0x2e26('0x8'));router[_0x2e26('0x9')]('/',auth[_0x2e26('0xa')](),controller[_0x2e26('0xb')]);router[_0x2e26('0x9')](_0x2e26('0xc'),auth[_0x2e26('0xa')](),controller[_0x2e26('0xd')]);router['get'](_0x2e26('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2e26('0xf')]);router[_0x2e26('0x10')](_0x2e26('0xe'),auth[_0x2e26('0xa')](),controller[_0x2e26('0x11')]);router[_0x2e26('0x12')]('/:id',auth[_0x2e26('0xa')](),controller[_0x2e26('0x13')]);module[_0x2e26('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8650214..65588f7 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 _0x5b02=['Feedback','star','thumb','stringify','name','text','input','parse','getDataValue','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','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','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip'];(function(_0x3e9e1b,_0x2f76f){var _0xaab638=function(_0x39db24){while(--_0x39db24){_0x3e9e1b['push'](_0x3e9e1b['shift']());}};_0xaab638(++_0x2f76f);}(_0x5b02,0xe9));var _0x25b0=function(_0x1e106e,_0x9f8e20){_0x1e106e=_0x1e106e-0x0;var _0x4c6aab=_0x5b02[_0x1e106e];return _0x4c6aab;};'use strict';var Sequelize=require(_0x25b0('0x0'));var rs=require(_0x25b0('0x1'));module[_0x25b0('0x2')]={'name':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x25b0('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x4')},'mapKeyOffline':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x4')},'key':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x25b0('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':_0x25b0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x25b0('0x3')]},'animation':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x25b0('0x7')](_0x25b0('0x8'),_0x25b0('0x9')),'defaultValue':_0x25b0('0x8')},'header_online':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xa')},'start_chat_button':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xb')},'offline_chat_button':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xc')},'header_offline':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xd')},'download_transcript':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x25b0('0x10')]},'closingQuestion':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x12')},'noteTitle':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x13')},'placeholderMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x14')},'closingMessageButton':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xc')},'skipMessageButton':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x16')},'ratingType':{'type':Sequelize[_0x25b0('0x7')](_0x25b0('0x17'),_0x25b0('0x18')),'defaultValue':_0x25b0('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':function(){return JSON[_0x25b0('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x25b0('0x1a'),'type':_0x25b0('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x25b0('0x1c'),'props':{'title':_0x25b0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x25b0('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x25b0('0x1d')](this[_0x25b0('0x1e')](_0x25b0('0x1f'))):{};},'set':function(_0x24f847){return this[_0x25b0('0x20')](_0x25b0('0x1f'),JSON[_0x25b0('0x19')](_0x24f847));}},'offlineForm':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':function(){return JSON[_0x25b0('0x19')]({'items':[{'type':'input','props':{'title':_0x25b0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x25b0('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x25b0('0x21'),'helpText':_0x25b0('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x25b0('0x1e')](_0x25b0('0x23'))?JSON[_0x25b0('0x1d')](this[_0x25b0('0x1e')](_0x25b0('0x23'))):{};},'set':function(_0x227287){return this[_0x25b0('0x20')](_0x25b0('0x23'),JSON[_0x25b0('0x19')](_0x227287));}},'token':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':function(){return rs[_0x25b0('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x25b0('0x3')]},'waitingTitle':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x25')},'waitingMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x27')},'offlineMessageBody':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x25b0('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x25b0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':function(){return _0x25b0('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x2a')},'verticalAlignment':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x2c')},'defaultTitle':{'type':Sequelize[_0x25b0('0x3')]},'customerAvatar':{'type':Sequelize[_0x25b0('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':_0x25b0('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x25b0('0xe')],'comment':_0x25b0('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x9c6ab4){if(!_0x9c6ab4)this['setDataValue'](_0x25b0('0x2f'),null);this[_0x25b0('0x20')](_0x25b0('0x30'),_0x9c6ab4);}},'vidaooEscalation':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x25b0('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x25b0('0x31')},'vidaooNote':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':function(){return _0x25b0('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x4d97dc,_0x3fbd7e){var _0x5dcd11=function(_0x28a0d0){while(--_0x28a0d0){_0x4d97dc['push'](_0x4d97dc['shift']());}};_0x5dcd11(++_0x3fbd7e);}(_0xee5b,0x1f4));var _0xbee5=function(_0x111744,_0x27e2b1){_0x111744=_0x111744-0x0;var _0x9e2a71=_0xee5b[_0x111744];return _0x9e2a71;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index a5cbe46..0ee548e 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 _0xe7bd=['CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','offline-chat','remove','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','true','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','connection','remoteAddress','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','stack','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','ejs','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','offset','undefined','limit','count','Content-Range','update','then','get','ChatWebsites','UserProfileResource','destroy','end','sendStatus','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','Pause','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','file','addAvatar','agentAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','root','sitepic','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat'];(function(_0x5a4d74,_0x5dbcbd){var _0x57c048=function(_0x5c1804){while(--_0x5c1804){_0x5a4d74['push'](_0x5a4d74['shift']());}};_0x57c048(++_0x5dbcbd);}(_0xe7bd,0x1ce));var _0xde7b=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0xe7bd[_0x422be2];return _0x1b820e;};'use strict';var BPromise=require(_0xde7b('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0xde7b('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde7b('0x2'));var querystring=require(_0xde7b('0x3'));var Redis=require(_0xde7b('0x4'));var qs=require(_0xde7b('0x5'));var logger=require('../../config/logger')(_0xde7b('0x6'));var config=require(_0xde7b('0x7'));var db=require(_0xde7b('0x8'))['db'];config['redis']=_[_0xde7b('0x9')](config[_0xde7b('0xa')],{'host':_0xde7b('0xb'),'port':0x18eb});var socket=require(_0xde7b('0xc'))(new Redis(config[_0xde7b('0xa')]));require(_0xde7b('0xd'))[_0xde7b('0xe')](socket);var htmlToText=require(_0xde7b('0xf'));var jayson=require(_0xde7b('0x10'));var client=jayson[_0xde7b('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xde7b('0x11')]['http']({'port':0x232a});var client9003=jayson[_0xde7b('0x11')][_0xde7b('0x12')]({'port':0x232b});var client9001=jayson[_0xde7b('0x11')][_0xde7b('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x55a55c,_0xb8834c,_0x36bda5,_0x443001){return new BPromise(function(_0x1cdacc,_0x36a352){var _0x1124b9=_0x443001||client;return _0x1124b9[_0xde7b('0x13')](_0x55a55c,_0x36bda5)['then'](function(_0x27f258){logger[_0xde7b('0x14')](_0xde7b('0x15'),_0xb8834c,_0xde7b('0x16'));logger['debug'](_0xde7b('0x17'),_0xb8834c,_0xde7b('0x16'),JSON[_0xde7b('0x18')](_0x27f258));if(_0x27f258[_0xde7b('0x19')]){if(_0x27f258[_0xde7b('0x19')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xb8834c,_0x27f258[_0xde7b('0x19')][_0xde7b('0x1a')]);return _0x36a352(_0x27f258['error'][_0xde7b('0x1a')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0xb8834c,_0x27f258[_0xde7b('0x19')][_0xde7b('0x1a')]);return _0x1cdacc(_0x27f258[_0xde7b('0x19')][_0xde7b('0x1a')]);}else{logger[_0xde7b('0x14')]('ChatWebsite,\x20%s,\x20%s',_0xb8834c,_0xde7b('0x16'));_0x1cdacc(_0x27f258[_0xde7b('0x1b')][_0xde7b('0x1a')]);}})['catch'](function(_0x5206f2){logger['error'](_0xde7b('0x15'),_0xb8834c,_0x5206f2);_0x36a352(_0x5206f2);});});}function respondWithStatusCode(_0x81d69e,_0x339b30){_0x339b30=_0x339b30||0xcc;return function(_0x11d20b){if(_0x11d20b){return _0x81d69e['sendStatus'](_0x339b30);}return _0x81d69e[_0xde7b('0x1c')](_0x339b30)['end']();};}function respondWithResult(_0x780a54,_0x5ab188){_0x5ab188=_0x5ab188||0xc8;return function(_0x59082e){if(_0x59082e){return _0x780a54[_0xde7b('0x1c')](_0x5ab188)[_0xde7b('0x1d')](_0x59082e);}};}function respondWithFilteredResult(_0x395a3a,_0x45655e){return function(_0x587cb1){if(_0x587cb1){var _0x6e691a=typeof _0x45655e[_0xde7b('0x1e')]===_0xde7b('0x1f')&&typeof _0x45655e[_0xde7b('0x20')]==='undefined';var _0xb22709=_0x587cb1[_0xde7b('0x21')];var _0x16118b=_0x6e691a?0x0:_0x45655e[_0xde7b('0x1e')];var _0x29a3ba=_0x6e691a?_0x587cb1[_0xde7b('0x21')]:_0x45655e[_0xde7b('0x1e')]+_0x45655e[_0xde7b('0x20')];var _0x1b8f77;if(_0x29a3ba>=_0xb22709){_0x29a3ba=_0xb22709;_0x1b8f77=0xc8;}else{_0x1b8f77=0xce;}_0x395a3a['status'](_0x1b8f77);return _0x395a3a['set'](_0xde7b('0x22'),_0x16118b+'-'+_0x29a3ba+'/'+_0xb22709)['json'](_0x587cb1);}return null;};}function saveUpdates(_0x32a017){return function(_0x2253de){if(_0x2253de){return _0x2253de[_0xde7b('0x23')](_0x32a017)[_0xde7b('0x24')](function(_0x4ecb6b){return _0x4ecb6b;});}return null;};}function removeEntity(_0x3edf5b){return function(_0x270672){if(_0x270672){return _0x270672['destroy']()['then'](function(){var _0x4a0f11=_0x270672[_0xde7b('0x25')]({'plain':!![]});var _0x2acd53=_0xde7b('0x26');return db[_0xde7b('0x27')][_0xde7b('0x28')]({'where':{'type':_0x2acd53,'resourceId':_0x4a0f11['id']}})[_0xde7b('0x24')](function(){return _0x270672;});})['then'](function(){_0x3edf5b['status'](0xcc)[_0xde7b('0x29')]();});}};}function handleEntityNotFound(_0x10047d){return function(_0x245a4c){if(!_0x245a4c){_0x10047d[_0xde7b('0x2a')](0x194);}return _0x245a4c;};}function handleError(_0x5bdbe8,_0x482a48){_0x482a48=_0x482a48||0x1f4;return function(_0x40eaf5){logger[_0xde7b('0x19')](_0x40eaf5['stack']);if(_0x40eaf5[_0xde7b('0x2b')]){delete _0x40eaf5['name'];}_0x5bdbe8['status'](_0x482a48)[_0xde7b('0x2c')](_0x40eaf5);};}exports['index']=function(_0x2c003b,_0x2bc1a5){var _0x466f21={'include':[{'model':db['Pause'],'as':_0xde7b('0x2d')}]},_0x460699={},_0x82eca0={'count':0x0,'rows':[]};var _0x33ca7a=_[_0xde7b('0x2e')](db[_0xde7b('0x2f')][_0xde7b('0x30')],function(_0x15afee){return{'name':_0x15afee['fieldName'],'type':_0x15afee[_0xde7b('0x31')]['key']};});_0x460699[_0xde7b('0x32')]=_[_0xde7b('0x2e')](_0x33ca7a,'name');_0x460699[_0xde7b('0x33')]=_[_0xde7b('0x34')](_0x2c003b[_0xde7b('0x33')]);_0x460699['filters']=_[_0xde7b('0x35')](_0x460699[_0xde7b('0x32')],_0x460699[_0xde7b('0x33')]);_0x466f21['attributes']=_[_0xde7b('0x35')](_0x460699[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0x2c003b['query'][_0xde7b('0x36')]));_0x466f21[_0xde7b('0x37')]=_0x466f21[_0xde7b('0x37')][_0xde7b('0x38')]?_0x466f21[_0xde7b('0x37')]:_0x460699[_0xde7b('0x32')];if(!_0x2c003b[_0xde7b('0x33')][_0xde7b('0x39')]('nolimit')){_0x466f21[_0xde7b('0x20')]=qs[_0xde7b('0x20')](_0x2c003b[_0xde7b('0x33')][_0xde7b('0x20')]);_0x466f21[_0xde7b('0x1e')]=qs['offset'](_0x2c003b['query']['offset']);}_0x466f21[_0xde7b('0x3a')]=qs['sort'](_0x2c003b[_0xde7b('0x33')][_0xde7b('0x3b')]);_0x466f21[_0xde7b('0x3c')]=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0x2c003b[_0xde7b('0x33')],_0x460699[_0xde7b('0x3d')]),_0x33ca7a);if(_0x2c003b[_0xde7b('0x33')][_0xde7b('0x3f')]){_0x466f21[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x466f21[_0xde7b('0x3c')],{'$or':_['map'](_0x33ca7a,function(_0x316096){if(_0x316096['type']!==_0xde7b('0x41')){var _0x4e244c={};_0x4e244c[_0x316096[_0xde7b('0x2b')]]={'$like':'%'+_0x2c003b['query'][_0xde7b('0x3f')]+'%'};return _0x4e244c;}})});}_0x466f21=_['merge']({},_0x466f21,_0x2c003b['options']);var _0x226a0a={'where':_0x466f21[_0xde7b('0x3c')]};return db['ChatWebsite'][_0xde7b('0x21')](_0x226a0a)['then'](function(_0x2ffc57){_0x82eca0[_0xde7b('0x21')]=_0x2ffc57;if(_0x2c003b[_0xde7b('0x33')]['includeAll']){_0x466f21[_0xde7b('0x42')]=[{'all':!![]}];}return db[_0xde7b('0x2f')][_0xde7b('0x43')](_0x466f21);})[_0xde7b('0x24')](function(_0x8976c){_0x82eca0[_0xde7b('0x44')]=_0x8976c;return _0x82eca0;})[_0xde7b('0x24')](respondWithFilteredResult(_0x2bc1a5,_0x466f21))[_0xde7b('0x45')](handleError(_0x2bc1a5,null));};exports[_0xde7b('0x46')]=function(_0x3d3e2f,_0x5214ac){var _0x1d3e53={'raw':![],'where':{'id':_0x3d3e2f['params']['id']},'include':[{'model':db[_0xde7b('0x47')],'as':'mandatoryDispositionPause'}]},_0x140426={};_0x140426['model']=_[_0xde7b('0x34')](db[_0xde7b('0x2f')][_0xde7b('0x30')]);_0x140426[_0xde7b('0x33')]=_[_0xde7b('0x34')](_0x3d3e2f[_0xde7b('0x33')]);_0x140426[_0xde7b('0x3d')]=_[_0xde7b('0x35')](_0x140426['model'],_0x140426['query']);_0x1d3e53[_0xde7b('0x37')]=_[_0xde7b('0x35')](_0x140426[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0x3d3e2f[_0xde7b('0x33')][_0xde7b('0x36')]));_0x1d3e53[_0xde7b('0x37')]=_0x1d3e53[_0xde7b('0x37')][_0xde7b('0x38')]?_0x1d3e53[_0xde7b('0x37')]:_0x140426['model'];if(_0x3d3e2f[_0xde7b('0x33')][_0xde7b('0x48')]){_0x1d3e53[_0xde7b('0x42')]=[{'all':!![]}];}_0x1d3e53=_[_0xde7b('0x40')]({},_0x1d3e53,_0x3d3e2f[_0xde7b('0x49')]);return db[_0xde7b('0x2f')]['find'](_0x1d3e53)['then'](handleEntityNotFound(_0x5214ac,null))[_0xde7b('0x24')](respondWithResult(_0x5214ac,null))[_0xde7b('0x45')](handleError(_0x5214ac,null));};exports[_0xde7b('0x4a')]=function(_0x312b44,_0x3a65de){return db['ChatWebsite'][_0xde7b('0x4a')](_0x312b44[_0xde7b('0x4b')],{})[_0xde7b('0x24')](function(_0x357994){var _0x4cc9f8=_0x312b44[_0xde7b('0x4c')][_0xde7b('0x25')]({'plain':!![]});if(!_0x4cc9f8)throw new Error(_0xde7b('0x4d'));if(_0x4cc9f8[_0xde7b('0x4e')]===_0xde7b('0x4c')){var _0x3463ea=_0x357994[_0xde7b('0x25')]({'plain':!![]});var _0x557a54=_0xde7b('0x26');return db[_0xde7b('0x4f')][_0xde7b('0x50')]({'where':{'name':_0x557a54,'userProfileId':_0x4cc9f8['userProfileId']},'raw':!![]})['then'](function(_0x4d0b1d){if(_0x4d0b1d&&_0x4d0b1d[_0xde7b('0x51')]===0x0){return db['UserProfileResource'][_0xde7b('0x4a')]({'name':_0x3463ea['name'],'resourceId':_0x3463ea['id'],'type':_0x4d0b1d['name'],'sectionId':_0x4d0b1d['id']},{})[_0xde7b('0x24')](function(){return _0x357994;});}else{return _0x357994;}})[_0xde7b('0x45')](function(_0x57bef8){logger[_0xde7b('0x19')](_0xde7b('0x52'),_0x57bef8);throw _0x57bef8;});}return _0x357994;})[_0xde7b('0x24')](respondWithResult(_0x3a65de,0xc9))['catch'](handleError(_0x3a65de,null));};exports[_0xde7b('0x23')]=function(_0xe3a85a,_0x26237f){if(_0xe3a85a[_0xde7b('0x4b')]['id']){delete _0xe3a85a[_0xde7b('0x4b')]['id'];}return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0xe3a85a['params']['id']},'include':[{'model':db[_0xde7b('0x47')],'as':'mandatoryDispositionPause'}]})[_0xde7b('0x24')](handleEntityNotFound(_0x26237f,null))[_0xde7b('0x24')](saveUpdates(_0xe3a85a[_0xde7b('0x4b')],null))[_0xde7b('0x24')](respondWithResult(_0x26237f,null))[_0xde7b('0x45')](handleError(_0x26237f,null));};exports[_0xde7b('0x28')]=function(_0x35455f,_0x23c1fc){return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x35455f[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x23c1fc,null))[_0xde7b('0x24')](removeEntity(_0x23c1fc,null))[_0xde7b('0x45')](handleError(_0x23c1fc,null));};exports['describe']=function(_0x322629,_0xb1189b){return db[_0xde7b('0x2f')][_0xde7b('0x54')]()['then'](respondWithResult(_0xb1189b,null))[_0xde7b('0x45')](handleError(_0xb1189b,null));};exports[_0xde7b('0x55')]=function(_0x5e9795,_0x206aea){if(_0x5e9795[_0xde7b('0x4b')]['id']){delete _0x5e9795[_0xde7b('0x4b')]['id'];}return db['ChatWebsite'][_0xde7b('0x50')]({'where':{'id':_0x5e9795[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x206aea,null))[_0xde7b('0x24')](function(_0x4d0862){if(_0x4d0862){_0x5e9795['body'][_0xde7b('0x56')]=_0x4d0862['id'];return db[_0xde7b('0x57')]['create'](_0x5e9795[_0xde7b('0x4b')]);}})[_0xde7b('0x24')](respondWithResult(_0x206aea,null))['catch'](handleError(_0x206aea,null));};exports['getDispositions']=function(_0xf4ccf6,_0xe8e125){var _0x4847ff={'raw':![],'where':{}};var _0x35bffa={};var _0x33207b={'count':0x0,'rows':[]};return db[_0xde7b('0x2f')]['findOne']({'where':{'id':_0xf4ccf6[_0xde7b('0x53')]['id']}})['then'](handleEntityNotFound(_0xe8e125,null))[_0xde7b('0x24')](function(_0x1e57f7){if(_0x1e57f7){_0x35bffa[_0xde7b('0x32')]=_[_0xde7b('0x34')](db[_0xde7b('0x57')][_0xde7b('0x30')]);_0x35bffa[_0xde7b('0x33')]=_[_0xde7b('0x34')](_0xf4ccf6[_0xde7b('0x33')]);_0x35bffa[_0xde7b('0x3d')]=_['intersection'](_0x35bffa[_0xde7b('0x32')],_0x35bffa['query']);_0x4847ff['attributes']=_[_0xde7b('0x35')](_0x35bffa['model'],qs[_0xde7b('0x36')](_0xf4ccf6['query'][_0xde7b('0x36')]));_0x4847ff['attributes']=_0x4847ff['attributes'][_0xde7b('0x38')]?_0x4847ff[_0xde7b('0x37')]:_0x35bffa[_0xde7b('0x32')];if(!_0xf4ccf6[_0xde7b('0x33')]['hasOwnProperty'](_0xde7b('0x58'))){_0x4847ff[_0xde7b('0x20')]=qs[_0xde7b('0x20')](_0xf4ccf6['query'][_0xde7b('0x20')]);_0x4847ff[_0xde7b('0x1e')]=qs[_0xde7b('0x1e')](_0xf4ccf6['query']['offset']);}_0x4847ff[_0xde7b('0x3a')]=qs[_0xde7b('0x3b')](_0xf4ccf6[_0xde7b('0x33')][_0xde7b('0x3b')]);_0x4847ff['where']=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0xf4ccf6[_0xde7b('0x33')],_0x35bffa['filters']));_0x4847ff[_0xde7b('0x3c')][_0xde7b('0x56')]=_0x1e57f7['id'];if(_0xf4ccf6['query'][_0xde7b('0x3f')]){_0x4847ff[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x4847ff['where'],{'$or':_[_0xde7b('0x2e')](_0x4847ff[_0xde7b('0x37')],function(_0x4f90e3){var _0x5442aa={};_0x5442aa[_0x4f90e3]={'$like':'%'+_0xf4ccf6[_0xde7b('0x33')]['filter']+'%'};return _0x5442aa;})});}_0x4847ff=_[_0xde7b('0x40')]({},_0x4847ff,_0xf4ccf6[_0xde7b('0x49')]);return db[_0xde7b('0x57')][_0xde7b('0x21')]({'where':_0x4847ff[_0xde7b('0x3c')]})[_0xde7b('0x24')](function(_0x12e6e3){_0x33207b[_0xde7b('0x21')]=_0x12e6e3;if(_0xf4ccf6[_0xde7b('0x33')][_0xde7b('0x48')]){_0x4847ff[_0xde7b('0x42')]=[{'all':!![]}];}return db[_0xde7b('0x57')]['findAll'](_0x4847ff);})['then'](function(_0x5d5ac4){_0x33207b[_0xde7b('0x44')]=_0x5d5ac4;return _0x33207b;});}})[_0xde7b('0x24')](respondWithFilteredResult(_0xe8e125,_0x4847ff))['catch'](handleError(_0xe8e125,null));};exports[_0xde7b('0x59')]=function(_0x29053d,_0x1c72fb){return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x29053d[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x1c72fb,null))['then'](function(_0x57be8a){if(_0x57be8a){return _0x57be8a[_0xde7b('0x59')](_0x29053d['query'][_0xde7b('0x5a')]);}})[_0xde7b('0x24')](respondWithStatusCode(_0x1c72fb,null))['catch'](handleError(_0x1c72fb,null));};exports['addAnswer']=function(_0x10ff27,_0x4181dd){if(_0x10ff27['body']['id']){delete _0x10ff27[_0xde7b('0x4b')]['id'];}return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x10ff27['params']['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x4181dd,null))[_0xde7b('0x24')](function(_0x404c79){if(_0x404c79){_0x10ff27[_0xde7b('0x4b')][_0xde7b('0x56')]=_0x404c79['id'];return db[_0xde7b('0x5b')][_0xde7b('0x4a')](_0x10ff27['body']);}})['then'](respondWithResult(_0x4181dd,null))['catch'](handleError(_0x4181dd,null));};exports[_0xde7b('0x5c')]=function(_0x1163f9,_0x224984){var _0x4f5efd={'raw':![],'where':{}};var _0x4302ff={};var _0x1527ed={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xde7b('0x5d')]({'where':{'id':_0x1163f9['params']['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x224984,null))[_0xde7b('0x24')](function(_0x3e3aa9){if(_0x3e3aa9){_0x4302ff[_0xde7b('0x32')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x4302ff['query']=_[_0xde7b('0x34')](_0x1163f9[_0xde7b('0x33')]);_0x4302ff[_0xde7b('0x3d')]=_[_0xde7b('0x35')](_0x4302ff['model'],_0x4302ff[_0xde7b('0x33')]);_0x4f5efd[_0xde7b('0x37')]=_[_0xde7b('0x35')](_0x4302ff[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0x1163f9[_0xde7b('0x33')][_0xde7b('0x36')]));_0x4f5efd['attributes']=_0x4f5efd[_0xde7b('0x37')][_0xde7b('0x38')]?_0x4f5efd[_0xde7b('0x37')]:_0x4302ff[_0xde7b('0x32')];if(!_0x1163f9['query'][_0xde7b('0x39')](_0xde7b('0x58'))){_0x4f5efd[_0xde7b('0x20')]=qs[_0xde7b('0x20')](_0x1163f9[_0xde7b('0x33')][_0xde7b('0x20')]);_0x4f5efd[_0xde7b('0x1e')]=qs[_0xde7b('0x1e')](_0x1163f9['query'][_0xde7b('0x1e')]);}_0x4f5efd[_0xde7b('0x3a')]=qs['sort'](_0x1163f9[_0xde7b('0x33')][_0xde7b('0x3b')]);_0x4f5efd[_0xde7b('0x3c')]=qs['filters'](_[_0xde7b('0x3e')](_0x1163f9[_0xde7b('0x33')],_0x4302ff[_0xde7b('0x3d')]));_0x4f5efd[_0xde7b('0x3c')][_0xde7b('0x56')]=_0x3e3aa9['id'];if(_0x1163f9[_0xde7b('0x33')][_0xde7b('0x3f')]){_0x4f5efd[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x4f5efd['where'],{'$or':_[_0xde7b('0x2e')](_0x4f5efd['attributes'],function(_0xfbc7b2){var _0x5b8a9b={};_0x5b8a9b[_0xfbc7b2]={'$like':'%'+_0x1163f9[_0xde7b('0x33')][_0xde7b('0x3f')]+'%'};return _0x5b8a9b;})});}_0x4f5efd=_['merge']({},_0x4f5efd,_0x1163f9[_0xde7b('0x49')]);return db['CannedAnswer']['count']({'where':_0x4f5efd[_0xde7b('0x3c')]})[_0xde7b('0x24')](function(_0x13b54a){_0x1527ed[_0xde7b('0x21')]=_0x13b54a;if(_0x1163f9[_0xde7b('0x33')][_0xde7b('0x48')]){_0x4f5efd[_0xde7b('0x42')]=[{'all':!![]}];}return db[_0xde7b('0x5b')][_0xde7b('0x43')](_0x4f5efd);})[_0xde7b('0x24')](function(_0x3ec017){_0x1527ed[_0xde7b('0x44')]=_0x3ec017;return _0x1527ed;});}})[_0xde7b('0x24')](respondWithFilteredResult(_0x224984,_0x4f5efd))[_0xde7b('0x45')](handleError(_0x224984,null));};exports[_0xde7b('0x5e')]=function(_0x2ed49b,_0x523a36){return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x2ed49b[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x523a36,null))[_0xde7b('0x24')](function(_0x58c0ea){if(_0x58c0ea){return _0x58c0ea[_0xde7b('0x5e')](_0x2ed49b[_0xde7b('0x33')][_0xde7b('0x5a')]);}})[_0xde7b('0x24')](respondWithStatusCode(_0x523a36,null))[_0xde7b('0x45')](handleError(_0x523a36,null));};exports['addLogo']=function(_0x106722,_0x5577f4){_0x106722[_0xde7b('0x4b')]['sitepic']=_0x106722[_0xde7b('0x5f')]['filename'];return db[_0xde7b('0x2f')]['find']({'where':{'id':_0x106722[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x5577f4,null))[_0xde7b('0x24')](saveUpdates(_0x106722[_0xde7b('0x4b')],null))[_0xde7b('0x24')](respondWithResult(_0x5577f4,null))[_0xde7b('0x45')](handleError(_0x5577f4,null));};exports[_0xde7b('0x60')]=function(_0x5033a7,_0x2bf7b4){_0x5033a7[_0xde7b('0x4b')][_0xde7b('0x61')]=_0x5033a7[_0xde7b('0x5f')]['filename'];return db[_0xde7b('0x2f')]['find']({'where':{'id':_0x5033a7[_0xde7b('0x53')]['id']}})['then'](handleEntityNotFound(_0x2bf7b4,null))[_0xde7b('0x24')](saveUpdates(_0x5033a7[_0xde7b('0x4b')],null))[_0xde7b('0x24')](respondWithResult(_0x2bf7b4,null))[_0xde7b('0x45')](handleError(_0x2bf7b4,null));};exports['addCustomerAvatar']=function(_0x60854c,_0x19e4f9){_0x60854c[_0xde7b('0x4b')][_0xde7b('0x62')]=_0x60854c[_0xde7b('0x5f')][_0xde7b('0x63')];return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x60854c[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x19e4f9,null))['then'](saveUpdates(_0x60854c[_0xde7b('0x4b')],null))['then'](respondWithResult(_0x19e4f9,null))[_0xde7b('0x45')](handleError(_0x19e4f9,null));};exports[_0xde7b('0x64')]=function(_0x1ab3f2,_0xd39d5e){_0x1ab3f2['body'][_0xde7b('0x65')]=_0x1ab3f2[_0xde7b('0x5f')][_0xde7b('0x63')];return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x1ab3f2['params']['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0xd39d5e,null))[_0xde7b('0x24')](saveUpdates(_0x1ab3f2[_0xde7b('0x4b')],null))[_0xde7b('0x24')](respondWithResult(_0xd39d5e,null))['catch'](handleError(_0xd39d5e,null));};exports['getLogo']=function(_0x58607f,_0xd45830){var _0x2ea139=path['join'](config[_0xde7b('0x66')],'server/files/images/logos/default_logo.svg');var _0x35b340={'where':{'id':_0x58607f['params']['id']},'attributes':['id',_0xde7b('0x67')],'raw':!![]};var _0x3597dc=![];return require(_0xde7b('0x68'))[_0xde7b('0x69')]()[_0xde7b('0x24')](function(_0x21b5e8){if(_0x21b5e8){_0x3597dc=_0x21b5e8[_0xde7b('0x6a')];}})['then'](function(){return db[_0xde7b('0x2f')][_0xde7b('0x50')](_0x35b340);})[_0xde7b('0x24')](handleEntityNotFound(_0xd45830,null))[_0xde7b('0x24')](function(_0x44c0e5){if(_0x44c0e5){if(!_[_0xde7b('0x6b')](_0x44c0e5[_0xde7b('0x67')])){if(fs['existsSync'](path[_0xde7b('0x6c')](config['root'],_0xde7b('0x6d'),_0x44c0e5['sitepic']))&&_0x3597dc){_0x2ea139=path[_0xde7b('0x6c')](config[_0xde7b('0x66')],_0xde7b('0x6d'),_0x44c0e5[_0xde7b('0x67')]);}}return _0xd45830[_0xde7b('0x6e')](_0x2ea139);}})[_0xde7b('0x45')](handleError(_0xd45830,null));};exports[_0xde7b('0x6f')]=function(_0x3f2165,_0x28df88){var _0x12a814=path[_0xde7b('0x6c')](config[_0xde7b('0x66')],'server/files/images/avatars/default_avatar.png');var _0x4d89ac={'where':{'id':_0x3f2165[_0xde7b('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xde7b('0x50')](_0x4d89ac)[_0xde7b('0x24')](handleEntityNotFound(_0x28df88,null))[_0xde7b('0x24')](function(_0xa12503){if(_0xa12503){if(!_[_0xde7b('0x6b')](_0xa12503[_0xde7b('0x61')])){if(fs[_0xde7b('0x70')](path[_0xde7b('0x6c')](config['root'],_0xde7b('0x71'),_0xa12503['agentAvatar']))){_0x12a814=path[_0xde7b('0x6c')](config[_0xde7b('0x66')],'server/files/images/avatars/',_0xa12503[_0xde7b('0x61')]);}}return _0x28df88[_0xde7b('0x6e')](_0x12a814);}})['catch'](handleError(_0x28df88,null));};exports[_0xde7b('0x72')]=function(_0x346fbe,_0xd6b219){var _0x106824=path[_0xde7b('0x6c')](config[_0xde7b('0x66')],_0xde7b('0x73'));var _0x3f6fc8={'where':{'id':_0x346fbe[_0xde7b('0x53')]['id']},'attributes':['id',_0xde7b('0x62'),_0xde7b('0x74')],'raw':!![]};return db['ChatWebsite'][_0xde7b('0x50')](_0x3f6fc8)[_0xde7b('0x24')](handleEntityNotFound(_0xd6b219,null))[_0xde7b('0x24')](function(_0x59059b){if(_0x59059b){if(!_[_0xde7b('0x6b')](_0x59059b[_0xde7b('0x62')])){if(fs[_0xde7b('0x70')](path[_0xde7b('0x6c')](config['root'],_0xde7b('0x71'),_0x59059b[_0xde7b('0x62')]))&&_0x59059b['showCustomerAvatar']){_0x106824=path['join'](config[_0xde7b('0x66')],_0xde7b('0x71'),_0x59059b['customerAvatar']);}}return _0xd6b219[_0xde7b('0x6e')](_0x106824);}})[_0xde7b('0x45')](handleError(_0xd6b219,null));};exports[_0xde7b('0x75')]=function(_0x29795d,_0x32aee2){var _0x11c020=path['join'](config[_0xde7b('0x66')],_0xde7b('0x76'));var _0x466bdd={'where':{'id':_0x29795d[_0xde7b('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x466bdd)[_0xde7b('0x24')](handleEntityNotFound(_0x32aee2,null))[_0xde7b('0x24')](function(_0x2b76c6){if(_0x2b76c6){if(!_['isNil'](_0x2b76c6[_0xde7b('0x65')])){if(fs[_0xde7b('0x70')](path[_0xde7b('0x6c')](config[_0xde7b('0x66')],_0xde7b('0x71'),_0x2b76c6[_0xde7b('0x65')]))){_0x11c020=path[_0xde7b('0x6c')](config[_0xde7b('0x66')],_0xde7b('0x71'),_0x2b76c6[_0xde7b('0x65')]);}}return _0x32aee2['download'](_0x11c020);}})['catch'](handleError(_0x32aee2,null));};exports[_0xde7b('0x77')]=function(_0x4cade2,_0x5f22b3){var _0xef1d28=require(_0xde7b('0x78'));var _0x4a169e=new _0xef1d28();var _0x1aed50=_0x4a169e[_0xde7b('0x79')](_0x4cade2[_0xde7b('0x7a')][_0xde7b('0x7b')])[_0xde7b('0x7c')]();var _0x165f31={'body':_0x4cade2[_0xde7b('0x4b')],'channel':_0xde7b('0x7d')};var _0x1a7331=[];var _0x306c6f=[];var _0x383cb0={};var _0x34f142=![];return db[_0xde7b('0x7e')][_0xde7b('0x54')]()[_0xde7b('0x24')](function(_0x53a342){if(!_0x53a342){throw new db[(_0xde7b('0x7f'))][(_0xde7b('0x80'))](_0xde7b('0x81'));}_0x1a7331=_[_0xde7b('0x82')](_['keys'](_0x53a342),[_0xde7b('0x83'),_0xde7b('0x84')]);_0x306c6f=_['difference'](_[_0xde7b('0x34')](_0x53a342),[_0xde7b('0x83'),'updatedAt',_0xde7b('0x85'),_0xde7b('0x86')]);if(_0x4cade2['body']['id']){delete _0x4cade2['body']['id'];}if(_['isNil'](_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x87')])){throw new db['Sequelize']['ValidationError'](_0xde7b('0x88'));}if(_['isNil'](_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x4b')])||_0x4cade2[_0xde7b('0x4b')]['body']===''){throw new db[(_0xde7b('0x7f'))]['ValidationError'](_0xde7b('0x89'));}if(_[_0xde7b('0x6b')](_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x8a')])){throw new db['Sequelize'][(_0xde7b('0x80'))](_0xde7b('0x8b')+_0x306c6f);}if(!_[_0xde7b('0x8c')](_0x306c6f,_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x8a')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x306c6f);}_0x383cb0[_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x8a')]]=_0x4cade2['body'][_0xde7b('0x87')];})[_0xde7b('0x24')](function(){return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x4cade2[_0xde7b('0x53')]['id']},'include':[{'model':db[_0xde7b('0x8d')],'as':_0xde7b('0x8e'),'include':[{'model':db[_0xde7b('0x7e')],'as':_0xde7b('0x8f'),'where':_0x383cb0,'limit':0x1,'order':[[_0xde7b('0x84'),_0xde7b('0x90')]]}]},{'model':db[_0xde7b('0x91')],'as':_0xde7b('0x92')}]});})[_0xde7b('0x24')](handleEntityNotFound(_0x5f22b3,null))['then'](function(_0x15532d){if(_0x15532d&&_0x15532d[_0xde7b('0x8e')]){_0x165f31[_0xde7b('0x93')]=_0x15532d;_0x165f31[_0xde7b('0x94')]=_0x15532d[_0xde7b('0x92')];_0x165f31[_0xde7b('0x95')]=_0x15532d[_0xde7b('0x8e')];_0x165f31[_0xde7b('0x94')]=_['orderBy'](_0x165f31['applications'],[_0xde7b('0x96')],[_0xde7b('0x97')]);if(_0x165f31[_0xde7b('0x93')][_0xde7b('0x92')]){delete _0x165f31['account'][_0xde7b('0x92')];}if(_0x165f31[_0xde7b('0x93')][_0xde7b('0x8e')]&&_0x165f31[_0xde7b('0x93')]['List']['Contacts'][_0xde7b('0x38')]){return _0x165f31[_0xde7b('0x93')][_0xde7b('0x8e')]['Contacts'][0x0];}var _0x7105ae=_['defaults'](_0x4cade2['body'],{'firstName':_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x87')],'ListId':_0x15532d[_0xde7b('0x86')]});_0x7105ae[_0x4cade2['body'][_0xde7b('0x8a')]]=_0x4cade2[_0xde7b('0x4b')]['from'];return db[_0xde7b('0x7e')][_0xde7b('0x4a')](_0x7105ae,{'fields':_0x1a7331,'raw':!![]});}})[_0xde7b('0x24')](handleEntityNotFound(_0x5f22b3,null))[_0xde7b('0x24')](function(_0x427642){_0x165f31[_0xde7b('0x98')]=_0x427642;var _0x28c9f6=_0x4cade2[_0xde7b('0x4b')][_0xde7b('0x99')];if(_0x4cade2[_0xde7b('0x7a')][_0xde7b('0x9a')]){_0x28c9f6=_0x4cade2[_0xde7b('0x7a')]['cf-connecting-ip'];}else if(_0x4cade2[_0xde7b('0x7a')]['x-forwarded-for']){_0x28c9f6=_['first'](_0x4cade2[_0xde7b('0x7a')][_0xde7b('0x9b')][_0xde7b('0x9c')](','));}if(_0x427642){var _0xb6a12b={'ContactId':_0x427642['id'],'ChatWebsiteId':_0x4cade2[_0xde7b('0x53')]['id'],'from':(_0x427642[_0xde7b('0x9d')]||'')+'\x20'+(_0x427642[_0xde7b('0x9e')]||''),'customerIp':_0x28c9f6,'customerPort':_0x4cade2[_0xde7b('0x7a')][_0xde7b('0x9f')]?_0x4cade2['headers'][_0xde7b('0x9f')]:null,'referer':_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xa0')],'browserName':_0x1aed50[_0xde7b('0xa1')][_0xde7b('0x2b')]&&_0x1aed50[_0xde7b('0xa1')]['version']?util[_0xde7b('0xa2')](_0xde7b('0xa3'),_0x1aed50['browser'][_0xde7b('0x2b')],_0x1aed50[_0xde7b('0xa1')][_0xde7b('0xa4')]):'unknown','browserVersion':_0x1aed50['browser'][_0xde7b('0xa4')]||_0xde7b('0xa5'),'osName':util['format'](_0xde7b('0xa3'),_0x1aed50['os'][_0xde7b('0x2b')],_0x1aed50['os'][_0xde7b('0xa4')]),'osVersion':_0x1aed50['os']['version'],'deviceModel':_0x1aed50[_0xde7b('0xa6')][_0xde7b('0x32')]&&_0x1aed50[_0xde7b('0xa6')][_0xde7b('0xa7')]?util['format']('%s\x20%s\x20%s',_0x1aed50[_0xde7b('0xa6')][_0xde7b('0x32')],_0x1aed50[_0xde7b('0xa6')][_0xde7b('0xa7')],_0x1aed50['device'][_0xde7b('0x31')]):null,'deviceVendor':_0x1aed50[_0xde7b('0xa6')][_0xde7b('0xa7')],'deviceType':_0x1aed50['device'][_0xde7b('0x31')],'formData':JSON[_0xde7b('0x18')](_0x4cade2[_0xde7b('0x4b')])};var _0x3956f0={'ChatWebsiteId':_0x4cade2['params']['id'],'closed':![]};if(_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xa8')]){_0x3956f0['threadId']=_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xa8')];return db[_0xde7b('0xa9')][_0xde7b('0x50')]({'where':_0x3956f0})[_0xde7b('0x24')](function(_0x7eb9ac){if(_0x7eb9ac){return[_0x7eb9ac,![]];}_0xb6a12b['threadId']=_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xa8')];_0xb6a12b[_0xde7b('0xaa')]=_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xaa')];return db[_0xde7b('0xa9')][_0xde7b('0x4a')](_0xb6a12b)[_0xde7b('0x24')](function(_0x31f86a){return[_0x31f86a,!![]];});});}_0x3956f0[_0xde7b('0xab')]=_0x427642['id'];if(_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xac')]&&_0x4cade2[_0xde7b('0x4b')]['interaction']['id']){_0x3956f0['id']=_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xac')]['id'];return db['ChatInteraction'][_0xde7b('0x50')]({'where':_0x3956f0})[_0xde7b('0x24')](function(_0x1e6f5f){if(_0x1e6f5f){return[_0x1e6f5f,![]];}return db[_0xde7b('0xa9')][_0xde7b('0x4a')](_0xb6a12b)['then'](function(_0x58efc3){return[_0x58efc3,!![]];});});}return db[_0xde7b('0xa9')][_0xde7b('0x4a')](_0xb6a12b)[_0xde7b('0x24')](function(_0x5617b3){return[_0x5617b3,!![]];});}})[_0xde7b('0xad')](function(_0x1fa09a,_0x12dae6){if(_0x1fa09a){_0x34f142=_0x12dae6;if(!_0x12dae6){var _0x514091={'from':(_0x165f31[_0xde7b('0x98')][_0xde7b('0x9d')]||'')+'\x20'+(_0x165f31['contact'][_0xde7b('0x9e')]||'')};if(_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xa8')]&&_0x4cade2['body'][_0xde7b('0xae')]&&_0x4cade2['body'][_0xde7b('0xa8')]!=_0x4cade2[_0xde7b('0x4b')][_0xde7b('0xae')]){_0x514091[_0xde7b('0xa8')]=_0x4cade2['body'][_0xde7b('0xae')];}return _0x1fa09a['update'](_0x514091);}else{return _0x1fa09a;}}})[_0xde7b('0x24')](function(_0x5f52d6){_0x165f31[_0xde7b('0xac')]=_0x5f52d6[_0xde7b('0x25')]({'plain':!![]});_0x165f31[_0xde7b('0xac')][_0xde7b('0xaf')]=_0x34f142;if(_0x165f31[_0xde7b('0xac')]['created']){if(_0x165f31[_0xde7b('0x93')][_0xde7b('0xb0')]){_0x165f31[_0xde7b('0x94')]['push']({'id':0x0,'priority':_0x165f31['applications'][_0xde7b('0x38')]+0x1,'app':_0xde7b('0xb1'),'appdata':'unmanaged','interval':_0xde7b('0xb2')});}}return db['ChatMessage'][_0xde7b('0x4a')]({'body':_0x4cade2['body']['body'],'ChatWebsiteId':_0x4cade2[_0xde7b('0x53')]['id'],'ChatInteractionId':_0x5f52d6['id'],'direction':'in','ContactId':_0x165f31['contact']['id'],'AttachmentId':_0x4cade2['body'][_0xde7b('0xb3')]});})[_0xde7b('0x24')](function(_0x20ea05){_0x165f31[_0xde7b('0x1a')]=_0x20ea05;if(_0x165f31['interaction'][_0xde7b('0xb4')]){return db[_0xde7b('0xb5')][_0xde7b('0x50')]({'attributes':['id',_0xde7b('0x2b')],'where':{'id':_0x165f31['interaction'][_0xde7b('0xb4')]}})[_0xde7b('0x24')](function(_0xda74a8){if(_0xda74a8){_0x165f31['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xde7b('0xb6'),'appdata':_0xda74a8['name']+','+(_0x165f31[_0xde7b('0x93')][_0xde7b('0xb7')]||0xa),'interval':_0xde7b('0xb2')});_0x165f31[_0xde7b('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xde7b('0xb9'),_0x165f31);});}return respondWithRpcPromise(_0xde7b('0xba'),'startRouting',_0x165f31);})[_0xde7b('0x24')](function(_0x450619){respondWithRpcPromise('EventManager',_0xde7b('0xbb'),{'event':_0xde7b('0x77'),'message':_0x450619},client9002);return _0x450619;})[_0xde7b('0x24')](respondWithResult(_0x5f22b3,null))['catch'](handleError(_0x5f22b3,null));};exports[_0xde7b('0xbc')]=function(_0x260b5f,_0x330843){var _0x5036ac,_0x2790f8,_0x3a0046;var _0x35c092=[];var _0x4e1f27={};var _0x1a14c7=_0x260b5f[_0xde7b('0xbd')]||[];var _0x191293=[];var _0x26f751;return db[_0xde7b('0x7e')][_0xde7b('0x54')]()[_0xde7b('0x24')](function(_0x59d6d5){if(!_0x59d6d5){throw new db[(_0xde7b('0x7f'))]['ValidationError']('no\x20available\x20attributes');}_0x35c092=_[_0xde7b('0x82')](_['keys'](_0x59d6d5),[_0xde7b('0x83'),_0xde7b('0x84'),_0xde7b('0x85'),_0xde7b('0x86')]);if(_0x260b5f[_0xde7b('0x4b')]['id']){delete _0x260b5f[_0xde7b('0x4b')]['id'];}if(_[_0xde7b('0x6b')](_0x260b5f[_0xde7b('0x4b')]['from'])){throw _0x330843[_0xde7b('0x1c')](0x1f4)[_0xde7b('0x2c')](new db[(_0xde7b('0x7f'))][(_0xde7b('0x80'))](_0xde7b('0x88')));}if(_['isNil'](_0x260b5f[_0xde7b('0x4b')][_0xde7b('0x4b')])||_0x260b5f[_0xde7b('0x4b')][_0xde7b('0x4b')]===''){throw _0x330843[_0xde7b('0x1c')](0x1f4)[_0xde7b('0x2c')](new db[(_0xde7b('0x7f'))][(_0xde7b('0x80'))](_0xde7b('0x89')));}if(_[_0xde7b('0x6b')](_0x260b5f['body'][_0xde7b('0xbe')])){throw _0x330843[_0xde7b('0x1c')](0x1f4)[_0xde7b('0x2c')](new db[(_0xde7b('0x7f'))]['ValidationError'](_0xde7b('0xbf')+_0x35c092));}if(!_['includes'](_0x35c092,_0x260b5f['body'][_0xde7b('0xbe')])){throw _0x330843[_0xde7b('0x1c')](0x1f4)[_0xde7b('0x2c')](new db[(_0xde7b('0x7f'))][(_0xde7b('0x80'))](_0xde7b('0xc0')+_0x35c092));}_0x4e1f27[_0x260b5f['body']['mapKeyOffline']]=_0x260b5f[_0xde7b('0x4b')][_0xde7b('0x87')];})['then'](function(){return db[_0xde7b('0x2f')]['find']({'where':{'id':_0x260b5f[_0xde7b('0x53')]['id']},'include':[{'model':db[_0xde7b('0x8d')],'as':_0xde7b('0x8e')},{'model':db[_0xde7b('0xc1')],'as':_0xde7b('0xc1')}]});})['then'](handleEntityNotFound(_0x330843,null))[_0xde7b('0x24')](function(_0x13fec7){if(_0x13fec7&&_0x13fec7['List']){_0x2790f8=_0x13fec7;var _0x47f6a3=_[_0xde7b('0x9')](_0x260b5f[_0xde7b('0x4b')],{'firstName':_0x260b5f[_0xde7b('0x4b')]['from'],'phone':_0x260b5f[_0xde7b('0x4b')]['from'],'ListId':_0x13fec7[_0xde7b('0x86')]});_0x47f6a3[_0x260b5f[_0xde7b('0x4b')][_0xde7b('0xbe')]]=_0x260b5f[_0xde7b('0x4b')]['from'];return db['CmContact'][_0xde7b('0xc2')]({'where':_0x4e1f27,'defaults':_0x47f6a3});}})[_0xde7b('0xad')](function(_0x176cda){if(_0x176cda){_0x3a0046=_0x176cda;var _0x48e239=fs[_0xde7b('0xc3')](path[_0xde7b('0x6c')](config[_0xde7b('0x66')],_0xde7b('0xc4')),_0xde7b('0xc5'));var _0x46b2b1=ejs[_0xde7b('0xc6')](_0x48e239,{'body':_[_0xde7b('0xc7')](_0x260b5f[_0xde7b('0x4b')]['body']),'bodyTitle':_0x2790f8[_0xde7b('0xc8')]});return db[_0xde7b('0xc9')]['create']({'body':_0x46b2b1,'plainBody':htmlToText['fromString'](_0x46b2b1),'ContactId':_0x176cda['id'],'ChatWebsiteId':_0x2790f8['id']});}})[_0xde7b('0x24')](function(_0x13203f){_0x26f751=_0x13203f;if(_0x1a14c7[_0xde7b('0x38')]){var _0x35531e=_0x1a14c7['map'](function(_0x949513){return{'name':_0x949513[_0xde7b('0xca')],'basename':_0x949513[_0xde7b('0x63')],'type':_0x949513[_0xde7b('0xcb')],'ChatOfflineMessageId':_0x13203f['id']};});_0x191293=_0x35531e['map'](_0x20c05f=>{var _0x8c33ea={'filename':_0x20c05f['name'],'path':path['join'](config[_0xde7b('0x66')],_0xde7b('0xcc'),_0xde7b('0xbd'),_0xde7b('0xcd'),'offline-chat',_0x20c05f[_0xde7b('0xce')])};return _0x8c33ea;});if(!_0x2790f8[_0xde7b('0xcf')]){return db[_0xde7b('0xd0')][_0xde7b('0xd1')](function(_0x4cf415){return db[_0xde7b('0xd2')][_0xde7b('0xd3')](_0x35531e,{'transaction':_0x4cf415});});}}})[_0xde7b('0x24')](function(){if(_0x26f751){_0x5036ac=_0x26f751;return db[_0xde7b('0xc1')][_0xde7b('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xde7b('0xd4')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xde7b('0xd5')],'as':_0xde7b('0xd5'),'raw':!![]}]}]});}})[_0xde7b('0x24')](function(_0x39da45){if(_0x39da45&&_0x39da45['Smtp']&&_0x2790f8[_0xde7b('0xd6')]&&_0x2790f8[_0xde7b('0xd7')]){var _0x3412=_0x39da45['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xde7b('0xd8'),{'account':_0x3412,'message':{'from':util['format'](_0xde7b('0xd9'),_0x39da45['name'],_0x39da45[_0xde7b('0xda')]||_0x39da45[_0xde7b('0xdb')][_0xde7b('0x4c')]),'to':_0x2790f8[_0xde7b('0xd7')],'subject':_0x2790f8[_0xde7b('0xdc')],'html':_0x5036ac[_0xde7b('0x4b')],'attachments':_0x191293}},client9003)[_0xde7b('0x24')](function(){return _0x5036ac;})['catch'](function(_0x1f2bcd){logger['error'](_0x1f2bcd);});}})[_0xde7b('0x24')](function(){if(_0x2790f8&&_0x2790f8[_0xde7b('0xcf')]&&_0x2790f8[_0xde7b('0xdd')]){var _0x3a215e=[];if(_0x1a14c7[_0xde7b('0x38')]){_0x3a215e=_0x1a14c7[_0xde7b('0x2e')](function(_0x5edf52){return{'name':_0x5edf52['originalname'],'basename':_0x5edf52[_0xde7b('0x63')],'type':_0x5edf52[_0xde7b('0xcb')],'ChatOfflineMessageId':_0x26f751['id']};});}var _0x387012;if(!_[_0xde7b('0x6b')](_0x2790f8[_0xde7b('0xde')])){var _0x171d4e=_[_0xde7b('0x2e')](_0x260b5f['body'],function(_0xe2ece8){return _0xe2ece8;});var _0x46d3ad=_[_0xde7b('0xdf')](_0x171d4e)[0x0];var _0x4a57ab=_[_0xde7b('0xe0')](_0x46d3ad,function(_0x4c404e){return _0x4c404e;});_0x387012=_0x4a57ab[0x1][_0x2790f8[_0xde7b('0xde')]];}var _0x4e0932={'from':_0x3a0046[_0xde7b('0xda')],'firstName':_0x3a0046['firstName'],'lastName':_0x3a0046['lastName'],'mapKey':_0xde7b('0xda'),'message':{'from':_0x3a0046[_0xde7b('0xda')],'to':_0x2790f8[_0xde7b('0xc1')][_0xde7b('0xda')],'cc':'','subject':_[_0xde7b('0x6b')](_0x387012)?_0x2790f8['offlineMessageSubject']:_0x387012,'messageId':'','sentAt':new Date(),'attach':_0x3a215e[_0xde7b('0x38')],'attachments':_0x3a215e,'originChannel':_0xde7b('0xe1'),'ChatWebsiteId':_0x2790f8['id'],'ChatOfflineMessageId':_0x5036ac['id'],'originTo':_0x2790f8[_0xde7b('0xc1')][_0xde7b('0xda')]},'body':_0x5036ac[_0xde7b('0x4b')]};var _0x387a53={'account':{'id':_0x2790f8[_0xde7b('0xdd')]},'body':_0x4e0932,'log':_0xde7b('0xe2')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x387a53,client9001)[_0xde7b('0x24')](function(){return _0x5036ac;})['catch'](function(_0x16b285){logger['error'](_0x16b285);});}return;})[_0xde7b('0x24')](function(){if(_0x5036ac){return _0x5036ac;}})[_0xde7b('0x24')](respondWithResult(_0x330843,null))[_0xde7b('0x45')](function(_0x1c2742){logger[_0xde7b('0x19')](_0xde7b('0x45'),_0x1c2742);for(var _0x461e1c of _0x1a14c7){var _0x31d814=path['join'](config[_0xde7b('0x66')],_0xde7b('0xcc'),'files',_0xde7b('0xcd'),_0xde7b('0xe3'),_0x461e1c[_0xde7b('0x63')]);fs_extra[_0xde7b('0xe4')](_0x31d814)[_0xde7b('0x45')](function(_0x1bf02b){logger[_0xde7b('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x31d814,_0x1bf02b);});}});};exports[_0xde7b('0xe5')]=function(_0x56b94d,_0x1bf67a){return db[_0xde7b('0xa9')][_0xde7b('0x50')]({'where':{'id':_0x56b94d[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x1bf67a,null))['then'](function(_0x21a7d4){if(_0x21a7d4){return _0x21a7d4['addInteraction'](_0x56b94d[_0xde7b('0x4b')][_0xde7b('0x5a')],_['omit'](_0x56b94d[_0xde7b('0x4b')],[_0xde7b('0x5a'),'id'])||{});}})[_0xde7b('0x24')](respondWithResult(_0x1bf67a,null))[_0xde7b('0x45')](handleError(_0x1bf67a,null));};exports[_0xde7b('0xe6')]=function(_0x199c07,_0x351307){var _0x1553d3={'raw':![],'where':{}};var _0x4867aa={};var _0x2b06b9={'count':0x0,'rows':[]};return db[_0xde7b('0x2f')][_0xde7b('0x5d')]({'where':{'id':_0x199c07['params']['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x351307,null))[_0xde7b('0x24')](function(_0xa8a770){if(_0xa8a770){_0x4867aa[_0xde7b('0x32')]=_[_0xde7b('0x34')](db['ChatInteraction'][_0xde7b('0x30')]);_0x4867aa[_0xde7b('0x33')]=_[_0xde7b('0x34')](_0x199c07[_0xde7b('0x33')]);_0x4867aa[_0xde7b('0x3d')]=_[_0xde7b('0x35')](_0x4867aa[_0xde7b('0x32')],_0x4867aa[_0xde7b('0x33')]);_0x1553d3[_0xde7b('0x37')]=_[_0xde7b('0x35')](_0x4867aa[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0x199c07['query'][_0xde7b('0x36')]));_0x1553d3[_0xde7b('0x37')]=_0x1553d3[_0xde7b('0x37')]['length']?_0x1553d3[_0xde7b('0x37')]:_0x4867aa[_0xde7b('0x32')];if(!_0x199c07[_0xde7b('0x33')]['hasOwnProperty'](_0xde7b('0x58'))){_0x1553d3[_0xde7b('0x20')]=qs[_0xde7b('0x20')](_0x199c07[_0xde7b('0x33')][_0xde7b('0x20')]);_0x1553d3[_0xde7b('0x1e')]=qs[_0xde7b('0x1e')](_0x199c07['query'][_0xde7b('0x1e')]);}_0x1553d3[_0xde7b('0x3a')]=qs[_0xde7b('0x3b')](_0x199c07[_0xde7b('0x33')][_0xde7b('0x3b')]);_0x1553d3[_0xde7b('0x3c')]=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0x199c07[_0xde7b('0x33')],_0x4867aa[_0xde7b('0x3d')]));_0x1553d3[_0xde7b('0x3c')][_0xde7b('0x56')]=_0xa8a770['id'];if(_0x199c07[_0xde7b('0x33')][_0xde7b('0x3f')]){_0x1553d3[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x1553d3[_0xde7b('0x3c')],{'$or':_[_0xde7b('0x2e')](_0x1553d3[_0xde7b('0x37')],function(_0x596c11){var _0xb02810={};_0xb02810[_0x596c11]={'$like':'%'+_0x199c07[_0xde7b('0x33')][_0xde7b('0x3f')]+'%'};return _0xb02810;})});}_0x1553d3=_['merge']({},_0x1553d3,_0x199c07[_0xde7b('0x49')]);return db['ChatInteraction'][_0xde7b('0x21')]({'where':_0x1553d3[_0xde7b('0x3c')]})[_0xde7b('0x24')](function(_0x5224ce){_0x2b06b9['count']=_0x5224ce;if(_0x199c07[_0xde7b('0x33')][_0xde7b('0x48')]){_0x1553d3[_0xde7b('0x42')]=[{'model':db[_0xde7b('0x7e')],'as':_0xde7b('0xe7'),'required':![]},{'model':db[_0xde7b('0xb5')],'as':_0xde7b('0xe8'),'attributes':[_0xde7b('0x2b'),_0xde7b('0xe9'),_0xde7b('0xea')],'required':![]},{'model':db[_0xde7b('0xeb')],'as':_0xde7b('0xec'),'attributes':['id',_0xde7b('0x2b'),_0xde7b('0xed')],'where':_0x199c07[_0xde7b('0x33')][_0xde7b('0xee')]?{'id':_0x199c07[_0xde7b('0x33')][_0xde7b('0xee')]}:undefined,'required':_0x199c07[_0xde7b('0x33')][_0xde7b('0xee')]?!![]:![]}];}return db[_0xde7b('0xa9')][_0xde7b('0x43')](_0x1553d3);})[_0xde7b('0x24')](function(_0x15df3f){_0x2b06b9['rows']=_0x15df3f;return _0x2b06b9;});}})[_0xde7b('0x24')](respondWithFilteredResult(_0x351307,_0x1553d3))[_0xde7b('0x45')](handleError(_0x351307,null));};function iftimePromise(_0x5a2d51,_0x264b57){return respondWithRpcPromise(_0xde7b('0xef'),_0xde7b('0xf0'),{'command':_0x264b57['timezone']?util[_0xde7b('0xa2')](_0xde7b('0xf1'),_0x5a2d51['interval'],_0x264b57[_0xde7b('0xf2')]):util[_0xde7b('0xa2')](_0xde7b('0xf3'),_0x5a2d51['interval'])},client9002)[_0xde7b('0x24')](function(_0x511cc8){var _0x558617=_0x511cc8&&_0x511cc8[_0xde7b('0xf4')](_0xde7b('0xf5'))>=0x0?!![]:![];logger[_0xde7b('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x264b57['id'],_0x5a2d51['id'],_0x5a2d51[_0xde7b('0xf6')],_0x558617?_0xde7b('0xf7'):_0xde7b('0xf8'),_0x264b57[_0xde7b('0xf2')]?_0x264b57[_0xde7b('0xf2')]:_0xde7b('0xf9'));return _0x558617;})['catch'](function(_0x3af097){logger[_0xde7b('0x19')](_0xde7b('0xfa'),_0x264b57['id'],_0x5a2d51['id'],_0x5a2d51[_0xde7b('0xf6')],util['inspect'](_0x3af097,{'showHidden':![],'depth':null}),_0x264b57[_0xde7b('0xf2')]?_0x264b57[_0xde7b('0xf2')]:_0xde7b('0xf9'));return![];});}exports[_0xde7b('0xf0')]=function(_0x4fabd7,_0x45f5db){var _0x31f298=0x0;var _0x4c346a=0x0;var _0x13aee7=![];var _0x5b4b05;var _0x3e08f1;return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x4fabd7[_0xde7b('0x53')]['id']},'include':[{'model':db['Interval'],'as':_0xde7b('0xfb'),'include':[{'model':db[_0xde7b('0xfb')],'as':_0xde7b('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xde7b('0x24')](handleEntityNotFound(_0x45f5db,null))[_0xde7b('0x24')](function(_0x5da2d5){if(_0x5da2d5){_0x5b4b05=_0x5da2d5;return _0x5da2d5[_0xde7b('0xfd')]({'raw':!![]});}})[_0xde7b('0x24')](function(_0x1952b6){if(_0x5b4b05){if(_0x1952b6){_0x3e08f1=_0x1952b6;}}return require(_0xde7b('0x68'))[_0xde7b('0x69')]();})[_0xde7b('0x24')](function(_0x49fb98){if(_0x49fb98){_0x4c346a=_0x49fb98[_0xde7b('0xfe')];_0x13aee7=_0x49fb98['custom'];}})[_0xde7b('0x24')](function(){return db[_0xde7b('0xa9')]['count']({'where':{'closed':![]}});})[_0xde7b('0x24')](function(_0x54ee29){_0x31f298=_0x54ee29;if(_0x4c346a&&_0x54ee29>_0x4c346a){return db[_0xde7b('0xff')][_0xde7b('0x5d')]({'where':{'id':0x1}})[_0xde7b('0x24')](function(_0x5e7753){if(_0x5e7753){_0x5e7753['increment'](_0xde7b('0x100'));}});}})[_0xde7b('0x24')](function(){if(_0x5b4b05[_0xde7b('0xfb')]&&_0x5b4b05[_0xde7b('0xfb')][_0xde7b('0xfc')]){var _0x12c383=[];for(var _0x2f3346=0x0;_0x2f3346<_0x5b4b05[_0xde7b('0xfb')][_0xde7b('0xfc')][_0xde7b('0x38')];_0x2f3346++){var _0x1c9456=_0x5b4b05[_0xde7b('0xfb')][_0xde7b('0xfc')][_0x2f3346][_0xde7b('0x25')]({'plain':!![]});_0x12c383['push'](iftimePromise(_0x1c9456,_0x5b4b05));}return BPromise[_0xde7b('0x101')](_0x12c383)['then'](function(_0x451250){return _['some'](_0x451250);});}else{return!![];}})[_0xde7b('0x24')](function(_0x116e33){var _0x593010=fs[_0xde7b('0xc3')](path[_0xde7b('0x6c')](config[_0xde7b('0x66')],_0xde7b('0x102')),_0xde7b('0xc5'));var _0x1e50f4={'remote':_0x5b4b05[_0xde7b('0x103')],'query':querystring[_0xde7b('0x18')](_['merge'](_0x5b4b05[_0xde7b('0x25')]({'plain':!![]}),{'customerIp':_0x4fabd7[_0xde7b('0x7a')][_0xde7b('0x9b')]||_0x4fabd7['headers']['x-real-ip']||_0x4fabd7[_0xde7b('0x104')][_0xde7b('0x105')]||_0x4fabd7['ip'],'referer':_0x4fabd7['headers'][_0xde7b('0xa0')],'openedInteractions':_0x31f298,'maxInteractions':_0x4c346a,'virtual':_0x13aee7['virtual'],'online':_0x116e33,'custom':_0x13aee7}))['replace'](/'/g,'\x5c\x27')};_0x45f5db[_0xde7b('0x2c')](ejs[_0xde7b('0xc6')](Mustache[_0xde7b('0xc6')](_0x593010,_0x1e50f4),{'proactiveActions':_0x3e08f1,'alignment':_0x5b4b05[_0xde7b('0x106')],'verticalAlignment':_0x5b4b05['verticalAlignment'],'div_color':_0x5b4b05['color'],'labelText':_0x5b4b05[_0xde7b('0x107')],'text_color':_0x5b4b05[_0xde7b('0x108')],'text_button_color':_0x5b4b05[_0xde7b('0x109')],'button_color':_0x5b4b05[_0xde7b('0x10a')],'background_color':_0x5b4b05[_0xde7b('0x10b')],'hideWhenOffline':_0x5b4b05[_0xde7b('0x10c')],'interval':_0x5b4b05[_0xde7b('0x10d')]}));})[_0xde7b('0x45')](handleError(_0x45f5db,null));};exports['addApplications']=function(_0x18951e,_0x109701){var _0x27f31c=_0x18951e[_0xde7b('0x53')]['id'];var _0x432b00=_0x18951e[_0xde7b('0x4b')];var _0x29bbff=0xc8;var _0x39636f=null;return db[_0xde7b('0xd0')][_0xde7b('0xd1')]({'isolationLevel':db['sequelize'][_0xde7b('0x10e')][_0xde7b('0x10f')]['READ_COMMITTED']},function(_0x3863b1){return db['ChatWebsite'][_0xde7b('0x5d')]({'where':{'id':_0x27f31c},'transaction':_0x3863b1})[_0xde7b('0x24')](function(_0xc7fa23){if(_0xc7fa23){return db['ChatApplication'][_0xde7b('0x28')]({'where':{'ChatWebsiteId':_0x27f31c},'transaction':_0x3863b1})['then'](function(){var _0x5cb20d=_['map'](_0x432b00,function(_0x556ecd){_0x556ecd[_0xde7b('0x56')]=_0x27f31c;return _0x556ecd;});return db[_0xde7b('0x91')]['bulkCreate'](_0x5cb20d,{'transaction':_0x3863b1});});}else{_0x29bbff=0x194;_0x39636f=[];}});})['then'](function(){if(_0x29bbff!==0x194){return db[_0xde7b('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x27f31c},'order':'priority'})['then'](function(_0x5dee4b){_0x39636f=_0x5dee4b;});}})[_0xde7b('0x45')](function(_0x47f3de){_0x29bbff=0x1f4;logger[_0xde7b('0x19')](_0x47f3de[_0xde7b('0x110')]);if(_0x47f3de['name']){delete _0x47f3de[_0xde7b('0x2b')];}_0x39636f=_0x47f3de;})[_0xde7b('0x111')](function(){if(_0x39636f===null){_0x109701[_0xde7b('0x2a')](_0x29bbff);}else{if(_0x29bbff===0x1f4){_0x109701[_0xde7b('0x1c')](_0x29bbff)[_0xde7b('0x2c')](_0x39636f);}else{_0x109701[_0xde7b('0x1c')](_0x29bbff)[_0xde7b('0x1d')](_0x39636f);}}});};exports[_0xde7b('0x112')]=function(_0xe8e44,_0x5c7706){var _0x3b0e18={};var _0x1b4eb8={};var _0x421891;var _0x4e4392;return db[_0xde7b('0x2f')][_0xde7b('0x5d')]({'where':{'id':_0xe8e44[_0xde7b('0x53')]['id']}})['then'](handleEntityNotFound(_0x5c7706,null))[_0xde7b('0x24')](function(_0x3bc104){if(_0x3bc104){_0x421891=_0x3bc104;_0x1b4eb8[_0xde7b('0x32')]=_[_0xde7b('0x34')](db[_0xde7b('0x91')][_0xde7b('0x30')]);_0x1b4eb8[_0xde7b('0x33')]=_[_0xde7b('0x34')](_0xe8e44[_0xde7b('0x33')]);_0x1b4eb8[_0xde7b('0x3d')]=_[_0xde7b('0x35')](_0x1b4eb8[_0xde7b('0x32')],_0x1b4eb8[_0xde7b('0x33')]);_0x3b0e18[_0xde7b('0x37')]=_[_0xde7b('0x35')](_0x1b4eb8[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0xe8e44['query'][_0xde7b('0x36')]));_0x3b0e18[_0xde7b('0x37')]=_0x3b0e18[_0xde7b('0x37')][_0xde7b('0x38')]?_0x3b0e18[_0xde7b('0x37')]:_0x1b4eb8[_0xde7b('0x32')];_0x3b0e18['order']=qs['sort'](_0xe8e44['query'][_0xde7b('0x3b')]);_0x3b0e18[_0xde7b('0x3c')]=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0xe8e44[_0xde7b('0x33')],_0x1b4eb8[_0xde7b('0x3d')]));if(_0xe8e44['query'][_0xde7b('0x3f')]){_0x3b0e18[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x3b0e18[_0xde7b('0x3c')],{'$or':_[_0xde7b('0x2e')](_0x3b0e18[_0xde7b('0x37')],function(_0x5dec18){var _0x19f0ae={};_0x19f0ae[_0x5dec18]={'$like':'%'+_0xe8e44[_0xde7b('0x33')][_0xde7b('0x3f')]+'%'};return _0x19f0ae;})});}_0x3b0e18=_[_0xde7b('0x40')]({},_0x3b0e18,_0xe8e44[_0xde7b('0x49')]);return _0x421891[_0xde7b('0x112')](_0x3b0e18);}})[_0xde7b('0x24')](function(_0x4492eb){if(_0x4492eb){_0x4e4392=_0x4492eb[_0xde7b('0x38')];if(!_0xe8e44['query'][_0xde7b('0x39')]('nolimit')){_0x3b0e18[_0xde7b('0x20')]=qs['limit'](_0xe8e44['query']['limit']);_0x3b0e18['offset']=qs['offset'](_0xe8e44[_0xde7b('0x33')][_0xde7b('0x1e')]);}return _0x421891['getApplications'](_0x3b0e18);}})[_0xde7b('0x24')](function(_0x4daa84){if(_0x4daa84){return _0x4daa84?{'count':_0x4e4392,'rows':_0x4daa84}:null;}})[_0xde7b('0x24')](respondWithResult(_0x5c7706,null))[_0xde7b('0x45')](handleError(_0x5c7706,null));};exports['addProactiveActions']=function(_0x4737f6,_0x4e4cee){return db[_0xde7b('0x113')][_0xde7b('0x50')]({'where':{'id':_0x4737f6[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x4e4cee,null))['then'](function(_0x50709f){if(_0x50709f){return _0x50709f[_0xde7b('0x114')](_0x4737f6['body'][_0xde7b('0x5a')],_[_0xde7b('0x115')](_0x4737f6[_0xde7b('0x4b')],[_0xde7b('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x4e4cee,null))[_0xde7b('0x45')](handleError(_0x4e4cee,null));};exports['getProactiveActions']=function(_0x231586,_0x238038){var _0x1b8345={};var _0x4752a5={};var _0x3788a6;var _0x573789;return db[_0xde7b('0x2f')][_0xde7b('0x5d')]({'where':{'id':_0x231586[_0xde7b('0x53')]['id']}})['then'](handleEntityNotFound(_0x238038,null))[_0xde7b('0x24')](function(_0xb1b69){if(_0xb1b69){_0x3788a6=_0xb1b69;_0x4752a5['model']=_[_0xde7b('0x34')](db[_0xde7b('0x116')][_0xde7b('0x30')]);_0x4752a5[_0xde7b('0x33')]=_[_0xde7b('0x34')](_0x231586[_0xde7b('0x33')]);_0x4752a5['filters']=_[_0xde7b('0x35')](_0x4752a5[_0xde7b('0x32')],_0x4752a5[_0xde7b('0x33')]);_0x1b8345['attributes']=_[_0xde7b('0x35')](_0x4752a5[_0xde7b('0x32')],qs['fields'](_0x231586[_0xde7b('0x33')][_0xde7b('0x36')]));_0x1b8345[_0xde7b('0x37')]=_0x1b8345[_0xde7b('0x37')]['length']?_0x1b8345[_0xde7b('0x37')]:_0x4752a5[_0xde7b('0x32')];_0x1b8345[_0xde7b('0x3a')]=qs[_0xde7b('0x3b')](_0x231586[_0xde7b('0x33')][_0xde7b('0x3b')]);_0x1b8345['where']=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0x231586[_0xde7b('0x33')],_0x4752a5['filters']));if(_0x231586[_0xde7b('0x33')][_0xde7b('0x3f')]){_0x1b8345[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x1b8345[_0xde7b('0x3c')],{'$or':_['map'](_0x1b8345[_0xde7b('0x37')],function(_0x456e23){var _0x26716d={};_0x26716d[_0x456e23]={'$like':'%'+_0x231586['query'][_0xde7b('0x3f')]+'%'};return _0x26716d;})});}_0x1b8345=_[_0xde7b('0x40')]({},_0x1b8345,_0x231586[_0xde7b('0x49')]);return _0x3788a6[_0xde7b('0xfd')](_0x1b8345);}})[_0xde7b('0x24')](function(_0x2b1cb4){if(_0x2b1cb4){_0x573789=_0x2b1cb4[_0xde7b('0x38')];if(!_0x231586[_0xde7b('0x33')][_0xde7b('0x39')](_0xde7b('0x58'))){_0x1b8345[_0xde7b('0x20')]=qs['limit'](_0x231586['query'][_0xde7b('0x20')]);_0x1b8345[_0xde7b('0x1e')]=qs['offset'](_0x231586['query'][_0xde7b('0x1e')]);}return _0x3788a6[_0xde7b('0xfd')](_0x1b8345);}})[_0xde7b('0x24')](function(_0x3616c2){if(_0x3616c2){return _0x3616c2?{'count':_0x573789,'rows':_0x3616c2}:null;}})['then'](respondWithResult(_0x238038,null))[_0xde7b('0x45')](handleError(_0x238038,null));};exports[_0xde7b('0x117')]=function(_0x3bf99a,_0x57c2c7){var _0x4f9d14=_0x3bf99a[_0xde7b('0x33')][_0xde7b('0x118')]===_0xde7b('0x119')?'offlineForm':_0xde7b('0x11a');return db['ChatWebsite'][_0xde7b('0x50')]({'attributes':['id',_0x4f9d14],'where':{'id':_0x3bf99a[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x57c2c7,null))[_0xde7b('0x24')](function(_0x4c80f5){if(_0x4c80f5){var _0x448285=_0x4c80f5[_0x4f9d14];var _0x87455d=_0x448285&&_0x448285['items']?_0x448285[_0xde7b('0x11b')]:[];_0x57c2c7[_0xde7b('0x2c')]({'fromKey':_[_0xde7b('0x6b')](_0x448285['fromKey'])?undefined:_0x448285[_0xde7b('0x11c')],'count':_0x87455d[_0xde7b('0x38')],'rows':_0x87455d});}})['catch'](handleError(_0x57c2c7,null));};exports[_0xde7b('0x11d')]=function(_0x8f0b67,_0x3f76e1){var _0x3dfebd={'raw':![],'where':{}};var _0x5479c2={};var _0x2f92e1={'count':0x0,'rows':[]};return db[_0xde7b('0x2f')][_0xde7b('0x5d')]({'where':{'id':_0x8f0b67[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x3f76e1,null))[_0xde7b('0x24')](function(_0x4b7d29){if(_0x4b7d29){_0x5479c2[_0xde7b('0x32')]=_[_0xde7b('0x34')](db[_0xde7b('0xc9')]['rawAttributes']);_0x5479c2[_0xde7b('0x33')]=_['keys'](_0x8f0b67[_0xde7b('0x33')]);_0x5479c2[_0xde7b('0x3d')]=_['intersection'](_0x5479c2['model'],_0x5479c2[_0xde7b('0x33')]);_0x3dfebd['attributes']=_[_0xde7b('0x35')](_0x5479c2[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0x8f0b67['query'][_0xde7b('0x36')]));_0x3dfebd[_0xde7b('0x37')]=_0x3dfebd[_0xde7b('0x37')][_0xde7b('0x38')]?_0x3dfebd[_0xde7b('0x37')]:_0x5479c2[_0xde7b('0x32')];if(!_0x8f0b67[_0xde7b('0x33')][_0xde7b('0x39')](_0xde7b('0x58'))){_0x3dfebd['limit']=qs[_0xde7b('0x20')](_0x8f0b67['query']['limit']);_0x3dfebd[_0xde7b('0x1e')]=qs['offset'](_0x8f0b67[_0xde7b('0x33')][_0xde7b('0x1e')]);}_0x3dfebd['order']=qs[_0xde7b('0x3b')](_0x8f0b67[_0xde7b('0x33')][_0xde7b('0x3b')]);_0x3dfebd[_0xde7b('0x3c')]=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0x8f0b67[_0xde7b('0x33')],_0x5479c2['filters']));_0x3dfebd[_0xde7b('0x3c')][_0xde7b('0x56')]=_0x4b7d29['id'];if(_0x8f0b67[_0xde7b('0x33')][_0xde7b('0x3f')]){_0x3dfebd[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x3dfebd['where'],{'$or':_[_0xde7b('0x2e')](_0x3dfebd[_0xde7b('0x37')],function(_0x595163){var _0x24bcf4={};_0x24bcf4[_0x595163]={'$like':'%'+_0x8f0b67['query']['filter']+'%'};return _0x24bcf4;})});}_0x3dfebd=_['merge']({},_0x3dfebd,_0x8f0b67['options']);return db['ChatOfflineMessage']['count']({'where':_0x3dfebd[_0xde7b('0x3c')]})['then'](function(_0x20b362){_0x2f92e1[_0xde7b('0x21')]=_0x20b362;if(_0x8f0b67[_0xde7b('0x33')][_0xde7b('0x48')]){_0x3dfebd[_0xde7b('0x42')]=[{'all':!![]}];}else{_0x3dfebd['include']=[{'model':db[_0xde7b('0x7e')],'as':_0xde7b('0xe7'),'required':![]},{'model':db[_0xde7b('0xd2')],'as':_0xde7b('0x11e'),'required':![]}];}return db[_0xde7b('0xc9')]['findAll'](_0x3dfebd);})[_0xde7b('0x24')](function(_0x136ad1){_0x2f92e1[_0xde7b('0x44')]=_0x136ad1;return _0x2f92e1;});}})[_0xde7b('0x24')](respondWithFilteredResult(_0x3f76e1,_0x3dfebd))['catch'](handleError(_0x3f76e1,null));};exports['addAgents']=function(_0x3eb202,_0x271bbe){return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x3eb202[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x271bbe,null))[_0xde7b('0x24')](function(_0xbbe0a8){if(_0xbbe0a8){return _0xbbe0a8[_0xde7b('0x11f')](_0x3eb202['body'][_0xde7b('0x5a')],_['omit'](_0x3eb202[_0xde7b('0x4b')],[_0xde7b('0x5a'),'id'])||{})[_0xde7b('0xad')](function(_0x2515f3){for(var _0x2c5491=0x0;_0x2c5491<_0x3eb202[_0xde7b('0x4b')][_0xde7b('0x5a')][_0xde7b('0x38')];_0x2c5491+=0x1){socket['emit'](_0xde7b('0x120'),{'UserId':Number(_0x3eb202[_0xde7b('0x4b')][_0xde7b('0x5a')][_0x2c5491]),'ChatWebsiteId':Number(_0x3eb202['params']['id'])});}return _0x2515f3;});}})[_0xde7b('0x24')](respondWithResult(_0x271bbe,null))[_0xde7b('0x45')](handleError(_0x271bbe,null));};exports[_0xde7b('0x121')]=function(_0x7c216e,_0x13c62a){return db[_0xde7b('0x2f')][_0xde7b('0x50')]({'where':{'id':_0x7c216e[_0xde7b('0x53')]['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x13c62a,null))['then'](function(_0x5d6a0a){if(_0x5d6a0a){return _0x5d6a0a[_0xde7b('0x121')](_0x7c216e[_0xde7b('0x33')]['ids'])[_0xde7b('0x24')](function(){if(_[_0xde7b('0x122')](_0x7c216e[_0xde7b('0x33')][_0xde7b('0x5a')])){for(var _0x5305dd=0x0;_0x5305dd<_0x7c216e[_0xde7b('0x33')]['ids'][_0xde7b('0x38')];_0x5305dd+=0x1){socket[_0xde7b('0x123')]('userChatWebsite:remove',{'UserId':Number(_0x7c216e[_0xde7b('0x33')][_0xde7b('0x5a')][_0x5305dd]),'ChatWebsiteId':Number(_0x7c216e[_0xde7b('0x53')]['id'])});}}else{socket[_0xde7b('0x123')](_0xde7b('0x124'),{'UserId':Number(_0x7c216e[_0xde7b('0x33')][_0xde7b('0x5a')]),'ChatWebsiteId':Number(_0x7c216e[_0xde7b('0x53')]['id'])});}});}})[_0xde7b('0x24')](respondWithStatusCode(_0x13c62a,null))[_0xde7b('0x45')](handleError(_0x13c62a,null));};exports['getAgents']=function(_0x27ae3b,_0x1cfabb){var _0x512d8e={};var _0x4110c7={};var _0x9c5c0a;var _0x2b5c0a;return db[_0xde7b('0x2f')][_0xde7b('0x5d')]({'where':{'id':_0x27ae3b['params']['id']}})[_0xde7b('0x24')](handleEntityNotFound(_0x1cfabb,null))[_0xde7b('0x24')](function(_0x3a260d){if(_0x3a260d){_0x9c5c0a=_0x3a260d;_0x4110c7[_0xde7b('0x32')]=_[_0xde7b('0x34')](db[_0xde7b('0xb5')]['rawAttributes']);_0x4110c7['query']=_['keys'](_0x27ae3b[_0xde7b('0x33')]);_0x4110c7[_0xde7b('0x3d')]=_[_0xde7b('0x35')](_0x4110c7['model'],_0x4110c7[_0xde7b('0x33')]);_0x512d8e[_0xde7b('0x37')]=_[_0xde7b('0x35')](_0x4110c7[_0xde7b('0x32')],qs[_0xde7b('0x36')](_0x27ae3b[_0xde7b('0x33')][_0xde7b('0x36')]));_0x512d8e['attributes']=_0x512d8e[_0xde7b('0x37')][_0xde7b('0x38')]?_0x512d8e[_0xde7b('0x37')]:_0x4110c7['model'];_0x512d8e[_0xde7b('0x3a')]=qs[_0xde7b('0x3b')](_0x27ae3b[_0xde7b('0x33')]['sort']);_0x512d8e[_0xde7b('0x3c')]=qs[_0xde7b('0x3d')](_[_0xde7b('0x3e')](_0x27ae3b[_0xde7b('0x33')],_0x4110c7[_0xde7b('0x3d')]));if(_0x27ae3b[_0xde7b('0x33')][_0xde7b('0x3f')]){_0x512d8e[_0xde7b('0x3c')]=_[_0xde7b('0x40')](_0x512d8e[_0xde7b('0x3c')],{'$or':_[_0xde7b('0x2e')](_0x512d8e[_0xde7b('0x37')],function(_0x3a3fcf){var _0x5523f6={};_0x5523f6[_0x3a3fcf]={'$like':'%'+_0x27ae3b[_0xde7b('0x33')][_0xde7b('0x3f')]+'%'};return _0x5523f6;})});}_0x512d8e=_[_0xde7b('0x40')]({},_0x512d8e,_0x27ae3b['options']);return _0x9c5c0a[_0xde7b('0x125')](_0x512d8e);}})[_0xde7b('0x24')](function(_0x5d280f){if(_0x5d280f){_0x2b5c0a=_0x5d280f[_0xde7b('0x38')];if(!_0x27ae3b[_0xde7b('0x33')][_0xde7b('0x39')](_0xde7b('0x58'))){_0x512d8e['limit']=qs[_0xde7b('0x20')](_0x27ae3b[_0xde7b('0x33')][_0xde7b('0x20')]);_0x512d8e['offset']=qs[_0xde7b('0x1e')](_0x27ae3b[_0xde7b('0x33')][_0xde7b('0x1e')]);}return _0x9c5c0a[_0xde7b('0x125')](_0x512d8e);}})[_0xde7b('0x24')](function(_0x30f3c6){if(_0x30f3c6){return _0x30f3c6?{'count':_0x2b5c0a,'rows':_0x30f3c6}:null;}})[_0xde7b('0x24')](respondWithResult(_0x1cfabb,null))[_0xde7b('0x45')](handleError(_0x1cfabb,null));};
\ No newline at end of file
+var _0xc716=['json','undefined','count','offset','limit','status','Content-Range','destroy','then','get','ChatWebsites','sendStatus','name','send','index','Pause','map','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','notify','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','remote','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','IntervalId','addApplications','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','html-to-text','http','client','request','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','result','end'];(function(_0x51e59b,_0x4cc772){var _0x2434b5=function(_0x591237){while(--_0x591237){_0x51e59b['push'](_0x51e59b['shift']());}};_0x2434b5(++_0x4cc772);}(_0xc716,0x10e));var _0x6c71=function(_0x46eb1e,_0x25660f){_0x46eb1e=_0x46eb1e-0x0;var _0x34813e=_0xc716[_0x46eb1e];return _0x34813e;};'use strict';var BPromise=require(_0x6c71('0x0'));var Mustache=require('mustache');var util=require(_0x6c71('0x1'));var path=require(_0x6c71('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c71('0x3'));var _=require('lodash');var querystring=require(_0x6c71('0x4'));var Redis=require(_0x6c71('0x5'));var qs=require(_0x6c71('0x6'));var logger=require(_0x6c71('0x7'))(_0x6c71('0x8'));var config=require(_0x6c71('0x9'));var db=require(_0x6c71('0xa'))['db'];config[_0x6c71('0xb')]=_['defaults'](config[_0x6c71('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c71('0xc'))(new Redis(config[_0x6c71('0xb')]));require(_0x6c71('0xd'))['register'](socket);var htmlToText=require(_0x6c71('0xe'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6c71('0xf')]({'port':0x232c});var client9002=jayson[_0x6c71('0x10')][_0x6c71('0xf')]({'port':0x232a});var client9003=jayson['client'][_0x6c71('0xf')]({'port':0x232b});var client9001=jayson[_0x6c71('0x10')][_0x6c71('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x32da3d,_0x39fb62,_0xa2b681,_0x56bf37){return new BPromise(function(_0x12c429,_0x1126a5){var _0x4b1261=_0x56bf37||client;return _0x4b1261[_0x6c71('0x11')](_0x32da3d,_0xa2b681)['then'](function(_0x5c941f){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x39fb62,'request\x20sent');logger[_0x6c71('0x12')](_0x6c71('0x13'),_0x39fb62,_0x6c71('0x14'),JSON[_0x6c71('0x15')](_0x5c941f));if(_0x5c941f[_0x6c71('0x16')]){if(_0x5c941f['error']['code']===0x1f4){logger[_0x6c71('0x16')](_0x6c71('0x17'),_0x39fb62,_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);return _0x1126a5(_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);}logger[_0x6c71('0x16')](_0x6c71('0x17'),_0x39fb62,_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);return _0x12c429(_0x5c941f[_0x6c71('0x16')][_0x6c71('0x18')]);}else{logger[_0x6c71('0x19')](_0x6c71('0x17'),_0x39fb62,_0x6c71('0x14'));_0x12c429(_0x5c941f[_0x6c71('0x1a')]['message']);}})['catch'](function(_0x50ad9e){logger[_0x6c71('0x16')](_0x6c71('0x17'),_0x39fb62,_0x50ad9e);_0x1126a5(_0x50ad9e);});});}function respondWithStatusCode(_0x2dd344,_0x5962a7){_0x5962a7=_0x5962a7||0xcc;return function(_0x1bfceb){if(_0x1bfceb){return _0x2dd344['sendStatus'](_0x5962a7);}return _0x2dd344['status'](_0x5962a7)[_0x6c71('0x1b')]();};}function respondWithResult(_0x4dbabd,_0x57814a){_0x57814a=_0x57814a||0xc8;return function(_0x4fb53e){if(_0x4fb53e){return _0x4dbabd['status'](_0x57814a)[_0x6c71('0x1c')](_0x4fb53e);}};}function respondWithFilteredResult(_0x116a57,_0x80b880){return function(_0x4f138f){if(_0x4f138f){var _0x2bc1d9=typeof _0x80b880['offset']==='undefined'&&typeof _0x80b880['limit']===_0x6c71('0x1d');var _0x17f3b6=_0x4f138f[_0x6c71('0x1e')];var _0x2d6382=_0x2bc1d9?0x0:_0x80b880[_0x6c71('0x1f')];var _0x26eb1c=_0x2bc1d9?_0x4f138f[_0x6c71('0x1e')]:_0x80b880[_0x6c71('0x1f')]+_0x80b880[_0x6c71('0x20')];var _0x39460b;if(_0x26eb1c>=_0x17f3b6){_0x26eb1c=_0x17f3b6;_0x39460b=0xc8;}else{_0x39460b=0xce;}_0x116a57[_0x6c71('0x21')](_0x39460b);return _0x116a57['set'](_0x6c71('0x22'),_0x2d6382+'-'+_0x26eb1c+'/'+_0x17f3b6)['json'](_0x4f138f);}return null;};}function saveUpdates(_0x3efdab){return function(_0x1711fc){if(_0x1711fc){return _0x1711fc['update'](_0x3efdab)['then'](function(_0x25df86){return _0x25df86;});}return null;};}function removeEntity(_0x43f21c){return function(_0x63f83a){if(_0x63f83a){return _0x63f83a[_0x6c71('0x23')]()[_0x6c71('0x24')](function(){var _0x23f500=_0x63f83a[_0x6c71('0x25')]({'plain':!![]});var _0x45e70c=_0x6c71('0x26');return db['UserProfileResource'][_0x6c71('0x23')]({'where':{'type':_0x45e70c,'resourceId':_0x23f500['id']}})['then'](function(){return _0x63f83a;});})[_0x6c71('0x24')](function(){_0x43f21c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x475c57){return function(_0x343036){if(!_0x343036){_0x475c57[_0x6c71('0x27')](0x194);}return _0x343036;};}function handleError(_0x1856ea,_0x92a9c2){_0x92a9c2=_0x92a9c2||0x1f4;return function(_0x292f19){logger['error'](_0x292f19['stack']);if(_0x292f19[_0x6c71('0x28')]){delete _0x292f19[_0x6c71('0x28')];}_0x1856ea[_0x6c71('0x21')](_0x92a9c2)[_0x6c71('0x29')](_0x292f19);};}exports[_0x6c71('0x2a')]=function(_0x2f92a8,_0x249341){var _0x569911={'include':[{'model':db[_0x6c71('0x2b')],'as':'mandatoryDispositionPause'}]},_0x4aca38={},_0x3188b9={'count':0x0,'rows':[]};var _0xf8bec3=_[_0x6c71('0x2c')](db['ChatWebsite']['rawAttributes'],function(_0xe2b622){return{'name':_0xe2b622['fieldName'],'type':_0xe2b622['type']['key']};});_0x4aca38[_0x6c71('0x2d')]=_['map'](_0xf8bec3,_0x6c71('0x28'));_0x4aca38[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x2f92a8[_0x6c71('0x2e')]);_0x4aca38['filters']=_[_0x6c71('0x30')](_0x4aca38[_0x6c71('0x2d')],_0x4aca38['query']);_0x569911[_0x6c71('0x31')]=_['intersection'](_0x4aca38[_0x6c71('0x2d')],qs['fields'](_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x569911[_0x6c71('0x31')]=_0x569911[_0x6c71('0x31')][_0x6c71('0x33')]?_0x569911[_0x6c71('0x31')]:_0x4aca38[_0x6c71('0x2d')];if(!_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x34')](_0x6c71('0x35'))){_0x569911['limit']=qs[_0x6c71('0x20')](_0x2f92a8[_0x6c71('0x2e')]['limit']);_0x569911[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0x569911[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0x2f92a8['query'][_0x6c71('0x37')]);_0x569911[_0x6c71('0x38')]=qs['filters'](_[_0x6c71('0x39')](_0x2f92a8['query'],_0x4aca38[_0x6c71('0x3a')]),_0xf8bec3);if(_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x569911[_0x6c71('0x38')]=_['merge'](_0x569911[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0xf8bec3,function(_0x352560){if(_0x352560[_0x6c71('0x3c')]!==_0x6c71('0x3d')){var _0x2e5e2c={};_0x2e5e2c[_0x352560[_0x6c71('0x28')]]={'$like':'%'+_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x2e5e2c;}})});}_0x569911=_['merge']({},_0x569911,_0x2f92a8['options']);var _0x46230b={'where':_0x569911[_0x6c71('0x38')]};return db[_0x6c71('0x3e')][_0x6c71('0x1e')](_0x46230b)['then'](function(_0x4ca538){_0x3188b9[_0x6c71('0x1e')]=_0x4ca538;if(_0x2f92a8[_0x6c71('0x2e')][_0x6c71('0x3f')]){_0x569911[_0x6c71('0x40')]=[{'all':!![]}];}return db[_0x6c71('0x3e')][_0x6c71('0x41')](_0x569911);})['then'](function(_0x4a0ffb){_0x3188b9[_0x6c71('0x42')]=_0x4a0ffb;return _0x3188b9;})[_0x6c71('0x24')](respondWithFilteredResult(_0x249341,_0x569911))[_0x6c71('0x43')](handleError(_0x249341,null));};exports[_0x6c71('0x44')]=function(_0x22052e,_0x18738e){var _0x2dea57={'raw':![],'where':{'id':_0x22052e[_0x6c71('0x45')]['id']},'include':[{'model':db[_0x6c71('0x2b')],'as':_0x6c71('0x46')}]},_0x51277e={};_0x51277e[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x3e')][_0x6c71('0x47')]);_0x51277e[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x22052e[_0x6c71('0x2e')]);_0x51277e[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x51277e[_0x6c71('0x2d')],_0x51277e['query']);_0x2dea57['attributes']=_[_0x6c71('0x30')](_0x51277e[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x22052e['query'][_0x6c71('0x32')]));_0x2dea57[_0x6c71('0x31')]=_0x2dea57[_0x6c71('0x31')][_0x6c71('0x33')]?_0x2dea57[_0x6c71('0x31')]:_0x51277e[_0x6c71('0x2d')];if(_0x22052e[_0x6c71('0x2e')][_0x6c71('0x3f')]){_0x2dea57[_0x6c71('0x40')]=[{'all':!![]}];}_0x2dea57=_[_0x6c71('0x48')]({},_0x2dea57,_0x22052e[_0x6c71('0x49')]);return db[_0x6c71('0x3e')][_0x6c71('0x4a')](_0x2dea57)[_0x6c71('0x24')](handleEntityNotFound(_0x18738e,null))['then'](respondWithResult(_0x18738e,null))[_0x6c71('0x43')](handleError(_0x18738e,null));};exports[_0x6c71('0x4b')]=function(_0x6e73c4,_0x4a26a7){return db[_0x6c71('0x3e')]['create'](_0x6e73c4[_0x6c71('0x4c')],{})[_0x6c71('0x24')](function(_0x4b4e2b){var _0x1230ba=_0x6e73c4[_0x6c71('0x4d')][_0x6c71('0x25')]({'plain':!![]});if(!_0x1230ba)throw new Error(_0x6c71('0x4e'));if(_0x1230ba[_0x6c71('0x4f')]===_0x6c71('0x4d')){var _0x5d71a0=_0x4b4e2b['get']({'plain':!![]});var _0x435ae3=_0x6c71('0x26');return db['UserProfileSection'][_0x6c71('0x4a')]({'where':{'name':_0x435ae3,'userProfileId':_0x1230ba['userProfileId']},'raw':!![]})[_0x6c71('0x24')](function(_0x136882){if(_0x136882&&_0x136882['autoAssociation']===0x0){return db[_0x6c71('0x50')][_0x6c71('0x4b')]({'name':_0x5d71a0[_0x6c71('0x28')],'resourceId':_0x5d71a0['id'],'type':_0x136882[_0x6c71('0x28')],'sectionId':_0x136882['id']},{})[_0x6c71('0x24')](function(){return _0x4b4e2b;});}else{return _0x4b4e2b;}})[_0x6c71('0x43')](function(_0x2dc3de){logger[_0x6c71('0x16')](_0x6c71('0x51'),_0x2dc3de);throw _0x2dc3de;});}return _0x4b4e2b;})[_0x6c71('0x24')](respondWithResult(_0x4a26a7,0xc9))[_0x6c71('0x43')](handleError(_0x4a26a7,null));};exports[_0x6c71('0x52')]=function(_0x5870a8,_0x1e91df){if(_0x5870a8[_0x6c71('0x4c')]['id']){delete _0x5870a8[_0x6c71('0x4c')]['id'];}return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x5870a8[_0x6c71('0x45')]['id']},'include':[{'model':db[_0x6c71('0x2b')],'as':'mandatoryDispositionPause'}]})[_0x6c71('0x24')](handleEntityNotFound(_0x1e91df,null))[_0x6c71('0x24')](saveUpdates(_0x5870a8[_0x6c71('0x4c')],null))[_0x6c71('0x24')](respondWithResult(_0x1e91df,null))[_0x6c71('0x43')](handleError(_0x1e91df,null));};exports['destroy']=function(_0x583aa0,_0x36d607){return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x583aa0[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x36d607,null))['then'](removeEntity(_0x36d607,null))[_0x6c71('0x43')](handleError(_0x36d607,null));};exports[_0x6c71('0x53')]=function(_0x528364,_0xa35649){return db[_0x6c71('0x3e')]['describe']()[_0x6c71('0x24')](respondWithResult(_0xa35649,null))[_0x6c71('0x43')](handleError(_0xa35649,null));};exports[_0x6c71('0x54')]=function(_0x33c9aa,_0x390e3c){if(_0x33c9aa['body']['id']){delete _0x33c9aa[_0x6c71('0x4c')]['id'];}return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x33c9aa[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x390e3c,null))[_0x6c71('0x24')](function(_0x50c19a){if(_0x50c19a){_0x33c9aa[_0x6c71('0x4c')]['ChatWebsiteId']=_0x50c19a['id'];return db[_0x6c71('0x55')]['create'](_0x33c9aa[_0x6c71('0x4c')]);}})[_0x6c71('0x24')](respondWithResult(_0x390e3c,null))[_0x6c71('0x43')](handleError(_0x390e3c,null));};exports['getDispositions']=function(_0x22c7e0,_0x26a06a){var _0x3d009a={'raw':![],'where':{}};var _0x52f8d1={};var _0x18db4a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6c71('0x56')]({'where':{'id':_0x22c7e0['params']['id']}})['then'](handleEntityNotFound(_0x26a06a,null))[_0x6c71('0x24')](function(_0x134e80){if(_0x134e80){_0x52f8d1[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x55')][_0x6c71('0x47')]);_0x52f8d1[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x22c7e0['query']);_0x52f8d1[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x52f8d1[_0x6c71('0x2d')],_0x52f8d1[_0x6c71('0x2e')]);_0x3d009a[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x52f8d1['model'],qs[_0x6c71('0x32')](_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x3d009a[_0x6c71('0x31')]=_0x3d009a[_0x6c71('0x31')][_0x6c71('0x33')]?_0x3d009a[_0x6c71('0x31')]:_0x52f8d1[_0x6c71('0x2d')];if(!_0x22c7e0[_0x6c71('0x2e')]['hasOwnProperty']('nolimit')){_0x3d009a[_0x6c71('0x20')]=qs['limit'](_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x20')]);_0x3d009a[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x22c7e0['query'][_0x6c71('0x1f')]);}_0x3d009a[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0x22c7e0['query'][_0x6c71('0x37')]);_0x3d009a['where']=qs['filters'](_[_0x6c71('0x39')](_0x22c7e0[_0x6c71('0x2e')],_0x52f8d1[_0x6c71('0x3a')]));_0x3d009a[_0x6c71('0x38')][_0x6c71('0x57')]=_0x134e80['id'];if(_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x3d009a[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0x3d009a[_0x6c71('0x38')],{'$or':_['map'](_0x3d009a['attributes'],function(_0x175d1d){var _0x383357={};_0x383357[_0x175d1d]={'$like':'%'+_0x22c7e0[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x383357;})});}_0x3d009a=_[_0x6c71('0x48')]({},_0x3d009a,_0x22c7e0[_0x6c71('0x49')]);return db[_0x6c71('0x55')]['count']({'where':_0x3d009a['where']})[_0x6c71('0x24')](function(_0x3d2dc){_0x18db4a[_0x6c71('0x1e')]=_0x3d2dc;if(_0x22c7e0['query'][_0x6c71('0x3f')]){_0x3d009a['include']=[{'all':!![]}];}return db[_0x6c71('0x55')][_0x6c71('0x41')](_0x3d009a);})[_0x6c71('0x24')](function(_0x4f452a){_0x18db4a[_0x6c71('0x42')]=_0x4f452a;return _0x18db4a;});}})[_0x6c71('0x24')](respondWithFilteredResult(_0x26a06a,_0x3d009a))[_0x6c71('0x43')](handleError(_0x26a06a,null));};exports[_0x6c71('0x58')]=function(_0x3d4b3e,_0x5baa84){return db['ChatWebsite'][_0x6c71('0x4a')]({'where':{'id':_0x3d4b3e[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x5baa84,null))['then'](function(_0x486356){if(_0x486356){return _0x486356[_0x6c71('0x58')](_0x3d4b3e['query'][_0x6c71('0x59')]);}})[_0x6c71('0x24')](respondWithStatusCode(_0x5baa84,null))[_0x6c71('0x43')](handleError(_0x5baa84,null));};exports[_0x6c71('0x5a')]=function(_0x38fb69,_0xada1cb){if(_0x38fb69[_0x6c71('0x4c')]['id']){delete _0x38fb69[_0x6c71('0x4c')]['id'];}return db['ChatWebsite'][_0x6c71('0x4a')]({'where':{'id':_0x38fb69['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0xada1cb,null))[_0x6c71('0x24')](function(_0x448d23){if(_0x448d23){_0x38fb69[_0x6c71('0x4c')][_0x6c71('0x57')]=_0x448d23['id'];return db[_0x6c71('0x5b')][_0x6c71('0x4b')](_0x38fb69[_0x6c71('0x4c')]);}})[_0x6c71('0x24')](respondWithResult(_0xada1cb,null))[_0x6c71('0x43')](handleError(_0xada1cb,null));};exports[_0x6c71('0x5c')]=function(_0x3199a3,_0x4ad849){var _0x33d090={'raw':![],'where':{}};var _0x391c82={};var _0x4198eb={'count':0x0,'rows':[]};return db[_0x6c71('0x3e')]['findOne']({'where':{'id':_0x3199a3['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x4ad849,null))[_0x6c71('0x24')](function(_0x3de2fb){if(_0x3de2fb){_0x391c82[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x5b')][_0x6c71('0x47')]);_0x391c82[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x3199a3[_0x6c71('0x2e')]);_0x391c82[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x391c82[_0x6c71('0x2d')],_0x391c82[_0x6c71('0x2e')]);_0x33d090[_0x6c71('0x31')]=_['intersection'](_0x391c82['model'],qs[_0x6c71('0x32')](_0x3199a3[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x33d090['attributes']=_0x33d090[_0x6c71('0x31')][_0x6c71('0x33')]?_0x33d090[_0x6c71('0x31')]:_0x391c82['model'];if(!_0x3199a3[_0x6c71('0x2e')]['hasOwnProperty'](_0x6c71('0x35'))){_0x33d090['limit']=qs[_0x6c71('0x20')](_0x3199a3[_0x6c71('0x2e')][_0x6c71('0x20')]);_0x33d090[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x3199a3[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0x33d090['order']=qs[_0x6c71('0x37')](_0x3199a3['query'][_0x6c71('0x37')]);_0x33d090[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x3199a3[_0x6c71('0x2e')],_0x391c82['filters']));_0x33d090[_0x6c71('0x38')][_0x6c71('0x57')]=_0x3de2fb['id'];if(_0x3199a3[_0x6c71('0x2e')]['filter']){_0x33d090['where']=_[_0x6c71('0x48')](_0x33d090[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x33d090[_0x6c71('0x31')],function(_0x10469f){var _0x223df8={};_0x223df8[_0x10469f]={'$like':'%'+_0x3199a3['query'][_0x6c71('0x3b')]+'%'};return _0x223df8;})});}_0x33d090=_[_0x6c71('0x48')]({},_0x33d090,_0x3199a3[_0x6c71('0x49')]);return db['CannedAnswer']['count']({'where':_0x33d090[_0x6c71('0x38')]})[_0x6c71('0x24')](function(_0x1a69c6){_0x4198eb[_0x6c71('0x1e')]=_0x1a69c6;if(_0x3199a3['query'][_0x6c71('0x3f')]){_0x33d090[_0x6c71('0x40')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x33d090);})['then'](function(_0x1c64e5){_0x4198eb[_0x6c71('0x42')]=_0x1c64e5;return _0x4198eb;});}})[_0x6c71('0x24')](respondWithFilteredResult(_0x4ad849,_0x33d090))[_0x6c71('0x43')](handleError(_0x4ad849,null));};exports[_0x6c71('0x5d')]=function(_0x4a905f,_0x54ff32){return db['ChatWebsite'][_0x6c71('0x4a')]({'where':{'id':_0x4a905f[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x54ff32,null))['then'](function(_0x4b82ba){if(_0x4b82ba){return _0x4b82ba[_0x6c71('0x5d')](_0x4a905f[_0x6c71('0x2e')][_0x6c71('0x59')]);}})[_0x6c71('0x24')](respondWithStatusCode(_0x54ff32,null))[_0x6c71('0x43')](handleError(_0x54ff32,null));};exports[_0x6c71('0x5e')]=function(_0xb83b0,_0x3816c5){_0xb83b0[_0x6c71('0x4c')][_0x6c71('0x5f')]=_0xb83b0['file']['filename'];return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0xb83b0[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x3816c5,null))[_0x6c71('0x24')](saveUpdates(_0xb83b0[_0x6c71('0x4c')],null))[_0x6c71('0x24')](respondWithResult(_0x3816c5,null))[_0x6c71('0x43')](handleError(_0x3816c5,null));};exports[_0x6c71('0x60')]=function(_0x1a1f4e,_0x3149ae){_0x1a1f4e[_0x6c71('0x4c')][_0x6c71('0x61')]=_0x1a1f4e[_0x6c71('0x62')][_0x6c71('0x63')];return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x1a1f4e[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x3149ae,null))[_0x6c71('0x24')](saveUpdates(_0x1a1f4e['body'],null))[_0x6c71('0x24')](respondWithResult(_0x3149ae,null))[_0x6c71('0x43')](handleError(_0x3149ae,null));};exports[_0x6c71('0x64')]=function(_0x247e7e,_0x556f7b){_0x247e7e[_0x6c71('0x4c')][_0x6c71('0x65')]=_0x247e7e[_0x6c71('0x62')][_0x6c71('0x63')];return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x247e7e[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x556f7b,null))[_0x6c71('0x24')](saveUpdates(_0x247e7e['body'],null))[_0x6c71('0x24')](respondWithResult(_0x556f7b,null))[_0x6c71('0x43')](handleError(_0x556f7b,null));};exports[_0x6c71('0x66')]=function(_0x5ee2a5,_0x3b22ab){_0x5ee2a5[_0x6c71('0x4c')]['systemAvatar']=_0x5ee2a5[_0x6c71('0x62')][_0x6c71('0x63')];return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x5ee2a5[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x3b22ab,null))[_0x6c71('0x24')](saveUpdates(_0x5ee2a5[_0x6c71('0x4c')],null))['then'](respondWithResult(_0x3b22ab,null))[_0x6c71('0x43')](handleError(_0x3b22ab,null));};exports[_0x6c71('0x67')]=function(_0x105410,_0x2f6684){var _0x29b104=path['join'](config[_0x6c71('0x68')],'server/files/images/logos/default_logo.svg');var _0x33040d={'where':{'id':_0x105410[_0x6c71('0x45')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4edb4c=![];return require(_0x6c71('0x69'))[_0x6c71('0x6a')]()[_0x6c71('0x24')](function(_0x43db03){if(_0x43db03){_0x4edb4c=_0x43db03[_0x6c71('0x6b')];}})[_0x6c71('0x24')](function(){return db['ChatWebsite'][_0x6c71('0x4a')](_0x33040d);})[_0x6c71('0x24')](handleEntityNotFound(_0x2f6684,null))[_0x6c71('0x24')](function(_0x4b744a){if(_0x4b744a){if(!_[_0x6c71('0x6c')](_0x4b744a[_0x6c71('0x5f')])){if(fs[_0x6c71('0x6d')](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x6f'),_0x4b744a[_0x6c71('0x5f')]))&&_0x4edb4c){_0x29b104=path['join'](config[_0x6c71('0x68')],'server/files/images/logos/',_0x4b744a[_0x6c71('0x5f')]);}}return _0x2f6684[_0x6c71('0x70')](_0x29b104);}})[_0x6c71('0x43')](handleError(_0x2f6684,null));};exports[_0x6c71('0x71')]=function(_0x2c7b09,_0xa14272){var _0x580949=path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x72'));var _0x198b51={'where':{'id':_0x2c7b09[_0x6c71('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6c71('0x3e')][_0x6c71('0x4a')](_0x198b51)[_0x6c71('0x24')](handleEntityNotFound(_0xa14272,null))[_0x6c71('0x24')](function(_0x215f8f){if(_0x215f8f){if(!_[_0x6c71('0x6c')](_0x215f8f[_0x6c71('0x61')])){if(fs[_0x6c71('0x6d')](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x73'),_0x215f8f[_0x6c71('0x61')]))){_0x580949=path[_0x6c71('0x6e')](config['root'],'server/files/images/avatars/',_0x215f8f['agentAvatar']);}}return _0xa14272['download'](_0x580949);}})[_0x6c71('0x43')](handleError(_0xa14272,null));};exports[_0x6c71('0x74')]=function(_0x39e641,_0x4ae86b){var _0x370570=path[_0x6c71('0x6e')](config['root'],_0x6c71('0x75'));var _0x11ceb5={'where':{'id':_0x39e641['params']['id']},'attributes':['id',_0x6c71('0x65'),_0x6c71('0x76')],'raw':!![]};return db[_0x6c71('0x3e')][_0x6c71('0x4a')](_0x11ceb5)['then'](handleEntityNotFound(_0x4ae86b,null))[_0x6c71('0x24')](function(_0x9c4772){if(_0x9c4772){if(!_[_0x6c71('0x6c')](_0x9c4772[_0x6c71('0x65')])){if(fs['existsSync'](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],_0x6c71('0x73'),_0x9c4772[_0x6c71('0x65')]))&&_0x9c4772[_0x6c71('0x76')]){_0x370570=path['join'](config['root'],_0x6c71('0x73'),_0x9c4772['customerAvatar']);}}return _0x4ae86b[_0x6c71('0x70')](_0x370570);}})[_0x6c71('0x43')](handleError(_0x4ae86b,null));};exports[_0x6c71('0x77')]=function(_0x47c027,_0x28361d){var _0x59a76b=path[_0x6c71('0x6e')](config['root'],_0x6c71('0x78'));var _0x561477={'where':{'id':_0x47c027[_0x6c71('0x45')]['id']},'attributes':['id',_0x6c71('0x79')],'raw':!![]};return db[_0x6c71('0x3e')]['find'](_0x561477)[_0x6c71('0x24')](handleEntityNotFound(_0x28361d,null))[_0x6c71('0x24')](function(_0x1d2638){if(_0x1d2638){if(!_[_0x6c71('0x6c')](_0x1d2638[_0x6c71('0x79')])){if(fs[_0x6c71('0x6d')](path['join'](config[_0x6c71('0x68')],_0x6c71('0x73'),_0x1d2638[_0x6c71('0x79')]))){_0x59a76b=path[_0x6c71('0x6e')](config['root'],_0x6c71('0x73'),_0x1d2638[_0x6c71('0x79')]);}}return _0x28361d[_0x6c71('0x70')](_0x59a76b);}})['catch'](handleError(_0x28361d,null));};exports['notify']=function(_0x4f5055,_0x26966e){var _0x31ada5=require(_0x6c71('0x7a'));var _0x3585d3=new _0x31ada5();var _0x343a2c=_0x3585d3[_0x6c71('0x7b')](_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x7d')])[_0x6c71('0x7e')]();var _0x33925c={'body':_0x4f5055[_0x6c71('0x4c')],'channel':'chat'};var _0x49206b=[];var _0xdb99c0=[];var _0x456523={};var _0x16a2c8=![];return db[_0x6c71('0x7f')][_0x6c71('0x53')]()[_0x6c71('0x24')](function(_0x11a799){if(!_0x11a799){throw new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))](_0x6c71('0x82'));}_0x49206b=_['difference'](_['keys'](_0x11a799),['createdAt',_0x6c71('0x83')]);_0xdb99c0=_[_0x6c71('0x84')](_[_0x6c71('0x2f')](_0x11a799),['createdAt','updatedAt',_0x6c71('0x85'),_0x6c71('0x86')]);if(_0x4f5055[_0x6c71('0x4c')]['id']){delete _0x4f5055['body']['id'];}if(_[_0x6c71('0x6c')](_0x4f5055['body'][_0x6c71('0x87')])){throw new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))](_0x6c71('0x88'));}if(_[_0x6c71('0x6c')](_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x4c')])||_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x4c')]===''){throw new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))](_0x6c71('0x89'));}if(_[_0x6c71('0x6c')](_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x8a')])){throw new db[(_0x6c71('0x80'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xdb99c0);}if(!_[_0x6c71('0x8b')](_0xdb99c0,_0x4f5055[_0x6c71('0x4c')]['mapKey'])){throw new db[(_0x6c71('0x80'))]['ValidationError'](_0x6c71('0x8c')+_0xdb99c0);}_0x456523[_0x4f5055['body'][_0x6c71('0x8a')]]=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x87')];})['then'](function(){return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x4f5055[_0x6c71('0x45')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6c71('0x7f')],'as':_0x6c71('0x8d'),'where':_0x456523,'limit':0x1,'order':[[_0x6c71('0x83'),_0x6c71('0x8e')]]}]},{'model':db[_0x6c71('0x8f')],'as':_0x6c71('0x90')}]});})[_0x6c71('0x24')](handleEntityNotFound(_0x26966e,null))['then'](function(_0x33f365){if(_0x33f365&&_0x33f365['List']){_0x33925c[_0x6c71('0x91')]=_0x33f365;_0x33925c[_0x6c71('0x92')]=_0x33f365[_0x6c71('0x90')];_0x33925c[_0x6c71('0x93')]=_0x33f365[_0x6c71('0x94')];_0x33925c[_0x6c71('0x92')]=_[_0x6c71('0x95')](_0x33925c[_0x6c71('0x92')],[_0x6c71('0x96')],[_0x6c71('0x97')]);if(_0x33925c['account'][_0x6c71('0x90')]){delete _0x33925c['account']['Applications'];}if(_0x33925c[_0x6c71('0x91')][_0x6c71('0x94')]&&_0x33925c[_0x6c71('0x91')]['List']['Contacts'][_0x6c71('0x33')]){return _0x33925c['account'][_0x6c71('0x94')][_0x6c71('0x8d')][0x0];}var _0x266dd6=_[_0x6c71('0x98')](_0x4f5055['body'],{'firstName':_0x4f5055[_0x6c71('0x4c')]['from'],'ListId':_0x33f365['ListId']});_0x266dd6[_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x8a')]]=_0x4f5055[_0x6c71('0x4c')]['from'];return db['CmContact'][_0x6c71('0x4b')](_0x266dd6,{'fields':_0x49206b,'raw':!![]});}})['then'](handleEntityNotFound(_0x26966e,null))[_0x6c71('0x24')](function(_0x418437){_0x33925c[_0x6c71('0x99')]=_0x418437;var _0x1ef21b=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0x9a')];if(_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x9b')]){_0x1ef21b=_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x9b')];}else if(_0x4f5055['headers'][_0x6c71('0x9c')]){_0x1ef21b=_['first'](_0x4f5055[_0x6c71('0x7c')][_0x6c71('0x9c')][_0x6c71('0x9d')](','));}if(_0x418437){var _0xe5a079={'ContactId':_0x418437['id'],'ChatWebsiteId':_0x4f5055[_0x6c71('0x45')]['id'],'from':(_0x418437[_0x6c71('0x9e')]||'')+'\x20'+(_0x418437[_0x6c71('0x9f')]||''),'customerIp':_0x1ef21b,'customerPort':_0x4f5055[_0x6c71('0x7c')][_0x6c71('0xa0')]?_0x4f5055['headers'][_0x6c71('0xa0')]:null,'referer':_0x4f5055['body'][_0x6c71('0xa1')],'browserName':_0x343a2c[_0x6c71('0xa2')][_0x6c71('0x28')]&&_0x343a2c['browser']['version']?util['format'](_0x6c71('0xa3'),_0x343a2c['browser'][_0x6c71('0x28')],_0x343a2c[_0x6c71('0xa2')][_0x6c71('0xa4')]):_0x6c71('0xa5'),'browserVersion':_0x343a2c[_0x6c71('0xa2')]['version']||_0x6c71('0xa5'),'osName':util[_0x6c71('0xa6')](_0x6c71('0xa3'),_0x343a2c['os']['name'],_0x343a2c['os'][_0x6c71('0xa4')]),'osVersion':_0x343a2c['os'][_0x6c71('0xa4')],'deviceModel':_0x343a2c[_0x6c71('0xa7')][_0x6c71('0x2d')]&&_0x343a2c[_0x6c71('0xa7')][_0x6c71('0xa8')]?util[_0x6c71('0xa6')]('%s\x20%s\x20%s',_0x343a2c['device']['model'],_0x343a2c[_0x6c71('0xa7')]['vendor'],_0x343a2c['device']['type']):null,'deviceVendor':_0x343a2c[_0x6c71('0xa7')][_0x6c71('0xa8')],'deviceType':_0x343a2c['device'][_0x6c71('0x3c')],'formData':JSON['stringify'](_0x4f5055[_0x6c71('0x4c')])};var _0x19566b={'ChatWebsiteId':_0x4f5055[_0x6c71('0x45')]['id'],'closed':![]};if(_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xa9')]){_0x19566b[_0x6c71('0xa9')]=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xa9')];return db[_0x6c71('0xaa')][_0x6c71('0x4a')]({'where':_0x19566b})[_0x6c71('0x24')](function(_0x545506){if(_0x545506){return[_0x545506,![]];}_0xe5a079[_0x6c71('0xa9')]=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xa9')];_0xe5a079['externalUrl']=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xab')];return db['ChatInteraction'][_0x6c71('0x4b')](_0xe5a079)[_0x6c71('0x24')](function(_0x41dccd){return[_0x41dccd,!![]];});});}_0x19566b['ContactId']=_0x418437['id'];if(_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xac')]&&_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xac')]['id']){_0x19566b['id']=_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xac')]['id'];return db[_0x6c71('0xaa')]['find']({'where':_0x19566b})[_0x6c71('0x24')](function(_0x47ed5e){if(_0x47ed5e){return[_0x47ed5e,![]];}return db[_0x6c71('0xaa')][_0x6c71('0x4b')](_0xe5a079)[_0x6c71('0x24')](function(_0x5a4480){return[_0x5a4480,!![]];});});}return db[_0x6c71('0xaa')]['create'](_0xe5a079)['then'](function(_0x4d727d){return[_0x4d727d,!![]];});}})['spread'](function(_0xff0dbe,_0x81eb62){if(_0xff0dbe){_0x16a2c8=_0x81eb62;if(!_0x81eb62){var _0x3f90d7={'from':(_0x33925c['contact'][_0x6c71('0x9e')]||'')+'\x20'+(_0x33925c['contact']['lastName']||'')};if(_0x4f5055['body']['threadId']&&_0x4f5055['body'][_0x6c71('0xad')]&&_0x4f5055[_0x6c71('0x4c')]['threadId']!=_0x4f5055['body'][_0x6c71('0xad')]){_0x3f90d7[_0x6c71('0xa9')]=_0x4f5055['body'][_0x6c71('0xad')];}return _0xff0dbe['update'](_0x3f90d7);}else{return _0xff0dbe;}}})['then'](function(_0x2711dd){_0x33925c[_0x6c71('0xac')]=_0x2711dd['get']({'plain':!![]});_0x33925c[_0x6c71('0xac')][_0x6c71('0xae')]=_0x16a2c8;if(_0x33925c['interaction'][_0x6c71('0xae')]){if(_0x33925c[_0x6c71('0x91')][_0x6c71('0xaf')]){_0x33925c[_0x6c71('0x92')][_0x6c71('0xb0')]({'id':0x0,'priority':_0x33925c[_0x6c71('0x92')]['length']+0x1,'app':_0x6c71('0xb1'),'appdata':_0x6c71('0xb2'),'interval':'*,*,*,*'});}}return db[_0x6c71('0xb3')][_0x6c71('0x4b')]({'body':_0x4f5055[_0x6c71('0x4c')]['body'],'ChatWebsiteId':_0x4f5055[_0x6c71('0x45')]['id'],'ChatInteractionId':_0x2711dd['id'],'direction':'in','ContactId':_0x33925c['contact']['id'],'AttachmentId':_0x4f5055[_0x6c71('0x4c')][_0x6c71('0xb4')]});})[_0x6c71('0x24')](function(_0x169631){_0x33925c[_0x6c71('0x18')]=_0x169631;if(_0x33925c[_0x6c71('0xac')][_0x6c71('0xb5')]){return db[_0x6c71('0xb6')]['find']({'attributes':['id',_0x6c71('0x28')],'where':{'id':_0x33925c[_0x6c71('0xac')]['UserId']}})[_0x6c71('0x24')](function(_0x38a45e){if(_0x38a45e){_0x33925c[_0x6c71('0x92')][_0x6c71('0xb7')]({'id':0x0,'priority':0x0,'app':_0x6c71('0xb8'),'appdata':_0x38a45e[_0x6c71('0x28')]+','+(_0x33925c[_0x6c71('0x91')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x33925c[_0x6c71('0xb9')]=!![];}return respondWithRpcPromise('Start',_0x6c71('0xba'),_0x33925c);});}return respondWithRpcPromise(_0x6c71('0xbb'),_0x6c71('0xba'),_0x33925c);})[_0x6c71('0x24')](function(_0x174ef2){respondWithRpcPromise(_0x6c71('0xbc'),'EventManager',{'event':_0x6c71('0xbd'),'message':_0x174ef2},client9002);return _0x174ef2;})[_0x6c71('0x24')](respondWithResult(_0x26966e,null))[_0x6c71('0x43')](handleError(_0x26966e,null));};exports['offline']=function(_0x267bfa,_0x350d00){var _0x63d3e6,_0x5ac1aa,_0x1d2983;var _0x2cb65e=[];var _0x40a4a1={};var _0x3d86b2=_0x267bfa[_0x6c71('0xbe')]||[];var _0x552846=[];var _0x5cb230;return db[_0x6c71('0x7f')][_0x6c71('0x53')]()['then'](function(_0x5e231a){if(!_0x5e231a){throw new db['Sequelize']['ValidationError'](_0x6c71('0x82'));}_0x2cb65e=_[_0x6c71('0x84')](_[_0x6c71('0x2f')](_0x5e231a),[_0x6c71('0xbf'),'updatedAt',_0x6c71('0x85'),_0x6c71('0x86')]);if(_0x267bfa['body']['id']){delete _0x267bfa[_0x6c71('0x4c')]['id'];}if(_[_0x6c71('0x6c')](_0x267bfa[_0x6c71('0x4c')]['from'])){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db[(_0x6c71('0x80'))]['ValidationError'](_0x6c71('0x88')));}if(_[_0x6c71('0x6c')](_0x267bfa['body'][_0x6c71('0x4c')])||_0x267bfa['body'][_0x6c71('0x4c')]===''){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db[(_0x6c71('0x80'))]['ValidationError'](_0x6c71('0x89')));}if(_['isNil'](_0x267bfa[_0x6c71('0x4c')][_0x6c71('0xc0')])){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db['Sequelize'][(_0x6c71('0x81'))](_0x6c71('0xc1')+_0x2cb65e));}if(!_[_0x6c71('0x8b')](_0x2cb65e,_0x267bfa[_0x6c71('0x4c')][_0x6c71('0xc0')])){throw _0x350d00[_0x6c71('0x21')](0x1f4)[_0x6c71('0x29')](new db[(_0x6c71('0x80'))][(_0x6c71('0x81'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cb65e));}_0x40a4a1[_0x267bfa['body'][_0x6c71('0xc0')]]=_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x87')];})[_0x6c71('0x24')](function(){return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x267bfa['params']['id']},'include':[{'model':db[_0x6c71('0xc2')],'as':_0x6c71('0x94')},{'model':db[_0x6c71('0xc3')],'as':_0x6c71('0xc3')}]});})['then'](handleEntityNotFound(_0x350d00,null))['then'](function(_0x4e09ca){if(_0x4e09ca&&_0x4e09ca['List']){_0x5ac1aa=_0x4e09ca;var _0x8d42ea=_[_0x6c71('0x98')](_0x267bfa['body'],{'firstName':_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x87')],'phone':_0x267bfa[_0x6c71('0x4c')]['from'],'ListId':_0x4e09ca[_0x6c71('0x86')]});_0x8d42ea[_0x267bfa['body'][_0x6c71('0xc0')]]=_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x87')];return db[_0x6c71('0x7f')][_0x6c71('0xc4')]({'where':_0x40a4a1,'defaults':_0x8d42ea});}})[_0x6c71('0xc5')](function(_0x316a5f){if(_0x316a5f){_0x1d2983=_0x316a5f;var _0x23d942=fs[_0x6c71('0xc6')](path[_0x6c71('0x6e')](config['root'],_0x6c71('0xc7')),_0x6c71('0xc8'));var _0x38e0c8=ejs[_0x6c71('0xc9')](_0x23d942,{'body':_[_0x6c71('0xca')](_0x267bfa[_0x6c71('0x4c')][_0x6c71('0x4c')]),'bodyTitle':_0x5ac1aa[_0x6c71('0xcb')]});return db[_0x6c71('0xcc')][_0x6c71('0x4b')]({'body':_0x38e0c8,'plainBody':htmlToText[_0x6c71('0xcd')](_0x38e0c8),'ContactId':_0x316a5f['id'],'ChatWebsiteId':_0x5ac1aa['id']});}})[_0x6c71('0x24')](function(_0x540929){_0x5cb230=_0x540929;if(_0x3d86b2[_0x6c71('0x33')]){var _0x361783=_0x3d86b2['map'](function(_0x297712){return{'name':_0x297712['originalname'],'basename':_0x297712['filename'],'type':_0x297712[_0x6c71('0xce')],'ChatOfflineMessageId':_0x540929['id']};});_0x552846=_0x361783['map'](_0x162d98=>{var _0x5df360={'filename':_0x162d98['name'],'path':path[_0x6c71('0x6e')](config['root'],_0x6c71('0xcf'),_0x6c71('0xbe'),_0x6c71('0xd0'),'offline-chat',_0x162d98[_0x6c71('0xd1')])};return _0x5df360;});if(!_0x5ac1aa[_0x6c71('0xd2')]){return db[_0x6c71('0xd3')][_0x6c71('0xd4')](function(_0x10cea1){return db[_0x6c71('0xd5')][_0x6c71('0xd6')](_0x361783,{'transaction':_0x10cea1});});}}})[_0x6c71('0x24')](function(){if(_0x5cb230){_0x63d3e6=_0x5cb230;return db['MailAccount'][_0x6c71('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x6c71('0xd7')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6c71('0xd8')],'as':_0x6c71('0xd8'),'raw':!![]}]}]});}})[_0x6c71('0x24')](function(_0x50d7e9){if(_0x50d7e9&&_0x50d7e9[_0x6c71('0xd9')]&&_0x5ac1aa[_0x6c71('0xda')]&&_0x5ac1aa[_0x6c71('0xdb')]){var _0x356941=_0x50d7e9[_0x6c71('0xdc')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x356941,'message':{'from':util['format'](_0x6c71('0xdd'),_0x50d7e9['name'],_0x50d7e9[_0x6c71('0xde')]||_0x50d7e9[_0x6c71('0xd9')][_0x6c71('0x4d')]),'to':_0x5ac1aa[_0x6c71('0xdb')],'subject':_0x5ac1aa['offlineMessageSubject'],'html':_0x63d3e6[_0x6c71('0x4c')],'attachments':_0x552846}},client9003)[_0x6c71('0x24')](function(){return _0x63d3e6;})[_0x6c71('0x43')](function(_0x5ee928){logger[_0x6c71('0x16')](_0x5ee928);});}})[_0x6c71('0x24')](function(){if(_0x5ac1aa&&_0x5ac1aa[_0x6c71('0xd2')]&&_0x5ac1aa[_0x6c71('0xdf')]){var _0x4bf9a3=[];if(_0x3d86b2[_0x6c71('0x33')]){_0x4bf9a3=_0x3d86b2['map'](function(_0x1eac00){return{'name':_0x1eac00[_0x6c71('0xe0')],'basename':_0x1eac00['filename'],'type':_0x1eac00['mimetype'],'ChatOfflineMessageId':_0x5cb230['id']};});}var _0x44fbf8;if(!_['isNil'](_0x5ac1aa[_0x6c71('0xe1')])){var _0x540615=_[_0x6c71('0x2c')](_0x267bfa[_0x6c71('0x4c')],function(_0x18589d){return _0x18589d;});var _0xe640ba=_['toPairsIn'](_0x540615)[0x0];var _0x266f35=_[_0x6c71('0xe2')](_0xe640ba,function(_0x472a0c){return _0x472a0c;});_0x44fbf8=_0x266f35[0x1][_0x5ac1aa[_0x6c71('0xe1')]];}var _0x337046={'from':_0x1d2983[_0x6c71('0xde')],'firstName':_0x1d2983[_0x6c71('0x9e')],'lastName':_0x1d2983[_0x6c71('0x9f')],'mapKey':_0x6c71('0xde'),'message':{'from':_0x1d2983[_0x6c71('0xde')],'to':_0x5ac1aa[_0x6c71('0xc3')]['email'],'cc':'','subject':_['isNil'](_0x44fbf8)?_0x5ac1aa[_0x6c71('0xe3')]:_0x44fbf8,'messageId':'','sentAt':new Date(),'attach':_0x4bf9a3['length'],'attachments':_0x4bf9a3,'originChannel':_0x6c71('0xe4'),'ChatWebsiteId':_0x5ac1aa['id'],'ChatOfflineMessageId':_0x63d3e6['id'],'originTo':_0x5ac1aa['MailAccount'][_0x6c71('0xde')]},'body':_0x63d3e6[_0x6c71('0x4c')]};var _0x335087={'account':{'id':_0x5ac1aa[_0x6c71('0xdf')]},'body':_0x337046,'log':_0x6c71('0xe5')};return respondWithRpcPromise(_0x6c71('0xe5'),_0x6c71('0xe6'),_0x335087,client9001)[_0x6c71('0x24')](function(){return _0x63d3e6;})[_0x6c71('0x43')](function(_0x23a7c0){logger[_0x6c71('0x16')](_0x23a7c0);});}return;})[_0x6c71('0x24')](function(){if(_0x63d3e6){return _0x63d3e6;}})[_0x6c71('0x24')](respondWithResult(_0x350d00,null))[_0x6c71('0x43')](function(_0x1dc9f7){logger[_0x6c71('0x16')](_0x6c71('0x43'),_0x1dc9f7);for(var _0xd343f2 of _0x3d86b2){var _0x231b54=path[_0x6c71('0x6e')](config['root'],'server',_0x6c71('0xbe'),'attachments',_0x6c71('0xe7'),_0xd343f2[_0x6c71('0x63')]);fs_extra[_0x6c71('0xe8')](_0x231b54)[_0x6c71('0x43')](function(_0x52e2c2){logger[_0x6c71('0x16')](_0x6c71('0xe9'),_0x231b54,_0x52e2c2);});}});};exports['addInteraction']=function(_0x8edaea,_0x6a8147){return db['ChatInteraction'][_0x6c71('0x4a')]({'where':{'id':_0x8edaea['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x6a8147,null))[_0x6c71('0x24')](function(_0xbe4cef){if(_0xbe4cef){return _0xbe4cef[_0x6c71('0xea')](_0x8edaea[_0x6c71('0x4c')][_0x6c71('0x59')],_[_0x6c71('0xeb')](_0x8edaea[_0x6c71('0x4c')],[_0x6c71('0x59'),'id'])||{});}})[_0x6c71('0x24')](respondWithResult(_0x6a8147,null))[_0x6c71('0x43')](handleError(_0x6a8147,null));};exports[_0x6c71('0xec')]=function(_0xa6d7cb,_0x4277fc){var _0x153b25={'raw':![],'where':{}};var _0x767c85={};var _0x2f07bd={'count':0x0,'rows':[]};return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0xa6d7cb['params']['id']}})['then'](handleEntityNotFound(_0x4277fc,null))[_0x6c71('0x24')](function(_0x9bbade){if(_0x9bbade){_0x767c85['model']=_[_0x6c71('0x2f')](db[_0x6c71('0xaa')]['rawAttributes']);_0x767c85[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0xa6d7cb[_0x6c71('0x2e')]);_0x767c85[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x767c85[_0x6c71('0x2d')],_0x767c85['query']);_0x153b25[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x767c85[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x153b25[_0x6c71('0x31')]=_0x153b25[_0x6c71('0x31')][_0x6c71('0x33')]?_0x153b25['attributes']:_0x767c85[_0x6c71('0x2d')];if(!_0xa6d7cb[_0x6c71('0x2e')]['hasOwnProperty'](_0x6c71('0x35'))){_0x153b25[_0x6c71('0x20')]=qs[_0x6c71('0x20')](_0xa6d7cb['query'][_0x6c71('0x20')]);_0x153b25['offset']=qs[_0x6c71('0x1f')](_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0x153b25[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x37')]);_0x153b25[_0x6c71('0x38')]=qs['filters'](_['pick'](_0xa6d7cb[_0x6c71('0x2e')],_0x767c85[_0x6c71('0x3a')]));_0x153b25[_0x6c71('0x38')][_0x6c71('0x57')]=_0x9bbade['id'];if(_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x153b25[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0x153b25['where'],{'$or':_[_0x6c71('0x2c')](_0x153b25[_0x6c71('0x31')],function(_0x296242){var _0x4016b1={};_0x4016b1[_0x296242]={'$like':'%'+_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x4016b1;})});}_0x153b25=_[_0x6c71('0x48')]({},_0x153b25,_0xa6d7cb[_0x6c71('0x49')]);return db[_0x6c71('0xaa')][_0x6c71('0x1e')]({'where':_0x153b25[_0x6c71('0x38')]})[_0x6c71('0x24')](function(_0x543ddf){_0x2f07bd[_0x6c71('0x1e')]=_0x543ddf;if(_0xa6d7cb[_0x6c71('0x2e')]['includeAll']){_0x153b25[_0x6c71('0x40')]=[{'model':db[_0x6c71('0x7f')],'as':_0x6c71('0xed'),'required':![]},{'model':db['User'],'as':_0x6c71('0xee'),'attributes':[_0x6c71('0x28'),_0x6c71('0xef'),_0x6c71('0xf0')],'required':![]},{'model':db[_0x6c71('0xf1')],'as':_0x6c71('0xf2'),'attributes':['id',_0x6c71('0x28'),_0x6c71('0xf3')],'where':_0xa6d7cb[_0x6c71('0x2e')]['tag']?{'id':_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0xf4')]}:undefined,'required':_0xa6d7cb[_0x6c71('0x2e')][_0x6c71('0xf4')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x153b25);})[_0x6c71('0x24')](function(_0x3c520d){_0x2f07bd[_0x6c71('0x42')]=_0x3c520d;return _0x2f07bd;});}})['then'](respondWithFilteredResult(_0x4277fc,_0x153b25))[_0x6c71('0x43')](handleError(_0x4277fc,null));};function iftimePromise(_0x16247c,_0x14979c){return respondWithRpcPromise(_0x6c71('0xf5'),_0x6c71('0xf6'),{'command':_0x14979c[_0x6c71('0xf7')]?util[_0x6c71('0xa6')](_0x6c71('0xf8'),_0x16247c[_0x6c71('0xf9')],_0x14979c[_0x6c71('0xf7')]):util[_0x6c71('0xa6')]('iftime\x20%s',_0x16247c[_0x6c71('0xf9')])},client9002)['then'](function(_0x3de419){var _0x29c06d=_0x3de419&&_0x3de419['indexOf'](_0x6c71('0xfa'))>=0x0?!![]:![];logger[_0x6c71('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14979c['id'],_0x16247c['id'],_0x16247c[_0x6c71('0xf9')],_0x29c06d?_0x6c71('0xfb'):_0x6c71('0xfc'),_0x14979c['timezone']?_0x14979c[_0x6c71('0xf7')]:_0x6c71('0xfd'));return _0x29c06d;})[_0x6c71('0x43')](function(_0x376213){logger[_0x6c71('0x16')](_0x6c71('0xfe'),_0x14979c['id'],_0x16247c['id'],_0x16247c[_0x6c71('0xf9')],util[_0x6c71('0xff')](_0x376213,{'showHidden':![],'depth':null}),_0x14979c[_0x6c71('0xf7')]?_0x14979c[_0x6c71('0xf7')]:_0x6c71('0xfd'));return![];});}exports[_0x6c71('0xf6')]=function(_0x26faa3,_0x2bef6d){var _0x291127=0x0;var _0x3b93f9=0x0;var _0x2601e3=![];var _0x48bd32;var _0x2f3925;return db[_0x6c71('0x3e')][_0x6c71('0x4a')]({'where':{'id':_0x26faa3['params']['id']},'include':[{'model':db[_0x6c71('0x100')],'as':_0x6c71('0x100'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x6c71('0xf9')],'raw':!![]}]}]})[_0x6c71('0x24')](handleEntityNotFound(_0x2bef6d,null))[_0x6c71('0x24')](function(_0x31ef19){if(_0x31ef19){_0x48bd32=_0x31ef19;return _0x31ef19[_0x6c71('0x101')]({'raw':!![]});}})[_0x6c71('0x24')](function(_0x192160){if(_0x48bd32){if(_0x192160){_0x2f3925=_0x192160;}}return require(_0x6c71('0x69'))[_0x6c71('0x6a')]();})[_0x6c71('0x24')](function(_0x3ac7c4){if(_0x3ac7c4){_0x3b93f9=_0x3ac7c4[_0x6c71('0x102')];_0x2601e3=_0x3ac7c4[_0x6c71('0x6b')];}})['then'](function(){return db[_0x6c71('0xaa')][_0x6c71('0x1e')]({'where':{'closed':![]}});})[_0x6c71('0x24')](function(_0x215f32){_0x291127=_0x215f32;if(_0x3b93f9&&_0x215f32>_0x3b93f9){return db[_0x6c71('0x103')][_0x6c71('0x56')]({'where':{'id':0x1}})[_0x6c71('0x24')](function(_0xcb210f){if(_0xcb210f){_0xcb210f[_0x6c71('0x104')](_0x6c71('0x105'));}});}})[_0x6c71('0x24')](function(){if(_0x48bd32['Interval']&&_0x48bd32['Interval'][_0x6c71('0x106')]){var _0x985661=[];for(var _0x575a24=0x0;_0x575a24<_0x48bd32['Interval'][_0x6c71('0x106')][_0x6c71('0x33')];_0x575a24++){var _0x573219=_0x48bd32[_0x6c71('0x100')][_0x6c71('0x106')][_0x575a24][_0x6c71('0x25')]({'plain':!![]});_0x985661[_0x6c71('0xb0')](iftimePromise(_0x573219,_0x48bd32));}return BPromise[_0x6c71('0x107')](_0x985661)[_0x6c71('0x24')](function(_0x20eedd){return _[_0x6c71('0x108')](_0x20eedd);});}else{return!![];}})[_0x6c71('0x24')](function(_0x4b47ea){var _0x4bbbc6=fs['readFileSync'](path[_0x6c71('0x6e')](config[_0x6c71('0x68')],'server/files/chat/iframe.ejs'),_0x6c71('0xc8'));var _0x338160={'remote':_0x48bd32[_0x6c71('0x109')],'query':querystring[_0x6c71('0x15')](_[_0x6c71('0x48')](_0x48bd32[_0x6c71('0x25')]({'plain':!![]}),{'customerIp':_0x26faa3[_0x6c71('0x7c')][_0x6c71('0x9c')]||_0x26faa3[_0x6c71('0x7c')]['x-real-ip']||_0x26faa3[_0x6c71('0x10a')][_0x6c71('0x10b')]||_0x26faa3['ip'],'referer':_0x26faa3[_0x6c71('0x7c')][_0x6c71('0xa1')],'openedInteractions':_0x291127,'maxInteractions':_0x3b93f9,'virtual':_0x2601e3[_0x6c71('0x102')],'online':_0x4b47ea,'custom':_0x2601e3}))[_0x6c71('0x10c')](/'/g,'\x5c\x27')};_0x2bef6d[_0x6c71('0x29')](ejs[_0x6c71('0xc9')](Mustache['render'](_0x4bbbc6,_0x338160),{'proactiveActions':_0x2f3925,'alignment':_0x48bd32[_0x6c71('0x10d')],'verticalAlignment':_0x48bd32[_0x6c71('0x10e')],'div_color':_0x48bd32[_0x6c71('0xf3')],'labelText':_0x48bd32[_0x6c71('0x10f')],'text_color':_0x48bd32[_0x6c71('0x110')],'text_button_color':_0x48bd32[_0x6c71('0x111')],'button_color':_0x48bd32['color_button'],'background_color':_0x48bd32['backgroundColor'],'hideWhenOffline':_0x48bd32['hideWhenOffline'],'interval':_0x48bd32[_0x6c71('0x112')]}));})['catch'](handleError(_0x2bef6d,null));};exports[_0x6c71('0x113')]=function(_0x5378fa,_0x3606a4){var _0x2c1de3=_0x5378fa[_0x6c71('0x45')]['id'];var _0x509b47=_0x5378fa[_0x6c71('0x4c')];var _0x3773ba=0xc8;var _0x2dcd5f=null;return db['sequelize'][_0x6c71('0xd4')]({'isolationLevel':db[_0x6c71('0xd3')]['Transaction'][_0x6c71('0x114')]['READ_COMMITTED']},function(_0x11bbfc){return db['ChatWebsite'][_0x6c71('0x56')]({'where':{'id':_0x2c1de3},'transaction':_0x11bbfc})['then'](function(_0xea1473){if(_0xea1473){return db['ChatApplication'][_0x6c71('0x23')]({'where':{'ChatWebsiteId':_0x2c1de3},'transaction':_0x11bbfc})[_0x6c71('0x24')](function(){var _0x213ac5=_[_0x6c71('0x2c')](_0x509b47,function(_0x1834b4){_0x1834b4['ChatWebsiteId']=_0x2c1de3;return _0x1834b4;});return db[_0x6c71('0x8f')]['bulkCreate'](_0x213ac5,{'transaction':_0x11bbfc});});}else{_0x3773ba=0x194;_0x2dcd5f=[];}});})[_0x6c71('0x24')](function(){if(_0x3773ba!==0x194){return db['ChatApplication'][_0x6c71('0x115')]({'where':{'ChatWebsiteId':_0x2c1de3},'order':_0x6c71('0x96')})['then'](function(_0x38d20f){_0x2dcd5f=_0x38d20f;});}})[_0x6c71('0x43')](function(_0x57f741){_0x3773ba=0x1f4;logger[_0x6c71('0x16')](_0x57f741['stack']);if(_0x57f741[_0x6c71('0x28')]){delete _0x57f741['name'];}_0x2dcd5f=_0x57f741;})[_0x6c71('0x116')](function(){if(_0x2dcd5f===null){_0x3606a4[_0x6c71('0x27')](_0x3773ba);}else{if(_0x3773ba===0x1f4){_0x3606a4['status'](_0x3773ba)[_0x6c71('0x29')](_0x2dcd5f);}else{_0x3606a4[_0x6c71('0x21')](_0x3773ba)['json'](_0x2dcd5f);}}});};exports[_0x6c71('0x117')]=function(_0x3fd315,_0x315f1e){var _0x353228={};var _0x25699b={};var _0x2ca847;var _0x83b625;return db['ChatWebsite'][_0x6c71('0x56')]({'where':{'id':_0x3fd315[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x315f1e,null))[_0x6c71('0x24')](function(_0x3b3e19){if(_0x3b3e19){_0x2ca847=_0x3b3e19;_0x25699b['model']=_[_0x6c71('0x2f')](db['ChatApplication']['rawAttributes']);_0x25699b[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x3fd315[_0x6c71('0x2e')]);_0x25699b[_0x6c71('0x3a')]=_['intersection'](_0x25699b[_0x6c71('0x2d')],_0x25699b['query']);_0x353228[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x25699b[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x353228[_0x6c71('0x31')]=_0x353228[_0x6c71('0x31')][_0x6c71('0x33')]?_0x353228['attributes']:_0x25699b['model'];_0x353228[_0x6c71('0x36')]=qs['sort'](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x37')]);_0x353228[_0x6c71('0x38')]=qs['filters'](_[_0x6c71('0x39')](_0x3fd315['query'],_0x25699b[_0x6c71('0x3a')]));if(_0x3fd315[_0x6c71('0x2e')]['filter']){_0x353228[_0x6c71('0x38')]=_['merge'](_0x353228[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x353228[_0x6c71('0x31')],function(_0x1e127d){var _0x5c14f6={};_0x5c14f6[_0x1e127d]={'$like':'%'+_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x5c14f6;})});}_0x353228=_[_0x6c71('0x48')]({},_0x353228,_0x3fd315[_0x6c71('0x49')]);return _0x2ca847[_0x6c71('0x117')](_0x353228);}})[_0x6c71('0x24')](function(_0x3b51e0){if(_0x3b51e0){_0x83b625=_0x3b51e0[_0x6c71('0x33')];if(!_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x34')](_0x6c71('0x35'))){_0x353228[_0x6c71('0x20')]=qs['limit'](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x20')]);_0x353228[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x3fd315[_0x6c71('0x2e')][_0x6c71('0x1f')]);}return _0x2ca847[_0x6c71('0x117')](_0x353228);}})[_0x6c71('0x24')](function(_0x565d47){if(_0x565d47){return _0x565d47?{'count':_0x83b625,'rows':_0x565d47}:null;}})[_0x6c71('0x24')](respondWithResult(_0x315f1e,null))[_0x6c71('0x43')](handleError(_0x315f1e,null));};exports[_0x6c71('0x118')]=function(_0x34f3c3,_0x7050df){return db[_0x6c71('0x119')][_0x6c71('0x4a')]({'where':{'id':_0x34f3c3['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x7050df,null))[_0x6c71('0x24')](function(_0x280d3a){if(_0x280d3a){return _0x280d3a[_0x6c71('0x118')](_0x34f3c3[_0x6c71('0x4c')][_0x6c71('0x59')],_[_0x6c71('0xeb')](_0x34f3c3[_0x6c71('0x4c')],[_0x6c71('0x59'),'id'])||{});}})[_0x6c71('0x24')](respondWithResult(_0x7050df,null))[_0x6c71('0x43')](handleError(_0x7050df,null));};exports[_0x6c71('0x101')]=function(_0x97bd56,_0x54c602){var _0x53ede8={};var _0x47bcbe={};var _0x6633a2;var _0x56bffe;return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0x97bd56[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x54c602,null))[_0x6c71('0x24')](function(_0xe0bf61){if(_0xe0bf61){_0x6633a2=_0xe0bf61;_0x47bcbe[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0x11a')][_0x6c71('0x47')]);_0x47bcbe['query']=_[_0x6c71('0x2f')](_0x97bd56['query']);_0x47bcbe['filters']=_[_0x6c71('0x30')](_0x47bcbe[_0x6c71('0x2d')],_0x47bcbe[_0x6c71('0x2e')]);_0x53ede8[_0x6c71('0x31')]=_['intersection'](_0x47bcbe[_0x6c71('0x2d')],qs['fields'](_0x97bd56['query'][_0x6c71('0x32')]));_0x53ede8['attributes']=_0x53ede8[_0x6c71('0x31')]['length']?_0x53ede8[_0x6c71('0x31')]:_0x47bcbe[_0x6c71('0x2d')];_0x53ede8[_0x6c71('0x36')]=qs[_0x6c71('0x37')](_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x37')]);_0x53ede8[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x97bd56[_0x6c71('0x2e')],_0x47bcbe[_0x6c71('0x3a')]));if(_0x97bd56['query']['filter']){_0x53ede8['where']=_[_0x6c71('0x48')](_0x53ede8[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x53ede8[_0x6c71('0x31')],function(_0x3e6797){var _0x1994cf={};_0x1994cf[_0x3e6797]={'$like':'%'+_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x1994cf;})});}_0x53ede8=_[_0x6c71('0x48')]({},_0x53ede8,_0x97bd56[_0x6c71('0x49')]);return _0x6633a2[_0x6c71('0x101')](_0x53ede8);}})[_0x6c71('0x24')](function(_0x59fba8){if(_0x59fba8){_0x56bffe=_0x59fba8[_0x6c71('0x33')];if(!_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x34')]('nolimit')){_0x53ede8[_0x6c71('0x20')]=qs['limit'](_0x97bd56['query'][_0x6c71('0x20')]);_0x53ede8[_0x6c71('0x1f')]=qs['offset'](_0x97bd56[_0x6c71('0x2e')][_0x6c71('0x1f')]);}return _0x6633a2['getProactiveActions'](_0x53ede8);}})[_0x6c71('0x24')](function(_0x59db78){if(_0x59db78){return _0x59db78?{'count':_0x56bffe,'rows':_0x59db78}:null;}})[_0x6c71('0x24')](respondWithResult(_0x54c602,null))['catch'](handleError(_0x54c602,null));};exports[_0x6c71('0x11b')]=function(_0x5c171a,_0x200c64){var _0x5f2968=_0x5c171a[_0x6c71('0x2e')][_0x6c71('0x11c')]===_0x6c71('0x11d')?_0x6c71('0x11e'):'onlineForm';return db['ChatWebsite'][_0x6c71('0x4a')]({'attributes':['id',_0x5f2968],'where':{'id':_0x5c171a[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x200c64,null))[_0x6c71('0x24')](function(_0x3a3ae2){if(_0x3a3ae2){var _0xca5f5f=_0x3a3ae2[_0x5f2968];var _0x5c2f1f=_0xca5f5f&&_0xca5f5f[_0x6c71('0x11f')]?_0xca5f5f[_0x6c71('0x11f')]:[];_0x200c64[_0x6c71('0x29')]({'fromKey':_[_0x6c71('0x6c')](_0xca5f5f[_0x6c71('0x120')])?undefined:_0xca5f5f[_0x6c71('0x120')],'count':_0x5c2f1f['length'],'rows':_0x5c2f1f});}})[_0x6c71('0x43')](handleError(_0x200c64,null));};exports[_0x6c71('0x121')]=function(_0x4a50ed,_0x44522c){var _0xeb8018={'raw':![],'where':{}};var _0x111aaf={};var _0x13cd9c={'count':0x0,'rows':[]};return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0x4a50ed['params']['id']}})['then'](handleEntityNotFound(_0x44522c,null))[_0x6c71('0x24')](function(_0x1b4fdf){if(_0x1b4fdf){_0x111aaf[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0xcc')][_0x6c71('0x47')]);_0x111aaf[_0x6c71('0x2e')]=_[_0x6c71('0x2f')](_0x4a50ed['query']);_0x111aaf[_0x6c71('0x3a')]=_[_0x6c71('0x30')](_0x111aaf[_0x6c71('0x2d')],_0x111aaf[_0x6c71('0x2e')]);_0xeb8018['attributes']=_[_0x6c71('0x30')](_0x111aaf[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x32')]));_0xeb8018[_0x6c71('0x31')]=_0xeb8018[_0x6c71('0x31')]['length']?_0xeb8018[_0x6c71('0x31')]:_0x111aaf[_0x6c71('0x2d')];if(!_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x34')](_0x6c71('0x35'))){_0xeb8018[_0x6c71('0x20')]=qs['limit'](_0x4a50ed[_0x6c71('0x2e')]['limit']);_0xeb8018[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x1f')]);}_0xeb8018['order']=qs[_0x6c71('0x37')](_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x37')]);_0xeb8018[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x4a50ed[_0x6c71('0x2e')],_0x111aaf[_0x6c71('0x3a')]));_0xeb8018[_0x6c71('0x38')]['ChatWebsiteId']=_0x1b4fdf['id'];if(_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0xeb8018[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0xeb8018['where'],{'$or':_[_0x6c71('0x2c')](_0xeb8018[_0x6c71('0x31')],function(_0x1cb451){var _0x244f23={};_0x244f23[_0x1cb451]={'$like':'%'+_0x4a50ed[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x244f23;})});}_0xeb8018=_[_0x6c71('0x48')]({},_0xeb8018,_0x4a50ed[_0x6c71('0x49')]);return db[_0x6c71('0xcc')][_0x6c71('0x1e')]({'where':_0xeb8018[_0x6c71('0x38')]})[_0x6c71('0x24')](function(_0x22ba5a){_0x13cd9c['count']=_0x22ba5a;if(_0x4a50ed[_0x6c71('0x2e')]['includeAll']){_0xeb8018['include']=[{'all':!![]}];}else{_0xeb8018[_0x6c71('0x40')]=[{'model':db[_0x6c71('0x7f')],'as':'Contact','required':![]},{'model':db[_0x6c71('0xd5')],'as':_0x6c71('0x122'),'required':![]}];}return db[_0x6c71('0xcc')][_0x6c71('0x41')](_0xeb8018);})[_0x6c71('0x24')](function(_0x42dfed){_0x13cd9c['rows']=_0x42dfed;return _0x13cd9c;});}})[_0x6c71('0x24')](respondWithFilteredResult(_0x44522c,_0xeb8018))[_0x6c71('0x43')](handleError(_0x44522c,null));};exports[_0x6c71('0x123')]=function(_0x194af2,_0x55ce69){return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x194af2['params']['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x55ce69,null))[_0x6c71('0x24')](function(_0x443f3e){if(_0x443f3e){return _0x443f3e['addAgents'](_0x194af2[_0x6c71('0x4c')][_0x6c71('0x59')],_[_0x6c71('0xeb')](_0x194af2[_0x6c71('0x4c')],[_0x6c71('0x59'),'id'])||{})[_0x6c71('0xc5')](function(_0x360229){for(var _0xd477c6=0x0;_0xd477c6<_0x194af2[_0x6c71('0x4c')]['ids'][_0x6c71('0x33')];_0xd477c6+=0x1){socket[_0x6c71('0x124')](_0x6c71('0x125'),{'UserId':Number(_0x194af2[_0x6c71('0x4c')][_0x6c71('0x59')][_0xd477c6]),'ChatWebsiteId':Number(_0x194af2[_0x6c71('0x45')]['id'])});}return _0x360229;});}})[_0x6c71('0x24')](respondWithResult(_0x55ce69,null))['catch'](handleError(_0x55ce69,null));};exports['removeAgents']=function(_0x473ddc,_0x4c8297){return db[_0x6c71('0x3e')]['find']({'where':{'id':_0x473ddc[_0x6c71('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c8297,null))[_0x6c71('0x24')](function(_0x11f7f6){if(_0x11f7f6){return _0x11f7f6[_0x6c71('0x126')](_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')])['then'](function(){if(_[_0x6c71('0x127')](_0x473ddc[_0x6c71('0x2e')]['ids'])){for(var _0x409373=0x0;_0x409373<_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')][_0x6c71('0x33')];_0x409373+=0x1){socket[_0x6c71('0x124')](_0x6c71('0x128'),{'UserId':Number(_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')][_0x409373]),'ChatWebsiteId':Number(_0x473ddc[_0x6c71('0x45')]['id'])});}}else{socket['emit'](_0x6c71('0x128'),{'UserId':Number(_0x473ddc[_0x6c71('0x2e')][_0x6c71('0x59')]),'ChatWebsiteId':Number(_0x473ddc['params']['id'])});}});}})[_0x6c71('0x24')](respondWithStatusCode(_0x4c8297,null))[_0x6c71('0x43')](handleError(_0x4c8297,null));};exports[_0x6c71('0x129')]=function(_0x50d9c9,_0x4718ad){var _0x37e613={};var _0x4c0a38={};var _0x1091c7;var _0x14cbb5;return db[_0x6c71('0x3e')][_0x6c71('0x56')]({'where':{'id':_0x50d9c9[_0x6c71('0x45')]['id']}})[_0x6c71('0x24')](handleEntityNotFound(_0x4718ad,null))[_0x6c71('0x24')](function(_0x2f091f){if(_0x2f091f){_0x1091c7=_0x2f091f;_0x4c0a38[_0x6c71('0x2d')]=_[_0x6c71('0x2f')](db[_0x6c71('0xb6')][_0x6c71('0x47')]);_0x4c0a38[_0x6c71('0x2e')]=_['keys'](_0x50d9c9[_0x6c71('0x2e')]);_0x4c0a38[_0x6c71('0x3a')]=_['intersection'](_0x4c0a38[_0x6c71('0x2d')],_0x4c0a38[_0x6c71('0x2e')]);_0x37e613[_0x6c71('0x31')]=_[_0x6c71('0x30')](_0x4c0a38[_0x6c71('0x2d')],qs[_0x6c71('0x32')](_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x32')]));_0x37e613['attributes']=_0x37e613[_0x6c71('0x31')][_0x6c71('0x33')]?_0x37e613[_0x6c71('0x31')]:_0x4c0a38[_0x6c71('0x2d')];_0x37e613[_0x6c71('0x36')]=qs['sort'](_0x50d9c9[_0x6c71('0x2e')]['sort']);_0x37e613[_0x6c71('0x38')]=qs[_0x6c71('0x3a')](_[_0x6c71('0x39')](_0x50d9c9[_0x6c71('0x2e')],_0x4c0a38['filters']));if(_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x3b')]){_0x37e613[_0x6c71('0x38')]=_[_0x6c71('0x48')](_0x37e613[_0x6c71('0x38')],{'$or':_[_0x6c71('0x2c')](_0x37e613[_0x6c71('0x31')],function(_0x311c2e){var _0x4b6356={};_0x4b6356[_0x311c2e]={'$like':'%'+_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x3b')]+'%'};return _0x4b6356;})});}_0x37e613=_[_0x6c71('0x48')]({},_0x37e613,_0x50d9c9[_0x6c71('0x49')]);return _0x1091c7[_0x6c71('0x129')](_0x37e613);}})[_0x6c71('0x24')](function(_0x29c77f){if(_0x29c77f){_0x14cbb5=_0x29c77f[_0x6c71('0x33')];if(!_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x34')]('nolimit')){_0x37e613[_0x6c71('0x20')]=qs[_0x6c71('0x20')](_0x50d9c9[_0x6c71('0x2e')]['limit']);_0x37e613[_0x6c71('0x1f')]=qs[_0x6c71('0x1f')](_0x50d9c9[_0x6c71('0x2e')][_0x6c71('0x1f')]);}return _0x1091c7[_0x6c71('0x129')](_0x37e613);}})[_0x6c71('0x24')](function(_0x1cc5c8){if(_0x1cc5c8){return _0x1cc5c8?{'count':_0x14cbb5,'rows':_0x1cc5c8}:null;}})['then'](respondWithResult(_0x4718ad,null))[_0x6c71('0x43')](handleError(_0x4718ad,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 4ba8ba1..3b5c2c0 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 _0x72a2=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x209a91,_0x5d3120){var _0x224b08=function(_0x48a6a3){while(--_0x48a6a3){_0x209a91['push'](_0x209a91['shift']());}};_0x224b08(++_0x5d3120);}(_0x72a2,0x161));var _0x272a=function(_0x1a32d0,_0x540c6d){_0x1a32d0=_0x1a32d0-0x0;var _0x116a21=_0x72a2[_0x1a32d0];return _0x116a21;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x272a('0x0'))['db'][_0x272a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x272a('0x2')](0x0);var events={'afterCreate':_0x272a('0x3'),'afterUpdate':_0x272a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x266d0d){return function(_0x52287e,_0x1d154d,_0x48aa90){ChatWebsiteEvents['emit'](_0x266d0d+':'+_0x52287e['id'],_0x52287e);ChatWebsiteEvents['emit'](_0x266d0d,_0x52287e);_0x48aa90(null);};}for(var e in events){if(events[_0x272a('0x5')](e)){var event=events[e];ChatWebsite[_0x272a('0x6')](e,emitEvent(event));}}module[_0x272a('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc9f5=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xc9f5[_0x5cab28];return _0xa3554d;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5c9f('0x0'))['db'][_0x5c9f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c9f('0x2'),'afterUpdate':_0x5c9f('0x3'),'afterDestroy':_0x5c9f('0x4')};function emitEvent(_0x5a1ee5){return function(_0x4a046a,_0x1af905,_0x57d666){ChatWebsiteEvents[_0x5c9f('0x5')](_0x5a1ee5+':'+_0x4a046a['id'],_0x4a046a);ChatWebsiteEvents['emit'](_0x5a1ee5,_0x4a046a);_0x57d666(null);};}for(var e in events){if(events[_0x5c9f('0x6')](e)){var event=events[e];ChatWebsite[_0x5c9f('0x7')](e,emitEvent(event));}}module[_0x5c9f('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 1661b2f..1eae034 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 _0xdb15=['request-promise','rimraf','../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','api','bluebird'];(function(_0xbca80b,_0x5cd39f){var _0x484524=function(_0x43e757){while(--_0x43e757){_0xbca80b['push'](_0xbca80b['shift']());}};_0x484524(++_0x5cd39f);}(_0xdb15,0x1be));var _0x5db1=function(_0x4edd82,_0x52f0cd){_0x4edd82=_0x4edd82-0x0;var _0x119cc3=_0xdb15[_0x4edd82];return _0x119cc3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5db1('0x0'));var moment=require('moment');var BPromise=require(_0x5db1('0x1'));var rp=require(_0x5db1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5db1('0x3'));var config=require(_0x5db1('0x4'));var attributes=require(_0x5db1('0x5'));module['exports']=function(_0x3a28bb,_0x10216f){return _0x3a28bb['define'](_0x5db1('0x6'),attributes,{'tableName':_0x5db1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b9a=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites'];(function(_0x2199bf,_0x2f7f41){var _0x1f5ca3=function(_0x2c292b){while(--_0x2c292b){_0x2199bf['push'](_0x2199bf['shift']());}};_0x1f5ca3(++_0x2f7f41);}(_0x3b9a,0x1e4));var _0xa3b9=function(_0x9d43a8,_0x3b976c){_0x9d43a8=_0x9d43a8-0x0;var _0x543e04=_0x3b9a[_0x9d43a8];return _0x543e04;};'use strict';var _=require(_0xa3b9('0x0'));var util=require('util');var logger=require(_0xa3b9('0x1'))(_0xa3b9('0x2'));var moment=require(_0xa3b9('0x3'));var BPromise=require(_0xa3b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa3b9('0x5'));var config=require(_0xa3b9('0x6'));var attributes=require('./chatWebsite.attributes');module[_0xa3b9('0x7')]=function(_0x342751,_0x11e634){return _0x342751[_0xa3b9('0x8')](_0xa3b9('0x9'),attributes,{'tableName':_0xa3b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 38c8617..8b8ef93 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 _0x701e=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s'];(function(_0x4a3695,_0x52287f){var _0x4d5ea6=function(_0x188441){while(--_0x188441){_0x4a3695['push'](_0x4a3695['shift']());}};_0x4d5ea6(++_0x52287f);}(_0x701e,0x13d));var _0xe701=function(_0xf991e7,_0x14ebb1){_0xf991e7=_0xf991e7-0x0;var _0x459e2c=_0x701e[_0xf991e7];return _0x459e2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe701('0x0'));var rs=require(_0xe701('0x1'));var fs=require('fs');var Redis=require(_0xe701('0x2'));var db=require(_0xe701('0x3'))['db'];var utils=require(_0xe701('0x4'));var logger=require(_0xe701('0x5'))(_0xe701('0x6'));var config=require(_0xe701('0x7'));var jayson=require(_0xe701('0x8'));var client=jayson[_0xe701('0x9')][_0xe701('0xa')]({'port':0x232a});config[_0xe701('0xb')]=_[_0xe701('0xc')](config[_0xe701('0xb')],{'host':_0xe701('0xd'),'port':0x18eb});var socket=require(_0xe701('0xe'))(new Redis(config[_0xe701('0xb')]));require('./chatWebsite.socket')[_0xe701('0xf')](socket);function respondWithRpcPromise(_0x527c58,_0x4edde4,_0x1d4baf){return new BPromise(function(_0x2cf749,_0x590332){return client[_0xe701('0x10')](_0x527c58,_0x1d4baf)[_0xe701('0x11')](function(_0x313c20){logger['info'](_0xe701('0x12'),_0x4edde4,'request\x20sent');logger[_0xe701('0x13')](_0xe701('0x14'),_0x4edde4,'request\x20sent',JSON[_0xe701('0x15')](_0x313c20));if(_0x313c20[_0xe701('0x16')]){if(_0x313c20['error']['code']===0x1f4){logger['error'](_0xe701('0x12'),_0x4edde4,_0x313c20['error'][_0xe701('0x17')]);return _0x590332(_0x313c20[_0xe701('0x16')][_0xe701('0x17')]);}logger['error'](_0xe701('0x12'),_0x4edde4,_0x313c20[_0xe701('0x16')][_0xe701('0x17')]);return _0x2cf749(_0x313c20[_0xe701('0x16')][_0xe701('0x17')]);}else{logger[_0xe701('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x4edde4,_0xe701('0x19'));_0x2cf749(_0x313c20[_0xe701('0x1a')]['message']);}})[_0xe701('0x1b')](function(_0x16628b){logger[_0xe701('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x4edde4,_0x16628b);_0x590332(_0x16628b);});});}
\ No newline at end of file
+var _0x1af8=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatWebsite.socket','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x35b0d3,_0x15f5d8){var _0x1e20ea=function(_0x44683f){while(--_0x44683f){_0x35b0d3['push'](_0x35b0d3['shift']());}};_0x1e20ea(++_0x15f5d8);}(_0x1af8,0x6c));var _0x81af=function(_0x2b1493,_0x3893a0){_0x2b1493=_0x2b1493-0x0;var _0xe867c3=_0x1af8[_0x2b1493];return _0xe867c3;};'use strict';var _=require(_0x81af('0x0'));var util=require(_0x81af('0x1'));var moment=require(_0x81af('0x2'));var BPromise=require('bluebird');var rs=require(_0x81af('0x3'));var fs=require('fs');var Redis=require(_0x81af('0x4'));var db=require(_0x81af('0x5'))['db'];var utils=require(_0x81af('0x6'));var logger=require(_0x81af('0x7'))(_0x81af('0x8'));var config=require(_0x81af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x81af('0xa')][_0x81af('0xb')]({'port':0x232a});config[_0x81af('0xc')]=_[_0x81af('0xd')](config[_0x81af('0xc')],{'host':_0x81af('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x81af('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c2cb5,_0x509b67,_0x130a70){return new BPromise(function(_0x248c5c,_0xcd1432){return client['request'](_0x3c2cb5,_0x130a70)[_0x81af('0x10')](function(_0xbe28b4){logger['info'](_0x81af('0x11'),_0x509b67,_0x81af('0x12'));logger[_0x81af('0x13')](_0x81af('0x14'),_0x509b67,_0x81af('0x12'),JSON[_0x81af('0x15')](_0xbe28b4));if(_0xbe28b4[_0x81af('0x16')]){if(_0xbe28b4['error'][_0x81af('0x17')]===0x1f4){logger['error'](_0x81af('0x11'),_0x509b67,_0xbe28b4[_0x81af('0x16')][_0x81af('0x18')]);return _0xcd1432(_0xbe28b4[_0x81af('0x16')][_0x81af('0x18')]);}logger['error'](_0x81af('0x11'),_0x509b67,_0xbe28b4[_0x81af('0x16')][_0x81af('0x18')]);return _0x248c5c(_0xbe28b4['error']['message']);}else{logger[_0x81af('0x19')](_0x81af('0x11'),_0x509b67,'request\x20sent');_0x248c5c(_0xbe28b4[_0x81af('0x1a')][_0x81af('0x18')]);}})['catch'](function(_0x2f74a8){logger[_0x81af('0x16')](_0x81af('0x11'),_0x509b67,_0x2f74a8);_0xcd1432(_0x2f74a8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 77e1c43..db45472 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 _0x8917=['chatWebsite:','./chatWebsite.events','save','emit','register'];(function(_0x127bed,_0x6ca046){var _0x5bbaa3=function(_0xe4d73d){while(--_0xe4d73d){_0x127bed['push'](_0x127bed['shift']());}};_0x5bbaa3(++_0x6ca046);}(_0x8917,0xe7));var _0x7891=function(_0x54993e,_0x5d3805){_0x54993e=_0x54993e-0x0;var _0x1fed1c=_0x8917[_0x54993e];return _0x1fed1c;};'use strict';var ChatWebsiteEvents=require(_0x7891('0x0'));var events=[_0x7891('0x1'),'remove','update'];function createListener(_0x276a78,_0x4c9c06){return function(_0x2d3e53){_0x4c9c06[_0x7891('0x2')](_0x276a78,_0x2d3e53);};}function removeListener(_0x16b537,_0x34bbcf){return function(){ChatWebsiteEvents['removeListener'](_0x16b537,_0x34bbcf);};}exports[_0x7891('0x3')]=function(_0x4d6ba4){for(var _0x4e3188=0x0,_0x5b24e4=events['length'];_0x4e3188<_0x5b24e4;_0x4e3188++){var _0x3a3430=events[_0x4e3188];var _0x2479b4=createListener(_0x7891('0x4')+_0x3a3430,_0x4d6ba4);ChatWebsiteEvents['on'](_0x3a3430,_0x2479b4);}};
\ No newline at end of file
+var _0xbfb7=['./chatWebsite.events','save','remove','update','emit','register','length','chatWebsite:'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xbfb7,0xb0));var _0x7bfb=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xbfb7[_0x48d6a3];return _0x38bfa0;};'use strict';var ChatWebsiteEvents=require(_0x7bfb('0x0'));var events=[_0x7bfb('0x1'),_0x7bfb('0x2'),_0x7bfb('0x3')];function createListener(_0x4e6f5f,_0x38b7c5){return function(_0x315247){_0x38b7c5[_0x7bfb('0x4')](_0x4e6f5f,_0x315247);};}function removeListener(_0x25471e,_0x3ddb74){return function(){ChatWebsiteEvents['removeListener'](_0x25471e,_0x3ddb74);};}exports[_0x7bfb('0x5')]=function(_0x54671c){for(var _0x37a502=0x0,_0x168382=events[_0x7bfb('0x6')];_0x37a502<_0x168382;_0x37a502++){var _0x1dc66a=events[_0x37a502];var _0x1e2ae5=createListener(_0x7bfb('0x7')+_0x1dc66a,_0x54671c);ChatWebsiteEvents['on'](_0x1dc66a,_0x1e2ae5);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index aa79597..fcf4e67 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 _0xdf7c=['notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','path','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','server/files/images/logos/','%s-%s','now','single','file','addLogo','join','root','server/files/images/avatars/','format','originalname','addAvatar','addCustomerAvatar','/:id/notify'];(function(_0x2be240,_0x1e119d){var _0x123543=function(_0x580bf4){while(--_0x580bf4){_0x2be240['push'](_0x2be240['shift']());}};_0x123543(++_0x1e119d);}(_0xdf7c,0x12a));var _0xcdf7=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xdf7c[_0x1c34e7];return _0x378cb1;};'use strict';var multer=require(_0xcdf7('0x0'));var util=require('util');var path=require(_0xcdf7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcdf7('0x2')]();var fs_extra=require(_0xcdf7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcdf7('0x4'));var config=require('../../config/environment');var controller=require(_0xcdf7('0x5'));router[_0xcdf7('0x6')]('/',auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x8')]);router[_0xcdf7('0x6')](_0xcdf7('0x9'),auth['isAuthenticated'](),controller[_0xcdf7('0xa')]);router['get'](_0xcdf7('0xb'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0xc')]);router[_0xcdf7('0x6')](_0xcdf7('0xd'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0xe')]);router['get']('/:id/canned_answers',auth[_0xcdf7('0x7')](),controller['getAnswers']);router[_0xcdf7('0x6')](_0xcdf7('0xf'),controller[_0xcdf7('0x10')]);router[_0xcdf7('0x6')]('/:id/avatar',controller[_0xcdf7('0x11')]);router[_0xcdf7('0x6')](_0xcdf7('0x12'),controller[_0xcdf7('0x13')]);router[_0xcdf7('0x6')](_0xcdf7('0x14'),controller['getSystemAvatar']);router[_0xcdf7('0x6')](_0xcdf7('0x15'),auth['isAuthenticated'](),controller[_0xcdf7('0x16')]);router[_0xcdf7('0x6')](_0xcdf7('0x17'),controller['getSnippet']);router[_0xcdf7('0x6')](_0xcdf7('0x18'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x19')]);router[_0xcdf7('0x6')](_0xcdf7('0x1a'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x1b')]);router[_0xcdf7('0x6')](_0xcdf7('0x1c'),controller[_0xcdf7('0x1d')]);router[_0xcdf7('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xcdf7('0x1e')]);router['get'](_0xcdf7('0x1f'),auth[_0xcdf7('0x7')](),controller['getAgents']);router[_0xcdf7('0x20')]('/',auth['isAuthenticated'](),controller[_0xcdf7('0x21')]);router['post'](_0xcdf7('0xd'),auth['isAuthenticated'](),controller[_0xcdf7('0x22')]);router[_0xcdf7('0x20')](_0xcdf7('0x23'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x24')]);var upload=multer({'storage':multer[_0xcdf7('0x25')]({'destination':function(_0x5c3d63,_0x313f73,_0x4b5900){_0x4b5900(null,path['join'](config['root'],_0xcdf7('0x26')));},'filename':function(_0x482e1a,_0x593741,_0x4ec76b){_0x4ec76b(null,util['format'](_0xcdf7('0x27'),Date[_0xcdf7('0x28')](),_0x593741['originalname']));}})});router[_0xcdf7('0x20')](_0xcdf7('0xf'),upload[_0xcdf7('0x29')](_0xcdf7('0x2a')),controller[_0xcdf7('0x2b')]);var upload=multer({'storage':multer[_0xcdf7('0x25')]({'destination':function(_0x3cde58,_0x2b7f04,_0x1489ce){_0x1489ce(null,path[_0xcdf7('0x2c')](config[_0xcdf7('0x2d')],_0xcdf7('0x2e')));},'filename':function(_0x37c47b,_0x334687,_0x47828f){_0x47828f(null,util[_0xcdf7('0x2f')](_0xcdf7('0x27'),Date[_0xcdf7('0x28')](),_0x334687[_0xcdf7('0x30')]));}})});router['post']('/:id/avatar',upload[_0xcdf7('0x29')](_0xcdf7('0x2a')),controller[_0xcdf7('0x31')]);var upload=multer({'storage':multer[_0xcdf7('0x25')]({'destination':function(_0x2827f4,_0x266908,_0x2dd220){_0x2dd220(null,path['join'](config['root'],_0xcdf7('0x2e')));},'filename':function(_0x2fd82a,_0xc475db,_0x45dba4){_0x45dba4(null,util[_0xcdf7('0x2f')](_0xcdf7('0x27'),Date['now'](),_0xc475db['originalname']));}})});router[_0xcdf7('0x20')](_0xcdf7('0x12'),upload[_0xcdf7('0x29')]('file'),controller[_0xcdf7('0x32')]);var upload=multer({'storage':multer[_0xcdf7('0x25')]({'destination':function(_0x3229e4,_0x50311f,_0x328207){_0x328207(null,path[_0xcdf7('0x2c')](config[_0xcdf7('0x2d')],_0xcdf7('0x2e')));},'filename':function(_0x1fe295,_0x199289,_0x1a09d1){_0x1a09d1(null,util['format'](_0xcdf7('0x27'),Date['now'](),_0x199289[_0xcdf7('0x30')]));}})});router[_0xcdf7('0x20')](_0xcdf7('0x14'),upload[_0xcdf7('0x29')]('file'),controller['addSystemAvatar']);router[_0xcdf7('0x20')](_0xcdf7('0x33'),controller[_0xcdf7('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xcdf7('0x25')]({'destination':function(_0x54c86b,_0x43a0ef,_0x93e65c){const _0x2c8aca=path[_0xcdf7('0x2c')](config['root'],'server/files',_0xcdf7('0x35'),_0xcdf7('0x36'));fs_extra[_0xcdf7('0x37')](_0x2c8aca,function(){_0x93e65c(null,_0x2c8aca);});},'filename':function(_0x202edd,_0x19f7ec,_0xa31fa3){const _0x397b34=_0x19f7ec[_0xcdf7('0x30')][_0xcdf7('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x951281=path['extname'](_0x397b34);const _0x1cf164=Date[_0xcdf7('0x28')]()+'-'+_0x397b34[_0xcdf7('0x38')](_0x951281,'')+_0x951281;_0xa31fa3(null,_0x1cf164);}})});router[_0xcdf7('0x20')](_0xcdf7('0x39'),offlineUploadMulter[_0xcdf7('0x3a')](),controller[_0xcdf7('0x3b')]);router[_0xcdf7('0x20')](_0xcdf7('0x15'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x3c')]);router['post'](_0xcdf7('0x18'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x3d')]);router[_0xcdf7('0x20')](_0xcdf7('0x1a'),auth[_0xcdf7('0x7')](),controller['addProactiveActions']);router[_0xcdf7('0x20')](_0xcdf7('0x1f'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x3e')]);router[_0xcdf7('0x3f')]('/:id',auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x40')]);router[_0xcdf7('0x41')](_0xcdf7('0xb'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x42')]);router[_0xcdf7('0x41')](_0xcdf7('0xd'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x43')]);router['delete'](_0xcdf7('0x23'),auth[_0xcdf7('0x7')](),controller[_0xcdf7('0x44')]);router['delete'](_0xcdf7('0x1f'),auth[_0xcdf7('0x7')](),controller['removeAgents']);module[_0xcdf7('0x45')]=router;
\ No newline at end of file
+var _0xf0b7=['/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','now','single','file','addLogo','root','server/files/images/avatars/','format','%s-%s','originalname','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addAgents','put','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xf0b7,0x11b));var _0x7f0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0b7[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7f0b('0x0'));var util=require(_0x7f0b('0x1'));var path=require(_0x7f0b('0x2'));var timeout=require(_0x7f0b('0x3'));var express=require(_0x7f0b('0x4'));var router=express[_0x7f0b('0x5')]();var fs_extra=require(_0x7f0b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7f0b('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x7f0b('0x8')]('/',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0xa')]);router['get'](_0x7f0b('0xb'),auth['isAuthenticated'](),controller[_0x7f0b('0xc')]);router[_0x7f0b('0x8')](_0x7f0b('0xd'),auth['isAuthenticated'](),controller[_0x7f0b('0xe')]);router[_0x7f0b('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7f0b('0xf')]);router[_0x7f0b('0x8')](_0x7f0b('0x10'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x11')]);router[_0x7f0b('0x8')](_0x7f0b('0x12'),controller[_0x7f0b('0x13')]);router['get'](_0x7f0b('0x14'),controller[_0x7f0b('0x15')]);router[_0x7f0b('0x8')](_0x7f0b('0x16'),controller[_0x7f0b('0x17')]);router[_0x7f0b('0x8')]('/:id/system_avatar',controller[_0x7f0b('0x18')]);router['get'](_0x7f0b('0x19'),auth[_0x7f0b('0x9')](),controller['getInteractions']);router[_0x7f0b('0x8')](_0x7f0b('0x1a'),controller[_0x7f0b('0x1b')]);router[_0x7f0b('0x8')](_0x7f0b('0x1c'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x1d')]);router[_0x7f0b('0x8')](_0x7f0b('0x1e'),auth['isAuthenticated'](),controller[_0x7f0b('0x1f')]);router[_0x7f0b('0x8')](_0x7f0b('0x20'),controller[_0x7f0b('0x21')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x7f0b('0x22')]);router[_0x7f0b('0x8')](_0x7f0b('0x23'),auth[_0x7f0b('0x9')](),controller['getAgents']);router[_0x7f0b('0x24')]('/',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x25')]);router[_0x7f0b('0x24')](_0x7f0b('0x26'),auth['isAuthenticated'](),controller[_0x7f0b('0x27')]);router['post'](_0x7f0b('0x10'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x28')]);var upload=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x2f7b4f,_0x20096f,_0x4bc088){_0x4bc088(null,path[_0x7f0b('0x2a')](config['root'],_0x7f0b('0x2b')));},'filename':function(_0xdea7b2,_0x4a1583,_0x585479){_0x585479(null,util['format']('%s-%s',Date[_0x7f0b('0x2c')](),_0x4a1583['originalname']));}})});router[_0x7f0b('0x24')](_0x7f0b('0x12'),upload[_0x7f0b('0x2d')](_0x7f0b('0x2e')),controller[_0x7f0b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56d5bd,_0x3e80d4,_0x1b60a2){_0x1b60a2(null,path[_0x7f0b('0x2a')](config[_0x7f0b('0x30')],_0x7f0b('0x31')));},'filename':function(_0x52b68a,_0x491f59,_0x41e5ed){_0x41e5ed(null,util[_0x7f0b('0x32')](_0x7f0b('0x33'),Date[_0x7f0b('0x2c')](),_0x491f59[_0x7f0b('0x34')]));}})});router[_0x7f0b('0x24')]('/:id/avatar',upload['single'](_0x7f0b('0x2e')),controller[_0x7f0b('0x35')]);var upload=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x5b2da3,_0x48addd,_0x5e1dfc){_0x5e1dfc(null,path['join'](config[_0x7f0b('0x30')],_0x7f0b('0x31')));},'filename':function(_0x4c02d1,_0x44c0da,_0xe37450){_0xe37450(null,util[_0x7f0b('0x32')]('%s-%s',Date[_0x7f0b('0x2c')](),_0x44c0da[_0x7f0b('0x34')]));}})});router[_0x7f0b('0x24')]('/:id/customer_avatar',upload[_0x7f0b('0x2d')](_0x7f0b('0x2e')),controller[_0x7f0b('0x36')]);var upload=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x4de317,_0x312692,_0x54b426){_0x54b426(null,path[_0x7f0b('0x2a')](config['root'],_0x7f0b('0x31')));},'filename':function(_0x359eb0,_0x48b957,_0x499a80){_0x499a80(null,util[_0x7f0b('0x32')]('%s-%s',Date[_0x7f0b('0x2c')](),_0x48b957[_0x7f0b('0x34')]));}})});router[_0x7f0b('0x24')](_0x7f0b('0x37'),upload['single'](_0x7f0b('0x2e')),controller[_0x7f0b('0x38')]);router['post'](_0x7f0b('0x39'),controller[_0x7f0b('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x7f0b('0x29')]({'destination':function(_0x12f9f3,_0x402389,_0x145b4b){const _0x3eb9d5=path[_0x7f0b('0x2a')](config[_0x7f0b('0x30')],'server/files','attachments',_0x7f0b('0x3b'));fs_extra[_0x7f0b('0x3c')](_0x3eb9d5,function(){_0x145b4b(null,_0x3eb9d5);});},'filename':function(_0x56851d,_0x3be958,_0x35768d){const _0x26a29c=_0x3be958[_0x7f0b('0x34')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5de13b=path[_0x7f0b('0x3d')](_0x26a29c);const _0x1875b0=Date[_0x7f0b('0x2c')]()+'-'+_0x26a29c[_0x7f0b('0x3e')](_0x5de13b,'')+_0x5de13b;_0x35768d(null,_0x1875b0);}})});router[_0x7f0b('0x24')](_0x7f0b('0x3f'),offlineUploadMulter[_0x7f0b('0x40')](),controller[_0x7f0b('0x41')]);router[_0x7f0b('0x24')]('/:id/interactions',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x42')]);router[_0x7f0b('0x24')]('/:id/applications',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x43')]);router['post'](_0x7f0b('0x1e'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x7f0b('0x24')]('/:id/users',auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x44')]);router[_0x7f0b('0x45')](_0x7f0b('0xd'),auth[_0x7f0b('0x9')](),controller[_0x7f0b('0x46')]);router[_0x7f0b('0x47')](_0x7f0b('0xd'),auth[_0x7f0b('0x9')](),controller['destroy']);router[_0x7f0b('0x47')](_0x7f0b('0x26'),auth['isAuthenticated'](),controller[_0x7f0b('0x48')]);router[_0x7f0b('0x47')](_0x7f0b('0x10'),auth[_0x7f0b('0x9')](),controller['removeAnswers']);router[_0x7f0b('0x47')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x7f0b('0x49')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 14d12bd..0cb05e1 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 _0x4552=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','beaver-logger/server','express','../components/auth/service','../config/environment','Router','production','app'];(function(_0x55f82e,_0x4deece){var _0x512f6d=function(_0x182f7a){while(--_0x182f7a){_0x55f82e['push'](_0x55f82e['shift']());}};_0x512f6d(++_0x4deece);}(_0x4552,0x1c1));var _0x2455=function(_0x18c92b,_0x1ca46e){_0x18c92b=_0x18c92b-0x0;var _0x1aeffe=_0x4552[_0x18c92b];return _0x1aeffe;};var beaverLogger=require(_0x2455('0x0'));var express=require(_0x2455('0x1'));var auth=require(_0x2455('0x2'));var config=require(_0x2455('0x3'));var router=express[_0x2455('0x4')]();var isProduction=config['env']===_0x2455('0x5')||![];function clientSideLogs(_0x57d943,_0x4a1963,_0x3b131e){var _0x3301db=_0x57d943[_0x2455('0x6')][_0x2455('0x7')](_0x2455('0x8'));if(!_0x3301db){throw new Error(_0x2455('0x9'));}return beaverLogger['expressEndpoint']({'uri':_0x2455('0xa'),'logger':_0x3301db,'enableCors':!isProduction})(_0x57d943,_0x4a1963,_0x3b131e);}router[_0x2455('0xb')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x0012=['env','production','app','get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','express','../components/auth/service','../config/environment'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x0012,0x111));var _0x2001=function(_0x3340a2,_0x44729a){_0x3340a2=_0x3340a2-0x0;var _0x43f75e=_0x0012[_0x3340a2];return _0x43f75e;};var beaverLogger=require('beaver-logger/server');var express=require(_0x2001('0x0'));var auth=require(_0x2001('0x1'));var config=require(_0x2001('0x2'));var router=express['Router']();var isProduction=config[_0x2001('0x3')]===_0x2001('0x4')||![];function clientSideLogs(_0x32c03f,_0x34cee0,_0x11a78a){var _0x2adf8c=_0x32c03f[_0x2001('0x5')][_0x2001('0x6')](_0x2001('0x7'));if(!_0x2adf8c){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x2001('0x8')]({'uri':'/client-logs','logger':_0x2adf8c,'enableCors':!isProduction})(_0x32c03f,_0x34cee0,_0x11a78a);}router[_0x2001('0x9')](auth[_0x2001('0xa')](),clientSideLogs);module[_0x2001('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 030bf42..59a91bc 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 _0x4a81=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x4a81,0xe8));var _0x14a8=function(_0x2a1e35,_0x1b6e8c){_0x2a1e35=_0x2a1e35-0x0;var _0x4389ad=_0x4a81[_0x2a1e35];return _0x4389ad;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'name':{'type':Sequelize[_0x14a8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x14a8('0x3')](_0x14a8('0x4'),'Google',_0x14a8('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x14a8('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x14a8('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x14a8('0x6')},'data5':{'type':Sequelize[_0x14a8('0x7')],'comment':_0x14a8('0x8')},'data6':{'type':Sequelize[_0x14a8('0x7')],'comment':_0x14a8('0x9')},'data7':{'type':Sequelize['TEXT'],'comment':_0x14a8('0xa')}};
\ No newline at end of file
+var _0x54df=['ENUM','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','MicrosoftAzure'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x54df,0xb1));var _0xf54d=function(_0x41b796,_0xa475ea){_0x41b796=_0x41b796-0x0;var _0x53a07c=_0x54df[_0x41b796];return _0x53a07c;};'use strict';var Sequelize=require(_0xf54d('0x0'));module[_0xf54d('0x1')]={'name':{'type':Sequelize[_0xf54d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf54d('0x3'),'Google',_0xf54d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf54d('0x5')]('Outlook365',_0xf54d('0x6'))},'data1':{'type':Sequelize[_0xf54d('0x2')],'comment':_0xf54d('0x7')},'data2':{'type':Sequelize[_0xf54d('0x2')],'comment':_0xf54d('0x8')},'data3':{'type':Sequelize[_0xf54d('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xf54d('0x2')],'comment':_0xf54d('0x9')},'data5':{'type':Sequelize[_0xf54d('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf54d('0xa')],'comment':_0xf54d('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xf54d('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 0ec424d..42e51c8 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 _0xf3ae=['Invalid\x20state\x20parameter','from','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','keys','include','options','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state'];(function(_0x19a32c,_0x38d44c){var _0x2c0e9a=function(_0x360aa5){while(--_0x360aa5){_0x19a32c['push'](_0x19a32c['shift']());}};_0x2c0e9a(++_0x38d44c);}(_0xf3ae,0x1e4));var _0xef3a=function(_0x13d249,_0x526954){_0x13d249=_0x13d249-0x0;var _0x1807d0=_0xf3ae[_0x13d249];return _0x1807d0;};'use strict';var _=require(_0xef3a('0x0'));var Redis=require('ioredis');var qs=require(_0xef3a('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xef3a('0x2'));var logger=require(_0xef3a('0x3'))('api');var db=require(_0xef3a('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xef3a('0x5')]=_['defaults'](config[_0xef3a('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xef3a('0x6'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1a2019,_0x28ddda){_0x28ddda=_0x28ddda||0xcc;return function(_0x1863a6){if(_0x1863a6){return _0x1a2019[_0xef3a('0x7')](_0x28ddda);}return _0x1a2019[_0xef3a('0x8')](_0x28ddda)[_0xef3a('0x9')]();};}function respondWithResult(_0x102904,_0x20e8e6){_0x20e8e6=_0x20e8e6||0xc8;return function(_0x1bae4c){if(_0x1bae4c){return _0x102904[_0xef3a('0x8')](_0x20e8e6)['json'](_0x1bae4c);}};}function respondWithFilteredResult(_0x238745,_0x280e69){return function(_0x1b8d4b){if(_0x1b8d4b){var _0x442704=typeof _0x280e69['offset']===_0xef3a('0xa')&&typeof _0x280e69[_0xef3a('0xb')]===_0xef3a('0xa');var _0x17ee3e=_0x1b8d4b[_0xef3a('0xc')];var _0x14e1a3=_0x442704?0x0:_0x280e69[_0xef3a('0xd')];var _0xbf7dee=_0x442704?_0x1b8d4b[_0xef3a('0xc')]:_0x280e69[_0xef3a('0xd')]+_0x280e69[_0xef3a('0xb')];var _0x401a09;if(_0xbf7dee>=_0x17ee3e){_0xbf7dee=_0x17ee3e;_0x401a09=0xc8;}else{_0x401a09=0xce;}_0x238745[_0xef3a('0x8')](_0x401a09);return _0x238745[_0xef3a('0xe')](_0xef3a('0xf'),_0x14e1a3+'-'+_0xbf7dee+'/'+_0x17ee3e)[_0xef3a('0x10')](_0x1b8d4b);}return null;};}function saveUpdates(_0x322505){return function(_0x202ad5){if(_0x202ad5){return _0x202ad5[_0xef3a('0x11')](_0x322505)[_0xef3a('0x12')](function(_0x22060c){return _0x22060c;});}return null;};}function removeEntity(_0x11a537){return function(_0x23101b){if(_0x23101b){return _0x23101b['destroy']()[_0xef3a('0x12')](function(){_0x11a537[_0xef3a('0x8')](0xcc)[_0xef3a('0x9')]();});}};}function handleEntityNotFound(_0x18a86f){return function(_0x2a2150){if(!_0x2a2150){_0x18a86f[_0xef3a('0x7')](0x194);}return _0x2a2150;};}function handleError(_0x4ff1e1,_0x39591c){_0x39591c=_0x39591c||0x1f4;return function(_0xdee6af){logger[_0xef3a('0x13')](_0xdee6af[_0xef3a('0x14')]);if(_0xdee6af['name']){delete _0xdee6af[_0xef3a('0x15')];}_0x4ff1e1[_0xef3a('0x8')](_0x39591c)[_0xef3a('0x16')](_0xdee6af);};}function maskClientSecret(_0x452012){return _[_0xef3a('0x17')](_0x452012['slice'](0x0,0x3),0x14,'*');}exports[_0xef3a('0x18')]=function(_0x51ed3d,_0xb73028){var _0x592c8c={},_0x5d26cc={},_0x364383={'count':0x0,'rows':[]};var _0x26a440=_[_0xef3a('0x19')](db[_0xef3a('0x1a')][_0xef3a('0x1b')],function(_0x523f22){return{'name':_0x523f22[_0xef3a('0x1c')],'type':_0x523f22[_0xef3a('0x1d')][_0xef3a('0x1e')]};});_0x5d26cc[_0xef3a('0x1f')]=_[_0xef3a('0x19')](_0x26a440,_0xef3a('0x15'));_0x5d26cc[_0xef3a('0x20')]=_['keys'](_0x51ed3d[_0xef3a('0x20')]);_0x5d26cc['filters']=_['intersection'](_0x5d26cc['model'],_0x5d26cc[_0xef3a('0x20')]);_0x592c8c['attributes']=_[_0xef3a('0x21')](_0x5d26cc[_0xef3a('0x1f')],qs[_0xef3a('0x22')](_0x51ed3d[_0xef3a('0x20')][_0xef3a('0x22')]));_0x592c8c[_0xef3a('0x23')]=_0x592c8c[_0xef3a('0x23')][_0xef3a('0x24')]?_0x592c8c['attributes']:_0x5d26cc[_0xef3a('0x1f')];if(!_0x51ed3d[_0xef3a('0x20')][_0xef3a('0x25')](_0xef3a('0x26'))){_0x592c8c[_0xef3a('0xb')]=qs[_0xef3a('0xb')](_0x51ed3d[_0xef3a('0x20')]['limit']);_0x592c8c[_0xef3a('0xd')]=qs[_0xef3a('0xd')](_0x51ed3d[_0xef3a('0x20')]['offset']);}_0x592c8c['order']=qs[_0xef3a('0x27')](_0x51ed3d['query'][_0xef3a('0x27')]);_0x592c8c[_0xef3a('0x28')]=qs['filters'](_[_0xef3a('0x29')](_0x51ed3d[_0xef3a('0x20')],_0x5d26cc[_0xef3a('0x2a')]),_0x26a440);if(_0x51ed3d[_0xef3a('0x20')][_0xef3a('0x2b')]){_0x592c8c[_0xef3a('0x28')]=_['merge'](_0x592c8c['where'],{'$or':_[_0xef3a('0x19')](_0x26a440,function(_0x153b22){if(_0x153b22[_0xef3a('0x1d')]!==_0xef3a('0x2c')){var _0x5f020f={};_0x5f020f[_0x153b22[_0xef3a('0x15')]]={'$like':'%'+_0x51ed3d[_0xef3a('0x20')][_0xef3a('0x2b')]+'%'};return _0x5f020f;}})});}_0x592c8c=_[_0xef3a('0x2d')]({},_0x592c8c,_0x51ed3d['options']);var _0x40857a={'where':_0x592c8c[_0xef3a('0x28')]};return db[_0xef3a('0x1a')][_0xef3a('0xc')](_0x40857a)[_0xef3a('0x12')](function(_0x602053){_0x364383[_0xef3a('0xc')]=_0x602053;if(_0x51ed3d[_0xef3a('0x20')]['includeAll']){_0x592c8c['include']=[{'all':!![]}];}return db[_0xef3a('0x1a')][_0xef3a('0x2e')](_0x592c8c);})[_0xef3a('0x12')](function(_0x73db9c){_0x364383[_0xef3a('0x2f')]=_['map'](_0x73db9c,function(_0xa43d36){if(_0xa43d36[_0xef3a('0x30')]===_0xef3a('0x31')){var _0x323bbb=encryptor[_0xef3a('0x32')](_0xa43d36[_0xef3a('0x33')]);_0xa43d36[_0xef3a('0x33')]=maskClientSecret(_0x323bbb);}return _0xa43d36;});return _0x364383;})['then'](respondWithFilteredResult(_0xb73028,_0x592c8c))[_0xef3a('0x34')](handleError(_0xb73028,null));};exports['show']=function(_0x38b7dc,_0x2800f8){var _0x5411f7={'raw':!![],'where':{'id':_0x38b7dc[_0xef3a('0x35')]['id']}},_0x443938={};_0x443938[_0xef3a('0x1f')]=_['keys'](db[_0xef3a('0x1a')][_0xef3a('0x1b')]);_0x443938[_0xef3a('0x20')]=_[_0xef3a('0x36')](_0x38b7dc[_0xef3a('0x20')]);_0x443938[_0xef3a('0x2a')]=_[_0xef3a('0x21')](_0x443938['model'],_0x443938[_0xef3a('0x20')]);_0x5411f7[_0xef3a('0x23')]=_[_0xef3a('0x21')](_0x443938[_0xef3a('0x1f')],qs[_0xef3a('0x22')](_0x38b7dc[_0xef3a('0x20')][_0xef3a('0x22')]));_0x5411f7['attributes']=_0x5411f7[_0xef3a('0x23')]['length']?_0x5411f7[_0xef3a('0x23')]:_0x443938[_0xef3a('0x1f')];if(_0x38b7dc[_0xef3a('0x20')]['includeAll']){_0x5411f7[_0xef3a('0x37')]=[{'all':!![]}];}_0x5411f7=_[_0xef3a('0x2d')]({},_0x5411f7,_0x38b7dc[_0xef3a('0x38')]);return db[_0xef3a('0x1a')]['find'](_0x5411f7)[_0xef3a('0x12')](handleEntityNotFound(_0x2800f8,null))[_0xef3a('0x12')](function(_0x545933){if(_0x545933['service']===_0xef3a('0x31')){var _0x2ee910=encryptor['decryptString'](_0x545933[_0xef3a('0x33')]);_0x545933[_0xef3a('0x33')]=maskClientSecret(_0x2ee910);}return _0x545933;})['then'](respondWithResult(_0x2800f8,null))[_0xef3a('0x34')](handleError(_0x2800f8,null));};exports[_0xef3a('0x39')]=function(_0x263bd8,_0x26ea73){if(!_0x263bd8[_0xef3a('0x3a')][_0xef3a('0x15')])throw new Error(_0xef3a('0x3b'));if(!_0x263bd8[_0xef3a('0x3a')][_0xef3a('0x30')])throw new Error(_0xef3a('0x3c'));var _0x384c5c=db['CloudProvider']['rawAttributes'][_0xef3a('0x30')][_0xef3a('0x3d')];if(!_0x384c5c[_0xef3a('0x3e')](_0x263bd8[_0xef3a('0x3a')][_0xef3a('0x30')]))throw new Error(_0xef3a('0x3f')+_0x384c5c[_0xef3a('0x40')](',\x20'));if(_0x263bd8['body']['service']===_0xef3a('0x31')&&_0x263bd8[_0xef3a('0x3a')][_0xef3a('0x33')]){_0x263bd8[_0xef3a('0x3a')][_0xef3a('0x33')]=encryptor[_0xef3a('0x41')](_0x263bd8['body'][_0xef3a('0x33')]);}return db[_0xef3a('0x1a')][_0xef3a('0x39')](_0x263bd8['body'],{})['then'](respondWithResult(_0x26ea73,0xc9))[_0xef3a('0x34')](handleError(_0x26ea73,null));};exports['update']=function(_0x36a049,_0x9b6f9e){if(_0x36a049[_0xef3a('0x3a')]['id']){delete _0x36a049[_0xef3a('0x3a')]['id'];}return db['CloudProvider'][_0xef3a('0x42')]({'where':{'id':_0x36a049['params']['id']}})[_0xef3a('0x12')](handleEntityNotFound(_0x9b6f9e,null))[_0xef3a('0x12')](function(_0x569c28){if(_0x569c28[_0xef3a('0x30')]===_0xef3a('0x31')&&_0x36a049[_0xef3a('0x3a')][_0xef3a('0x33')]){_0x36a049[_0xef3a('0x3a')][_0xef3a('0x33')]=encryptor[_0xef3a('0x41')](_0x36a049[_0xef3a('0x3a')][_0xef3a('0x33')]);}return _0x569c28;})['then'](saveUpdates(_0x36a049['body'],null))[_0xef3a('0x12')](respondWithResult(_0x9b6f9e,null))['catch'](handleError(_0x9b6f9e,null));};exports[_0xef3a('0x43')]=function(_0x190ac4,_0x2e5846){return db['CloudProvider'][_0xef3a('0x42')]({'where':{'id':_0x190ac4[_0xef3a('0x35')]['id']}})[_0xef3a('0x12')](handleEntityNotFound(_0x2e5846,null))['then'](removeEntity(_0x2e5846,null))[_0xef3a('0x34')](handleError(_0x2e5846,null));};exports[_0xef3a('0x44')]=function(_0x4e8161,_0xf23d16){return db['CloudProvider']['findOne']({'where':{'id':_0x4e8161[_0xef3a('0x35')]['id']},'raw':!![]})['then'](function(_0x306d25){if(!_0x306d25)return _0xf23d16['sendStatus'](0x194);return{'url':oauth[_0xef3a('0x45')](_0x306d25,_0x4e8161[_0xef3a('0x46')]['id'])};})[_0xef3a('0x12')](respondWithResult(_0xf23d16,null))[_0xef3a('0x34')](handleError(_0xf23d16,null));};exports[_0xef3a('0x47')]=function(_0x3cf8d3,_0x1cb573){var _0x1c753f=_0x3cf8d3[_0xef3a('0x3a')];var _0x564438;var _0x4e1fab;if(_0x1c753f[_0xef3a('0x13')])throw _0x1c753f;redis[_0xef3a('0x48')](_0x1c753f[_0xef3a('0x49')])['then'](function(_0x2f5eee){if(!_0x2f5eee)throw new Error(_0xef3a('0x4a'));_0x564438=JSON['parse'](_0x2f5eee);var _0x51ef46=Buffer[_0xef3a('0x4b')](_0x1c753f[_0xef3a('0x49')],'base64')['toString'](_0xef3a('0x4c'));_0x4e1fab=JSON[_0xef3a('0x4d')](_0x51ef46);if(!oauth[_0xef3a('0x4e')](_0x1c753f[_0xef3a('0x4f')],_0x564438[_0xef3a('0x50')]))throw new Error(_0xef3a('0x51'));redis[_0xef3a('0x52')](_0x1c753f[_0xef3a('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1c753f[_0xef3a('0x53')],_0x564438);})[_0xef3a('0x12')](function(_0x2d2763){_0x564438[_0xef3a('0x54')]=_0x2d2763[_0xef3a('0x55')];_0x564438[_0xef3a('0x56')]=_0x2d2763[_0xef3a('0x57')];return db[_0xef3a('0x1a')]['update']({'data5':_0x564438['data5'],'data6':_0x564438[_0xef3a('0x56')]},{'where':{'id':_0x564438['id']}});})[_0xef3a('0x12')](function(){oauth[_0xef3a('0x58')](_0x564438);socket[_0xef3a('0x59')]('microsoftAuthorization:success',{'id':_0x4e1fab['id']});return;})[_0xef3a('0x12')](respondWithStatusCode(_0x1cb573,null))[_0xef3a('0x34')](function(_0x1f5f17){if(_0x4e1fab){socket[_0xef3a('0x59')]('microsoftAuthorization:error',{'id':_0x4e1fab['id']});}if(!_0x564438){logger[_0xef3a('0x13')](_0xef3a('0x5a'),_0x1f5f17);return _0x1cb573[_0xef3a('0x8')](0x1f4)[_0xef3a('0x16')](_0x1f5f17[_0xef3a('0x5b')]);}logger[_0xef3a('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x564438['id'],JSON[_0xef3a('0x5c')](_0x1f5f17));});};
\ No newline at end of file
+var _0x2d16=['rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','create','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll'];(function(_0x4fce2c,_0x4b856f){var _0x5391d4=function(_0x3cc79e){while(--_0x3cc79e){_0x4fce2c['push'](_0x4fce2c['shift']());}};_0x5391d4(++_0x4b856f);}(_0x2d16,0x15d));var _0x62d1=function(_0x470a31,_0x5d9949){_0x470a31=_0x470a31-0x0;var _0x4d9380=_0x2d16[_0x470a31];return _0x4d9380;};'use strict';var _=require(_0x62d1('0x0'));var Redis=require(_0x62d1('0x1'));var qs=require(_0x62d1('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x62d1('0x3'))(_0x62d1('0x4'));var db=require(_0x62d1('0x5'))['db'];var oauth=require(_0x62d1('0x6'));config['redis']=_[_0x62d1('0x7')](config[_0x62d1('0x8')],{'host':_0x62d1('0x9'),'port':0x18eb});var socket=require(_0x62d1('0xa'))(new Redis(config[_0x62d1('0x8')]));var redis=new Redis(config[_0x62d1('0x8')]);function respondWithStatusCode(_0x366e06,_0x1b2b6e){_0x1b2b6e=_0x1b2b6e||0xcc;return function(_0xc56d82){if(_0xc56d82){return _0x366e06['sendStatus'](_0x1b2b6e);}return _0x366e06[_0x62d1('0xb')](_0x1b2b6e)[_0x62d1('0xc')]();};}function respondWithResult(_0x22e779,_0x21a7cc){_0x21a7cc=_0x21a7cc||0xc8;return function(_0x3f8647){if(_0x3f8647){return _0x22e779[_0x62d1('0xb')](_0x21a7cc)[_0x62d1('0xd')](_0x3f8647);}};}function respondWithFilteredResult(_0x23a22c,_0x133e02){return function(_0x585d37){if(_0x585d37){var _0x486faf=typeof _0x133e02['offset']===_0x62d1('0xe')&&typeof _0x133e02[_0x62d1('0xf')]===_0x62d1('0xe');var _0x45b986=_0x585d37[_0x62d1('0x10')];var _0x3adb59=_0x486faf?0x0:_0x133e02[_0x62d1('0x11')];var _0x30ec27=_0x486faf?_0x585d37[_0x62d1('0x10')]:_0x133e02[_0x62d1('0x11')]+_0x133e02[_0x62d1('0xf')];var _0x1eb4a0;if(_0x30ec27>=_0x45b986){_0x30ec27=_0x45b986;_0x1eb4a0=0xc8;}else{_0x1eb4a0=0xce;}_0x23a22c[_0x62d1('0xb')](_0x1eb4a0);return _0x23a22c[_0x62d1('0x12')](_0x62d1('0x13'),_0x3adb59+'-'+_0x30ec27+'/'+_0x45b986)['json'](_0x585d37);}return null;};}function saveUpdates(_0x3b276e){return function(_0x3940e3){if(_0x3940e3){return _0x3940e3[_0x62d1('0x14')](_0x3b276e)[_0x62d1('0x15')](function(_0x142db8){return _0x142db8;});}return null;};}function removeEntity(_0x2467a8){return function(_0x12b382){if(_0x12b382){return _0x12b382[_0x62d1('0x16')]()[_0x62d1('0x15')](function(){_0x2467a8[_0x62d1('0xb')](0xcc)[_0x62d1('0xc')]();});}};}function handleEntityNotFound(_0x11f220){return function(_0xf6a6db){if(!_0xf6a6db){_0x11f220['sendStatus'](0x194);}return _0xf6a6db;};}function handleError(_0x4dc4d2,_0x102860){_0x102860=_0x102860||0x1f4;return function(_0x5bd3d6){logger[_0x62d1('0x17')](_0x5bd3d6[_0x62d1('0x18')]);if(_0x5bd3d6[_0x62d1('0x19')]){delete _0x5bd3d6[_0x62d1('0x19')];}_0x4dc4d2['status'](_0x102860)[_0x62d1('0x1a')](_0x5bd3d6);};}function maskClientSecret(_0x34b83d){return _[_0x62d1('0x1b')](_0x34b83d[_0x62d1('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x304502,_0x4be29e){var _0x2b3956={},_0xc1aed9={},_0x1fc1d2={'count':0x0,'rows':[]};var _0x3c89ac=_[_0x62d1('0x1d')](db[_0x62d1('0x1e')]['rawAttributes'],function(_0x1dd3cd){return{'name':_0x1dd3cd[_0x62d1('0x1f')],'type':_0x1dd3cd[_0x62d1('0x20')][_0x62d1('0x21')]};});_0xc1aed9[_0x62d1('0x22')]=_['map'](_0x3c89ac,'name');_0xc1aed9['query']=_[_0x62d1('0x23')](_0x304502[_0x62d1('0x24')]);_0xc1aed9[_0x62d1('0x25')]=_[_0x62d1('0x26')](_0xc1aed9['model'],_0xc1aed9['query']);_0x2b3956[_0x62d1('0x27')]=_[_0x62d1('0x26')](_0xc1aed9[_0x62d1('0x22')],qs[_0x62d1('0x28')](_0x304502[_0x62d1('0x24')][_0x62d1('0x28')]));_0x2b3956['attributes']=_0x2b3956[_0x62d1('0x27')][_0x62d1('0x29')]?_0x2b3956['attributes']:_0xc1aed9[_0x62d1('0x22')];if(!_0x304502[_0x62d1('0x24')][_0x62d1('0x2a')](_0x62d1('0x2b'))){_0x2b3956[_0x62d1('0xf')]=qs[_0x62d1('0xf')](_0x304502[_0x62d1('0x24')]['limit']);_0x2b3956[_0x62d1('0x11')]=qs[_0x62d1('0x11')](_0x304502[_0x62d1('0x24')][_0x62d1('0x11')]);}_0x2b3956[_0x62d1('0x2c')]=qs[_0x62d1('0x2d')](_0x304502[_0x62d1('0x24')][_0x62d1('0x2d')]);_0x2b3956[_0x62d1('0x2e')]=qs['filters'](_[_0x62d1('0x2f')](_0x304502[_0x62d1('0x24')],_0xc1aed9[_0x62d1('0x25')]),_0x3c89ac);if(_0x304502[_0x62d1('0x24')]['filter']){_0x2b3956[_0x62d1('0x2e')]=_['merge'](_0x2b3956['where'],{'$or':_['map'](_0x3c89ac,function(_0x254eb9){if(_0x254eb9['type']!==_0x62d1('0x30')){var _0x1097d2={};_0x1097d2[_0x254eb9[_0x62d1('0x19')]]={'$like':'%'+_0x304502[_0x62d1('0x24')][_0x62d1('0x31')]+'%'};return _0x1097d2;}})});}_0x2b3956=_[_0x62d1('0x32')]({},_0x2b3956,_0x304502[_0x62d1('0x33')]);var _0x26a05b={'where':_0x2b3956[_0x62d1('0x2e')]};return db[_0x62d1('0x1e')][_0x62d1('0x10')](_0x26a05b)['then'](function(_0x54e569){_0x1fc1d2['count']=_0x54e569;if(_0x304502['query'][_0x62d1('0x34')]){_0x2b3956[_0x62d1('0x35')]=[{'all':!![]}];}return db[_0x62d1('0x1e')][_0x62d1('0x36')](_0x2b3956);})['then'](function(_0x3953b0){_0x1fc1d2[_0x62d1('0x37')]=_['map'](_0x3953b0,function(_0x3f828e){if(_0x3f828e[_0x62d1('0x38')]===_0x62d1('0x39')){var _0x4222d5=encryptor[_0x62d1('0x3a')](_0x3f828e[_0x62d1('0x3b')]);_0x3f828e[_0x62d1('0x3b')]=maskClientSecret(_0x4222d5);}return _0x3f828e;});return _0x1fc1d2;})[_0x62d1('0x15')](respondWithFilteredResult(_0x4be29e,_0x2b3956))[_0x62d1('0x3c')](handleError(_0x4be29e,null));};exports[_0x62d1('0x3d')]=function(_0x588632,_0x28a17e){var _0x16391e={'raw':!![],'where':{'id':_0x588632[_0x62d1('0x3e')]['id']}},_0x23eccc={};_0x23eccc['model']=_[_0x62d1('0x23')](db[_0x62d1('0x1e')][_0x62d1('0x3f')]);_0x23eccc[_0x62d1('0x24')]=_[_0x62d1('0x23')](_0x588632['query']);_0x23eccc[_0x62d1('0x25')]=_['intersection'](_0x23eccc[_0x62d1('0x22')],_0x23eccc['query']);_0x16391e[_0x62d1('0x27')]=_[_0x62d1('0x26')](_0x23eccc[_0x62d1('0x22')],qs[_0x62d1('0x28')](_0x588632['query']['fields']));_0x16391e[_0x62d1('0x27')]=_0x16391e['attributes'][_0x62d1('0x29')]?_0x16391e[_0x62d1('0x27')]:_0x23eccc[_0x62d1('0x22')];if(_0x588632[_0x62d1('0x24')]['includeAll']){_0x16391e[_0x62d1('0x35')]=[{'all':!![]}];}_0x16391e=_[_0x62d1('0x32')]({},_0x16391e,_0x588632[_0x62d1('0x33')]);return db[_0x62d1('0x1e')][_0x62d1('0x40')](_0x16391e)[_0x62d1('0x15')](handleEntityNotFound(_0x28a17e,null))[_0x62d1('0x15')](function(_0x21f6ec){if(_0x21f6ec[_0x62d1('0x38')]===_0x62d1('0x39')){var _0x228e62=encryptor[_0x62d1('0x3a')](_0x21f6ec[_0x62d1('0x3b')]);_0x21f6ec[_0x62d1('0x3b')]=maskClientSecret(_0x228e62);}return _0x21f6ec;})[_0x62d1('0x15')](respondWithResult(_0x28a17e,null))['catch'](handleError(_0x28a17e,null));};exports['create']=function(_0x2c6ff2,_0x3724b7){if(!_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x19')])throw new Error(_0x62d1('0x42'));if(!_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x38')])throw new Error(_0x62d1('0x43'));var _0x128f5f=db[_0x62d1('0x1e')][_0x62d1('0x3f')][_0x62d1('0x38')]['values'];if(!_0x128f5f['includes'](_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x38')]))throw new Error(_0x62d1('0x44')+_0x128f5f['join'](',\x20'));if(_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x38')]===_0x62d1('0x39')&&_0x2c6ff2[_0x62d1('0x41')][_0x62d1('0x3b')]){_0x2c6ff2['body'][_0x62d1('0x3b')]=encryptor['encryptString'](_0x2c6ff2[_0x62d1('0x41')]['data3']);}return db['CloudProvider'][_0x62d1('0x45')](_0x2c6ff2[_0x62d1('0x41')],{})[_0x62d1('0x15')](respondWithResult(_0x3724b7,0xc9))[_0x62d1('0x3c')](handleError(_0x3724b7,null));};exports[_0x62d1('0x14')]=function(_0x5eb1dc,_0x242cd5){if(_0x5eb1dc[_0x62d1('0x41')]['id']){delete _0x5eb1dc['body']['id'];}return db[_0x62d1('0x1e')][_0x62d1('0x40')]({'where':{'id':_0x5eb1dc[_0x62d1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x242cd5,null))[_0x62d1('0x15')](function(_0x8d432b){if(_0x8d432b[_0x62d1('0x38')]===_0x62d1('0x39')&&_0x5eb1dc[_0x62d1('0x41')][_0x62d1('0x3b')]){_0x5eb1dc['body'][_0x62d1('0x3b')]=encryptor[_0x62d1('0x46')](_0x5eb1dc['body'][_0x62d1('0x3b')]);}return _0x8d432b;})[_0x62d1('0x15')](saveUpdates(_0x5eb1dc[_0x62d1('0x41')],null))['then'](respondWithResult(_0x242cd5,null))[_0x62d1('0x3c')](handleError(_0x242cd5,null));};exports[_0x62d1('0x16')]=function(_0x191e6e,_0x34d131){return db['CloudProvider']['find']({'where':{'id':_0x191e6e[_0x62d1('0x3e')]['id']}})[_0x62d1('0x15')](handleEntityNotFound(_0x34d131,null))[_0x62d1('0x15')](removeEntity(_0x34d131,null))[_0x62d1('0x3c')](handleError(_0x34d131,null));};exports[_0x62d1('0x47')]=function(_0x207249,_0x123180){return db[_0x62d1('0x1e')][_0x62d1('0x48')]({'where':{'id':_0x207249[_0x62d1('0x3e')]['id']},'raw':!![]})[_0x62d1('0x15')](function(_0x4c41c4){if(!_0x4c41c4)return _0x123180[_0x62d1('0x49')](0x194);return{'url':oauth[_0x62d1('0x4a')](_0x4c41c4,_0x207249['user']['id'])};})[_0x62d1('0x15')](respondWithResult(_0x123180,null))[_0x62d1('0x3c')](handleError(_0x123180,null));};exports[_0x62d1('0x4b')]=function(_0x4415a8,_0x53364d){var _0x1f85e6=_0x4415a8[_0x62d1('0x41')];var _0x4ebf4d;var _0x149f2c;if(_0x1f85e6[_0x62d1('0x17')])throw _0x1f85e6;redis[_0x62d1('0x4c')](_0x1f85e6[_0x62d1('0x4d')])[_0x62d1('0x15')](function(_0x4e090b){if(!_0x4e090b)throw new Error(_0x62d1('0x4e'));_0x4ebf4d=JSON['parse'](_0x4e090b);var _0x57b2d7=Buffer[_0x62d1('0x4f')](_0x1f85e6[_0x62d1('0x4d')],_0x62d1('0x50'))[_0x62d1('0x51')](_0x62d1('0x52'));_0x149f2c=JSON[_0x62d1('0x53')](_0x57b2d7);if(!oauth['isValidIdToken'](_0x1f85e6[_0x62d1('0x54')],_0x4ebf4d['oauth2Claims']))throw new Error(_0x62d1('0x55'));redis[_0x62d1('0x56')](_0x1f85e6[_0x62d1('0x4d')]);return oauth[_0x62d1('0x57')](_0x1f85e6[_0x62d1('0x58')],_0x4ebf4d);})[_0x62d1('0x15')](function(_0x22812b){_0x4ebf4d[_0x62d1('0x59')]=_0x22812b[_0x62d1('0x5a')];_0x4ebf4d['data6']=_0x22812b[_0x62d1('0x5b')];return db['CloudProvider'][_0x62d1('0x14')]({'data5':_0x4ebf4d[_0x62d1('0x59')],'data6':_0x4ebf4d[_0x62d1('0x5c')]},{'where':{'id':_0x4ebf4d['id']}});})['then'](function(){oauth[_0x62d1('0x5d')](_0x4ebf4d);socket[_0x62d1('0x5e')](_0x62d1('0x5f'),{'id':_0x149f2c['id']});return;})[_0x62d1('0x15')](respondWithStatusCode(_0x53364d,null))[_0x62d1('0x3c')](function(_0x33a976){if(_0x149f2c){socket[_0x62d1('0x5e')](_0x62d1('0x60'),{'id':_0x149f2c['id']});}if(!_0x4ebf4d){logger[_0x62d1('0x17')](_0x62d1('0x61'),_0x33a976);return _0x53364d['status'](0x1f4)[_0x62d1('0x1a')](_0x33a976[_0x62d1('0x62')]);}logger[_0x62d1('0x17')](_0x62d1('0x63'),_0x4ebf4d['id'],JSON[_0x62d1('0x64')](_0x33a976));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 005b933..b3458e5 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 _0xb27e=['./cloudProvider.attributes','define','CloudProvider','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xb27e,0x150));var _0xeb27=function(_0xccb743,_0x547392){_0xccb743=_0xccb743-0x0;var _0x4ca6ad=_0xb27e[_0xccb743];return _0x4ca6ad;};'use strict';var _=require(_0xeb27('0x0'));var util=require(_0xeb27('0x1'));var logger=require(_0xeb27('0x2'))('api');var moment=require(_0xeb27('0x3'));var BPromise=require(_0xeb27('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb27('0x5'));var attributes=require(_0xeb27('0x6'));module['exports']=function(_0x2a7782,_0x41540d){return _0x2a7782[_0xeb27('0x7')](_0xeb27('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d2d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x2575b8,_0x23d9cb){var _0x24762b=function(_0xc062f6){while(--_0xc062f6){_0x2575b8['push'](_0x2575b8['shift']());}};_0x24762b(++_0x23d9cb);}(_0x4d2d,0x184));var _0xd4d2=function(_0x1e48b3,_0x3150bc){_0x1e48b3=_0x1e48b3-0x0;var _0x295fae=_0x4d2d[_0x1e48b3];return _0x295fae;};'use strict';var _=require(_0xd4d2('0x0'));var util=require(_0xd4d2('0x1'));var logger=require(_0xd4d2('0x2'))(_0xd4d2('0x3'));var moment=require(_0xd4d2('0x4'));var BPromise=require(_0xd4d2('0x5'));var rp=require(_0xd4d2('0x6'));var fs=require('fs');var path=require(_0xd4d2('0x7'));var rimraf=require('rimraf');var config=require(_0xd4d2('0x8'));var attributes=require(_0xd4d2('0x9'));module['exports']=function(_0x5046f1,_0x5b452a){return _0x5046f1[_0xd4d2('0xa')](_0xd4d2('0xb'),attributes,{'tableName':_0xd4d2('0xc'),'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 89b6510..b1d360d 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 _0xca85=['lodash','crypto','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1','data4','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','POST','intervals','findAll','all','error'];(function(_0x545907,_0x2c6a64){var _0x4e88e6=function(_0x4b15d8){while(--_0x4b15d8){_0x545907['push'](_0x545907['shift']());}};_0x4e88e6(++_0x2c6a64);}(_0xca85,0x138));var _0x5ca8=function(_0x49595c,_0x86f44e){_0x49595c=_0x49595c-0x0;var _0x259ca0=_0xca85[_0x49595c];return _0x259ca0;};'use strict';var _=require(_0x5ca8('0x0'));var crypto=require(_0x5ca8('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x5ca8('0x2'));var rp=require(_0x5ca8('0x3'));var util=require(_0x5ca8('0x4'));var encryptor=require(_0x5ca8('0x5'));var config=require('../../config/environment');var logger=require(_0x5ca8('0x6'))(_0x5ca8('0x7'));var schedule=require(_0x5ca8('0x8'));var db=require(_0x5ca8('0x9'))['db'];config[_0x5ca8('0xa')]=_[_0x5ca8('0xb')](config[_0x5ca8('0xa')],{'host':_0x5ca8('0xc'),'port':0x18eb});var redis=new Redis(config[_0x5ca8('0xa')]);var MICROSOFT_AUTH_URL=_0x5ca8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x5ca8('0xe'),_0x5ca8('0xf'),'email',_0x5ca8('0x10'),_0x5ca8('0x11'),_0x5ca8('0x12'),_0x5ca8('0x13')],'Dynamics365':[_0x5ca8('0xe'),_0x5ca8('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x5ca8('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x5ca8('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2dffcf){var _0x23300e=_[_0x5ca8('0x16')](AZURE_AUTH_SCOPES[_0x2dffcf[_0x5ca8('0x17')]]);if(_0x2dffcf[_0x5ca8('0x17')]==='Dynamics365')_0x23300e[_0x5ca8('0x18')](_0x2dffcf[_0x5ca8('0x19')]+_0x5ca8('0x1a'));return _0x23300e[_0x5ca8('0x1b')]('\x20');}function getAccessTokenScope(_0xe74401){if(_0xe74401[_0x5ca8('0x17')]===_0x5ca8('0x1c'))return _0x5ca8('0x11');if(_0xe74401[_0x5ca8('0x17')]===_0x5ca8('0x1d'))return _0xe74401[_0x5ca8('0x19')]+_0x5ca8('0x1a');}function generateMicrosoftAuthorizationUrl(_0x32180a,_0x3c42b5){var _0x8eaf31=MICROSOFT_AUTH_URL[_0x5ca8('0x1e')](_0x5ca8('0x1f'),_0x32180a[_0x5ca8('0x20')]);var _0x308341=[_0x5ca8('0x21'),'id_token'];var _0x39187c=Buffer[_0x5ca8('0x22')](JSON[_0x5ca8('0x23')]({'id':_0x3c42b5}))[_0x5ca8('0x24')]('base64');var _0x2a2172=crypto[_0x5ca8('0x25')](0x10)[_0x5ca8('0x24')](_0x5ca8('0x26'));var _0xbc0518=getAuthorizationScopes(_0x32180a);var _0xb243be=[{'key':_0x5ca8('0x27'),'value':_0x32180a[_0x5ca8('0x28')]},{'key':'response_type','value':encodeURIComponent(_0x308341[_0x5ca8('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x32180a[_0x5ca8('0x29')]},{'key':'response_mode','value':_0x5ca8('0x2a')},{'key':_0x5ca8('0x2b'),'value':encodeURIComponent(_0xbc0518)},{'key':_0x5ca8('0x2c'),'value':_0x39187c},{'key':_0x5ca8('0x2d'),'value':_0x2a2172},{'key':_0x5ca8('0x2e'),'value':'login'}];var _0x22978b=_0x8eaf31+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5ca8('0x16')](_0xb243be,function(_0x23f68d){return _0x23f68d[_0x5ca8('0x2f')]+'='+_0x23f68d[_0x5ca8('0x30')];})[_0x5ca8('0x1b')]('&');_0x32180a[_0x5ca8('0x31')]={'issuer':_0x8eaf31[_0x5ca8('0x1e')](_0x5ca8('0x32'),''),'audience':_0x32180a[_0x5ca8('0x28')],'state':_0x39187c,'nonce':_0x2a2172};redis[_0x5ca8('0x33')](_0x39187c,JSON['stringify'](_0x32180a));return _0x22978b;}function isValidIdToken(_0x4ecd11,_0x1962f4){try{var _0x123d17=jwt[_0x5ca8('0x34')](_0x4ecd11,{'complete':!![]});var _0x3dc32f=_0x123d17[_0x5ca8('0x35')];if(_0x3dc32f['iss']!==_0x1962f4[_0x5ca8('0x36')])return![];if(_0x3dc32f[_0x5ca8('0x37')]!==_0x1962f4[_0x5ca8('0x38')])return![];if(_0x3dc32f[_0x5ca8('0x2d')]!==_0x1962f4[_0x5ca8('0x2d')])return![];if(moment()[_0x5ca8('0x39')](moment[_0x5ca8('0x3a')](_0x3dc32f[_0x5ca8('0x3b')])))return![];return!![];}catch(_0x17cdbf){throw _0x17cdbf;}}function refreshOauth2MicrosoftAccessToken(_0x3a9a0a){return Promise[_0x5ca8('0x3c')]()['then'](function(){if(_0x3a9a0a[_0x5ca8('0x3d')])return _0x3a9a0a;return db[_0x5ca8('0x3e')][_0x5ca8('0x3f')]({'where':{'id':_0x3a9a0a['id']},'raw':!![]});})[_0x5ca8('0x40')](function(_0x4faada){var _0x2162e9={'grant_type':_0x5ca8('0x41'),'refresh_token':_0x4faada[_0x5ca8('0x42')],'scope':getAccessTokenScope(_0x4faada),'redirect_uri':_0x4faada['data4'],'client_id':_0x4faada[_0x5ca8('0x28')],'client_secret':encryptor['decryptString'](_0x4faada['data3'])};var _0x9a4370={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5ca8('0x1e')]('{TENANT_ID}',_0x4faada[_0x5ca8('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2162e9,'json':!![]};return rp(_0x9a4370);})['then'](function(_0x48ea8e){_0x3a9a0a[_0x5ca8('0x43')]=_0x48ea8e[_0x5ca8('0x44')];_0x3a9a0a['data6']=_0x48ea8e[_0x5ca8('0x41')];return db[_0x5ca8('0x3e')][_0x5ca8('0x45')]({'data5':_0x3a9a0a['data5'],'data6':_0x3a9a0a[_0x5ca8('0x42')]},{'where':{'id':_0x3a9a0a['id']}});})['then'](function(){return _0x3a9a0a;})[_0x5ca8('0x46')](function(_0x4b0e2b){logger['error'](_0x5ca8('0x47'),_0x3a9a0a['id'],_0x4b0e2b);});}function getOauth2MicrosoftAccessToken(_0x299349,_0x273897){var _0x14dfcd={'grant_type':'authorization_code','code':_0x299349,'scope':getAccessTokenScope(_0x273897),'redirect_uri':_0x273897[_0x5ca8('0x29')],'client_id':_0x273897[_0x5ca8('0x28')],'client_secret':encryptor[_0x5ca8('0x48')](_0x273897[_0x5ca8('0x3d')])};var _0x40c2b1={'method':_0x5ca8('0x49'),'uri':MICROSOFT_AUTH_URL[_0x5ca8('0x1e')](_0x5ca8('0x1f'),_0x273897[_0x5ca8('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14dfcd,'json':!![]};return rp(_0x40c2b1);}function startRefreshInterval(_0x152c9d){var _0x3ac6f4=schedule[_0x5ca8('0x4a')];if(_0x3ac6f4[_0x152c9d['id']])clearInterval(_0x3ac6f4[_0x152c9d['id']]);_0x3ac6f4[_0x152c9d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x152c9d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5ca8('0x4a')]=_0x3ac6f4;}function startAllRefreshIntervals(){return db[_0x5ca8('0x3e')][_0x5ca8('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5ca8('0x40')](function(_0x383ec0){var _0x2e4e9e=_0x383ec0[_0x5ca8('0x16')](function(_0x225504){return refreshOauth2MicrosoftAccessToken(_0x225504)[_0x5ca8('0x40')](function(_0x232bf7){startRefreshInterval(_0x232bf7);});});return Promise[_0x5ca8('0x4c')](_0x2e4e9e);})[_0x5ca8('0x46')](function(_0x1dfae9){var _0x3270a5=_0x1dfae9?util['inspect'](_0x1dfae9,{'showHidden':![],'depth':null}):'';logger[_0x5ca8('0x4d')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3270a5);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x80d9=['resolve','CloudProvider','findOne','then','data6','data4','decryptString','POST','replace','data5','access_token','refresh_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data3','intervals','bind','findAll','catch','inspect','exports','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','response_mode','form_post','nonce','login','key','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp'];(function(_0x24003a,_0x4f4649){var _0x1d76b0=function(_0x5d020c){while(--_0x5d020c){_0x24003a['push'](_0x24003a['shift']());}};_0x1d76b0(++_0x4f4649);}(_0x80d9,0x106));var _0x980d=function(_0x166371,_0x3d6cbd){_0x166371=_0x166371-0x0;var _0x16d191=_0x80d9[_0x166371];return _0x16d191;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x980d('0x0'));var Redis=require(_0x980d('0x1'));var rp=require(_0x980d('0x2'));var util=require(_0x980d('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0x980d('0x4'));var logger=require(_0x980d('0x5'))(_0x980d('0x6'));var schedule=require(_0x980d('0x7'));var db=require(_0x980d('0x8'))['db'];config[_0x980d('0x9')]=_[_0x980d('0xa')](config[_0x980d('0x9')],{'host':_0x980d('0xb'),'port':0x18eb});var redis=new Redis(config[_0x980d('0x9')]);var MICROSOFT_AUTH_URL=_0x980d('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x980d('0xd'),_0x980d('0xe'),_0x980d('0xf'),_0x980d('0x10'),_0x980d('0x11'),_0x980d('0x12'),_0x980d('0x13')],'Dynamics365':['openid',_0x980d('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x980d('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x980d('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48d102){var _0x34f5ef=_[_0x980d('0x16')](AZURE_AUTH_SCOPES[_0x48d102['type']]);if(_0x48d102[_0x980d('0x17')]===_0x980d('0x18'))_0x34f5ef[_0x980d('0x19')](_0x48d102[_0x980d('0x1a')]+_0x980d('0x1b'));return _0x34f5ef[_0x980d('0x1c')]('\x20');}function getAccessTokenScope(_0xf1431){if(_0xf1431[_0x980d('0x17')]===_0x980d('0x1d'))return _0x980d('0x11');if(_0xf1431[_0x980d('0x17')]===_0x980d('0x18'))return _0xf1431['data7']+_0x980d('0x1b');}function generateMicrosoftAuthorizationUrl(_0x784ce7,_0x47fecf){var _0x115263=MICROSOFT_AUTH_URL['replace'](_0x980d('0x1e'),_0x784ce7[_0x980d('0x1f')]);var _0x58799c=[_0x980d('0x20'),_0x980d('0x21')];var _0x525a97=Buffer[_0x980d('0x22')](JSON[_0x980d('0x23')]({'id':_0x47fecf}))[_0x980d('0x24')]('base64');var _0x125638=crypto[_0x980d('0x25')](0x10)[_0x980d('0x24')](_0x980d('0x26'));var _0x5ec0d0=getAuthorizationScopes(_0x784ce7);var _0x4fcd55=[{'key':_0x980d('0x27'),'value':_0x784ce7[_0x980d('0x28')]},{'key':_0x980d('0x29'),'value':encodeURIComponent(_0x58799c['join']('\x20'))},{'key':'redirect_uri','value':_0x784ce7['data4']},{'key':_0x980d('0x2a'),'value':_0x980d('0x2b')},{'key':'scope','value':encodeURIComponent(_0x5ec0d0)},{'key':'state','value':_0x525a97},{'key':_0x980d('0x2c'),'value':_0x125638},{'key':'prompt','value':_0x980d('0x2d')}];var _0x290566=_0x115263+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x980d('0x16')](_0x4fcd55,function(_0x909d3){return _0x909d3[_0x980d('0x2e')]+'='+_0x909d3['value'];})[_0x980d('0x1c')]('&');_0x784ce7[_0x980d('0x2f')]={'issuer':_0x115263['replace'](_0x980d('0x30'),''),'audience':_0x784ce7['data1'],'state':_0x525a97,'nonce':_0x125638};redis[_0x980d('0x31')](_0x525a97,JSON[_0x980d('0x23')](_0x784ce7));return _0x290566;}function isValidIdToken(_0x313a20,_0x1b5c82){try{var _0xf0050b=jwt[_0x980d('0x32')](_0x313a20,{'complete':!![]});var _0x47762f=_0xf0050b[_0x980d('0x33')];if(_0x47762f[_0x980d('0x34')]!==_0x1b5c82['issuer'])return![];if(_0x47762f[_0x980d('0x35')]!==_0x1b5c82[_0x980d('0x36')])return![];if(_0x47762f[_0x980d('0x2c')]!==_0x1b5c82[_0x980d('0x2c')])return![];if(moment()[_0x980d('0x37')](moment[_0x980d('0x38')](_0x47762f[_0x980d('0x39')])))return![];return!![];}catch(_0x458d9f){throw _0x458d9f;}}function refreshOauth2MicrosoftAccessToken(_0x179584){return Promise[_0x980d('0x3a')]()['then'](function(){if(_0x179584['data3'])return _0x179584;return db[_0x980d('0x3b')][_0x980d('0x3c')]({'where':{'id':_0x179584['id']},'raw':!![]});})[_0x980d('0x3d')](function(_0x1c3c36){var _0x390776={'grant_type':'refresh_token','refresh_token':_0x1c3c36[_0x980d('0x3e')],'scope':getAccessTokenScope(_0x1c3c36),'redirect_uri':_0x1c3c36[_0x980d('0x3f')],'client_id':_0x1c3c36[_0x980d('0x28')],'client_secret':encryptor[_0x980d('0x40')](_0x1c3c36['data3'])};var _0x5e6d6b={'method':_0x980d('0x41'),'uri':MICROSOFT_AUTH_URL[_0x980d('0x42')](_0x980d('0x1e'),_0x1c3c36['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x390776,'json':!![]};return rp(_0x5e6d6b);})[_0x980d('0x3d')](function(_0x9a6f48){_0x179584[_0x980d('0x43')]=_0x9a6f48[_0x980d('0x44')];_0x179584[_0x980d('0x3e')]=_0x9a6f48[_0x980d('0x45')];return db[_0x980d('0x3b')][_0x980d('0x46')]({'data5':_0x179584[_0x980d('0x43')],'data6':_0x179584[_0x980d('0x3e')]},{'where':{'id':_0x179584['id']}});})[_0x980d('0x3d')](function(){return _0x179584;})['catch'](function(_0x70b726){logger[_0x980d('0x47')](_0x980d('0x48'),_0x179584['id'],_0x70b726);});}function getOauth2MicrosoftAccessToken(_0x5a54cd,_0xed766b){var _0x1be2c1={'grant_type':'authorization_code','code':_0x5a54cd,'scope':getAccessTokenScope(_0xed766b),'redirect_uri':_0xed766b[_0x980d('0x3f')],'client_id':_0xed766b[_0x980d('0x28')],'client_secret':encryptor['decryptString'](_0xed766b[_0x980d('0x49')])};var _0x344ce0={'method':_0x980d('0x41'),'uri':MICROSOFT_AUTH_URL[_0x980d('0x42')](_0x980d('0x1e'),_0xed766b[_0x980d('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1be2c1,'json':!![]};return rp(_0x344ce0);}function startRefreshInterval(_0x2e9e98){var _0x5dc2ae=schedule[_0x980d('0x4a')];if(_0x5dc2ae[_0x2e9e98['id']])clearInterval(_0x5dc2ae[_0x2e9e98['id']]);_0x5dc2ae[_0x2e9e98['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x980d('0x4b')](this,{'id':_0x2e9e98['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5dc2ae;}function startAllRefreshIntervals(){return db[_0x980d('0x3b')][_0x980d('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x980d('0x3d')](function(_0x4a5888){var _0x175810=_0x4a5888[_0x980d('0x16')](function(_0x193c6e){return refreshOauth2MicrosoftAccessToken(_0x193c6e)[_0x980d('0x3d')](function(_0x218669){startRefreshInterval(_0x218669);});});return Promise['all'](_0x175810);})[_0x980d('0x4d')](function(_0x40bdad){var _0x4927a2=_0x40bdad?util[_0x980d('0x4e')](_0x40bdad,{'showHidden':![],'depth':null}):'';logger[_0x980d('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4927a2);});}module[_0x980d('0x4f')]={'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 abca9e5..1c4c0e8 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 _0xdec3=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5cbb46,_0x35eadd){var _0x2ff270=function(_0x28d528){while(--_0x28d528){_0x5cbb46['push'](_0x5cbb46['shift']());}};_0x2ff270(++_0x35eadd);}(_0xdec3,0x89));var _0x3dec=function(_0x410997,_0x28abae){_0x410997=_0x410997-0x0;var _0x460ad4=_0xdec3[_0x410997];return _0x460ad4;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var moment=require(_0x3dec('0x1'));var BPromise=require(_0x3dec('0x2'));var rs=require(_0x3dec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3dec('0x4'))['db'];var utils=require(_0x3dec('0x5'));var logger=require(_0x3dec('0x6'))(_0x3dec('0x7'));var config=require('../../config/environment');var jayson=require(_0x3dec('0x8'));var client=jayson[_0x3dec('0x9')][_0x3dec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd3208e,_0x1826ab,_0x311a74){return new BPromise(function(_0x207dcf,_0x4b32d2){return client[_0x3dec('0xb')](_0xd3208e,_0x311a74)[_0x3dec('0xc')](function(_0x599552){logger[_0x3dec('0xd')]('CloudProvider,\x20%s,\x20%s',_0x1826ab,'request\x20sent');logger[_0x3dec('0xe')](_0x3dec('0xf'),_0x1826ab,'request\x20sent',JSON[_0x3dec('0x10')](_0x599552));if(_0x599552[_0x3dec('0x11')]){if(_0x599552['error'][_0x3dec('0x12')]===0x1f4){logger[_0x3dec('0x11')](_0x3dec('0x13'),_0x1826ab,_0x599552[_0x3dec('0x11')][_0x3dec('0x14')]);return _0x4b32d2(_0x599552[_0x3dec('0x11')]['message']);}logger['error'](_0x3dec('0x13'),_0x1826ab,_0x599552['error'][_0x3dec('0x14')]);return _0x207dcf(_0x599552[_0x3dec('0x11')]['message']);}else{logger['info'](_0x3dec('0x13'),_0x1826ab,'request\x20sent');_0x207dcf(_0x599552[_0x3dec('0x15')]['message']);}})[_0x3dec('0x16')](function(_0x51cb2c){logger[_0x3dec('0x11')](_0x3dec('0x13'),_0x1826ab,_0x51cb2c);_0x4b32d2(_0x51cb2c);});});}
\ No newline at end of file
+var _0x543b=['http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35fe8c,_0x2d5ac){var _0x346a2a=function(_0x2d4d0b){while(--_0x2d4d0b){_0x35fe8c['push'](_0x35fe8c['shift']());}};_0x346a2a(++_0x2d5ac);}(_0x543b,0x18d));var _0xb543=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x543b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var moment=require(_0xb543('0x2'));var BPromise=require('bluebird');var rs=require(_0xb543('0x3'));var fs=require('fs');var Redis=require(_0xb543('0x4'));var db=require(_0xb543('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb543('0x6'))(_0xb543('0x7'));var config=require(_0xb543('0x8'));var jayson=require(_0xb543('0x9'));var client=jayson[_0xb543('0xa')][_0xb543('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208c95,_0x338142,_0x21bb48){return new BPromise(function(_0x307a74,_0x2a2c1f){return client[_0xb543('0xc')](_0x208c95,_0x21bb48)['then'](function(_0xa94776){logger['info'](_0xb543('0xd'),_0x338142,_0xb543('0xe'));logger[_0xb543('0xf')](_0xb543('0x10'),_0x338142,_0xb543('0xe'),JSON[_0xb543('0x11')](_0xa94776));if(_0xa94776['error']){if(_0xa94776[_0xb543('0x12')][_0xb543('0x13')]===0x1f4){logger[_0xb543('0x12')]('CloudProvider,\x20%s,\x20%s',_0x338142,_0xa94776[_0xb543('0x12')][_0xb543('0x14')]);return _0x2a2c1f(_0xa94776[_0xb543('0x12')]['message']);}logger['error'](_0xb543('0xd'),_0x338142,_0xa94776[_0xb543('0x12')][_0xb543('0x14')]);return _0x307a74(_0xa94776[_0xb543('0x12')]['message']);}else{logger[_0xb543('0x15')](_0xb543('0xd'),_0x338142,_0xb543('0xe'));_0x307a74(_0xa94776[_0xb543('0x16')]['message']);}})[_0xb543('0x17')](function(_0x5230df){logger[_0xb543('0x12')](_0xb543('0xd'),_0x338142,_0x5230df);_0x2a2c1f(_0x5230df);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 477aed2..e6ea0a6 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(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x1261,0x144));var _0x1126=function(_0x103c4c,_0x285348){_0x103c4c=_0x103c4c-0x0;var _0x3fc15e=_0x1261[_0x103c4c];return _0x3fc15e;};'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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0xbbee90,_0x5b19e3){_0xbbee90=_0xbbee90-0x0;var _0x96c9d=_0x7a54[_0xbbee90];return _0x96c9d;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9e7774b..14cf5c4 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 _0xd0d1=['STRING','name','sequelize'];(function(_0x15c561,_0x2507e0){var _0x2e840f=function(_0x1afb9b){while(--_0x1afb9b){_0x15c561['push'](_0x15c561['shift']());}};_0x2e840f(++_0x2507e0);}(_0xd0d1,0x95));var _0x1d0d=function(_0x4fcda1,_0x1e51fb){_0x4fcda1=_0x4fcda1-0x0;var _0x5ddf5d=_0xd0d1[_0x4fcda1];return _0x5ddf5d;};'use strict';var Sequelize=require(_0x1d0d('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d0d('0x1')],'unique':_0x1d0d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1d0d('0x1')]},'companyId':{'type':Sequelize[_0x1d0d('0x1')]},'website':{'type':Sequelize[_0x1d0d('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1d0d('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1d0d('0x1')]},'city':{'type':Sequelize[_0x1d0d('0x1')]},'country':{'type':Sequelize[_0x1d0d('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x1d0d('0x1')]},'sCity':{'type':Sequelize[_0x1d0d('0x1')]},'sCountry':{'type':Sequelize[_0x1d0d('0x1')]},'description':{'type':Sequelize[_0x1d0d('0x1')]}};
\ No newline at end of file
+var _0x53a2=['STRING','exports'];(function(_0x35ca63,_0x46a768){var _0x13ad71=function(_0x135e8c){while(--_0x135e8c){_0x35ca63['push'](_0x35ca63['shift']());}};_0x13ad71(++_0x46a768);}(_0x53a2,0x1a7));var _0x253a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x53a2[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x253a('0x0')]={'name':{'type':Sequelize[_0x253a('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x253a('0x1')]},'companyId':{'type':Sequelize[_0x253a('0x1')]},'website':{'type':Sequelize[_0x253a('0x1')]},'phone':{'type':Sequelize[_0x253a('0x1')]},'fax':{'type':Sequelize[_0x253a('0x1')]},'type':{'type':Sequelize[_0x253a('0x1')]},'street':{'type':Sequelize[_0x253a('0x1')]},'postalCode':{'type':Sequelize[_0x253a('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x253a('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x253a('0x1')]},'sStreet':{'type':Sequelize[_0x253a('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x253a('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index eb1f8db..5a45980 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 _0x2e27=['Companies','then','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','omit','getContacts','CmContact','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get'];(function(_0x1f3562,_0x2e25d4){var _0x2e9ac6=function(_0x3217e8){while(--_0x3217e8){_0x1f3562['push'](_0x1f3562['shift']());}};_0x2e9ac6(++_0x2e25d4);}(_0x2e27,0x17f));var _0x72e2=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x2e27[_0x4687df];return _0x32eaef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72e2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72e2('0x1'));var rp=require(_0x72e2('0x2'));var moment=require(_0x72e2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x72e2('0x4'));var util=require(_0x72e2('0x5'));var path=require('path');var sox=require(_0x72e2('0x6'));var csv=require(_0x72e2('0x7'));var ejs=require(_0x72e2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72e2('0x9'));var squel=require(_0x72e2('0xa'));var crypto=require('crypto');var jsforce=require(_0x72e2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x72e2('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72e2('0xc'));var authService=require(_0x72e2('0xd'));var qs=require(_0x72e2('0xe'));var as=require(_0x72e2('0xf'));var hardwareService=require(_0x72e2('0x10'));var logger=require('../../config/logger')(_0x72e2('0x11'));var utils=require(_0x72e2('0x12'));var config=require(_0x72e2('0x13'));var licenseUtil=require(_0x72e2('0x14'));var db=require(_0x72e2('0x15'))['db'];function respondWithStatusCode(_0x5d87e6,_0xb005fa){_0xb005fa=_0xb005fa||0xcc;return function(_0x572645){if(_0x572645){return _0x5d87e6[_0x72e2('0x16')](_0xb005fa);}return _0x5d87e6[_0x72e2('0x17')](_0xb005fa)[_0x72e2('0x18')]();};}function respondWithResult(_0x4bc599,_0x37155e){_0x37155e=_0x37155e||0xc8;return function(_0x4ddaee){if(_0x4ddaee){return _0x4bc599[_0x72e2('0x17')](_0x37155e)['json'](_0x4ddaee);}};}function respondWithFilteredResult(_0x236125,_0x501761){return function(_0x485a3f){if(_0x485a3f){var _0x3054af=typeof _0x501761[_0x72e2('0x19')]===_0x72e2('0x1a')&&typeof _0x501761[_0x72e2('0x1b')]===_0x72e2('0x1a');var _0x9b1ba4=_0x485a3f[_0x72e2('0x1c')];var _0x5ac525=_0x3054af?0x0:_0x501761[_0x72e2('0x19')];var _0x22e4ea=_0x3054af?_0x485a3f[_0x72e2('0x1c')]:_0x501761[_0x72e2('0x19')]+_0x501761[_0x72e2('0x1b')];var _0x17db6f;if(_0x22e4ea>=_0x9b1ba4){_0x22e4ea=_0x9b1ba4;_0x17db6f=0xc8;}else{_0x17db6f=0xce;}_0x236125['status'](_0x17db6f);return _0x236125[_0x72e2('0x1d')](_0x72e2('0x1e'),_0x5ac525+'-'+_0x22e4ea+'/'+_0x9b1ba4)[_0x72e2('0x1f')](_0x485a3f);}return null;};}function patchUpdates(_0x599ca2){return function(_0x504406){try{jsonpatch[_0x72e2('0x20')](_0x504406,_0x599ca2,!![]);}catch(_0x408998){return BPromise[_0x72e2('0x21')](_0x408998);}return _0x504406[_0x72e2('0x22')]();};}function saveUpdates(_0x911df7,_0x49760c){return function(_0xb4f5a5){if(_0xb4f5a5){return _0xb4f5a5['update'](_0x911df7)['then'](function(_0x561544){return _0x561544;});}return null;};}function removeEntity(_0x5b0059,_0x51a6fd){return function(_0x3a0281){if(_0x3a0281){return _0x3a0281[_0x72e2('0x23')]()['then'](function(){var _0x3a6751=_0x3a0281[_0x72e2('0x24')]({'plain':!![]});var _0x37008f=_0x72e2('0x25');return db['UserProfileResource'][_0x72e2('0x23')]({'where':{'type':_0x37008f,'resourceId':_0x3a6751['id']}})[_0x72e2('0x26')](function(){return _0x3a0281;});})['then'](function(){_0x5b0059['status'](0xcc)[_0x72e2('0x18')]();});}};}function handleEntityNotFound(_0x393d2c,_0x227fbe){return function(_0x205fa9){if(!_0x205fa9){_0x393d2c[_0x72e2('0x16')](0x194);}return _0x205fa9;};}function handleError(_0x8513d7,_0x57f7bb){_0x57f7bb=_0x57f7bb||0x1f4;return function(_0x525734){logger['error'](_0x525734[_0x72e2('0x27')]);if(_0x525734[_0x72e2('0x28')]){delete _0x525734['name'];}_0x8513d7[_0x72e2('0x17')](_0x57f7bb)[_0x72e2('0x29')](_0x525734);};}exports[_0x72e2('0x2a')]=function(_0x391d11,_0x149333){var _0x310866={},_0x952128={},_0x2e0744={'count':0x0,'rows':[]};return db[_0x72e2('0x2b')]['describe']()[_0x72e2('0x26')](function(_0x284b55){_0x952128[_0x72e2('0x2c')]=_[_0x72e2('0x2d')](_0x284b55);_0x952128['query']=_[_0x72e2('0x2d')](_0x391d11[_0x72e2('0x2e')]);_0x952128[_0x72e2('0x2f')]=_[_0x72e2('0x30')](_0x952128['model'],_0x952128[_0x72e2('0x2e')]);_0x310866[_0x72e2('0x31')]=_[_0x72e2('0x30')](_0x952128[_0x72e2('0x2c')],qs[_0x72e2('0x32')](_0x391d11[_0x72e2('0x2e')][_0x72e2('0x32')]));_0x310866[_0x72e2('0x31')]=_0x310866[_0x72e2('0x31')][_0x72e2('0x33')]?_0x310866[_0x72e2('0x31')]:_0x952128[_0x72e2('0x2c')];if(!_0x391d11[_0x72e2('0x2e')][_0x72e2('0x34')]('nolimit')){_0x310866[_0x72e2('0x1b')]=qs[_0x72e2('0x1b')](_0x391d11[_0x72e2('0x2e')]['limit']);_0x310866[_0x72e2('0x19')]=qs[_0x72e2('0x19')](_0x391d11[_0x72e2('0x2e')][_0x72e2('0x19')]);}_0x310866[_0x72e2('0x35')]=qs[_0x72e2('0x36')](_0x391d11[_0x72e2('0x2e')][_0x72e2('0x36')]);_0x310866['where']=qs[_0x72e2('0x2f')](_[_0x72e2('0x37')](_0x391d11['query'],_0x952128['filters']),_0x284b55);if(_0x391d11[_0x72e2('0x2e')][_0x72e2('0x38')]){_0x310866[_0x72e2('0x39')]=_[_0x72e2('0x3a')](_0x310866['where'],{'$or':_[_0x72e2('0x3b')](_0x310866[_0x72e2('0x31')],function(_0x45b893){var _0x5d200c={};_0x5d200c[_0x45b893]={'$like':'%'+_0x391d11[_0x72e2('0x2e')]['filter']+'%'};return _0x5d200c;})});}_0x310866=_[_0x72e2('0x3a')]({},_0x310866,_0x391d11[_0x72e2('0x3c')]);var _0x3d2f45={'where':_0x310866['where']};return db['CmCompany'][_0x72e2('0x1c')](_0x3d2f45)[_0x72e2('0x26')](function(_0x3763ca){_0x2e0744[_0x72e2('0x1c')]=_0x3763ca;if(_0x391d11[_0x72e2('0x2e')]['includeAll']){_0x310866[_0x72e2('0x3d')]=[{'all':!![]}];}return db[_0x72e2('0x2b')][_0x72e2('0x3e')](_0x310866);})[_0x72e2('0x26')](function(_0x190886){_0x2e0744[_0x72e2('0x3f')]=_0x190886;return _0x2e0744;})[_0x72e2('0x26')](respondWithFilteredResult(_0x149333,_0x310866))[_0x72e2('0x40')](handleError(_0x149333,null));})['catch'](handleError(_0x149333,null));};exports[_0x72e2('0x41')]=function(_0x288158,_0x3afe95){var _0x49dd9c={'raw':![],'where':{'id':_0x288158[_0x72e2('0x42')]['id']}},_0x48d838={};_0x48d838[_0x72e2('0x2c')]=_[_0x72e2('0x2d')](db[_0x72e2('0x2b')]['rawAttributes']);_0x48d838[_0x72e2('0x2e')]=_[_0x72e2('0x2d')](_0x288158[_0x72e2('0x2e')]);_0x48d838[_0x72e2('0x2f')]=_[_0x72e2('0x30')](_0x48d838[_0x72e2('0x2c')],_0x48d838[_0x72e2('0x2e')]);_0x49dd9c[_0x72e2('0x31')]=_[_0x72e2('0x30')](_0x48d838['model'],qs[_0x72e2('0x32')](_0x288158[_0x72e2('0x2e')]['fields']));_0x49dd9c[_0x72e2('0x31')]=_0x49dd9c[_0x72e2('0x31')]['length']?_0x49dd9c[_0x72e2('0x31')]:_0x48d838['model'];if(_0x288158[_0x72e2('0x2e')][_0x72e2('0x43')]){_0x49dd9c[_0x72e2('0x3d')]=[{'all':!![]}];}_0x49dd9c=_[_0x72e2('0x3a')]({},_0x49dd9c,_0x288158[_0x72e2('0x3c')]);return db[_0x72e2('0x2b')][_0x72e2('0x44')](_0x49dd9c)[_0x72e2('0x26')](handleEntityNotFound(_0x3afe95,null))[_0x72e2('0x26')](respondWithResult(_0x3afe95,null))[_0x72e2('0x40')](handleError(_0x3afe95,null));};exports[_0x72e2('0x45')]=function(_0x498eb4,_0x59207d){return db[_0x72e2('0x2b')][_0x72e2('0x45')](_0x498eb4['body'],{})[_0x72e2('0x26')](function(_0x31459f){var _0x50c1e2=_0x498eb4[_0x72e2('0x46')]['get']({'plain':!![]});if(!_0x50c1e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50c1e2[_0x72e2('0x47')]===_0x72e2('0x46')){var _0x294ea4=_0x31459f[_0x72e2('0x24')]({'plain':!![]});var _0x33e280='Companies';return db[_0x72e2('0x48')][_0x72e2('0x44')]({'where':{'name':_0x33e280,'userProfileId':_0x50c1e2['userProfileId']},'raw':!![]})[_0x72e2('0x26')](function(_0x258203){if(_0x258203&&_0x258203[_0x72e2('0x49')]===0x0){return db[_0x72e2('0x4a')][_0x72e2('0x45')]({'name':_0x294ea4[_0x72e2('0x28')],'resourceId':_0x294ea4['id'],'type':_0x258203[_0x72e2('0x28')],'sectionId':_0x258203['id']},{})['then'](function(){return _0x31459f;});}else{return _0x31459f;}})[_0x72e2('0x40')](function(_0x42adf4){logger[_0x72e2('0x4b')](_0x72e2('0x4c'),_0x42adf4);throw _0x42adf4;});}return _0x31459f;})['then'](respondWithResult(_0x59207d,0xc9))['catch'](handleError(_0x59207d,null));};exports['update']=function(_0x41af40,_0x3a9278){if(_0x41af40[_0x72e2('0x4d')]['id']){delete _0x41af40[_0x72e2('0x4d')]['id'];}return db[_0x72e2('0x2b')][_0x72e2('0x44')]({'where':{'id':_0x41af40['params']['id']}})[_0x72e2('0x26')](handleEntityNotFound(_0x3a9278,null))[_0x72e2('0x26')](saveUpdates(_0x41af40['body'],null))[_0x72e2('0x26')](respondWithResult(_0x3a9278,null))[_0x72e2('0x40')](handleError(_0x3a9278,null));};exports[_0x72e2('0x23')]=function(_0x44d775,_0xe596a4){return db['CmCompany'][_0x72e2('0x44')]({'where':{'id':_0x44d775[_0x72e2('0x42')]['id']}})['then'](handleEntityNotFound(_0xe596a4,null))[_0x72e2('0x26')](removeEntity(_0xe596a4,null))[_0x72e2('0x40')](handleError(_0xe596a4,null));};exports['describe']=function(_0x2bce2e,_0x221aa9){return db[_0x72e2('0x2b')][_0x72e2('0x4e')]()[_0x72e2('0x26')](respondWithResult(_0x221aa9,null))['catch'](handleError(_0x221aa9,null));};exports[_0x72e2('0x4f')]=function(_0x42e82e,_0x55e16,_0x24a798){return db['CmContact'][_0x72e2('0x44')]({'where':{'id':_0x42e82e[_0x72e2('0x42')]['id']}})[_0x72e2('0x26')](handleEntityNotFound(_0x55e16,null))[_0x72e2('0x26')](function(_0x3948b5){if(_0x3948b5){return _0x3948b5[_0x72e2('0x4f')](_0x42e82e[_0x72e2('0x4d')][_0x72e2('0x50')],_[_0x72e2('0x51')](_0x42e82e['body'],[_0x72e2('0x50'),'id'])||{});}})[_0x72e2('0x26')](respondWithResult(_0x55e16,null))[_0x72e2('0x40')](handleError(_0x55e16,null));};exports[_0x72e2('0x52')]=function(_0x59355f,_0x214bf8,_0x5112b5){var _0x4da1c5={};var _0x4c455a={};var _0x10e604;var _0x2787c1;return db[_0x72e2('0x2b')]['findOne']({'where':{'id':_0x59355f[_0x72e2('0x42')]['id']}})[_0x72e2('0x26')](handleEntityNotFound(_0x214bf8,null))[_0x72e2('0x26')](function(_0x4f7f76){if(_0x4f7f76){_0x10e604=_0x4f7f76;_0x4c455a[_0x72e2('0x2c')]=_[_0x72e2('0x2d')](db[_0x72e2('0x53')]['rawAttributes']);_0x4c455a[_0x72e2('0x2e')]=_[_0x72e2('0x2d')](_0x59355f[_0x72e2('0x2e')]);_0x4c455a[_0x72e2('0x2f')]=_[_0x72e2('0x30')](_0x4c455a[_0x72e2('0x2c')],_0x4c455a['query']);_0x4da1c5[_0x72e2('0x31')]=_['intersection'](_0x4c455a[_0x72e2('0x2c')],qs['fields'](_0x59355f[_0x72e2('0x2e')][_0x72e2('0x32')]));_0x4da1c5[_0x72e2('0x31')]=_0x4da1c5[_0x72e2('0x31')][_0x72e2('0x33')]?_0x4da1c5['attributes']:_0x4c455a['model'];_0x4da1c5[_0x72e2('0x35')]=qs[_0x72e2('0x36')](_0x59355f['query'][_0x72e2('0x36')]);_0x4da1c5[_0x72e2('0x39')]=qs[_0x72e2('0x2f')](_[_0x72e2('0x37')](_0x59355f[_0x72e2('0x2e')],_0x4c455a[_0x72e2('0x2f')]));if(_0x59355f[_0x72e2('0x2e')][_0x72e2('0x38')]){_0x4da1c5[_0x72e2('0x39')]=_[_0x72e2('0x3a')](_0x4da1c5['where'],{'$or':_[_0x72e2('0x3b')](_0x4da1c5[_0x72e2('0x31')],function(_0x448160){var _0x39d1aa={};_0x39d1aa[_0x448160]={'$like':'%'+_0x59355f[_0x72e2('0x2e')][_0x72e2('0x38')]+'%'};return _0x39d1aa;})});}_0x4da1c5=_['merge']({},_0x4da1c5,_0x59355f[_0x72e2('0x3c')]);return _0x10e604[_0x72e2('0x52')](_0x4da1c5);}})[_0x72e2('0x26')](function(_0x1bbe25){if(_0x1bbe25){_0x2787c1=_0x1bbe25[_0x72e2('0x33')];if(!_0x59355f['query'][_0x72e2('0x34')]('nolimit')){_0x4da1c5['limit']=qs['limit'](_0x59355f[_0x72e2('0x2e')][_0x72e2('0x1b')]);_0x4da1c5['offset']=qs[_0x72e2('0x19')](_0x59355f[_0x72e2('0x2e')][_0x72e2('0x19')]);}return _0x10e604[_0x72e2('0x52')](_0x4da1c5);}})[_0x72e2('0x26')](function(_0x4fbf06){if(_0x4fbf06){return _0x4fbf06?{'count':_0x2787c1,'rows':_0x4fbf06}:null;}})[_0x72e2('0x26')](respondWithResult(_0x214bf8,null))['catch'](handleError(_0x214bf8,null));};
\ No newline at end of file
+var _0x11fd=['rawAttributes','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','CmContact','addContacts','ids','getContacts','findOne'];(function(_0x551d3d,_0x2766ab){var _0x57658f=function(_0x3d9920){while(--_0x3d9920){_0x551d3d['push'](_0x551d3d['shift']());}};_0x57658f(++_0x2766ab);}(_0x11fd,0x169));var _0xd11f=function(_0x3a4e1b,_0x1cfeaf){_0x3a4e1b=_0x3a4e1b-0x0;var _0x1cfe1f=_0x11fd[_0x3a4e1b];return _0x1cfe1f;};'use strict';var emlformat=require(_0xd11f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd11f('0x1'));var jsonpatch=require(_0xd11f('0x2'));var rp=require(_0xd11f('0x3'));var moment=require('moment');var BPromise=require(_0xd11f('0x4'));var Mustache=require(_0xd11f('0x5'));var util=require('util');var path=require(_0xd11f('0x6'));var sox=require('sox');var csv=require(_0xd11f('0x7'));var ejs=require(_0xd11f('0x8'));var fs=require('fs');var fs_extra=require(_0xd11f('0x9'));var _=require(_0xd11f('0xa'));var squel=require(_0xd11f('0xb'));var crypto=require(_0xd11f('0xc'));var jsforce=require(_0xd11f('0xd'));var deskjs=require(_0xd11f('0xe'));var toCsv=require(_0xd11f('0x7'));var querystring=require(_0xd11f('0xf'));var Papa=require(_0xd11f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd11f('0x11'));var as=require(_0xd11f('0x12'));var hardwareService=require(_0xd11f('0x13'));var logger=require(_0xd11f('0x14'))(_0xd11f('0x15'));var utils=require(_0xd11f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd11f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19511f,_0x20fa67){_0x20fa67=_0x20fa67||0xcc;return function(_0x4d9ab1){if(_0x4d9ab1){return _0x19511f[_0xd11f('0x18')](_0x20fa67);}return _0x19511f[_0xd11f('0x19')](_0x20fa67)[_0xd11f('0x1a')]();};}function respondWithResult(_0x1f071a,_0x1e21c2){_0x1e21c2=_0x1e21c2||0xc8;return function(_0x3019df){if(_0x3019df){return _0x1f071a[_0xd11f('0x19')](_0x1e21c2)[_0xd11f('0x1b')](_0x3019df);}};}function respondWithFilteredResult(_0x5a02ff,_0x5e4948){return function(_0x48bee6){if(_0x48bee6){var _0x5f45d4=typeof _0x5e4948[_0xd11f('0x1c')]==='undefined'&&typeof _0x5e4948[_0xd11f('0x1d')]===_0xd11f('0x1e');var _0x4c0dd7=_0x48bee6['count'];var _0x189f36=_0x5f45d4?0x0:_0x5e4948[_0xd11f('0x1c')];var _0xe0b49a=_0x5f45d4?_0x48bee6[_0xd11f('0x1f')]:_0x5e4948[_0xd11f('0x1c')]+_0x5e4948[_0xd11f('0x1d')];var _0x1a7889;if(_0xe0b49a>=_0x4c0dd7){_0xe0b49a=_0x4c0dd7;_0x1a7889=0xc8;}else{_0x1a7889=0xce;}_0x5a02ff[_0xd11f('0x19')](_0x1a7889);return _0x5a02ff[_0xd11f('0x20')](_0xd11f('0x21'),_0x189f36+'-'+_0xe0b49a+'/'+_0x4c0dd7)['json'](_0x48bee6);}return null;};}function patchUpdates(_0x3b631a){return function(_0x3ba63d){try{jsonpatch[_0xd11f('0x22')](_0x3ba63d,_0x3b631a,!![]);}catch(_0x4e1894){return BPromise[_0xd11f('0x23')](_0x4e1894);}return _0x3ba63d[_0xd11f('0x24')]();};}function saveUpdates(_0x33f2e3,_0x43f236){return function(_0x3d2f44){if(_0x3d2f44){return _0x3d2f44[_0xd11f('0x25')](_0x33f2e3)[_0xd11f('0x26')](function(_0x452663){return _0x452663;});}return null;};}function removeEntity(_0x59f5f6,_0x1deb84){return function(_0x20e400){if(_0x20e400){return _0x20e400['destroy']()[_0xd11f('0x26')](function(){var _0x31c7bd=_0x20e400[_0xd11f('0x27')]({'plain':!![]});var _0x367190='Companies';return db[_0xd11f('0x28')]['destroy']({'where':{'type':_0x367190,'resourceId':_0x31c7bd['id']}})[_0xd11f('0x26')](function(){return _0x20e400;});})[_0xd11f('0x26')](function(){_0x59f5f6[_0xd11f('0x19')](0xcc)[_0xd11f('0x1a')]();});}};}function handleEntityNotFound(_0x3ee93b,_0x3b1d22){return function(_0x14ef39){if(!_0x14ef39){_0x3ee93b[_0xd11f('0x18')](0x194);}return _0x14ef39;};}function handleError(_0x45318b,_0x5d1664){_0x5d1664=_0x5d1664||0x1f4;return function(_0x4a594e){logger[_0xd11f('0x29')](_0x4a594e[_0xd11f('0x2a')]);if(_0x4a594e[_0xd11f('0x2b')]){delete _0x4a594e[_0xd11f('0x2b')];}_0x45318b[_0xd11f('0x19')](_0x5d1664)[_0xd11f('0x2c')](_0x4a594e);};}exports[_0xd11f('0x2d')]=function(_0xbc4df7,_0x5e9271){var _0x5c638e={},_0x5091f0={},_0x4f6cb5={'count':0x0,'rows':[]};return db['CmCompany'][_0xd11f('0x2e')]()[_0xd11f('0x26')](function(_0xb44580){_0x5091f0[_0xd11f('0x2f')]=_[_0xd11f('0x30')](_0xb44580);_0x5091f0[_0xd11f('0x31')]=_[_0xd11f('0x30')](_0xbc4df7['query']);_0x5091f0[_0xd11f('0x32')]=_[_0xd11f('0x33')](_0x5091f0[_0xd11f('0x2f')],_0x5091f0[_0xd11f('0x31')]);_0x5c638e[_0xd11f('0x34')]=_[_0xd11f('0x33')](_0x5091f0[_0xd11f('0x2f')],qs[_0xd11f('0x35')](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x35')]));_0x5c638e[_0xd11f('0x34')]=_0x5c638e[_0xd11f('0x34')][_0xd11f('0x36')]?_0x5c638e[_0xd11f('0x34')]:_0x5091f0[_0xd11f('0x2f')];if(!_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x37')](_0xd11f('0x38'))){_0x5c638e[_0xd11f('0x1d')]=qs[_0xd11f('0x1d')](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x1d')]);_0x5c638e[_0xd11f('0x1c')]=qs['offset'](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x1c')]);}_0x5c638e[_0xd11f('0x39')]=qs[_0xd11f('0x3a')](_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x3a')]);_0x5c638e['where']=qs[_0xd11f('0x32')](_[_0xd11f('0x3b')](_0xbc4df7[_0xd11f('0x31')],_0x5091f0[_0xd11f('0x32')]),_0xb44580);if(_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x3c')]){_0x5c638e[_0xd11f('0x3d')]=_[_0xd11f('0x3e')](_0x5c638e[_0xd11f('0x3d')],{'$or':_[_0xd11f('0x3f')](_0x5c638e[_0xd11f('0x34')],function(_0x494407){var _0x551b70={};_0x551b70[_0x494407]={'$like':'%'+_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x3c')]+'%'};return _0x551b70;})});}_0x5c638e=_[_0xd11f('0x3e')]({},_0x5c638e,_0xbc4df7[_0xd11f('0x40')]);var _0x168f87={'where':_0x5c638e[_0xd11f('0x3d')]};return db[_0xd11f('0x41')][_0xd11f('0x1f')](_0x168f87)[_0xd11f('0x26')](function(_0xd2870f){_0x4f6cb5['count']=_0xd2870f;if(_0xbc4df7[_0xd11f('0x31')][_0xd11f('0x42')]){_0x5c638e['include']=[{'all':!![]}];}return db[_0xd11f('0x41')][_0xd11f('0x43')](_0x5c638e);})['then'](function(_0x6b9f0b){_0x4f6cb5[_0xd11f('0x44')]=_0x6b9f0b;return _0x4f6cb5;})[_0xd11f('0x26')](respondWithFilteredResult(_0x5e9271,_0x5c638e))['catch'](handleError(_0x5e9271,null));})[_0xd11f('0x45')](handleError(_0x5e9271,null));};exports[_0xd11f('0x46')]=function(_0x56f10a,_0x492ba1){var _0x178a36={'raw':![],'where':{'id':_0x56f10a[_0xd11f('0x47')]['id']}},_0x597eda={};_0x597eda[_0xd11f('0x2f')]=_['keys'](db[_0xd11f('0x41')]['rawAttributes']);_0x597eda[_0xd11f('0x31')]=_[_0xd11f('0x30')](_0x56f10a[_0xd11f('0x31')]);_0x597eda['filters']=_[_0xd11f('0x33')](_0x597eda[_0xd11f('0x2f')],_0x597eda['query']);_0x178a36[_0xd11f('0x34')]=_[_0xd11f('0x33')](_0x597eda[_0xd11f('0x2f')],qs[_0xd11f('0x35')](_0x56f10a[_0xd11f('0x31')][_0xd11f('0x35')]));_0x178a36[_0xd11f('0x34')]=_0x178a36['attributes'][_0xd11f('0x36')]?_0x178a36[_0xd11f('0x34')]:_0x597eda[_0xd11f('0x2f')];if(_0x56f10a[_0xd11f('0x31')][_0xd11f('0x42')]){_0x178a36[_0xd11f('0x48')]=[{'all':!![]}];}_0x178a36=_[_0xd11f('0x3e')]({},_0x178a36,_0x56f10a[_0xd11f('0x40')]);return db['CmCompany'][_0xd11f('0x49')](_0x178a36)['then'](handleEntityNotFound(_0x492ba1,null))[_0xd11f('0x26')](respondWithResult(_0x492ba1,null))[_0xd11f('0x45')](handleError(_0x492ba1,null));};exports[_0xd11f('0x4a')]=function(_0x4fca36,_0x433254){return db[_0xd11f('0x41')][_0xd11f('0x4a')](_0x4fca36[_0xd11f('0x4b')],{})[_0xd11f('0x26')](function(_0x4f07b7){var _0x475c2c=_0x4fca36[_0xd11f('0x4c')][_0xd11f('0x27')]({'plain':!![]});if(!_0x475c2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x475c2c[_0xd11f('0x4d')]===_0xd11f('0x4c')){var _0x58d6cc=_0x4f07b7['get']({'plain':!![]});var _0x29f7e5=_0xd11f('0x4e');return db[_0xd11f('0x4f')][_0xd11f('0x49')]({'where':{'name':_0x29f7e5,'userProfileId':_0x475c2c[_0xd11f('0x50')]},'raw':!![]})[_0xd11f('0x26')](function(_0x49e2dd){if(_0x49e2dd&&_0x49e2dd[_0xd11f('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x58d6cc['name'],'resourceId':_0x58d6cc['id'],'type':_0x49e2dd['name'],'sectionId':_0x49e2dd['id']},{})[_0xd11f('0x26')](function(){return _0x4f07b7;});}else{return _0x4f07b7;}})[_0xd11f('0x45')](function(_0x4e3781){logger[_0xd11f('0x29')](_0xd11f('0x52'),_0x4e3781);throw _0x4e3781;});}return _0x4f07b7;})[_0xd11f('0x26')](respondWithResult(_0x433254,0xc9))[_0xd11f('0x45')](handleError(_0x433254,null));};exports[_0xd11f('0x25')]=function(_0x32650a,_0x469257){if(_0x32650a[_0xd11f('0x4b')]['id']){delete _0x32650a[_0xd11f('0x4b')]['id'];}return db[_0xd11f('0x41')]['find']({'where':{'id':_0x32650a[_0xd11f('0x47')]['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x469257,null))['then'](saveUpdates(_0x32650a[_0xd11f('0x4b')],null))[_0xd11f('0x26')](respondWithResult(_0x469257,null))['catch'](handleError(_0x469257,null));};exports[_0xd11f('0x53')]=function(_0x1669cb,_0x5ea17a){return db[_0xd11f('0x41')][_0xd11f('0x49')]({'where':{'id':_0x1669cb['params']['id']}})['then'](handleEntityNotFound(_0x5ea17a,null))[_0xd11f('0x26')](removeEntity(_0x5ea17a,null))[_0xd11f('0x45')](handleError(_0x5ea17a,null));};exports[_0xd11f('0x2e')]=function(_0x35a04d,_0x561c85){return db[_0xd11f('0x41')][_0xd11f('0x2e')]()[_0xd11f('0x26')](respondWithResult(_0x561c85,null))[_0xd11f('0x45')](handleError(_0x561c85,null));};exports['addContacts']=function(_0x2c6767,_0x50cf7a,_0x427c15){return db[_0xd11f('0x54')][_0xd11f('0x49')]({'where':{'id':_0x2c6767[_0xd11f('0x47')]['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x50cf7a,null))[_0xd11f('0x26')](function(_0x23f44b){if(_0x23f44b){return _0x23f44b[_0xd11f('0x55')](_0x2c6767[_0xd11f('0x4b')][_0xd11f('0x56')],_['omit'](_0x2c6767['body'],['ids','id'])||{});}})[_0xd11f('0x26')](respondWithResult(_0x50cf7a,null))['catch'](handleError(_0x50cf7a,null));};exports[_0xd11f('0x57')]=function(_0x4e27fe,_0x5a9adb,_0x520a91){var _0x4b9570={};var _0xafcf1f={};var _0x400b71;var _0xefde61;return db[_0xd11f('0x41')][_0xd11f('0x58')]({'where':{'id':_0x4e27fe['params']['id']}})[_0xd11f('0x26')](handleEntityNotFound(_0x5a9adb,null))[_0xd11f('0x26')](function(_0x362e69){if(_0x362e69){_0x400b71=_0x362e69;_0xafcf1f['model']=_['keys'](db['CmContact'][_0xd11f('0x59')]);_0xafcf1f[_0xd11f('0x31')]=_[_0xd11f('0x30')](_0x4e27fe[_0xd11f('0x31')]);_0xafcf1f['filters']=_['intersection'](_0xafcf1f[_0xd11f('0x2f')],_0xafcf1f[_0xd11f('0x31')]);_0x4b9570['attributes']=_[_0xd11f('0x33')](_0xafcf1f[_0xd11f('0x2f')],qs[_0xd11f('0x35')](_0x4e27fe[_0xd11f('0x31')][_0xd11f('0x35')]));_0x4b9570['attributes']=_0x4b9570['attributes'][_0xd11f('0x36')]?_0x4b9570[_0xd11f('0x34')]:_0xafcf1f[_0xd11f('0x2f')];_0x4b9570[_0xd11f('0x39')]=qs[_0xd11f('0x3a')](_0x4e27fe[_0xd11f('0x31')][_0xd11f('0x3a')]);_0x4b9570['where']=qs[_0xd11f('0x32')](_['pick'](_0x4e27fe[_0xd11f('0x31')],_0xafcf1f[_0xd11f('0x32')]));if(_0x4e27fe['query'][_0xd11f('0x3c')]){_0x4b9570[_0xd11f('0x3d')]=_[_0xd11f('0x3e')](_0x4b9570[_0xd11f('0x3d')],{'$or':_[_0xd11f('0x3f')](_0x4b9570['attributes'],function(_0x37e837){var _0x317735={};_0x317735[_0x37e837]={'$like':'%'+_0x4e27fe['query'][_0xd11f('0x3c')]+'%'};return _0x317735;})});}_0x4b9570=_[_0xd11f('0x3e')]({},_0x4b9570,_0x4e27fe[_0xd11f('0x40')]);return _0x400b71[_0xd11f('0x57')](_0x4b9570);}})['then'](function(_0x25aadb){if(_0x25aadb){_0xefde61=_0x25aadb[_0xd11f('0x36')];if(!_0x4e27fe[_0xd11f('0x31')][_0xd11f('0x37')](_0xd11f('0x38'))){_0x4b9570['limit']=qs['limit'](_0x4e27fe['query'][_0xd11f('0x1d')]);_0x4b9570[_0xd11f('0x1c')]=qs[_0xd11f('0x1c')](_0x4e27fe['query'][_0xd11f('0x1c')]);}return _0x400b71[_0xd11f('0x57')](_0x4b9570);}})[_0xd11f('0x26')](function(_0xaeb637){if(_0xaeb637){return _0xaeb637?{'count':_0xefde61,'rows':_0xaeb637}:null;}})[_0xd11f('0x26')](respondWithResult(_0x5a9adb,null))[_0xd11f('0x45')](handleError(_0x5a9adb,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 1e3da9f..4877c6b 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 _0x928d=['rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x34716f,_0xf890ae){var _0x6e5aad=function(_0x355793){while(--_0x355793){_0x34716f['push'](_0x34716f['shift']());}};_0x6e5aad(++_0xf890ae);}(_0x928d,0xe6));var _0xd928=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x928d[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xd928('0x0'));var util=require(_0xd928('0x1'));var logger=require(_0xd928('0x2'))(_0xd928('0x3'));var moment=require(_0xd928('0x4'));var BPromise=require(_0xd928('0x5'));var rp=require(_0xd928('0x6'));var fs=require('fs');var path=require(_0xd928('0x7'));var rimraf=require(_0xd928('0x8'));var config=require(_0xd928('0x9'));var attributes=require(_0xd928('0xa'));module['exports']=function(_0x1e8a47,_0x4f4f34){return _0x1e8a47[_0xd928('0xb')](_0xd928('0xc'),attributes,{'tableName':_0xd928('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x730f=['cm_companies','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x26c18f,_0x24ec32){var _0x4aefc6=function(_0x12068e){while(--_0x12068e){_0x26c18f['push'](_0x26c18f['shift']());}};_0x4aefc6(++_0x24ec32);}(_0x730f,0x7f));var _0xf730=function(_0xf17e2b,_0x448b96){_0xf17e2b=_0xf17e2b-0x0;var _0x4303b6=_0x730f[_0xf17e2b];return _0x4303b6;};'use strict';var _=require(_0xf730('0x0'));var util=require('util');var logger=require(_0xf730('0x1'))('api');var moment=require(_0xf730('0x2'));var BPromise=require('bluebird');var rp=require(_0xf730('0x3'));var fs=require('fs');var path=require(_0xf730('0x4'));var rimraf=require(_0xf730('0x5'));var config=require(_0xf730('0x6'));var attributes=require(_0xf730('0x7'));module['exports']=function(_0x50dc86,_0x3c1aef){return _0x50dc86['define']('CmCompany',attributes,{'tableName':_0xf730('0x8'),'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 6bfb514..c7599b7 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 _0xf1f6=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3d6553,_0x2631e7){var _0x1eab6c=function(_0x3f9a72){while(--_0x3f9a72){_0x3d6553['push'](_0x3d6553['shift']());}};_0x1eab6c(++_0x2631e7);}(_0xf1f6,0x1ad));var _0x6f1f=function(_0x2318f3,_0x2b51ef){_0x2318f3=_0x2318f3-0x0;var _0x3ad44a=_0xf1f6[_0x2318f3];return _0x3ad44a;};'use strict';var _=require(_0x6f1f('0x0'));var util=require('util');var moment=require(_0x6f1f('0x1'));var BPromise=require(_0x6f1f('0x2'));var rs=require(_0x6f1f('0x3'));var fs=require('fs');var Redis=require(_0x6f1f('0x4'));var db=require(_0x6f1f('0x5'))['db'];var utils=require(_0x6f1f('0x6'));var logger=require(_0x6f1f('0x7'))(_0x6f1f('0x8'));var config=require(_0x6f1f('0x9'));var jayson=require(_0x6f1f('0xa'));var client=jayson[_0x6f1f('0xb')][_0x6f1f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8519a4,_0x2d931b,_0x2b2cc1){return new BPromise(function(_0x19c25c,_0x483ad5){return client[_0x6f1f('0xd')](_0x8519a4,_0x2b2cc1)[_0x6f1f('0xe')](function(_0x3d1c96){logger[_0x6f1f('0xf')](_0x6f1f('0x10'),_0x2d931b,_0x6f1f('0x11'));logger[_0x6f1f('0x12')](_0x6f1f('0x13'),_0x2d931b,_0x6f1f('0x11'),JSON[_0x6f1f('0x14')](_0x3d1c96));if(_0x3d1c96[_0x6f1f('0x15')]){if(_0x3d1c96['error'][_0x6f1f('0x16')]===0x1f4){logger[_0x6f1f('0x15')](_0x6f1f('0x10'),_0x2d931b,_0x3d1c96[_0x6f1f('0x15')]['message']);return _0x483ad5(_0x3d1c96[_0x6f1f('0x15')][_0x6f1f('0x17')]);}logger[_0x6f1f('0x15')](_0x6f1f('0x10'),_0x2d931b,_0x3d1c96[_0x6f1f('0x15')][_0x6f1f('0x17')]);return _0x19c25c(_0x3d1c96[_0x6f1f('0x15')][_0x6f1f('0x17')]);}else{logger[_0x6f1f('0xf')](_0x6f1f('0x10'),_0x2d931b,_0x6f1f('0x11'));_0x19c25c(_0x3d1c96[_0x6f1f('0x18')][_0x6f1f('0x17')]);}})[_0x6f1f('0x19')](function(_0x5d06b2){logger[_0x6f1f('0x15')]('CmCompany,\x20%s,\x20%s',_0x2d931b,_0x5d06b2);_0x483ad5(_0x5d06b2);});});}
\ No newline at end of file
+var _0x1571=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x116945,_0x5bfce6){var _0x37671d=function(_0x4a6f79){while(--_0x4a6f79){_0x116945['push'](_0x116945['shift']());}};_0x37671d(++_0x5bfce6);}(_0x1571,0x174));var _0x1157=function(_0xa7fb1f,_0x1c49bc){_0xa7fb1f=_0xa7fb1f-0x0;var _0x32e057=_0x1571[_0xa7fb1f];return _0x32e057;};'use strict';var _=require(_0x1157('0x0'));var util=require('util');var moment=require(_0x1157('0x1'));var BPromise=require(_0x1157('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1157('0x3'));var db=require(_0x1157('0x4'))['db'];var utils=require(_0x1157('0x5'));var logger=require(_0x1157('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1157('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c3211,_0x25e471,_0x5b6e57){return new BPromise(function(_0x17bc7d,_0x326b20){return client[_0x1157('0x8')](_0x1c3211,_0x5b6e57)[_0x1157('0x9')](function(_0x1422c6){logger[_0x1157('0xa')](_0x1157('0xb'),_0x25e471,_0x1157('0xc'));logger[_0x1157('0xd')](_0x1157('0xe'),_0x25e471,_0x1157('0xc'),JSON[_0x1157('0xf')](_0x1422c6));if(_0x1422c6[_0x1157('0x10')]){if(_0x1422c6[_0x1157('0x10')]['code']===0x1f4){logger[_0x1157('0x10')]('CmCompany,\x20%s,\x20%s',_0x25e471,_0x1422c6[_0x1157('0x10')]['message']);return _0x326b20(_0x1422c6['error']['message']);}logger[_0x1157('0x10')](_0x1157('0xb'),_0x25e471,_0x1422c6[_0x1157('0x10')][_0x1157('0x11')]);return _0x17bc7d(_0x1422c6[_0x1157('0x10')][_0x1157('0x11')]);}else{logger[_0x1157('0xa')](_0x1157('0xb'),_0x25e471,_0x1157('0xc'));_0x17bc7d(_0x1422c6[_0x1157('0x12')][_0x1157('0x11')]);}})['catch'](function(_0x282fba){logger[_0x1157('0x10')](_0x1157('0xb'),_0x25e471,_0x282fba);_0x326b20(_0x282fba);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 32ceb5f..dda07fe 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 _0x4672=['delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4672,0x18a));var _0x2467=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0x4672[_0x30a528];return _0x3e029c;};'use strict';var multer=require(_0x2467('0x0'));var util=require('util');var path=require(_0x2467('0x1'));var timeout=require(_0x2467('0x2'));var express=require('express');var router=express[_0x2467('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2467('0x4'));var interaction=require(_0x2467('0x5'));var config=require(_0x2467('0x6'));var controller=require(_0x2467('0x7'));router['get']('/',auth[_0x2467('0x8')](),controller['index']);router[_0x2467('0x9')](_0x2467('0xa'),auth[_0x2467('0x8')](),controller[_0x2467('0xb')]);router[_0x2467('0x9')](_0x2467('0xc'),auth[_0x2467('0x8')](),controller[_0x2467('0xd')]);router[_0x2467('0x9')]('/:id/contacts',auth[_0x2467('0x8')](),controller[_0x2467('0xe')]);router[_0x2467('0xf')]('/',auth[_0x2467('0x8')](),controller['create']);router[_0x2467('0xf')](_0x2467('0x10'),auth[_0x2467('0x8')](),controller[_0x2467('0x11')]);router[_0x2467('0x12')](_0x2467('0xc'),auth['isAuthenticated'](),controller[_0x2467('0x13')]);router[_0x2467('0x14')](_0x2467('0xc'),auth[_0x2467('0x8')](),controller[_0x2467('0x15')]);module[_0x2467('0x16')]=router;
\ No newline at end of file
+var _0x6ce8=['addContacts','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id/contacts','getContacts','post'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x6ce8,0x89));var _0x86ce=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x6ce8[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0x86ce('0x0'));var util=require(_0x86ce('0x1'));var path=require(_0x86ce('0x2'));var timeout=require(_0x86ce('0x3'));var express=require(_0x86ce('0x4'));var router=express[_0x86ce('0x5')]();var fs_extra=require(_0x86ce('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x86ce('0x7'));var config=require(_0x86ce('0x8'));var controller=require('./cmCompany.controller');router[_0x86ce('0x9')]('/',auth['isAuthenticated'](),controller[_0x86ce('0xa')]);router[_0x86ce('0x9')](_0x86ce('0xb'),auth[_0x86ce('0xc')](),controller[_0x86ce('0xd')]);router[_0x86ce('0x9')]('/:id',auth[_0x86ce('0xc')](),controller['show']);router[_0x86ce('0x9')](_0x86ce('0xe'),auth['isAuthenticated'](),controller[_0x86ce('0xf')]);router[_0x86ce('0x10')]('/',auth[_0x86ce('0xc')](),controller['create']);router['post'](_0x86ce('0xe'),auth['isAuthenticated'](),controller[_0x86ce('0x11')]);router[_0x86ce('0x12')](_0x86ce('0x13'),auth[_0x86ce('0xc')](),controller['update']);router[_0x86ce('0x14')](_0x86ce('0x13'),auth[_0x86ce('0xc')](),controller['destroy']);module[_0x86ce('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 1633b0e..33b1f18 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 _0x5f66=['sequelize','STRING','INTEGER','DATE'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var Sequelize=require(_0x65f6('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x65f6('0x1')]},'street':{'type':Sequelize[_0x65f6('0x1')]},'postalCode':{'type':Sequelize[_0x65f6('0x1')]},'city':{'type':Sequelize[_0x65f6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x65f6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x65f6('0x1')]},'mobile':{'type':Sequelize[_0x65f6('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x65f6('0x1')]},'facebook':{'type':Sequelize[_0x65f6('0x1')]},'fb_data':{'type':Sequelize[_0x65f6('0x1')]},'twitter':{'type':Sequelize[_0x65f6('0x1')]},'skype':{'type':Sequelize[_0x65f6('0x1')]},'teams':{'type':Sequelize[_0x65f6('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65f6('0x1')]},'telegram':{'type':Sequelize[_0x65f6('0x1')]},'UserId':{'type':Sequelize[_0x65f6('0x2')]},'priority':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x65f6('0x2')]}};
\ No newline at end of file
+var _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4d3f19,_0x96a39b){var _0x25ae86=function(_0x3674e6){while(--_0x3674e6){_0x4d3f19['push'](_0x4d3f19['shift']());}};_0x25ae86(++_0x96a39b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index b5b6c0b..91a1d09 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 _0xcf01=['Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','callerid','endtime','duration','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','DESC','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','subject','threadId','startCase','Interaction','Owner','all','flatten','sortBy','moment','util','squel','papaparse','../../config/logger','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','index','CmContact','keys','startsWith','cf_','push','trimStart','length','fieldType','type','model','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','text','value','start','map','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','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?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','having','t.id\x20IN\x20?','resolve','role','agent','some','User','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','describe','columnName','analytics','findAll','displayName','alias','custom','values','merge','body','get','mergeWith','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','create','join','dialTimezone','utcOffset','timezones','each','duplicates','$or','findOrCreate','spread','show','CmCustomField','omit','format','$and','pickBy','cf_%d','table','id\x20=\x20?','toParam','phone','CmHopper','findOne','Tag','rawAttributes','options','getTags','setTags','getHoppers','ContactId','includeAll','include','getHopperHistories','CmHopperFinal','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','root','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','path','parse','meta','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','whatsapp','voice','channel','includes','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf01,0x141));var _0x1cf0=function(_0x43f9fd,_0x3bb23c){_0x43f9fd=_0x43f9fd-0x0;var _0x15360e=_0xcf01[_0x43f9fd];return _0x15360e;};'use strict';var moment=require(_0x1cf0('0x0'));var BPromise=require('bluebird');var util=require(_0x1cf0('0x1'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x1cf0('0x2'));var Papa=require(_0x1cf0('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x1cf0('0x4'))('api');var config=require('../../config/environment');var shared=require(_0x1cf0('0x5'));var db=require(_0x1cf0('0x6'))['db'];config[_0x1cf0('0x7')]=_[_0x1cf0('0x8')](config[_0x1cf0('0x7')],{'host':_0x1cf0('0x9'),'port':0x18eb});var socket=require(_0x1cf0('0xa'))(new Redis(config['redis']));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x479b24,_0x5016ca){_0x5016ca=_0x5016ca||0xc8;return function(_0x48af00){if(_0x48af00){return _0x479b24[_0x1cf0('0xb')](_0x5016ca)[_0x1cf0('0xc')](_0x48af00);}};}function respondWithFilteredResult(_0x153233,_0x3bb6a7){return function(_0x11b70b){if(_0x11b70b){var _0xe7532c=typeof _0x3bb6a7[_0x1cf0('0xd')]===_0x1cf0('0xe')&&typeof _0x3bb6a7[_0x1cf0('0xf')]==='undefined';var _0xce1872=_0x11b70b[_0x1cf0('0x10')];var _0x41617a=_0xe7532c?0x0:_0x3bb6a7[_0x1cf0('0xd')];var _0x83d0b=_0xe7532c?_0x11b70b[_0x1cf0('0x10')]:_0x3bb6a7[_0x1cf0('0xd')]+_0x3bb6a7['limit'];var _0x547aca;if(_0x83d0b>=_0xce1872){_0x83d0b=_0xce1872;_0x547aca=0xc8;}else{_0x547aca=0xce;}_0x153233['status'](_0x547aca);return _0x153233[_0x1cf0('0x11')](_0x1cf0('0x12'),_0x41617a+'-'+_0x83d0b+'/'+_0xce1872)[_0x1cf0('0xc')](_0x11b70b);}return null;};}function saveUpdates(_0x5019dd){return function(_0x3b571a){if(_0x3b571a){return _0x3b571a[_0x1cf0('0x13')](_0x5019dd)[_0x1cf0('0x14')](function(_0x2d2568){return _0x2d2568;});}return null;};}function removeEntity(_0x379695){return function(_0x227078){if(_0x227078){return _0x227078[_0x1cf0('0x15')]()[_0x1cf0('0x14')](function(){_0x379695[_0x1cf0('0xb')](0xcc)[_0x1cf0('0x16')]();});}};}function handleEntityNotFound(_0x101fbe){return function(_0x3b6ebb){if(!_0x3b6ebb){_0x101fbe[_0x1cf0('0x17')](0x194);}return _0x3b6ebb;};}function handleError(_0x4a1f8c,_0x393adc){_0x393adc=_0x393adc||0x1f4;return function(_0x130c83){logger['error'](_0x130c83[_0x1cf0('0x18')]);if(_0x130c83[_0x1cf0('0x19')]){delete _0x130c83[_0x1cf0('0x19')];}_0x4a1f8c[_0x1cf0('0xb')](_0x393adc)['send'](_0x130c83);};}exports[_0x1cf0('0x1a')]=function(_0xce3ff4,_0x5ad914){var _0x4870a2={},_0x32095c={},_0x35a379={'count':0x0,'rows':[]};return db[_0x1cf0('0x1b')]['describe']()['then'](function(_0x54f2de){var _0x30e746=[];for(var _0x7274ba=0x0;_0x7274ba
','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','address','generate','@xcally.com','head','value','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','html','test','replace','includes','0x1?_0x293a7c[_0xef33('0x11')](0x0,-0x1)[_0xef33('0x12')]('\x20'):_0x2862bb['name'];}return _0xef33('0x13');}function getLastName(_0x41f93f){var _0x531efd=_['head'](_0x41f93f[_0xef33('0xc')]);if(_0x531efd&&_0x531efd[_0xef33('0xd')]){var _0xe3071a=_0x531efd['name'][_0xef33('0xf')](/\s+/);return _0xe3071a[_0xef33('0x10')]>0x1?_0xe3071a[_0xef33('0x14')]():'';}return'';}function getMails(_0x48ae05,_0x23b92f){var _0xf3af8a='';for(var _0x850fe=0x0;_0x850fe<_0x23b92f[_0xef33('0xc')][_0xef33('0x10')];_0x850fe+=0x1){if(_0x23b92f['value'][_0x850fe][_0xef33('0x8')]!==_0x48ae05){if(!_[_0xef33('0x15')](_0xf3af8a)){_0xf3af8a+=',';}_0xf3af8a+=_0x23b92f[_0xef33('0xc')][_0x850fe]['name']||_0x23b92f['value'][_0x850fe][_0xef33('0x8')]||'';_0xf3af8a+='\x20<';_0xf3af8a+=_0x23b92f[_0xef33('0xc')][_0x850fe][_0xef33('0x8')]?_0x23b92f[_0xef33('0xc')][_0x850fe]['address']:_0xef33('0x16')+random[_0xef33('0x9')](0x6)+_0xef33('0xa');_0xf3af8a+='>';}}return _0xf3af8a;}function parseEmail(_0x5df019,_0x3f776f,_0x1ed3a7){if(_0x3f776f[_0xef33('0x17')]){var _0x90f11d=/