From: Andrea Bianco
Date: Thu, 23 Sep 2021 13:02:34 +0000 (+0200)
Subject: Built motion from commit 746c7d2a.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.fax?a=commitdiff_plain;h=8f3710d61ad4f188686c6bee34468724f64a2e30;p=motion2.git
Built motion from commit 746c7d2a.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 27a5480..0b5776e 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-19T19:50:08.868Z",
+ "time": "2021-09-23T12:56:02.602Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index d386851..24bcf9f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-19T19:50:08.868Z",
+ "time": "2021-09-23T12:56:02.602Z",
"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 43844df..3a952f2 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 _0xb6a6=['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]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x31b0de,_0x2d8988){var _0x4de47f=function(_0x176a3f){while(--_0x176a3f){_0x31b0de['push'](_0x31b0de['shift']());}};_0x4de47f(++_0x2d8988);}(_0xb6a6,0x1ed));var _0x6b6a=function(_0x4c1c56,_0x4a4b63){_0x4c1c56=_0x4c1c56-0x0;var _0x1e561a=_0xb6a6[_0x4c1c56];return _0x1e561a;};'use strict';var Sequelize=require('sequelize');module[_0x6b6a('0x0')]={'name':{'type':Sequelize[_0x6b6a('0x1')],'get':function(_0x176431){return this[_0x6b6a('0x2')]('action');}},'action':{'type':Sequelize[_0x6b6a('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6b6a('0x4'),_0x6b6a('0x5'),_0x6b6a('0x6'),'jscripty','urlForward',_0x6b6a('0x7'),_0x6b6a('0x8'),_0x6b6a('0x9')]],'msg':_0x6b6a('0xa')}},'comment':_0x6b6a('0xa')},'data1':{'type':Sequelize[_0x6b6a('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['STRING'](0x1000),'comment':_0x6b6a('0xb')},'data3':{'type':Sequelize[_0x6b6a('0x3')](0x1000),'comment':_0x6b6a('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x6b6a('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6b6a('0xe')},'data6':{'type':Sequelize[_0x6b6a('0x3')],'comments':_0x6b6a('0xf')},'data7':{'type':Sequelize[_0x6b6a('0x10')],'comments':_0x6b6a('0x11')}};
\ No newline at end of file
+var _0xd9dd=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','motionbar','urlForward','bot','script'];(function(_0x47014f,_0x1e5544){var _0x5e24a5=function(_0x1e1581){while(--_0x1e1581){_0x47014f['push'](_0x47014f['shift']());}};_0x5e24a5(++_0x1e5544);}(_0xd9dd,0x1a6));var _0xdd9d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9dd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdd9d('0x0'));module[_0xdd9d('0x1')]={'name':{'type':Sequelize[_0xdd9d('0x2')],'get':function(_0x5bee62){return this[_0xdd9d('0x3')](_0xdd9d('0x4'));}},'action':{'type':Sequelize[_0xdd9d('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xdd9d('0x6'),'jscripty',_0xdd9d('0x7'),'browser',_0xdd9d('0x8'),_0xdd9d('0x9')]],'msg':_0xdd9d('0xa')}},'comment':_0xdd9d('0xa')},'data1':{'type':Sequelize[_0xdd9d('0x5')](0x1000),'comment':_0xdd9d('0xb')},'data2':{'type':Sequelize[_0xdd9d('0x5')](0x1000),'comment':_0xdd9d('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdd9d('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xdd9d('0x5')](0x1000),'comments':_0xdd9d('0xe')},'data6':{'type':Sequelize[_0xdd9d('0x5')],'comments':_0xdd9d('0xf')},'data7':{'type':Sequelize[_0xdd9d('0x10')],'comments':_0xdd9d('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index bfb99b2..1b0ac27 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 _0x22c5=['Action','params','catch','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','body'];(function(_0x234b33,_0x24747c){var _0x3f3ab8=function(_0xe110d7){while(--_0xe110d7){_0x234b33['push'](_0x234b33['shift']());}};_0x3f3ab8(++_0x24747c);}(_0x22c5,0xe0));var _0x522c=function(_0x369c25,_0x2b1b6e){_0x369c25=_0x369c25-0x0;var _0x15b1bd=_0x22c5[_0x369c25];return _0x15b1bd;};'use strict';var emlformat=require(_0x522c('0x0'));var rimraf=require(_0x522c('0x1'));var zipdir=require(_0x522c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x522c('0x3'));var BPromise=require(_0x522c('0x4'));var Mustache=require(_0x522c('0x5'));var util=require('util');var path=require(_0x522c('0x6'));var sox=require(_0x522c('0x7'));var csv=require(_0x522c('0x8'));var ejs=require(_0x522c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x522c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x522c('0xb'));var toCsv=require(_0x522c('0x8'));var querystring=require('querystring');var Papa=require(_0x522c('0xc'));var Redis=require('ioredis');var authService=require(_0x522c('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x522c('0xe'))(_0x522c('0xf'));var utils=require(_0x522c('0x10'));var config=require(_0x522c('0x11'));var licenseUtil=require(_0x522c('0x12'));var db=require(_0x522c('0x13'))['db'];function respondWithStatusCode(_0x114a6c,_0x3712af){_0x3712af=_0x3712af||0xcc;return function(_0x59d647){if(_0x59d647){return _0x114a6c['sendStatus'](_0x3712af);}return _0x114a6c[_0x522c('0x14')](_0x3712af)['end']();};}function respondWithResult(_0x4c1c82,_0x23feb7){_0x23feb7=_0x23feb7||0xc8;return function(_0x248b03){if(_0x248b03){return _0x4c1c82[_0x522c('0x14')](_0x23feb7)['json'](_0x248b03);}};}function respondWithFilteredResult(_0x44dec5,_0x581969){return function(_0x548932){if(_0x548932){var _0x3ac163=typeof _0x581969[_0x522c('0x15')]===_0x522c('0x16')&&typeof _0x581969[_0x522c('0x17')]==='undefined';var _0x48abab=_0x548932[_0x522c('0x18')];var _0x3f3172=_0x3ac163?0x0:_0x581969['offset'];var _0x96df50=_0x3ac163?_0x548932['count']:_0x581969['offset']+_0x581969[_0x522c('0x17')];var _0x3edc5e;if(_0x96df50>=_0x48abab){_0x96df50=_0x48abab;_0x3edc5e=0xc8;}else{_0x3edc5e=0xce;}_0x44dec5[_0x522c('0x14')](_0x3edc5e);return _0x44dec5[_0x522c('0x19')](_0x522c('0x1a'),_0x3f3172+'-'+_0x96df50+'/'+_0x48abab)[_0x522c('0x1b')](_0x548932);}return null;};}function patchUpdates(_0x244d3b){return function(_0x4882e7){try{jsonpatch[_0x522c('0x1c')](_0x4882e7,_0x244d3b,!![]);}catch(_0x38134e){return BPromise[_0x522c('0x1d')](_0x38134e);}return _0x4882e7[_0x522c('0x1e')]();};}function saveUpdates(_0x1a0fb0,_0x2ec0a2){return function(_0x4e7984){if(_0x4e7984){return _0x4e7984[_0x522c('0x1f')](_0x1a0fb0)[_0x522c('0x20')](function(_0x2076fd){return _0x2076fd;});}return null;};}function removeEntity(_0x28d385,_0x3f2ea7){return function(_0x5c4b62){if(_0x5c4b62){return _0x5c4b62['destroy']()['then'](function(){_0x28d385[_0x522c('0x14')](0xcc)[_0x522c('0x21')]();});}};}function handleEntityNotFound(_0x1e33d2,_0x4956e6){return function(_0x14b179){if(!_0x14b179){_0x1e33d2[_0x522c('0x22')](0x194);}return _0x14b179;};}function handleError(_0x4b1051,_0x245711){_0x245711=_0x245711||0x1f4;return function(_0x58c776){logger[_0x522c('0x23')](_0x58c776[_0x522c('0x24')]);if(_0x58c776['name']){delete _0x58c776[_0x522c('0x25')];}_0x4b1051['status'](_0x245711)[_0x522c('0x26')](_0x58c776);};}exports[_0x522c('0x1f')]=function(_0x5f0980,_0x4e0127){if(_0x5f0980[_0x522c('0x27')]['id']){delete _0x5f0980[_0x522c('0x27')]['id'];}return db[_0x522c('0x28')]['find']({'where':{'id':_0x5f0980[_0x522c('0x29')]['id']}})[_0x522c('0x20')](handleEntityNotFound(_0x4e0127,null))[_0x522c('0x20')](saveUpdates(_0x5f0980[_0x522c('0x27')],null))[_0x522c('0x20')](respondWithResult(_0x4e0127,null))[_0x522c('0x2a')](handleError(_0x4e0127,null));};exports[_0x522c('0x2b')]=function(_0x97cea,_0x612262){return db[_0x522c('0x28')]['find']({'where':{'id':_0x97cea['params']['id']}})[_0x522c('0x20')](handleEntityNotFound(_0x612262,null))[_0x522c('0x20')](removeEntity(_0x612262,null))['catch'](handleError(_0x612262,null));};
\ No newline at end of file
+var _0x788b=['then','destroy','error','stack','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update'];(function(_0x44b533,_0x221c8d){var _0x42325b=function(_0x309350){while(--_0x309350){_0x44b533['push'](_0x44b533['shift']());}};_0x42325b(++_0x221c8d);}(_0x788b,0x1eb));var _0xb788=function(_0x5b2878,_0x3453fa){_0x5b2878=_0x5b2878-0x0;var _0x350952=_0x788b[_0x5b2878];return _0x350952;};'use strict';var emlformat=require(_0xb788('0x0'));var rimraf=require(_0xb788('0x1'));var zipdir=require(_0xb788('0x2'));var jsonpatch=require(_0xb788('0x3'));var rp=require(_0xb788('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb788('0x5'));var util=require(_0xb788('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb788('0x7'));var ejs=require(_0xb788('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb788('0x9'));var squel=require(_0xb788('0xa'));var crypto=require(_0xb788('0xb'));var jsforce=require(_0xb788('0xc'));var deskjs=require(_0xb788('0xd'));var toCsv=require(_0xb788('0x7'));var querystring=require(_0xb788('0xe'));var Papa=require('papaparse');var Redis=require(_0xb788('0xf'));var authService=require(_0xb788('0x10'));var qs=require(_0xb788('0x11'));var as=require(_0xb788('0x12'));var hardwareService=require(_0xb788('0x13'));var logger=require(_0xb788('0x14'))('api');var utils=require(_0xb788('0x15'));var config=require(_0xb788('0x16'));var licenseUtil=require(_0xb788('0x17'));var db=require(_0xb788('0x18'))['db'];function respondWithStatusCode(_0x56963f,_0x9e2286){_0x9e2286=_0x9e2286||0xcc;return function(_0x50f502){if(_0x50f502){return _0x56963f[_0xb788('0x19')](_0x9e2286);}return _0x56963f[_0xb788('0x1a')](_0x9e2286)[_0xb788('0x1b')]();};}function respondWithResult(_0x143530,_0x2db5a2){_0x2db5a2=_0x2db5a2||0xc8;return function(_0x5f000a){if(_0x5f000a){return _0x143530[_0xb788('0x1a')](_0x2db5a2)['json'](_0x5f000a);}};}function respondWithFilteredResult(_0x394e80,_0x43f43e){return function(_0x35f4a1){if(_0x35f4a1){var _0x4ff7c9=typeof _0x43f43e[_0xb788('0x1c')]===_0xb788('0x1d')&&typeof _0x43f43e[_0xb788('0x1e')]===_0xb788('0x1d');var _0x44ca89=_0x35f4a1[_0xb788('0x1f')];var _0x518889=_0x4ff7c9?0x0:_0x43f43e[_0xb788('0x1c')];var _0x3e3078=_0x4ff7c9?_0x35f4a1[_0xb788('0x1f')]:_0x43f43e[_0xb788('0x1c')]+_0x43f43e[_0xb788('0x1e')];var _0x5e23ee;if(_0x3e3078>=_0x44ca89){_0x3e3078=_0x44ca89;_0x5e23ee=0xc8;}else{_0x5e23ee=0xce;}_0x394e80[_0xb788('0x1a')](_0x5e23ee);return _0x394e80[_0xb788('0x20')](_0xb788('0x21'),_0x518889+'-'+_0x3e3078+'/'+_0x44ca89)[_0xb788('0x22')](_0x35f4a1);}return null;};}function patchUpdates(_0x4cf795){return function(_0x1e9820){try{jsonpatch['apply'](_0x1e9820,_0x4cf795,!![]);}catch(_0x1cbe44){return BPromise['reject'](_0x1cbe44);}return _0x1e9820[_0xb788('0x23')]();};}function saveUpdates(_0x3afe33,_0x4b3331){return function(_0x389b07){if(_0x389b07){return _0x389b07[_0xb788('0x24')](_0x3afe33)[_0xb788('0x25')](function(_0x13a3ae){return _0x13a3ae;});}return null;};}function removeEntity(_0x454edc,_0x1afe56){return function(_0x2ee702){if(_0x2ee702){return _0x2ee702[_0xb788('0x26')]()[_0xb788('0x25')](function(){_0x454edc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ec83,_0x14826b){return function(_0x1bbf5a){if(!_0x1bbf5a){_0x32ec83[_0xb788('0x19')](0x194);}return _0x1bbf5a;};}function handleError(_0x54a1cf,_0x3aaf0b){_0x3aaf0b=_0x3aaf0b||0x1f4;return function(_0x59b522){logger[_0xb788('0x27')](_0x59b522[_0xb788('0x28')]);if(_0x59b522['name']){delete _0x59b522[_0xb788('0x29')];}_0x54a1cf[_0xb788('0x1a')](_0x3aaf0b)[_0xb788('0x2a')](_0x59b522);};}exports['update']=function(_0xb5a1dc,_0x357b30){if(_0xb5a1dc[_0xb788('0x2b')]['id']){delete _0xb5a1dc[_0xb788('0x2b')]['id'];}return db[_0xb788('0x2c')][_0xb788('0x2d')]({'where':{'id':_0xb5a1dc['params']['id']}})[_0xb788('0x25')](handleEntityNotFound(_0x357b30,null))[_0xb788('0x25')](saveUpdates(_0xb5a1dc[_0xb788('0x2b')],null))['then'](respondWithResult(_0x357b30,null))[_0xb788('0x2e')](handleError(_0x357b30,null));};exports[_0xb788('0x26')]=function(_0x3949f3,_0x1c71be){return db['Action']['find']({'where':{'id':_0x3949f3[_0xb788('0x2f')]['id']}})['then'](handleEntityNotFound(_0x1c71be,null))[_0xb788('0x25')](removeEntity(_0x1c71be,null))[_0xb788('0x2e')](handleError(_0x1c71be,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index f753697..d7b6520 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 _0xd802=['path','rimraf','../../config/environment','define','tools_actions','util','../../config/logger','moment','request-promise'];(function(_0x3d0293,_0x3d3c80){var _0x5aa8d3=function(_0x1e1a9a){while(--_0x1e1a9a){_0x3d0293['push'](_0x3d0293['shift']());}};_0x5aa8d3(++_0x3d3c80);}(_0xd802,0x7a));var _0x2d80=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0xd802[_0x1b1365];return _0x5edfd8;};'use strict';var _=require('lodash');var util=require(_0x2d80('0x0'));var logger=require(_0x2d80('0x1'))('api');var moment=require(_0x2d80('0x2'));var BPromise=require('bluebird');var rp=require(_0x2d80('0x3'));var fs=require('fs');var path=require(_0x2d80('0x4'));var rimraf=require(_0x2d80('0x5'));var config=require(_0x2d80('0x6'));var attributes=require('./action.attributes');module['exports']=function(_0xf81f6f,_0x22c27c){return _0xf81f6f[_0x2d80('0x7')]('Action',attributes,{'tableName':_0x2d80('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0053=['tools_actions','util','../../config/logger','api','moment','request-promise','rimraf','./action.attributes','define','Action'];(function(_0x10f6c5,_0xa3fc35){var _0x3003f9=function(_0x22d5df){while(--_0x22d5df){_0x10f6c5['push'](_0x10f6c5['shift']());}};_0x3003f9(++_0xa3fc35);}(_0x0053,0x14b));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3005('0x0'));var logger=require(_0x3005('0x1'))(_0x3005('0x2'));var moment=require(_0x3005('0x3'));var BPromise=require('bluebird');var rp=require(_0x3005('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3005('0x5'));var config=require('../../config/environment');var attributes=require(_0x3005('0x6'));module['exports']=function(_0x17c82a,_0x3c6aa2){return _0x17c82a[_0x3005('0x7')](_0x3005('0x8'),attributes,{'tableName':_0x3005('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index eeabe27..6e99062 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2e7e96,_0x2b8f8b){var _0x2790ba=function(_0x534fdb){while(--_0x534fdb){_0x2e7e96['push'](_0x2e7e96['shift']());}};_0x2790ba(++_0x2b8f8b);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+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(_0x1a6225,_0x4140f0){var _0x4bd1d3=function(_0x128f51){while(--_0x128f51){_0x1a6225['push'](_0x1a6225['shift']());}};_0x4bd1d3(++_0x4140f0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'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 52e0569..efee6d9 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 _0x444d=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated'];(function(_0x204cbf,_0x26b425){var _0x19729f=function(_0x357104){while(--_0x357104){_0x204cbf['push'](_0x204cbf['shift']());}};_0x19729f(++_0x26b425);}(_0x444d,0xd5));var _0xd444=function(_0xb660ff,_0x5452f0){_0xb660ff=_0xb660ff-0x0;var _0x544073=_0x444d[_0xb660ff];return _0x544073;};'use strict';var multer=require(_0xd444('0x0'));var util=require(_0xd444('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd444('0x2'));var router=express[_0xd444('0x3')]();var fs_extra=require(_0xd444('0x4'));var auth=require(_0xd444('0x5'));var interaction=require(_0xd444('0x6'));var config=require('../../config/environment');var controller=require(_0xd444('0x7'));router[_0xd444('0x8')](_0xd444('0x9'),auth[_0xd444('0xa')](),controller['update']);router[_0xd444('0xb')]('/:id',auth[_0xd444('0xa')](),controller[_0xd444('0xc')]);module[_0xd444('0xd')]=router;
\ No newline at end of file
+var _0xb0fa=['./action.controller','put','/:id','isAuthenticated','delete','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x425c51,_0x8ae79f){var _0x5a2ef6=function(_0x1d450d){while(--_0x1d450d){_0x425c51['push'](_0x425c51['shift']());}};_0x5a2ef6(++_0x8ae79f);}(_0xb0fa,0xff));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab0f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab0f('0x1'));var router=express['Router']();var fs_extra=require(_0xab0f('0x2'));var auth=require(_0xab0f('0x3'));var interaction=require(_0xab0f('0x4'));var config=require('../../config/environment');var controller=require(_0xab0f('0x5'));router[_0xab0f('0x6')](_0xab0f('0x7'),auth[_0xab0f('0x8')](),controller['update']);router[_0xab0f('0x9')](_0xab0f('0x7'),auth[_0xab0f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d1569a9..812af26 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x53e3fa,_0x50c5f2){var _0xe8584a=function(_0x1771a5){while(--_0x1771a5){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xe8584a(++_0x50c5f2);}(_0xafc4,0x69));var _0x4afc=function(_0x3e85b5,_0x262880){_0x3e85b5=_0x3e85b5-0x0;var _0x3a3c32=_0xafc4[_0x3e85b5];return _0x3a3c32;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x4d1133,_0x11548f){var _0x3d52c7=function(_0x4c0401){while(--_0x4c0401){_0x4d1133['push'](_0x4d1133['shift']());}};_0x3d52c7(++_0x11548f);}(_0x1883,0xab));var _0x3188=function(_0x4485c7,_0x1e619b){_0x4485c7=_0x4485c7-0x0;var _0x1b61c1=_0x1883[_0x4485c7];return _0x1b61c1;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 46c4e6d..c870ec2 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 _0x5554=['fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','show','params','length','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','MetricId','metric','field','function','replace','orderBy','order','DESC','alias','joins','parse','foreignTable','format','%s.%s\x20=\x20%s.%s','table','parentKey','foreignKey','conditions','clone','debug','toString','sequelize','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','AnalyticMetric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','select','countTable','COUNT(*)','QueryTypes','run','IS\x20EMPTY','value','groupBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','stack','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x9c173a,_0x461c9c){var _0x88d611=function(_0x4900c7){while(--_0x4900c7){_0x9c173a['push'](_0x9c173a['shift']());}};_0x88d611(++_0x461c9c);}(_0x5554,0x70));var _0x4555=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x5554[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x4555('0x0'));var rimraf=require(_0x4555('0x1'));var zipdir=require(_0x4555('0x2'));var jsonpatch=require(_0x4555('0x3'));var rp=require(_0x4555('0x4'));var moment=require('moment');var BPromise=require(_0x4555('0x5'));var Mustache=require('mustache');var util=require(_0x4555('0x6'));var path=require(_0x4555('0x7'));var sox=require('sox');var csv=require(_0x4555('0x8'));var ejs=require(_0x4555('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4555('0xa'));var squel=require(_0x4555('0xb'));var crypto=require(_0x4555('0xc'));var jsforce=require(_0x4555('0xd'));var deskjs=require(_0x4555('0xe'));var toCsv=require(_0x4555('0x8'));var querystring=require(_0x4555('0xf'));var Papa=require(_0x4555('0x10'));var Redis=require(_0x4555('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4555('0x12'));var as=require(_0x4555('0x13'));var hardwareService=require(_0x4555('0x14'));var logger=require(_0x4555('0x15'))('api');var utils=require(_0x4555('0x16'));var config=require(_0x4555('0x17'));var licenseUtil=require(_0x4555('0x18'));var db=require(_0x4555('0x19'))['db'];var dbH=require('../../mysqldb')[_0x4555('0x1a')];function respondWithStatusCode(_0x252d8e,_0x3176cd){_0x3176cd=_0x3176cd||0xcc;return function(_0x5b90e1){if(_0x5b90e1){return _0x252d8e['sendStatus'](_0x3176cd);}return _0x252d8e[_0x4555('0x1b')](_0x3176cd)[_0x4555('0x1c')]();};}function respondWithResult(_0x37ca01,_0x2ce7d1){_0x2ce7d1=_0x2ce7d1||0xc8;return function(_0x345b35){if(_0x345b35){return _0x37ca01[_0x4555('0x1b')](_0x2ce7d1)[_0x4555('0x1d')](_0x345b35);}};}function respondWithFilteredResult(_0x105429,_0x3cb791){return function(_0x5618f6){if(_0x5618f6){var _0x370016=typeof _0x3cb791[_0x4555('0x1e')]==='undefined'&&typeof _0x3cb791['limit']===_0x4555('0x1f');var _0x5d618f=_0x5618f6['count'];var _0x3f571c=_0x370016?0x0:_0x3cb791['offset'];var _0x498914=_0x370016?_0x5618f6['count']:_0x3cb791[_0x4555('0x1e')]+_0x3cb791['limit'];var _0x1573ca;if(_0x498914>=_0x5d618f){_0x498914=_0x5d618f;_0x1573ca=0xc8;}else{_0x1573ca=0xce;}_0x105429['status'](_0x1573ca);return _0x105429[_0x4555('0x20')](_0x4555('0x21'),_0x3f571c+'-'+_0x498914+'/'+_0x5d618f)[_0x4555('0x1d')](_0x5618f6);}return null;};}function patchUpdates(_0x3d43ac){return function(_0x2bdd9c){try{jsonpatch[_0x4555('0x22')](_0x2bdd9c,_0x3d43ac,!![]);}catch(_0x4d0ad5){return BPromise[_0x4555('0x23')](_0x4d0ad5);}return _0x2bdd9c[_0x4555('0x24')]();};}function saveUpdates(_0x5bb5c3,_0x5e9b5c){return function(_0xb18ff6){if(_0xb18ff6){return _0xb18ff6[_0x4555('0x25')](_0x5bb5c3)[_0x4555('0x26')](function(_0x5170f9){return _0x5170f9;});}return null;};}function removeEntity(_0x4053d6,_0x276b29){return function(_0x2d7b55){if(_0x2d7b55){return _0x2d7b55[_0x4555('0x27')]()[_0x4555('0x26')](function(){var _0x2eb1bc=_0x2d7b55[_0x4555('0x28')]({'plain':!![]});var _0x1dd476=_0x4555('0x29');return db[_0x4555('0x2a')]['destroy']({'where':{'type':_0x1dd476,'resourceId':_0x2eb1bc['id']}})[_0x4555('0x26')](function(){return _0x2d7b55;});})[_0x4555('0x26')](function(){_0x4053d6[_0x4555('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9627,_0x47a689){return function(_0x28d2ee){if(!_0x28d2ee){_0x3c9627[_0x4555('0x2b')](0x194);}return _0x28d2ee;};}function handleError(_0x337de2,_0x6af5cd){_0x6af5cd=_0x6af5cd||0x1f4;return function(_0x59fcb4){logger['error'](_0x59fcb4[_0x4555('0x2c')]);if(_0x59fcb4['name']){delete _0x59fcb4[_0x4555('0x2d')];}_0x337de2[_0x4555('0x1b')](_0x6af5cd)['send'](_0x59fcb4);};}exports['index']=function(_0x8ba98,_0x17ce60){var _0x56f340={},_0xf9bb24={},_0x560f75={'count':0x0,'rows':[]};var _0x283d1b=_[_0x4555('0x2e')](db[_0x4555('0x2f')][_0x4555('0x30')],function(_0x1b8499){return{'name':_0x1b8499[_0x4555('0x31')],'type':_0x1b8499[_0x4555('0x32')][_0x4555('0x33')]};});_0xf9bb24[_0x4555('0x34')]=_[_0x4555('0x2e')](_0x283d1b,_0x4555('0x2d'));_0xf9bb24[_0x4555('0x35')]=_[_0x4555('0x36')](_0x8ba98[_0x4555('0x35')]);_0xf9bb24[_0x4555('0x37')]=_[_0x4555('0x38')](_0xf9bb24[_0x4555('0x34')],_0xf9bb24['query']);_0x56f340['attributes']=_[_0x4555('0x38')](_0xf9bb24['model'],qs[_0x4555('0x39')](_0x8ba98['query'][_0x4555('0x39')]));_0x56f340[_0x4555('0x3a')]=_0x56f340['attributes']['length']?_0x56f340['attributes']:_0xf9bb24[_0x4555('0x34')];if(!_0x8ba98[_0x4555('0x35')][_0x4555('0x3b')](_0x4555('0x3c'))){_0x56f340['limit']=qs[_0x4555('0x3d')](_0x8ba98[_0x4555('0x35')][_0x4555('0x3d')]);_0x56f340['offset']=qs[_0x4555('0x1e')](_0x8ba98[_0x4555('0x35')][_0x4555('0x1e')]);}_0x56f340['order']=qs[_0x4555('0x3e')](_0x8ba98[_0x4555('0x35')][_0x4555('0x3e')]);_0x56f340[_0x4555('0x3f')]=qs[_0x4555('0x37')](_['pick'](_0x8ba98['query'],_0xf9bb24[_0x4555('0x37')]),_0x283d1b);if(_0x8ba98[_0x4555('0x35')][_0x4555('0x40')]){_0x56f340[_0x4555('0x3f')]=_[_0x4555('0x41')](_0x56f340[_0x4555('0x3f')],{'$or':_[_0x4555('0x2e')](_0x283d1b,function(_0xaaa4df){if(_0xaaa4df[_0x4555('0x32')]!=='VIRTUAL'){var _0x181344={};_0x181344[_0xaaa4df[_0x4555('0x2d')]]={'$like':'%'+_0x8ba98['query'][_0x4555('0x40')]+'%'};return _0x181344;}})});}_0x56f340=_[_0x4555('0x41')]({},_0x56f340,_0x8ba98[_0x4555('0x42')]);var _0x356faa={'where':_0x56f340['where']};return db[_0x4555('0x2f')][_0x4555('0x43')](_0x356faa)[_0x4555('0x26')](function(_0x385b98){_0x560f75[_0x4555('0x43')]=_0x385b98;if(_0x8ba98[_0x4555('0x35')][_0x4555('0x44')]){_0x56f340[_0x4555('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4555('0x46')](_0x56f340);})[_0x4555('0x26')](function(_0x2d3242){_0x560f75[_0x4555('0x47')]=_0x2d3242;return _0x560f75;})[_0x4555('0x26')](respondWithFilteredResult(_0x17ce60,_0x56f340))['catch'](handleError(_0x17ce60,null));};exports[_0x4555('0x48')]=function(_0x517752,_0x54355c){var _0x1d207e={'raw':![],'where':{'id':_0x517752[_0x4555('0x49')]['id']}},_0x4ae09c={};_0x4ae09c['model']=_[_0x4555('0x36')](db['AnalyticCustomReport'][_0x4555('0x30')]);_0x4ae09c['query']=_['keys'](_0x517752[_0x4555('0x35')]);_0x4ae09c[_0x4555('0x37')]=_['intersection'](_0x4ae09c['model'],_0x4ae09c[_0x4555('0x35')]);_0x1d207e[_0x4555('0x3a')]=_['intersection'](_0x4ae09c[_0x4555('0x34')],qs[_0x4555('0x39')](_0x517752[_0x4555('0x35')]['fields']));_0x1d207e[_0x4555('0x3a')]=_0x1d207e[_0x4555('0x3a')][_0x4555('0x4a')]?_0x1d207e[_0x4555('0x3a')]:_0x4ae09c[_0x4555('0x34')];if(_0x517752[_0x4555('0x35')][_0x4555('0x44')]){_0x1d207e[_0x4555('0x45')]=[{'all':!![]}];}_0x1d207e=_['merge']({},_0x1d207e,_0x517752[_0x4555('0x42')]);return db[_0x4555('0x2f')]['find'](_0x1d207e)[_0x4555('0x26')](handleEntityNotFound(_0x54355c,null))['then'](respondWithResult(_0x54355c,null))[_0x4555('0x4b')](handleError(_0x54355c,null));};exports[_0x4555('0x4c')]=function(_0x460ebc,_0x2918ac){return db['AnalyticCustomReport'][_0x4555('0x4c')](_0x460ebc[_0x4555('0x4d')],{})[_0x4555('0x26')](function(_0x3474c0){var _0xa95828=_0x460ebc['user'][_0x4555('0x28')]({'plain':!![]});if(!_0xa95828)throw new Error(_0x4555('0x4e'));if(_0xa95828[_0x4555('0x4f')]==='user'){var _0x146cbb=_0x3474c0[_0x4555('0x28')]({'plain':!![]});var _0x55e135=_0x4555('0x50');return db[_0x4555('0x51')][_0x4555('0x52')]({'where':{'name':_0x55e135,'userProfileId':_0xa95828[_0x4555('0x53')]},'raw':!![]})['then'](function(_0x40c14d){if(_0x40c14d&&_0x40c14d[_0x4555('0x54')]===0x0){return db[_0x4555('0x2a')][_0x4555('0x4c')]({'name':_0x146cbb[_0x4555('0x2d')],'resourceId':_0x146cbb['id'],'type':_0x4555('0x29'),'sectionId':_0x40c14d['id']},{})[_0x4555('0x26')](function(){return _0x3474c0;});}else{return _0x3474c0;}})[_0x4555('0x4b')](function(_0x5afc03){logger[_0x4555('0x55')](_0x4555('0x56'),_0x5afc03);throw _0x5afc03;});}return _0x3474c0;})['then'](respondWithResult(_0x2918ac,0xc9))[_0x4555('0x4b')](handleError(_0x2918ac,null));};exports[_0x4555('0x25')]=function(_0x2be64b,_0x5d908f){if(_0x2be64b[_0x4555('0x4d')]['id']){delete _0x2be64b[_0x4555('0x4d')]['id'];}return db[_0x4555('0x2f')][_0x4555('0x52')]({'where':{'id':_0x2be64b[_0x4555('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d908f,null))[_0x4555('0x26')](saveUpdates(_0x2be64b[_0x4555('0x4d')],null))[_0x4555('0x26')](respondWithResult(_0x5d908f,null))[_0x4555('0x4b')](handleError(_0x5d908f,null));};exports[_0x4555('0x27')]=function(_0x5bd5b6,_0x4666b4){return db[_0x4555('0x2f')]['find']({'where':{'id':_0x5bd5b6[_0x4555('0x49')]['id']}})['then'](handleEntityNotFound(_0x4666b4,null))['then'](removeEntity(_0x4666b4,null))[_0x4555('0x4b')](handleError(_0x4666b4,null));};exports[_0x4555('0x57')]=function(_0x35c17f,_0x11c744){var _0x37fa01=0xa;var _0x30b645=[_0x4555('0x58'),_0x4555('0x59'),'right_join',_0x4555('0x5a')];var _0x51351b={'SUM':_0x4555('0x5b'),'COUNT':_0x4555('0x5c'),'COUNT DISTINCT':_0x4555('0x5d'),'MAX':_0x4555('0x5e'),'MIN':_0x4555('0x5f'),'AVG':_0x4555('0x60'),'GROUP_CONCAT':_0x4555('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4555('0x62')};var _0x3b7050={'SEC_TO_TIME':_0x4555('0x63'),'DATE':_0x4555('0x64'),'HOUR':_0x4555('0x65'),'ROUND':_0x4555('0x66'),'UNIX_TIMESTAMP':_0x4555('0x67')};var _0x33f6ad=function(_0x386013){return!_[_0x4555('0x68')]([_0x4555('0x69'),_0x4555('0x6a'),'IS\x20EMPTY',_0x4555('0x6b')],_0x386013);};var _0x32e65b=function(_0x297268){if(!_0x297268||!_0x297268[_0x4555('0x6c')]['length']){return'';}for(var _0x24eee3='(',_0x28cd1c=0x0;_0x28cd1c<_0x297268['rules']['length'];_0x28cd1c+=0x1){_0x28cd1c>0x0&&(_0x24eee3+='\x20'+_0x297268[_0x4555('0x6d')]+'\x20');_0x24eee3+=_0x297268[_0x4555('0x6c')][_0x28cd1c][_0x4555('0x6e')]?_0x32e65b(_0x297268['rules'][_0x28cd1c]['group']):_0x297268[_0x4555('0x6c')][_0x28cd1c]['field']+'\x20'+_0x297268[_0x4555('0x6c')][_0x28cd1c]['condition']+(_0x33f6ad(_0x297268[_0x4555('0x6c')][_0x28cd1c][_0x4555('0x6f')])?'\x20'+_0x297268[_0x4555('0x6c')][_0x28cd1c]['value']:'');}return _0x24eee3+')';};var _0x5dd139={'where':{'id':_0x35c17f['params']['id']}},_0x104b62,_0x75923f,_0x16e93b,_0x5d6fd6,_0x202367;_0x5dd139=_['merge']({},_0x5dd139,_0x35c17f[_0x4555('0x42')]);return db[_0x4555('0x2f')][_0x4555('0x52')](_0x5dd139)[_0x4555('0x26')](function(_0x5bd729){if(_0x5bd729){_0x104b62=_0x5bd729;return _0x5bd729[_0x4555('0x70')]();}return null;})[_0x4555('0x26')](function(_0x3c1250){if(_0x3c1250){if(!_0x3c1250[_0x4555('0x4a')]){throw new db[(_0x4555('0x71'))][(_0x4555('0x72'))](_0x4555('0x73'),0x193);}_0x75923f=_0x3c1250;return db['AnalyticMetric'][_0x4555('0x46')]({'raw':!![]});}return null;})[_0x4555('0x26')](function(_0x1c7dd6){if(_0x1c7dd6){_0x16e93b=_[_0x4555('0x74')](_0x1c7dd6,'id');var _0x48b277;var _0x2c0ace=squel['select']();_0x2c0ace[_0x4555('0x75')](_0x104b62['table']);for(var _0x5e9635=0x0;_0x5e9635<_0x75923f[_0x4555('0x4a')];_0x5e9635+=0x1){_0x48b277=_0x75923f[_0x5e9635][_0x4555('0x76')]?_0x16e93b[_0x75923f[_0x5e9635][_0x4555('0x76')]][_0x4555('0x77')]:_0x75923f[_0x5e9635][_0x4555('0x78')];_0x48b277=_0x75923f[_0x5e9635][_0x4555('0x79')]?_['replace'](_0x51351b[_0x75923f[_0x5e9635][_0x4555('0x79')]],'%s',_0x48b277):_0x48b277;_0x48b277=_0x75923f[_0x5e9635]['format']?_[_0x4555('0x7a')](_0x3b7050[_0x75923f[_0x5e9635]['format']],'%s',_0x48b277):_0x48b277;if(_0x75923f[_0x5e9635]['groupBy']){_0x2c0ace[_0x4555('0x6e')](_0x48b277);}_0x75923f[_0x5e9635][_0x4555('0x7b')]&&_0x2c0ace[_0x4555('0x7c')](_0x48b277,_0x75923f[_0x5e9635]['orderBy']===_0x4555('0x7d')?![]:!![]);_0x2c0ace[_0x4555('0x78')](_0x48b277,_0x75923f[_0x5e9635][_0x4555('0x7e')]||_0x48b277);}if(_0x104b62[_0x4555('0x7f')]){_0x104b62['joins']=JSON[_0x4555('0x80')](_0x104b62['joins']);for(var _0x2fec54=0x0;_0x2fec54<_0x104b62['joins']['length'];_0x2fec54+=0x1){if(_0x104b62['joins'][_0x2fec54][_0x4555('0x32')]&&_[_0x4555('0x68')](_0x30b645,_0x104b62[_0x4555('0x7f')][_0x2fec54]['type'])&&_0x104b62[_0x4555('0x7f')][_0x2fec54]['parentKey']&&_0x104b62[_0x4555('0x7f')][_0x2fec54][_0x4555('0x81')]&&_0x104b62[_0x4555('0x7f')][_0x2fec54]['foreignKey']){_0x2c0ace[_0x104b62['joins'][_0x2fec54][_0x4555('0x32')]](_0x104b62[_0x4555('0x7f')][_0x2fec54]['foreignTable'],null,util[_0x4555('0x82')](_0x4555('0x83'),_0x104b62[_0x4555('0x84')],_0x104b62[_0x4555('0x7f')][_0x2fec54][_0x4555('0x85')],_0x104b62[_0x4555('0x7f')][_0x2fec54][_0x4555('0x81')],_0x104b62[_0x4555('0x7f')][_0x2fec54][_0x4555('0x86')]));}}}if(_0x104b62[_0x4555('0x87')]){_0x104b62[_0x4555('0x87')]=JSON[_0x4555('0x80')](_0x104b62['conditions']);_0x2c0ace[_0x4555('0x3f')](_0x32e65b(_0x104b62[_0x4555('0x87')][_0x4555('0x6e')]));}_0x202367=_0x2c0ace[_0x4555('0x88')]();_0x2c0ace[_0x4555('0x3d')](_0x37fa01);_0x2c0ace['offset'](0x0);logger[_0x4555('0x89')]('Limited\x20Query:',_0x2c0ace['toString']());return dbH['sequelize'][_0x4555('0x35')](_0x2c0ace[_0x4555('0x8a')](),{'type':dbH[_0x4555('0x8b')]['QueryTypes'][_0x4555('0x8c')]});}})[_0x4555('0x26')](respondWithResult(_0x11c744,null))[_0x4555('0x4b')](handleError(_0x11c744,null));};function runReport(_0x16daab,_0xc3e9bf,_0x1e3a55){var _0x5bd8f1=_0xc3e9bf[_0x4555('0x2d')];var _0x5653ce=0xa;var _0x2b068d=[_0x4555('0x58'),'left_join',_0x4555('0x8d'),'cross_join'];var _0x4772f3={'SUM':_0x4555('0x5b'),'COUNT':_0x4555('0x5c'),'COUNT DISTINCT':_0x4555('0x5d'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4555('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4555('0x8e'),'GROUP_CONCAT DESC':_0x4555('0x62')};var _0x40cef0={'SEC_TO_TIME':_0x4555('0x63'),'DATE':_0x4555('0x64'),'HOUR':_0x4555('0x65'),'ROUND':_0x4555('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x26e695=function(_0x22eba6){return!_['includes']([_0x4555('0x69'),_0x4555('0x6a'),'IS\x20EMPTY',_0x4555('0x6b')],_0x22eba6);};var _0x5607a1=function(_0x1b91f7){if(!_0x1b91f7||!_0x1b91f7[_0x4555('0x6c')][_0x4555('0x4a')]){return'';}for(var _0x1bc5df='(',_0x51af5a=0x0;_0x51af5a<_0x1b91f7[_0x4555('0x6c')][_0x4555('0x4a')];_0x51af5a+=0x1){_0x51af5a>0x0&&(_0x1bc5df+='\x20'+_0x1b91f7[_0x4555('0x6d')]+'\x20');_0x1bc5df+=_0x1b91f7[_0x4555('0x6c')][_0x51af5a][_0x4555('0x6e')]?_0x5607a1(_0x1b91f7[_0x4555('0x6c')][_0x51af5a][_0x4555('0x6e')]):_0x1b91f7[_0x4555('0x6c')][_0x51af5a]['field']+'\x20'+_0x1b91f7[_0x4555('0x6c')][_0x51af5a][_0x4555('0x6f')]+(_0x26e695(_0x1b91f7['rules'][_0x51af5a]['condition'])?'\x20'+_0x1b91f7[_0x4555('0x6c')][_0x51af5a]['value']:'');}return _0x1bc5df+')';};var _0x4503a8={'where':{'id':_0x16daab['id']}},_0x392e41,_0x23d762,_0x1ee0c8,_0x45f782,_0x5228c0;_0x4503a8=_[_0x4555('0x41')]({},_0x4503a8,_0x1e3a55);return db['AnalyticCustomReport'][_0x4555('0x52')](_0x4503a8)['then'](function(_0x4b0c2a){if(_0x4b0c2a){_0x392e41=_0x4b0c2a;return _0x4b0c2a['getFields']();}return null;})['then'](function(_0x35bad8){if(_0x35bad8){if(!_0x35bad8[_0x4555('0x4a')]){throw new db[(_0x4555('0x71'))][(_0x4555('0x72'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x23d762=_0x35bad8;return db[_0x4555('0x8f')][_0x4555('0x46')]({'raw':!![]});}return null;})[_0x4555('0x26')](function(_0x5d1d26){if(_0x5d1d26){_0x1ee0c8=_['keyBy'](_0x5d1d26,'id');var _0x5823db;var _0x2fb914=squel['select']();_0x2fb914[_0x4555('0x75')](_0x392e41[_0x4555('0x84')]);for(var _0x1e7443=0x0;_0x1e7443<_0x23d762[_0x4555('0x4a')];_0x1e7443+=0x1){_0x5823db=_0x23d762[_0x1e7443][_0x4555('0x76')]?_0x1ee0c8[_0x23d762[_0x1e7443][_0x4555('0x76')]][_0x4555('0x77')]:_0x23d762[_0x1e7443]['field'];_0x5823db=_0x23d762[_0x1e7443][_0x4555('0x79')]?_[_0x4555('0x7a')](_0x4772f3[_0x23d762[_0x1e7443][_0x4555('0x79')]],'%s',_0x5823db):_0x5823db;_0x5823db=_0x23d762[_0x1e7443][_0x4555('0x82')]?_[_0x4555('0x7a')](_0x40cef0[_0x23d762[_0x1e7443]['format']],'%s',_0x5823db):_0x5823db;if(_0x23d762[_0x1e7443]['groupBy']){_0x2fb914[_0x4555('0x6e')](_0x5823db);}_0x23d762[_0x1e7443][_0x4555('0x7b')]&&_0x2fb914[_0x4555('0x7c')](_0x5823db,_0x23d762[_0x1e7443]['orderBy']==='DESC'?![]:!![]);_0x2fb914[_0x4555('0x78')](_0x5823db,_0x23d762[_0x1e7443][_0x4555('0x7e')]||_0x5823db);}if(_0x392e41[_0x4555('0x7f')]){_0x392e41[_0x4555('0x7f')]=JSON[_0x4555('0x80')](_0x392e41['joins']);for(var _0x523744=0x0;_0x523744<_0x392e41['joins'][_0x4555('0x4a')];_0x523744+=0x1){if(_0x392e41['joins'][_0x523744][_0x4555('0x32')]&&_[_0x4555('0x68')](_0x2b068d,_0x392e41[_0x4555('0x7f')][_0x523744]['type'])&&_0x392e41[_0x4555('0x7f')][_0x523744]['parentKey']&&_0x392e41['joins'][_0x523744][_0x4555('0x81')]&&_0x392e41[_0x4555('0x7f')][_0x523744][_0x4555('0x86')]){_0x2fb914[_0x392e41[_0x4555('0x7f')][_0x523744][_0x4555('0x32')]](_0x392e41[_0x4555('0x7f')][_0x523744][_0x4555('0x81')],null,util[_0x4555('0x82')](_0x4555('0x83'),_0x392e41[_0x4555('0x84')],_0x392e41[_0x4555('0x7f')][_0x523744]['parentKey'],_0x392e41[_0x4555('0x7f')][_0x523744][_0x4555('0x81')],_0x392e41[_0x4555('0x7f')][_0x523744][_0x4555('0x86')]));}}}if(_0x392e41[_0x4555('0x87')]){_0x392e41[_0x4555('0x87')]=JSON[_0x4555('0x80')](_0x392e41[_0x4555('0x87')]);_0x2fb914['where'](_0x5607a1(_0x392e41[_0x4555('0x87')][_0x4555('0x6e')]));}_0x5228c0=_0x2fb914[_0x4555('0x88')]();_0x2fb914[_0x4555('0x3d')](_0x5653ce);_0x2fb914[_0x4555('0x1e')](0x0);return;}})[_0x4555('0x26')](function(){if(_0xc3e9bf[_0x4555('0x90')]===_0x4555('0x91')){return null;}var _0x279a92=_[_0x4555('0x41')](_0xc3e9bf,{'name':_0xc3e9bf[_0x4555('0x92')]||_0xc3e9bf[_0x4555('0x2d')]||_0x392e41[_0x4555('0x2d')],'basename':_0x5bd8f1,'savename':util[_0x4555('0x82')](_0x4555('0x93'),_0xc3e9bf[_0x4555('0x2d')]||_0x392e41[_0x4555('0x2d')],require(_0x4555('0x94'))[_0x4555('0x95')](0x4),_0xc3e9bf[_0x4555('0x90')]||_0x4555('0x96')),'reportId':_0x392e41['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x4555('0x4c')](_0x279a92,{'raw':!![]});})[_0x4555('0x26')](function(_0x233a11){if(_0x392e41[_0x4555('0x84')]===_0x4555('0x97')){_0x5228c0[_0x4555('0x3f')](_0x392e41[_0x4555('0x84')]+_0x4555('0x98'),_0xc3e9bf[_0x4555('0x99')],_0xc3e9bf[_0x4555('0x9a')]);}else{_0x5228c0[_0x4555('0x3f')](_0x392e41[_0x4555('0x84')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc3e9bf[_0x4555('0x99')],_0xc3e9bf[_0x4555('0x9a')]);}if(_0x233a11){logger[_0x4555('0x9b')](_0x4555('0x9c'),_0x5228c0['toString']());require(_0x4555('0x9d'))[_0x4555('0x9e')](path[_0x4555('0x58')](__dirname,_0x4555('0x9f'),_0x233a11['output']),[_0x233a11['id'],_0x5228c0['toString'](),path[_0x4555('0x58')](__dirname,'../../files/reports',_0x233a11[_0x4555('0xa0')]),_0x5bd8f1]);return _0x233a11;}else{var _0x28caa8=squel[_0x4555('0xa1')]();_0x28caa8[_0x4555('0x75')]('('+_0x5228c0['toString']()+')',_0x4555('0xa2'));_0x28caa8[_0x4555('0x78')](_0x4555('0xa3'),_0x4555('0x43'));_0x5228c0[_0x4555('0x3d')](_0xc3e9bf[_0x4555('0x3d')]||_0x5653ce);_0x5228c0[_0x4555('0x1e')](_0xc3e9bf['offset']||0x0);return dbH[_0x4555('0x8b')][_0x4555('0x35')](_0x28caa8[_0x4555('0x8a')](),{'type':dbH[_0x4555('0x8b')][_0x4555('0xa4')][_0x4555('0x8c')]})[_0x4555('0x26')](function(_0x22946e){if(!_0x22946e[_0x4555('0x4a')]){_0x45f782=0x0;}else{_0x45f782=_0x22946e[0x0][_0x4555('0x43')]||0x0;}return dbH[_0x4555('0x8b')]['query'](_0x5228c0[_0x4555('0x8a')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x4555('0x26')](function(_0x5ec227){return{'rows':_0x5ec227||[],'count':_0x45f782};});}});}exports[_0x4555('0xa5')]=function(_0x2d0b8f,_0x3ddb47){return runReport(_0x2d0b8f[_0x4555('0x49')],_0x2d0b8f[_0x4555('0x35')],_0x2d0b8f[_0x4555('0x42')])[_0x4555('0x26')](respondWithResult(_0x3ddb47,null))['catch'](handleError(_0x3ddb47,null));};exports['runReport']=runReport;exports['query']=function(_0x57674a,_0x52c76f){var _0x5eb19d=0xa;var _0x4b9472=[_0x4555('0x58'),_0x4555('0x59'),_0x4555('0x8d'),_0x4555('0x5a')];var _0x528b55={'SUM':_0x4555('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4555('0x5d'),'MAX':_0x4555('0x5e'),'MIN':_0x4555('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4555('0x8e'),'GROUP_CONCAT DESC':_0x4555('0x62')};var _0x32db47={'SEC_TO_TIME':_0x4555('0x63'),'DATE':_0x4555('0x64'),'HOUR':_0x4555('0x65'),'ROUND':_0x4555('0x66'),'UNIX_TIMESTAMP':_0x4555('0x67')};var _0x585f10=function(_0x3059bc){return!_['includes'](['IS\x20NULL',_0x4555('0x6a'),_0x4555('0xa6'),_0x4555('0x6b')],_0x3059bc);};var _0x38bb7e=function(_0x781db5){if(!_0x781db5||!_0x781db5[_0x4555('0x6c')][_0x4555('0x4a')]){return'';}for(var _0x7fdb6a='(',_0x3b3f90=0x0;_0x3b3f90<_0x781db5[_0x4555('0x6c')][_0x4555('0x4a')];_0x3b3f90+=0x1){_0x3b3f90>0x0&&(_0x7fdb6a+='\x20'+_0x781db5[_0x4555('0x6d')]+'\x20');_0x7fdb6a+=_0x781db5['rules'][_0x3b3f90]['group']?_0x38bb7e(_0x781db5['rules'][_0x3b3f90][_0x4555('0x6e')]):_0x781db5[_0x4555('0x6c')][_0x3b3f90][_0x4555('0x78')]+'\x20'+_0x781db5['rules'][_0x3b3f90][_0x4555('0x6f')]+(_0x585f10(_0x781db5[_0x4555('0x6c')][_0x3b3f90][_0x4555('0x6f')])?'\x20'+_0x781db5['rules'][_0x3b3f90][_0x4555('0xa7')]:'');}return _0x7fdb6a+')';};var _0x154681={'where':{'id':_0x57674a[_0x4555('0x49')]['id']}},_0x5ea282,_0x1a26f7,_0x39b03b,_0x1afbec,_0x33f482;_0x154681=_['merge']({},_0x154681,_0x57674a['options']);return db[_0x4555('0x2f')][_0x4555('0x52')](_0x154681)['then'](function(_0xc0441){if(_0xc0441){_0x5ea282=_0xc0441;return _0xc0441[_0x4555('0x70')]();}return null;})[_0x4555('0x26')](function(_0x57cc43){if(_0x57cc43){if(!_0x57cc43[_0x4555('0x4a')]){throw new db[(_0x4555('0x71'))][(_0x4555('0x72'))](_0x4555('0x73'),0x193);}_0x1a26f7=_0x57cc43;return db[_0x4555('0x8f')]['findAll']({'raw':!![]});}return null;})[_0x4555('0x26')](function(_0x281362){if(_0x281362){_0x39b03b=_['keyBy'](_0x281362,'id');var _0x4d4dc4;var _0x412fe8=squel[_0x4555('0xa1')]();_0x412fe8[_0x4555('0x75')](_0x5ea282[_0x4555('0x84')]);for(var _0x1ff167=0x0;_0x1ff167<_0x1a26f7[_0x4555('0x4a')];_0x1ff167+=0x1){_0x4d4dc4=_0x1a26f7[_0x1ff167][_0x4555('0x76')]?_0x39b03b[_0x1a26f7[_0x1ff167]['MetricId']]['metric']:_0x1a26f7[_0x1ff167]['field'];_0x4d4dc4=_0x1a26f7[_0x1ff167]['function']?_['replace'](_0x528b55[_0x1a26f7[_0x1ff167][_0x4555('0x79')]],'%s',_0x4d4dc4):_0x4d4dc4;_0x4d4dc4=_0x1a26f7[_0x1ff167][_0x4555('0x82')]?_['replace'](_0x32db47[_0x1a26f7[_0x1ff167][_0x4555('0x82')]],'%s',_0x4d4dc4):_0x4d4dc4;if(_0x1a26f7[_0x1ff167][_0x4555('0xa8')]){_0x412fe8[_0x4555('0x6e')](_0x4d4dc4);}_0x1a26f7[_0x1ff167][_0x4555('0x7b')]&&_0x412fe8[_0x4555('0x7c')](_0x4d4dc4,_0x1a26f7[_0x1ff167][_0x4555('0x7b')]==='DESC'?![]:!![]);_0x412fe8[_0x4555('0x78')](_0x4d4dc4,_0x1a26f7[_0x1ff167][_0x4555('0x7e')]||_0x4d4dc4);}if(_0x5ea282[_0x4555('0x7f')]){_0x5ea282['joins']=JSON[_0x4555('0x80')](_0x5ea282[_0x4555('0x7f')]);for(var _0x227959=0x0;_0x227959<_0x5ea282['joins'][_0x4555('0x4a')];_0x227959+=0x1){if(_0x5ea282[_0x4555('0x7f')][_0x227959]['type']&&_[_0x4555('0x68')](_0x4b9472,_0x5ea282[_0x4555('0x7f')][_0x227959]['type'])&&_0x5ea282[_0x4555('0x7f')][_0x227959][_0x4555('0x85')]&&_0x5ea282[_0x4555('0x7f')][_0x227959][_0x4555('0x81')]&&_0x5ea282['joins'][_0x227959]['foreignKey']){_0x412fe8[_0x5ea282['joins'][_0x227959][_0x4555('0x32')]](_0x5ea282[_0x4555('0x7f')][_0x227959][_0x4555('0x81')],null,util[_0x4555('0x82')](_0x4555('0x83'),_0x5ea282['table'],_0x5ea282[_0x4555('0x7f')][_0x227959][_0x4555('0x85')],_0x5ea282['joins'][_0x227959]['foreignTable'],_0x5ea282[_0x4555('0x7f')][_0x227959][_0x4555('0x86')]));}}}if(_0x5ea282[_0x4555('0x87')]){_0x5ea282[_0x4555('0x87')]=JSON[_0x4555('0x80')](_0x5ea282[_0x4555('0x87')]);_0x412fe8[_0x4555('0x3f')](_0x38bb7e(_0x5ea282[_0x4555('0x87')][_0x4555('0x6e')]));}_0x33f482=_0x412fe8[_0x4555('0x88')]();_0x412fe8['limit'](_0x5eb19d);_0x412fe8['offset'](0x0);logger[_0x4555('0x89')]('Limited\x20Query:',_0x412fe8[_0x4555('0x8a')]());return dbH[_0x4555('0x8b')][_0x4555('0x35')](_0x412fe8[_0x4555('0x8a')](),{'type':dbH[_0x4555('0x8b')][_0x4555('0xa4')][_0x4555('0x8c')]});}})['then'](function(){return{'sql':_0x33f482[_0x4555('0x8a')]()};})[_0x4555('0x26')](respondWithResult(_0x52c76f,null))[_0x4555('0x4b')](handleError(_0x52c76f,null));};
\ No newline at end of file
+var _0x07a5=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','end','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','Sequelize','from','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','clone','rimraf','zip-dir','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20959c,_0x3ffd34){var _0x185282=function(_0x1eeba2){while(--_0x1eeba2){_0x20959c['push'](_0x20959c['shift']());}};_0x185282(++_0x3ffd34);}(_0x07a5,0x96));var _0x507a=function(_0x487702,_0x49f5d4){_0x487702=_0x487702-0x0;var _0x5e7150=_0x07a5[_0x487702];return _0x5e7150;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x507a('0x0'));var zipdir=require(_0x507a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x507a('0x2'));var moment=require('moment');var BPromise=require(_0x507a('0x3'));var Mustache=require('mustache');var util=require(_0x507a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x507a('0x5'));var ejs=require(_0x507a('0x6'));var fs=require('fs');var fs_extra=require(_0x507a('0x7'));var _=require(_0x507a('0x8'));var squel=require(_0x507a('0x9'));var crypto=require(_0x507a('0xa'));var jsforce=require(_0x507a('0xb'));var deskjs=require(_0x507a('0xc'));var toCsv=require(_0x507a('0x5'));var querystring=require(_0x507a('0xd'));var Papa=require(_0x507a('0xe'));var Redis=require(_0x507a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x507a('0x10'));var as=require(_0x507a('0x11'));var hardwareService=require(_0x507a('0x12'));var logger=require(_0x507a('0x13'))(_0x507a('0x14'));var utils=require(_0x507a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x507a('0x16'));var db=require(_0x507a('0x17'))['db'];var dbH=require(_0x507a('0x17'))[_0x507a('0x18')];function respondWithStatusCode(_0x48790c,_0x4443e4){_0x4443e4=_0x4443e4||0xcc;return function(_0x1bf154){if(_0x1bf154){return _0x48790c[_0x507a('0x19')](_0x4443e4);}return _0x48790c[_0x507a('0x1a')](_0x4443e4)['end']();};}function respondWithResult(_0x18bae6,_0x13ed36){_0x13ed36=_0x13ed36||0xc8;return function(_0x209ed2){if(_0x209ed2){return _0x18bae6[_0x507a('0x1a')](_0x13ed36)[_0x507a('0x1b')](_0x209ed2);}};}function respondWithFilteredResult(_0x4f5953,_0x5af7cd){return function(_0x2e7585){if(_0x2e7585){var _0x4a2e1f=typeof _0x5af7cd[_0x507a('0x1c')]===_0x507a('0x1d')&&typeof _0x5af7cd[_0x507a('0x1e')]===_0x507a('0x1d');var _0x341963=_0x2e7585[_0x507a('0x1f')];var _0x50c309=_0x4a2e1f?0x0:_0x5af7cd[_0x507a('0x1c')];var _0x33a5cb=_0x4a2e1f?_0x2e7585[_0x507a('0x1f')]:_0x5af7cd[_0x507a('0x1c')]+_0x5af7cd[_0x507a('0x1e')];var _0x2b2c5e;if(_0x33a5cb>=_0x341963){_0x33a5cb=_0x341963;_0x2b2c5e=0xc8;}else{_0x2b2c5e=0xce;}_0x4f5953[_0x507a('0x1a')](_0x2b2c5e);return _0x4f5953[_0x507a('0x20')](_0x507a('0x21'),_0x50c309+'-'+_0x33a5cb+'/'+_0x341963)[_0x507a('0x1b')](_0x2e7585);}return null;};}function patchUpdates(_0x2bf1bf){return function(_0xe1aa5d){try{jsonpatch[_0x507a('0x22')](_0xe1aa5d,_0x2bf1bf,!![]);}catch(_0x3f3551){return BPromise[_0x507a('0x23')](_0x3f3551);}return _0xe1aa5d[_0x507a('0x24')]();};}function saveUpdates(_0x2c8009,_0x12f767){return function(_0x4b3f03){if(_0x4b3f03){return _0x4b3f03[_0x507a('0x25')](_0x2c8009)[_0x507a('0x26')](function(_0x473e62){return _0x473e62;});}return null;};}function removeEntity(_0x48a6bd,_0x45b443){return function(_0x5aaef0){if(_0x5aaef0){return _0x5aaef0[_0x507a('0x27')]()[_0x507a('0x26')](function(){var _0x4bba11=_0x5aaef0[_0x507a('0x28')]({'plain':!![]});var _0x50454f=_0x507a('0x29');return db['UserProfileResource'][_0x507a('0x27')]({'where':{'type':_0x50454f,'resourceId':_0x4bba11['id']}})[_0x507a('0x26')](function(){return _0x5aaef0;});})['then'](function(){_0x48a6bd['status'](0xcc)[_0x507a('0x2a')]();});}};}function handleEntityNotFound(_0x54c9e9,_0x813588){return function(_0x5dad19){if(!_0x5dad19){_0x54c9e9[_0x507a('0x19')](0x194);}return _0x5dad19;};}function handleError(_0x2164eb,_0x34816f){_0x34816f=_0x34816f||0x1f4;return function(_0xecce3){logger['error'](_0xecce3[_0x507a('0x2b')]);if(_0xecce3['name']){delete _0xecce3[_0x507a('0x2c')];}_0x2164eb[_0x507a('0x1a')](_0x34816f)[_0x507a('0x2d')](_0xecce3);};}exports[_0x507a('0x2e')]=function(_0x1cd717,_0x3cd494){var _0x46f75b={},_0x5e78f6={},_0x41c6fa={'count':0x0,'rows':[]};var _0x56b619=_[_0x507a('0x2f')](db[_0x507a('0x30')][_0x507a('0x31')],function(_0xd84480){return{'name':_0xd84480[_0x507a('0x32')],'type':_0xd84480['type'][_0x507a('0x33')]};});_0x5e78f6[_0x507a('0x34')]=_[_0x507a('0x2f')](_0x56b619,_0x507a('0x2c'));_0x5e78f6[_0x507a('0x35')]=_['keys'](_0x1cd717['query']);_0x5e78f6[_0x507a('0x36')]=_[_0x507a('0x37')](_0x5e78f6[_0x507a('0x34')],_0x5e78f6[_0x507a('0x35')]);_0x46f75b[_0x507a('0x38')]=_[_0x507a('0x37')](_0x5e78f6[_0x507a('0x34')],qs[_0x507a('0x39')](_0x1cd717[_0x507a('0x35')][_0x507a('0x39')]));_0x46f75b['attributes']=_0x46f75b[_0x507a('0x38')]['length']?_0x46f75b[_0x507a('0x38')]:_0x5e78f6[_0x507a('0x34')];if(!_0x1cd717[_0x507a('0x35')][_0x507a('0x3a')]('nolimit')){_0x46f75b['limit']=qs['limit'](_0x1cd717[_0x507a('0x35')][_0x507a('0x1e')]);_0x46f75b[_0x507a('0x1c')]=qs[_0x507a('0x1c')](_0x1cd717[_0x507a('0x35')][_0x507a('0x1c')]);}_0x46f75b[_0x507a('0x3b')]=qs[_0x507a('0x3c')](_0x1cd717[_0x507a('0x35')][_0x507a('0x3c')]);_0x46f75b[_0x507a('0x3d')]=qs[_0x507a('0x36')](_[_0x507a('0x3e')](_0x1cd717['query'],_0x5e78f6[_0x507a('0x36')]),_0x56b619);if(_0x1cd717[_0x507a('0x35')][_0x507a('0x3f')]){_0x46f75b['where']=_['merge'](_0x46f75b['where'],{'$or':_['map'](_0x56b619,function(_0x11bb37){if(_0x11bb37[_0x507a('0x40')]!==_0x507a('0x41')){var _0x5d8ba8={};_0x5d8ba8[_0x11bb37[_0x507a('0x2c')]]={'$like':'%'+_0x1cd717[_0x507a('0x35')][_0x507a('0x3f')]+'%'};return _0x5d8ba8;}})});}_0x46f75b=_[_0x507a('0x42')]({},_0x46f75b,_0x1cd717['options']);var _0x12a925={'where':_0x46f75b[_0x507a('0x3d')]};return db['AnalyticCustomReport'][_0x507a('0x1f')](_0x12a925)[_0x507a('0x26')](function(_0x214614){_0x41c6fa[_0x507a('0x1f')]=_0x214614;if(_0x1cd717[_0x507a('0x35')][_0x507a('0x43')]){_0x46f75b[_0x507a('0x44')]=[{'all':!![]}];}return db[_0x507a('0x30')][_0x507a('0x45')](_0x46f75b);})[_0x507a('0x26')](function(_0x59978d){_0x41c6fa[_0x507a('0x46')]=_0x59978d;return _0x41c6fa;})[_0x507a('0x26')](respondWithFilteredResult(_0x3cd494,_0x46f75b))[_0x507a('0x47')](handleError(_0x3cd494,null));};exports[_0x507a('0x48')]=function(_0x2e040e,_0x91d3f0){var _0x23f62c={'raw':![],'where':{'id':_0x2e040e[_0x507a('0x49')]['id']}},_0x5e1c68={};_0x5e1c68[_0x507a('0x34')]=_[_0x507a('0x4a')](db['AnalyticCustomReport'][_0x507a('0x31')]);_0x5e1c68[_0x507a('0x35')]=_[_0x507a('0x4a')](_0x2e040e[_0x507a('0x35')]);_0x5e1c68[_0x507a('0x36')]=_['intersection'](_0x5e1c68[_0x507a('0x34')],_0x5e1c68[_0x507a('0x35')]);_0x23f62c[_0x507a('0x38')]=_[_0x507a('0x37')](_0x5e1c68['model'],qs[_0x507a('0x39')](_0x2e040e[_0x507a('0x35')][_0x507a('0x39')]));_0x23f62c[_0x507a('0x38')]=_0x23f62c['attributes'][_0x507a('0x4b')]?_0x23f62c['attributes']:_0x5e1c68[_0x507a('0x34')];if(_0x2e040e['query'][_0x507a('0x43')]){_0x23f62c[_0x507a('0x44')]=[{'all':!![]}];}_0x23f62c=_[_0x507a('0x42')]({},_0x23f62c,_0x2e040e[_0x507a('0x4c')]);return db[_0x507a('0x30')][_0x507a('0x4d')](_0x23f62c)[_0x507a('0x26')](handleEntityNotFound(_0x91d3f0,null))[_0x507a('0x26')](respondWithResult(_0x91d3f0,null))[_0x507a('0x47')](handleError(_0x91d3f0,null));};exports[_0x507a('0x4e')]=function(_0x9b1e79,_0x24b634){return db[_0x507a('0x30')][_0x507a('0x4e')](_0x9b1e79[_0x507a('0x4f')],{})[_0x507a('0x26')](function(_0x36e19a){var _0x5c6f79=_0x9b1e79[_0x507a('0x50')][_0x507a('0x28')]({'plain':!![]});if(!_0x5c6f79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c6f79[_0x507a('0x51')]===_0x507a('0x50')){var _0x7ea683=_0x36e19a['get']({'plain':!![]});var _0x4250cd='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x4250cd,'userProfileId':_0x5c6f79[_0x507a('0x52')]},'raw':!![]})['then'](function(_0x183fa6){if(_0x183fa6&&_0x183fa6[_0x507a('0x53')]===0x0){return db['UserProfileResource'][_0x507a('0x4e')]({'name':_0x7ea683[_0x507a('0x2c')],'resourceId':_0x7ea683['id'],'type':_0x507a('0x29'),'sectionId':_0x183fa6['id']},{})[_0x507a('0x26')](function(){return _0x36e19a;});}else{return _0x36e19a;}})[_0x507a('0x47')](function(_0x4efb16){logger[_0x507a('0x54')](_0x507a('0x55'),_0x4efb16);throw _0x4efb16;});}return _0x36e19a;})[_0x507a('0x26')](respondWithResult(_0x24b634,0xc9))[_0x507a('0x47')](handleError(_0x24b634,null));};exports['update']=function(_0x339b14,_0xb1fc31){if(_0x339b14[_0x507a('0x4f')]['id']){delete _0x339b14['body']['id'];}return db[_0x507a('0x30')][_0x507a('0x4d')]({'where':{'id':_0x339b14['params']['id']}})[_0x507a('0x26')](handleEntityNotFound(_0xb1fc31,null))[_0x507a('0x26')](saveUpdates(_0x339b14[_0x507a('0x4f')],null))[_0x507a('0x26')](respondWithResult(_0xb1fc31,null))[_0x507a('0x47')](handleError(_0xb1fc31,null));};exports[_0x507a('0x27')]=function(_0x305024,_0x31b89b){return db[_0x507a('0x30')][_0x507a('0x4d')]({'where':{'id':_0x305024[_0x507a('0x49')]['id']}})[_0x507a('0x26')](handleEntityNotFound(_0x31b89b,null))[_0x507a('0x26')](removeEntity(_0x31b89b,null))[_0x507a('0x47')](handleError(_0x31b89b,null));};exports[_0x507a('0x56')]=function(_0x47d2ea,_0x39e4ca){var _0x797d49=0xa;var _0x16f569=[_0x507a('0x57'),_0x507a('0x58'),_0x507a('0x59'),_0x507a('0x5a')];var _0xbc4cf7={'SUM':_0x507a('0x5b'),'COUNT':_0x507a('0x5c'),'COUNT DISTINCT':_0x507a('0x5d'),'MAX':_0x507a('0x5e'),'MIN':_0x507a('0x5f'),'AVG':_0x507a('0x60'),'GROUP_CONCAT':_0x507a('0x61'),'GROUP_CONCAT ASC':_0x507a('0x62'),'GROUP_CONCAT DESC':_0x507a('0x63')};var _0x4891e1={'SEC_TO_TIME':_0x507a('0x64'),'DATE':_0x507a('0x65'),'HOUR':_0x507a('0x66'),'ROUND':_0x507a('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4451ce=function(_0x5f6263){return!_['includes']([_0x507a('0x68'),_0x507a('0x69'),'IS\x20EMPTY',_0x507a('0x6a')],_0x5f6263);};var _0x3a90cd=function(_0x224dc2){if(!_0x224dc2||!_0x224dc2[_0x507a('0x6b')][_0x507a('0x4b')]){return'';}for(var _0x2fa856='(',_0x5ad1ac=0x0;_0x5ad1ac<_0x224dc2[_0x507a('0x6b')]['length'];_0x5ad1ac+=0x1){_0x5ad1ac>0x0&&(_0x2fa856+='\x20'+_0x224dc2[_0x507a('0x6c')]+'\x20');_0x2fa856+=_0x224dc2[_0x507a('0x6b')][_0x5ad1ac][_0x507a('0x6d')]?_0x3a90cd(_0x224dc2[_0x507a('0x6b')][_0x5ad1ac][_0x507a('0x6d')]):_0x224dc2[_0x507a('0x6b')][_0x5ad1ac][_0x507a('0x6e')]+'\x20'+_0x224dc2[_0x507a('0x6b')][_0x5ad1ac][_0x507a('0x6f')]+(_0x4451ce(_0x224dc2[_0x507a('0x6b')][_0x5ad1ac][_0x507a('0x6f')])?'\x20'+_0x224dc2['rules'][_0x5ad1ac][_0x507a('0x70')]:'');}return _0x2fa856+')';};var _0x3ef231={'where':{'id':_0x47d2ea[_0x507a('0x49')]['id']}},_0x5eb65e,_0x103968,_0x35a67a,_0x1aac9f,_0x1ceeef;_0x3ef231=_[_0x507a('0x42')]({},_0x3ef231,_0x47d2ea[_0x507a('0x4c')]);return db[_0x507a('0x30')][_0x507a('0x4d')](_0x3ef231)[_0x507a('0x26')](function(_0x4be962){if(_0x4be962){_0x5eb65e=_0x4be962;return _0x4be962['getFields']();}return null;})['then'](function(_0x263e38){if(_0x263e38){if(!_0x263e38['length']){throw new db['Sequelize'][(_0x507a('0x71'))](_0x507a('0x72'),0x193);}_0x103968=_0x263e38;return db[_0x507a('0x73')][_0x507a('0x45')]({'raw':!![]});}return null;})[_0x507a('0x26')](function(_0x3a4302){if(_0x3a4302){_0x35a67a=_[_0x507a('0x74')](_0x3a4302,'id');var _0x3f79e4;var _0x4dd5ba=squel[_0x507a('0x75')]();_0x4dd5ba['from'](_0x5eb65e[_0x507a('0x76')]);for(var _0x5a9208=0x0;_0x5a9208<_0x103968['length'];_0x5a9208+=0x1){_0x3f79e4=_0x103968[_0x5a9208][_0x507a('0x77')]?_0x35a67a[_0x103968[_0x5a9208][_0x507a('0x77')]][_0x507a('0x78')]:_0x103968[_0x5a9208][_0x507a('0x6e')];_0x3f79e4=_0x103968[_0x5a9208]['function']?_[_0x507a('0x79')](_0xbc4cf7[_0x103968[_0x5a9208][_0x507a('0x7a')]],'%s',_0x3f79e4):_0x3f79e4;_0x3f79e4=_0x103968[_0x5a9208]['format']?_[_0x507a('0x79')](_0x4891e1[_0x103968[_0x5a9208][_0x507a('0x7b')]],'%s',_0x3f79e4):_0x3f79e4;if(_0x103968[_0x5a9208][_0x507a('0x7c')]){_0x4dd5ba[_0x507a('0x6d')](_0x3f79e4);}_0x103968[_0x5a9208][_0x507a('0x7d')]&&_0x4dd5ba[_0x507a('0x3b')](_0x3f79e4,_0x103968[_0x5a9208][_0x507a('0x7d')]===_0x507a('0x7e')?![]:!![]);_0x4dd5ba[_0x507a('0x6e')](_0x3f79e4,_0x103968[_0x5a9208][_0x507a('0x7f')]||_0x3f79e4);}if(_0x5eb65e['joins']){_0x5eb65e[_0x507a('0x80')]=JSON[_0x507a('0x81')](_0x5eb65e['joins']);for(var _0x30a01e=0x0;_0x30a01e<_0x5eb65e[_0x507a('0x80')][_0x507a('0x4b')];_0x30a01e+=0x1){if(_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x40')]&&_[_0x507a('0x82')](_0x16f569,_0x5eb65e['joins'][_0x30a01e][_0x507a('0x40')])&&_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x83')]&&_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x84')]&&_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x85')]){_0x4dd5ba[_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x40')]](_0x5eb65e['joins'][_0x30a01e][_0x507a('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5eb65e[_0x507a('0x76')],_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x83')],_0x5eb65e[_0x507a('0x80')][_0x30a01e][_0x507a('0x84')],_0x5eb65e['joins'][_0x30a01e]['foreignKey']));}}}if(_0x5eb65e['conditions']){_0x5eb65e['conditions']=JSON[_0x507a('0x81')](_0x5eb65e[_0x507a('0x86')]);_0x4dd5ba['where'](_0x3a90cd(_0x5eb65e['conditions'][_0x507a('0x6d')]));}_0x1ceeef=_0x4dd5ba['clone']();_0x4dd5ba[_0x507a('0x1e')](_0x797d49);_0x4dd5ba['offset'](0x0);logger[_0x507a('0x87')](_0x507a('0x88'),_0x4dd5ba['toString']());return dbH[_0x507a('0x89')][_0x507a('0x35')](_0x4dd5ba[_0x507a('0x8a')](),{'type':dbH['sequelize'][_0x507a('0x8b')][_0x507a('0x8c')]});}})[_0x507a('0x26')](respondWithResult(_0x39e4ca,null))[_0x507a('0x47')](handleError(_0x39e4ca,null));};function runReport(_0x1eec9e,_0x17a854,_0x3faf3c){var _0x338bc1=_0x17a854[_0x507a('0x2c')];var _0x3b1b68=0xa;var _0x1981f6=[_0x507a('0x57'),_0x507a('0x58'),_0x507a('0x59'),_0x507a('0x5a')];var _0x4889d6={'SUM':_0x507a('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x507a('0x5d'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x507a('0x60'),'GROUP_CONCAT':_0x507a('0x61'),'GROUP_CONCAT ASC':_0x507a('0x62'),'GROUP_CONCAT DESC':_0x507a('0x63')};var _0x210960={'SEC_TO_TIME':_0x507a('0x64'),'DATE':_0x507a('0x65'),'HOUR':_0x507a('0x66'),'ROUND':_0x507a('0x67'),'UNIX_TIMESTAMP':_0x507a('0x8d')};var _0x3777c5=function(_0x13842a){return!_[_0x507a('0x82')]([_0x507a('0x68'),_0x507a('0x69'),_0x507a('0x8e'),'IS\x20NOT\x20EMPTY'],_0x13842a);};var _0x197c6f=function(_0x53d01e){if(!_0x53d01e||!_0x53d01e[_0x507a('0x6b')][_0x507a('0x4b')]){return'';}for(var _0x2afdf9='(',_0x442f60=0x0;_0x442f60<_0x53d01e[_0x507a('0x6b')][_0x507a('0x4b')];_0x442f60+=0x1){_0x442f60>0x0&&(_0x2afdf9+='\x20'+_0x53d01e[_0x507a('0x6c')]+'\x20');_0x2afdf9+=_0x53d01e['rules'][_0x442f60]['group']?_0x197c6f(_0x53d01e['rules'][_0x442f60][_0x507a('0x6d')]):_0x53d01e[_0x507a('0x6b')][_0x442f60]['field']+'\x20'+_0x53d01e[_0x507a('0x6b')][_0x442f60][_0x507a('0x6f')]+(_0x3777c5(_0x53d01e[_0x507a('0x6b')][_0x442f60]['condition'])?'\x20'+_0x53d01e[_0x507a('0x6b')][_0x442f60][_0x507a('0x70')]:'');}return _0x2afdf9+')';};var _0x6f8d8={'where':{'id':_0x1eec9e['id']}},_0x12f6b6,_0x4cd6cd,_0x13f22d,_0x2c5df8,_0x4f0818;_0x6f8d8=_[_0x507a('0x42')]({},_0x6f8d8,_0x3faf3c);return db[_0x507a('0x30')][_0x507a('0x4d')](_0x6f8d8)['then'](function(_0x2b49b0){if(_0x2b49b0){_0x12f6b6=_0x2b49b0;return _0x2b49b0[_0x507a('0x8f')]();}return null;})[_0x507a('0x26')](function(_0x4411c5){if(_0x4411c5){if(!_0x4411c5[_0x507a('0x4b')]){throw new db[(_0x507a('0x90'))][(_0x507a('0x71'))](_0x507a('0x72'),0x193);}_0x4cd6cd=_0x4411c5;return db[_0x507a('0x73')][_0x507a('0x45')]({'raw':!![]});}return null;})[_0x507a('0x26')](function(_0x5977f3){if(_0x5977f3){_0x13f22d=_[_0x507a('0x74')](_0x5977f3,'id');var _0x3089c3;var _0x2cb915=squel[_0x507a('0x75')]();_0x2cb915[_0x507a('0x91')](_0x12f6b6[_0x507a('0x76')]);for(var _0x40265e=0x0;_0x40265e<_0x4cd6cd[_0x507a('0x4b')];_0x40265e+=0x1){_0x3089c3=_0x4cd6cd[_0x40265e][_0x507a('0x77')]?_0x13f22d[_0x4cd6cd[_0x40265e][_0x507a('0x77')]][_0x507a('0x78')]:_0x4cd6cd[_0x40265e][_0x507a('0x6e')];_0x3089c3=_0x4cd6cd[_0x40265e]['function']?_['replace'](_0x4889d6[_0x4cd6cd[_0x40265e]['function']],'%s',_0x3089c3):_0x3089c3;_0x3089c3=_0x4cd6cd[_0x40265e][_0x507a('0x7b')]?_['replace'](_0x210960[_0x4cd6cd[_0x40265e][_0x507a('0x7b')]],'%s',_0x3089c3):_0x3089c3;if(_0x4cd6cd[_0x40265e][_0x507a('0x7c')]){_0x2cb915['group'](_0x3089c3);}_0x4cd6cd[_0x40265e][_0x507a('0x7d')]&&_0x2cb915[_0x507a('0x3b')](_0x3089c3,_0x4cd6cd[_0x40265e]['orderBy']===_0x507a('0x7e')?![]:!![]);_0x2cb915[_0x507a('0x6e')](_0x3089c3,_0x4cd6cd[_0x40265e][_0x507a('0x7f')]||_0x3089c3);}if(_0x12f6b6[_0x507a('0x80')]){_0x12f6b6['joins']=JSON[_0x507a('0x81')](_0x12f6b6['joins']);for(var _0x3f805f=0x0;_0x3f805f<_0x12f6b6['joins'][_0x507a('0x4b')];_0x3f805f+=0x1){if(_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x40')]&&_[_0x507a('0x82')](_0x1981f6,_0x12f6b6['joins'][_0x3f805f][_0x507a('0x40')])&&_0x12f6b6[_0x507a('0x80')][_0x3f805f]['parentKey']&&_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x84')]&&_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x85')]){_0x2cb915[_0x12f6b6[_0x507a('0x80')][_0x3f805f]['type']](_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x84')],null,util['format'](_0x507a('0x92'),_0x12f6b6[_0x507a('0x76')],_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x83')],_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x84')],_0x12f6b6[_0x507a('0x80')][_0x3f805f][_0x507a('0x85')]));}}}if(_0x12f6b6[_0x507a('0x86')]){_0x12f6b6[_0x507a('0x86')]=JSON[_0x507a('0x81')](_0x12f6b6[_0x507a('0x86')]);_0x2cb915[_0x507a('0x3d')](_0x197c6f(_0x12f6b6[_0x507a('0x86')][_0x507a('0x6d')]));}_0x4f0818=_0x2cb915['clone']();_0x2cb915[_0x507a('0x1e')](_0x3b1b68);_0x2cb915['offset'](0x0);return;}})['then'](function(){if(_0x17a854[_0x507a('0x93')]===_0x507a('0x94')){return null;}var _0x574777=_[_0x507a('0x42')](_0x17a854,{'name':_0x17a854[_0x507a('0x95')]||_0x17a854['name']||_0x12f6b6[_0x507a('0x2c')],'basename':_0x338bc1,'savename':util[_0x507a('0x7b')](_0x507a('0x96'),_0x17a854[_0x507a('0x2c')]||_0x12f6b6[_0x507a('0x2c')],require(_0x507a('0x97'))[_0x507a('0x98')](0x4),_0x17a854[_0x507a('0x93')]||_0x507a('0x99')),'reportId':_0x12f6b6['id'],'reportType':'custom'});return db[_0x507a('0x9a')]['create'](_0x574777,{'raw':!![]});})[_0x507a('0x26')](function(_0x5ec887){if(_0x12f6b6[_0x507a('0x76')]===_0x507a('0x9b')){_0x4f0818[_0x507a('0x3d')](_0x12f6b6['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17a854[_0x507a('0x9c')],_0x17a854[_0x507a('0x9d')]);}else{_0x4f0818[_0x507a('0x3d')](_0x12f6b6[_0x507a('0x76')]+_0x507a('0x9e'),_0x17a854[_0x507a('0x9c')],_0x17a854['endDate']);}if(_0x5ec887){logger[_0x507a('0x9f')](_0x507a('0xa0'),_0x4f0818['toString']());require(_0x507a('0xa1'))[_0x507a('0xa2')](path[_0x507a('0x57')](__dirname,_0x507a('0xa3'),_0x5ec887['output']),[_0x5ec887['id'],_0x4f0818[_0x507a('0x8a')](),path['join'](__dirname,_0x507a('0xa4'),_0x5ec887[_0x507a('0xa5')]),_0x338bc1]);return _0x5ec887;}else{var _0x5940cf=squel['select']();_0x5940cf[_0x507a('0x91')]('('+_0x4f0818['toString']()+')',_0x507a('0xa6'));_0x5940cf[_0x507a('0x6e')]('COUNT(*)',_0x507a('0x1f'));_0x4f0818[_0x507a('0x1e')](_0x17a854['limit']||_0x3b1b68);_0x4f0818[_0x507a('0x1c')](_0x17a854['offset']||0x0);return dbH[_0x507a('0x89')][_0x507a('0x35')](_0x5940cf[_0x507a('0x8a')](),{'type':dbH[_0x507a('0x89')]['QueryTypes'][_0x507a('0x8c')]})['then'](function(_0x466eca){if(!_0x466eca[_0x507a('0x4b')]){_0x2c5df8=0x0;}else{_0x2c5df8=_0x466eca[0x0]['count']||0x0;}return dbH['sequelize'][_0x507a('0x35')](_0x4f0818[_0x507a('0x8a')](),{'type':dbH[_0x507a('0x89')][_0x507a('0x8b')][_0x507a('0x8c')]});})[_0x507a('0x26')](function(_0x5ecc21){return{'rows':_0x5ecc21||[],'count':_0x2c5df8};});}});}exports['run']=function(_0x157a15,_0x1c5a3e){return runReport(_0x157a15[_0x507a('0x49')],_0x157a15[_0x507a('0x35')],_0x157a15[_0x507a('0x4c')])[_0x507a('0x26')](respondWithResult(_0x1c5a3e,null))[_0x507a('0x47')](handleError(_0x1c5a3e,null));};exports['runReport']=runReport;exports[_0x507a('0x35')]=function(_0x543ed9,_0x41e14b){var _0x5617e2=0xa;var _0xdf2647=[_0x507a('0x57'),_0x507a('0x58'),_0x507a('0x59'),_0x507a('0x5a')];var _0x32f1cc={'SUM':'SUM(%s)','COUNT':_0x507a('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x507a('0x60'),'GROUP_CONCAT':_0x507a('0x61'),'GROUP_CONCAT ASC':_0x507a('0x62'),'GROUP_CONCAT DESC':_0x507a('0x63')};var _0x2bb6e3={'SEC_TO_TIME':_0x507a('0x64'),'DATE':'DATE(%s)','HOUR':_0x507a('0x66'),'ROUND':_0x507a('0x67'),'UNIX_TIMESTAMP':_0x507a('0x8d')};var _0x4212ce=function(_0x2f1927){return!_[_0x507a('0x82')]([_0x507a('0x68'),_0x507a('0x69'),_0x507a('0x8e'),_0x507a('0x6a')],_0x2f1927);};var _0x481931=function(_0x218bb3){if(!_0x218bb3||!_0x218bb3[_0x507a('0x6b')][_0x507a('0x4b')]){return'';}for(var _0x49670e='(',_0x3b74a5=0x0;_0x3b74a5<_0x218bb3[_0x507a('0x6b')][_0x507a('0x4b')];_0x3b74a5+=0x1){_0x3b74a5>0x0&&(_0x49670e+='\x20'+_0x218bb3['operator']+'\x20');_0x49670e+=_0x218bb3[_0x507a('0x6b')][_0x3b74a5][_0x507a('0x6d')]?_0x481931(_0x218bb3[_0x507a('0x6b')][_0x3b74a5]['group']):_0x218bb3['rules'][_0x3b74a5][_0x507a('0x6e')]+'\x20'+_0x218bb3[_0x507a('0x6b')][_0x3b74a5][_0x507a('0x6f')]+(_0x4212ce(_0x218bb3[_0x507a('0x6b')][_0x3b74a5][_0x507a('0x6f')])?'\x20'+_0x218bb3[_0x507a('0x6b')][_0x3b74a5]['value']:'');}return _0x49670e+')';};var _0x1240d1={'where':{'id':_0x543ed9[_0x507a('0x49')]['id']}},_0x24b67a,_0x5156fb,_0x7c01e5,_0x3a73de,_0x30a6be;_0x1240d1=_[_0x507a('0x42')]({},_0x1240d1,_0x543ed9[_0x507a('0x4c')]);return db[_0x507a('0x30')][_0x507a('0x4d')](_0x1240d1)[_0x507a('0x26')](function(_0x2f2a9b){if(_0x2f2a9b){_0x24b67a=_0x2f2a9b;return _0x2f2a9b['getFields']();}return null;})[_0x507a('0x26')](function(_0x596c8b){if(_0x596c8b){if(!_0x596c8b[_0x507a('0x4b')]){throw new db[(_0x507a('0x90'))][(_0x507a('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5156fb=_0x596c8b;return db[_0x507a('0x73')]['findAll']({'raw':!![]});}return null;})[_0x507a('0x26')](function(_0x535bf0){if(_0x535bf0){_0x7c01e5=_[_0x507a('0x74')](_0x535bf0,'id');var _0xb93418;var _0x4b4cbd=squel['select']();_0x4b4cbd['from'](_0x24b67a[_0x507a('0x76')]);for(var _0x82e72=0x0;_0x82e72<_0x5156fb[_0x507a('0x4b')];_0x82e72+=0x1){_0xb93418=_0x5156fb[_0x82e72][_0x507a('0x77')]?_0x7c01e5[_0x5156fb[_0x82e72][_0x507a('0x77')]]['metric']:_0x5156fb[_0x82e72][_0x507a('0x6e')];_0xb93418=_0x5156fb[_0x82e72][_0x507a('0x7a')]?_[_0x507a('0x79')](_0x32f1cc[_0x5156fb[_0x82e72][_0x507a('0x7a')]],'%s',_0xb93418):_0xb93418;_0xb93418=_0x5156fb[_0x82e72][_0x507a('0x7b')]?_['replace'](_0x2bb6e3[_0x5156fb[_0x82e72][_0x507a('0x7b')]],'%s',_0xb93418):_0xb93418;if(_0x5156fb[_0x82e72][_0x507a('0x7c')]){_0x4b4cbd[_0x507a('0x6d')](_0xb93418);}_0x5156fb[_0x82e72][_0x507a('0x7d')]&&_0x4b4cbd[_0x507a('0x3b')](_0xb93418,_0x5156fb[_0x82e72][_0x507a('0x7d')]===_0x507a('0x7e')?![]:!![]);_0x4b4cbd[_0x507a('0x6e')](_0xb93418,_0x5156fb[_0x82e72][_0x507a('0x7f')]||_0xb93418);}if(_0x24b67a[_0x507a('0x80')]){_0x24b67a[_0x507a('0x80')]=JSON['parse'](_0x24b67a['joins']);for(var _0x42e59e=0x0;_0x42e59e<_0x24b67a['joins'][_0x507a('0x4b')];_0x42e59e+=0x1){if(_0x24b67a[_0x507a('0x80')][_0x42e59e][_0x507a('0x40')]&&_[_0x507a('0x82')](_0xdf2647,_0x24b67a[_0x507a('0x80')][_0x42e59e][_0x507a('0x40')])&&_0x24b67a[_0x507a('0x80')][_0x42e59e][_0x507a('0x83')]&&_0x24b67a[_0x507a('0x80')][_0x42e59e]['foreignTable']&&_0x24b67a['joins'][_0x42e59e]['foreignKey']){_0x4b4cbd[_0x24b67a['joins'][_0x42e59e][_0x507a('0x40')]](_0x24b67a['joins'][_0x42e59e]['foreignTable'],null,util[_0x507a('0x7b')](_0x507a('0x92'),_0x24b67a[_0x507a('0x76')],_0x24b67a['joins'][_0x42e59e][_0x507a('0x83')],_0x24b67a['joins'][_0x42e59e][_0x507a('0x84')],_0x24b67a[_0x507a('0x80')][_0x42e59e][_0x507a('0x85')]));}}}if(_0x24b67a[_0x507a('0x86')]){_0x24b67a[_0x507a('0x86')]=JSON[_0x507a('0x81')](_0x24b67a['conditions']);_0x4b4cbd[_0x507a('0x3d')](_0x481931(_0x24b67a['conditions']['group']));}_0x30a6be=_0x4b4cbd[_0x507a('0xa7')]();_0x4b4cbd[_0x507a('0x1e')](_0x5617e2);_0x4b4cbd[_0x507a('0x1c')](0x0);logger[_0x507a('0x87')](_0x507a('0x88'),_0x4b4cbd['toString']());return dbH[_0x507a('0x89')]['query'](_0x4b4cbd['toString'](),{'type':dbH[_0x507a('0x89')][_0x507a('0x8b')][_0x507a('0x8c')]});}})[_0x507a('0x26')](function(){return{'sql':_0x30a6be[_0x507a('0x8a')]()};})['then'](respondWithResult(_0x41e14b,null))[_0x507a('0x47')](handleError(_0x41e14b,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 8af8f00..82d7a29 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 _0x798d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','util'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x798d,0xdb));var _0xd798=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x798d[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xd798('0x0'));var logger=require('../../config/logger')(_0xd798('0x1'));var moment=require(_0xd798('0x2'));var BPromise=require(_0xd798('0x3'));var rp=require(_0xd798('0x4'));var fs=require('fs');var path=require(_0xd798('0x5'));var rimraf=require(_0xd798('0x6'));var config=require(_0xd798('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xd798('0x8')]=function(_0x59329b,_0x91ceee){return _0x59329b[_0xd798('0x9')](_0xd798('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ce2=['exports','define','AnalyticCustomReport','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./analyticCustomReport.attributes'];(function(_0x269732,_0x1b3473){var _0x23e9b4=function(_0x142f10){while(--_0x142f10){_0x269732['push'](_0x269732['shift']());}};_0x23e9b4(++_0x1b3473);}(_0x2ce2,0x1e3));var _0x22ce=function(_0x14d9b7,_0x41650d){_0x14d9b7=_0x14d9b7-0x0;var _0x254b92=_0x2ce2[_0x14d9b7];return _0x254b92;};'use strict';var _=require(_0x22ce('0x0'));var util=require(_0x22ce('0x1'));var logger=require(_0x22ce('0x2'))('api');var moment=require('moment');var BPromise=require(_0x22ce('0x3'));var rp=require(_0x22ce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22ce('0x5'));var config=require('../../config/environment');var attributes=require(_0x22ce('0x6'));module[_0x22ce('0x7')]=function(_0x2c9235,_0x4e8c20){return _0x2c9235[_0x22ce('0x8')](_0x22ce('0x9'),attributes,{'tableName':'analytics_custom_reports','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 9c38abb..de24a5a 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 _0x532c=['../../config/environment','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3e0d88,_0x3c850f){var _0x47cdc0=function(_0x40fb30){while(--_0x40fb30){_0x3e0d88['push'](_0x3e0d88['shift']());}};_0x47cdc0(++_0x3c850f);}(_0x532c,0x109));var _0xc532=function(_0x273f1b,_0x22b88f){_0x273f1b=_0x273f1b-0x0;var _0x38aab0=_0x532c[_0x273f1b];return _0x38aab0;};'use strict';var _=require(_0xc532('0x0'));var util=require(_0xc532('0x1'));var moment=require(_0xc532('0x2'));var BPromise=require(_0xc532('0x3'));var rs=require(_0xc532('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc532('0x5'))['db'];var utils=require(_0xc532('0x6'));var logger=require(_0xc532('0x7'))('rpc');var config=require(_0xc532('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc532('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x341f90,_0x261770,_0x55a08f){return new BPromise(function(_0x82476d,_0x11eca8){return client[_0xc532('0xa')](_0x341f90,_0x55a08f)['then'](function(_0x230966){logger[_0xc532('0xb')](_0xc532('0xc'),_0x261770,_0xc532('0xd'));logger['debug'](_0xc532('0xe'),_0x261770,_0xc532('0xd'),JSON[_0xc532('0xf')](_0x230966));if(_0x230966[_0xc532('0x10')]){if(_0x230966[_0xc532('0x10')][_0xc532('0x11')]===0x1f4){logger[_0xc532('0x10')](_0xc532('0xc'),_0x261770,_0x230966[_0xc532('0x10')][_0xc532('0x12')]);return _0x11eca8(_0x230966['error'][_0xc532('0x12')]);}logger[_0xc532('0x10')](_0xc532('0xc'),_0x261770,_0x230966[_0xc532('0x10')]['message']);return _0x82476d(_0x230966[_0xc532('0x10')]['message']);}else{logger[_0xc532('0xb')](_0xc532('0xc'),_0x261770,_0xc532('0xd'));_0x82476d(_0x230966[_0xc532('0x13')][_0xc532('0x12')]);}})[_0xc532('0x14')](function(_0x98f7b1){logger[_0xc532('0x10')](_0xc532('0xc'),_0x261770,_0x98f7b1);_0x11eca8(_0x98f7b1);});});}
\ No newline at end of file
+var _0x09eb=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x09eb,0x103));var _0xb09e=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x09eb[_0x5a99db];return _0x3aad62;};'use strict';var _=require(_0xb09e('0x0'));var util=require(_0xb09e('0x1'));var moment=require(_0xb09e('0x2'));var BPromise=require(_0xb09e('0x3'));var rs=require(_0xb09e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb09e('0x5'))['db'];var utils=require(_0xb09e('0x6'));var logger=require('../../config/logger')(_0xb09e('0x7'));var config=require(_0xb09e('0x8'));var jayson=require(_0xb09e('0x9'));var client=jayson[_0xb09e('0xa')][_0xb09e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x302fb8,_0x3cbf51,_0x5006ae){return new BPromise(function(_0x360a5f,_0x2f92f3){return client[_0xb09e('0xc')](_0x302fb8,_0x5006ae)[_0xb09e('0xd')](function(_0x29cf13){logger['info'](_0xb09e('0xe'),_0x3cbf51,_0xb09e('0xf'));logger[_0xb09e('0x10')](_0xb09e('0x11'),_0x3cbf51,_0xb09e('0xf'),JSON[_0xb09e('0x12')](_0x29cf13));if(_0x29cf13[_0xb09e('0x13')]){if(_0x29cf13[_0xb09e('0x13')]['code']===0x1f4){logger['error'](_0xb09e('0xe'),_0x3cbf51,_0x29cf13[_0xb09e('0x13')]['message']);return _0x2f92f3(_0x29cf13[_0xb09e('0x13')][_0xb09e('0x14')]);}logger[_0xb09e('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3cbf51,_0x29cf13[_0xb09e('0x13')][_0xb09e('0x14')]);return _0x360a5f(_0x29cf13['error']['message']);}else{logger[_0xb09e('0x15')](_0xb09e('0xe'),_0x3cbf51,_0xb09e('0xf'));_0x360a5f(_0x29cf13['result'][_0xb09e('0x14')]);}})[_0xb09e('0x16')](function(_0x93d710){logger[_0xb09e('0x13')](_0xb09e('0xe'),_0x3cbf51,_0x93d710);_0x2f92f3(_0x93d710);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 321da13..9fa96b5 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 _0x2f63=['../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3fad58,_0x52d780){var _0x135e78=function(_0x546e43){while(--_0x546e43){_0x3fad58['push'](_0x3fad58['shift']());}};_0x135e78(++_0x52d780);}(_0x2f63,0xe8));var _0x32f6=function(_0x3d7022,_0x59dfd5){_0x3d7022=_0x3d7022-0x0;var _0x40870b=_0x2f63[_0x3d7022];return _0x40870b;};'use strict';var multer=require(_0x32f6('0x0'));var util=require(_0x32f6('0x1'));var path=require(_0x32f6('0x2'));var timeout=require(_0x32f6('0x3'));var express=require(_0x32f6('0x4'));var router=express[_0x32f6('0x5')]();var fs_extra=require(_0x32f6('0x6'));var auth=require(_0x32f6('0x7'));var interaction=require(_0x32f6('0x8'));var config=require(_0x32f6('0x9'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x32f6('0xa')](),controller['index']);router[_0x32f6('0xb')]('/:id',auth[_0x32f6('0xa')](),controller[_0x32f6('0xc')]);router[_0x32f6('0xb')](_0x32f6('0xd'),auth[_0x32f6('0xa')](),controller[_0x32f6('0xe')]);router[_0x32f6('0xb')](_0x32f6('0xf'),auth[_0x32f6('0xa')](),controller[_0x32f6('0x10')]);router[_0x32f6('0xb')](_0x32f6('0x11'),auth[_0x32f6('0xa')](),controller[_0x32f6('0x12')]);router[_0x32f6('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32f6('0x14')](_0x32f6('0x15'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x32f6('0xa')](),controller[_0x32f6('0x16')]);module[_0x32f6('0x17')]=router;
\ No newline at end of file
+var _0x387e=['preview','/:id/run','run','/:id/query','post','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/preview'];(function(_0xeb43f1,_0x16b60d){var _0x401a42=function(_0x5b40c8){while(--_0x5b40c8){_0xeb43f1['push'](_0xeb43f1['shift']());}};_0x401a42(++_0x16b60d);}(_0x387e,0x1c0));var _0xe387=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x387e[_0x236c89];return _0x3b2a15;};'use strict';var multer=require(_0xe387('0x0'));var util=require('util');var path=require(_0xe387('0x1'));var timeout=require(_0xe387('0x2'));var express=require(_0xe387('0x3'));var router=express[_0xe387('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe387('0x5'));var interaction=require(_0xe387('0x6'));var config=require(_0xe387('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xe387('0x8')]('/',auth[_0xe387('0x9')](),controller[_0xe387('0xa')]);router['get']('/:id',auth[_0xe387('0x9')](),controller['show']);router[_0xe387('0x8')](_0xe387('0xb'),auth[_0xe387('0x9')](),controller[_0xe387('0xc')]);router[_0xe387('0x8')](_0xe387('0xd'),auth['isAuthenticated'](),controller[_0xe387('0xe')]);router[_0xe387('0x8')](_0xe387('0xf'),auth[_0xe387('0x9')](),controller['query']);router[_0xe387('0x10')]('/',auth['isAuthenticated'](),controller[_0xe387('0x11')]);router[_0xe387('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe387('0x13')](_0xe387('0x14'),auth[_0xe387('0x9')](),controller[_0xe387('0x15')]);module[_0xe387('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4d47642..986a28b 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f47=['TEXT','exports','STRING'];(function(_0x5bb99a,_0xdcf922){var _0x7b09cd=function(_0x25dc13){while(--_0x25dc13){_0x5bb99a['push'](_0x5bb99a['shift']());}};_0x7b09cd(++_0xdcf922);}(_0x6f47,0xc7));var _0x76f4=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x6f47[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x3377ef,_0xcd2120){var _0x3d2638=function(_0x5509c1){while(--_0x5509c1){_0x3377ef['push'](_0x3377ef['shift']());}};_0x3d2638(++_0xcd2120);}(_0xac9d,0x14d));var _0xdac9=function(_0x3d3590,_0x23bd12){_0x3d3590=_0x3d3590-0x0;var _0x1348ff=_0xac9d[_0x3d3590];return _0x1348ff;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 703835a..e0b87dc 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 _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4ebb37,_0x53ebf3){_0x4ebb37=_0x4ebb37-0x0;var _0x156e72=_0xc6ac[_0x4ebb37];return _0x156e72;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
+var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x5a0d6e,_0x2b572b){var _0x11f186=function(_0x3012c3){while(--_0x3012c3){_0x5a0d6e['push'](_0x5a0d6e['shift']());}};_0x11f186(++_0x2b572b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x893974,_0x6e411a){_0x893974=_0x893974-0x0;var _0x3ff57d=_0x1cb9[_0x893974];return _0x3ff57d;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6ebbd2f..196ae17 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 _0x33a1=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x33a1,0x1bb));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x133a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x133a('0x1'));var moment=require('moment');var BPromise=require(_0x133a('0x2'));var rp=require(_0x133a('0x3'));var fs=require('fs');var path=require(_0x133a('0x4'));var rimraf=require(_0x133a('0x5'));var config=require(_0x133a('0x6'));var attributes=require(_0x133a('0x7'));module[_0x133a('0x8')]=function(_0x4f8746,_0x1a7568){return _0x4f8746['define'](_0x133a('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1509=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x1509,0x15f));var _0x9150=function(_0x4b8c1b,_0x23daf2){_0x4b8c1b=_0x4b8c1b-0x0;var _0x34f867=_0x1509[_0x4b8c1b];return _0x34f867;};'use strict';var _=require(_0x9150('0x0'));var util=require(_0x9150('0x1'));var logger=require(_0x9150('0x2'))(_0x9150('0x3'));var moment=require('moment');var BPromise=require(_0x9150('0x4'));var rp=require(_0x9150('0x5'));var fs=require('fs');var path=require(_0x9150('0x6'));var rimraf=require('rimraf');var config=require(_0x9150('0x7'));var attributes=require(_0x9150('0x8'));module[_0x9150('0x9')]=function(_0x570411,_0x5ad593){return _0x570411[_0x9150('0xa')](_0x9150('0xb'),attributes,{'tableName':_0x9150('0xc'),'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 4ce9f2e..3cd77b1 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 _0x1f88=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x476bcd,_0x2f6582){var _0x47b60f=function(_0x406a6e){while(--_0x406a6e){_0x476bcd['push'](_0x476bcd['shift']());}};_0x47b60f(++_0x2f6582);}(_0x1f88,0xdd));var _0x81f8=function(_0x12a9c6,_0x17fcf7){_0x12a9c6=_0x12a9c6-0x0;var _0x432410=_0x1f88[_0x12a9c6];return _0x432410;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x81f8('0x0'));var BPromise=require(_0x81f8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81f8('0x2'));var db=require(_0x81f8('0x3'))['db'];var utils=require(_0x81f8('0x4'));var logger=require(_0x81f8('0x5'))(_0x81f8('0x6'));var config=require(_0x81f8('0x7'));var jayson=require(_0x81f8('0x8'));var client=jayson[_0x81f8('0x9')][_0x81f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bfa0d,_0x11e8f4,_0x448297){return new BPromise(function(_0x5a27cd,_0x1cb0ee){return client['request'](_0x3bfa0d,_0x448297)[_0x81f8('0xb')](function(_0x40d067){logger[_0x81f8('0xc')](_0x81f8('0xd'),_0x11e8f4,_0x81f8('0xe'));logger[_0x81f8('0xf')](_0x81f8('0x10'),_0x11e8f4,_0x81f8('0xe'),JSON[_0x81f8('0x11')](_0x40d067));if(_0x40d067[_0x81f8('0x12')]){if(_0x40d067['error'][_0x81f8('0x13')]===0x1f4){logger[_0x81f8('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x11e8f4,_0x40d067[_0x81f8('0x12')][_0x81f8('0x14')]);return _0x1cb0ee(_0x40d067[_0x81f8('0x12')][_0x81f8('0x14')]);}logger['error'](_0x81f8('0xd'),_0x11e8f4,_0x40d067[_0x81f8('0x12')][_0x81f8('0x14')]);return _0x5a27cd(_0x40d067['error'][_0x81f8('0x14')]);}else{logger[_0x81f8('0xc')](_0x81f8('0xd'),_0x11e8f4,_0x81f8('0xe'));_0x5a27cd(_0x40d067['result'][_0x81f8('0x14')]);}})[_0x81f8('0x15')](function(_0x1bd561){logger['error'](_0x81f8('0xd'),_0x11e8f4,_0x1bd561);_0x1cb0ee(_0x1bd561);});});}
\ No newline at end of file
+var _0x960b=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x525ffa,_0x523d3f){var _0x34befd=function(_0x44006a){while(--_0x44006a){_0x525ffa['push'](_0x525ffa['shift']());}};_0x34befd(++_0x523d3f);}(_0x960b,0x187));var _0xb960=function(_0x3db1fd,_0x4c9d21){_0x3db1fd=_0x3db1fd-0x0;var _0x3fe0e2=_0x960b[_0x3db1fd];return _0x3fe0e2;};'use strict';var _=require(_0xb960('0x0'));var util=require(_0xb960('0x1'));var moment=require(_0xb960('0x2'));var BPromise=require('bluebird');var rs=require(_0xb960('0x3'));var fs=require('fs');var Redis=require(_0xb960('0x4'));var db=require(_0xb960('0x5'))['db'];var utils=require(_0xb960('0x6'));var logger=require(_0xb960('0x7'))('rpc');var config=require(_0xb960('0x8'));var jayson=require(_0xb960('0x9'));var client=jayson[_0xb960('0xa')][_0xb960('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35482d,_0x16be1c,_0x58d9f1){return new BPromise(function(_0x32b8e2,_0x1fa653){return client[_0xb960('0xc')](_0x35482d,_0x58d9f1)[_0xb960('0xd')](function(_0x27242c){logger[_0xb960('0xe')](_0xb960('0xf'),_0x16be1c,_0xb960('0x10'));logger[_0xb960('0x11')](_0xb960('0x12'),_0x16be1c,_0xb960('0x10'),JSON[_0xb960('0x13')](_0x27242c));if(_0x27242c[_0xb960('0x14')]){if(_0x27242c[_0xb960('0x14')][_0xb960('0x15')]===0x1f4){logger[_0xb960('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x16be1c,_0x27242c['error'][_0xb960('0x16')]);return _0x1fa653(_0x27242c[_0xb960('0x14')][_0xb960('0x16')]);}logger[_0xb960('0x14')](_0xb960('0xf'),_0x16be1c,_0x27242c[_0xb960('0x14')]['message']);return _0x32b8e2(_0x27242c['error'][_0xb960('0x16')]);}else{logger[_0xb960('0xe')](_0xb960('0xf'),_0x16be1c,_0xb960('0x10'));_0x32b8e2(_0x27242c['result'][_0xb960('0x16')]);}})['catch'](function(_0x2496cd){logger['error'](_0xb960('0xf'),_0x16be1c,_0x2496cd);_0x1fa653(_0x2496cd);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3efd9fa..9b7b24c 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 _0x6b02=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','put'];(function(_0x560582,_0x1406d4){var _0x3c7c83=function(_0x4d9978){while(--_0x4d9978){_0x560582['push'](_0x560582['shift']());}};_0x3c7c83(++_0x1406d4);}(_0x6b02,0x1d0));var _0x26b0=function(_0x269568,_0x53c448){_0x269568=_0x269568-0x0;var _0x38a9bd=_0x6b02[_0x269568];return _0x38a9bd;};'use strict';var multer=require('multer');var util=require(_0x26b0('0x0'));var path=require(_0x26b0('0x1'));var timeout=require(_0x26b0('0x2'));var express=require(_0x26b0('0x3'));var router=express['Router']();var fs_extra=require(_0x26b0('0x4'));var auth=require(_0x26b0('0x5'));var interaction=require(_0x26b0('0x6'));var config=require(_0x26b0('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x26b0('0x8')]('/',auth[_0x26b0('0x9')](),controller[_0x26b0('0xa')]);router[_0x26b0('0x8')](_0x26b0('0xb'),auth[_0x26b0('0x9')](),controller['show']);router['get'](_0x26b0('0xc'),auth['isAuthenticated'](),controller[_0x26b0('0xd')]);router[_0x26b0('0x8')](_0x26b0('0xe'),auth[_0x26b0('0x9')](),controller[_0x26b0('0xf')]);router[_0x26b0('0x8')]('/:id/query',auth[_0x26b0('0x9')](),controller[_0x26b0('0x10')]);router[_0x26b0('0x11')]('/',auth[_0x26b0('0x9')](),controller['create']);router[_0x26b0('0x12')](_0x26b0('0xb'),auth[_0x26b0('0x9')](),controller[_0x26b0('0x13')]);router[_0x26b0('0x14')](_0x26b0('0xb'),auth[_0x26b0('0x9')](),controller[_0x26b0('0x15')]);module[_0x26b0('0x16')]=router;
\ No newline at end of file
+var _0x2071=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get'];(function(_0x3ce34a,_0x5a2dd4){var _0x3320ed=function(_0x2815f7){while(--_0x2815f7){_0x3ce34a['push'](_0x3ce34a['shift']());}};_0x3320ed(++_0x5a2dd4);}(_0x2071,0xb1));var _0x1207=function(_0x44cd28,_0x1502d9){_0x44cd28=_0x44cd28-0x0;var _0x39356e=_0x2071[_0x44cd28];return _0x39356e;};'use strict';var multer=require(_0x1207('0x0'));var util=require(_0x1207('0x1'));var path=require(_0x1207('0x2'));var timeout=require('connect-timeout');var express=require(_0x1207('0x3'));var router=express[_0x1207('0x4')]();var fs_extra=require(_0x1207('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1207('0x6'));var config=require(_0x1207('0x7'));var controller=require(_0x1207('0x8'));router['get']('/',auth[_0x1207('0x9')](),controller[_0x1207('0xa')]);router[_0x1207('0xb')]('/:id',auth[_0x1207('0x9')](),controller[_0x1207('0xc')]);router[_0x1207('0xb')](_0x1207('0xd'),auth[_0x1207('0x9')](),controller[_0x1207('0xe')]);router['get'](_0x1207('0xf'),auth[_0x1207('0x9')](),controller[_0x1207('0x10')]);router['get'](_0x1207('0x11'),auth[_0x1207('0x9')](),controller[_0x1207('0x12')]);router[_0x1207('0x13')]('/',auth[_0x1207('0x9')](),controller[_0x1207('0x14')]);router[_0x1207('0x15')](_0x1207('0x16'),auth[_0x1207('0x9')](),controller[_0x1207('0x17')]);router[_0x1207('0x18')](_0x1207('0x16'),auth[_0x1207('0x9')](),controller[_0x1207('0x19')]);module[_0x1207('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8b4f768..75fad23 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 _0x2973=['csv','xlsx','DATE','Loading','manual','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2973,0xa6));var _0x3297=function(_0x44c340,_0x575719){_0x44c340=_0x44c340-0x0;var _0x2cd080=_0x2973[_0x44c340];return _0x2cd080;};'use strict';var Sequelize=require(_0x3297('0x0'));var moment=require('moment');module[_0x3297('0x1')]={'name':{'type':Sequelize[_0x3297('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3297('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3297('0x3')](_0x3297('0x4'),'pdf',_0x3297('0x5')),'allowNull':![],'defaultValue':_0x3297('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x3297('0x6')]},'endDate':{'type':Sequelize[_0x3297('0x6')]},'status':{'type':Sequelize[_0x3297('0x2')],'defaultValue':_0x3297('0x7')},'type':{'type':Sequelize[_0x3297('0x3')](_0x3297('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x3297('0x8')},'reportId':{'type':Sequelize[_0x3297('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2a58=['ENUM','csv','pdf','xlsx','DATE','Loading','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2a58,0x68));var _0x82a5=function(_0x1c411a,_0x2cbf0a){_0x1c411a=_0x1c411a-0x0;var _0xe8808c=_0x2a58[_0x1c411a];return _0xe8808c;};'use strict';var Sequelize=require(_0x82a5('0x0'));var moment=require(_0x82a5('0x1'));module[_0x82a5('0x2')]={'name':{'type':Sequelize[_0x82a5('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x82a5('0x4')](_0x82a5('0x5'),_0x82a5('0x6'),_0x82a5('0x7')),'allowNull':![],'defaultValue':_0x82a5('0x5')},'savename':{'type':Sequelize[_0x82a5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x82a5('0x8')]},'endDate':{'type':Sequelize[_0x82a5('0x8')]},'status':{'type':Sequelize[_0x82a5('0x3')],'defaultValue':_0x82a5('0x9')},'type':{'type':Sequelize[_0x82a5('0x4')]('manual','scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x82a5('0xa')](0xb)[_0x82a5('0xb')]},'reportType':{'type':Sequelize[_0x82a5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 0a89d51..2b26951 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 _0x5d90=['attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','destroy','then','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','intersection'];(function(_0x2b5d9a,_0x238e95){var _0x2c852a=function(_0x19b275){while(--_0x19b275){_0x2b5d9a['push'](_0x2b5d9a['shift']());}};_0x2c852a(++_0x238e95);}(_0x5d90,0x146));var _0x05d9=function(_0x19d22c,_0x3c48af){_0x19d22c=_0x19d22c-0x0;var _0x568d33=_0x5d90[_0x19d22c];return _0x568d33;};'use strict';var emlformat=require(_0x05d9('0x0'));var rimraf=require(_0x05d9('0x1'));var zipdir=require(_0x05d9('0x2'));var jsonpatch=require(_0x05d9('0x3'));var rp=require(_0x05d9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x05d9('0x5'));var util=require(_0x05d9('0x6'));var path=require(_0x05d9('0x7'));var sox=require(_0x05d9('0x8'));var csv=require(_0x05d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05d9('0xa'));var _=require(_0x05d9('0xb'));var squel=require(_0x05d9('0xc'));var crypto=require(_0x05d9('0xd'));var jsforce=require(_0x05d9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x05d9('0x9'));var querystring=require(_0x05d9('0xf'));var Papa=require(_0x05d9('0x10'));var Redis=require(_0x05d9('0x11'));var authService=require(_0x05d9('0x12'));var qs=require(_0x05d9('0x13'));var as=require(_0x05d9('0x14'));var hardwareService=require(_0x05d9('0x15'));var logger=require(_0x05d9('0x16'))('api');var utils=require(_0x05d9('0x17'));var config=require(_0x05d9('0x18'));var licenseUtil=require(_0x05d9('0x19'));var db=require(_0x05d9('0x1a'))['db'];function respondWithStatusCode(_0x3c6627,_0x5372fe){_0x5372fe=_0x5372fe||0xcc;return function(_0x55e64a){if(_0x55e64a){return _0x3c6627[_0x05d9('0x1b')](_0x5372fe);}return _0x3c6627[_0x05d9('0x1c')](_0x5372fe)[_0x05d9('0x1d')]();};}function respondWithResult(_0x475413,_0x36a0e7){_0x36a0e7=_0x36a0e7||0xc8;return function(_0x595e34){if(_0x595e34){return _0x475413['status'](_0x36a0e7)[_0x05d9('0x1e')](_0x595e34);}};}function respondWithFilteredResult(_0x239571,_0x566b4c){return function(_0x1d80db){if(_0x1d80db){var _0x4d8a0b=typeof _0x566b4c[_0x05d9('0x1f')]===_0x05d9('0x20')&&typeof _0x566b4c[_0x05d9('0x21')]===_0x05d9('0x20');var _0x2ec2c0=_0x1d80db['count'];var _0x19cacb=_0x4d8a0b?0x0:_0x566b4c[_0x05d9('0x1f')];var _0x122489=_0x4d8a0b?_0x1d80db[_0x05d9('0x22')]:_0x566b4c[_0x05d9('0x1f')]+_0x566b4c[_0x05d9('0x21')];var _0x149430;if(_0x122489>=_0x2ec2c0){_0x122489=_0x2ec2c0;_0x149430=0xc8;}else{_0x149430=0xce;}_0x239571[_0x05d9('0x1c')](_0x149430);return _0x239571[_0x05d9('0x23')]('Content-Range',_0x19cacb+'-'+_0x122489+'/'+_0x2ec2c0)[_0x05d9('0x1e')](_0x1d80db);}return null;};}function patchUpdates(_0x78932d){return function(_0x41deca){try{jsonpatch[_0x05d9('0x24')](_0x41deca,_0x78932d,!![]);}catch(_0x2a1521){return BPromise['reject'](_0x2a1521);}return _0x41deca['save']();};}function saveUpdates(_0x48bb87,_0x319d7d){return function(_0x42f580){if(_0x42f580){return _0x42f580['update'](_0x48bb87)['then'](function(_0x5bad5b){return _0x5bad5b;});}return null;};}function removeEntity(_0x41ef95,_0x1c4800){return function(_0x2a486e){if(_0x2a486e){return _0x2a486e[_0x05d9('0x25')]()[_0x05d9('0x26')](function(){var _0x3925f8=_0x2a486e[_0x05d9('0x27')]({'plain':!![]});var _0x42b131=_0x05d9('0x28');return db['UserProfileResource'][_0x05d9('0x25')]({'where':{'type':_0x42b131,'resourceId':_0x3925f8['id']}})[_0x05d9('0x26')](function(){return _0x2a486e;});})[_0x05d9('0x26')](function(){_0x41ef95['status'](0xcc)[_0x05d9('0x1d')]();});}};}function handleEntityNotFound(_0x2a59a9,_0x5bbc5c){return function(_0x4b686c){if(!_0x4b686c){_0x2a59a9[_0x05d9('0x1b')](0x194);}return _0x4b686c;};}function handleError(_0x31f08a,_0x48c574){_0x48c574=_0x48c574||0x1f4;return function(_0x445656){logger['error'](_0x445656[_0x05d9('0x29')]);if(_0x445656[_0x05d9('0x2a')]){delete _0x445656[_0x05d9('0x2a')];}_0x31f08a[_0x05d9('0x1c')](_0x48c574)[_0x05d9('0x2b')](_0x445656);};}exports[_0x05d9('0x2c')]=function(_0x53f087,_0x1c95e9){var _0x45eb03={},_0x32b34d={},_0x37738f={'count':0x0,'rows':[]};var _0x1627e3=_[_0x05d9('0x2d')](db[_0x05d9('0x2e')]['rawAttributes'],function(_0x481a0e){return{'name':_0x481a0e[_0x05d9('0x2f')],'type':_0x481a0e[_0x05d9('0x30')][_0x05d9('0x31')]};});_0x32b34d[_0x05d9('0x32')]=_[_0x05d9('0x2d')](_0x1627e3,'name');_0x32b34d[_0x05d9('0x33')]=_[_0x05d9('0x34')](_0x53f087[_0x05d9('0x33')]);_0x32b34d['filters']=_[_0x05d9('0x35')](_0x32b34d['model'],_0x32b34d['query']);_0x45eb03[_0x05d9('0x36')]=_['intersection'](_0x32b34d[_0x05d9('0x32')],qs['fields'](_0x53f087['query']['fields']));_0x45eb03[_0x05d9('0x36')]=_0x45eb03[_0x05d9('0x36')][_0x05d9('0x37')]?_0x45eb03[_0x05d9('0x36')]:_0x32b34d[_0x05d9('0x32')];if(!_0x53f087['query']['hasOwnProperty']('nolimit')){_0x45eb03[_0x05d9('0x21')]=qs['limit'](_0x53f087[_0x05d9('0x33')][_0x05d9('0x21')]);_0x45eb03['offset']=qs[_0x05d9('0x1f')](_0x53f087[_0x05d9('0x33')][_0x05d9('0x1f')]);}_0x45eb03[_0x05d9('0x38')]=qs[_0x05d9('0x39')](_0x53f087[_0x05d9('0x33')][_0x05d9('0x39')]);_0x45eb03[_0x05d9('0x3a')]=qs[_0x05d9('0x3b')](_[_0x05d9('0x3c')](_0x53f087[_0x05d9('0x33')],_0x32b34d['filters']),_0x1627e3);if(_0x53f087[_0x05d9('0x33')]['filter']){_0x45eb03[_0x05d9('0x3a')]=_[_0x05d9('0x3d')](_0x45eb03[_0x05d9('0x3a')],{'$or':_['map'](_0x1627e3,function(_0x1f4e18){if(_0x1f4e18[_0x05d9('0x30')]!==_0x05d9('0x3e')){var _0xd51fd7={};_0xd51fd7[_0x1f4e18[_0x05d9('0x2a')]]={'$like':'%'+_0x53f087['query']['filter']+'%'};return _0xd51fd7;}})});}_0x45eb03=_[_0x05d9('0x3d')]({},_0x45eb03,_0x53f087[_0x05d9('0x3f')]);var _0x2d2cba={'where':_0x45eb03[_0x05d9('0x3a')]};return db['AnalyticExtractedReport'][_0x05d9('0x22')](_0x2d2cba)['then'](function(_0x29323f){_0x37738f['count']=_0x29323f;if(_0x53f087[_0x05d9('0x33')][_0x05d9('0x40')]){_0x45eb03['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x05d9('0x41')](_0x45eb03);})['then'](function(_0x44cce1){_0x37738f[_0x05d9('0x42')]=_0x44cce1;return _0x37738f;})[_0x05d9('0x26')](respondWithFilteredResult(_0x1c95e9,_0x45eb03))['catch'](handleError(_0x1c95e9,null));};exports['show']=function(_0x1e298c,_0x184bae){var _0x1ea2fd={'raw':!![],'where':{'id':_0x1e298c[_0x05d9('0x43')]['id']}},_0x39f9f9={};_0x39f9f9[_0x05d9('0x32')]=_[_0x05d9('0x34')](db[_0x05d9('0x2e')][_0x05d9('0x44')]);_0x39f9f9['query']=_[_0x05d9('0x34')](_0x1e298c[_0x05d9('0x33')]);_0x39f9f9['filters']=_[_0x05d9('0x35')](_0x39f9f9['model'],_0x39f9f9[_0x05d9('0x33')]);_0x1ea2fd[_0x05d9('0x36')]=_[_0x05d9('0x35')](_0x39f9f9['model'],qs['fields'](_0x1e298c[_0x05d9('0x33')]['fields']));_0x1ea2fd[_0x05d9('0x36')]=_0x1ea2fd['attributes'][_0x05d9('0x37')]?_0x1ea2fd[_0x05d9('0x36')]:_0x39f9f9['model'];if(_0x1e298c['query'][_0x05d9('0x40')]){_0x1ea2fd[_0x05d9('0x45')]=[{'all':!![]}];}_0x1ea2fd=_[_0x05d9('0x3d')]({},_0x1ea2fd,_0x1e298c['options']);return db[_0x05d9('0x2e')][_0x05d9('0x46')](_0x1ea2fd)[_0x05d9('0x26')](handleEntityNotFound(_0x184bae,null))[_0x05d9('0x26')](respondWithResult(_0x184bae,null))[_0x05d9('0x47')](handleError(_0x184bae,null));};exports[_0x05d9('0x48')]=function(_0x4d4f80,_0x3362d1){return db[_0x05d9('0x2e')]['create'](_0x4d4f80[_0x05d9('0x49')],{})['then'](function(_0x52360c){var _0x503c14=_0x4d4f80[_0x05d9('0x4a')]['get']({'plain':!![]});if(!_0x503c14)throw new Error(_0x05d9('0x4b'));if(_0x503c14['role']===_0x05d9('0x4a')){var _0x3d0f5b=_0x52360c['get']({'plain':!![]});var _0xf0e7f2='ExtractedReports';return db['UserProfileSection'][_0x05d9('0x46')]({'where':{'name':_0xf0e7f2,'userProfileId':_0x503c14[_0x05d9('0x4c')]},'raw':!![]})[_0x05d9('0x26')](function(_0x3d91cc){if(_0x3d91cc&&_0x3d91cc[_0x05d9('0x4d')]===0x0){return db[_0x05d9('0x4e')][_0x05d9('0x48')]({'name':_0x3d0f5b[_0x05d9('0x2a')],'resourceId':_0x3d0f5b['id'],'type':_0x3d91cc['name'],'sectionId':_0x3d91cc['id']},{})[_0x05d9('0x26')](function(){return _0x52360c;});}else{return _0x52360c;}})[_0x05d9('0x47')](function(_0x385b01){logger['error'](_0x05d9('0x4f'),_0x385b01);throw _0x385b01;});}return _0x52360c;})[_0x05d9('0x26')](respondWithResult(_0x3362d1,0xc9))['catch'](handleError(_0x3362d1,null));};exports[_0x05d9('0x50')]=function(_0xb94525,_0xd6b541){if(_0xb94525['body']['id']){delete _0xb94525[_0x05d9('0x49')]['id'];}return db[_0x05d9('0x2e')][_0x05d9('0x46')]({'where':{'id':_0xb94525[_0x05d9('0x43')]['id']}})['then'](handleEntityNotFound(_0xd6b541,null))[_0x05d9('0x26')](saveUpdates(_0xb94525['body'],null))[_0x05d9('0x26')](respondWithResult(_0xd6b541,null))['catch'](handleError(_0xd6b541,null));};exports[_0x05d9('0x25')]=function(_0x400f28,_0x24a883){return db[_0x05d9('0x2e')]['find']({'where':{'id':_0x400f28[_0x05d9('0x43')]['id']}})[_0x05d9('0x26')](handleEntityNotFound(_0x24a883,null))[_0x05d9('0x26')](removeEntity(_0x24a883,null))['catch'](handleError(_0x24a883,null));};exports[_0x05d9('0x51')]=function(_0x3ef654,_0x2dd76a,_0x458bb5){return db[_0x05d9('0x2e')]['find']({'where':{'id':_0x3ef654[_0x05d9('0x43')]['id']},'attributes':[_0x05d9('0x2a'),_0x05d9('0x52'),'savename',_0x05d9('0x53')],'raw':!![]})[_0x05d9('0x26')](handleEntityNotFound(_0x2dd76a,null))[_0x05d9('0x26')](function(_0x4e52fb){if(_0x4e52fb){if(!fs[_0x05d9('0x54')](path[_0x05d9('0x55')](config[_0x05d9('0x56')],_0x05d9('0x57'),_0x4e52fb[_0x05d9('0x58')]))){throw new db[(_0x05d9('0x59'))][(_0x05d9('0x5a'))](_0x05d9('0x5b'));}if(_0x3ef654[_0x05d9('0x33')][_0x05d9('0x5c')]){return _0x2dd76a['sendStatus'](0xc8);}return _0x2dd76a[_0x05d9('0x51')](path['join'](config['root'],_0x05d9('0x57'),_0x4e52fb[_0x05d9('0x58')]),util[_0x05d9('0x5d')](_0x05d9('0x5e'),_0x4e52fb[_0x05d9('0x52')]||_0x4e52fb['name'],_0x4e52fb[_0x05d9('0x53')]['toLowerCase']()));}})['catch'](handleError(_0x2dd76a,null));};
\ No newline at end of file
+var _0xc1a6=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','ExtractedReports','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','AnalyticExtractedReport','includeAll','include','findAll','rows','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2f8219,_0x209d33){var _0x101515=function(_0x2467ce){while(--_0x2467ce){_0x2f8219['push'](_0x2f8219['shift']());}};_0x101515(++_0x209d33);}(_0xc1a6,0x18f));var _0x6c1a=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xc1a6[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0x6c1a('0x0'));var rimraf=require(_0x6c1a('0x1'));var zipdir=require(_0x6c1a('0x2'));var jsonpatch=require(_0x6c1a('0x3'));var rp=require('request-promise');var moment=require(_0x6c1a('0x4'));var BPromise=require(_0x6c1a('0x5'));var Mustache=require(_0x6c1a('0x6'));var util=require(_0x6c1a('0x7'));var path=require(_0x6c1a('0x8'));var sox=require(_0x6c1a('0x9'));var csv=require(_0x6c1a('0xa'));var ejs=require(_0x6c1a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c1a('0xc'));var squel=require(_0x6c1a('0xd'));var crypto=require(_0x6c1a('0xe'));var jsforce=require(_0x6c1a('0xf'));var deskjs=require(_0x6c1a('0x10'));var toCsv=require(_0x6c1a('0xa'));var querystring=require(_0x6c1a('0x11'));var Papa=require('papaparse');var Redis=require(_0x6c1a('0x12'));var authService=require(_0x6c1a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6c1a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c1a('0x15'))('api');var utils=require(_0x6c1a('0x16'));var config=require(_0x6c1a('0x17'));var licenseUtil=require(_0x6c1a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa214ba,_0x1a4d51){_0x1a4d51=_0x1a4d51||0xcc;return function(_0x3263d3){if(_0x3263d3){return _0xa214ba['sendStatus'](_0x1a4d51);}return _0xa214ba[_0x6c1a('0x19')](_0x1a4d51)[_0x6c1a('0x1a')]();};}function respondWithResult(_0x2b2f12,_0xb6a31b){_0xb6a31b=_0xb6a31b||0xc8;return function(_0x2b2ce2){if(_0x2b2ce2){return _0x2b2f12[_0x6c1a('0x19')](_0xb6a31b)['json'](_0x2b2ce2);}};}function respondWithFilteredResult(_0xf2c4f9,_0x34c317){return function(_0x182925){if(_0x182925){var _0x3317ec=typeof _0x34c317[_0x6c1a('0x1b')]===_0x6c1a('0x1c')&&typeof _0x34c317['limit']===_0x6c1a('0x1c');var _0x5e7ecb=_0x182925[_0x6c1a('0x1d')];var _0xb0c00a=_0x3317ec?0x0:_0x34c317[_0x6c1a('0x1b')];var _0x18181e=_0x3317ec?_0x182925[_0x6c1a('0x1d')]:_0x34c317[_0x6c1a('0x1b')]+_0x34c317[_0x6c1a('0x1e')];var _0x39d25e;if(_0x18181e>=_0x5e7ecb){_0x18181e=_0x5e7ecb;_0x39d25e=0xc8;}else{_0x39d25e=0xce;}_0xf2c4f9[_0x6c1a('0x19')](_0x39d25e);return _0xf2c4f9[_0x6c1a('0x1f')](_0x6c1a('0x20'),_0xb0c00a+'-'+_0x18181e+'/'+_0x5e7ecb)[_0x6c1a('0x21')](_0x182925);}return null;};}function patchUpdates(_0x541235){return function(_0xd6dfd0){try{jsonpatch[_0x6c1a('0x22')](_0xd6dfd0,_0x541235,!![]);}catch(_0x1a5a14){return BPromise['reject'](_0x1a5a14);}return _0xd6dfd0[_0x6c1a('0x23')]();};}function saveUpdates(_0x3f9057,_0x2fd91a){return function(_0x2691a6){if(_0x2691a6){return _0x2691a6[_0x6c1a('0x24')](_0x3f9057)[_0x6c1a('0x25')](function(_0x1296d5){return _0x1296d5;});}return null;};}function removeEntity(_0x87d670,_0x2151d6){return function(_0x17aac6){if(_0x17aac6){return _0x17aac6['destroy']()[_0x6c1a('0x25')](function(){var _0x102b1a=_0x17aac6['get']({'plain':!![]});var _0x54f21a=_0x6c1a('0x26');return db['UserProfileResource'][_0x6c1a('0x27')]({'where':{'type':_0x54f21a,'resourceId':_0x102b1a['id']}})[_0x6c1a('0x25')](function(){return _0x17aac6;});})['then'](function(){_0x87d670['status'](0xcc)[_0x6c1a('0x1a')]();});}};}function handleEntityNotFound(_0x39ab9a,_0x348195){return function(_0x5491b3){if(!_0x5491b3){_0x39ab9a[_0x6c1a('0x28')](0x194);}return _0x5491b3;};}function handleError(_0x347fd8,_0x493f06){_0x493f06=_0x493f06||0x1f4;return function(_0x2c2c45){logger[_0x6c1a('0x29')](_0x2c2c45[_0x6c1a('0x2a')]);if(_0x2c2c45[_0x6c1a('0x2b')]){delete _0x2c2c45[_0x6c1a('0x2b')];}_0x347fd8['status'](_0x493f06)[_0x6c1a('0x2c')](_0x2c2c45);};}exports[_0x6c1a('0x2d')]=function(_0x1e5cd8,_0x574457){var _0x2a02b5={},_0x9cb2a6={},_0x6bb718={'count':0x0,'rows':[]};var _0x3cdb47=_[_0x6c1a('0x2e')](db['AnalyticExtractedReport'][_0x6c1a('0x2f')],function(_0x3fc252){return{'name':_0x3fc252[_0x6c1a('0x30')],'type':_0x3fc252[_0x6c1a('0x31')][_0x6c1a('0x32')]};});_0x9cb2a6['model']=_[_0x6c1a('0x2e')](_0x3cdb47,'name');_0x9cb2a6[_0x6c1a('0x33')]=_[_0x6c1a('0x34')](_0x1e5cd8['query']);_0x9cb2a6['filters']=_[_0x6c1a('0x35')](_0x9cb2a6[_0x6c1a('0x36')],_0x9cb2a6[_0x6c1a('0x33')]);_0x2a02b5['attributes']=_[_0x6c1a('0x35')](_0x9cb2a6[_0x6c1a('0x36')],qs['fields'](_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x37')]));_0x2a02b5[_0x6c1a('0x38')]=_0x2a02b5['attributes'][_0x6c1a('0x39')]?_0x2a02b5[_0x6c1a('0x38')]:_0x9cb2a6[_0x6c1a('0x36')];if(!_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x3a')](_0x6c1a('0x3b'))){_0x2a02b5[_0x6c1a('0x1e')]=qs[_0x6c1a('0x1e')](_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x1e')]);_0x2a02b5['offset']=qs[_0x6c1a('0x1b')](_0x1e5cd8[_0x6c1a('0x33')]['offset']);}_0x2a02b5[_0x6c1a('0x3c')]=qs[_0x6c1a('0x3d')](_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x3d')]);_0x2a02b5['where']=qs[_0x6c1a('0x3e')](_[_0x6c1a('0x3f')](_0x1e5cd8[_0x6c1a('0x33')],_0x9cb2a6[_0x6c1a('0x3e')]),_0x3cdb47);if(_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x40')]){_0x2a02b5[_0x6c1a('0x41')]=_[_0x6c1a('0x42')](_0x2a02b5[_0x6c1a('0x41')],{'$or':_[_0x6c1a('0x2e')](_0x3cdb47,function(_0x130606){if(_0x130606[_0x6c1a('0x31')]!=='VIRTUAL'){var _0x3b1788={};_0x3b1788[_0x130606['name']]={'$like':'%'+_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x40')]+'%'};return _0x3b1788;}})});}_0x2a02b5=_[_0x6c1a('0x42')]({},_0x2a02b5,_0x1e5cd8[_0x6c1a('0x43')]);var _0x299301={'where':_0x2a02b5['where']};return db[_0x6c1a('0x44')][_0x6c1a('0x1d')](_0x299301)['then'](function(_0x5c4a83){_0x6bb718[_0x6c1a('0x1d')]=_0x5c4a83;if(_0x1e5cd8[_0x6c1a('0x33')][_0x6c1a('0x45')]){_0x2a02b5[_0x6c1a('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x6c1a('0x47')](_0x2a02b5);})[_0x6c1a('0x25')](function(_0x479298){_0x6bb718[_0x6c1a('0x48')]=_0x479298;return _0x6bb718;})[_0x6c1a('0x25')](respondWithFilteredResult(_0x574457,_0x2a02b5))['catch'](handleError(_0x574457,null));};exports['show']=function(_0xb0bbdd,_0x353a53){var _0x4d21ec={'raw':!![],'where':{'id':_0xb0bbdd[_0x6c1a('0x49')]['id']}},_0x78ef9={};_0x78ef9[_0x6c1a('0x36')]=_[_0x6c1a('0x34')](db['AnalyticExtractedReport'][_0x6c1a('0x2f')]);_0x78ef9[_0x6c1a('0x33')]=_['keys'](_0xb0bbdd[_0x6c1a('0x33')]);_0x78ef9['filters']=_[_0x6c1a('0x35')](_0x78ef9['model'],_0x78ef9['query']);_0x4d21ec[_0x6c1a('0x38')]=_[_0x6c1a('0x35')](_0x78ef9[_0x6c1a('0x36')],qs[_0x6c1a('0x37')](_0xb0bbdd[_0x6c1a('0x33')][_0x6c1a('0x37')]));_0x4d21ec[_0x6c1a('0x38')]=_0x4d21ec[_0x6c1a('0x38')]['length']?_0x4d21ec[_0x6c1a('0x38')]:_0x78ef9[_0x6c1a('0x36')];if(_0xb0bbdd[_0x6c1a('0x33')][_0x6c1a('0x45')]){_0x4d21ec[_0x6c1a('0x46')]=[{'all':!![]}];}_0x4d21ec=_['merge']({},_0x4d21ec,_0xb0bbdd[_0x6c1a('0x43')]);return db['AnalyticExtractedReport'][_0x6c1a('0x4a')](_0x4d21ec)[_0x6c1a('0x25')](handleEntityNotFound(_0x353a53,null))[_0x6c1a('0x25')](respondWithResult(_0x353a53,null))[_0x6c1a('0x4b')](handleError(_0x353a53,null));};exports['create']=function(_0x2215d8,_0x5b6338){return db[_0x6c1a('0x44')][_0x6c1a('0x4c')](_0x2215d8[_0x6c1a('0x4d')],{})[_0x6c1a('0x25')](function(_0x19bd3b){var _0x524388=_0x2215d8[_0x6c1a('0x4e')][_0x6c1a('0x4f')]({'plain':!![]});if(!_0x524388)throw new Error(_0x6c1a('0x50'));if(_0x524388[_0x6c1a('0x51')]==='user'){var _0x74603a=_0x19bd3b[_0x6c1a('0x4f')]({'plain':!![]});var _0x1d510a=_0x6c1a('0x26');return db[_0x6c1a('0x52')]['find']({'where':{'name':_0x1d510a,'userProfileId':_0x524388[_0x6c1a('0x53')]},'raw':!![]})[_0x6c1a('0x25')](function(_0x391327){if(_0x391327&&_0x391327[_0x6c1a('0x54')]===0x0){return db['UserProfileResource'][_0x6c1a('0x4c')]({'name':_0x74603a[_0x6c1a('0x2b')],'resourceId':_0x74603a['id'],'type':_0x391327[_0x6c1a('0x2b')],'sectionId':_0x391327['id']},{})[_0x6c1a('0x25')](function(){return _0x19bd3b;});}else{return _0x19bd3b;}})['catch'](function(_0xd44577){logger[_0x6c1a('0x29')](_0x6c1a('0x55'),_0xd44577);throw _0xd44577;});}return _0x19bd3b;})[_0x6c1a('0x25')](respondWithResult(_0x5b6338,0xc9))[_0x6c1a('0x4b')](handleError(_0x5b6338,null));};exports[_0x6c1a('0x24')]=function(_0x429749,_0xf992f0){if(_0x429749[_0x6c1a('0x4d')]['id']){delete _0x429749[_0x6c1a('0x4d')]['id'];}return db[_0x6c1a('0x44')][_0x6c1a('0x4a')]({'where':{'id':_0x429749['params']['id']}})[_0x6c1a('0x25')](handleEntityNotFound(_0xf992f0,null))[_0x6c1a('0x25')](saveUpdates(_0x429749[_0x6c1a('0x4d')],null))['then'](respondWithResult(_0xf992f0,null))[_0x6c1a('0x4b')](handleError(_0xf992f0,null));};exports['destroy']=function(_0x2c2821,_0x28b0cc){return db[_0x6c1a('0x44')]['find']({'where':{'id':_0x2c2821[_0x6c1a('0x49')]['id']}})[_0x6c1a('0x25')](handleEntityNotFound(_0x28b0cc,null))[_0x6c1a('0x25')](removeEntity(_0x28b0cc,null))[_0x6c1a('0x4b')](handleError(_0x28b0cc,null));};exports['download']=function(_0x423fce,_0x26376c,_0x741844){return db[_0x6c1a('0x44')]['find']({'where':{'id':_0x423fce[_0x6c1a('0x49')]['id']},'attributes':[_0x6c1a('0x2b'),'basename',_0x6c1a('0x56'),_0x6c1a('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x26376c,null))[_0x6c1a('0x25')](function(_0x4e975d){if(_0x4e975d){if(!fs['existsSync'](path[_0x6c1a('0x58')](config[_0x6c1a('0x59')],_0x6c1a('0x5a'),_0x4e975d[_0x6c1a('0x56')]))){throw new db['Sequelize'][(_0x6c1a('0x5b'))](_0x6c1a('0x5c'));}if(_0x423fce[_0x6c1a('0x33')]['exists']){return _0x26376c[_0x6c1a('0x28')](0xc8);}return _0x26376c['download'](path['join'](config[_0x6c1a('0x59')],'server/files/reports',_0x4e975d[_0x6c1a('0x56')]),util['format'](_0x6c1a('0x5d'),_0x4e975d[_0x6c1a('0x5e')]||_0x4e975d[_0x6c1a('0x2b')],_0x4e975d[_0x6c1a('0x57')][_0x6c1a('0x5f')]()));}})['catch'](handleError(_0x26376c,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7729b7c..8ec6086 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 _0x3f68=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','moment','path','../../config/environment'];(function(_0x5a723b,_0x31eac3){var _0x475a83=function(_0x5bcf41){while(--_0x5bcf41){_0x5a723b['push'](_0x5a723b['shift']());}};_0x475a83(++_0x31eac3);}(_0x3f68,0x13a));var _0x83f6=function(_0x629c0a,_0x12c1cf){_0x629c0a=_0x629c0a-0x0;var _0x30ca16=_0x3f68[_0x629c0a];return _0x30ca16;};'use strict';var _=require(_0x83f6('0x0'));var util=require('util');var logger=require(_0x83f6('0x1'))(_0x83f6('0x2'));var moment=require(_0x83f6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x83f6('0x4'));var rimraf=require('rimraf');var config=require(_0x83f6('0x5'));var attributes=require(_0x83f6('0x6'));module[_0x83f6('0x7')]=function(_0x194662,_0x500d50){return _0x194662[_0x83f6('0x8')](_0x83f6('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2261=['bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x35c817,_0x53e6a5){var _0xbc0a55=function(_0x43d9bd){while(--_0x43d9bd){_0x35c817['push'](_0x35c817['shift']());}};_0xbc0a55(++_0x53e6a5);}(_0x2261,0x7d));var _0x1226=function(_0x47af7f,_0x116e95){_0x47af7f=_0x47af7f-0x0;var _0x5a62f9=_0x2261[_0x47af7f];return _0x5a62f9;};'use strict';var _=require(_0x1226('0x0'));var util=require(_0x1226('0x1'));var logger=require(_0x1226('0x2'))(_0x1226('0x3'));var moment=require(_0x1226('0x4'));var BPromise=require(_0x1226('0x5'));var rp=require(_0x1226('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1226('0x7'));var config=require(_0x1226('0x8'));var attributes=require(_0x1226('0x9'));module['exports']=function(_0x3bdb21,_0x7bae98){return _0x3bdb21[_0x1226('0xa')](_0x1226('0xb'),attributes,{'tableName':_0x1226('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 8263ba5..670fc8b 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 _0xb63b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xb63b,0x106));var _0xbb63=function(_0x29e218,_0x868444){_0x29e218=_0x29e218-0x0;var _0x310fb8=_0xb63b[_0x29e218];return _0x310fb8;};'use strict';var _=require(_0xbb63('0x0'));var util=require(_0xbb63('0x1'));var moment=require(_0xbb63('0x2'));var BPromise=require(_0xbb63('0x3'));var rs=require(_0xbb63('0x4'));var fs=require('fs');var Redis=require(_0xbb63('0x5'));var db=require(_0xbb63('0x6'))['db'];var utils=require(_0xbb63('0x7'));var logger=require(_0xbb63('0x8'))('rpc');var config=require(_0xbb63('0x9'));var jayson=require(_0xbb63('0xa'));var client=jayson[_0xbb63('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x430c99,_0x3d9a85,_0x213068){return new BPromise(function(_0x29ed7c,_0x6167d8){return client[_0xbb63('0xc')](_0x430c99,_0x213068)[_0xbb63('0xd')](function(_0x134ce8){logger[_0xbb63('0xe')](_0xbb63('0xf'),_0x3d9a85,_0xbb63('0x10'));logger[_0xbb63('0x11')](_0xbb63('0x12'),_0x3d9a85,'request\x20sent',JSON['stringify'](_0x134ce8));if(_0x134ce8[_0xbb63('0x13')]){if(_0x134ce8['error'][_0xbb63('0x14')]===0x1f4){logger[_0xbb63('0x13')](_0xbb63('0xf'),_0x3d9a85,_0x134ce8[_0xbb63('0x13')][_0xbb63('0x15')]);return _0x6167d8(_0x134ce8[_0xbb63('0x13')][_0xbb63('0x15')]);}logger[_0xbb63('0x13')](_0xbb63('0xf'),_0x3d9a85,_0x134ce8[_0xbb63('0x13')][_0xbb63('0x15')]);return _0x29ed7c(_0x134ce8[_0xbb63('0x13')]['message']);}else{logger['info'](_0xbb63('0xf'),_0x3d9a85,_0xbb63('0x10'));_0x29ed7c(_0x134ce8[_0xbb63('0x16')]['message']);}})[_0xbb63('0x17')](function(_0xe2573c){logger[_0xbb63('0x13')](_0xbb63('0xf'),_0x3d9a85,_0xe2573c);_0x6167d8(_0xe2573c);});});}
\ No newline at end of file
+var _0xd6f7=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0xa840a9,_0x231941){var _0x3f7029=function(_0x480fa7){while(--_0x480fa7){_0xa840a9['push'](_0xa840a9['shift']());}};_0x3f7029(++_0x231941);}(_0xd6f7,0xed));var _0x7d6f=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0xd6f7[_0x301c34];return _0x1a8c5a;};'use strict';var _=require(_0x7d6f('0x0'));var util=require(_0x7d6f('0x1'));var moment=require(_0x7d6f('0x2'));var BPromise=require(_0x7d6f('0x3'));var rs=require(_0x7d6f('0x4'));var fs=require('fs');var Redis=require(_0x7d6f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d6f('0x6'));var logger=require('../../config/logger')(_0x7d6f('0x7'));var config=require(_0x7d6f('0x8'));var jayson=require(_0x7d6f('0x9'));var client=jayson[_0x7d6f('0xa')][_0x7d6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe5f837,_0x5aef59,_0xc5f0be){return new BPromise(function(_0x31b9a9,_0x1ebcb3){return client[_0x7d6f('0xc')](_0xe5f837,_0xc5f0be)[_0x7d6f('0xd')](function(_0x4884d2){logger[_0x7d6f('0xe')](_0x7d6f('0xf'),_0x5aef59,_0x7d6f('0x10'));logger[_0x7d6f('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5aef59,_0x7d6f('0x10'),JSON[_0x7d6f('0x12')](_0x4884d2));if(_0x4884d2[_0x7d6f('0x13')]){if(_0x4884d2[_0x7d6f('0x13')]['code']===0x1f4){logger[_0x7d6f('0x13')](_0x7d6f('0xf'),_0x5aef59,_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);return _0x1ebcb3(_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);}logger['error'](_0x7d6f('0xf'),_0x5aef59,_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);return _0x31b9a9(_0x4884d2[_0x7d6f('0x13')][_0x7d6f('0x14')]);}else{logger[_0x7d6f('0xe')](_0x7d6f('0xf'),_0x5aef59,_0x7d6f('0x10'));_0x31b9a9(_0x4884d2[_0x7d6f('0x15')][_0x7d6f('0x14')]);}})[_0x7d6f('0x16')](function(_0x39e631){logger[_0x7d6f('0x13')](_0x7d6f('0xf'),_0x5aef59,_0x39e631);_0x1ebcb3(_0x39e631);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 1235edd..f59d01b 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 _0x23ed=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','isAuthenticated','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x23ed,0x126));var _0xd23e=function(_0x1f6fd1,_0x4a5bb7){_0x1f6fd1=_0x1f6fd1-0x0;var _0x1c5fd5=_0x23ed[_0x1f6fd1];return _0x1c5fd5;};'use strict';var multer=require(_0xd23e('0x0'));var util=require(_0xd23e('0x1'));var path=require(_0xd23e('0x2'));var timeout=require(_0xd23e('0x3'));var express=require('express');var router=express[_0xd23e('0x4')]();var fs_extra=require(_0xd23e('0x5'));var auth=require(_0xd23e('0x6'));var interaction=require(_0xd23e('0x7'));var config=require(_0xd23e('0x8'));var controller=require(_0xd23e('0x9'));router[_0xd23e('0xa')]('/',auth['isAuthenticated'](),controller[_0xd23e('0xb')]);router[_0xd23e('0xa')]('/:id',auth[_0xd23e('0xc')](),controller['show']);router[_0xd23e('0xa')](_0xd23e('0xd'),auth['isAuthenticated'](),controller[_0xd23e('0xe')]);router[_0xd23e('0xf')]('/',auth[_0xd23e('0xc')](),controller[_0xd23e('0x10')]);router[_0xd23e('0x11')](_0xd23e('0x12'),auth[_0xd23e('0xc')](),controller[_0xd23e('0x13')]);router[_0xd23e('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd23e('0x15')]);module[_0xd23e('0x16')]=router;
\ No newline at end of file
+var _0x03ac=['download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','show','/:id/download','isAuthenticated'];(function(_0x22f373,_0xfe4768){var _0x1da590=function(_0x187492){while(--_0x187492){_0x22f373['push'](_0x22f373['shift']());}};_0x1da590(++_0xfe4768);}(_0x03ac,0xfa));var _0xc03a=function(_0x528b29,_0x1b9d72){_0x528b29=_0x528b29-0x0;var _0x34e6c5=_0x03ac[_0x528b29];return _0x34e6c5;};'use strict';var multer=require(_0xc03a('0x0'));var util=require(_0xc03a('0x1'));var path=require(_0xc03a('0x2'));var timeout=require(_0xc03a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc03a('0x4'));var auth=require(_0xc03a('0x5'));var interaction=require(_0xc03a('0x6'));var config=require(_0xc03a('0x7'));var controller=require(_0xc03a('0x8'));router[_0xc03a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc03a('0xa'),auth['isAuthenticated'](),controller[_0xc03a('0xb')]);router[_0xc03a('0x9')](_0xc03a('0xc'),auth[_0xc03a('0xd')](),controller[_0xc03a('0xe')]);router[_0xc03a('0xf')]('/',auth[_0xc03a('0xd')](),controller[_0xc03a('0x10')]);router[_0xc03a('0x11')](_0xc03a('0xa'),auth['isAuthenticated'](),controller[_0xc03a('0x12')]);router[_0xc03a('0x13')](_0xc03a('0xa'),auth[_0xc03a('0xd')](),controller[_0xc03a('0x14')]);module[_0xc03a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3cbea14..523050d 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 _0x8475=['TEXT','STRING','BOOLEAN','exports'];(function(_0x46dcf3,_0x3dc151){var _0x48d3ca=function(_0x262f26){while(--_0x262f26){_0x46dcf3['push'](_0x46dcf3['shift']());}};_0x48d3ca(++_0x3dc151);}(_0x8475,0x18f));var _0x5847=function(_0x25758a,_0x5b2dbc){_0x25758a=_0x25758a-0x0;var _0x92822d=_0x8475[_0x25758a];return _0x92822d;};'use strict';var Sequelize=require('sequelize');module[_0x5847('0x0')]={'field':{'type':Sequelize[_0x5847('0x1')]},'alias':{'type':Sequelize[_0x5847('0x2')]},'function':{'type':Sequelize[_0x5847('0x2')]},'format':{'type':Sequelize[_0x5847('0x2')]},'groupBy':{'type':Sequelize[_0x5847('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5847('0x2')]},'custom':{'type':Sequelize[_0x5847('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xef31=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4117bd,_0x54c2b8){var _0x376d67=function(_0x48e8ea){while(--_0x48e8ea){_0x4117bd['push'](_0x4117bd['shift']());}};_0x376d67(++_0x54c2b8);}(_0xef31,0x17a));var _0x1ef3=function(_0x1c2b85,_0x3d3ca2){_0x1c2b85=_0x1c2b85-0x0;var _0x598796=_0xef31[_0x1c2b85];return _0x598796;};'use strict';var Sequelize=require(_0x1ef3('0x0'));module[_0x1ef3('0x1')]={'field':{'type':Sequelize[_0x1ef3('0x2')]},'alias':{'type':Sequelize[_0x1ef3('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1ef3('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1ef3('0x3')]},'custom':{'type':Sequelize[_0x1ef3('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 0b0fc2f..aa44344 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 _0xf6c4=['bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','name','options','include','findAll','rows','catch','show','params','includeAll','create','body','bulkCreate','find'];(function(_0x27ba2c,_0xa760f4){var _0x2c09eb=function(_0x58b65a){while(--_0x58b65a){_0x27ba2c['push'](_0x27ba2c['shift']());}};_0x2c09eb(++_0xa760f4);}(_0xf6c4,0x1df));var _0x4f6c=function(_0x32dffe,_0x2c6d36){_0x32dffe=_0x32dffe-0x0;var _0x1f6d1e=_0xf6c4[_0x32dffe];return _0x1f6d1e;};'use strict';var emlformat=require(_0x4f6c('0x0'));var rimraf=require(_0x4f6c('0x1'));var zipdir=require(_0x4f6c('0x2'));var jsonpatch=require(_0x4f6c('0x3'));var rp=require('request-promise');var moment=require(_0x4f6c('0x4'));var BPromise=require(_0x4f6c('0x5'));var Mustache=require(_0x4f6c('0x6'));var util=require(_0x4f6c('0x7'));var path=require(_0x4f6c('0x8'));var sox=require(_0x4f6c('0x9'));var csv=require(_0x4f6c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f6c('0xb'));var _=require(_0x4f6c('0xc'));var squel=require('squel');var crypto=require(_0x4f6c('0xd'));var jsforce=require(_0x4f6c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4f6c('0xf'));var Papa=require(_0x4f6c('0x10'));var Redis=require(_0x4f6c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4f6c('0x12'));var as=require(_0x4f6c('0x13'));var hardwareService=require(_0x4f6c('0x14'));var logger=require(_0x4f6c('0x15'))(_0x4f6c('0x16'));var utils=require(_0x4f6c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4f6c('0x18'));var db=require(_0x4f6c('0x19'))['db'];function respondWithStatusCode(_0x418344,_0x3f8b87){_0x3f8b87=_0x3f8b87||0xcc;return function(_0xd84ea6){if(_0xd84ea6){return _0x418344[_0x4f6c('0x1a')](_0x3f8b87);}return _0x418344[_0x4f6c('0x1b')](_0x3f8b87)[_0x4f6c('0x1c')]();};}function respondWithResult(_0x98fd91,_0x1da8b0){_0x1da8b0=_0x1da8b0||0xc8;return function(_0x4e8593){if(_0x4e8593){return _0x98fd91[_0x4f6c('0x1b')](_0x1da8b0)[_0x4f6c('0x1d')](_0x4e8593);}};}function respondWithFilteredResult(_0x338e35,_0x47d159){return function(_0x18c5ca){if(_0x18c5ca){var _0xa0650a=typeof _0x47d159[_0x4f6c('0x1e')]===_0x4f6c('0x1f')&&typeof _0x47d159[_0x4f6c('0x20')]===_0x4f6c('0x1f');var _0x570663=_0x18c5ca[_0x4f6c('0x21')];var _0x5bf655=_0xa0650a?0x0:_0x47d159[_0x4f6c('0x1e')];var _0x5db133=_0xa0650a?_0x18c5ca[_0x4f6c('0x21')]:_0x47d159[_0x4f6c('0x1e')]+_0x47d159[_0x4f6c('0x20')];var _0x29b271;if(_0x5db133>=_0x570663){_0x5db133=_0x570663;_0x29b271=0xc8;}else{_0x29b271=0xce;}_0x338e35[_0x4f6c('0x1b')](_0x29b271);return _0x338e35['set']('Content-Range',_0x5bf655+'-'+_0x5db133+'/'+_0x570663)[_0x4f6c('0x1d')](_0x18c5ca);}return null;};}function patchUpdates(_0x305f46){return function(_0x44d2c5){try{jsonpatch[_0x4f6c('0x22')](_0x44d2c5,_0x305f46,!![]);}catch(_0x7d6e24){return BPromise[_0x4f6c('0x23')](_0x7d6e24);}return _0x44d2c5[_0x4f6c('0x24')]();};}function saveUpdates(_0x58e9de,_0x7c124){return function(_0x569e62){if(_0x569e62){return _0x569e62[_0x4f6c('0x25')](_0x58e9de)['then'](function(_0x1ce493){return _0x1ce493;});}return null;};}function removeEntity(_0x57a5b6,_0x34226d){return function(_0xb39725){if(_0xb39725){return _0xb39725[_0x4f6c('0x26')]()[_0x4f6c('0x27')](function(){_0x57a5b6[_0x4f6c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454c8a,_0x3ca289){return function(_0x44d335){if(!_0x44d335){_0x454c8a[_0x4f6c('0x1a')](0x194);}return _0x44d335;};}function handleError(_0x1780c4,_0xd9d31f){_0xd9d31f=_0xd9d31f||0x1f4;return function(_0x450408){logger[_0x4f6c('0x28')](_0x450408[_0x4f6c('0x29')]);if(_0x450408['name']){delete _0x450408['name'];}_0x1780c4[_0x4f6c('0x1b')](_0xd9d31f)['send'](_0x450408);};}exports['index']=function(_0x34fd1d,_0x1209af){var _0x5613a9={},_0x246b88={},_0x26044e={'count':0x0,'rows':[]};var _0x430604=_['map'](db[_0x4f6c('0x2a')][_0x4f6c('0x2b')],function(_0x30b4da){return{'name':_0x30b4da[_0x4f6c('0x2c')],'type':_0x30b4da[_0x4f6c('0x2d')][_0x4f6c('0x2e')]};});_0x246b88['model']=_[_0x4f6c('0x2f')](_0x430604,'name');_0x246b88[_0x4f6c('0x30')]=_[_0x4f6c('0x31')](_0x34fd1d['query']);_0x246b88[_0x4f6c('0x32')]=_[_0x4f6c('0x33')](_0x246b88[_0x4f6c('0x34')],_0x246b88['query']);_0x5613a9[_0x4f6c('0x35')]=_['intersection'](_0x246b88[_0x4f6c('0x34')],qs[_0x4f6c('0x36')](_0x34fd1d['query']['fields']));_0x5613a9[_0x4f6c('0x35')]=_0x5613a9['attributes'][_0x4f6c('0x37')]?_0x5613a9[_0x4f6c('0x35')]:_0x246b88[_0x4f6c('0x34')];if(!_0x34fd1d[_0x4f6c('0x30')][_0x4f6c('0x38')](_0x4f6c('0x39'))){_0x5613a9[_0x4f6c('0x20')]=qs['limit'](_0x34fd1d[_0x4f6c('0x30')][_0x4f6c('0x20')]);_0x5613a9[_0x4f6c('0x1e')]=qs['offset'](_0x34fd1d['query'][_0x4f6c('0x1e')]);}_0x5613a9[_0x4f6c('0x3a')]=qs['sort'](_0x34fd1d[_0x4f6c('0x30')]['sort']);_0x5613a9[_0x4f6c('0x3b')]=qs[_0x4f6c('0x32')](_['pick'](_0x34fd1d[_0x4f6c('0x30')],_0x246b88['filters']),_0x430604);if(_0x34fd1d[_0x4f6c('0x30')]['filter']){_0x5613a9[_0x4f6c('0x3b')]=_[_0x4f6c('0x3c')](_0x5613a9['where'],{'$or':_[_0x4f6c('0x2f')](_0x430604,function(_0x35cff1){if(_0x35cff1[_0x4f6c('0x2d')]!=='VIRTUAL'){var _0x4ad6fe={};_0x4ad6fe[_0x35cff1[_0x4f6c('0x3d')]]={'$like':'%'+_0x34fd1d['query']['filter']+'%'};return _0x4ad6fe;}})});}_0x5613a9=_[_0x4f6c('0x3c')]({},_0x5613a9,_0x34fd1d[_0x4f6c('0x3e')]);var _0x483d28={'where':_0x5613a9[_0x4f6c('0x3b')]};return db[_0x4f6c('0x2a')][_0x4f6c('0x21')](_0x483d28)[_0x4f6c('0x27')](function(_0x39e09a){_0x26044e[_0x4f6c('0x21')]=_0x39e09a;if(_0x34fd1d[_0x4f6c('0x30')]['includeAll']){_0x5613a9[_0x4f6c('0x3f')]=[{'all':!![]}];}return db[_0x4f6c('0x2a')][_0x4f6c('0x40')](_0x5613a9);})[_0x4f6c('0x27')](function(_0x35374d){_0x26044e[_0x4f6c('0x41')]=_0x35374d;return _0x26044e;})[_0x4f6c('0x27')](respondWithFilteredResult(_0x1209af,_0x5613a9))[_0x4f6c('0x42')](handleError(_0x1209af,null));};exports[_0x4f6c('0x43')]=function(_0x32cfbc,_0x449016){var _0x1f14e4={'raw':![],'where':{'id':_0x32cfbc[_0x4f6c('0x44')]['id']}},_0x255631={};_0x255631[_0x4f6c('0x34')]=_['keys'](db[_0x4f6c('0x2a')][_0x4f6c('0x2b')]);_0x255631[_0x4f6c('0x30')]=_[_0x4f6c('0x31')](_0x32cfbc[_0x4f6c('0x30')]);_0x255631[_0x4f6c('0x32')]=_['intersection'](_0x255631[_0x4f6c('0x34')],_0x255631[_0x4f6c('0x30')]);_0x1f14e4[_0x4f6c('0x35')]=_[_0x4f6c('0x33')](_0x255631[_0x4f6c('0x34')],qs[_0x4f6c('0x36')](_0x32cfbc[_0x4f6c('0x30')][_0x4f6c('0x36')]));_0x1f14e4[_0x4f6c('0x35')]=_0x1f14e4[_0x4f6c('0x35')][_0x4f6c('0x37')]?_0x1f14e4[_0x4f6c('0x35')]:_0x255631[_0x4f6c('0x34')];if(_0x32cfbc['query'][_0x4f6c('0x45')]){_0x1f14e4[_0x4f6c('0x3f')]=[{'all':!![]}];}_0x1f14e4=_[_0x4f6c('0x3c')]({},_0x1f14e4,_0x32cfbc[_0x4f6c('0x3e')]);return db['AnalyticFieldReport']['find'](_0x1f14e4)[_0x4f6c('0x27')](handleEntityNotFound(_0x449016,null))[_0x4f6c('0x27')](respondWithResult(_0x449016,null))['catch'](handleError(_0x449016,null));};exports[_0x4f6c('0x46')]=function(_0x24c60d,_0x45e87d){return db[_0x4f6c('0x2a')][_0x4f6c('0x46')](_0x24c60d[_0x4f6c('0x47')],{})[_0x4f6c('0x27')](respondWithResult(_0x45e87d,0xc9))[_0x4f6c('0x42')](handleError(_0x45e87d,null));};exports[_0x4f6c('0x48')]=function(_0x1cf850,_0x3fbff0){return db[_0x4f6c('0x2a')][_0x4f6c('0x48')](_0x1cf850[_0x4f6c('0x47')],{'raw':![],'individualHooks':!![]})[_0x4f6c('0x27')](respondWithResult(_0x3fbff0,0xc9))['catch'](handleError(_0x3fbff0,null));};exports[_0x4f6c('0x25')]=function(_0x1dd4ba,_0x4fff9e){if(_0x1dd4ba[_0x4f6c('0x47')]['id']){delete _0x1dd4ba[_0x4f6c('0x47')]['id'];}return db[_0x4f6c('0x2a')]['find']({'where':{'id':_0x1dd4ba[_0x4f6c('0x44')]['id']}})[_0x4f6c('0x27')](handleEntityNotFound(_0x4fff9e,null))['then'](saveUpdates(_0x1dd4ba[_0x4f6c('0x47')],null))[_0x4f6c('0x27')](respondWithResult(_0x4fff9e,null))['catch'](handleError(_0x4fff9e,null));};exports['destroy']=function(_0x542d26,_0x102c71){return db[_0x4f6c('0x2a')][_0x4f6c('0x49')]({'where':{'id':_0x542d26[_0x4f6c('0x44')]['id']}})[_0x4f6c('0x27')](handleEntityNotFound(_0x102c71,null))[_0x4f6c('0x27')](removeEntity(_0x102c71,null))[_0x4f6c('0x42')](handleError(_0x102c71,null));};exports[_0x4f6c('0x4a')]=function(_0xa1acb,_0x392260){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0xa1acb['query'][_0x4f6c('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x4f6c('0x27')](respondWithResult(_0x392260,0xcc))[_0x4f6c('0x42')](handleError(_0x392260,null));};exports['addFields']=function(_0x537da0,_0xe3baea,_0x266772){return db[_0x4f6c('0x4c')][_0x4f6c('0x4d')]({'where':{'id':_0x537da0['params']['id']}})[_0x4f6c('0x27')](handleEntityNotFound(_0xe3baea,null))[_0x4f6c('0x27')](function(_0x350836){if(_0x350836){return db[_0x4f6c('0x4e')]['transaction'](function(_0x767dd5){return db[_0x4f6c('0x2a')][_0x4f6c('0x26')]({'where':{'CustomReportId':_0x537da0['params']['id']},'transaction':_0x767dd5})['then'](function(_0x377f6c){var _0x35b3fb=_[_0x4f6c('0x2f')](_0x537da0[_0x4f6c('0x47')],function(_0x41e64b){delete _0x41e64b['id'];_0x41e64b['CustomReportId']=_0x537da0[_0x4f6c('0x44')]['id'];return _0x41e64b;});return db['AnalyticFieldReport']['bulkCreate'](_0x35b3fb,{'transaction':_0x767dd5});});})[_0x4f6c('0x27')](function(){return db[_0x4f6c('0x2a')][_0x4f6c('0x40')]({'where':{'CustomReportId':_0x537da0[_0x4f6c('0x44')]['id']}});});}})[_0x4f6c('0x27')](respondWithResult(_0xe3baea,null))[_0x4f6c('0x42')](handleError(_0xe3baea,null));};
\ No newline at end of file
+var _0x6d42=['findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','includeAll','include','catch','show','params','options','find','create','body','bulkCreate','ids','AnalyticCustomReport','findOne','sequelize','transaction','map','CustomReportId'];(function(_0x524eae,_0x418e7c){var _0x2635b9=function(_0x5d2c9f){while(--_0x5d2c9f){_0x524eae['push'](_0x524eae['shift']());}};_0x2635b9(++_0x418e7c);}(_0x6d42,0x151));var _0x26d4=function(_0x4b61fa,_0x428814){_0x4b61fa=_0x4b61fa-0x0;var _0x51c27d=_0x6d42[_0x4b61fa];return _0x51c27d;};'use strict';var emlformat=require(_0x26d4('0x0'));var rimraf=require(_0x26d4('0x1'));var zipdir=require(_0x26d4('0x2'));var jsonpatch=require(_0x26d4('0x3'));var rp=require(_0x26d4('0x4'));var moment=require(_0x26d4('0x5'));var BPromise=require(_0x26d4('0x6'));var Mustache=require(_0x26d4('0x7'));var util=require(_0x26d4('0x8'));var path=require(_0x26d4('0x9'));var sox=require(_0x26d4('0xa'));var csv=require(_0x26d4('0xb'));var ejs=require(_0x26d4('0xc'));var fs=require('fs');var fs_extra=require(_0x26d4('0xd'));var _=require(_0x26d4('0xe'));var squel=require(_0x26d4('0xf'));var crypto=require('crypto');var jsforce=require(_0x26d4('0x10'));var deskjs=require(_0x26d4('0x11'));var toCsv=require(_0x26d4('0xb'));var querystring=require(_0x26d4('0x12'));var Papa=require('papaparse');var Redis=require(_0x26d4('0x13'));var authService=require(_0x26d4('0x14'));var qs=require(_0x26d4('0x15'));var as=require(_0x26d4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26d4('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x26d4('0x18'));var licenseUtil=require(_0x26d4('0x19'));var db=require(_0x26d4('0x1a'))['db'];function respondWithStatusCode(_0xed26f4,_0x3c7a73){_0x3c7a73=_0x3c7a73||0xcc;return function(_0x1dea7e){if(_0x1dea7e){return _0xed26f4[_0x26d4('0x1b')](_0x3c7a73);}return _0xed26f4[_0x26d4('0x1c')](_0x3c7a73)[_0x26d4('0x1d')]();};}function respondWithResult(_0x5636df,_0x1ff05d){_0x1ff05d=_0x1ff05d||0xc8;return function(_0x4adad4){if(_0x4adad4){return _0x5636df[_0x26d4('0x1c')](_0x1ff05d)[_0x26d4('0x1e')](_0x4adad4);}};}function respondWithFilteredResult(_0x15f7c0,_0x4fef30){return function(_0x474d12){if(_0x474d12){var _0x2ed591=typeof _0x4fef30[_0x26d4('0x1f')]===_0x26d4('0x20')&&typeof _0x4fef30['limit']===_0x26d4('0x20');var _0x5c7eb9=_0x474d12['count'];var _0x44566e=_0x2ed591?0x0:_0x4fef30[_0x26d4('0x1f')];var _0x2ff6e9=_0x2ed591?_0x474d12[_0x26d4('0x21')]:_0x4fef30[_0x26d4('0x1f')]+_0x4fef30['limit'];var _0x22fef3;if(_0x2ff6e9>=_0x5c7eb9){_0x2ff6e9=_0x5c7eb9;_0x22fef3=0xc8;}else{_0x22fef3=0xce;}_0x15f7c0[_0x26d4('0x1c')](_0x22fef3);return _0x15f7c0[_0x26d4('0x22')](_0x26d4('0x23'),_0x44566e+'-'+_0x2ff6e9+'/'+_0x5c7eb9)[_0x26d4('0x1e')](_0x474d12);}return null;};}function patchUpdates(_0x1a0621){return function(_0x453e18){try{jsonpatch['apply'](_0x453e18,_0x1a0621,!![]);}catch(_0x227eb0){return BPromise[_0x26d4('0x24')](_0x227eb0);}return _0x453e18[_0x26d4('0x25')]();};}function saveUpdates(_0xf06204,_0x48d4c8){return function(_0x4e04d9){if(_0x4e04d9){return _0x4e04d9[_0x26d4('0x26')](_0xf06204)['then'](function(_0x29e440){return _0x29e440;});}return null;};}function removeEntity(_0x17d7c4,_0x267cdb){return function(_0x3a1d5e){if(_0x3a1d5e){return _0x3a1d5e[_0x26d4('0x27')]()[_0x26d4('0x28')](function(){_0x17d7c4[_0x26d4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x144d6f,_0x2ed92c){return function(_0x49bc0b){if(!_0x49bc0b){_0x144d6f[_0x26d4('0x1b')](0x194);}return _0x49bc0b;};}function handleError(_0x7a14a3,_0x42d9c1){_0x42d9c1=_0x42d9c1||0x1f4;return function(_0x370586){logger[_0x26d4('0x29')](_0x370586[_0x26d4('0x2a')]);if(_0x370586[_0x26d4('0x2b')]){delete _0x370586[_0x26d4('0x2b')];}_0x7a14a3[_0x26d4('0x1c')](_0x42d9c1)[_0x26d4('0x2c')](_0x370586);};}exports[_0x26d4('0x2d')]=function(_0x41567a,_0x5db4a1){var _0x537431={},_0x4ce3ce={},_0x14d481={'count':0x0,'rows':[]};var _0x2167ef=_['map'](db[_0x26d4('0x2e')][_0x26d4('0x2f')],function(_0x4e3676){return{'name':_0x4e3676[_0x26d4('0x30')],'type':_0x4e3676[_0x26d4('0x31')][_0x26d4('0x32')]};});_0x4ce3ce[_0x26d4('0x33')]=_['map'](_0x2167ef,_0x26d4('0x2b'));_0x4ce3ce[_0x26d4('0x34')]=_[_0x26d4('0x35')](_0x41567a['query']);_0x4ce3ce[_0x26d4('0x36')]=_[_0x26d4('0x37')](_0x4ce3ce[_0x26d4('0x33')],_0x4ce3ce[_0x26d4('0x34')]);_0x537431[_0x26d4('0x38')]=_[_0x26d4('0x37')](_0x4ce3ce['model'],qs[_0x26d4('0x39')](_0x41567a[_0x26d4('0x34')][_0x26d4('0x39')]));_0x537431[_0x26d4('0x38')]=_0x537431[_0x26d4('0x38')][_0x26d4('0x3a')]?_0x537431[_0x26d4('0x38')]:_0x4ce3ce[_0x26d4('0x33')];if(!_0x41567a[_0x26d4('0x34')]['hasOwnProperty'](_0x26d4('0x3b'))){_0x537431[_0x26d4('0x3c')]=qs['limit'](_0x41567a[_0x26d4('0x34')][_0x26d4('0x3c')]);_0x537431[_0x26d4('0x1f')]=qs[_0x26d4('0x1f')](_0x41567a['query'][_0x26d4('0x1f')]);}_0x537431[_0x26d4('0x3d')]=qs[_0x26d4('0x3e')](_0x41567a[_0x26d4('0x34')][_0x26d4('0x3e')]);_0x537431[_0x26d4('0x3f')]=qs['filters'](_[_0x26d4('0x40')](_0x41567a[_0x26d4('0x34')],_0x4ce3ce[_0x26d4('0x36')]),_0x2167ef);if(_0x41567a[_0x26d4('0x34')]['filter']){_0x537431[_0x26d4('0x3f')]=_[_0x26d4('0x41')](_0x537431[_0x26d4('0x3f')],{'$or':_['map'](_0x2167ef,function(_0x556354){if(_0x556354['type']!=='VIRTUAL'){var _0x2182d4={};_0x2182d4[_0x556354['name']]={'$like':'%'+_0x41567a['query']['filter']+'%'};return _0x2182d4;}})});}_0x537431=_[_0x26d4('0x41')]({},_0x537431,_0x41567a['options']);var _0x1bb07a={'where':_0x537431[_0x26d4('0x3f')]};return db[_0x26d4('0x2e')]['count'](_0x1bb07a)[_0x26d4('0x28')](function(_0x2ba7e4){_0x14d481['count']=_0x2ba7e4;if(_0x41567a['query'][_0x26d4('0x42')]){_0x537431[_0x26d4('0x43')]=[{'all':!![]}];}return db[_0x26d4('0x2e')]['findAll'](_0x537431);})[_0x26d4('0x28')](function(_0x123b27){_0x14d481['rows']=_0x123b27;return _0x14d481;})[_0x26d4('0x28')](respondWithFilteredResult(_0x5db4a1,_0x537431))[_0x26d4('0x44')](handleError(_0x5db4a1,null));};exports[_0x26d4('0x45')]=function(_0x3242d1,_0x2f1e48){var _0x108843={'raw':![],'where':{'id':_0x3242d1[_0x26d4('0x46')]['id']}},_0x4d7ee5={};_0x4d7ee5[_0x26d4('0x33')]=_[_0x26d4('0x35')](db[_0x26d4('0x2e')][_0x26d4('0x2f')]);_0x4d7ee5[_0x26d4('0x34')]=_[_0x26d4('0x35')](_0x3242d1[_0x26d4('0x34')]);_0x4d7ee5[_0x26d4('0x36')]=_[_0x26d4('0x37')](_0x4d7ee5[_0x26d4('0x33')],_0x4d7ee5[_0x26d4('0x34')]);_0x108843[_0x26d4('0x38')]=_[_0x26d4('0x37')](_0x4d7ee5['model'],qs['fields'](_0x3242d1[_0x26d4('0x34')][_0x26d4('0x39')]));_0x108843[_0x26d4('0x38')]=_0x108843[_0x26d4('0x38')][_0x26d4('0x3a')]?_0x108843[_0x26d4('0x38')]:_0x4d7ee5[_0x26d4('0x33')];if(_0x3242d1[_0x26d4('0x34')]['includeAll']){_0x108843[_0x26d4('0x43')]=[{'all':!![]}];}_0x108843=_['merge']({},_0x108843,_0x3242d1[_0x26d4('0x47')]);return db[_0x26d4('0x2e')][_0x26d4('0x48')](_0x108843)['then'](handleEntityNotFound(_0x2f1e48,null))['then'](respondWithResult(_0x2f1e48,null))[_0x26d4('0x44')](handleError(_0x2f1e48,null));};exports[_0x26d4('0x49')]=function(_0x3ebf4d,_0x7aa3d2){return db[_0x26d4('0x2e')]['create'](_0x3ebf4d[_0x26d4('0x4a')],{})[_0x26d4('0x28')](respondWithResult(_0x7aa3d2,0xc9))[_0x26d4('0x44')](handleError(_0x7aa3d2,null));};exports[_0x26d4('0x4b')]=function(_0x4a2f97,_0x28e907){return db[_0x26d4('0x2e')][_0x26d4('0x4b')](_0x4a2f97['body'],{'raw':![],'individualHooks':!![]})[_0x26d4('0x28')](respondWithResult(_0x28e907,0xc9))[_0x26d4('0x44')](handleError(_0x28e907,null));};exports['update']=function(_0x2ff8c4,_0x33b163){if(_0x2ff8c4[_0x26d4('0x4a')]['id']){delete _0x2ff8c4['body']['id'];}return db['AnalyticFieldReport'][_0x26d4('0x48')]({'where':{'id':_0x2ff8c4[_0x26d4('0x46')]['id']}})['then'](handleEntityNotFound(_0x33b163,null))[_0x26d4('0x28')](saveUpdates(_0x2ff8c4[_0x26d4('0x4a')],null))[_0x26d4('0x28')](respondWithResult(_0x33b163,null))[_0x26d4('0x44')](handleError(_0x33b163,null));};exports['destroy']=function(_0x5045c2,_0x1ef9b3){return db[_0x26d4('0x2e')][_0x26d4('0x48')]({'where':{'id':_0x5045c2[_0x26d4('0x46')]['id']}})[_0x26d4('0x28')](handleEntityNotFound(_0x1ef9b3,null))[_0x26d4('0x28')](removeEntity(_0x1ef9b3,null))[_0x26d4('0x44')](handleError(_0x1ef9b3,null));};exports['bulkDestroy']=function(_0x3e0f3c,_0x46cf40){return db[_0x26d4('0x2e')][_0x26d4('0x27')]({'where':{'id':_0x3e0f3c[_0x26d4('0x34')][_0x26d4('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x46cf40,0xcc))[_0x26d4('0x44')](handleError(_0x46cf40,null));};exports['addFields']=function(_0x2988d1,_0x157831,_0x1766ad){return db[_0x26d4('0x4d')][_0x26d4('0x4e')]({'where':{'id':_0x2988d1['params']['id']}})[_0x26d4('0x28')](handleEntityNotFound(_0x157831,null))['then'](function(_0x413063){if(_0x413063){return db[_0x26d4('0x4f')][_0x26d4('0x50')](function(_0x1b051c){return db[_0x26d4('0x2e')][_0x26d4('0x27')]({'where':{'CustomReportId':_0x2988d1[_0x26d4('0x46')]['id']},'transaction':_0x1b051c})['then'](function(_0x3ba655){var _0x2d4892=_[_0x26d4('0x51')](_0x2988d1[_0x26d4('0x4a')],function(_0x9aa4f4){delete _0x9aa4f4['id'];_0x9aa4f4[_0x26d4('0x52')]=_0x2988d1[_0x26d4('0x46')]['id'];return _0x9aa4f4;});return db[_0x26d4('0x2e')][_0x26d4('0x4b')](_0x2d4892,{'transaction':_0x1b051c});});})[_0x26d4('0x28')](function(){return db[_0x26d4('0x2e')][_0x26d4('0x53')]({'where':{'CustomReportId':_0x2988d1[_0x26d4('0x46')]['id']}});});}})[_0x26d4('0x28')](respondWithResult(_0x157831,null))['catch'](handleError(_0x157831,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3046624..4ae0cd3 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 _0xe582=['rimraf','../../config/environment','exports','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe582,0x130));var _0x2e58=function(_0xa522f,_0x5debbc){_0xa522f=_0xa522f-0x0;var _0x2083b0=_0xe582[_0xa522f];return _0x2083b0;};'use strict';var _=require(_0x2e58('0x0'));var util=require(_0x2e58('0x1'));var logger=require(_0x2e58('0x2'))(_0x2e58('0x3'));var moment=require(_0x2e58('0x4'));var BPromise=require(_0x2e58('0x5'));var rp=require(_0x2e58('0x6'));var fs=require('fs');var path=require(_0x2e58('0x7'));var rimraf=require(_0x2e58('0x8'));var config=require(_0x2e58('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0x2e58('0xa')]=function(_0x36fac5,_0x32d42d){return _0x36fac5['define'](_0x2e58('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0bf=['lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','analytics_report_fields'];(function(_0x27e502,_0x24cdc3){var _0x53967a=function(_0x426162){while(--_0x426162){_0x27e502['push'](_0x27e502['shift']());}};_0x53967a(++_0x24cdc3);}(_0xa0bf,0x104));var _0xfa0b=function(_0x106604,_0xf73447){_0x106604=_0x106604-0x0;var _0x26ddd8=_0xa0bf[_0x106604];return _0x26ddd8;};'use strict';var _=require(_0xfa0b('0x0'));var util=require(_0xfa0b('0x1'));var logger=require('../../config/logger')(_0xfa0b('0x2'));var moment=require(_0xfa0b('0x3'));var BPromise=require(_0xfa0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa0b('0x5'));var rimraf=require('rimraf');var config=require(_0xfa0b('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0xfa0b('0x7')]=function(_0x55c247,_0x58b2c3){return _0x55c247[_0xfa0b('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0xfa0b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index d5761fa..21dc5ce 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 _0xca51=['error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca51,0x196));var _0x1ca5=function(_0x58b63d,_0x2689f0){_0x58b63d=_0x58b63d-0x0;var _0x30738e=_0xca51[_0x58b63d];return _0x30738e;};'use strict';var _=require(_0x1ca5('0x0'));var util=require(_0x1ca5('0x1'));var moment=require(_0x1ca5('0x2'));var BPromise=require(_0x1ca5('0x3'));var rs=require(_0x1ca5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1ca5('0x5'));var logger=require(_0x1ca5('0x6'))('rpc');var config=require(_0x1ca5('0x7'));var jayson=require(_0x1ca5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e4c68,_0x52f7d2,_0xfd13f7){return new BPromise(function(_0x4f55d5,_0x23614c){return client[_0x1ca5('0x9')](_0x1e4c68,_0xfd13f7)[_0x1ca5('0xa')](function(_0x451974){logger[_0x1ca5('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52f7d2,_0x1ca5('0xc'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x52f7d2,'request\x20sent',JSON[_0x1ca5('0xd')](_0x451974));if(_0x451974[_0x1ca5('0xe')]){if(_0x451974[_0x1ca5('0xe')][_0x1ca5('0xf')]===0x1f4){logger[_0x1ca5('0xe')](_0x1ca5('0x10'),_0x52f7d2,_0x451974[_0x1ca5('0xe')][_0x1ca5('0x11')]);return _0x23614c(_0x451974[_0x1ca5('0xe')]['message']);}logger[_0x1ca5('0xe')](_0x1ca5('0x10'),_0x52f7d2,_0x451974['error'][_0x1ca5('0x11')]);return _0x4f55d5(_0x451974['error'][_0x1ca5('0x11')]);}else{logger[_0x1ca5('0xb')](_0x1ca5('0x10'),_0x52f7d2,_0x1ca5('0xc'));_0x4f55d5(_0x451974[_0x1ca5('0x12')]['message']);}})[_0x1ca5('0x13')](function(_0x10d983){logger['error'](_0x1ca5('0x10'),_0x52f7d2,_0x10d983);_0x23614c(_0x10d983);});});}
\ No newline at end of file
+var _0x8dd3=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x243b15,_0x48e5bb){var _0x13f58e=function(_0x1b93ba){while(--_0x1b93ba){_0x243b15['push'](_0x243b15['shift']());}};_0x13f58e(++_0x48e5bb);}(_0x8dd3,0x19a));var _0x38dd=function(_0x26601e,_0x139a4c){_0x26601e=_0x26601e-0x0;var _0x116282=_0x8dd3[_0x26601e];return _0x116282;};'use strict';var _=require('lodash');var util=require(_0x38dd('0x0'));var moment=require(_0x38dd('0x1'));var BPromise=require(_0x38dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x38dd('0x3'))['db'];var utils=require(_0x38dd('0x4'));var logger=require(_0x38dd('0x5'))(_0x38dd('0x6'));var config=require(_0x38dd('0x7'));var jayson=require(_0x38dd('0x8'));var client=jayson['client'][_0x38dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b4c6e,_0xd7e510,_0x18abdd){return new BPromise(function(_0x30c27e,_0x219051){return client[_0x38dd('0xa')](_0x5b4c6e,_0x18abdd)[_0x38dd('0xb')](function(_0x35971f){logger[_0x38dd('0xc')](_0x38dd('0xd'),_0xd7e510,'request\x20sent');logger['debug'](_0x38dd('0xe'),_0xd7e510,'request\x20sent',JSON[_0x38dd('0xf')](_0x35971f));if(_0x35971f[_0x38dd('0x10')]){if(_0x35971f['error'][_0x38dd('0x11')]===0x1f4){logger[_0x38dd('0x10')](_0x38dd('0xd'),_0xd7e510,_0x35971f['error'][_0x38dd('0x12')]);return _0x219051(_0x35971f[_0x38dd('0x10')]['message']);}logger[_0x38dd('0x10')](_0x38dd('0xd'),_0xd7e510,_0x35971f[_0x38dd('0x10')][_0x38dd('0x12')]);return _0x30c27e(_0x35971f[_0x38dd('0x10')][_0x38dd('0x12')]);}else{logger[_0x38dd('0xc')](_0x38dd('0xd'),_0xd7e510,_0x38dd('0x13'));_0x30c27e(_0x35971f[_0x38dd('0x14')]['message']);}})['catch'](function(_0x5d07c4){logger['error'](_0x38dd('0xd'),_0xd7e510,_0x5d07c4);_0x219051(_0x5d07c4);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b5dd39a..6f68b83 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(_0x1c064c,_0x28adb6){var _0x7c603b=function(_0x3a87ef){while(--_0x3a87ef){_0x1c064c['push'](_0x1c064c['shift']());}};_0x7c603b(++_0x28adb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x5e4151,_0xc1d194){var _0x25de8f=function(_0x5714ff){while(--_0x5714ff){_0x5e4151['push'](_0x5e4151['shift']());}};_0x25de8f(++_0xc1d194);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 a5b2944..6152910 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 _0x1ca7=['exports','TEXT','STRING','sequelize'];(function(_0x5ec655,_0x1b7d41){var _0x144c58=function(_0x4285dd){while(--_0x4285dd){_0x5ec655['push'](_0x5ec655['shift']());}};_0x144c58(++_0x1b7d41);}(_0x1ca7,0x157));var _0x71ca=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1ca7[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x71ca('0x0'));module[_0x71ca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x71ca('0x2')]},'description':{'type':Sequelize[_0x71ca('0x3')]}};
\ No newline at end of file
+var _0x5fc7=['TEXT','sequelize','exports','STRING','name'];(function(_0x511cb,_0x3e571b){var _0x267407=function(_0x3aa1b6){while(--_0x3aa1b6){_0x511cb['push'](_0x511cb['shift']());}};_0x267407(++_0x3e571b);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0x5fc7[_0x2c7dc6];return _0x10002b;};'use strict';var Sequelize=require(_0x75fc('0x0'));module[_0x75fc('0x1')]={'name':{'type':Sequelize[_0x75fc('0x2')],'allowNull':![],'unique':_0x75fc('0x3')},'table':{'type':Sequelize[_0x75fc('0x2')]},'metric':{'type':Sequelize[_0x75fc('0x4')]},'description':{'type':Sequelize[_0x75fc('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index d8b9cf4..6d21061 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x2c27be,_0x2a4f85){var _0x1da496=function(_0x2f829b){while(--_0x2f829b){_0x2c27be['push'](_0x2c27be['shift']());}};_0x1da496(++_0x2a4f85);}(_0x81bd,0x7c));var _0xd81b=function(_0x3541da,_0x5b2254){_0x3541da=_0x3541da-0x0;var _0xa24cff=_0x81bd[_0x3541da];return _0xa24cff;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x86c9d5,_0x41f245){var _0x5b6aab=function(_0x162a42){while(--_0x162a42){_0x86c9d5['push'](_0x86c9d5['shift']());}};_0x5b6aab(++_0x41f245);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5c7bb3d..65cff8a 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 _0xb5dd=['moment','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0x25db7e,_0x4c8eaa){var _0x1a6163=function(_0x3cb546){while(--_0x3cb546){_0x25db7e['push'](_0x25db7e['shift']());}};_0x1a6163(++_0x4c8eaa);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb5dd[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xdb5d('0x0'));var util=require(_0xdb5d('0x1'));var logger=require(_0xdb5d('0x2'))(_0xdb5d('0x3'));var moment=require(_0xdb5d('0x4'));var BPromise=require('bluebird');var rp=require(_0xdb5d('0x5'));var fs=require('fs');var path=require(_0xdb5d('0x6'));var rimraf=require(_0xdb5d('0x7'));var config=require('../../config/environment');var attributes=require(_0xdb5d('0x8'));module[_0xdb5d('0x9')]=function(_0x43afa8,_0x13996b){return _0x43afa8[_0xdb5d('0xa')](_0xdb5d('0xb'),attributes,{'tableName':_0xdb5d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc61d=['exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticMetric.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc61d,0xfb));var _0xdc61=function(_0x2d1556,_0x2b918c){_0x2d1556=_0x2d1556-0x0;var _0x5514a0=_0xc61d[_0x2d1556];return _0x5514a0;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var logger=require(_0xdc61('0x2'))(_0xdc61('0x3'));var moment=require(_0xdc61('0x4'));var BPromise=require(_0xdc61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc61('0x6'));var rimraf=require(_0xdc61('0x7'));var config=require('../../config/environment');var attributes=require(_0xdc61('0x8'));module[_0xdc61('0x9')]=function(_0xf7834c,_0x20eef5){return _0xf7834c[_0xdc61('0xa')](_0xdc61('0xb'),attributes,{'tableName':_0xdc61('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index b2ca0e8..9df41d1 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 _0xd32d=['jayson/promise','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x85268c,_0x4cf5a9){var _0x5b4df7=function(_0x4cdf04){while(--_0x4cdf04){_0x85268c['push'](_0x85268c['shift']());}};_0x5b4df7(++_0x4cf5a9);}(_0xd32d,0x91));var _0xdd32=function(_0x4de158,_0x34f440){_0x4de158=_0x4de158-0x0;var _0x214074=_0xd32d[_0x4de158];return _0x214074;};'use strict';var _=require(_0xdd32('0x0'));var util=require(_0xdd32('0x1'));var moment=require(_0xdd32('0x2'));var BPromise=require(_0xdd32('0x3'));var rs=require(_0xdd32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd32('0x5'))['db'];var utils=require(_0xdd32('0x6'));var logger=require(_0xdd32('0x7'))(_0xdd32('0x8'));var config=require('../../config/environment');var jayson=require(_0xdd32('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d7486,_0x58db92,_0x396cb3){return new BPromise(function(_0x513d24,_0x350cd4){return client[_0xdd32('0xa')](_0x3d7486,_0x396cb3)[_0xdd32('0xb')](function(_0x3473a1){logger[_0xdd32('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x58db92,_0xdd32('0xd'));logger[_0xdd32('0xe')](_0xdd32('0xf'),_0x58db92,_0xdd32('0xd'),JSON[_0xdd32('0x10')](_0x3473a1));if(_0x3473a1['error']){if(_0x3473a1[_0xdd32('0x11')][_0xdd32('0x12')]===0x1f4){logger['error'](_0xdd32('0x13'),_0x58db92,_0x3473a1[_0xdd32('0x11')][_0xdd32('0x14')]);return _0x350cd4(_0x3473a1[_0xdd32('0x11')]['message']);}logger['error'](_0xdd32('0x13'),_0x58db92,_0x3473a1[_0xdd32('0x11')]['message']);return _0x513d24(_0x3473a1[_0xdd32('0x11')][_0xdd32('0x14')]);}else{logger[_0xdd32('0xc')](_0xdd32('0x13'),_0x58db92,'request\x20sent');_0x513d24(_0x3473a1['result'][_0xdd32('0x14')]);}})[_0xdd32('0x15')](function(_0x77596f){logger[_0xdd32('0x11')](_0xdd32('0x13'),_0x58db92,_0x77596f);_0x350cd4(_0x77596f);});});}
\ No newline at end of file
+var _0x30e5=['stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','info','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug'];(function(_0x27ca9a,_0x308d61){var _0x36a049=function(_0x22f4fc){while(--_0x22f4fc){_0x27ca9a['push'](_0x27ca9a['shift']());}};_0x36a049(++_0x308d61);}(_0x30e5,0x94));var _0x530e=function(_0x4998bd,_0x3faca9){_0x4998bd=_0x4998bd-0x0;var _0x5d4b6c=_0x30e5[_0x4998bd];return _0x5d4b6c;};'use strict';var _=require(_0x530e('0x0'));var util=require(_0x530e('0x1'));var moment=require(_0x530e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x530e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x530e('0x4'))(_0x530e('0x5'));var config=require('../../config/environment');var jayson=require(_0x530e('0x6'));var client=jayson['client'][_0x530e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44b038,_0x59be63,_0x544de6){return new BPromise(function(_0x3f7fd0,_0x12498e){return client[_0x530e('0x8')](_0x44b038,_0x544de6)[_0x530e('0x9')](function(_0x583e3e){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x59be63,_0x530e('0xa'));logger[_0x530e('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x59be63,_0x530e('0xa'),JSON[_0x530e('0xc')](_0x583e3e));if(_0x583e3e[_0x530e('0xd')]){if(_0x583e3e[_0x530e('0xd')][_0x530e('0xe')]===0x1f4){logger[_0x530e('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x59be63,_0x583e3e[_0x530e('0xd')]['message']);return _0x12498e(_0x583e3e[_0x530e('0xd')][_0x530e('0xf')]);}logger[_0x530e('0xd')](_0x530e('0x10'),_0x59be63,_0x583e3e['error'][_0x530e('0xf')]);return _0x3f7fd0(_0x583e3e[_0x530e('0xd')][_0x530e('0xf')]);}else{logger[_0x530e('0x11')](_0x530e('0x10'),_0x59be63,_0x530e('0xa'));_0x3f7fd0(_0x583e3e[_0x530e('0x12')][_0x530e('0xf')]);}})[_0x530e('0x13')](function(_0x12e6f2){logger[_0x530e('0xd')](_0x530e('0x10'),_0x59be63,_0x12e6f2);_0x12498e(_0x12e6f2);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index de1e65f..6962c95 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 _0x093a=['destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x1719e4,_0x4278fe){var _0x236bac=function(_0x12e8a3){while(--_0x12e8a3){_0x1719e4['push'](_0x1719e4['shift']());}};_0x236bac(++_0x4278fe);}(_0x093a,0x16a));var _0xa093=function(_0x4c630b,_0x25f8ef){_0x4c630b=_0x4c630b-0x0;var _0x181259=_0x093a[_0x4c630b];return _0x181259;};'use strict';var multer=require('multer');var util=require(_0xa093('0x0'));var path=require(_0xa093('0x1'));var timeout=require(_0xa093('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa093('0x3'));var auth=require(_0xa093('0x4'));var interaction=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var controller=require(_0xa093('0x7'));router[_0xa093('0x8')]('/',auth[_0xa093('0x9')](),controller[_0xa093('0xa')]);router[_0xa093('0x8')](_0xa093('0xb'),auth[_0xa093('0x9')](),controller[_0xa093('0xc')]);router[_0xa093('0xd')]('/',auth[_0xa093('0x9')](),controller[_0xa093('0xe')]);router[_0xa093('0xf')](_0xa093('0xb'),auth[_0xa093('0x9')](),controller[_0xa093('0x10')]);router[_0xa093('0x11')](_0xa093('0xb'),auth['isAuthenticated'](),controller[_0xa093('0x12')]);module[_0xa093('0x13')]=router;
\ No newline at end of file
+var _0xa4bd=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x141cf7,_0x5d9082){_0x141cf7=_0x141cf7-0x0;var _0x2eff71=_0xa4bd[_0x141cf7];return _0x2eff71;};'use strict';var multer=require(_0xda4b('0x0'));var util=require(_0xda4b('0x1'));var path=require(_0xda4b('0x2'));var timeout=require('connect-timeout');var express=require(_0xda4b('0x3'));var router=express[_0xda4b('0x4')]();var fs_extra=require(_0xda4b('0x5'));var auth=require(_0xda4b('0x6'));var interaction=require(_0xda4b('0x7'));var config=require(_0xda4b('0x8'));var controller=require(_0xda4b('0x9'));router[_0xda4b('0xa')]('/',auth[_0xda4b('0xb')](),controller[_0xda4b('0xc')]);router['get'](_0xda4b('0xd'),auth[_0xda4b('0xb')](),controller[_0xda4b('0xe')]);router[_0xda4b('0xf')]('/',auth['isAuthenticated'](),controller[_0xda4b('0x10')]);router[_0xda4b('0x11')](_0xda4b('0xd'),auth['isAuthenticated'](),controller[_0xda4b('0x12')]);router['delete'](_0xda4b('0xd'),auth[_0xda4b('0xb')](),controller[_0xda4b('0x13')]);module[_0xda4b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 2f2693b..5d07e0b 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 _0xbff3=['TEXT','sequelize','exports'];(function(_0x41f9d8,_0x4718ba){var _0x13f080=function(_0x3bf1d4){while(--_0x3bf1d4){_0x41f9d8['push'](_0x41f9d8['shift']());}};_0x13f080(++_0x4718ba);}(_0xbff3,0x1f0));var _0x3bff=function(_0x5ed847,_0x1ce9d3){_0x5ed847=_0x5ed847-0x0;var _0x33ed61=_0xbff3[_0x5ed847];return _0x33ed61;};'use strict';var Sequelize=require(_0x3bff('0x0'));module[_0x3bff('0x1')]={'tree':{'type':Sequelize[_0x3bff('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9465=['TEXT','sequelize'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x9465,0x81));var _0x5946=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x9465[_0x15ca1a];return _0x507626;};'use strict';var Sequelize=require(_0x5946('0x0'));module['exports']={'tree':{'type':Sequelize[_0x5946('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 18d4ef3..6a247f0 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 _0x084f=['../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x219729,_0x19f07d){var _0x35c464=function(_0x3c412c){while(--_0x3c412c){_0x219729['push'](_0x219729['shift']());}};_0x35c464(++_0x19f07d);}(_0x084f,0x1cd));var _0xf084=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x084f[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0xf084('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf084('0x1'));var moment=require('moment');var BPromise=require(_0xf084('0x2'));var Mustache=require(_0xf084('0x3'));var util=require('util');var path=require(_0xf084('0x4'));var sox=require(_0xf084('0x5'));var csv=require(_0xf084('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf084('0x7'));var squel=require('squel');var crypto=require(_0xf084('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf084('0x9'));var toCsv=require('to-csv');var querystring=require(_0xf084('0xa'));var Papa=require(_0xf084('0xb'));var Redis=require(_0xf084('0xc'));var authService=require(_0xf084('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf084('0xe'));var logger=require(_0xf084('0xf'))(_0xf084('0x10'));var utils=require('../../config/utils');var config=require(_0xf084('0x11'));var licenseUtil=require(_0xf084('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19bec2,_0x2d93ce){_0x2d93ce=_0x2d93ce||0xcc;return function(_0x4ac337){if(_0x4ac337){return _0x19bec2[_0xf084('0x13')](_0x2d93ce);}return _0x19bec2[_0xf084('0x14')](_0x2d93ce)[_0xf084('0x15')]();};}function respondWithResult(_0x52d6c3,_0x130180){_0x130180=_0x130180||0xc8;return function(_0x196c13){if(_0x196c13){return _0x52d6c3[_0xf084('0x14')](_0x130180)[_0xf084('0x16')](_0x196c13);}};}function respondWithFilteredResult(_0x3cb84b,_0x2f9168){return function(_0x343e56){if(_0x343e56){var _0x1e3998=typeof _0x2f9168[_0xf084('0x17')]==='undefined'&&typeof _0x2f9168['limit']===_0xf084('0x18');var _0x2ccba5=_0x343e56[_0xf084('0x19')];var _0x186282=_0x1e3998?0x0:_0x2f9168[_0xf084('0x17')];var _0x25cf4a=_0x1e3998?_0x343e56['count']:_0x2f9168['offset']+_0x2f9168[_0xf084('0x1a')];var _0x2cd834;if(_0x25cf4a>=_0x2ccba5){_0x25cf4a=_0x2ccba5;_0x2cd834=0xc8;}else{_0x2cd834=0xce;}_0x3cb84b[_0xf084('0x14')](_0x2cd834);return _0x3cb84b['set']('Content-Range',_0x186282+'-'+_0x25cf4a+'/'+_0x2ccba5)[_0xf084('0x16')](_0x343e56);}return null;};}function patchUpdates(_0x574497){return function(_0x5e1878){try{jsonpatch[_0xf084('0x1b')](_0x5e1878,_0x574497,!![]);}catch(_0x2743ee){return BPromise[_0xf084('0x1c')](_0x2743ee);}return _0x5e1878[_0xf084('0x1d')]();};}function saveUpdates(_0x240956,_0x3a8abe){return function(_0x16e634){if(_0x16e634){return _0x16e634[_0xf084('0x1e')](_0x240956)['then'](function(_0x394133){return _0x394133;});}return null;};}function removeEntity(_0x5d1dd3,_0x1db511){return function(_0x1561c6){if(_0x1561c6){return _0x1561c6['destroy']()[_0xf084('0x1f')](function(){_0x5d1dd3[_0xf084('0x14')](0xcc)[_0xf084('0x15')]();});}};}function handleEntityNotFound(_0x5aa13f,_0x1e72cd){return function(_0x4e7c5e){if(!_0x4e7c5e){_0x5aa13f[_0xf084('0x13')](0x194);}return _0x4e7c5e;};}function handleError(_0x245480,_0x486f24){_0x486f24=_0x486f24||0x1f4;return function(_0x1861dd){logger[_0xf084('0x20')](_0x1861dd[_0xf084('0x21')]);if(_0x1861dd['name']){delete _0x1861dd[_0xf084('0x22')];}_0x245480['status'](_0x486f24)[_0xf084('0x23')](_0x1861dd);};}exports[_0xf084('0x24')]=function(_0x2f6c47,_0x1a6738){var _0x110044={},_0x168a7c={},_0x44cf9e={'count':0x0,'rows':[]};var _0x124bfe=_[_0xf084('0x25')](db[_0xf084('0x26')][_0xf084('0x27')],function(_0x55d8df){return{'name':_0x55d8df[_0xf084('0x28')],'type':_0x55d8df[_0xf084('0x29')]['key']};});_0x168a7c[_0xf084('0x2a')]=_['map'](_0x124bfe,_0xf084('0x22'));_0x168a7c[_0xf084('0x2b')]=_[_0xf084('0x2c')](_0x2f6c47['query']);_0x168a7c[_0xf084('0x2d')]=_[_0xf084('0x2e')](_0x168a7c[_0xf084('0x2a')],_0x168a7c[_0xf084('0x2b')]);_0x110044['attributes']=_['intersection'](_0x168a7c['model'],qs[_0xf084('0x2f')](_0x2f6c47['query'][_0xf084('0x2f')]));_0x110044[_0xf084('0x30')]=_0x110044[_0xf084('0x30')][_0xf084('0x31')]?_0x110044[_0xf084('0x30')]:_0x168a7c[_0xf084('0x2a')];if(!_0x2f6c47[_0xf084('0x2b')][_0xf084('0x32')]('nolimit')){_0x110044[_0xf084('0x1a')]=qs['limit'](_0x2f6c47[_0xf084('0x2b')][_0xf084('0x1a')]);_0x110044[_0xf084('0x17')]=qs[_0xf084('0x17')](_0x2f6c47['query'][_0xf084('0x17')]);}_0x110044[_0xf084('0x33')]=qs[_0xf084('0x34')](_0x2f6c47[_0xf084('0x2b')][_0xf084('0x34')]);_0x110044[_0xf084('0x35')]=qs[_0xf084('0x2d')](_['pick'](_0x2f6c47[_0xf084('0x2b')],_0x168a7c[_0xf084('0x2d')]),_0x124bfe);if(_0x2f6c47[_0xf084('0x2b')][_0xf084('0x36')]){_0x110044['where']=_[_0xf084('0x37')](_0x110044[_0xf084('0x35')],{'$or':_['map'](_0x124bfe,function(_0x513170){if(_0x513170[_0xf084('0x29')]!==_0xf084('0x38')){var _0x1163fc={};_0x1163fc[_0x513170['name']]={'$like':'%'+_0x2f6c47[_0xf084('0x2b')][_0xf084('0x36')]+'%'};return _0x1163fc;}})});}_0x110044=_[_0xf084('0x37')]({},_0x110044,_0x2f6c47[_0xf084('0x39')]);var _0x58d19e={'where':_0x110044[_0xf084('0x35')]};return db[_0xf084('0x26')][_0xf084('0x19')](_0x58d19e)['then'](function(_0x9ac16e){_0x44cf9e[_0xf084('0x19')]=_0x9ac16e;if(_0x2f6c47[_0xf084('0x2b')][_0xf084('0x3a')]){_0x110044[_0xf084('0x3b')]=[{'all':!![]}];}return db[_0xf084('0x26')][_0xf084('0x3c')](_0x110044);})['then'](function(_0x3b56e6){_0x44cf9e[_0xf084('0x3d')]=_0x3b56e6;return _0x44cf9e;})[_0xf084('0x1f')](respondWithFilteredResult(_0x1a6738,_0x110044))[_0xf084('0x3e')](handleError(_0x1a6738,null));};exports[_0xf084('0x3f')]=function(_0x2a8ecd,_0x7a5006){var _0x159d6a={'raw':!![],'where':{'id':_0x2a8ecd[_0xf084('0x40')]['id']}},_0x200a92={};_0x200a92[_0xf084('0x2a')]=_[_0xf084('0x2c')](db['AnalyticTreeReport'][_0xf084('0x27')]);_0x200a92[_0xf084('0x2b')]=_[_0xf084('0x2c')](_0x2a8ecd[_0xf084('0x2b')]);_0x200a92['filters']=_['intersection'](_0x200a92[_0xf084('0x2a')],_0x200a92[_0xf084('0x2b')]);_0x159d6a[_0xf084('0x30')]=_['intersection'](_0x200a92[_0xf084('0x2a')],qs[_0xf084('0x2f')](_0x2a8ecd[_0xf084('0x2b')][_0xf084('0x2f')]));_0x159d6a[_0xf084('0x30')]=_0x159d6a['attributes'][_0xf084('0x31')]?_0x159d6a['attributes']:_0x200a92['model'];if(_0x2a8ecd[_0xf084('0x2b')][_0xf084('0x3a')]){_0x159d6a[_0xf084('0x3b')]=[{'all':!![]}];}_0x159d6a=_[_0xf084('0x37')]({},_0x159d6a,_0x2a8ecd[_0xf084('0x39')]);return db[_0xf084('0x26')][_0xf084('0x41')](_0x159d6a)[_0xf084('0x1f')](handleEntityNotFound(_0x7a5006,null))[_0xf084('0x1f')](respondWithResult(_0x7a5006,null))[_0xf084('0x3e')](handleError(_0x7a5006,null));};exports['create']=function(_0x486235,_0x514ed6){return db[_0xf084('0x26')][_0xf084('0x42')](_0x486235['body'],{})[_0xf084('0x1f')](respondWithResult(_0x514ed6,0xc9))[_0xf084('0x3e')](handleError(_0x514ed6,null));};exports[_0xf084('0x1e')]=function(_0x319e33,_0x4dccfa){if(_0x319e33[_0xf084('0x43')]['id']){delete _0x319e33['body']['id'];}return db[_0xf084('0x26')][_0xf084('0x41')]({'where':{'id':_0x319e33['params']['id']}})[_0xf084('0x1f')](handleEntityNotFound(_0x4dccfa,null))['then'](saveUpdates(_0x319e33[_0xf084('0x43')],null))[_0xf084('0x1f')](respondWithResult(_0x4dccfa,null))[_0xf084('0x3e')](handleError(_0x4dccfa,null));};exports['destroy']=function(_0x57c443,_0x4e9b27){return db[_0xf084('0x26')]['find']({'where':{'id':_0x57c443[_0xf084('0x40')]['id']}})['then'](handleEntityNotFound(_0x4e9b27,null))[_0xf084('0x1f')](removeEntity(_0x4e9b27,null))[_0xf084('0x3e')](handleError(_0x4e9b27,null));};
\ No newline at end of file
+var _0xa856=['map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','index'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xa856,0x139));var _0x6a85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa856[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6a85('0x0'));var rimraf=require(_0x6a85('0x1'));var zipdir=require(_0x6a85('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a85('0x3'));var moment=require(_0x6a85('0x4'));var BPromise=require(_0x6a85('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6a85('0x6'));var sox=require('sox');var csv=require(_0x6a85('0x7'));var ejs=require(_0x6a85('0x8'));var fs=require('fs');var fs_extra=require(_0x6a85('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6a85('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a85('0x7'));var querystring=require(_0x6a85('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a85('0xc'));var qs=require(_0x6a85('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a85('0xe'));var logger=require(_0x6a85('0xf'))('api');var utils=require(_0x6a85('0x10'));var config=require(_0x6a85('0x11'));var licenseUtil=require(_0x6a85('0x12'));var db=require(_0x6a85('0x13'))['db'];function respondWithStatusCode(_0x4fe2da,_0x38352c){_0x38352c=_0x38352c||0xcc;return function(_0x3fd25c){if(_0x3fd25c){return _0x4fe2da[_0x6a85('0x14')](_0x38352c);}return _0x4fe2da['status'](_0x38352c)[_0x6a85('0x15')]();};}function respondWithResult(_0x15c323,_0x4a4005){_0x4a4005=_0x4a4005||0xc8;return function(_0x385e1a){if(_0x385e1a){return _0x15c323[_0x6a85('0x16')](_0x4a4005)[_0x6a85('0x17')](_0x385e1a);}};}function respondWithFilteredResult(_0x214c21,_0x3c07ad){return function(_0x30fc3d){if(_0x30fc3d){var _0x57f9ff=typeof _0x3c07ad[_0x6a85('0x18')]===_0x6a85('0x19')&&typeof _0x3c07ad[_0x6a85('0x1a')]===_0x6a85('0x19');var _0x2ccd5d=_0x30fc3d[_0x6a85('0x1b')];var _0x1e5f72=_0x57f9ff?0x0:_0x3c07ad['offset'];var _0x3752a3=_0x57f9ff?_0x30fc3d[_0x6a85('0x1b')]:_0x3c07ad[_0x6a85('0x18')]+_0x3c07ad[_0x6a85('0x1a')];var _0x3c4151;if(_0x3752a3>=_0x2ccd5d){_0x3752a3=_0x2ccd5d;_0x3c4151=0xc8;}else{_0x3c4151=0xce;}_0x214c21[_0x6a85('0x16')](_0x3c4151);return _0x214c21['set'](_0x6a85('0x1c'),_0x1e5f72+'-'+_0x3752a3+'/'+_0x2ccd5d)[_0x6a85('0x17')](_0x30fc3d);}return null;};}function patchUpdates(_0x494a33){return function(_0x37b631){try{jsonpatch['apply'](_0x37b631,_0x494a33,!![]);}catch(_0x451c37){return BPromise['reject'](_0x451c37);}return _0x37b631[_0x6a85('0x1d')]();};}function saveUpdates(_0x5e0f6b,_0x2f0e24){return function(_0x57a688){if(_0x57a688){return _0x57a688[_0x6a85('0x1e')](_0x5e0f6b)[_0x6a85('0x1f')](function(_0x3b35ce){return _0x3b35ce;});}return null;};}function removeEntity(_0x44e9ee,_0x203d65){return function(_0x577429){if(_0x577429){return _0x577429[_0x6a85('0x20')]()['then'](function(){_0x44e9ee[_0x6a85('0x16')](0xcc)[_0x6a85('0x15')]();});}};}function handleEntityNotFound(_0x448626,_0x2d4815){return function(_0x4cc0c5){if(!_0x4cc0c5){_0x448626[_0x6a85('0x14')](0x194);}return _0x4cc0c5;};}function handleError(_0x3b2b49,_0x5a21ac){_0x5a21ac=_0x5a21ac||0x1f4;return function(_0x4653fc){logger[_0x6a85('0x21')](_0x4653fc[_0x6a85('0x22')]);if(_0x4653fc[_0x6a85('0x23')]){delete _0x4653fc[_0x6a85('0x23')];}_0x3b2b49[_0x6a85('0x16')](_0x5a21ac)['send'](_0x4653fc);};}exports[_0x6a85('0x24')]=function(_0x588e52,_0x11cf6f){var _0x5fa685={},_0x54cc78={},_0x4e5daf={'count':0x0,'rows':[]};var _0x547bd8=_[_0x6a85('0x25')](db[_0x6a85('0x26')][_0x6a85('0x27')],function(_0x1f375f){return{'name':_0x1f375f[_0x6a85('0x28')],'type':_0x1f375f[_0x6a85('0x29')][_0x6a85('0x2a')]};});_0x54cc78[_0x6a85('0x2b')]=_[_0x6a85('0x25')](_0x547bd8,_0x6a85('0x23'));_0x54cc78[_0x6a85('0x2c')]=_[_0x6a85('0x2d')](_0x588e52['query']);_0x54cc78[_0x6a85('0x2e')]=_[_0x6a85('0x2f')](_0x54cc78[_0x6a85('0x2b')],_0x54cc78[_0x6a85('0x2c')]);_0x5fa685['attributes']=_[_0x6a85('0x2f')](_0x54cc78[_0x6a85('0x2b')],qs[_0x6a85('0x30')](_0x588e52['query'][_0x6a85('0x30')]));_0x5fa685[_0x6a85('0x31')]=_0x5fa685[_0x6a85('0x31')][_0x6a85('0x32')]?_0x5fa685[_0x6a85('0x31')]:_0x54cc78['model'];if(!_0x588e52[_0x6a85('0x2c')][_0x6a85('0x33')](_0x6a85('0x34'))){_0x5fa685[_0x6a85('0x1a')]=qs[_0x6a85('0x1a')](_0x588e52[_0x6a85('0x2c')][_0x6a85('0x1a')]);_0x5fa685[_0x6a85('0x18')]=qs[_0x6a85('0x18')](_0x588e52[_0x6a85('0x2c')]['offset']);}_0x5fa685[_0x6a85('0x35')]=qs[_0x6a85('0x36')](_0x588e52[_0x6a85('0x2c')][_0x6a85('0x36')]);_0x5fa685[_0x6a85('0x37')]=qs['filters'](_[_0x6a85('0x38')](_0x588e52[_0x6a85('0x2c')],_0x54cc78[_0x6a85('0x2e')]),_0x547bd8);if(_0x588e52['query'][_0x6a85('0x39')]){_0x5fa685[_0x6a85('0x37')]=_['merge'](_0x5fa685[_0x6a85('0x37')],{'$or':_[_0x6a85('0x25')](_0x547bd8,function(_0x41086f){if(_0x41086f[_0x6a85('0x29')]!==_0x6a85('0x3a')){var _0x4ce7eb={};_0x4ce7eb[_0x41086f[_0x6a85('0x23')]]={'$like':'%'+_0x588e52[_0x6a85('0x2c')][_0x6a85('0x39')]+'%'};return _0x4ce7eb;}})});}_0x5fa685=_['merge']({},_0x5fa685,_0x588e52[_0x6a85('0x3b')]);var _0x5bfaa1={'where':_0x5fa685[_0x6a85('0x37')]};return db[_0x6a85('0x26')][_0x6a85('0x1b')](_0x5bfaa1)[_0x6a85('0x1f')](function(_0x3dccaa){_0x4e5daf['count']=_0x3dccaa;if(_0x588e52[_0x6a85('0x2c')][_0x6a85('0x3c')]){_0x5fa685[_0x6a85('0x3d')]=[{'all':!![]}];}return db[_0x6a85('0x26')][_0x6a85('0x3e')](_0x5fa685);})['then'](function(_0x5d9e62){_0x4e5daf[_0x6a85('0x3f')]=_0x5d9e62;return _0x4e5daf;})['then'](respondWithFilteredResult(_0x11cf6f,_0x5fa685))['catch'](handleError(_0x11cf6f,null));};exports['show']=function(_0x81109a,_0x278c4c){var _0x8ca301={'raw':!![],'where':{'id':_0x81109a[_0x6a85('0x40')]['id']}},_0x4ee031={};_0x4ee031[_0x6a85('0x2b')]=_[_0x6a85('0x2d')](db[_0x6a85('0x26')][_0x6a85('0x27')]);_0x4ee031[_0x6a85('0x2c')]=_[_0x6a85('0x2d')](_0x81109a[_0x6a85('0x2c')]);_0x4ee031[_0x6a85('0x2e')]=_[_0x6a85('0x2f')](_0x4ee031[_0x6a85('0x2b')],_0x4ee031[_0x6a85('0x2c')]);_0x8ca301[_0x6a85('0x31')]=_[_0x6a85('0x2f')](_0x4ee031['model'],qs['fields'](_0x81109a['query'][_0x6a85('0x30')]));_0x8ca301[_0x6a85('0x31')]=_0x8ca301[_0x6a85('0x31')][_0x6a85('0x32')]?_0x8ca301[_0x6a85('0x31')]:_0x4ee031['model'];if(_0x81109a[_0x6a85('0x2c')][_0x6a85('0x3c')]){_0x8ca301[_0x6a85('0x3d')]=[{'all':!![]}];}_0x8ca301=_[_0x6a85('0x41')]({},_0x8ca301,_0x81109a[_0x6a85('0x3b')]);return db[_0x6a85('0x26')][_0x6a85('0x42')](_0x8ca301)[_0x6a85('0x1f')](handleEntityNotFound(_0x278c4c,null))[_0x6a85('0x1f')](respondWithResult(_0x278c4c,null))[_0x6a85('0x43')](handleError(_0x278c4c,null));};exports[_0x6a85('0x44')]=function(_0x356dc2,_0x3caf73){return db[_0x6a85('0x26')][_0x6a85('0x44')](_0x356dc2[_0x6a85('0x45')],{})[_0x6a85('0x1f')](respondWithResult(_0x3caf73,0xc9))[_0x6a85('0x43')](handleError(_0x3caf73,null));};exports['update']=function(_0x109bd3,_0x139139){if(_0x109bd3[_0x6a85('0x45')]['id']){delete _0x109bd3[_0x6a85('0x45')]['id'];}return db['AnalyticTreeReport'][_0x6a85('0x42')]({'where':{'id':_0x109bd3[_0x6a85('0x40')]['id']}})[_0x6a85('0x1f')](handleEntityNotFound(_0x139139,null))['then'](saveUpdates(_0x109bd3[_0x6a85('0x45')],null))[_0x6a85('0x1f')](respondWithResult(_0x139139,null))['catch'](handleError(_0x139139,null));};exports[_0x6a85('0x20')]=function(_0x2a06f3,_0x176bf1){return db[_0x6a85('0x26')][_0x6a85('0x42')]({'where':{'id':_0x2a06f3[_0x6a85('0x40')]['id']}})[_0x6a85('0x1f')](handleEntityNotFound(_0x176bf1,null))[_0x6a85('0x1f')](removeEntity(_0x176bf1,null))[_0x6a85('0x43')](handleError(_0x176bf1,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index a1bad7c..901b084 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 _0x1f01=['define','AnalyticTreeReport','lodash','util','../../config/logger','api','moment','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x2fdef1,_0x4cb3a9){var _0x36944c=function(_0xe87218){while(--_0xe87218){_0x2fdef1['push'](_0x2fdef1['shift']());}};_0x36944c(++_0x4cb3a9);}(_0x1f01,0xde));var _0x11f0=function(_0x518e15,_0x568735){_0x518e15=_0x518e15-0x0;var _0x3bd658=_0x1f01[_0x518e15];return _0x3bd658;};'use strict';var _=require(_0x11f0('0x0'));var util=require(_0x11f0('0x1'));var logger=require(_0x11f0('0x2'))(_0x11f0('0x3'));var moment=require(_0x11f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11f0('0x5'));var rimraf=require('rimraf');var config=require(_0x11f0('0x6'));var attributes=require(_0x11f0('0x7'));module[_0x11f0('0x8')]=function(_0x267d90,_0x343d5f){return _0x267d90[_0x11f0('0x9')](_0x11f0('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb327=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash'];(function(_0x45fa7d,_0x2c3049){var _0x1f9fe0=function(_0x7389f1){while(--_0x7389f1){_0x45fa7d['push'](_0x45fa7d['shift']());}};_0x1f9fe0(++_0x2c3049);}(_0xb327,0x137));var _0x7b32=function(_0x36e9da,_0x133203){_0x36e9da=_0x36e9da-0x0;var _0x58f668=_0xb327[_0x36e9da];return _0x58f668;};'use strict';var _=require(_0x7b32('0x0'));var util=require(_0x7b32('0x1'));var logger=require(_0x7b32('0x2'))(_0x7b32('0x3'));var moment=require('moment');var BPromise=require(_0x7b32('0x4'));var rp=require(_0x7b32('0x5'));var fs=require('fs');var path=require(_0x7b32('0x6'));var rimraf=require(_0x7b32('0x7'));var config=require(_0x7b32('0x8'));var attributes=require(_0x7b32('0x9'));module[_0x7b32('0xa')]=function(_0x2446a0,_0x38fdcd){return _0x2446a0[_0x7b32('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x7b32('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 6e311f7..9556b43 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x337261,_0x1182a7){var _0x2639a1=function(_0x3b83c1){while(--_0x3b83c1){_0x337261['push'](_0x337261['shift']());}};_0x2639a1(++_0x1182a7);}(_0x1261,0x144));var _0x1126=function(_0x1a48a0,_0x3c95f5){_0x1a48a0=_0x1a48a0-0x0;var _0x269714=_0x1261[_0x1a48a0];return _0x269714;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4d324d,_0x16b4f3){var _0x34c197=function(_0x506963){while(--_0x506963){_0x4d324d['push'](_0x4d324d['shift']());}};_0x34c197(++_0x16b4f3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13d130,_0x5c9dc1){_0x13d130=_0x13d130-0x0;var _0x52df35=_0x5f2f[_0x13d130];return _0x52df35;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 6dc225b..1da8027 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 _0xd89c=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','/:id','destroy','exports','util','path'];(function(_0x1b0750,_0xe873a2){var _0x2153ab=function(_0x414941){while(--_0x414941){_0x1b0750['push'](_0x1b0750['shift']());}};_0x2153ab(++_0xe873a2);}(_0xd89c,0x76));var _0xcd89=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xd89c[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require('multer');var util=require(_0xcd89('0x0'));var path=require(_0xcd89('0x1'));var timeout=require(_0xcd89('0x2'));var express=require('express');var router=express[_0xcd89('0x3')]();var fs_extra=require(_0xcd89('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcd89('0x5'));var config=require(_0xcd89('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xcd89('0x7')]('/',auth[_0xcd89('0x8')](),controller[_0xcd89('0x9')]);router[_0xcd89('0x7')]('/:id',auth[_0xcd89('0x8')](),controller['show']);router[_0xcd89('0xa')]('/',auth[_0xcd89('0x8')](),controller[_0xcd89('0xb')]);router['put']('/:id',auth[_0xcd89('0x8')](),controller['update']);router['delete'](_0xcd89('0xc'),auth[_0xcd89('0x8')](),controller[_0xcd89('0xd')]);module[_0xcd89('0xe')]=router;
\ No newline at end of file
+var _0x641b=['../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get','show','post','create','update','delete','/:id','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x641b,0x1ab));var _0xb641=function(_0x334b90,_0x7fe59b){_0x334b90=_0x334b90-0x0;var _0x13e76b=_0x641b[_0x334b90];return _0x13e76b;};'use strict';var multer=require(_0xb641('0x0'));var util=require(_0xb641('0x1'));var path=require('path');var timeout=require(_0xb641('0x2'));var express=require(_0xb641('0x3'));var router=express['Router']();var fs_extra=require(_0xb641('0x4'));var auth=require(_0xb641('0x5'));var interaction=require(_0xb641('0x6'));var config=require('../../config/environment');var controller=require(_0xb641('0x7'));router['get']('/',auth[_0xb641('0x8')](),controller[_0xb641('0x9')]);router[_0xb641('0xa')]('/:id',auth[_0xb641('0x8')](),controller[_0xb641('0xb')]);router[_0xb641('0xc')]('/',auth[_0xb641('0x8')](),controller[_0xb641('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb641('0xe')]);router[_0xb641('0xf')](_0xb641('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xb641('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f47b515..1a782de 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 _0xdb13=['exports','STRING'];(function(_0x13dee0,_0x5e168e){var _0x61d462=function(_0xf5c736){while(--_0xf5c736){_0x13dee0['push'](_0x13dee0['shift']());}};_0x61d462(++_0x5e168e);}(_0xdb13,0x10c));var _0x3db1=function(_0xbf8aed,_0x2a7eca){_0xbf8aed=_0xbf8aed-0x0;var _0x271f3d=_0xdb13[_0xbf8aed];return _0x271f3d;};'use strict';var Sequelize=require('sequelize');module[_0x3db1('0x0')]={'name':{'type':Sequelize[_0x3db1('0x1')]},'basename':{'type':Sequelize[_0x3db1('0x1')]},'type':{'type':Sequelize[_0x3db1('0x1')]}};
\ No newline at end of file
+var _0x3cd1=['exports','STRING'];(function(_0x3fcbe1,_0x5b1f24){var _0x5efafc=function(_0x4bae4c){while(--_0x4bae4c){_0x3fcbe1['push'](_0x3fcbe1['shift']());}};_0x5efafc(++_0x5b1f24);}(_0x3cd1,0x112));var _0x13cd=function(_0x31405e,_0x19260b){_0x31405e=_0x31405e-0x0;var _0x2a9b18=_0x3cd1[_0x31405e];return _0x2a9b18;};'use strict';var Sequelize=require('sequelize');module[_0x13cd('0x0')]={'name':{'type':Sequelize[_0x13cd('0x1')]},'basename':{'type':Sequelize[_0x13cd('0x1')]},'type':{'type':Sequelize[_0x13cd('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index f012d4d..e133c0c 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 _0x1fe8=['body','create','file','originalname','filename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','clone','get','omit','createdAt','updatedAt'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1fe8,0x6b));var _0x81fe=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x1fe8[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require(_0x81fe('0x0'));var rimraf=require(_0x81fe('0x1'));var zipdir=require(_0x81fe('0x2'));var jsonpatch=require(_0x81fe('0x3'));var rp=require(_0x81fe('0x4'));var moment=require(_0x81fe('0x5'));var BPromise=require(_0x81fe('0x6'));var Mustache=require(_0x81fe('0x7'));var util=require('util');var path=require(_0x81fe('0x8'));var sox=require(_0x81fe('0x9'));var csv=require(_0x81fe('0xa'));var ejs=require(_0x81fe('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81fe('0xc'));var squel=require(_0x81fe('0xd'));var crypto=require(_0x81fe('0xe'));var jsforce=require(_0x81fe('0xf'));var deskjs=require(_0x81fe('0x10'));var toCsv=require(_0x81fe('0xa'));var querystring=require(_0x81fe('0x11'));var Papa=require(_0x81fe('0x12'));var Redis=require('ioredis');var authService=require(_0x81fe('0x13'));var qs=require(_0x81fe('0x14'));var as=require(_0x81fe('0x15'));var hardwareService=require(_0x81fe('0x16'));var logger=require(_0x81fe('0x17'))(_0x81fe('0x18'));var utils=require(_0x81fe('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x81fe('0x1a'))['db'];function respondWithStatusCode(_0x133db9,_0x20ab46){_0x20ab46=_0x20ab46||0xcc;return function(_0x12ed09){if(_0x12ed09){return _0x133db9[_0x81fe('0x1b')](_0x20ab46);}return _0x133db9[_0x81fe('0x1c')](_0x20ab46)[_0x81fe('0x1d')]();};}function respondWithResult(_0x130b87,_0x434957){_0x434957=_0x434957||0xc8;return function(_0x199cf5){if(_0x199cf5){return _0x130b87[_0x81fe('0x1c')](_0x434957)[_0x81fe('0x1e')](_0x199cf5);}};}function respondWithFilteredResult(_0x3b6bc0,_0xb47cea){return function(_0x242c32){if(_0x242c32){var _0xcccbbc=typeof _0xb47cea['offset']===_0x81fe('0x1f')&&typeof _0xb47cea[_0x81fe('0x20')]===_0x81fe('0x1f');var _0x1af871=_0x242c32['count'];var _0x1f276f=_0xcccbbc?0x0:_0xb47cea[_0x81fe('0x21')];var _0x3ae6db=_0xcccbbc?_0x242c32[_0x81fe('0x22')]:_0xb47cea[_0x81fe('0x21')]+_0xb47cea[_0x81fe('0x20')];var _0x26ad54;if(_0x3ae6db>=_0x1af871){_0x3ae6db=_0x1af871;_0x26ad54=0xc8;}else{_0x26ad54=0xce;}_0x3b6bc0['status'](_0x26ad54);return _0x3b6bc0['set'](_0x81fe('0x23'),_0x1f276f+'-'+_0x3ae6db+'/'+_0x1af871)[_0x81fe('0x1e')](_0x242c32);}return null;};}function patchUpdates(_0x5d88b4){return function(_0x5adfb4){try{jsonpatch[_0x81fe('0x24')](_0x5adfb4,_0x5d88b4,!![]);}catch(_0x3c9462){return BPromise['reject'](_0x3c9462);}return _0x5adfb4[_0x81fe('0x25')]();};}function saveUpdates(_0x5778e1,_0x4aa2e4){return function(_0x22bcbc){if(_0x22bcbc){return _0x22bcbc[_0x81fe('0x26')](_0x5778e1)[_0x81fe('0x27')](function(_0x2f0d90){return _0x2f0d90;});}return null;};}function removeEntity(_0x5ac3c9,_0xd3b5c4){return function(_0x3f33ef){if(_0x3f33ef){return _0x3f33ef['destroy']()[_0x81fe('0x27')](function(){_0x5ac3c9['status'](0xcc)[_0x81fe('0x1d')]();});}};}function handleEntityNotFound(_0x980b6c,_0x2e0ff1){return function(_0x118a84){if(!_0x118a84){_0x980b6c[_0x81fe('0x1b')](0x194);}return _0x118a84;};}function handleError(_0x21ce6b,_0xac1cf9){_0xac1cf9=_0xac1cf9||0x1f4;return function(_0x4ac2a7){logger['error'](_0x4ac2a7[_0x81fe('0x28')]);if(_0x4ac2a7[_0x81fe('0x29')]){delete _0x4ac2a7[_0x81fe('0x29')];}_0x21ce6b['status'](_0xac1cf9)[_0x81fe('0x2a')](_0x4ac2a7);};}exports[_0x81fe('0x2b')]=function(_0x481c55,_0xaaf44e){var _0x10177a={},_0x2a1955={},_0x4b73a9={'count':0x0,'rows':[]};var _0x43a5b0=_[_0x81fe('0x2c')](db[_0x81fe('0x2d')][_0x81fe('0x2e')],function(_0x3dae16){return{'name':_0x3dae16[_0x81fe('0x2f')],'type':_0x3dae16[_0x81fe('0x30')][_0x81fe('0x31')]};});_0x2a1955[_0x81fe('0x32')]=_['map'](_0x43a5b0,'name');_0x2a1955[_0x81fe('0x33')]=_[_0x81fe('0x34')](_0x481c55[_0x81fe('0x33')]);_0x2a1955[_0x81fe('0x35')]=_['intersection'](_0x2a1955['model'],_0x2a1955[_0x81fe('0x33')]);_0x10177a[_0x81fe('0x36')]=_['intersection'](_0x2a1955[_0x81fe('0x32')],qs[_0x81fe('0x37')](_0x481c55[_0x81fe('0x33')]['fields']));_0x10177a['attributes']=_0x10177a['attributes'][_0x81fe('0x38')]?_0x10177a['attributes']:_0x2a1955[_0x81fe('0x32')];if(!_0x481c55[_0x81fe('0x33')][_0x81fe('0x39')](_0x81fe('0x3a'))){_0x10177a[_0x81fe('0x20')]=qs[_0x81fe('0x20')](_0x481c55['query']['limit']);_0x10177a[_0x81fe('0x21')]=qs[_0x81fe('0x21')](_0x481c55[_0x81fe('0x33')][_0x81fe('0x21')]);}_0x10177a[_0x81fe('0x3b')]=qs[_0x81fe('0x3c')](_0x481c55[_0x81fe('0x33')][_0x81fe('0x3c')]);_0x10177a[_0x81fe('0x3d')]=qs[_0x81fe('0x35')](_[_0x81fe('0x3e')](_0x481c55[_0x81fe('0x33')],_0x2a1955[_0x81fe('0x35')]),_0x43a5b0);if(_0x481c55[_0x81fe('0x33')]['filter']){_0x10177a['where']=_[_0x81fe('0x3f')](_0x10177a[_0x81fe('0x3d')],{'$or':_[_0x81fe('0x2c')](_0x43a5b0,function(_0x535005){if(_0x535005[_0x81fe('0x30')]!==_0x81fe('0x40')){var _0x1df42e={};_0x1df42e[_0x535005[_0x81fe('0x29')]]={'$like':'%'+_0x481c55[_0x81fe('0x33')][_0x81fe('0x41')]+'%'};return _0x1df42e;}})});}_0x10177a=_[_0x81fe('0x3f')]({},_0x10177a,_0x481c55[_0x81fe('0x42')]);var _0x21577f={'where':_0x10177a[_0x81fe('0x3d')]};return db[_0x81fe('0x2d')][_0x81fe('0x22')](_0x21577f)[_0x81fe('0x27')](function(_0x5bb41e){_0x4b73a9['count']=_0x5bb41e;if(_0x481c55['query'][_0x81fe('0x43')]){_0x10177a[_0x81fe('0x44')]=[{'all':!![]}];}return db[_0x81fe('0x2d')][_0x81fe('0x45')](_0x10177a);})[_0x81fe('0x27')](function(_0x235b62){_0x4b73a9[_0x81fe('0x46')]=_0x235b62;return _0x4b73a9;})[_0x81fe('0x27')](respondWithFilteredResult(_0xaaf44e,_0x10177a))[_0x81fe('0x47')](handleError(_0xaaf44e,null));};exports[_0x81fe('0x48')]=function(_0x2acf56,_0x17344f){var _0x315283={'raw':!![],'where':{'id':_0x2acf56[_0x81fe('0x49')]['id']}},_0x3493b1={};_0x3493b1['model']=_[_0x81fe('0x34')](db['Attachment'][_0x81fe('0x2e')]);_0x3493b1[_0x81fe('0x33')]=_[_0x81fe('0x34')](_0x2acf56[_0x81fe('0x33')]);_0x3493b1['filters']=_[_0x81fe('0x4a')](_0x3493b1[_0x81fe('0x32')],_0x3493b1[_0x81fe('0x33')]);_0x315283[_0x81fe('0x36')]=_[_0x81fe('0x4a')](_0x3493b1[_0x81fe('0x32')],qs[_0x81fe('0x37')](_0x2acf56[_0x81fe('0x33')][_0x81fe('0x37')]));_0x315283[_0x81fe('0x36')]=_0x315283[_0x81fe('0x36')][_0x81fe('0x38')]?_0x315283['attributes']:_0x3493b1[_0x81fe('0x32')];if(_0x2acf56[_0x81fe('0x33')][_0x81fe('0x43')]){_0x315283[_0x81fe('0x44')]=[{'all':!![]}];}_0x315283=_[_0x81fe('0x3f')]({},_0x315283,_0x2acf56['options']);return db[_0x81fe('0x2d')][_0x81fe('0x4b')](_0x315283)[_0x81fe('0x27')](handleEntityNotFound(_0x17344f,null))['then'](respondWithResult(_0x17344f,null))['catch'](handleError(_0x17344f,null));};exports[_0x81fe('0x4c')]=function(_0x5bc0f1,_0x3a765a){var _0x170866={'where':{'id':_0x5bc0f1[_0x81fe('0x49')]['id']}},_0x127f75={};_0x127f75['model']=_[_0x81fe('0x34')](db[_0x81fe('0x2d')][_0x81fe('0x2e')]);_0x170866[_0x81fe('0x36')]=_[_0x81fe('0x4a')](_0x127f75[_0x81fe('0x32')],qs[_0x81fe('0x37')](_0x5bc0f1[_0x81fe('0x33')][_0x81fe('0x37')]));_0x170866[_0x81fe('0x36')]=_0x170866[_0x81fe('0x36')]['length']?_0x170866[_0x81fe('0x36')]:_0x127f75[_0x81fe('0x32')];if(_0x5bc0f1[_0x81fe('0x33')][_0x81fe('0x43')]){_0x170866[_0x81fe('0x44')]=[{'all':!![]}];}_0x170866=_[_0x81fe('0x3f')]({},_0x170866,_0x5bc0f1[_0x81fe('0x42')]);return db['Attachment'][_0x81fe('0x4b')](_0x170866)[_0x81fe('0x27')](handleEntityNotFound(_0x3a765a,null))[_0x81fe('0x27')](function(_0xb7f83d){if(_0xb7f83d){var _0x3c77ef=_0xb7f83d[_0x81fe('0x4d')]({'plain':!![]});_0x3c77ef=qs[_0x81fe('0x4e')](_0x3c77ef,['id',_0x81fe('0x4f'),_0x81fe('0x50')]);_0x5bc0f1[_0x81fe('0x51')]=_[_0x81fe('0x4e')](_0x5bc0f1[_0x81fe('0x51')],['id','createdAt',_0x81fe('0x50')]);return db[_0x81fe('0x2d')]['create'](_[_0x81fe('0x3f')](_0x3c77ef,_0x5bc0f1['body']),{'include':_0x5bc0f1['query'][_0x81fe('0x43')]?[{'all':!![]}]:undefined});}})[_0x81fe('0x27')](respondWithResult(_0x3a765a,0xc9))[_0x81fe('0x47')](handleError(_0x3a765a,null));};exports[_0x81fe('0x26')]=function(_0x5d7040,_0x11e59a){if(_0x5d7040[_0x81fe('0x51')]['id']){delete _0x5d7040['body']['id'];}return db[_0x81fe('0x2d')][_0x81fe('0x4b')]({'where':{'id':_0x5d7040[_0x81fe('0x49')]['id']}})[_0x81fe('0x27')](handleEntityNotFound(_0x11e59a,null))[_0x81fe('0x27')](saveUpdates(_0x5d7040[_0x81fe('0x51')],null))['then'](respondWithResult(_0x11e59a,null))['catch'](handleError(_0x11e59a,null));};exports['destroy']=function(_0xe3adbe,_0x26633b){return db['Attachment'][_0x81fe('0x4b')]({'where':{'id':_0xe3adbe[_0x81fe('0x49')]['id']}})[_0x81fe('0x27')](handleEntityNotFound(_0x26633b,null))[_0x81fe('0x27')](removeEntity(_0x26633b,null))[_0x81fe('0x47')](handleError(_0x26633b,null));};exports[_0x81fe('0x52')]=function(_0x181f90,_0xa1a184,_0xa0ab11){_0x181f90[_0x81fe('0x51')][_0x81fe('0x29')]=_0x181f90[_0x81fe('0x53')][_0x81fe('0x54')];_0x181f90[_0x81fe('0x51')]['basename']=_0x181f90[_0x81fe('0x53')][_0x81fe('0x55')];_0x181f90[_0x81fe('0x51')][_0x81fe('0x30')]=_0x181f90[_0x81fe('0x53')][_0x81fe('0x56')];return db[_0x81fe('0x2d')][_0x81fe('0x52')](_0x181f90[_0x81fe('0x51')])[_0x81fe('0x27')](respondWithResult(_0xa1a184,0xc9))['catch'](handleError(_0xa1a184,null));};exports[_0x81fe('0x57')]=function(_0xfcad8b,_0x449bec,_0x129e9b){return db[_0x81fe('0x2d')][_0x81fe('0x58')]({'where':{'id':_0xfcad8b[_0x81fe('0x49')]['id']},'raw':!![]})[_0x81fe('0x27')](handleEntityNotFound(_0x449bec,null))[_0x81fe('0x27')](function(_0x227c31){if(_0x227c31){var _0x16426d=_0x227c31['ChatOfflineMessageId']!==null;var _0x259d02=path[_0x81fe('0x59')](config[_0x81fe('0x5a')],_0x81fe('0x5b'));if(_0x16426d){_0x259d02=path[_0x81fe('0x59')](_0x259d02,_0x81fe('0x5c'));}var _0x8e9a76=path[_0x81fe('0x59')](_0x259d02,_0x227c31[_0x81fe('0x5d')]);return _0x449bec['download'](_0x8e9a76);}})[_0x81fe('0x47')](handleError(_0x449bec,null));};
\ No newline at end of file
+var _0x8116=['catch','show','find','clone','params','length','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','download','findOne','join','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include'];(function(_0x5da341,_0x540c57){var _0x1365f3=function(_0x386dcc){while(--_0x386dcc){_0x5da341['push'](_0x5da341['shift']());}};_0x1365f3(++_0x540c57);}(_0x8116,0x71));var _0x6811=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8116[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x6811('0x0'));var rimraf=require(_0x6811('0x1'));var zipdir=require(_0x6811('0x2'));var jsonpatch=require(_0x6811('0x3'));var rp=require(_0x6811('0x4'));var moment=require(_0x6811('0x5'));var BPromise=require(_0x6811('0x6'));var Mustache=require('mustache');var util=require(_0x6811('0x7'));var path=require(_0x6811('0x8'));var sox=require(_0x6811('0x9'));var csv=require(_0x6811('0xa'));var ejs=require(_0x6811('0xb'));var fs=require('fs');var fs_extra=require(_0x6811('0xc'));var _=require(_0x6811('0xd'));var squel=require(_0x6811('0xe'));var crypto=require('crypto');var jsforce=require(_0x6811('0xf'));var deskjs=require(_0x6811('0x10'));var toCsv=require(_0x6811('0xa'));var querystring=require(_0x6811('0x11'));var Papa=require('papaparse');var Redis=require(_0x6811('0x12'));var authService=require(_0x6811('0x13'));var qs=require(_0x6811('0x14'));var as=require(_0x6811('0x15'));var hardwareService=require(_0x6811('0x16'));var logger=require(_0x6811('0x17'))(_0x6811('0x18'));var utils=require(_0x6811('0x19'));var config=require(_0x6811('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6811('0x1b'))['db'];function respondWithStatusCode(_0x2d9422,_0x3778ef){_0x3778ef=_0x3778ef||0xcc;return function(_0xa8c705){if(_0xa8c705){return _0x2d9422[_0x6811('0x1c')](_0x3778ef);}return _0x2d9422[_0x6811('0x1d')](_0x3778ef)['end']();};}function respondWithResult(_0x4f20ee,_0x566aba){_0x566aba=_0x566aba||0xc8;return function(_0x3bc9ab){if(_0x3bc9ab){return _0x4f20ee['status'](_0x566aba)[_0x6811('0x1e')](_0x3bc9ab);}};}function respondWithFilteredResult(_0x155735,_0x251307){return function(_0x4ba590){if(_0x4ba590){var _0x1cbd59=typeof _0x251307['offset']==='undefined'&&typeof _0x251307[_0x6811('0x1f')]===_0x6811('0x20');var _0x1d2a29=_0x4ba590[_0x6811('0x21')];var _0x36b24d=_0x1cbd59?0x0:_0x251307[_0x6811('0x22')];var _0x30f59e=_0x1cbd59?_0x4ba590[_0x6811('0x21')]:_0x251307[_0x6811('0x22')]+_0x251307[_0x6811('0x1f')];var _0x32ab74;if(_0x30f59e>=_0x1d2a29){_0x30f59e=_0x1d2a29;_0x32ab74=0xc8;}else{_0x32ab74=0xce;}_0x155735['status'](_0x32ab74);return _0x155735['set'](_0x6811('0x23'),_0x36b24d+'-'+_0x30f59e+'/'+_0x1d2a29)['json'](_0x4ba590);}return null;};}function patchUpdates(_0x39efbf){return function(_0x3913c7){try{jsonpatch[_0x6811('0x24')](_0x3913c7,_0x39efbf,!![]);}catch(_0x4e14c0){return BPromise[_0x6811('0x25')](_0x4e14c0);}return _0x3913c7[_0x6811('0x26')]();};}function saveUpdates(_0x1bc23d,_0x14173e){return function(_0xec9630){if(_0xec9630){return _0xec9630[_0x6811('0x27')](_0x1bc23d)[_0x6811('0x28')](function(_0x4a4e2d){return _0x4a4e2d;});}return null;};}function removeEntity(_0x371b81,_0x307517){return function(_0x280ce9){if(_0x280ce9){return _0x280ce9[_0x6811('0x29')]()[_0x6811('0x28')](function(){_0x371b81['status'](0xcc)[_0x6811('0x2a')]();});}};}function handleEntityNotFound(_0x4ca39e,_0x25d59b){return function(_0xc4ade2){if(!_0xc4ade2){_0x4ca39e[_0x6811('0x1c')](0x194);}return _0xc4ade2;};}function handleError(_0x4829e8,_0x3487a4){_0x3487a4=_0x3487a4||0x1f4;return function(_0x1f0d79){logger[_0x6811('0x2b')](_0x1f0d79[_0x6811('0x2c')]);if(_0x1f0d79[_0x6811('0x2d')]){delete _0x1f0d79[_0x6811('0x2d')];}_0x4829e8[_0x6811('0x1d')](_0x3487a4)[_0x6811('0x2e')](_0x1f0d79);};}exports[_0x6811('0x2f')]=function(_0x115c23,_0x418f01){var _0x2195d6={},_0x5a5b26={},_0x5cd140={'count':0x0,'rows':[]};var _0x37d849=_['map'](db[_0x6811('0x30')][_0x6811('0x31')],function(_0x28cc57){return{'name':_0x28cc57['fieldName'],'type':_0x28cc57[_0x6811('0x32')][_0x6811('0x33')]};});_0x5a5b26[_0x6811('0x34')]=_['map'](_0x37d849,_0x6811('0x2d'));_0x5a5b26[_0x6811('0x35')]=_[_0x6811('0x36')](_0x115c23[_0x6811('0x35')]);_0x5a5b26[_0x6811('0x37')]=_[_0x6811('0x38')](_0x5a5b26['model'],_0x5a5b26[_0x6811('0x35')]);_0x2195d6[_0x6811('0x39')]=_[_0x6811('0x38')](_0x5a5b26[_0x6811('0x34')],qs[_0x6811('0x3a')](_0x115c23[_0x6811('0x35')][_0x6811('0x3a')]));_0x2195d6[_0x6811('0x39')]=_0x2195d6['attributes']['length']?_0x2195d6[_0x6811('0x39')]:_0x5a5b26[_0x6811('0x34')];if(!_0x115c23[_0x6811('0x35')][_0x6811('0x3b')](_0x6811('0x3c'))){_0x2195d6['limit']=qs[_0x6811('0x1f')](_0x115c23[_0x6811('0x35')][_0x6811('0x1f')]);_0x2195d6['offset']=qs['offset'](_0x115c23[_0x6811('0x35')][_0x6811('0x22')]);}_0x2195d6[_0x6811('0x3d')]=qs[_0x6811('0x3e')](_0x115c23[_0x6811('0x35')][_0x6811('0x3e')]);_0x2195d6[_0x6811('0x3f')]=qs[_0x6811('0x37')](_['pick'](_0x115c23[_0x6811('0x35')],_0x5a5b26[_0x6811('0x37')]),_0x37d849);if(_0x115c23[_0x6811('0x35')][_0x6811('0x40')]){_0x2195d6[_0x6811('0x3f')]=_[_0x6811('0x41')](_0x2195d6[_0x6811('0x3f')],{'$or':_[_0x6811('0x42')](_0x37d849,function(_0x1a9126){if(_0x1a9126[_0x6811('0x32')]!==_0x6811('0x43')){var _0x2dbd42={};_0x2dbd42[_0x1a9126[_0x6811('0x2d')]]={'$like':'%'+_0x115c23[_0x6811('0x35')][_0x6811('0x40')]+'%'};return _0x2dbd42;}})});}_0x2195d6=_[_0x6811('0x41')]({},_0x2195d6,_0x115c23[_0x6811('0x44')]);var _0x30f47f={'where':_0x2195d6['where']};return db[_0x6811('0x30')][_0x6811('0x21')](_0x30f47f)[_0x6811('0x28')](function(_0x4f993b){_0x5cd140['count']=_0x4f993b;if(_0x115c23['query'][_0x6811('0x45')]){_0x2195d6[_0x6811('0x46')]=[{'all':!![]}];}return db[_0x6811('0x30')]['findAll'](_0x2195d6);})[_0x6811('0x28')](function(_0x464c63){_0x5cd140['rows']=_0x464c63;return _0x5cd140;})[_0x6811('0x28')](respondWithFilteredResult(_0x418f01,_0x2195d6))[_0x6811('0x47')](handleError(_0x418f01,null));};exports[_0x6811('0x48')]=function(_0x49114e,_0x3d2d6b){var _0x302c5a={'raw':!![],'where':{'id':_0x49114e['params']['id']}},_0x411172={};_0x411172[_0x6811('0x34')]=_[_0x6811('0x36')](db['Attachment'][_0x6811('0x31')]);_0x411172[_0x6811('0x35')]=_[_0x6811('0x36')](_0x49114e[_0x6811('0x35')]);_0x411172[_0x6811('0x37')]=_['intersection'](_0x411172[_0x6811('0x34')],_0x411172[_0x6811('0x35')]);_0x302c5a[_0x6811('0x39')]=_[_0x6811('0x38')](_0x411172[_0x6811('0x34')],qs[_0x6811('0x3a')](_0x49114e[_0x6811('0x35')][_0x6811('0x3a')]));_0x302c5a['attributes']=_0x302c5a[_0x6811('0x39')]['length']?_0x302c5a['attributes']:_0x411172[_0x6811('0x34')];if(_0x49114e['query'][_0x6811('0x45')]){_0x302c5a[_0x6811('0x46')]=[{'all':!![]}];}_0x302c5a=_['merge']({},_0x302c5a,_0x49114e[_0x6811('0x44')]);return db[_0x6811('0x30')][_0x6811('0x49')](_0x302c5a)[_0x6811('0x28')](handleEntityNotFound(_0x3d2d6b,null))[_0x6811('0x28')](respondWithResult(_0x3d2d6b,null))[_0x6811('0x47')](handleError(_0x3d2d6b,null));};exports[_0x6811('0x4a')]=function(_0x409c84,_0x4d5205){var _0x166fee={'where':{'id':_0x409c84[_0x6811('0x4b')]['id']}},_0x5708f3={};_0x5708f3[_0x6811('0x34')]=_['keys'](db[_0x6811('0x30')]['rawAttributes']);_0x166fee[_0x6811('0x39')]=_[_0x6811('0x38')](_0x5708f3[_0x6811('0x34')],qs['fields'](_0x409c84[_0x6811('0x35')][_0x6811('0x3a')]));_0x166fee[_0x6811('0x39')]=_0x166fee[_0x6811('0x39')][_0x6811('0x4c')]?_0x166fee[_0x6811('0x39')]:_0x5708f3['model'];if(_0x409c84[_0x6811('0x35')]['includeAll']){_0x166fee[_0x6811('0x46')]=[{'all':!![]}];}_0x166fee=_[_0x6811('0x41')]({},_0x166fee,_0x409c84[_0x6811('0x44')]);return db[_0x6811('0x30')][_0x6811('0x49')](_0x166fee)[_0x6811('0x28')](handleEntityNotFound(_0x4d5205,null))[_0x6811('0x28')](function(_0x2ee6d3){if(_0x2ee6d3){var _0x381ba2=_0x2ee6d3['get']({'plain':!![]});_0x381ba2=qs[_0x6811('0x4d')](_0x381ba2,['id',_0x6811('0x4e'),_0x6811('0x4f')]);_0x409c84['body']=_[_0x6811('0x4d')](_0x409c84[_0x6811('0x50')],['id',_0x6811('0x4e'),_0x6811('0x4f')]);return db[_0x6811('0x30')][_0x6811('0x51')](_[_0x6811('0x41')](_0x381ba2,_0x409c84[_0x6811('0x50')]),{'include':_0x409c84[_0x6811('0x35')][_0x6811('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4d5205,0xc9))[_0x6811('0x47')](handleError(_0x4d5205,null));};exports[_0x6811('0x27')]=function(_0x152fcc,_0x2119b3){if(_0x152fcc[_0x6811('0x50')]['id']){delete _0x152fcc[_0x6811('0x50')]['id'];}return db[_0x6811('0x30')][_0x6811('0x49')]({'where':{'id':_0x152fcc[_0x6811('0x4b')]['id']}})[_0x6811('0x28')](handleEntityNotFound(_0x2119b3,null))['then'](saveUpdates(_0x152fcc[_0x6811('0x50')],null))[_0x6811('0x28')](respondWithResult(_0x2119b3,null))[_0x6811('0x47')](handleError(_0x2119b3,null));};exports['destroy']=function(_0x6a6ed2,_0x198cd9){return db['Attachment'][_0x6811('0x49')]({'where':{'id':_0x6a6ed2['params']['id']}})[_0x6811('0x28')](handleEntityNotFound(_0x198cd9,null))[_0x6811('0x28')](removeEntity(_0x198cd9,null))[_0x6811('0x47')](handleError(_0x198cd9,null));};exports['create']=function(_0x337eec,_0x50f7f3,_0x40cb99){_0x337eec[_0x6811('0x50')]['name']=_0x337eec[_0x6811('0x52')][_0x6811('0x53')];_0x337eec[_0x6811('0x50')]['basename']=_0x337eec[_0x6811('0x52')][_0x6811('0x54')];_0x337eec[_0x6811('0x50')][_0x6811('0x32')]=_0x337eec['file'][_0x6811('0x55')];return db[_0x6811('0x30')][_0x6811('0x51')](_0x337eec['body'])[_0x6811('0x28')](respondWithResult(_0x50f7f3,0xc9))[_0x6811('0x47')](handleError(_0x50f7f3,null));};exports[_0x6811('0x56')]=function(_0x171b76,_0x970a19,_0x32a18d){return db[_0x6811('0x30')][_0x6811('0x57')]({'where':{'id':_0x171b76[_0x6811('0x4b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x970a19,null))[_0x6811('0x28')](function(_0x245ce2){if(_0x245ce2){var _0x35ddd4=_0x245ce2['ChatOfflineMessageId']!==null;var _0x27b9cd=path[_0x6811('0x58')](config['root'],_0x6811('0x59'));if(_0x35ddd4){_0x27b9cd=path[_0x6811('0x58')](_0x27b9cd,_0x6811('0x5a'));}var _0xc9fe3=path[_0x6811('0x58')](_0x27b9cd,_0x245ce2[_0x6811('0x5b')]);return _0x970a19[_0x6811('0x56')](_0xc9fe3);}})[_0x6811('0x47')](handleError(_0x970a19,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index c4501be..8990b09 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 _0xb877=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x10ab7e,_0x3d0349){var _0x3acecf=function(_0xb4fa82){while(--_0xb4fa82){_0x10ab7e['push'](_0x10ab7e['shift']());}};_0x3acecf(++_0x3d0349);}(_0xb877,0x19b));var _0x7b87=function(_0x186214,_0x1e5ad4){_0x186214=_0x186214-0x0;var _0x434495=_0xb877[_0x186214];return _0x434495;};'use strict';var _=require('lodash');var util=require(_0x7b87('0x0'));var logger=require(_0x7b87('0x1'))('api');var moment=require(_0x7b87('0x2'));var BPromise=require(_0x7b87('0x3'));var rp=require(_0x7b87('0x4'));var fs=require('fs');var path=require(_0x7b87('0x5'));var rimraf=require(_0x7b87('0x6'));var config=require(_0x7b87('0x7'));var attributes=require(_0x7b87('0x8'));module[_0x7b87('0x9')]=function(_0x2f6031,_0x25bd58){return _0x2f6031[_0x7b87('0xa')](_0x7b87('0xb'),attributes,{'tableName':_0x7b87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x037e=['request-promise','path','rimraf','../../config/environment','define','attachments','util','../../config/logger','api','moment','bluebird'];(function(_0x2c6f39,_0x3f9fb9){var _0x8e2c52=function(_0x2217ca){while(--_0x2217ca){_0x2c6f39['push'](_0x2c6f39['shift']());}};_0x8e2c52(++_0x3f9fb9);}(_0x037e,0x171));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe037('0x0'));var logger=require(_0xe037('0x1'))(_0xe037('0x2'));var moment=require(_0xe037('0x3'));var BPromise=require(_0xe037('0x4'));var rp=require(_0xe037('0x5'));var fs=require('fs');var path=require(_0xe037('0x6'));var rimraf=require(_0xe037('0x7'));var config=require(_0xe037('0x8'));var attributes=require('./attachment.attributes');module['exports']=function(_0x1725d9,_0x292222){return _0x1725d9[_0xe037('0x9')]('Attachment',attributes,{'tableName':_0xe037('0xa'),'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 47d1117..e0a3282 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 _0xc874=['Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateAttachment','Attachment','create','body','options','raw','then','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x1e182d,_0x4f35c2){var _0x5627c6=function(_0x12b34c){while(--_0x12b34c){_0x1e182d['push'](_0x1e182d['shift']());}};_0x5627c6(++_0x4f35c2);}(_0xc874,0x154));var _0x4c87=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0xc874[_0x3c81b5];return _0x5888c4;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var moment=require(_0x4c87('0x1'));var BPromise=require(_0x4c87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c87('0x3'))['db'];var utils=require(_0x4c87('0x4'));var logger=require(_0x4c87('0x5'))('rpc');var config=require(_0x4c87('0x6'));var jayson=require(_0x4c87('0x7'));var client=jayson['client'][_0x4c87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dafe0,_0x30c939,_0xdc4a29){return new BPromise(function(_0x116649,_0x5b7720){return client[_0x4c87('0x9')](_0x3dafe0,_0xdc4a29)['then'](function(_0x384268){logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,_0x4c87('0xc'));logger[_0x4c87('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x30c939,_0x4c87('0xc'),JSON[_0x4c87('0xe')](_0x384268));if(_0x384268['error']){if(_0x384268[_0x4c87('0xf')][_0x4c87('0x10')]===0x1f4){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')]['message']);return _0x5b7720(_0x384268['error']['message']);}logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);return _0x116649(_0x384268[_0x4c87('0xf')][_0x4c87('0x11')]);}else{logger[_0x4c87('0xa')](_0x4c87('0xb'),_0x30c939,'request\x20sent');_0x116649(_0x384268[_0x4c87('0x12')][_0x4c87('0x11')]);}})['catch'](function(_0x575de5){logger[_0x4c87('0xf')](_0x4c87('0xb'),_0x30c939,_0x575de5);_0x5b7720(_0x575de5);});});}exports[_0x4c87('0x13')]=function(_0x547d92){var _0x428144=this;return new Promise(function(_0x561441,_0x9bc75f){return db[_0x4c87('0x14')][_0x4c87('0x15')](_0x547d92[_0x4c87('0x16')],{'raw':_0x547d92['options']?_0x547d92[_0x4c87('0x17')][_0x4c87('0x18')]===undefined?!![]:![]:!![]})[_0x4c87('0x19')](function(_0x3f27d4){logger[_0x4c87('0xa')](_0x4c87('0x13'),_0x547d92);logger[_0x4c87('0xd')](_0x4c87('0x13'),_0x547d92,JSON['stringify'](_0x3f27d4));_0x561441(_0x3f27d4);})[_0x4c87('0x1a')](function(_0x33aafd){logger['error'](_0x4c87('0x13'),_0x33aafd[_0x4c87('0x11')],_0x547d92);_0x9bc75f(_0x428144['error'](0x1f4,_0x33aafd[_0x4c87('0x11')]));});});};
\ No newline at end of file
+var _0xf25a=['Attachment','create','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateAttachment'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xf25a,0x195));var _0xaf25=function(_0x31db5b,_0x4014dc){_0x31db5b=_0x31db5b-0x0;var _0xff1d36=_0xf25a[_0x31db5b];return _0xff1d36;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var moment=require(_0xaf25('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf25('0x3'));var fs=require('fs');var Redis=require(_0xaf25('0x4'));var db=require(_0xaf25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf25('0x6'))(_0xaf25('0x7'));var config=require(_0xaf25('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c6e6,_0x4b7258,_0x457ba5){return new BPromise(function(_0x41b3cd,_0x61e8d){return client['request'](_0x48c6e6,_0x457ba5)[_0xaf25('0xa')](function(_0x24ac0a){logger[_0xaf25('0xb')](_0xaf25('0xc'),_0x4b7258,_0xaf25('0xd'));logger['debug'](_0xaf25('0xe'),_0x4b7258,_0xaf25('0xd'),JSON[_0xaf25('0xf')](_0x24ac0a));if(_0x24ac0a[_0xaf25('0x10')]){if(_0x24ac0a['error']['code']===0x1f4){logger[_0xaf25('0x10')](_0xaf25('0xc'),_0x4b7258,_0x24ac0a[_0xaf25('0x10')][_0xaf25('0x11')]);return _0x61e8d(_0x24ac0a[_0xaf25('0x10')]['message']);}logger['error'](_0xaf25('0xc'),_0x4b7258,_0x24ac0a['error'][_0xaf25('0x11')]);return _0x41b3cd(_0x24ac0a[_0xaf25('0x10')][_0xaf25('0x11')]);}else{logger[_0xaf25('0xb')]('Attachment,\x20%s,\x20%s',_0x4b7258,_0xaf25('0xd'));_0x41b3cd(_0x24ac0a['result']['message']);}})[_0xaf25('0x12')](function(_0x4b396d){logger[_0xaf25('0x10')](_0xaf25('0xc'),_0x4b7258,_0x4b396d);_0x61e8d(_0x4b396d);});});}exports[_0xaf25('0x13')]=function(_0x2c815a){var _0x28bb0e=this;return new Promise(function(_0x10ed9a,_0x615537){return db[_0xaf25('0x14')][_0xaf25('0x15')](_0x2c815a[_0xaf25('0x16')],{'raw':_0x2c815a['options']?_0x2c815a[_0xaf25('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf25('0xa')](function(_0x396af4){logger[_0xaf25('0xb')](_0xaf25('0x13'),_0x2c815a);logger[_0xaf25('0x18')](_0xaf25('0x13'),_0x2c815a,JSON[_0xaf25('0xf')](_0x396af4));_0x10ed9a(_0x396af4);})[_0xaf25('0x12')](function(_0x2d8b66){logger[_0xaf25('0x10')](_0xaf25('0x13'),_0x2d8b66[_0xaf25('0x11')],_0x2c815a);_0x615537(_0x28bb0e[_0xaf25('0x10')](0x1f4,_0x2d8b66[_0xaf25('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 5f27430..dacf01d 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x292a7a,_0x3ac93e){_0x292a7a=_0x292a7a-0x0;var _0x1771d3=_0xdb28[_0x292a7a];return _0x1771d3;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x202c32,_0x55471d){var _0x1a44dd=function(_0x4ef989){while(--_0x4ef989){_0x202c32['push'](_0x202c32['shift']());}};_0x1a44dd(++_0x55471d);}(_0xadb5,0xad));var _0x5adb=function(_0x59fc43,_0x3801d1){_0x59fc43=_0x59fc43-0x0;var _0x4b40f3=_0xadb5[_0x59fc43];return _0x4b40f3;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 13f0aa9..e5e1b91 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 _0x9ece=['blockedAt','add','minutes','clearBlockUser','getLicense','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','authenticate','google','/login','profile','email','use','clientID','secret','callbackURL','Setting','blockDuration','then','User','find','map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked'];(function(_0x4f3f71,_0x1e35ce){var _0x559c25=function(_0x1d874e){while(--_0x1d874e){_0x4f3f71['push'](_0x4f3f71['shift']());}};_0x559c25(++_0x1e35ce);}(_0x9ece,0x159));var _0xe9ec=function(_0x8ccbf0,_0x3317aa){_0x8ccbf0=_0x8ccbf0-0x0;var _0x3e7903=_0x9ece[_0x8ccbf0];return _0x3e7903;};'use strict';var _=require('lodash');var passport=require(_0xe9ec('0x0'));var GoogleStrategy=require(_0xe9ec('0x1'))[_0xe9ec('0x2')];var moment=require(_0xe9ec('0x3'));var db=require(_0xe9ec('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xe9ec('0x5'))[_0xe9ec('0x6')];var utils=require('../../config/utils');exports['login']=passport[_0xe9ec('0x7')](_0xe9ec('0x8'),{'failureRedirect':_0xe9ec('0x9'),'scope':[_0xe9ec('0xa'),_0xe9ec('0xb')],'session':![]});exports['callback']=passport[_0xe9ec('0x7')](_0xe9ec('0x8'),{'failureRedirect':_0xe9ec('0x9'),'session':![]});passport[_0xe9ec('0xc')](new GoogleStrategy({'clientID':config[_0xe9ec('0x8')]?config[_0xe9ec('0x8')][_0xe9ec('0xd')]:'id','clientSecret':config[_0xe9ec('0x8')]?config[_0xe9ec('0x8')]['clientSecret']:_0xe9ec('0xe'),'callbackURL':config[_0xe9ec('0x8')]?config['google'][_0xe9ec('0xf')]:''},function(_0x38cd5b,_0x1abf96,_0x29feaf,_0x57d1a9){var _0x3a7a80,_0xf7d25a;return db[_0xe9ec('0x10')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9ec('0x11')],'raw':!![]})[_0xe9ec('0x12')](function(_0x1a428b){_0x3a7a80=_0x1a428b;return db[_0xe9ec('0x13')][_0xe9ec('0x14')]({'where':{'email':_[_0xe9ec('0x15')](_0x29feaf[_0xe9ec('0x16')],'value'),'role':{'$or':[_0xe9ec('0x17'),_0xe9ec('0x18'),_0xe9ec('0x19')]}}});})[_0xe9ec('0x12')](function(_0x94a784){_0xf7d25a=_0x94a784;if(_0xf7d25a){if(_0xf7d25a[_0xe9ec('0x1a')]){return _0x57d1a9(_0xe9ec('0x1b'));}else if(_0x3a7a80[_0xe9ec('0x11')]>0x0){if(_0xf7d25a[_0xe9ec('0x1c')]){if(moment(_0xf7d25a[_0xe9ec('0x1d')])[_0xe9ec('0x1e')](_0x3a7a80[_0xe9ec('0x11')],_0xe9ec('0x1f'))>moment()){return _0x57d1a9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xe9ec('0x20')](_0xf7d25a,0x0,![],null)[_0xe9ec('0x12')](function(){return utils[_0xe9ec('0x21')](_0xf7d25a);})[_0xe9ec('0x12')](function(){return _0x57d1a9(null,_0xf7d25a);});}}else{return utils[_0xe9ec('0x21')](_0xf7d25a)[_0xe9ec('0x12')](function(){return _0x57d1a9(null,_0xf7d25a);});}}else{return utils[_0xe9ec('0x21')](_0xf7d25a)['then'](function(){return _0x57d1a9(null,_0xf7d25a);});}}return _0x57d1a9(_0xe9ec('0x1b'));})['catch'](function(_0x5e173b){_0x57d1a9(_0x5e173b);});}));
\ No newline at end of file
+var _0x91d1=['admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','Setting','allowedLoginAttempts','blockDuration','then','find','value'];(function(_0x56c18d,_0x2bf58c){var _0x4f6673=function(_0x44f644){while(--_0x44f644){_0x56c18d['push'](_0x56c18d['shift']());}};_0x4f6673(++_0x2bf58c);}(_0x91d1,0x74));var _0x191d=function(_0x321575,_0x2feea4){_0x321575=_0x321575-0x0;var _0x48e024=_0x91d1[_0x321575];return _0x48e024;};'use strict';var _=require(_0x191d('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x191d('0x1'))['Strategy'];var moment=require(_0x191d('0x2'));var db=require(_0x191d('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0x191d('0x4'))[_0x191d('0x5')];var utils=require(_0x191d('0x6'));exports[_0x191d('0x7')]=passport[_0x191d('0x8')](_0x191d('0x9'),{'failureRedirect':_0x191d('0xa'),'scope':[_0x191d('0xb'),_0x191d('0xc')],'session':![]});exports[_0x191d('0xd')]=passport[_0x191d('0x8')]('google',{'failureRedirect':_0x191d('0xa'),'session':![]});passport[_0x191d('0xe')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x191d('0xf')]:'id','clientSecret':config[_0x191d('0x9')]?config[_0x191d('0x9')][_0x191d('0x10')]:_0x191d('0x11'),'callbackURL':config[_0x191d('0x9')]?config[_0x191d('0x9')]['callbackURL']:''},function(_0x10a97e,_0x424405,_0x2ee6af,_0x95b7eb){var _0x14c29d,_0x3d0efb;return db[_0x191d('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x191d('0x13'),_0x191d('0x14')],'raw':!![]})[_0x191d('0x15')](function(_0x581f41){_0x14c29d=_0x581f41;return db['User'][_0x191d('0x16')]({'where':{'email':_['map'](_0x2ee6af['emails'],_0x191d('0x17')),'role':{'$or':[_0x191d('0x18'),'user',_0x191d('0x19')]}}});})[_0x191d('0x15')](function(_0x515fb3){_0x3d0efb=_0x515fb3;if(_0x3d0efb){if(_0x3d0efb[_0x191d('0x1a')]){return _0x95b7eb(_0x191d('0x1b'));}else if(_0x14c29d['blockDuration']>0x0){if(_0x3d0efb[_0x191d('0x1c')]){if(moment(_0x3d0efb[_0x191d('0x1d')])[_0x191d('0x1e')](_0x14c29d[_0x191d('0x14')],_0x191d('0x1f'))>moment()){return _0x95b7eb(_0x191d('0x1b'));}else{return utils[_0x191d('0x20')](_0x3d0efb,0x0,![],null)[_0x191d('0x15')](function(){return utils['getLicense'](_0x3d0efb);})[_0x191d('0x15')](function(){return _0x95b7eb(null,_0x3d0efb);});}}else{return utils['getLicense'](_0x3d0efb)[_0x191d('0x15')](function(){return _0x95b7eb(null,_0x3d0efb);});}}else{return utils[_0x191d('0x21')](_0x3d0efb)[_0x191d('0x15')](function(){return _0x95b7eb(null,_0x3d0efb);});}}return _0x95b7eb(_0x191d('0x1b'));})[_0x191d('0x22')](function(_0x128e5c){_0x95b7eb(_0x128e5c);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index ceb18e7..deedf44 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 _0x3404=['exports','express','passport','Router','../user/user.controller.js','get','login','/callback','callback','isMiddleware'];(function(_0x287868,_0x4623bf){var _0x5703ee=function(_0x3d8a91){while(--_0x3d8a91){_0x287868['push'](_0x287868['shift']());}};_0x5703ee(++_0x4623bf);}(_0x3404,0xc9));var _0x4340=function(_0x58a907,_0x3928a5){_0x58a907=_0x58a907-0x0;var _0x41ca9a=_0x3404[_0x58a907];return _0x41ca9a;};'use strict';var express=require(_0x4340('0x0'));var passport=require(_0x4340('0x1'));var router=express[_0x4340('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x4340('0x3'));var authService=require('../../components/auth/service');router[_0x4340('0x4')]('/',controller[_0x4340('0x5')]);router[_0x4340('0x4')](_0x4340('0x6'),controller[_0x4340('0x7')],authService[_0x4340('0x8')],userController[_0x4340('0x5')],authService['setTokenCookie']);module[_0x4340('0x9')]=router;
\ No newline at end of file
+var _0x0abe=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login'];(function(_0x1d848d,_0x4514e6){var _0x3d71d7=function(_0x4233eb){while(--_0x4233eb){_0x1d848d['push'](_0x1d848d['shift']());}};_0x3d71d7(++_0x4514e6);}(_0x0abe,0x14a));var _0xe0ab=function(_0x2999d3,_0x3689f9){_0x2999d3=_0x2999d3-0x0;var _0x2aa91c=_0x0abe[_0x2999d3];return _0x2aa91c;};'use strict';var express=require('express');var passport=require(_0xe0ab('0x0'));var router=express[_0xe0ab('0x1')]();var controller=require(_0xe0ab('0x2'));var userController=require(_0xe0ab('0x3'));var authService=require(_0xe0ab('0x4'));router['get']('/',controller['login']);router[_0xe0ab('0x5')](_0xe0ab('0x6'),controller[_0xe0ab('0x7')],authService[_0xe0ab('0x8')],userController[_0xe0ab('0x9')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 45ef7c9..9edd4ce 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 _0xd681=['Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','merge','format','name','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local','role','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','https://','/reset/','status','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd681,0x13b));var _0x1d68=function(_0x1c1803,_0x33b31e){_0x1c1803=_0x1c1803-0x0;var _0x522ba0=_0xd681[_0x1c1803];return _0x522ba0;};'use strict';var util=require('util');var passport=require(_0x1d68('0x0'));var LocalStrategy=require('passport-local')[_0x1d68('0x1')];var jayson=require('jayson/promise');var _=require(_0x1d68('0x2'));var rs=require(_0x1d68('0x3'));var moment=require(_0x1d68('0x4'));var db=require(_0x1d68('0x5'))['db'];var authService=require(_0x1d68('0x6'));var utils=require(_0x1d68('0x7'));var client=jayson[_0x1d68('0x8')][_0x1d68('0x9')]({'port':0x232b});function localAuthenticate(_0x2f8816,_0x2d2a0d,_0x5bdcbd,_0x3e2e1e){var _0x28193c,_0x166de2;return db[_0x1d68('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x1d68('0xb'),_0x1d68('0xc')],'raw':!![]})[_0x1d68('0xd')](function(_0x5c50f5){_0x28193c=_0x5c50f5;return _0x2f8816[_0x1d68('0xe')]({'attributes':['id','name',_0x1d68('0xf'),_0x1d68('0x10'),'role','disabled','blocked',_0x1d68('0x11'),'loginAttempts'],'where':{'name':_0x2d2a0d,'role':{'$or':['admin',_0x1d68('0x12'),_0x1d68('0x13')]}}});})['then'](function(_0x4b0659){if(!_0x4b0659||_0x4b0659&&_0x4b0659['name']!==_0x2d2a0d){throw new Error(_0x1d68('0x14'));}else{_0x166de2=_0x4b0659;return _0x166de2;}})[_0x1d68('0xd')](function(){_0x166de2[_0x1d68('0x15')](_0x5bdcbd,function(_0x3bf44f,_0x1c262e){var _0x4c2edc=_0x166de2['loginAttempts']+0x1;if(_0x3bf44f){return _0x3e2e1e(_0x3bf44f);}else if(!_0x1c262e){if(_0x166de2['disabled']){return _0x3e2e1e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x28193c[_0x1d68('0xb')]>0x0){if(_0x166de2[_0x1d68('0x16')]){if(_0x28193c['blockDuration']>0x0){if(moment(_0x166de2[_0x1d68('0x11')])[_0x1d68('0x17')](_0x28193c['blockDuration'],_0x1d68('0x18'))>moment()){return _0x3e2e1e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1d68('0x19')](_0x166de2,_0x4c2edc,![],null)[_0x1d68('0xd')](function(){return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});});}}else{return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});}}else{if(_0x4c2edc>=_0x28193c[_0x1d68('0xb')]){return utils['clearBlockUser'](_0x166de2,0x0,!![],moment())[_0x1d68('0xd')](function(){return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});});}else{return utils[_0x1d68('0x19')](_0x166de2,_0x4c2edc,![],null)[_0x1d68('0xd')](function(){return _0x3e2e1e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});}}else{if(_0x166de2[_0x1d68('0x1a')]){return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});}else if(_0x28193c[_0x1d68('0xb')]>0x0){if(_0x166de2[_0x1d68('0x16')]){if(_0x28193c[_0x1d68('0xc')]>0x0){if(moment(_0x166de2[_0x1d68('0x11')])[_0x1d68('0x17')](_0x28193c['blockDuration'],_0x1d68('0x18'))>moment()){return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});}else{return utils[_0x1d68('0x19')](_0x166de2,0x0,![],null)[_0x1d68('0xd')](function(){return utils[_0x1d68('0x1b')](_0x166de2);})[_0x1d68('0xd')](function(){return _0x3e2e1e(null,_0x166de2);});}}else{return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});}}else{return utils['clearBlockUser'](_0x166de2,0x0,![],null)[_0x1d68('0xd')](function(){return utils[_0x1d68('0x1b')](_0x166de2);})['then'](function(){return _0x3e2e1e(null,_0x166de2);})[_0x1d68('0x1c')](function(_0x26d74c){return _0x3e2e1e(null,![],_0x26d74c);});}}else{if(_0x166de2['blocked']){return _0x3e2e1e(null,![],{'message':_0x1d68('0x14')});}else{return utils[_0x1d68('0x1b')](_0x166de2)['then'](function(){return _0x3e2e1e(null,_0x166de2);});}}}});})[_0x1d68('0x1c')](function(_0x30ffaf){return _0x3e2e1e(null,![],_0x30ffaf);});}function sendServiceMail(_0x4cfef7){return db[_0x1d68('0x1d')][_0x1d68('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x1d68('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x1d68('0x20')}]})[_0x1d68('0xd')](function(_0x1f364c){if(!_0x1f364c){throw new Error(_0x1d68('0x21'));}var _0x2c037c={'tls':{'rejectUnauthorized':![]}};if(_0x1f364c['Smtp'][_0x1d68('0x22')]){_0x2c037c['service']=_0x1f364c[_0x1d68('0x20')]['service'];}else{_0x2c037c[_0x1d68('0x23')]=_0x1f364c[_0x1d68('0x20')][_0x1d68('0x23')];_0x2c037c[_0x1d68('0x24')]=_0x1f364c[_0x1d68('0x20')]['port'];_0x2c037c[_0x1d68('0x25')]=_0x1f364c[_0x1d68('0x20')]['secure'];}if(_0x1f364c['Smtp']['authentication']){_0x2c037c[_0x1d68('0x26')]={'user':_0x1f364c[_0x1d68('0x20')][_0x1d68('0x12')],'pass':_0x1f364c['Smtp']['pass']};}var _0x1f3bc0={'account':_0x2c037c,'message':_[_0x1d68('0x27')]({'from':util[_0x1d68('0x28')]('\x22%s\x22\x20<%s>',_0x1f364c[_0x1d68('0x29')],_0x1f364c[_0x1d68('0x1f')]||_0x1f364c[_0x1d68('0x20')][_0x1d68('0x12')])},_0x4cfef7)};return client[_0x1d68('0x2a')](_0x1d68('0x2b'),_0x1f3bc0);})[_0x1d68('0xd')](function(_0x2a570d){if(_0x2a570d[_0x1d68('0x2c')]){throw new Error(util[_0x1d68('0x28')](_0x1d68('0x2d'),_0x2a570d[_0x1d68('0x2c')][_0x1d68('0x2e')]||JSON[_0x1d68('0x2f')](_0x2a570d[_0x1d68('0x2c')])));}return!![];});}function handleError(_0x12f5d5,_0x37a547,_0x59c32f){return _0x12f5d5['status'](_0x37a547||0x1f4)[_0x1d68('0x30')]({'message':_0x59c32f?_0x59c32f['message']||_0x59c32f:''});}exports[_0x1d68('0x31')]=function(_0x1b03e1,_0x2d4153,_0x5a18c3){passport['authenticate'](_0x1d68('0x32'),function(_0x7bbf72,_0x49a52a,_0x487715){var _0x59ab10=_0x7bbf72||_0x487715;if(_0x59ab10){return handleError(_0x2d4153,0x191,_0x59ab10);}if(!_0x49a52a){return handleError(_0x2d4153,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x17c775={'payload':{'id':_0x49a52a['id'],'role':_0x49a52a[_0x1d68('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0x1d68('0x34')](_0x17c775)[_0x1d68('0xd')](function(_0x5ca293){_0x2d4153[_0x1d68('0x35')]({'id':_0x49a52a['id'],'token':_0x5ca293,'statusCall':'','isAlreadyLogged':_0x49a52a['online']});});}})(_0x1b03e1,_0x2d4153,_0x5a18c3);};exports[_0x1d68('0x36')]=function(_0x28cfa6,_0x1dbc24,_0x304943){if(!_0x28cfa6[_0x1d68('0x37')][_0x1d68('0x1f')]){return handleError(_0x1dbc24,0x1f4,{'message':_0x1d68('0x38')});}var _0x191ce3=rs[_0x1d68('0x39')]();_0x28cfa6[_0x1d68('0x37')][_0x1d68('0x1f')]=_0x28cfa6[_0x1d68('0x37')][_0x1d68('0x1f')][_0x1d68('0x3a')]()['toLowerCase']();var _0x37fe8f;return db[_0x1d68('0xa')][_0x1d68('0xe')]({'where':{'id':0x1},'attributes':[_0x1d68('0xb'),_0x1d68('0xc')],'raw':!![]})[_0x1d68('0xd')](function(_0x1db324){_0x37fe8f=_0x1db324;return db[_0x1d68('0x3b')][_0x1d68('0x1e')]({'where':{'email':_0x28cfa6['body'][_0x1d68('0x1f')]}});})[_0x1d68('0xd')](function(_0x51d025){if(!_0x51d025){throw new Error(_0x1d68('0x3c'));}if(_0x51d025[_0x1d68('0x1a')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x51d025[_0x1d68('0x16')]){if(moment(_0x51d025['blockedAt'])[_0x1d68('0x17')](_0x37fe8f[_0x1d68('0xc')],_0x1d68('0x18'))>moment()){throw new Error(_0x1d68('0x3d'));}else{_0x51d025[_0x1d68('0x16')]=![];_0x51d025[_0x1d68('0x11')]=null;}}_0x51d025[_0x1d68('0x3e')]=_0x191ce3;_0x51d025[_0x1d68('0x3f')]=Date[_0x1d68('0x40')]()+0x36ee80;return _0x51d025['save']();})[_0x1d68('0xd')](function(){return sendServiceMail({'to':_0x28cfa6['body'][_0x1d68('0x1f')],'subject':_0x1d68('0x41'),'text':'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'+_0x1d68('0x42')+_0x28cfa6['headers'][_0x1d68('0x23')]+_0x1d68('0x43')+_0x191ce3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x1dbc24[_0x1d68('0x44')](0xc8)[_0x1d68('0x30')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x20180e){return handleError(_0x1dbc24,0x1f4,_0x20180e);});};exports[_0x1d68('0x45')]=function(_0x566fb2,_0x46b436,_0x4e6f6d){return db[_0x1d68('0x3b')]['find']({'where':{'resetPasswordToken':_0x566fb2[_0x1d68('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0x1d68('0x40')]()}}})[_0x1d68('0xd')](function(_0x2dbcf3){if(!_0x2dbcf3){throw new Error(_0x1d68('0x47'));}return db[_0x1d68('0xa')]['findOne']({'attributes':['id',_0x1d68('0x48'),'enforcePasswordHistory',_0x1d68('0x49')]})['then'](function(_0x2f83d6){if(_0x2f83d6['securePassword'])authService[_0x1d68('0x4a')](_0x566fb2[_0x1d68('0x37')][_0x1d68('0xf')]);if(!_0x2f83d6['enforcePasswordHistory']||!_0x2dbcf3[_0x1d68('0x4b')])return _0x2dbcf3;authService[_0x1d68('0x4c')](_0x566fb2[_0x1d68('0x37')][_0x1d68('0xf')],_0x2dbcf3['previousPasswords'],_0x2f83d6[_0x1d68('0x49')]);return _0x2dbcf3;})['then'](function(){_0x2dbcf3[_0x1d68('0xf')]=_0x566fb2[_0x1d68('0x37')][_0x1d68('0xf')];_0x2dbcf3['resetPasswordToken']=null;_0x2dbcf3[_0x1d68('0x3f')]=null;return _0x2dbcf3['save']();});})[_0x1d68('0xd')](function(){_0x46b436[_0x1d68('0x44')](0xc8)[_0x1d68('0x30')]({'message':_0x1d68('0x4d')});})['catch'](function(_0x20bc81){return handleError(_0x46b436,0x1f4,_0x20bc81);});};passport[_0x1d68('0x4e')](new LocalStrategy({'usernameField':_0x1d68('0x29'),'passwordField':_0x1d68('0xf')},function(_0x5ab1cb,_0x1dc7f2,_0x33f97e){return localAuthenticate(db['User'],_0x5ab1cb,_0x1dc7f2,_0x33f97e);}));
\ No newline at end of file
+var _0xf925=['randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','blockDuration','findOne','name','salt','role','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','generate','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport'];(function(_0x3aaf7d,_0x110885){var _0x364c9e=function(_0x5b0aca){while(--_0x5b0aca){_0x3aaf7d['push'](_0x3aaf7d['shift']());}};_0x364c9e(++_0x110885);}(_0xf925,0x1a7));var _0x5f92=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0xf925[_0x3b1106];return _0x1fbeef;};'use strict';var util=require(_0x5f92('0x0'));var passport=require(_0x5f92('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x5f92('0x2'));var moment=require(_0x5f92('0x3'));var db=require(_0x5f92('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x5f92('0x5'));var client=jayson[_0x5f92('0x6')][_0x5f92('0x7')]({'port':0x232b});function localAuthenticate(_0x484788,_0x9cf95e,_0xd5b7f4,_0x28c227){var _0x40e627,_0x2277b2;return db[_0x5f92('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5f92('0x9')],'raw':!![]})['then'](function(_0x21b51a){_0x40e627=_0x21b51a;return _0x484788[_0x5f92('0xa')]({'attributes':['id',_0x5f92('0xb'),'password',_0x5f92('0xc'),_0x5f92('0xd'),'disabled',_0x5f92('0xe'),'blockedAt',_0x5f92('0xf')],'where':{'name':_0x9cf95e,'role':{'$or':[_0x5f92('0x10'),_0x5f92('0x11'),_0x5f92('0x12')]}}});})[_0x5f92('0x13')](function(_0x1c94d2){if(!_0x1c94d2||_0x1c94d2&&_0x1c94d2[_0x5f92('0xb')]!==_0x9cf95e){throw new Error(_0x5f92('0x14'));}else{_0x2277b2=_0x1c94d2;return _0x2277b2;}})['then'](function(){_0x2277b2[_0x5f92('0x15')](_0xd5b7f4,function(_0xc1d590,_0x285f96){var _0x32ccbb=_0x2277b2['loginAttempts']+0x1;if(_0xc1d590){return _0x28c227(_0xc1d590);}else if(!_0x285f96){if(_0x2277b2[_0x5f92('0x16')]){return _0x28c227(null,![],{'message':_0x5f92('0x14')});}else if(_0x40e627[_0x5f92('0x17')]>0x0){if(_0x2277b2[_0x5f92('0xe')]){if(_0x40e627['blockDuration']>0x0){if(moment(_0x2277b2[_0x5f92('0x18')])[_0x5f92('0x19')](_0x40e627[_0x5f92('0x9')],_0x5f92('0x1a'))>moment()){return _0x28c227(null,![],{'message':_0x5f92('0x14')});}else{return utils[_0x5f92('0x1b')](_0x2277b2,_0x32ccbb,![],null)['then'](function(){return _0x28c227(null,![],{'message':_0x5f92('0x14')});});}}else{return _0x28c227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x32ccbb>=_0x40e627[_0x5f92('0x17')]){return utils['clearBlockUser'](_0x2277b2,0x0,!![],moment())[_0x5f92('0x13')](function(){return _0x28c227(null,![],{'message':_0x5f92('0x14')});});}else{return utils[_0x5f92('0x1b')](_0x2277b2,_0x32ccbb,![],null)[_0x5f92('0x13')](function(){return _0x28c227(null,![],{'message':_0x5f92('0x14')});});}}}else{return _0x28c227(null,![],{'message':_0x5f92('0x14')});}}else{if(_0x2277b2[_0x5f92('0x16')]){return _0x28c227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x40e627[_0x5f92('0x17')]>0x0){if(_0x2277b2['blocked']){if(_0x40e627[_0x5f92('0x9')]>0x0){if(moment(_0x2277b2[_0x5f92('0x18')])[_0x5f92('0x19')](_0x40e627['blockDuration'],_0x5f92('0x1a'))>moment()){return _0x28c227(null,![],{'message':_0x5f92('0x14')});}else{return utils[_0x5f92('0x1b')](_0x2277b2,0x0,![],null)['then'](function(){return utils[_0x5f92('0x1c')](_0x2277b2);})[_0x5f92('0x13')](function(){return _0x28c227(null,_0x2277b2);});}}else{return _0x28c227(null,![],{'message':_0x5f92('0x14')});}}else{return utils[_0x5f92('0x1b')](_0x2277b2,0x0,![],null)['then'](function(){return utils[_0x5f92('0x1c')](_0x2277b2);})[_0x5f92('0x13')](function(){return _0x28c227(null,_0x2277b2);})['catch'](function(_0x273ccd){return _0x28c227(null,![],_0x273ccd);});}}else{if(_0x2277b2[_0x5f92('0xe')]){return _0x28c227(null,![],{'message':_0x5f92('0x14')});}else{return utils[_0x5f92('0x1c')](_0x2277b2)['then'](function(){return _0x28c227(null,_0x2277b2);});}}}});})[_0x5f92('0x1d')](function(_0x5210fb){return _0x28c227(null,![],_0x5210fb);});}function sendServiceMail(_0x23f5b8){return db[_0x5f92('0x1e')][_0x5f92('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x5f92('0xb'),_0x5f92('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x5f92('0x21')}]})['then'](function(_0x1b42c3){if(!_0x1b42c3){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x150b97={'tls':{'rejectUnauthorized':![]}};if(_0x1b42c3[_0x5f92('0x21')][_0x5f92('0x22')]){_0x150b97[_0x5f92('0x22')]=_0x1b42c3['Smtp'][_0x5f92('0x22')];}else{_0x150b97[_0x5f92('0x23')]=_0x1b42c3['Smtp'][_0x5f92('0x23')];_0x150b97['port']=_0x1b42c3[_0x5f92('0x21')][_0x5f92('0x24')];_0x150b97[_0x5f92('0x25')]=_0x1b42c3[_0x5f92('0x21')][_0x5f92('0x25')];}if(_0x1b42c3[_0x5f92('0x21')][_0x5f92('0x26')]){_0x150b97[_0x5f92('0x27')]={'user':_0x1b42c3[_0x5f92('0x21')][_0x5f92('0x11')],'pass':_0x1b42c3['Smtp'][_0x5f92('0x28')]};}var _0x973d95={'account':_0x150b97,'message':_[_0x5f92('0x29')]({'from':util[_0x5f92('0x2a')](_0x5f92('0x2b'),_0x1b42c3[_0x5f92('0xb')],_0x1b42c3[_0x5f92('0x20')]||_0x1b42c3[_0x5f92('0x21')][_0x5f92('0x11')])},_0x23f5b8)};return client[_0x5f92('0x2c')](_0x5f92('0x2d'),_0x973d95);})[_0x5f92('0x13')](function(_0xe4f5ad){if(_0xe4f5ad[_0x5f92('0x2e')]){throw new Error(util['format'](_0x5f92('0x2f'),_0xe4f5ad[_0x5f92('0x2e')][_0x5f92('0x30')]||JSON[_0x5f92('0x31')](_0xe4f5ad[_0x5f92('0x2e')])));}return!![];});}function handleError(_0x54ff4e,_0xda5613,_0x4fb864){return _0x54ff4e[_0x5f92('0x32')](_0xda5613||0x1f4)[_0x5f92('0x33')]({'message':_0x4fb864?_0x4fb864['message']||_0x4fb864:''});}exports[_0x5f92('0x34')]=function(_0x4fa6fb,_0x4ae1a8,_0x48301a){passport[_0x5f92('0x15')]('local',function(_0x1f5a2e,_0x2c9cb1,_0x217512){var _0x22d2cf=_0x1f5a2e||_0x217512;if(_0x22d2cf){return handleError(_0x4ae1a8,0x191,_0x22d2cf);}if(!_0x2c9cb1){return handleError(_0x4ae1a8,0x194,{'message':_0x5f92('0x35')});}else{var _0x4a2cfd={'payload':{'id':_0x2c9cb1['id'],'role':_0x2c9cb1[_0x5f92('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x5f92('0x36')](_0x4a2cfd)['then'](function(_0x16fe6a){_0x4ae1a8[_0x5f92('0x37')]({'id':_0x2c9cb1['id'],'token':_0x16fe6a,'statusCall':'','isAlreadyLogged':_0x2c9cb1['online']});});}})(_0x4fa6fb,_0x4ae1a8,_0x48301a);};exports[_0x5f92('0x38')]=function(_0xbdb8ac,_0x36d63a,_0x3f4020){if(!_0xbdb8ac[_0x5f92('0x39')]['email']){return handleError(_0x36d63a,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3a07dc=rs[_0x5f92('0x3a')]();_0xbdb8ac[_0x5f92('0x39')][_0x5f92('0x20')]=_0xbdb8ac[_0x5f92('0x39')][_0x5f92('0x20')]['trim']()['toLowerCase']();var _0x43e45f;return db[_0x5f92('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x5f92('0x17'),_0x5f92('0x9')],'raw':!![]})[_0x5f92('0x13')](function(_0x1cbacf){_0x43e45f=_0x1cbacf;return db['User'][_0x5f92('0x1f')]({'where':{'email':_0xbdb8ac[_0x5f92('0x39')][_0x5f92('0x20')]}});})[_0x5f92('0x13')](function(_0x1fbf69){if(!_0x1fbf69){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1fbf69[_0x5f92('0x16')]){throw new Error(_0x5f92('0x3b'));}if(_0x1fbf69[_0x5f92('0xe')]){if(moment(_0x1fbf69['blockedAt'])[_0x5f92('0x19')](_0x43e45f[_0x5f92('0x9')],_0x5f92('0x1a'))>moment()){throw new Error(_0x5f92('0x3c'));}else{_0x1fbf69[_0x5f92('0xe')]=![];_0x1fbf69['blockedAt']=null;}}_0x1fbf69['resetPasswordToken']=_0x3a07dc;_0x1fbf69['resetPasswordExpires']=Date[_0x5f92('0x3d')]()+0x36ee80;return _0x1fbf69[_0x5f92('0x3e')]();})[_0x5f92('0x13')](function(){return sendServiceMail({'to':_0xbdb8ac[_0x5f92('0x39')][_0x5f92('0x20')],'subject':_0x5f92('0x3f'),'text':_0x5f92('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x5f92('0x41')+_0xbdb8ac[_0x5f92('0x42')][_0x5f92('0x23')]+_0x5f92('0x43')+_0x3a07dc+'\x0a\x0a'+_0x5f92('0x44')});})['then'](function(){_0x36d63a['status'](0xc8)[_0x5f92('0x33')]({'message':_0x5f92('0x45')});})['catch'](function(_0x2d4d4b){return handleError(_0x36d63a,0x1f4,_0x2d4d4b);});};exports['reset']=function(_0x5cdbff,_0x476a07,_0x2c71fc){return db[_0x5f92('0x46')][_0x5f92('0x1f')]({'where':{'resetPasswordToken':_0x5cdbff[_0x5f92('0x47')][_0x5f92('0x48')],'resetPasswordExpires':{'$gt':Date[_0x5f92('0x3d')]()}}})[_0x5f92('0x13')](function(_0x498bd5){if(!_0x498bd5){throw new Error(_0x5f92('0x49'));}return db[_0x5f92('0x8')]['findOne']({'attributes':['id',_0x5f92('0x4a'),_0x5f92('0x4b'),_0x5f92('0x4c')]})[_0x5f92('0x13')](function(_0xca9229){if(_0xca9229[_0x5f92('0x4a')])authService[_0x5f92('0x4d')](_0x5cdbff[_0x5f92('0x39')]['password']);if(!_0xca9229[_0x5f92('0x4b')]||!_0x498bd5[_0x5f92('0x4e')])return _0x498bd5;authService[_0x5f92('0x4f')](_0x5cdbff['body'][_0x5f92('0x50')],_0x498bd5[_0x5f92('0x4e')],_0xca9229[_0x5f92('0x4c')]);return _0x498bd5;})['then'](function(){_0x498bd5[_0x5f92('0x50')]=_0x5cdbff[_0x5f92('0x39')][_0x5f92('0x50')];_0x498bd5[_0x5f92('0x51')]=null;_0x498bd5[_0x5f92('0x52')]=null;return _0x498bd5[_0x5f92('0x3e')]();});})[_0x5f92('0x13')](function(){_0x476a07['status'](0xc8)[_0x5f92('0x33')]({'message':_0x5f92('0x53')});})['catch'](function(_0x404c18){return handleError(_0x476a07,0x1f4,_0x404c18);});};passport[_0x5f92('0x54')](new LocalStrategy({'usernameField':'name','passwordField':_0x5f92('0x50')},function(_0x2d3168,_0x1a82d9,_0x3c3cbf){return localAuthenticate(db[_0x5f92('0x46')],_0x2d3168,_0x1a82d9,_0x3c3cbf);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 0f10721..9b2484b 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 _0x6d85=['forgot','exports','express','Router','./authLocal.controller','post','login','/forgot'];(function(_0x2e5030,_0x120033){var _0x205687=function(_0x36b7a4){while(--_0x36b7a4){_0x2e5030['push'](_0x2e5030['shift']());}};_0x205687(++_0x120033);}(_0x6d85,0x122));var _0x56d8=function(_0x39a09b,_0x403398){_0x39a09b=_0x39a09b-0x0;var _0x382252=_0x6d85[_0x39a09b];return _0x382252;};'use strict';var express=require(_0x56d8('0x0'));var router=express[_0x56d8('0x1')]();var controller=require(_0x56d8('0x2'));router[_0x56d8('0x3')]('/',controller[_0x56d8('0x4')]);router[_0x56d8('0x3')](_0x56d8('0x5'),controller[_0x56d8('0x6')]);router[_0x56d8('0x3')]('/reset/:token',controller['reset']);module[_0x56d8('0x7')]=router;
\ No newline at end of file
+var _0x77b0=['login','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4cc89c,_0x4d2e23){var _0x5852a2=function(_0xc597fc){while(--_0xc597fc){_0x4cc89c['push'](_0x4cc89c['shift']());}};_0x5852a2(++_0x4d2e23);}(_0x77b0,0x17c));var _0x077b=function(_0x118824,_0x49e7b2){_0x118824=_0x118824-0x0;var _0x406641=_0x77b0[_0x118824];return _0x406641;};'use strict';var express=require(_0x077b('0x0'));var router=express[_0x077b('0x1')]();var controller=require(_0x077b('0x2'));router[_0x077b('0x3')]('/',controller[_0x077b('0x4')]);router['post']('/forgot',controller['forgot']);router['post'](_0x077b('0x5'),controller[_0x077b('0x6')]);module[_0x077b('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index cbf5042..dc6438a 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 _0x2da9=['BOOLEAN','sequelize','exports','STRING'];(function(_0x17bfa4,_0x3eb5f7){var _0x3d9ca8=function(_0x235cd4){while(--_0x235cd4){_0x17bfa4['push'](_0x17bfa4['shift']());}};_0x3d9ca8(++_0x3eb5f7);}(_0x2da9,0x1b1));var _0x92da=function(_0x206437,_0x40e74f){_0x206437=_0x206437-0x0;var _0x15a3cf=_0x2da9[_0x206437];return _0x15a3cf;};'use strict';var Sequelize=require(_0x92da('0x0'));module[_0x92da('0x1')]={'name':{'type':Sequelize[_0x92da('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x92da('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x2c45=['STRING','INTEGER','exports'];(function(_0x249529,_0x15af2f){var _0x4fb4d4=function(_0x5dd532){while(--_0x5dd532){_0x249529['push'](_0x249529['shift']());}};_0x4fb4d4(++_0x15af2f);}(_0x2c45,0x143));var _0x52c4=function(_0x1fe9a7,_0xa8b21){_0x1fe9a7=_0x1fe9a7-0x0;var _0x587177=_0x2c45[_0x1fe9a7];return _0x587177;};'use strict';var Sequelize=require('sequelize');module[_0x52c4('0x0')]={'name':{'type':Sequelize[_0x52c4('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x52c4('0x1')]},'description':{'type':Sequelize[_0x52c4('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x52c4('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 46a0392..75e6750 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 _0x3a8b=['../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','map','Automation','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','type','includeAll','rows','catch','show','params','options','find','create','body','Condition','ids','omit','getConditions','findOne','hasOwnProperty','nolimit','addActions','Action','getActions','order','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util'];(function(_0x26dc9a,_0x1633c7){var _0xd4fbf2=function(_0x4dc0b3){while(--_0x4dc0b3){_0x26dc9a['push'](_0x26dc9a['shift']());}};_0xd4fbf2(++_0x1633c7);}(_0x3a8b,0xd5));var _0xb3a8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x3a8b[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3a8('0x0'));var zipdir=require(_0xb3a8('0x1'));var jsonpatch=require(_0xb3a8('0x2'));var rp=require(_0xb3a8('0x3'));var moment=require('moment');var BPromise=require(_0xb3a8('0x4'));var Mustache=require(_0xb3a8('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb3a8('0x6'));var csv=require('to-csv');var ejs=require(_0xb3a8('0x7'));var fs=require('fs');var fs_extra=require(_0xb3a8('0x8'));var _=require(_0xb3a8('0x9'));var squel=require(_0xb3a8('0xa'));var crypto=require(_0xb3a8('0xb'));var jsforce=require(_0xb3a8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb3a8('0xd'));var querystring=require(_0xb3a8('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3a8('0xf'));var authService=require(_0xb3a8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb3a8('0x11'));var hardwareService=require(_0xb3a8('0x12'));var logger=require(_0xb3a8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb3a8('0x14'));var db=require(_0xb3a8('0x15'))['db'];function respondWithStatusCode(_0x34eb1b,_0x4a1733){_0x4a1733=_0x4a1733||0xcc;return function(_0x330b6f){if(_0x330b6f){return _0x34eb1b['sendStatus'](_0x4a1733);}return _0x34eb1b[_0xb3a8('0x16')](_0x4a1733)[_0xb3a8('0x17')]();};}function respondWithResult(_0x47bbe1,_0x916644){_0x916644=_0x916644||0xc8;return function(_0x57a27c){if(_0x57a27c){return _0x47bbe1['status'](_0x916644)[_0xb3a8('0x18')](_0x57a27c);}};}function respondWithFilteredResult(_0x34ca46,_0x1bb8c3){return function(_0x2680ae){if(_0x2680ae){var _0x416dda=typeof _0x1bb8c3['offset']===_0xb3a8('0x19')&&typeof _0x1bb8c3[_0xb3a8('0x1a')]===_0xb3a8('0x19');var _0x52f39b=_0x2680ae[_0xb3a8('0x1b')];var _0x3c2cc5=_0x416dda?0x0:_0x1bb8c3[_0xb3a8('0x1c')];var _0x536633=_0x416dda?_0x2680ae[_0xb3a8('0x1b')]:_0x1bb8c3[_0xb3a8('0x1c')]+_0x1bb8c3['limit'];var _0x5ef535;if(_0x536633>=_0x52f39b){_0x536633=_0x52f39b;_0x5ef535=0xc8;}else{_0x5ef535=0xce;}_0x34ca46['status'](_0x5ef535);return _0x34ca46[_0xb3a8('0x1d')](_0xb3a8('0x1e'),_0x3c2cc5+'-'+_0x536633+'/'+_0x52f39b)[_0xb3a8('0x18')](_0x2680ae);}return null;};}function patchUpdates(_0x2a0b50){return function(_0x2fff74){try{jsonpatch['apply'](_0x2fff74,_0x2a0b50,!![]);}catch(_0x110f71){return BPromise[_0xb3a8('0x1f')](_0x110f71);}return _0x2fff74['save']();};}function saveUpdates(_0x3b0510,_0x5871ff){return function(_0x1ad96a){if(_0x1ad96a){return _0x1ad96a[_0xb3a8('0x20')](_0x3b0510)[_0xb3a8('0x21')](function(_0xae2968){return _0xae2968;});}return null;};}function removeEntity(_0x5efabe,_0x547431){return function(_0x583e7c){if(_0x583e7c){return _0x583e7c[_0xb3a8('0x22')]()[_0xb3a8('0x21')](function(){_0x5efabe[_0xb3a8('0x16')](0xcc)[_0xb3a8('0x17')]();});}};}function handleEntityNotFound(_0x212ea8,_0x1e1a86){return function(_0x1c359b){if(!_0x1c359b){_0x212ea8[_0xb3a8('0x23')](0x194);}return _0x1c359b;};}function handleError(_0x3bda7c,_0x36b081){_0x36b081=_0x36b081||0x1f4;return function(_0xb52bd9){logger[_0xb3a8('0x24')](_0xb52bd9['stack']);if(_0xb52bd9[_0xb3a8('0x25')]){delete _0xb52bd9[_0xb3a8('0x25')];}_0x3bda7c[_0xb3a8('0x16')](_0x36b081)[_0xb3a8('0x26')](_0xb52bd9);};}exports[_0xb3a8('0x27')]=function(_0x638e79,_0x9b5157){var _0x5af26c={},_0x4498db={},_0x5357f6={'count':0x0,'rows':[]};var _0x63af0e=_[_0xb3a8('0x28')](db[_0xb3a8('0x29')][_0xb3a8('0x2a')],function(_0x892f53){return{'name':_0x892f53['fieldName'],'type':_0x892f53['type'][_0xb3a8('0x2b')]};});_0x4498db[_0xb3a8('0x2c')]=_['map'](_0x63af0e,'name');_0x4498db['query']=_[_0xb3a8('0x2d')](_0x638e79[_0xb3a8('0x2e')]);_0x4498db[_0xb3a8('0x2f')]=_[_0xb3a8('0x30')](_0x4498db[_0xb3a8('0x2c')],_0x4498db[_0xb3a8('0x2e')]);_0x5af26c[_0xb3a8('0x31')]=_['intersection'](_0x4498db[_0xb3a8('0x2c')],qs[_0xb3a8('0x32')](_0x638e79[_0xb3a8('0x2e')][_0xb3a8('0x32')]));_0x5af26c[_0xb3a8('0x31')]=_0x5af26c['attributes'][_0xb3a8('0x33')]?_0x5af26c[_0xb3a8('0x31')]:_0x4498db[_0xb3a8('0x2c')];if(!_0x638e79[_0xb3a8('0x2e')]['hasOwnProperty']('nolimit')){_0x5af26c['limit']=qs[_0xb3a8('0x1a')](_0x638e79[_0xb3a8('0x2e')][_0xb3a8('0x1a')]);_0x5af26c[_0xb3a8('0x1c')]=qs[_0xb3a8('0x1c')](_0x638e79['query'][_0xb3a8('0x1c')]);}_0x5af26c['order']=qs[_0xb3a8('0x34')](_0x638e79[_0xb3a8('0x2e')][_0xb3a8('0x34')]);_0x5af26c['where']=qs[_0xb3a8('0x2f')](_[_0xb3a8('0x35')](_0x638e79[_0xb3a8('0x2e')],_0x4498db['filters']),_0x63af0e);if(_0x638e79['query'][_0xb3a8('0x36')]){_0x5af26c[_0xb3a8('0x37')]=_[_0xb3a8('0x38')](_0x5af26c[_0xb3a8('0x37')],{'$or':_[_0xb3a8('0x28')](_0x63af0e,function(_0x41c46e){if(_0x41c46e[_0xb3a8('0x39')]!=='VIRTUAL'){var _0x20f55e={};_0x20f55e[_0x41c46e[_0xb3a8('0x25')]]={'$like':'%'+_0x638e79[_0xb3a8('0x2e')][_0xb3a8('0x36')]+'%'};return _0x20f55e;}})});}_0x5af26c=_['merge']({},_0x5af26c,_0x638e79['options']);var _0x2a5ebe={'where':_0x5af26c['where']};return db['Automation']['count'](_0x2a5ebe)[_0xb3a8('0x21')](function(_0x317c98){_0x5357f6[_0xb3a8('0x1b')]=_0x317c98;if(_0x638e79['query'][_0xb3a8('0x3a')]){_0x5af26c['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x5af26c);})['then'](function(_0xba121a){_0x5357f6[_0xb3a8('0x3b')]=_0xba121a;return _0x5357f6;})[_0xb3a8('0x21')](respondWithFilteredResult(_0x9b5157,_0x5af26c))[_0xb3a8('0x3c')](handleError(_0x9b5157,null));};exports[_0xb3a8('0x3d')]=function(_0xf9493f,_0x5a5678){var _0x185b24={'raw':![],'where':{'id':_0xf9493f[_0xb3a8('0x3e')]['id']}},_0x9d633d={};_0x9d633d[_0xb3a8('0x2c')]=_[_0xb3a8('0x2d')](db[_0xb3a8('0x29')]['rawAttributes']);_0x9d633d['query']=_['keys'](_0xf9493f[_0xb3a8('0x2e')]);_0x9d633d[_0xb3a8('0x2f')]=_[_0xb3a8('0x30')](_0x9d633d[_0xb3a8('0x2c')],_0x9d633d['query']);_0x185b24['attributes']=_['intersection'](_0x9d633d[_0xb3a8('0x2c')],qs[_0xb3a8('0x32')](_0xf9493f[_0xb3a8('0x2e')][_0xb3a8('0x32')]));_0x185b24[_0xb3a8('0x31')]=_0x185b24['attributes'][_0xb3a8('0x33')]?_0x185b24[_0xb3a8('0x31')]:_0x9d633d[_0xb3a8('0x2c')];if(_0xf9493f[_0xb3a8('0x2e')][_0xb3a8('0x3a')]){_0x185b24['include']=[{'all':!![]}];}_0x185b24=_[_0xb3a8('0x38')]({},_0x185b24,_0xf9493f[_0xb3a8('0x3f')]);return db[_0xb3a8('0x29')][_0xb3a8('0x40')](_0x185b24)[_0xb3a8('0x21')](handleEntityNotFound(_0x5a5678,null))[_0xb3a8('0x21')](respondWithResult(_0x5a5678,null))['catch'](handleError(_0x5a5678,null));};exports['create']=function(_0x320121,_0x271b9a){return db[_0xb3a8('0x29')][_0xb3a8('0x41')](_0x320121[_0xb3a8('0x42')],{})['then'](respondWithResult(_0x271b9a,0xc9))[_0xb3a8('0x3c')](handleError(_0x271b9a,null));};exports[_0xb3a8('0x20')]=function(_0x46368b,_0x5f5643){if(_0x46368b[_0xb3a8('0x42')]['id']){delete _0x46368b[_0xb3a8('0x42')]['id'];}return db['Automation']['find']({'where':{'id':_0x46368b[_0xb3a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5f5643,null))[_0xb3a8('0x21')](saveUpdates(_0x46368b[_0xb3a8('0x42')],null))[_0xb3a8('0x21')](respondWithResult(_0x5f5643,null))[_0xb3a8('0x3c')](handleError(_0x5f5643,null));};exports[_0xb3a8('0x22')]=function(_0x16b8b2,_0x31e272){return db[_0xb3a8('0x29')][_0xb3a8('0x40')]({'where':{'id':_0x16b8b2['params']['id']}})[_0xb3a8('0x21')](handleEntityNotFound(_0x31e272,null))['then'](removeEntity(_0x31e272,null))['catch'](handleError(_0x31e272,null));};exports['addConditions']=function(_0x23b79e,_0x1554a1,_0x2f2e9d){return db[_0xb3a8('0x43')]['find']({'where':{'id':_0x23b79e[_0xb3a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1554a1,null))[_0xb3a8('0x21')](function(_0x2076a1){if(_0x2076a1){return _0x2076a1['addConditions'](_0x23b79e[_0xb3a8('0x42')][_0xb3a8('0x44')],_[_0xb3a8('0x45')](_0x23b79e[_0xb3a8('0x42')],[_0xb3a8('0x44'),'id'])||{});}})[_0xb3a8('0x21')](respondWithResult(_0x1554a1,null))[_0xb3a8('0x3c')](handleError(_0x1554a1,null));};exports[_0xb3a8('0x46')]=function(_0x42c73a,_0x2b689d,_0x5cc761){var _0x50bdf4={};var _0x19089d={};var _0x17fae9;var _0x4545bb;return db[_0xb3a8('0x29')][_0xb3a8('0x47')]({'where':{'id':_0x42c73a[_0xb3a8('0x3e')]['id']}})[_0xb3a8('0x21')](handleEntityNotFound(_0x2b689d,null))[_0xb3a8('0x21')](function(_0x489cb9){if(_0x489cb9){_0x17fae9=_0x489cb9;_0x19089d[_0xb3a8('0x2c')]=_[_0xb3a8('0x2d')](db[_0xb3a8('0x43')][_0xb3a8('0x2a')]);_0x19089d[_0xb3a8('0x2e')]=_[_0xb3a8('0x2d')](_0x42c73a[_0xb3a8('0x2e')]);_0x19089d['filters']=_[_0xb3a8('0x30')](_0x19089d['model'],_0x19089d['query']);_0x50bdf4[_0xb3a8('0x31')]=_['intersection'](_0x19089d[_0xb3a8('0x2c')],qs['fields'](_0x42c73a[_0xb3a8('0x2e')][_0xb3a8('0x32')]));_0x50bdf4[_0xb3a8('0x31')]=_0x50bdf4[_0xb3a8('0x31')][_0xb3a8('0x33')]?_0x50bdf4['attributes']:_0x19089d[_0xb3a8('0x2c')];_0x50bdf4['order']=qs[_0xb3a8('0x34')](_0x42c73a['query']['sort']);_0x50bdf4[_0xb3a8('0x37')]=qs[_0xb3a8('0x2f')](_['pick'](_0x42c73a[_0xb3a8('0x2e')],_0x19089d[_0xb3a8('0x2f')]));if(_0x42c73a[_0xb3a8('0x2e')]['filter']){_0x50bdf4[_0xb3a8('0x37')]=_[_0xb3a8('0x38')](_0x50bdf4[_0xb3a8('0x37')],{'$or':_['map'](_0x50bdf4['attributes'],function(_0x4934a4){var _0x42eb07={};_0x42eb07[_0x4934a4]={'$like':'%'+_0x42c73a[_0xb3a8('0x2e')][_0xb3a8('0x36')]+'%'};return _0x42eb07;})});}_0x50bdf4=_[_0xb3a8('0x38')]({},_0x50bdf4,_0x42c73a['options']);return _0x17fae9[_0xb3a8('0x46')](_0x50bdf4);}})[_0xb3a8('0x21')](function(_0x56ba5a){if(_0x56ba5a){_0x4545bb=_0x56ba5a[_0xb3a8('0x33')];if(!_0x42c73a[_0xb3a8('0x2e')][_0xb3a8('0x48')](_0xb3a8('0x49'))){_0x50bdf4[_0xb3a8('0x1a')]=qs['limit'](_0x42c73a[_0xb3a8('0x2e')][_0xb3a8('0x1a')]);_0x50bdf4[_0xb3a8('0x1c')]=qs[_0xb3a8('0x1c')](_0x42c73a[_0xb3a8('0x2e')][_0xb3a8('0x1c')]);}return _0x17fae9['getConditions'](_0x50bdf4);}})['then'](function(_0x15ee4e){if(_0x15ee4e){return _0x15ee4e?{'count':_0x4545bb,'rows':_0x15ee4e}:null;}})[_0xb3a8('0x21')](respondWithResult(_0x2b689d,null))['catch'](handleError(_0x2b689d,null));};exports[_0xb3a8('0x4a')]=function(_0x3b6d3b,_0x6b4453,_0x18baa1){return db[_0xb3a8('0x4b')][_0xb3a8('0x40')]({'where':{'id':_0x3b6d3b[_0xb3a8('0x3e')]['id']}})[_0xb3a8('0x21')](handleEntityNotFound(_0x6b4453,null))['then'](function(_0xec9e0b){if(_0xec9e0b){return _0xec9e0b[_0xb3a8('0x4a')](_0x3b6d3b['body'][_0xb3a8('0x44')],_['omit'](_0x3b6d3b[_0xb3a8('0x42')],[_0xb3a8('0x44'),'id'])||{});}})['then'](respondWithResult(_0x6b4453,null))['catch'](handleError(_0x6b4453,null));};exports[_0xb3a8('0x4c')]=function(_0x153d4e,_0x5f5529,_0x5c02a7){var _0x3c86a2={};var _0x3f8426={};var _0x501f1d;var _0xbc2d09;return db['Automation'][_0xb3a8('0x47')]({'where':{'id':_0x153d4e['params']['id']}})[_0xb3a8('0x21')](handleEntityNotFound(_0x5f5529,null))[_0xb3a8('0x21')](function(_0xf9f30b){if(_0xf9f30b){_0x501f1d=_0xf9f30b;_0x3f8426[_0xb3a8('0x2c')]=_[_0xb3a8('0x2d')](db['Action'][_0xb3a8('0x2a')]);_0x3f8426[_0xb3a8('0x2e')]=_[_0xb3a8('0x2d')](_0x153d4e[_0xb3a8('0x2e')]);_0x3f8426[_0xb3a8('0x2f')]=_[_0xb3a8('0x30')](_0x3f8426[_0xb3a8('0x2c')],_0x3f8426[_0xb3a8('0x2e')]);_0x3c86a2[_0xb3a8('0x31')]=_[_0xb3a8('0x30')](_0x3f8426[_0xb3a8('0x2c')],qs['fields'](_0x153d4e[_0xb3a8('0x2e')]['fields']));_0x3c86a2[_0xb3a8('0x31')]=_0x3c86a2['attributes'][_0xb3a8('0x33')]?_0x3c86a2[_0xb3a8('0x31')]:_0x3f8426[_0xb3a8('0x2c')];_0x3c86a2[_0xb3a8('0x4d')]=qs[_0xb3a8('0x34')](_0x153d4e[_0xb3a8('0x2e')][_0xb3a8('0x34')]);_0x3c86a2['where']=qs[_0xb3a8('0x2f')](_['pick'](_0x153d4e[_0xb3a8('0x2e')],_0x3f8426[_0xb3a8('0x2f')]));if(_0x153d4e[_0xb3a8('0x2e')][_0xb3a8('0x36')]){_0x3c86a2[_0xb3a8('0x37')]=_['merge'](_0x3c86a2[_0xb3a8('0x37')],{'$or':_[_0xb3a8('0x28')](_0x3c86a2[_0xb3a8('0x31')],function(_0x1fe4ea){var _0x531c92={};_0x531c92[_0x1fe4ea]={'$like':'%'+_0x153d4e[_0xb3a8('0x2e')][_0xb3a8('0x36')]+'%'};return _0x531c92;})});}_0x3c86a2=_[_0xb3a8('0x38')]({},_0x3c86a2,_0x153d4e[_0xb3a8('0x3f')]);return _0x501f1d[_0xb3a8('0x4c')](_0x3c86a2);}})[_0xb3a8('0x21')](function(_0x3d0494){if(_0x3d0494){_0xbc2d09=_0x3d0494[_0xb3a8('0x33')];if(!_0x153d4e['query'][_0xb3a8('0x48')](_0xb3a8('0x49'))){_0x3c86a2['limit']=qs[_0xb3a8('0x1a')](_0x153d4e[_0xb3a8('0x2e')][_0xb3a8('0x1a')]);_0x3c86a2[_0xb3a8('0x1c')]=qs[_0xb3a8('0x1c')](_0x153d4e[_0xb3a8('0x2e')][_0xb3a8('0x1c')]);}return _0x501f1d['getActions'](_0x3c86a2);}})[_0xb3a8('0x21')](function(_0x224308){if(_0x224308){return _0x224308?{'count':_0xbc2d09,'rows':_0x224308}:null;}})[_0xb3a8('0x21')](respondWithResult(_0x5f5529,null))[_0xb3a8('0x3c')](handleError(_0x5f5529,null));};
\ No newline at end of file
+var _0x3c22=['../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','addConditions','Condition','find','ids','getConditions','findOne','order','nolimit','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2d6b73,_0x11a92f){var _0x45bbf2=function(_0x472e5f){while(--_0x472e5f){_0x2d6b73['push'](_0x2d6b73['shift']());}};_0x45bbf2(++_0x11a92f);}(_0x3c22,0x94));var _0x23c2=function(_0x4baa8a,_0x3ea752){_0x4baa8a=_0x4baa8a-0x0;var _0x41c481=_0x3c22[_0x4baa8a];return _0x41c481;};'use strict';var emlformat=require(_0x23c2('0x0'));var rimraf=require(_0x23c2('0x1'));var zipdir=require(_0x23c2('0x2'));var jsonpatch=require(_0x23c2('0x3'));var rp=require('request-promise');var moment=require(_0x23c2('0x4'));var BPromise=require(_0x23c2('0x5'));var Mustache=require('mustache');var util=require(_0x23c2('0x6'));var path=require(_0x23c2('0x7'));var sox=require(_0x23c2('0x8'));var csv=require(_0x23c2('0x9'));var ejs=require(_0x23c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x23c2('0xb'));var crypto=require(_0x23c2('0xc'));var jsforce=require(_0x23c2('0xd'));var deskjs=require(_0x23c2('0xe'));var toCsv=require(_0x23c2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x23c2('0xf'));var qs=require(_0x23c2('0x10'));var as=require(_0x23c2('0x11'));var hardwareService=require(_0x23c2('0x12'));var logger=require('../../config/logger')(_0x23c2('0x13'));var utils=require('../../config/utils');var config=require(_0x23c2('0x14'));var licenseUtil=require(_0x23c2('0x15'));var db=require(_0x23c2('0x16'))['db'];function respondWithStatusCode(_0x1c751e,_0x6f980c){_0x6f980c=_0x6f980c||0xcc;return function(_0x2ebd62){if(_0x2ebd62){return _0x1c751e[_0x23c2('0x17')](_0x6f980c);}return _0x1c751e[_0x23c2('0x18')](_0x6f980c)[_0x23c2('0x19')]();};}function respondWithResult(_0x3ecd20,_0x125664){_0x125664=_0x125664||0xc8;return function(_0x33f665){if(_0x33f665){return _0x3ecd20[_0x23c2('0x18')](_0x125664)[_0x23c2('0x1a')](_0x33f665);}};}function respondWithFilteredResult(_0x3a0765,_0x25fc9d){return function(_0x39e83b){if(_0x39e83b){var _0xf84a41=typeof _0x25fc9d['offset']===_0x23c2('0x1b')&&typeof _0x25fc9d[_0x23c2('0x1c')]==='undefined';var _0x3d94f5=_0x39e83b[_0x23c2('0x1d')];var _0x59068d=_0xf84a41?0x0:_0x25fc9d[_0x23c2('0x1e')];var _0x386fba=_0xf84a41?_0x39e83b[_0x23c2('0x1d')]:_0x25fc9d[_0x23c2('0x1e')]+_0x25fc9d[_0x23c2('0x1c')];var _0x16f314;if(_0x386fba>=_0x3d94f5){_0x386fba=_0x3d94f5;_0x16f314=0xc8;}else{_0x16f314=0xce;}_0x3a0765[_0x23c2('0x18')](_0x16f314);return _0x3a0765['set'](_0x23c2('0x1f'),_0x59068d+'-'+_0x386fba+'/'+_0x3d94f5)[_0x23c2('0x1a')](_0x39e83b);}return null;};}function patchUpdates(_0x136202){return function(_0x5c35dd){try{jsonpatch[_0x23c2('0x20')](_0x5c35dd,_0x136202,!![]);}catch(_0x554627){return BPromise['reject'](_0x554627);}return _0x5c35dd[_0x23c2('0x21')]();};}function saveUpdates(_0x5bb137,_0xc74b04){return function(_0x4384f1){if(_0x4384f1){return _0x4384f1[_0x23c2('0x22')](_0x5bb137)[_0x23c2('0x23')](function(_0x1e32c0){return _0x1e32c0;});}return null;};}function removeEntity(_0x21f448,_0x5d6cb9){return function(_0x501ad6){if(_0x501ad6){return _0x501ad6[_0x23c2('0x24')]()[_0x23c2('0x23')](function(){_0x21f448[_0x23c2('0x18')](0xcc)[_0x23c2('0x19')]();});}};}function handleEntityNotFound(_0x544577,_0x17c81d){return function(_0x19abee){if(!_0x19abee){_0x544577[_0x23c2('0x17')](0x194);}return _0x19abee;};}function handleError(_0x3954a9,_0x1482b7){_0x1482b7=_0x1482b7||0x1f4;return function(_0x4eaca3){logger[_0x23c2('0x25')](_0x4eaca3[_0x23c2('0x26')]);if(_0x4eaca3[_0x23c2('0x27')]){delete _0x4eaca3['name'];}_0x3954a9[_0x23c2('0x18')](_0x1482b7)['send'](_0x4eaca3);};}exports[_0x23c2('0x28')]=function(_0x6da4dd,_0xa4e27e){var _0x10faca={},_0x48c4b0={},_0x4d8066={'count':0x0,'rows':[]};var _0x4b3644=_[_0x23c2('0x29')](db[_0x23c2('0x2a')]['rawAttributes'],function(_0xd15c06){return{'name':_0xd15c06[_0x23c2('0x2b')],'type':_0xd15c06[_0x23c2('0x2c')][_0x23c2('0x2d')]};});_0x48c4b0[_0x23c2('0x2e')]=_[_0x23c2('0x29')](_0x4b3644,_0x23c2('0x27'));_0x48c4b0[_0x23c2('0x2f')]=_[_0x23c2('0x30')](_0x6da4dd[_0x23c2('0x2f')]);_0x48c4b0['filters']=_[_0x23c2('0x31')](_0x48c4b0[_0x23c2('0x2e')],_0x48c4b0[_0x23c2('0x2f')]);_0x10faca[_0x23c2('0x32')]=_[_0x23c2('0x31')](_0x48c4b0['model'],qs[_0x23c2('0x33')](_0x6da4dd[_0x23c2('0x2f')][_0x23c2('0x33')]));_0x10faca['attributes']=_0x10faca['attributes'][_0x23c2('0x34')]?_0x10faca['attributes']:_0x48c4b0[_0x23c2('0x2e')];if(!_0x6da4dd['query'][_0x23c2('0x35')]('nolimit')){_0x10faca['limit']=qs[_0x23c2('0x1c')](_0x6da4dd[_0x23c2('0x2f')][_0x23c2('0x1c')]);_0x10faca[_0x23c2('0x1e')]=qs[_0x23c2('0x1e')](_0x6da4dd['query'][_0x23c2('0x1e')]);}_0x10faca['order']=qs[_0x23c2('0x36')](_0x6da4dd[_0x23c2('0x2f')][_0x23c2('0x36')]);_0x10faca[_0x23c2('0x37')]=qs['filters'](_[_0x23c2('0x38')](_0x6da4dd[_0x23c2('0x2f')],_0x48c4b0[_0x23c2('0x39')]),_0x4b3644);if(_0x6da4dd[_0x23c2('0x2f')][_0x23c2('0x3a')]){_0x10faca[_0x23c2('0x37')]=_[_0x23c2('0x3b')](_0x10faca[_0x23c2('0x37')],{'$or':_[_0x23c2('0x29')](_0x4b3644,function(_0x2316c3){if(_0x2316c3['type']!==_0x23c2('0x3c')){var _0x1cffbc={};_0x1cffbc[_0x2316c3[_0x23c2('0x27')]]={'$like':'%'+_0x6da4dd[_0x23c2('0x2f')][_0x23c2('0x3a')]+'%'};return _0x1cffbc;}})});}_0x10faca=_[_0x23c2('0x3b')]({},_0x10faca,_0x6da4dd[_0x23c2('0x3d')]);var _0xc0c6b6={'where':_0x10faca[_0x23c2('0x37')]};return db[_0x23c2('0x2a')][_0x23c2('0x1d')](_0xc0c6b6)[_0x23c2('0x23')](function(_0x2e7451){_0x4d8066['count']=_0x2e7451;if(_0x6da4dd[_0x23c2('0x2f')][_0x23c2('0x3e')]){_0x10faca[_0x23c2('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x23c2('0x40')](_0x10faca);})[_0x23c2('0x23')](function(_0x18c1c2){_0x4d8066[_0x23c2('0x41')]=_0x18c1c2;return _0x4d8066;})[_0x23c2('0x23')](respondWithFilteredResult(_0xa4e27e,_0x10faca))[_0x23c2('0x42')](handleError(_0xa4e27e,null));};exports['show']=function(_0x5fe7e6,_0x3b8cfd){var _0x3342d5={'raw':![],'where':{'id':_0x5fe7e6[_0x23c2('0x43')]['id']}},_0x1547b1={};_0x1547b1['model']=_['keys'](db['Automation'][_0x23c2('0x44')]);_0x1547b1['query']=_[_0x23c2('0x30')](_0x5fe7e6[_0x23c2('0x2f')]);_0x1547b1[_0x23c2('0x39')]=_[_0x23c2('0x31')](_0x1547b1[_0x23c2('0x2e')],_0x1547b1[_0x23c2('0x2f')]);_0x3342d5[_0x23c2('0x32')]=_[_0x23c2('0x31')](_0x1547b1[_0x23c2('0x2e')],qs['fields'](_0x5fe7e6[_0x23c2('0x2f')][_0x23c2('0x33')]));_0x3342d5[_0x23c2('0x32')]=_0x3342d5[_0x23c2('0x32')]['length']?_0x3342d5['attributes']:_0x1547b1[_0x23c2('0x2e')];if(_0x5fe7e6[_0x23c2('0x2f')][_0x23c2('0x3e')]){_0x3342d5[_0x23c2('0x3f')]=[{'all':!![]}];}_0x3342d5=_[_0x23c2('0x3b')]({},_0x3342d5,_0x5fe7e6[_0x23c2('0x3d')]);return db[_0x23c2('0x2a')]['find'](_0x3342d5)[_0x23c2('0x23')](handleEntityNotFound(_0x3b8cfd,null))[_0x23c2('0x23')](respondWithResult(_0x3b8cfd,null))['catch'](handleError(_0x3b8cfd,null));};exports['create']=function(_0x3a54e8,_0x5e9f9c){return db[_0x23c2('0x2a')][_0x23c2('0x45')](_0x3a54e8[_0x23c2('0x46')],{})['then'](respondWithResult(_0x5e9f9c,0xc9))[_0x23c2('0x42')](handleError(_0x5e9f9c,null));};exports['update']=function(_0x4fd38a,_0x14780d){if(_0x4fd38a['body']['id']){delete _0x4fd38a[_0x23c2('0x46')]['id'];}return db[_0x23c2('0x2a')]['find']({'where':{'id':_0x4fd38a[_0x23c2('0x43')]['id']}})['then'](handleEntityNotFound(_0x14780d,null))[_0x23c2('0x23')](saveUpdates(_0x4fd38a[_0x23c2('0x46')],null))['then'](respondWithResult(_0x14780d,null))[_0x23c2('0x42')](handleError(_0x14780d,null));};exports[_0x23c2('0x24')]=function(_0x139014,_0x581c08){return db[_0x23c2('0x2a')]['find']({'where':{'id':_0x139014[_0x23c2('0x43')]['id']}})['then'](handleEntityNotFound(_0x581c08,null))[_0x23c2('0x23')](removeEntity(_0x581c08,null))[_0x23c2('0x42')](handleError(_0x581c08,null));};exports[_0x23c2('0x47')]=function(_0x56c274,_0x441d54,_0x18791e){return db[_0x23c2('0x48')][_0x23c2('0x49')]({'where':{'id':_0x56c274['params']['id']}})[_0x23c2('0x23')](handleEntityNotFound(_0x441d54,null))[_0x23c2('0x23')](function(_0xb9159){if(_0xb9159){return _0xb9159[_0x23c2('0x47')](_0x56c274[_0x23c2('0x46')][_0x23c2('0x4a')],_['omit'](_0x56c274[_0x23c2('0x46')],[_0x23c2('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x441d54,null))[_0x23c2('0x42')](handleError(_0x441d54,null));};exports[_0x23c2('0x4b')]=function(_0x28304f,_0x23e4d,_0x25345a){var _0x4431c2={};var _0x22d6ea={};var _0x103abd;var _0x25532f;return db[_0x23c2('0x2a')][_0x23c2('0x4c')]({'where':{'id':_0x28304f['params']['id']}})['then'](handleEntityNotFound(_0x23e4d,null))[_0x23c2('0x23')](function(_0x4cb56b){if(_0x4cb56b){_0x103abd=_0x4cb56b;_0x22d6ea[_0x23c2('0x2e')]=_[_0x23c2('0x30')](db[_0x23c2('0x48')][_0x23c2('0x44')]);_0x22d6ea['query']=_[_0x23c2('0x30')](_0x28304f[_0x23c2('0x2f')]);_0x22d6ea[_0x23c2('0x39')]=_[_0x23c2('0x31')](_0x22d6ea['model'],_0x22d6ea['query']);_0x4431c2[_0x23c2('0x32')]=_['intersection'](_0x22d6ea[_0x23c2('0x2e')],qs[_0x23c2('0x33')](_0x28304f[_0x23c2('0x2f')][_0x23c2('0x33')]));_0x4431c2[_0x23c2('0x32')]=_0x4431c2['attributes'][_0x23c2('0x34')]?_0x4431c2[_0x23c2('0x32')]:_0x22d6ea[_0x23c2('0x2e')];_0x4431c2[_0x23c2('0x4d')]=qs[_0x23c2('0x36')](_0x28304f[_0x23c2('0x2f')][_0x23c2('0x36')]);_0x4431c2[_0x23c2('0x37')]=qs['filters'](_[_0x23c2('0x38')](_0x28304f[_0x23c2('0x2f')],_0x22d6ea[_0x23c2('0x39')]));if(_0x28304f[_0x23c2('0x2f')][_0x23c2('0x3a')]){_0x4431c2[_0x23c2('0x37')]=_['merge'](_0x4431c2[_0x23c2('0x37')],{'$or':_['map'](_0x4431c2['attributes'],function(_0x52a5cc){var _0x342969={};_0x342969[_0x52a5cc]={'$like':'%'+_0x28304f[_0x23c2('0x2f')][_0x23c2('0x3a')]+'%'};return _0x342969;})});}_0x4431c2=_[_0x23c2('0x3b')]({},_0x4431c2,_0x28304f[_0x23c2('0x3d')]);return _0x103abd[_0x23c2('0x4b')](_0x4431c2);}})[_0x23c2('0x23')](function(_0x3c5011){if(_0x3c5011){_0x25532f=_0x3c5011[_0x23c2('0x34')];if(!_0x28304f[_0x23c2('0x2f')][_0x23c2('0x35')](_0x23c2('0x4e'))){_0x4431c2[_0x23c2('0x1c')]=qs[_0x23c2('0x1c')](_0x28304f[_0x23c2('0x2f')]['limit']);_0x4431c2['offset']=qs[_0x23c2('0x1e')](_0x28304f[_0x23c2('0x2f')]['offset']);}return _0x103abd['getConditions'](_0x4431c2);}})[_0x23c2('0x23')](function(_0x429fd7){if(_0x429fd7){return _0x429fd7?{'count':_0x25532f,'rows':_0x429fd7}:null;}})[_0x23c2('0x23')](respondWithResult(_0x23e4d,null))[_0x23c2('0x42')](handleError(_0x23e4d,null));};exports[_0x23c2('0x4f')]=function(_0x48e816,_0x3fba6b,_0x201603){return db[_0x23c2('0x50')][_0x23c2('0x49')]({'where':{'id':_0x48e816['params']['id']}})[_0x23c2('0x23')](handleEntityNotFound(_0x3fba6b,null))[_0x23c2('0x23')](function(_0x441e6c){if(_0x441e6c){return _0x441e6c['addActions'](_0x48e816[_0x23c2('0x46')][_0x23c2('0x4a')],_[_0x23c2('0x51')](_0x48e816['body'],[_0x23c2('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x3fba6b,null))['catch'](handleError(_0x3fba6b,null));};exports[_0x23c2('0x52')]=function(_0x5ecf36,_0x36f440,_0x3c9a58){var _0x1b0bfc={};var _0x2a7ef0={};var _0x200239;var _0x288f2b;return db['Automation'][_0x23c2('0x4c')]({'where':{'id':_0x5ecf36[_0x23c2('0x43')]['id']}})[_0x23c2('0x23')](handleEntityNotFound(_0x36f440,null))[_0x23c2('0x23')](function(_0x12b177){if(_0x12b177){_0x200239=_0x12b177;_0x2a7ef0[_0x23c2('0x2e')]=_[_0x23c2('0x30')](db[_0x23c2('0x50')][_0x23c2('0x44')]);_0x2a7ef0[_0x23c2('0x2f')]=_[_0x23c2('0x30')](_0x5ecf36['query']);_0x2a7ef0[_0x23c2('0x39')]=_[_0x23c2('0x31')](_0x2a7ef0['model'],_0x2a7ef0[_0x23c2('0x2f')]);_0x1b0bfc[_0x23c2('0x32')]=_[_0x23c2('0x31')](_0x2a7ef0['model'],qs[_0x23c2('0x33')](_0x5ecf36[_0x23c2('0x2f')][_0x23c2('0x33')]));_0x1b0bfc['attributes']=_0x1b0bfc['attributes'][_0x23c2('0x34')]?_0x1b0bfc[_0x23c2('0x32')]:_0x2a7ef0['model'];_0x1b0bfc[_0x23c2('0x4d')]=qs[_0x23c2('0x36')](_0x5ecf36[_0x23c2('0x2f')]['sort']);_0x1b0bfc[_0x23c2('0x37')]=qs[_0x23c2('0x39')](_['pick'](_0x5ecf36['query'],_0x2a7ef0['filters']));if(_0x5ecf36['query'][_0x23c2('0x3a')]){_0x1b0bfc[_0x23c2('0x37')]=_['merge'](_0x1b0bfc[_0x23c2('0x37')],{'$or':_['map'](_0x1b0bfc[_0x23c2('0x32')],function(_0x24bb5d){var _0x32aad6={};_0x32aad6[_0x24bb5d]={'$like':'%'+_0x5ecf36['query'][_0x23c2('0x3a')]+'%'};return _0x32aad6;})});}_0x1b0bfc=_[_0x23c2('0x3b')]({},_0x1b0bfc,_0x5ecf36[_0x23c2('0x3d')]);return _0x200239[_0x23c2('0x52')](_0x1b0bfc);}})[_0x23c2('0x23')](function(_0x3f6bb9){if(_0x3f6bb9){_0x288f2b=_0x3f6bb9[_0x23c2('0x34')];if(!_0x5ecf36['query'][_0x23c2('0x35')]('nolimit')){_0x1b0bfc[_0x23c2('0x1c')]=qs[_0x23c2('0x1c')](_0x5ecf36[_0x23c2('0x2f')][_0x23c2('0x1c')]);_0x1b0bfc['offset']=qs[_0x23c2('0x1e')](_0x5ecf36[_0x23c2('0x2f')][_0x23c2('0x1e')]);}return _0x200239[_0x23c2('0x52')](_0x1b0bfc);}})[_0x23c2('0x23')](function(_0x319c57){if(_0x319c57){return _0x319c57?{'count':_0x288f2b,'rows':_0x319c57}:null;}})[_0x23c2('0x23')](respondWithResult(_0x36f440,null))['catch'](handleError(_0x36f440,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 8fc7c91..5600be0 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 _0xf365=['exports','define','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x1973f7,_0xf09bda){var _0x3f490e=function(_0x16fbc2){while(--_0x16fbc2){_0x1973f7['push'](_0x1973f7['shift']());}};_0x3f490e(++_0xf09bda);}(_0xf365,0x145));var _0x5f36=function(_0x6a2228,_0x4a1d8b){_0x6a2228=_0x6a2228-0x0;var _0x2d7c81=_0xf365[_0x6a2228];return _0x2d7c81;};'use strict';var _=require(_0x5f36('0x0'));var util=require(_0x5f36('0x1'));var logger=require(_0x5f36('0x2'))(_0x5f36('0x3'));var moment=require(_0x5f36('0x4'));var BPromise=require(_0x5f36('0x5'));var rp=require(_0x5f36('0x6'));var fs=require('fs');var path=require(_0x5f36('0x7'));var rimraf=require(_0x5f36('0x8'));var config=require(_0x5f36('0x9'));var attributes=require(_0x5f36('0xa'));module[_0x5f36('0xb')]=function(_0x199479,_0x26ae99){return _0x199479[_0x5f36('0xc')]('Automation',attributes,{'tableName':_0x5f36('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa25a=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x916634,_0x9494db){var _0x3b381c=function(_0x594310){while(--_0x594310){_0x916634['push'](_0x916634['shift']());}};_0x3b381c(++_0x9494db);}(_0xa25a,0x114));var _0xaa25=function(_0x331926,_0x5b2f83){_0x331926=_0x331926-0x0;var _0x426fef=_0xa25a[_0x331926];return _0x426fef;};'use strict';var _=require('lodash');var util=require(_0xaa25('0x0'));var logger=require(_0xaa25('0x1'))(_0xaa25('0x2'));var moment=require(_0xaa25('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa25('0x5'));var config=require(_0xaa25('0x6'));var attributes=require(_0xaa25('0x7'));module[_0xaa25('0x8')]=function(_0x3566c2,_0x571198){return _0x3566c2[_0xaa25('0x9')](_0xaa25('0xa'),attributes,{'tableName':_0xaa25('0xb'),'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 82b1a07..4a8e050 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 _0x8212=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x271e26,_0xeaa798){var _0x4c3771=function(_0x594c71){while(--_0x594c71){_0x271e26['push'](_0x271e26['shift']());}};_0x4c3771(++_0xeaa798);}(_0x8212,0xb3));var _0x2821=function(_0x5421ea,_0x10c8e0){_0x5421ea=_0x5421ea-0x0;var _0x4260db=_0x8212[_0x5421ea];return _0x4260db;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var moment=require('moment');var BPromise=require(_0x2821('0x2'));var rs=require(_0x2821('0x3'));var fs=require('fs');var Redis=require(_0x2821('0x4'));var db=require(_0x2821('0x5'))['db'];var utils=require(_0x2821('0x6'));var logger=require(_0x2821('0x7'))(_0x2821('0x8'));var config=require(_0x2821('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2821('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x376c57,_0x1dc078,_0x4ea6d5){return new BPromise(function(_0x3644aa,_0x201069){return client[_0x2821('0xb')](_0x376c57,_0x4ea6d5)[_0x2821('0xc')](function(_0x16003f){logger[_0x2821('0xd')](_0x2821('0xe'),_0x1dc078,_0x2821('0xf'));logger[_0x2821('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x1dc078,_0x2821('0xf'),JSON[_0x2821('0x11')](_0x16003f));if(_0x16003f[_0x2821('0x12')]){if(_0x16003f['error']['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1dc078,_0x16003f[_0x2821('0x12')][_0x2821('0x13')]);return _0x201069(_0x16003f[_0x2821('0x12')][_0x2821('0x13')]);}logger[_0x2821('0x12')](_0x2821('0xe'),_0x1dc078,_0x16003f['error'][_0x2821('0x13')]);return _0x3644aa(_0x16003f['error']['message']);}else{logger[_0x2821('0xd')](_0x2821('0xe'),_0x1dc078,_0x2821('0xf'));_0x3644aa(_0x16003f[_0x2821('0x14')]['message']);}})[_0x2821('0x15')](function(_0x5c2aa7){logger[_0x2821('0x12')](_0x2821('0xe'),_0x1dc078,_0x5c2aa7);_0x201069(_0x5c2aa7);});});}
\ No newline at end of file
+var _0x110f=['result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x110f,0x1e6));var _0xf110=function(_0x4238ba,_0x50c846){_0x4238ba=_0x4238ba-0x0;var _0x1fffa1=_0x110f[_0x4238ba];return _0x1fffa1;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf110('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf110('0x3'));var logger=require(_0xf110('0x4'))(_0xf110('0x5'));var config=require('../../config/environment');var jayson=require(_0xf110('0x6'));var client=jayson[_0xf110('0x7')][_0xf110('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dcb19,_0x1a1a3b,_0xadc2a3){return new BPromise(function(_0x194a16,_0x57593b){return client[_0xf110('0x9')](_0x4dcb19,_0xadc2a3)[_0xf110('0xa')](function(_0x11c28f){logger['info'](_0xf110('0xb'),_0x1a1a3b,_0xf110('0xc'));logger[_0xf110('0xd')](_0xf110('0xe'),_0x1a1a3b,'request\x20sent',JSON[_0xf110('0xf')](_0x11c28f));if(_0x11c28f[_0xf110('0x10')]){if(_0x11c28f['error'][_0xf110('0x11')]===0x1f4){logger[_0xf110('0x10')](_0xf110('0xb'),_0x1a1a3b,_0x11c28f[_0xf110('0x10')]['message']);return _0x57593b(_0x11c28f[_0xf110('0x10')][_0xf110('0x12')]);}logger[_0xf110('0x10')]('Automation,\x20%s,\x20%s',_0x1a1a3b,_0x11c28f[_0xf110('0x10')][_0xf110('0x12')]);return _0x194a16(_0x11c28f['error'][_0xf110('0x12')]);}else{logger[_0xf110('0x13')](_0xf110('0xb'),_0x1a1a3b,_0xf110('0xc'));_0x194a16(_0x11c28f[_0xf110('0x14')][_0xf110('0x12')]);}})[_0xf110('0x15')](function(_0x44ba58){logger[_0xf110('0x10')]('Automation,\x20%s,\x20%s',_0x1a1a3b,_0x44ba58);_0x57593b(_0x44ba58);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 68c8c82..cf255eb 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 _0xe096=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','getActions','create','/:id/actions','addActions','/:id','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xe096,0x13c));var _0x6e09=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0xe096[_0xdd2348];return _0x2e0a02;};'use strict';var multer=require(_0x6e09('0x0'));var util=require(_0x6e09('0x1'));var path=require(_0x6e09('0x2'));var timeout=require(_0x6e09('0x3'));var express=require(_0x6e09('0x4'));var router=express[_0x6e09('0x5')]();var fs_extra=require(_0x6e09('0x6'));var auth=require(_0x6e09('0x7'));var interaction=require(_0x6e09('0x8'));var config=require(_0x6e09('0x9'));var controller=require(_0x6e09('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6e09('0xb')]('/:id',auth[_0x6e09('0xc')](),controller[_0x6e09('0xd')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x6e09('0xb')]('/:id/actions',auth[_0x6e09('0xc')](),controller[_0x6e09('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6e09('0xf')]);router['post']('/:id/conditions',auth[_0x6e09('0xc')](),controller['addConditions']);router['post'](_0x6e09('0x10'),auth[_0x6e09('0xc')](),controller[_0x6e09('0x11')]);router['put'](_0x6e09('0x12'),auth[_0x6e09('0xc')](),controller['update']);router['delete'](_0x6e09('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd5b2=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','show','/:id/conditions','isAuthenticated','getConditions','get','/:id/actions','getActions','post','create','addConditions','addActions','put','update','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xd5b2[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require('multer');var util=require(_0x2d5b('0x0'));var path=require(_0x2d5b('0x1'));var timeout=require('connect-timeout');var express=require(_0x2d5b('0x2'));var router=express[_0x2d5b('0x3')]();var fs_extra=require(_0x2d5b('0x4'));var auth=require(_0x2d5b('0x5'));var interaction=require(_0x2d5b('0x6'));var config=require(_0x2d5b('0x7'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2d5b('0x8')]);router['get'](_0x2d5b('0x9'),auth['isAuthenticated'](),controller[_0x2d5b('0xa')]);router['get'](_0x2d5b('0xb'),auth[_0x2d5b('0xc')](),controller[_0x2d5b('0xd')]);router[_0x2d5b('0xe')](_0x2d5b('0xf'),auth[_0x2d5b('0xc')](),controller[_0x2d5b('0x10')]);router[_0x2d5b('0x11')]('/',auth[_0x2d5b('0xc')](),controller[_0x2d5b('0x12')]);router[_0x2d5b('0x11')](_0x2d5b('0xb'),auth[_0x2d5b('0xc')](),controller[_0x2d5b('0x13')]);router['post']('/:id/actions',auth[_0x2d5b('0xc')](),controller[_0x2d5b('0x14')]);router[_0x2d5b('0x15')](_0x2d5b('0x9'),auth[_0x2d5b('0xc')](),controller[_0x2d5b('0x16')]);router['delete'](_0x2d5b('0x9'),auth['isAuthenticated'](),controller[_0x2d5b('0x17')]);module[_0x2d5b('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f614277..de10a4f 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 _0x9045=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#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)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED'];(function(_0x275ae6,_0x51d1cb){var _0x4e6bd3=function(_0x507fea){while(--_0x507fea){_0x275ae6['push'](_0x275ae6['shift']());}};_0x4e6bd3(++_0x51d1cb);}(_0x9045,0x83));var _0x5904=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x9045[_0x2cf2e9];return _0xd3670d;};'use strict';var Sequelize=require(_0x5904('0x0'));module['exports']={'name':{'type':Sequelize[_0x5904('0x1')],'unique':_0x5904('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5904('0x3')](_0x5904('0x4')),'allowNull':![],'defaultValue':_0x5904('0x4')},'description':{'type':Sequelize[_0x5904('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5904('0x5')},'limitCalls':{'type':Sequelize[_0x5904('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5904('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5904('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5904('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5904('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5904('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5904('0x6')](0x3)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5904('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5904('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5904('0x6')](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5904('0x6')](0x3)[_0x5904('0x8')],'defaultValue':0x3,'comment':_0x5904('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5904('0x6')](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5904('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5904('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5904('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5904('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5904('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5904('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x5904('0x6')](0x9)[_0x5904('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5904('0x6')](0x9)[_0x5904('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5904('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5904('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5904('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5904('0x6')](0x9)[_0x5904('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5904('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5904('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5904('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5904('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5904('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5904('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5904('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5904('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5904('0x6')](0x9)[_0x5904('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x5904('0x3')](_0x5904('0x18'),_0x5904('0x19')),'defaultValue':_0x5904('0x18')},'dialPrefix':{'type':Sequelize[_0x5904('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5904('0x6')](0x3)[_0x5904('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5904('0x1a')},'dialCutDigit':{'type':Sequelize[_0x5904('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5904('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5904('0x6')](0x3)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5904('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5904('0x6')](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x5904('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5904('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5904('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5904('0x6')](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5904('0x6')](0x3)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5904('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5904('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5904('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5904('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5904('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5904('0x6')](0x5)[_0x5904('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5904('0x22')}};
\ No newline at end of file
+var _0x0b79=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\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)','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x268202,_0x4ff2ff){var _0x1847aa=function(_0x23ac03){while(--_0x23ac03){_0x268202['push'](_0x268202['shift']());}};_0x1847aa(++_0x4ff2ff);}(_0x0b79,0x9a));var _0x90b7=function(_0x3892e1,_0x3f2266){_0x3892e1=_0x3892e1-0x0;var _0x4264e5=_0x0b79[_0x3892e1];return _0x4264e5;};'use strict';var Sequelize=require('sequelize');module[_0x90b7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x90b7('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x90b7('0x2')](_0x90b7('0x3')),'allowNull':![],'defaultValue':_0x90b7('0x3')},'description':{'type':Sequelize[_0x90b7('0x4')]},'active':{'type':Sequelize[_0x90b7('0x5')],'defaultValue':0x0,'comment':_0x90b7('0x6')},'limitCalls':{'type':Sequelize[_0x90b7('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x90b7('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x90b7('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x90b7('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x90b7('0x7')](0x3)[_0x90b7('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90b7('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x90b7('0x7')](0x3)[_0x90b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90b7('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90b7('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90b7('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x90b7('0x7')](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x90b7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x90b7('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90b7('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x90b7('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x90b7('0x4')],'defaultValue':_0x90b7('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x90b7('0x2')]('always',_0x90b7('0x11'),'onlyIfOpen'),'defaultValue':_0x90b7('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x90b7('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x90b7('0x7')](0x9)[_0x90b7('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x90b7('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x90b7('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x90b7('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x90b7('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x90b7('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x90b7('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x90b7('0x7')](0x9)[_0x90b7('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x90b7('0x7')](0x9)[_0x90b7('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x90b7('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x90b7('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x90b7('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x90b7('0x7')](0x9)[_0x90b7('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x90b7('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x90b7('0x2')](_0x90b7('0x1c'),_0x90b7('0x1d')),'defaultValue':_0x90b7('0x1c')},'dialPrefix':{'type':Sequelize[_0x90b7('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x90b7('0x7')](0x3)[_0x90b7('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x90b7('0x1e')},'dialCutDigit':{'type':Sequelize[_0x90b7('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x90b7('0x7')](0x3)[_0x90b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90b7('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x90b7('0x7')](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x90b7('0x7')](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90b7('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x90b7('0x7')](0x3)[_0x90b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90b7('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x90b7('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x90b7('0x7')](0x3)[_0x90b7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x90b7('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x90b7('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x90b7('0x7')](0x5)[_0x90b7('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index e6751ac..6606dc0 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 _0xae3c=['nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','Campaign','includeAll','catch','show','params','rawAttributes','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','error','update','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','rows','getHopperHistories','CmHopperHistory','findAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','ListId','select','phone','field','NOW()','scheduledAt','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','IvrCampaigns','UserProfileResource','then','sendStatus','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xae3c,0x159));var _0xcae3=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xae3c[_0x3cb30b];return _0x2ca717;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcae3('0x0'));var jsonpatch=require(_0xcae3('0x1'));var rp=require('request-promise');var moment=require(_0xcae3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcae3('0x3'));var path=require(_0xcae3('0x4'));var sox=require('sox');var csv=require(_0xcae3('0x5'));var ejs=require(_0xcae3('0x6'));var fs=require('fs');var fs_extra=require(_0xcae3('0x7'));var _=require(_0xcae3('0x8'));var squel=require(_0xcae3('0x9'));var crypto=require('crypto');var jsforce=require(_0xcae3('0xa'));var deskjs=require(_0xcae3('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcae3('0xc'));var Redis=require('ioredis');var authService=require(_0xcae3('0xd'));var qs=require(_0xcae3('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcae3('0xf'));var logger=require(_0xcae3('0x10'))(_0xcae3('0x11'));var utils=require(_0xcae3('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcae3('0x13'));var db=require(_0xcae3('0x14'))['db'];function respondWithStatusCode(_0x1b08b4,_0x5cef5d){_0x5cef5d=_0x5cef5d||0xcc;return function(_0x17ffa4){if(_0x17ffa4){return _0x1b08b4['sendStatus'](_0x5cef5d);}return _0x1b08b4['status'](_0x5cef5d)[_0xcae3('0x15')]();};}function respondWithResult(_0x270097,_0x234e9d){_0x234e9d=_0x234e9d||0xc8;return function(_0x43ee66){if(_0x43ee66){return _0x270097[_0xcae3('0x16')](_0x234e9d)[_0xcae3('0x17')](_0x43ee66);}};}function respondWithFilteredResult(_0x1d297a,_0x3d9e68){return function(_0x154a9d){if(_0x154a9d){var _0x3da154=typeof _0x3d9e68[_0xcae3('0x18')]===_0xcae3('0x19')&&typeof _0x3d9e68['limit']==='undefined';var _0x348bfc=_0x154a9d[_0xcae3('0x1a')];var _0x42e9ff=_0x3da154?0x0:_0x3d9e68['offset'];var _0x4e12a6=_0x3da154?_0x154a9d[_0xcae3('0x1a')]:_0x3d9e68[_0xcae3('0x18')]+_0x3d9e68[_0xcae3('0x1b')];var _0x5771d9;if(_0x4e12a6>=_0x348bfc){_0x4e12a6=_0x348bfc;_0x5771d9=0xc8;}else{_0x5771d9=0xce;}_0x1d297a[_0xcae3('0x16')](_0x5771d9);return _0x1d297a[_0xcae3('0x1c')](_0xcae3('0x1d'),_0x42e9ff+'-'+_0x4e12a6+'/'+_0x348bfc)['json'](_0x154a9d);}return null;};}function patchUpdates(_0xbc9478){return function(_0x62bbdd){try{jsonpatch[_0xcae3('0x1e')](_0x62bbdd,_0xbc9478,!![]);}catch(_0x419ab0){return BPromise[_0xcae3('0x1f')](_0x419ab0);}return _0x62bbdd[_0xcae3('0x20')]();};}function saveUpdates(_0x39b93f,_0x554189){return function(_0xeae52b){if(_0xeae52b){return _0xeae52b['update'](_0x39b93f)['then'](function(_0x149d02){return _0x149d02;});}return null;};}function removeEntity(_0x3feb7e,_0x3b01f5){return function(_0x4ab0d4){if(_0x4ab0d4){return _0x4ab0d4[_0xcae3('0x21')]()['then'](function(){var _0x556144=_0x4ab0d4[_0xcae3('0x22')]({'plain':!![]});var _0x1fd4e5=_0xcae3('0x23');return db[_0xcae3('0x24')][_0xcae3('0x21')]({'where':{'type':_0x1fd4e5,'resourceId':_0x556144['id']}})[_0xcae3('0x25')](function(){return _0x4ab0d4;});})[_0xcae3('0x25')](function(){_0x3feb7e[_0xcae3('0x16')](0xcc)[_0xcae3('0x15')]();});}};}function handleEntityNotFound(_0x329e53,_0x477949){return function(_0x1ab203){if(!_0x1ab203){_0x329e53[_0xcae3('0x26')](0x194);}return _0x1ab203;};}function handleError(_0x151a71,_0x1b56cc){_0x1b56cc=_0x1b56cc||0x1f4;return function(_0x490285){logger['error'](_0x490285[_0xcae3('0x27')]);if(_0x490285[_0xcae3('0x28')]){delete _0x490285[_0xcae3('0x28')];}_0x151a71['status'](_0x1b56cc)[_0xcae3('0x29')](_0x490285);};}exports[_0xcae3('0x2a')]=function(_0x104407,_0x4c5015){var _0x287b71={},_0x40d4a6={},_0x550125={'count':0x0,'rows':[]};var _0x863c3d=_[_0xcae3('0x2b')](db['Campaign']['rawAttributes'],function(_0xc12a57){return{'name':_0xc12a57[_0xcae3('0x2c')],'type':_0xc12a57['type'][_0xcae3('0x2d')]};});_0x40d4a6['model']=_[_0xcae3('0x2b')](_0x863c3d,_0xcae3('0x28'));_0x40d4a6[_0xcae3('0x2e')]=_[_0xcae3('0x2f')](_0x104407['query']);_0x40d4a6[_0xcae3('0x30')]=_[_0xcae3('0x31')](_0x40d4a6[_0xcae3('0x32')],_0x40d4a6[_0xcae3('0x2e')]);_0x287b71[_0xcae3('0x33')]=_['intersection'](_0x40d4a6[_0xcae3('0x32')],qs[_0xcae3('0x34')](_0x104407[_0xcae3('0x2e')][_0xcae3('0x34')]));_0x287b71[_0xcae3('0x33')]=_0x287b71[_0xcae3('0x33')][_0xcae3('0x35')]?_0x287b71[_0xcae3('0x33')]:_0x40d4a6[_0xcae3('0x32')];if(!_0x104407[_0xcae3('0x2e')]['hasOwnProperty'](_0xcae3('0x36'))){_0x287b71[_0xcae3('0x1b')]=qs['limit'](_0x104407[_0xcae3('0x2e')][_0xcae3('0x1b')]);_0x287b71[_0xcae3('0x18')]=qs[_0xcae3('0x18')](_0x104407[_0xcae3('0x2e')]['offset']);}_0x287b71['order']=qs[_0xcae3('0x37')](_0x104407[_0xcae3('0x2e')][_0xcae3('0x37')]);_0x287b71[_0xcae3('0x38')]=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x104407[_0xcae3('0x2e')],_0x40d4a6['filters']),_0x863c3d);if(_0x104407['query'][_0xcae3('0x3a')]){_0x287b71[_0xcae3('0x38')]=_[_0xcae3('0x3b')](_0x287b71[_0xcae3('0x38')],{'$or':_[_0xcae3('0x2b')](_0x863c3d,function(_0x260677){if(_0x260677[_0xcae3('0x3c')]!==_0xcae3('0x3d')){var _0x2734a3={};_0x2734a3[_0x260677[_0xcae3('0x28')]]={'$like':'%'+_0x104407[_0xcae3('0x2e')][_0xcae3('0x3a')]+'%'};return _0x2734a3;}})});}_0x287b71=_[_0xcae3('0x3b')]({},_0x287b71,_0x104407[_0xcae3('0x3e')]);var _0x238ce7={'where':_0x287b71[_0xcae3('0x38')]};return db[_0xcae3('0x3f')][_0xcae3('0x1a')](_0x238ce7)['then'](function(_0x1a51eb){_0x550125[_0xcae3('0x1a')]=_0x1a51eb;if(_0x104407[_0xcae3('0x2e')][_0xcae3('0x40')]){_0x287b71['include']=[{'all':!![]}];}return db[_0xcae3('0x3f')]['findAll'](_0x287b71);})[_0xcae3('0x25')](function(_0x105e65){_0x550125['rows']=_0x105e65;return _0x550125;})['then'](respondWithFilteredResult(_0x4c5015,_0x287b71))[_0xcae3('0x41')](handleError(_0x4c5015,null));};exports[_0xcae3('0x42')]=function(_0x3ef968,_0x41a882){var _0x25576b={'raw':![],'where':{'id':_0x3ef968[_0xcae3('0x43')]['id']}},_0x2f6525={};_0x2f6525[_0xcae3('0x32')]=_[_0xcae3('0x2f')](db[_0xcae3('0x3f')][_0xcae3('0x44')]);_0x2f6525['query']=_['keys'](_0x3ef968['query']);_0x2f6525[_0xcae3('0x30')]=_['intersection'](_0x2f6525['model'],_0x2f6525['query']);_0x25576b[_0xcae3('0x33')]=_['intersection'](_0x2f6525[_0xcae3('0x32')],qs['fields'](_0x3ef968[_0xcae3('0x2e')][_0xcae3('0x34')]));_0x25576b['attributes']=_0x25576b[_0xcae3('0x33')][_0xcae3('0x35')]?_0x25576b['attributes']:_0x2f6525[_0xcae3('0x32')];if(_0x3ef968[_0xcae3('0x2e')][_0xcae3('0x40')]){_0x25576b[_0xcae3('0x45')]=[{'all':!![]}];}_0x25576b=_[_0xcae3('0x3b')]({},_0x25576b,_0x3ef968[_0xcae3('0x3e')]);return db[_0xcae3('0x3f')][_0xcae3('0x46')](_0x25576b)[_0xcae3('0x25')](handleEntityNotFound(_0x41a882,null))['then'](respondWithResult(_0x41a882,null))['catch'](handleError(_0x41a882,null));};exports[_0xcae3('0x47')]=function(_0x36e8a8,_0x65b9d){return db[_0xcae3('0x3f')][_0xcae3('0x47')](_0x36e8a8[_0xcae3('0x48')],{})[_0xcae3('0x25')](function(_0x2f8614){var _0x51b33e=_0x36e8a8[_0xcae3('0x49')]['get']({'plain':!![]});if(!_0x51b33e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51b33e[_0xcae3('0x4a')]==='user'){var _0x26ba1f=_0x2f8614[_0xcae3('0x22')]({'plain':!![]});var _0x3706f1=_0xcae3('0x23');return db['UserProfileSection'][_0xcae3('0x46')]({'where':{'name':_0x3706f1,'userProfileId':_0x51b33e[_0xcae3('0x4b')]},'raw':!![]})[_0xcae3('0x25')](function(_0x284ae8){if(_0x284ae8&&_0x284ae8[_0xcae3('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x26ba1f['name'],'resourceId':_0x26ba1f['id'],'type':_0x284ae8[_0xcae3('0x28')],'sectionId':_0x284ae8['id']},{})['then'](function(){return _0x2f8614;});}else{return _0x2f8614;}})[_0xcae3('0x41')](function(_0x376cae){logger['error'](_0xcae3('0x4d'),_0x376cae);throw _0x376cae;});}return _0x2f8614;})[_0xcae3('0x25')](respondWithResult(_0x65b9d,0xc9))[_0xcae3('0x41')](handleError(_0x65b9d,null));};exports[_0xcae3('0x4e')]=function(_0x5aa8b2,_0x38938a){var _0xbd8393={'where':{'id':_0x5aa8b2[_0xcae3('0x43')]['id']}},_0x5c02c2={};_0x5c02c2[_0xcae3('0x32')]=_[_0xcae3('0x2f')](db[_0xcae3('0x3f')][_0xcae3('0x44')]);_0xbd8393['attributes']=_[_0xcae3('0x31')](_0x5c02c2[_0xcae3('0x32')],qs[_0xcae3('0x34')](_0x5aa8b2[_0xcae3('0x2e')][_0xcae3('0x34')]));_0xbd8393[_0xcae3('0x33')]=_0xbd8393['attributes'][_0xcae3('0x35')]?_0xbd8393[_0xcae3('0x33')]:_0x5c02c2[_0xcae3('0x32')];if(_0x5aa8b2['query'][_0xcae3('0x40')]){_0xbd8393['include']=[{'all':!![]}];}_0xbd8393=_[_0xcae3('0x3b')]({},_0xbd8393,_0x5aa8b2[_0xcae3('0x3e')]);return db[_0xcae3('0x3f')][_0xcae3('0x46')](_0xbd8393)[_0xcae3('0x25')](handleEntityNotFound(_0x38938a,null))[_0xcae3('0x25')](function(_0x4255ba){if(_0x4255ba){var _0x13cf76=_0x4255ba['get']({'plain':!![]});_0x13cf76=qs[_0xcae3('0x4f')](_0x13cf76,['id',_0xcae3('0x50'),_0xcae3('0x51')]);_0x5aa8b2['body']=_[_0xcae3('0x4f')](_0x5aa8b2['body'],['id',_0xcae3('0x50'),_0xcae3('0x51')]);return db['Campaign']['create'](_[_0xcae3('0x3b')](_0x13cf76,_0x5aa8b2[_0xcae3('0x48')]),{'include':_0x5aa8b2[_0xcae3('0x2e')][_0xcae3('0x40')]?[{'all':!![]}]:undefined})[_0xcae3('0x25')](function(_0x30367e){var _0x366649=_0x5aa8b2[_0xcae3('0x49')][_0xcae3('0x22')]({'plain':!![]});if(!_0x366649)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x366649['role']===_0xcae3('0x49')){var _0x34c14a=_0x30367e['get']({'plain':!![]});var _0xca64a='IvrCampaigns';return db['UserProfileSection'][_0xcae3('0x46')]({'where':{'name':_0xca64a,'userProfileId':_0x366649['userProfileId']},'raw':!![]})['then'](function(_0x4013d0){if(_0x4013d0&&_0x4013d0['autoAssociation']===0x0){return db['UserProfileResource'][_0xcae3('0x47')]({'name':_0x34c14a[_0xcae3('0x28')],'resourceId':_0x34c14a['id'],'type':_0x4013d0[_0xcae3('0x28')],'sectionId':_0x4013d0['id']},{})[_0xcae3('0x25')](function(){return _0x30367e;});}else{return _0x30367e;}})[_0xcae3('0x41')](function(_0xf1b8c){logger[_0xcae3('0x52')](_0xcae3('0x4d'),_0xf1b8c);throw _0xf1b8c;});}return _0x30367e;});}})[_0xcae3('0x25')](respondWithResult(_0x38938a,0xc9))[_0xcae3('0x41')](handleError(_0x38938a,null));};exports[_0xcae3('0x53')]=function(_0x43d55d,_0x37f983){if(_0x43d55d['body']['id']){delete _0x43d55d['body']['id'];}return db[_0xcae3('0x3f')][_0xcae3('0x46')]({'where':{'id':_0x43d55d[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x37f983,null))[_0xcae3('0x25')](saveUpdates(_0x43d55d[_0xcae3('0x48')],null))[_0xcae3('0x25')](respondWithResult(_0x37f983,null))['catch'](handleError(_0x37f983,null));};exports['destroy']=function(_0x422f99,_0x1ae51c){return db[_0xcae3('0x3f')][_0xcae3('0x46')]({'where':{'id':_0x422f99[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x1ae51c,null))[_0xcae3('0x25')](removeEntity(_0x1ae51c,null))[_0xcae3('0x41')](handleError(_0x1ae51c,null));};exports[_0xcae3('0x54')]=function(_0x4a8883,_0x555e40,_0x249175){var _0x4a74ed={'raw':!![],'where':{}};var _0x25bdae={};var _0x13f928={'count':0x0,'rows':[]};return db[_0xcae3('0x3f')][_0xcae3('0x55')]({'where':{'id':_0x4a8883['params']['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x555e40,null))[_0xcae3('0x25')](function(_0x396d9b){if(_0x396d9b){_0x25bdae[_0xcae3('0x32')]=_[_0xcae3('0x2f')](db[_0xcae3('0x56')][_0xcae3('0x44')]);_0x25bdae[_0xcae3('0x2e')]=_[_0xcae3('0x2f')](_0x4a8883[_0xcae3('0x2e')]);_0x25bdae[_0xcae3('0x30')]=_[_0xcae3('0x31')](_0x25bdae[_0xcae3('0x32')],_0x25bdae[_0xcae3('0x2e')]);_0x4a74ed[_0xcae3('0x33')]=_['intersection'](_0x25bdae[_0xcae3('0x32')],qs[_0xcae3('0x34')](_0x4a8883['query'][_0xcae3('0x34')]));_0x4a74ed[_0xcae3('0x33')]=_0x4a74ed[_0xcae3('0x33')]['length']?_0x4a74ed[_0xcae3('0x33')]:_0x25bdae[_0xcae3('0x32')];if(!_0x4a8883[_0xcae3('0x2e')][_0xcae3('0x57')](_0xcae3('0x36'))){_0x4a74ed['limit']=qs[_0xcae3('0x1b')](_0x4a8883['query'][_0xcae3('0x1b')]);_0x4a74ed[_0xcae3('0x18')]=qs[_0xcae3('0x18')](_0x4a8883[_0xcae3('0x2e')]['offset']);}_0x4a74ed[_0xcae3('0x58')]=qs[_0xcae3('0x37')](_0x4a8883[_0xcae3('0x2e')][_0xcae3('0x37')]);_0x4a74ed[_0xcae3('0x38')]=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x4a8883['query'],_0x25bdae[_0xcae3('0x30')]));_0x4a74ed[_0xcae3('0x38')][_0xcae3('0x59')]=_0x396d9b['id'];if(_0x4a8883[_0xcae3('0x2e')][_0xcae3('0x3a')]){_0x4a74ed['where']=_[_0xcae3('0x3b')](_0x4a74ed[_0xcae3('0x38')],{'$or':_[_0xcae3('0x2b')](_0x4a74ed['attributes'],function(_0x597146){var _0xe47197={};_0xe47197[_0x597146]={'$like':'%'+_0x4a8883[_0xcae3('0x2e')][_0xcae3('0x3a')]+'%'};return _0xe47197;})});}_0x4a74ed=_[_0xcae3('0x3b')]({},_0x4a74ed,_0x4a8883['options']);return db[_0xcae3('0x56')][_0xcae3('0x1a')]({'where':_0x4a74ed[_0xcae3('0x38')]})[_0xcae3('0x25')](function(_0x431938){_0x13f928[_0xcae3('0x1a')]=_0x431938;if(_0x4a8883[_0xcae3('0x2e')][_0xcae3('0x40')]){_0x4a74ed[_0xcae3('0x45')]=[{'all':!![]}];}return db[_0xcae3('0x56')]['findAll'](_0x4a74ed);})[_0xcae3('0x25')](function(_0x165bb6){_0x13f928[_0xcae3('0x5a')]=_0x165bb6;return _0x13f928;});}})[_0xcae3('0x25')](respondWithFilteredResult(_0x555e40,_0x4a74ed))['catch'](handleError(_0x555e40,null));};exports[_0xcae3('0x5b')]=function(_0x589150,_0x407e73,_0x3033fc){var _0x5010a6={'raw':!![],'where':{}};var _0x1302ba={};var _0x247790={'count':0x0,'rows':[]};return db[_0xcae3('0x3f')][_0xcae3('0x55')]({'where':{'id':_0x589150['params']['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x407e73,null))[_0xcae3('0x25')](function(_0x43df07){if(_0x43df07){_0x1302ba[_0xcae3('0x32')]=_[_0xcae3('0x2f')](db['CmHopperHistory'][_0xcae3('0x44')]);_0x1302ba['query']=_[_0xcae3('0x2f')](_0x589150[_0xcae3('0x2e')]);_0x1302ba[_0xcae3('0x30')]=_[_0xcae3('0x31')](_0x1302ba[_0xcae3('0x32')],_0x1302ba[_0xcae3('0x2e')]);_0x5010a6[_0xcae3('0x33')]=_[_0xcae3('0x31')](_0x1302ba['model'],qs['fields'](_0x589150[_0xcae3('0x2e')][_0xcae3('0x34')]));_0x5010a6[_0xcae3('0x33')]=_0x5010a6[_0xcae3('0x33')][_0xcae3('0x35')]?_0x5010a6['attributes']:_0x1302ba['model'];if(!_0x589150['query']['hasOwnProperty']('nolimit')){_0x5010a6[_0xcae3('0x1b')]=qs[_0xcae3('0x1b')](_0x589150['query']['limit']);_0x5010a6[_0xcae3('0x18')]=qs['offset'](_0x589150[_0xcae3('0x2e')][_0xcae3('0x18')]);}_0x5010a6[_0xcae3('0x58')]=qs['sort'](_0x589150[_0xcae3('0x2e')][_0xcae3('0x37')]);_0x5010a6[_0xcae3('0x38')]=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x589150[_0xcae3('0x2e')],_0x1302ba[_0xcae3('0x30')]));_0x5010a6[_0xcae3('0x38')][_0xcae3('0x59')]=_0x43df07['id'];if(_0x589150['query'][_0xcae3('0x3a')]){_0x5010a6['where']=_[_0xcae3('0x3b')](_0x5010a6['where'],{'$or':_['map'](_0x5010a6[_0xcae3('0x33')],function(_0x3782b8){var _0x136f35={};_0x136f35[_0x3782b8]={'$like':'%'+_0x589150['query']['filter']+'%'};return _0x136f35;})});}_0x5010a6=_[_0xcae3('0x3b')]({},_0x5010a6,_0x589150[_0xcae3('0x3e')]);return db[_0xcae3('0x5c')][_0xcae3('0x1a')]({'where':_0x5010a6['where']})[_0xcae3('0x25')](function(_0x5a0aaa){_0x247790[_0xcae3('0x1a')]=_0x5a0aaa;if(_0x589150['query']['includeAll']){_0x5010a6[_0xcae3('0x45')]=[{'all':!![]}];}return db[_0xcae3('0x5c')][_0xcae3('0x5d')](_0x5010a6);})['then'](function(_0x16f230){_0x247790[_0xcae3('0x5a')]=_0x16f230;return _0x247790;});}})[_0xcae3('0x25')](respondWithFilteredResult(_0x407e73,_0x5010a6))['catch'](handleError(_0x407e73,null));};exports['getHopperFinals']=function(_0x1b160e,_0x17aba4,_0x3df0c2){var _0x51a5b7={'raw':!![],'where':{}};var _0x230197={};var _0x2e8779={'count':0x0,'rows':[]};return db['Campaign'][_0xcae3('0x55')]({'where':{'id':_0x1b160e['params']['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x17aba4,null))[_0xcae3('0x25')](function(_0x29809c){if(_0x29809c){_0x230197[_0xcae3('0x32')]=_['keys'](db[_0xcae3('0x5e')][_0xcae3('0x44')]);_0x230197[_0xcae3('0x2e')]=_['keys'](_0x1b160e[_0xcae3('0x2e')]);_0x230197[_0xcae3('0x30')]=_[_0xcae3('0x31')](_0x230197[_0xcae3('0x32')],_0x230197['query']);_0x51a5b7[_0xcae3('0x33')]=_[_0xcae3('0x31')](_0x230197[_0xcae3('0x32')],qs[_0xcae3('0x34')](_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x34')]));_0x51a5b7[_0xcae3('0x33')]=_0x51a5b7[_0xcae3('0x33')]['length']?_0x51a5b7[_0xcae3('0x33')]:_0x230197[_0xcae3('0x32')];if(!_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x57')](_0xcae3('0x36'))){_0x51a5b7['limit']=qs[_0xcae3('0x1b')](_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x1b')]);_0x51a5b7[_0xcae3('0x18')]=qs[_0xcae3('0x18')](_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x18')]);}_0x51a5b7[_0xcae3('0x58')]=qs[_0xcae3('0x37')](_0x1b160e[_0xcae3('0x2e')]['sort']);_0x51a5b7[_0xcae3('0x38')]=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x1b160e[_0xcae3('0x2e')],_0x230197[_0xcae3('0x30')]));_0x51a5b7[_0xcae3('0x38')]['CampaignId']=_0x29809c['id'];if(_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x3a')]){_0x51a5b7[_0xcae3('0x38')]=_[_0xcae3('0x3b')](_0x51a5b7['where'],{'$or':_['map'](_0x51a5b7[_0xcae3('0x33')],function(_0x329780){var _0x404537={};_0x404537[_0x329780]={'$like':'%'+_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x3a')]+'%'};return _0x404537;})});}_0x51a5b7=_[_0xcae3('0x3b')]({},_0x51a5b7,_0x1b160e[_0xcae3('0x3e')]);return db['CmHopperFinal'][_0xcae3('0x1a')]({'where':_0x51a5b7[_0xcae3('0x38')]})[_0xcae3('0x25')](function(_0x4597d1){_0x2e8779[_0xcae3('0x1a')]=_0x4597d1;if(_0x1b160e[_0xcae3('0x2e')][_0xcae3('0x40')]){_0x51a5b7[_0xcae3('0x45')]=[{'all':!![]}];}return db[_0xcae3('0x5e')][_0xcae3('0x5d')](_0x51a5b7);})[_0xcae3('0x25')](function(_0x4abbd6){_0x2e8779[_0xcae3('0x5a')]=_0x4abbd6;return _0x2e8779;});}})['then'](respondWithFilteredResult(_0x17aba4,_0x51a5b7))['catch'](handleError(_0x17aba4,null));};exports[_0xcae3('0x5f')]=function(_0x2c3b93,_0x2b77dd,_0x21bfff){var _0x25805c={'raw':!![],'where':{}};var _0x4da6c7={};var _0x4858da={'count':0x0,'rows':[]};return db[_0xcae3('0x3f')][_0xcae3('0x55')]({'where':{'id':_0x2c3b93['params']['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x2b77dd,null))[_0xcae3('0x25')](function(_0x183169){if(_0x183169){_0x4da6c7[_0xcae3('0x32')]=_[_0xcae3('0x2f')](db[_0xcae3('0x60')][_0xcae3('0x44')]);_0x4da6c7['query']=_[_0xcae3('0x2f')](_0x2c3b93[_0xcae3('0x2e')]);_0x4da6c7['filters']=_[_0xcae3('0x31')](_0x4da6c7[_0xcae3('0x32')],_0x4da6c7['query']);_0x25805c['attributes']=_[_0xcae3('0x31')](_0x4da6c7[_0xcae3('0x32')],qs['fields'](_0x2c3b93[_0xcae3('0x2e')]['fields']));_0x25805c[_0xcae3('0x33')]=_0x25805c['attributes'][_0xcae3('0x35')]?_0x25805c[_0xcae3('0x33')]:_0x4da6c7['model'];if(!_0x2c3b93['query']['hasOwnProperty'](_0xcae3('0x36'))){_0x25805c[_0xcae3('0x1b')]=qs['limit'](_0x2c3b93[_0xcae3('0x2e')]['limit']);_0x25805c[_0xcae3('0x18')]=qs[_0xcae3('0x18')](_0x2c3b93[_0xcae3('0x2e')]['offset']);}_0x25805c['order']=qs['sort'](_0x2c3b93[_0xcae3('0x2e')][_0xcae3('0x37')]);_0x25805c[_0xcae3('0x38')]=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x2c3b93['query'],_0x4da6c7[_0xcae3('0x30')]));_0x25805c[_0xcae3('0x38')]['CampaignId']=_0x183169['id'];if(_0x2c3b93['query']['filter']){_0x25805c['where']=_[_0xcae3('0x3b')](_0x25805c['where'],{'$or':_[_0xcae3('0x2b')](_0x25805c['attributes'],function(_0x449713){var _0x1a0c34={};_0x1a0c34[_0x449713]={'$like':'%'+_0x2c3b93['query'][_0xcae3('0x3a')]+'%'};return _0x1a0c34;})});}_0x25805c=_[_0xcae3('0x3b')]({},_0x25805c,_0x2c3b93['options']);return db[_0xcae3('0x60')]['count']({'where':_0x25805c[_0xcae3('0x38')]})[_0xcae3('0x25')](function(_0x1da92c){_0x4858da[_0xcae3('0x1a')]=_0x1da92c;if(_0x2c3b93[_0xcae3('0x2e')][_0xcae3('0x40')]){_0x25805c[_0xcae3('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xcae3('0x5d')](_0x25805c);})[_0xcae3('0x25')](function(_0x3d3214){_0x4858da[_0xcae3('0x5a')]=_0x3d3214;return _0x4858da;});}})[_0xcae3('0x25')](respondWithFilteredResult(_0x2b77dd,_0x25805c))[_0xcae3('0x41')](handleError(_0x2b77dd,null));};exports[_0xcae3('0x61')]=function(_0x27b268,_0xd55e06,_0x31a71c){var _0x4a6435={};var _0x38c46a={};var _0x52fadd;var _0x188daa;return db[_0xcae3('0x3f')][_0xcae3('0x55')]({'where':{'id':_0x27b268['params']['id']}})['then'](handleEntityNotFound(_0xd55e06,null))[_0xcae3('0x25')](function(_0x362e96){if(_0x362e96){_0x52fadd=_0x362e96;_0x38c46a['model']=_['keys'](db[_0xcae3('0x62')][_0xcae3('0x44')]);_0x38c46a[_0xcae3('0x2e')]=_[_0xcae3('0x2f')](_0x27b268[_0xcae3('0x2e')]);_0x38c46a[_0xcae3('0x30')]=_['intersection'](_0x38c46a[_0xcae3('0x32')],_0x38c46a['query']);_0x4a6435[_0xcae3('0x33')]=_['intersection'](_0x38c46a['model'],qs[_0xcae3('0x34')](_0x27b268[_0xcae3('0x2e')][_0xcae3('0x34')]));_0x4a6435[_0xcae3('0x33')]=_0x4a6435[_0xcae3('0x33')][_0xcae3('0x35')]?_0x4a6435[_0xcae3('0x33')]:_0x38c46a[_0xcae3('0x32')];_0x4a6435[_0xcae3('0x58')]=qs[_0xcae3('0x37')](_0x27b268['query'][_0xcae3('0x37')]);_0x4a6435['where']=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x27b268['query'],_0x38c46a[_0xcae3('0x30')]));if(_0x27b268[_0xcae3('0x2e')][_0xcae3('0x3a')]){_0x4a6435[_0xcae3('0x38')]=_['merge'](_0x4a6435['where'],{'$or':_[_0xcae3('0x2b')](_0x4a6435['attributes'],function(_0x278ecc){var _0x135b05={};_0x135b05[_0x278ecc]={'$like':'%'+_0x27b268['query'][_0xcae3('0x3a')]+'%'};return _0x135b05;})});}_0x4a6435=_[_0xcae3('0x3b')]({},_0x4a6435,_0x27b268[_0xcae3('0x3e')]);return _0x52fadd[_0xcae3('0x61')](_0x4a6435);}})['then'](function(_0x184c3a){if(_0x184c3a){_0x188daa=_0x184c3a[_0xcae3('0x35')];if(!_0x27b268[_0xcae3('0x2e')][_0xcae3('0x57')]('nolimit')){_0x4a6435[_0xcae3('0x1b')]=qs[_0xcae3('0x1b')](_0x27b268[_0xcae3('0x2e')][_0xcae3('0x1b')]);_0x4a6435[_0xcae3('0x18')]=qs[_0xcae3('0x18')](_0x27b268[_0xcae3('0x2e')][_0xcae3('0x18')]);}return _0x52fadd[_0xcae3('0x61')](_0x4a6435);}})[_0xcae3('0x25')](function(_0xc9d7a3){if(_0xc9d7a3){return _0xc9d7a3?{'count':_0x188daa,'rows':_0xc9d7a3}:null;}})[_0xcae3('0x25')](respondWithResult(_0xd55e06,null))[_0xcae3('0x41')](handleError(_0xd55e06,null));};exports[_0xcae3('0x63')]=function(_0x304775,_0x2349ea,_0x343a78){var _0xe0769b,_0x5c0142;return db[_0xcae3('0x3f')]['find']({'where':{'id':_0x304775[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x2349ea,null))[_0xcae3('0x25')](function(_0x1438e1){if(_0x1438e1){_0x5c0142=_0x1438e1;return _0x1438e1['addLists'](_0x304775[_0xcae3('0x48')][_0xcae3('0x64')],_[_0xcae3('0x4f')](_0x304775[_0xcae3('0x48')],[_0xcae3('0x64'),'id'])||{});}return null;})[_0xcae3('0x65')](function(_0x3fd04f){var _0x3430a2;_0xe0769b=_0x3fd04f||[];var _0x263b23=[];if(_0x3fd04f){for(var _0x5ed9b0=0x0;_0x5ed9b0<_0x3fd04f[_0xcae3('0x35')];_0x5ed9b0+=0x1){var _0x40ec47=_0x3fd04f[_0x5ed9b0][_0xcae3('0x22')]({'plain':!![]});_0x5c0142[_0xcae3('0x66')]=_0x304775[_0xcae3('0x48')][_0xcae3('0x66')]?_0x304775[_0xcae3('0x48')][_0xcae3('0x66')]:_0x5c0142[_0xcae3('0x66')];switch(_0x5c0142['dialCheckDuplicateType']){case'always':_0x3430a2=squel[_0xcae3('0x67')]()[_0xcae3('0x68')](_0xcae3('0x69'))[_0xcae3('0x6a')](['phone','scheduledAt',_0xcae3('0x6b'),_0xcae3('0x6c'),_0xcae3('0x59'),_0xcae3('0x50'),_0xcae3('0x51')],squel[_0xcae3('0x6d')]()['field']('phone',_0xcae3('0x6e'))[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x71'))['field']('id',_0xcae3('0x6b'))[_0xcae3('0x6f')](_0x40ec47[_0xcae3('0x72')][_0xcae3('0x73')](),_0xcae3('0x6c'))[_0xcae3('0x6f')](_0x304775[_0xcae3('0x43')]['id']['toString'](),_0xcae3('0x59'))[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x50'))[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x51'))['from'](_0xcae3('0x74'))[_0xcae3('0x38')]('deletedAt\x20IS\x20NULL')[_0xcae3('0x38')](_0xcae3('0x75'),_0x40ec47[_0xcae3('0x72')][_0xcae3('0x73')]())[_0xcae3('0x38')](_0xcae3('0x76'))[_0xcae3('0x38')](_0xcae3('0x77'),squel[_0xcae3('0x6d')]()[_0xcae3('0x6f')](_0xcae3('0x78'))[_0xcae3('0x79')](_0xcae3('0x7a'))[_0xcae3('0x38')](_0xcae3('0x7b'),_0x304775[_0xcae3('0x43')]['id'][_0xcae3('0x73')]()))[_0xcae3('0x38')](_0xcae3('0x77'),squel['select']()[_0xcae3('0x6f')]('COALESCE(phone,\x27\x27)')[_0xcae3('0x79')]('cm_hopper')[_0xcae3('0x38')]('CampaignId\x20=\x20?',_0x304775['params']['id'][_0xcae3('0x73')]())))['toString']();break;case'onlyIfOpen':_0x3430a2=squel[_0xcae3('0x67')]()[_0xcae3('0x68')]('cm_hopper')['fromQuery'](['phone',_0xcae3('0x71'),_0xcae3('0x6b'),_0xcae3('0x6c'),'CampaignId',_0xcae3('0x50'),_0xcae3('0x51')],squel[_0xcae3('0x6d')]()[_0xcae3('0x6f')](_0xcae3('0x6e'),_0xcae3('0x6e'))[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x71'))[_0xcae3('0x6f')]('id',_0xcae3('0x6b'))[_0xcae3('0x6f')](_0x40ec47[_0xcae3('0x72')][_0xcae3('0x73')](),_0xcae3('0x6c'))[_0xcae3('0x6f')](_0x304775[_0xcae3('0x43')]['id'][_0xcae3('0x73')](),'CampaignId')[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x50'))['field'](_0xcae3('0x70'),_0xcae3('0x51'))[_0xcae3('0x79')](_0xcae3('0x74'))[_0xcae3('0x38')](_0xcae3('0x7c'))[_0xcae3('0x38')](_0xcae3('0x75'),_0x40ec47[_0xcae3('0x72')][_0xcae3('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xcae3('0x38')](_0xcae3('0x77'),squel[_0xcae3('0x6d')]()[_0xcae3('0x6f')]('COALESCE(phone,\x27\x27)')['from'](_0xcae3('0x69'))[_0xcae3('0x38')](_0xcae3('0x7b'),_0x304775[_0xcae3('0x43')]['id']['toString']())))[_0xcae3('0x73')]();break;default:_0x3430a2=squel[_0xcae3('0x67')]()[_0xcae3('0x68')](_0xcae3('0x69'))[_0xcae3('0x6a')]([_0xcae3('0x6e'),_0xcae3('0x71'),_0xcae3('0x6b'),_0xcae3('0x6c'),_0xcae3('0x59'),_0xcae3('0x50'),_0xcae3('0x51')],squel['select']()[_0xcae3('0x6f')]('phone',_0xcae3('0x6e'))[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x71'))[_0xcae3('0x6f')]('id',_0xcae3('0x6b'))[_0xcae3('0x6f')](_0x40ec47[_0xcae3('0x72')]['toString'](),_0xcae3('0x6c'))[_0xcae3('0x6f')](_0x304775['params']['id'][_0xcae3('0x73')](),'CampaignId')[_0xcae3('0x6f')](_0xcae3('0x70'),_0xcae3('0x50'))['field'](_0xcae3('0x70'),_0xcae3('0x51'))[_0xcae3('0x79')](_0xcae3('0x74'))[_0xcae3('0x38')](_0xcae3('0x7c'))[_0xcae3('0x38')](_0xcae3('0x75'),_0x40ec47[_0xcae3('0x72')][_0xcae3('0x73')]())['where'](_0xcae3('0x76')))[_0xcae3('0x73')]();}_0x263b23[_0xcae3('0x7d')](db['sequelize'][_0xcae3('0x2e')](_0x3430a2));}return BPromise[_0xcae3('0x7e')](_0x263b23);}})[_0xcae3('0x25')](function(){return _0xe0769b;})['then'](respondWithResult(_0x2349ea,null))[_0xcae3('0x41')](handleError(_0x2349ea,null));};exports[_0xcae3('0x7f')]=function(_0x339b10,_0x13ecb5,_0x251544){return db['Campaign'][_0xcae3('0x46')]({'where':{'id':_0x339b10[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x13ecb5,null))[_0xcae3('0x25')](function(_0x23a552){if(_0x23a552){return _0x23a552[_0xcae3('0x7f')](_0x339b10[_0xcae3('0x2e')][_0xcae3('0x64')]);}})[_0xcae3('0x25')](function(_0x46c9d5){if(_0x46c9d5){return db[_0xcae3('0x56')][_0xcae3('0x21')]({'where':{'ListId':_0x339b10[_0xcae3('0x2e')][_0xcae3('0x64')],'CampaignId':_0x339b10[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](function(){return _0x46c9d5;});}})[_0xcae3('0x25')](respondWithStatusCode(_0x13ecb5,null))[_0xcae3('0x41')](handleError(_0x13ecb5,null));};exports['getBlackLists']=function(_0x1ab682,_0x1d7194,_0x5b22a6){var _0x5af82a={};var _0x507f39={};var _0x15cb4e;var _0x3465a5;return db[_0xcae3('0x3f')][_0xcae3('0x55')]({'where':{'id':_0x1ab682[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x1d7194,null))[_0xcae3('0x25')](function(_0x3a0a93){if(_0x3a0a93){_0x15cb4e=_0x3a0a93;_0x507f39['model']=_[_0xcae3('0x2f')](db[_0xcae3('0x62')]['rawAttributes']);_0x507f39[_0xcae3('0x2e')]=_[_0xcae3('0x2f')](_0x1ab682[_0xcae3('0x2e')]);_0x507f39['filters']=_[_0xcae3('0x31')](_0x507f39[_0xcae3('0x32')],_0x507f39[_0xcae3('0x2e')]);_0x5af82a[_0xcae3('0x33')]=_[_0xcae3('0x31')](_0x507f39[_0xcae3('0x32')],qs[_0xcae3('0x34')](_0x1ab682[_0xcae3('0x2e')][_0xcae3('0x34')]));_0x5af82a[_0xcae3('0x33')]=_0x5af82a['attributes'][_0xcae3('0x35')]?_0x5af82a['attributes']:_0x507f39['model'];_0x5af82a['order']=qs[_0xcae3('0x37')](_0x1ab682[_0xcae3('0x2e')][_0xcae3('0x37')]);_0x5af82a[_0xcae3('0x38')]=qs[_0xcae3('0x30')](_[_0xcae3('0x39')](_0x1ab682[_0xcae3('0x2e')],_0x507f39[_0xcae3('0x30')]));if(_0x1ab682['query']['filter']){_0x5af82a[_0xcae3('0x38')]=_[_0xcae3('0x3b')](_0x5af82a['where'],{'$or':_['map'](_0x5af82a[_0xcae3('0x33')],function(_0x248a15){var _0x4b0d37={};_0x4b0d37[_0x248a15]={'$like':'%'+_0x1ab682[_0xcae3('0x2e')][_0xcae3('0x3a')]+'%'};return _0x4b0d37;})});}_0x5af82a=_[_0xcae3('0x3b')]({},_0x5af82a,_0x1ab682[_0xcae3('0x3e')]);return _0x15cb4e[_0xcae3('0x80')](_0x5af82a);}})[_0xcae3('0x25')](function(_0x48c8d7){if(_0x48c8d7){_0x3465a5=_0x48c8d7[_0xcae3('0x35')];if(!_0x1ab682[_0xcae3('0x2e')][_0xcae3('0x57')](_0xcae3('0x36'))){_0x5af82a[_0xcae3('0x1b')]=qs['limit'](_0x1ab682['query'][_0xcae3('0x1b')]);_0x5af82a['offset']=qs['offset'](_0x1ab682[_0xcae3('0x2e')][_0xcae3('0x18')]);}return _0x15cb4e['getBlackLists'](_0x5af82a);}})[_0xcae3('0x25')](function(_0x5d5afa){if(_0x5d5afa){return _0x5d5afa?{'count':_0x3465a5,'rows':_0x5d5afa}:null;}})[_0xcae3('0x25')](respondWithResult(_0x1d7194,null))[_0xcae3('0x41')](handleError(_0x1d7194,null));};exports[_0xcae3('0x81')]=function(_0x1b8225,_0x891511,_0x24a97a){var _0x34114d,_0x282f46;return db[_0xcae3('0x3f')][_0xcae3('0x46')]({'where':{'id':_0x1b8225[_0xcae3('0x43')]['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x891511,null))['then'](function(_0x5437b5){if(_0x5437b5){_0x282f46=_0x5437b5;return _0x5437b5[_0xcae3('0x81')](_0x1b8225[_0xcae3('0x48')][_0xcae3('0x64')],_['omit'](_0x1b8225[_0xcae3('0x48')],[_0xcae3('0x64'),'id'])||{});}return null;})[_0xcae3('0x65')](function(_0x4a40a8){var _0x589905;_0x34114d=_0x4a40a8||[];var _0x51cf1a=[];if(_0x4a40a8){for(var _0x6ae99b=0x0;_0x6ae99b<_0x4a40a8[_0xcae3('0x35')];_0x6ae99b+=0x1){var _0x5a4aed=_0x4a40a8[_0x6ae99b][_0xcae3('0x22')]({'plain':!![]});_0x589905=squel[_0xcae3('0x67')]()['into'](_0xcae3('0x82'))[_0xcae3('0x6a')]([_0xcae3('0x6e'),_0xcae3('0x6b'),_0xcae3('0x6c'),'CampaignId','createdAt',_0xcae3('0x51')],squel[_0xcae3('0x6d')]()['field']('phone','phone')[_0xcae3('0x6f')]('id','ContactId')['field'](_0x5a4aed[_0xcae3('0x72')][_0xcae3('0x73')](),_0xcae3('0x6c'))[_0xcae3('0x6f')](_0x1b8225[_0xcae3('0x43')]['id'][_0xcae3('0x73')](),_0xcae3('0x59'))['field'](_0xcae3('0x70'),_0xcae3('0x50'))[_0xcae3('0x6f')](_0xcae3('0x70'),'updatedAt')[_0xcae3('0x79')](_0xcae3('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0xcae3('0x38')](_0xcae3('0x75'),_0x5a4aed[_0xcae3('0x72')][_0xcae3('0x73')]())['where'](_0xcae3('0x76')))[_0xcae3('0x73')]();_0x51cf1a[_0xcae3('0x7d')](db[_0xcae3('0x83')][_0xcae3('0x2e')](_0x589905));}return BPromise['all'](_0x51cf1a);}})[_0xcae3('0x25')](function(){return _0x34114d;})[_0xcae3('0x25')](respondWithResult(_0x891511,null))[_0xcae3('0x41')](handleError(_0x891511,null));};exports['removeBlackLists']=function(_0x4d6d57,_0x257d3f,_0x24aa56){return db[_0xcae3('0x3f')][_0xcae3('0x46')]({'where':{'id':_0x4d6d57['params']['id']}})[_0xcae3('0x25')](handleEntityNotFound(_0x257d3f,null))[_0xcae3('0x25')](function(_0x2e700d){if(_0x2e700d){return _0x2e700d[_0xcae3('0x84')](_0x4d6d57[_0xcae3('0x2e')][_0xcae3('0x64')]);}})[_0xcae3('0x25')](function(_0x55ae3d){if(_0x55ae3d){return db[_0xcae3('0x60')][_0xcae3('0x21')]({'where':{'ListId':_0x4d6d57['query'][_0xcae3('0x64')],'CampaignId':_0x4d6d57['params']['id']}})[_0xcae3('0x25')](function(){return _0x55ae3d;});}})[_0xcae3('0x25')](respondWithStatusCode(_0x257d3f,null))[_0xcae3('0x41')](handleError(_0x257d3f,null));};
\ No newline at end of file
+var _0x7eab=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','onlyIfOpen','insert','cm_contacts','COALESCE(phone,\x27\x27)','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','create','body','user'];(function(_0x32ae4e,_0x1dd4b0){var _0x1084a7=function(_0x50c403){while(--_0x50c403){_0x32ae4e['push'](_0x32ae4e['shift']());}};_0x1084a7(++_0x1dd4b0);}(_0x7eab,0xca));var _0xb7ea=function(_0x1b34fe,_0x362300){_0x1b34fe=_0x1b34fe-0x0;var _0x438670=_0x7eab[_0x1b34fe];return _0x438670;};'use strict';var emlformat=require(_0xb7ea('0x0'));var rimraf=require(_0xb7ea('0x1'));var zipdir=require(_0xb7ea('0x2'));var jsonpatch=require(_0xb7ea('0x3'));var rp=require(_0xb7ea('0x4'));var moment=require(_0xb7ea('0x5'));var BPromise=require(_0xb7ea('0x6'));var Mustache=require(_0xb7ea('0x7'));var util=require(_0xb7ea('0x8'));var path=require('path');var sox=require(_0xb7ea('0x9'));var csv=require(_0xb7ea('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7ea('0xb'));var _=require(_0xb7ea('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb7ea('0xd'));var deskjs=require(_0xb7ea('0xe'));var toCsv=require(_0xb7ea('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb7ea('0xf'));var authService=require(_0xb7ea('0x10'));var qs=require(_0xb7ea('0x11'));var as=require(_0xb7ea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7ea('0x13'))(_0xb7ea('0x14'));var utils=require('../../config/utils');var config=require(_0xb7ea('0x15'));var licenseUtil=require(_0xb7ea('0x16'));var db=require(_0xb7ea('0x17'))['db'];function respondWithStatusCode(_0x61f25,_0x3083d5){_0x3083d5=_0x3083d5||0xcc;return function(_0x4d55ec){if(_0x4d55ec){return _0x61f25['sendStatus'](_0x3083d5);}return _0x61f25[_0xb7ea('0x18')](_0x3083d5)[_0xb7ea('0x19')]();};}function respondWithResult(_0x2f47ae,_0x5941bd){_0x5941bd=_0x5941bd||0xc8;return function(_0x50b205){if(_0x50b205){return _0x2f47ae[_0xb7ea('0x18')](_0x5941bd)[_0xb7ea('0x1a')](_0x50b205);}};}function respondWithFilteredResult(_0x2b2f3c,_0x33f016){return function(_0x2a8aa1){if(_0x2a8aa1){var _0x2c20fd=typeof _0x33f016[_0xb7ea('0x1b')]===_0xb7ea('0x1c')&&typeof _0x33f016[_0xb7ea('0x1d')]==='undefined';var _0x3b8fcf=_0x2a8aa1[_0xb7ea('0x1e')];var _0x2dbc52=_0x2c20fd?0x0:_0x33f016[_0xb7ea('0x1b')];var _0x3a3cea=_0x2c20fd?_0x2a8aa1[_0xb7ea('0x1e')]:_0x33f016[_0xb7ea('0x1b')]+_0x33f016[_0xb7ea('0x1d')];var _0x840a9d;if(_0x3a3cea>=_0x3b8fcf){_0x3a3cea=_0x3b8fcf;_0x840a9d=0xc8;}else{_0x840a9d=0xce;}_0x2b2f3c[_0xb7ea('0x18')](_0x840a9d);return _0x2b2f3c[_0xb7ea('0x1f')](_0xb7ea('0x20'),_0x2dbc52+'-'+_0x3a3cea+'/'+_0x3b8fcf)[_0xb7ea('0x1a')](_0x2a8aa1);}return null;};}function patchUpdates(_0x2744b9){return function(_0x559eb5){try{jsonpatch[_0xb7ea('0x21')](_0x559eb5,_0x2744b9,!![]);}catch(_0x426a9b){return BPromise[_0xb7ea('0x22')](_0x426a9b);}return _0x559eb5[_0xb7ea('0x23')]();};}function saveUpdates(_0x1e7eb8,_0x2019a7){return function(_0x1da2ab){if(_0x1da2ab){return _0x1da2ab[_0xb7ea('0x24')](_0x1e7eb8)[_0xb7ea('0x25')](function(_0x36dc80){return _0x36dc80;});}return null;};}function removeEntity(_0xafd393,_0x4b72f5){return function(_0x56c7cf){if(_0x56c7cf){return _0x56c7cf[_0xb7ea('0x26')]()[_0xb7ea('0x25')](function(){var _0x527e05=_0x56c7cf[_0xb7ea('0x27')]({'plain':!![]});var _0x446e61=_0xb7ea('0x28');return db['UserProfileResource'][_0xb7ea('0x26')]({'where':{'type':_0x446e61,'resourceId':_0x527e05['id']}})[_0xb7ea('0x25')](function(){return _0x56c7cf;});})[_0xb7ea('0x25')](function(){_0xafd393[_0xb7ea('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bcc61,_0x50d84f){return function(_0x143384){if(!_0x143384){_0x3bcc61[_0xb7ea('0x29')](0x194);}return _0x143384;};}function handleError(_0x380217,_0x3d8333){_0x3d8333=_0x3d8333||0x1f4;return function(_0x1a07cd){logger[_0xb7ea('0x2a')](_0x1a07cd[_0xb7ea('0x2b')]);if(_0x1a07cd['name']){delete _0x1a07cd[_0xb7ea('0x2c')];}_0x380217[_0xb7ea('0x18')](_0x3d8333)[_0xb7ea('0x2d')](_0x1a07cd);};}exports[_0xb7ea('0x2e')]=function(_0x3c1144,_0x2cc937){var _0x5aa5c5={},_0x3f4977={},_0xdac933={'count':0x0,'rows':[]};var _0x3d503a=_['map'](db[_0xb7ea('0x2f')][_0xb7ea('0x30')],function(_0x1d7d88){return{'name':_0x1d7d88['fieldName'],'type':_0x1d7d88[_0xb7ea('0x31')][_0xb7ea('0x32')]};});_0x3f4977[_0xb7ea('0x33')]=_[_0xb7ea('0x34')](_0x3d503a,'name');_0x3f4977[_0xb7ea('0x35')]=_[_0xb7ea('0x36')](_0x3c1144[_0xb7ea('0x35')]);_0x3f4977[_0xb7ea('0x37')]=_['intersection'](_0x3f4977[_0xb7ea('0x33')],_0x3f4977['query']);_0x5aa5c5[_0xb7ea('0x38')]=_[_0xb7ea('0x39')](_0x3f4977[_0xb7ea('0x33')],qs['fields'](_0x3c1144[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x5aa5c5[_0xb7ea('0x38')]=_0x5aa5c5[_0xb7ea('0x38')]['length']?_0x5aa5c5[_0xb7ea('0x38')]:_0x3f4977[_0xb7ea('0x33')];if(!_0x3c1144[_0xb7ea('0x35')][_0xb7ea('0x3b')](_0xb7ea('0x3c'))){_0x5aa5c5['limit']=qs[_0xb7ea('0x1d')](_0x3c1144[_0xb7ea('0x35')][_0xb7ea('0x1d')]);_0x5aa5c5['offset']=qs['offset'](_0x3c1144[_0xb7ea('0x35')][_0xb7ea('0x1b')]);}_0x5aa5c5['order']=qs[_0xb7ea('0x3d')](_0x3c1144[_0xb7ea('0x35')][_0xb7ea('0x3d')]);_0x5aa5c5[_0xb7ea('0x3e')]=qs[_0xb7ea('0x37')](_[_0xb7ea('0x3f')](_0x3c1144['query'],_0x3f4977[_0xb7ea('0x37')]),_0x3d503a);if(_0x3c1144[_0xb7ea('0x35')][_0xb7ea('0x40')]){_0x5aa5c5[_0xb7ea('0x3e')]=_[_0xb7ea('0x41')](_0x5aa5c5['where'],{'$or':_[_0xb7ea('0x34')](_0x3d503a,function(_0x3e8850){if(_0x3e8850[_0xb7ea('0x31')]!==_0xb7ea('0x42')){var _0x5bddaa={};_0x5bddaa[_0x3e8850[_0xb7ea('0x2c')]]={'$like':'%'+_0x3c1144['query'][_0xb7ea('0x40')]+'%'};return _0x5bddaa;}})});}_0x5aa5c5=_[_0xb7ea('0x41')]({},_0x5aa5c5,_0x3c1144[_0xb7ea('0x43')]);var _0x45c519={'where':_0x5aa5c5['where']};return db[_0xb7ea('0x2f')][_0xb7ea('0x1e')](_0x45c519)[_0xb7ea('0x25')](function(_0x88c5b3){_0xdac933['count']=_0x88c5b3;if(_0x3c1144['query'][_0xb7ea('0x44')]){_0x5aa5c5[_0xb7ea('0x45')]=[{'all':!![]}];}return db[_0xb7ea('0x2f')][_0xb7ea('0x46')](_0x5aa5c5);})['then'](function(_0x4b60aa){_0xdac933['rows']=_0x4b60aa;return _0xdac933;})[_0xb7ea('0x25')](respondWithFilteredResult(_0x2cc937,_0x5aa5c5))[_0xb7ea('0x47')](handleError(_0x2cc937,null));};exports[_0xb7ea('0x48')]=function(_0x9dc267,_0x24175c){var _0x9e5ddb={'raw':![],'where':{'id':_0x9dc267[_0xb7ea('0x49')]['id']}},_0x18e103={};_0x18e103['model']=_[_0xb7ea('0x36')](db['Campaign'][_0xb7ea('0x30')]);_0x18e103['query']=_[_0xb7ea('0x36')](_0x9dc267[_0xb7ea('0x35')]);_0x18e103[_0xb7ea('0x37')]=_[_0xb7ea('0x39')](_0x18e103[_0xb7ea('0x33')],_0x18e103[_0xb7ea('0x35')]);_0x9e5ddb['attributes']=_[_0xb7ea('0x39')](_0x18e103[_0xb7ea('0x33')],qs[_0xb7ea('0x3a')](_0x9dc267['query'][_0xb7ea('0x3a')]));_0x9e5ddb[_0xb7ea('0x38')]=_0x9e5ddb['attributes'][_0xb7ea('0x4a')]?_0x9e5ddb[_0xb7ea('0x38')]:_0x18e103['model'];if(_0x9dc267[_0xb7ea('0x35')][_0xb7ea('0x44')]){_0x9e5ddb[_0xb7ea('0x45')]=[{'all':!![]}];}_0x9e5ddb=_['merge']({},_0x9e5ddb,_0x9dc267[_0xb7ea('0x43')]);return db[_0xb7ea('0x2f')]['find'](_0x9e5ddb)[_0xb7ea('0x25')](handleEntityNotFound(_0x24175c,null))[_0xb7ea('0x25')](respondWithResult(_0x24175c,null))[_0xb7ea('0x47')](handleError(_0x24175c,null));};exports[_0xb7ea('0x4b')]=function(_0x337b60,_0x3ee093){return db[_0xb7ea('0x2f')][_0xb7ea('0x4b')](_0x337b60[_0xb7ea('0x4c')],{})[_0xb7ea('0x25')](function(_0x2465e0){var _0xc691e1=_0x337b60[_0xb7ea('0x4d')][_0xb7ea('0x27')]({'plain':!![]});if(!_0xc691e1)throw new Error(_0xb7ea('0x4e'));if(_0xc691e1[_0xb7ea('0x4f')]===_0xb7ea('0x4d')){var _0xe87c29=_0x2465e0[_0xb7ea('0x27')]({'plain':!![]});var _0x3c978a=_0xb7ea('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x3c978a,'userProfileId':_0xc691e1[_0xb7ea('0x50')]},'raw':!![]})[_0xb7ea('0x25')](function(_0x5dc35b){if(_0x5dc35b&&_0x5dc35b[_0xb7ea('0x51')]===0x0){return db[_0xb7ea('0x52')]['create']({'name':_0xe87c29[_0xb7ea('0x2c')],'resourceId':_0xe87c29['id'],'type':_0x5dc35b['name'],'sectionId':_0x5dc35b['id']},{})[_0xb7ea('0x25')](function(){return _0x2465e0;});}else{return _0x2465e0;}})['catch'](function(_0x31634e){logger[_0xb7ea('0x2a')](_0xb7ea('0x53'),_0x31634e);throw _0x31634e;});}return _0x2465e0;})[_0xb7ea('0x25')](respondWithResult(_0x3ee093,0xc9))['catch'](handleError(_0x3ee093,null));};exports[_0xb7ea('0x54')]=function(_0x1e056a,_0x1391c3){var _0x57b556={'where':{'id':_0x1e056a[_0xb7ea('0x49')]['id']}},_0x1dbaea={};_0x1dbaea['model']=_[_0xb7ea('0x36')](db[_0xb7ea('0x2f')][_0xb7ea('0x30')]);_0x57b556[_0xb7ea('0x38')]=_['intersection'](_0x1dbaea[_0xb7ea('0x33')],qs[_0xb7ea('0x3a')](_0x1e056a['query'][_0xb7ea('0x3a')]));_0x57b556[_0xb7ea('0x38')]=_0x57b556[_0xb7ea('0x38')][_0xb7ea('0x4a')]?_0x57b556[_0xb7ea('0x38')]:_0x1dbaea[_0xb7ea('0x33')];if(_0x1e056a[_0xb7ea('0x35')]['includeAll']){_0x57b556[_0xb7ea('0x45')]=[{'all':!![]}];}_0x57b556=_[_0xb7ea('0x41')]({},_0x57b556,_0x1e056a['options']);return db[_0xb7ea('0x2f')][_0xb7ea('0x55')](_0x57b556)[_0xb7ea('0x25')](handleEntityNotFound(_0x1391c3,null))['then'](function(_0x371cd1){if(_0x371cd1){var _0x380ff9=_0x371cd1['get']({'plain':!![]});_0x380ff9=qs[_0xb7ea('0x56')](_0x380ff9,['id',_0xb7ea('0x57'),_0xb7ea('0x58')]);_0x1e056a['body']=_[_0xb7ea('0x56')](_0x1e056a[_0xb7ea('0x4c')],['id',_0xb7ea('0x57'),_0xb7ea('0x58')]);return db[_0xb7ea('0x2f')][_0xb7ea('0x4b')](_['merge'](_0x380ff9,_0x1e056a[_0xb7ea('0x4c')]),{'include':_0x1e056a[_0xb7ea('0x35')][_0xb7ea('0x44')]?[{'all':!![]}]:undefined})[_0xb7ea('0x25')](function(_0xda17ae){var _0x18466f=_0x1e056a['user'][_0xb7ea('0x27')]({'plain':!![]});if(!_0x18466f)throw new Error(_0xb7ea('0x4e'));if(_0x18466f[_0xb7ea('0x4f')]===_0xb7ea('0x4d')){var _0x202eeb=_0xda17ae['get']({'plain':!![]});var _0x24d727=_0xb7ea('0x28');return db[_0xb7ea('0x59')]['find']({'where':{'name':_0x24d727,'userProfileId':_0x18466f[_0xb7ea('0x50')]},'raw':!![]})[_0xb7ea('0x25')](function(_0x162492){if(_0x162492&&_0x162492[_0xb7ea('0x51')]===0x0){return db['UserProfileResource'][_0xb7ea('0x4b')]({'name':_0x202eeb[_0xb7ea('0x2c')],'resourceId':_0x202eeb['id'],'type':_0x162492['name'],'sectionId':_0x162492['id']},{})[_0xb7ea('0x25')](function(){return _0xda17ae;});}else{return _0xda17ae;}})['catch'](function(_0x17fa4d){logger[_0xb7ea('0x2a')](_0xb7ea('0x53'),_0x17fa4d);throw _0x17fa4d;});}return _0xda17ae;});}})[_0xb7ea('0x25')](respondWithResult(_0x1391c3,0xc9))[_0xb7ea('0x47')](handleError(_0x1391c3,null));};exports[_0xb7ea('0x24')]=function(_0x19f765,_0x5896f5){if(_0x19f765['body']['id']){delete _0x19f765[_0xb7ea('0x4c')]['id'];}return db[_0xb7ea('0x2f')]['find']({'where':{'id':_0x19f765['params']['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x5896f5,null))[_0xb7ea('0x25')](saveUpdates(_0x19f765[_0xb7ea('0x4c')],null))['then'](respondWithResult(_0x5896f5,null))[_0xb7ea('0x47')](handleError(_0x5896f5,null));};exports[_0xb7ea('0x26')]=function(_0x3cdb7b,_0x532ce1){return db[_0xb7ea('0x2f')][_0xb7ea('0x55')]({'where':{'id':_0x3cdb7b[_0xb7ea('0x49')]['id']}})['then'](handleEntityNotFound(_0x532ce1,null))[_0xb7ea('0x25')](removeEntity(_0x532ce1,null))['catch'](handleError(_0x532ce1,null));};exports[_0xb7ea('0x5a')]=function(_0x4daded,_0x2905da,_0x3433e9){var _0x46526b={'raw':!![],'where':{}};var _0x59c421={};var _0x4bb60={'count':0x0,'rows':[]};return db['Campaign'][_0xb7ea('0x5b')]({'where':{'id':_0x4daded['params']['id']}})['then'](handleEntityNotFound(_0x2905da,null))[_0xb7ea('0x25')](function(_0x574309){if(_0x574309){_0x59c421[_0xb7ea('0x33')]=_[_0xb7ea('0x36')](db[_0xb7ea('0x5c')][_0xb7ea('0x30')]);_0x59c421['query']=_[_0xb7ea('0x36')](_0x4daded[_0xb7ea('0x35')]);_0x59c421[_0xb7ea('0x37')]=_[_0xb7ea('0x39')](_0x59c421[_0xb7ea('0x33')],_0x59c421['query']);_0x46526b[_0xb7ea('0x38')]=_[_0xb7ea('0x39')](_0x59c421[_0xb7ea('0x33')],qs['fields'](_0x4daded[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x46526b[_0xb7ea('0x38')]=_0x46526b[_0xb7ea('0x38')]['length']?_0x46526b[_0xb7ea('0x38')]:_0x59c421[_0xb7ea('0x33')];if(!_0x4daded[_0xb7ea('0x35')][_0xb7ea('0x3b')](_0xb7ea('0x3c'))){_0x46526b['limit']=qs[_0xb7ea('0x1d')](_0x4daded['query'][_0xb7ea('0x1d')]);_0x46526b[_0xb7ea('0x1b')]=qs[_0xb7ea('0x1b')](_0x4daded['query'][_0xb7ea('0x1b')]);}_0x46526b['order']=qs[_0xb7ea('0x3d')](_0x4daded[_0xb7ea('0x35')]['sort']);_0x46526b[_0xb7ea('0x3e')]=qs['filters'](_[_0xb7ea('0x3f')](_0x4daded[_0xb7ea('0x35')],_0x59c421['filters']));_0x46526b[_0xb7ea('0x3e')][_0xb7ea('0x5d')]=_0x574309['id'];if(_0x4daded['query'][_0xb7ea('0x40')]){_0x46526b[_0xb7ea('0x3e')]=_[_0xb7ea('0x41')](_0x46526b[_0xb7ea('0x3e')],{'$or':_[_0xb7ea('0x34')](_0x46526b['attributes'],function(_0x3a3301){var _0x3777b4={};_0x3777b4[_0x3a3301]={'$like':'%'+_0x4daded[_0xb7ea('0x35')][_0xb7ea('0x40')]+'%'};return _0x3777b4;})});}_0x46526b=_[_0xb7ea('0x41')]({},_0x46526b,_0x4daded['options']);return db[_0xb7ea('0x5c')][_0xb7ea('0x1e')]({'where':_0x46526b[_0xb7ea('0x3e')]})['then'](function(_0x38751c){_0x4bb60[_0xb7ea('0x1e')]=_0x38751c;if(_0x4daded[_0xb7ea('0x35')][_0xb7ea('0x44')]){_0x46526b[_0xb7ea('0x45')]=[{'all':!![]}];}return db[_0xb7ea('0x5c')][_0xb7ea('0x46')](_0x46526b);})[_0xb7ea('0x25')](function(_0x5653d2){_0x4bb60['rows']=_0x5653d2;return _0x4bb60;});}})[_0xb7ea('0x25')](respondWithFilteredResult(_0x2905da,_0x46526b))[_0xb7ea('0x47')](handleError(_0x2905da,null));};exports[_0xb7ea('0x5e')]=function(_0xf37e2c,_0x245aac,_0x21e90a){var _0x650f65={'raw':!![],'where':{}};var _0x4c9644={};var _0x501339={'count':0x0,'rows':[]};return db[_0xb7ea('0x2f')][_0xb7ea('0x5b')]({'where':{'id':_0xf37e2c[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x245aac,null))[_0xb7ea('0x25')](function(_0x4d525d){if(_0x4d525d){_0x4c9644[_0xb7ea('0x33')]=_[_0xb7ea('0x36')](db[_0xb7ea('0x5f')][_0xb7ea('0x30')]);_0x4c9644['query']=_['keys'](_0xf37e2c[_0xb7ea('0x35')]);_0x4c9644[_0xb7ea('0x37')]=_[_0xb7ea('0x39')](_0x4c9644['model'],_0x4c9644[_0xb7ea('0x35')]);_0x650f65['attributes']=_[_0xb7ea('0x39')](_0x4c9644[_0xb7ea('0x33')],qs['fields'](_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x650f65[_0xb7ea('0x38')]=_0x650f65[_0xb7ea('0x38')][_0xb7ea('0x4a')]?_0x650f65[_0xb7ea('0x38')]:_0x4c9644['model'];if(!_0xf37e2c['query'][_0xb7ea('0x3b')](_0xb7ea('0x3c'))){_0x650f65['limit']=qs[_0xb7ea('0x1d')](_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x1d')]);_0x650f65[_0xb7ea('0x1b')]=qs['offset'](_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x1b')]);}_0x650f65[_0xb7ea('0x60')]=qs[_0xb7ea('0x3d')](_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x3d')]);_0x650f65[_0xb7ea('0x3e')]=qs[_0xb7ea('0x37')](_['pick'](_0xf37e2c['query'],_0x4c9644[_0xb7ea('0x37')]));_0x650f65[_0xb7ea('0x3e')][_0xb7ea('0x5d')]=_0x4d525d['id'];if(_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x40')]){_0x650f65['where']=_[_0xb7ea('0x41')](_0x650f65[_0xb7ea('0x3e')],{'$or':_[_0xb7ea('0x34')](_0x650f65[_0xb7ea('0x38')],function(_0x3d0a72){var _0x11584a={};_0x11584a[_0x3d0a72]={'$like':'%'+_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x40')]+'%'};return _0x11584a;})});}_0x650f65=_[_0xb7ea('0x41')]({},_0x650f65,_0xf37e2c[_0xb7ea('0x43')]);return db[_0xb7ea('0x5f')][_0xb7ea('0x1e')]({'where':_0x650f65[_0xb7ea('0x3e')]})['then'](function(_0x2cab6b){_0x501339[_0xb7ea('0x1e')]=_0x2cab6b;if(_0xf37e2c[_0xb7ea('0x35')][_0xb7ea('0x44')]){_0x650f65['include']=[{'all':!![]}];}return db[_0xb7ea('0x5f')][_0xb7ea('0x46')](_0x650f65);})['then'](function(_0x5b5e73){_0x501339[_0xb7ea('0x61')]=_0x5b5e73;return _0x501339;});}})['then'](respondWithFilteredResult(_0x245aac,_0x650f65))[_0xb7ea('0x47')](handleError(_0x245aac,null));};exports[_0xb7ea('0x62')]=function(_0x4033e2,_0x1b75a6,_0x3c379d){var _0x54ff4a={'raw':!![],'where':{}};var _0x1823df={};var _0x3b7eab={'count':0x0,'rows':[]};return db[_0xb7ea('0x2f')]['findOne']({'where':{'id':_0x4033e2['params']['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x1b75a6,null))[_0xb7ea('0x25')](function(_0x4f4483){if(_0x4f4483){_0x1823df[_0xb7ea('0x33')]=_[_0xb7ea('0x36')](db[_0xb7ea('0x63')]['rawAttributes']);_0x1823df[_0xb7ea('0x35')]=_[_0xb7ea('0x36')](_0x4033e2[_0xb7ea('0x35')]);_0x1823df[_0xb7ea('0x37')]=_[_0xb7ea('0x39')](_0x1823df[_0xb7ea('0x33')],_0x1823df[_0xb7ea('0x35')]);_0x54ff4a[_0xb7ea('0x38')]=_[_0xb7ea('0x39')](_0x1823df['model'],qs[_0xb7ea('0x3a')](_0x4033e2[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x54ff4a[_0xb7ea('0x38')]=_0x54ff4a['attributes'][_0xb7ea('0x4a')]?_0x54ff4a['attributes']:_0x1823df[_0xb7ea('0x33')];if(!_0x4033e2[_0xb7ea('0x35')][_0xb7ea('0x3b')](_0xb7ea('0x3c'))){_0x54ff4a[_0xb7ea('0x1d')]=qs[_0xb7ea('0x1d')](_0x4033e2['query'][_0xb7ea('0x1d')]);_0x54ff4a[_0xb7ea('0x1b')]=qs['offset'](_0x4033e2['query'][_0xb7ea('0x1b')]);}_0x54ff4a['order']=qs['sort'](_0x4033e2['query']['sort']);_0x54ff4a[_0xb7ea('0x3e')]=qs[_0xb7ea('0x37')](_['pick'](_0x4033e2[_0xb7ea('0x35')],_0x1823df['filters']));_0x54ff4a['where']['CampaignId']=_0x4f4483['id'];if(_0x4033e2[_0xb7ea('0x35')][_0xb7ea('0x40')]){_0x54ff4a[_0xb7ea('0x3e')]=_[_0xb7ea('0x41')](_0x54ff4a[_0xb7ea('0x3e')],{'$or':_[_0xb7ea('0x34')](_0x54ff4a[_0xb7ea('0x38')],function(_0x5dd0ec){var _0x38b5df={};_0x38b5df[_0x5dd0ec]={'$like':'%'+_0x4033e2[_0xb7ea('0x35')]['filter']+'%'};return _0x38b5df;})});}_0x54ff4a=_[_0xb7ea('0x41')]({},_0x54ff4a,_0x4033e2[_0xb7ea('0x43')]);return db['CmHopperFinal'][_0xb7ea('0x1e')]({'where':_0x54ff4a['where']})[_0xb7ea('0x25')](function(_0x545717){_0x3b7eab['count']=_0x545717;if(_0x4033e2[_0xb7ea('0x35')][_0xb7ea('0x44')]){_0x54ff4a[_0xb7ea('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x54ff4a);})[_0xb7ea('0x25')](function(_0x180c9d){_0x3b7eab['rows']=_0x180c9d;return _0x3b7eab;});}})[_0xb7ea('0x25')](respondWithFilteredResult(_0x1b75a6,_0x54ff4a))['catch'](handleError(_0x1b75a6,null));};exports[_0xb7ea('0x64')]=function(_0xe8b615,_0x4171cc,_0x5d53b7){var _0x1b9751={'raw':!![],'where':{}};var _0x28311a={};var _0x1cb641={'count':0x0,'rows':[]};return db['Campaign'][_0xb7ea('0x5b')]({'where':{'id':_0xe8b615[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x4171cc,null))[_0xb7ea('0x25')](function(_0x13ce5f){if(_0x13ce5f){_0x28311a['model']=_['keys'](db['CmHopperBlack'][_0xb7ea('0x30')]);_0x28311a[_0xb7ea('0x35')]=_[_0xb7ea('0x36')](_0xe8b615['query']);_0x28311a[_0xb7ea('0x37')]=_[_0xb7ea('0x39')](_0x28311a[_0xb7ea('0x33')],_0x28311a[_0xb7ea('0x35')]);_0x1b9751[_0xb7ea('0x38')]=_[_0xb7ea('0x39')](_0x28311a[_0xb7ea('0x33')],qs[_0xb7ea('0x3a')](_0xe8b615[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x1b9751['attributes']=_0x1b9751['attributes']['length']?_0x1b9751['attributes']:_0x28311a['model'];if(!_0xe8b615[_0xb7ea('0x35')][_0xb7ea('0x3b')](_0xb7ea('0x3c'))){_0x1b9751[_0xb7ea('0x1d')]=qs[_0xb7ea('0x1d')](_0xe8b615[_0xb7ea('0x35')][_0xb7ea('0x1d')]);_0x1b9751[_0xb7ea('0x1b')]=qs[_0xb7ea('0x1b')](_0xe8b615[_0xb7ea('0x35')]['offset']);}_0x1b9751[_0xb7ea('0x60')]=qs['sort'](_0xe8b615['query']['sort']);_0x1b9751[_0xb7ea('0x3e')]=qs[_0xb7ea('0x37')](_['pick'](_0xe8b615['query'],_0x28311a[_0xb7ea('0x37')]));_0x1b9751['where'][_0xb7ea('0x5d')]=_0x13ce5f['id'];if(_0xe8b615[_0xb7ea('0x35')][_0xb7ea('0x40')]){_0x1b9751[_0xb7ea('0x3e')]=_[_0xb7ea('0x41')](_0x1b9751[_0xb7ea('0x3e')],{'$or':_[_0xb7ea('0x34')](_0x1b9751['attributes'],function(_0x1221a8){var _0xaf5cd={};_0xaf5cd[_0x1221a8]={'$like':'%'+_0xe8b615[_0xb7ea('0x35')]['filter']+'%'};return _0xaf5cd;})});}_0x1b9751=_[_0xb7ea('0x41')]({},_0x1b9751,_0xe8b615['options']);return db[_0xb7ea('0x65')][_0xb7ea('0x1e')]({'where':_0x1b9751[_0xb7ea('0x3e')]})[_0xb7ea('0x25')](function(_0x2c16ed){_0x1cb641[_0xb7ea('0x1e')]=_0x2c16ed;if(_0xe8b615[_0xb7ea('0x35')][_0xb7ea('0x44')]){_0x1b9751[_0xb7ea('0x45')]=[{'all':!![]}];}return db[_0xb7ea('0x65')]['findAll'](_0x1b9751);})[_0xb7ea('0x25')](function(_0x15709f){_0x1cb641[_0xb7ea('0x61')]=_0x15709f;return _0x1cb641;});}})[_0xb7ea('0x25')](respondWithFilteredResult(_0x4171cc,_0x1b9751))[_0xb7ea('0x47')](handleError(_0x4171cc,null));};exports[_0xb7ea('0x66')]=function(_0x390e2c,_0x3473b5,_0x130294){var _0x24124d={};var _0xecba2e={};var _0x1b3c37;var _0x192871;return db[_0xb7ea('0x2f')][_0xb7ea('0x5b')]({'where':{'id':_0x390e2c[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x3473b5,null))[_0xb7ea('0x25')](function(_0x20a488){if(_0x20a488){_0x1b3c37=_0x20a488;_0xecba2e[_0xb7ea('0x33')]=_[_0xb7ea('0x36')](db[_0xb7ea('0x67')][_0xb7ea('0x30')]);_0xecba2e[_0xb7ea('0x35')]=_['keys'](_0x390e2c[_0xb7ea('0x35')]);_0xecba2e['filters']=_['intersection'](_0xecba2e[_0xb7ea('0x33')],_0xecba2e['query']);_0x24124d[_0xb7ea('0x38')]=_[_0xb7ea('0x39')](_0xecba2e['model'],qs[_0xb7ea('0x3a')](_0x390e2c[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x24124d['attributes']=_0x24124d[_0xb7ea('0x38')][_0xb7ea('0x4a')]?_0x24124d[_0xb7ea('0x38')]:_0xecba2e['model'];_0x24124d[_0xb7ea('0x60')]=qs[_0xb7ea('0x3d')](_0x390e2c['query'][_0xb7ea('0x3d')]);_0x24124d[_0xb7ea('0x3e')]=qs[_0xb7ea('0x37')](_['pick'](_0x390e2c['query'],_0xecba2e[_0xb7ea('0x37')]));if(_0x390e2c[_0xb7ea('0x35')]['filter']){_0x24124d[_0xb7ea('0x3e')]=_[_0xb7ea('0x41')](_0x24124d[_0xb7ea('0x3e')],{'$or':_[_0xb7ea('0x34')](_0x24124d[_0xb7ea('0x38')],function(_0x4b7133){var _0x4ce9d6={};_0x4ce9d6[_0x4b7133]={'$like':'%'+_0x390e2c['query'][_0xb7ea('0x40')]+'%'};return _0x4ce9d6;})});}_0x24124d=_[_0xb7ea('0x41')]({},_0x24124d,_0x390e2c['options']);return _0x1b3c37['getLists'](_0x24124d);}})[_0xb7ea('0x25')](function(_0x3549bb){if(_0x3549bb){_0x192871=_0x3549bb['length'];if(!_0x390e2c[_0xb7ea('0x35')][_0xb7ea('0x3b')](_0xb7ea('0x3c'))){_0x24124d[_0xb7ea('0x1d')]=qs[_0xb7ea('0x1d')](_0x390e2c[_0xb7ea('0x35')][_0xb7ea('0x1d')]);_0x24124d[_0xb7ea('0x1b')]=qs[_0xb7ea('0x1b')](_0x390e2c[_0xb7ea('0x35')]['offset']);}return _0x1b3c37[_0xb7ea('0x66')](_0x24124d);}})[_0xb7ea('0x25')](function(_0xc1dab5){if(_0xc1dab5){return _0xc1dab5?{'count':_0x192871,'rows':_0xc1dab5}:null;}})[_0xb7ea('0x25')](respondWithResult(_0x3473b5,null))[_0xb7ea('0x47')](handleError(_0x3473b5,null));};exports[_0xb7ea('0x68')]=function(_0x42f3a3,_0x33b8cf,_0x30152c){var _0x46f4c5,_0x59a0c8;return db[_0xb7ea('0x2f')]['find']({'where':{'id':_0x42f3a3[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x33b8cf,null))['then'](function(_0x3e428e){if(_0x3e428e){_0x59a0c8=_0x3e428e;return _0x3e428e['addLists'](_0x42f3a3['body'][_0xb7ea('0x69')],_[_0xb7ea('0x56')](_0x42f3a3[_0xb7ea('0x4c')],[_0xb7ea('0x69'),'id'])||{});}return null;})[_0xb7ea('0x6a')](function(_0x1b4ca0){var _0x1fcddd;_0x46f4c5=_0x1b4ca0||[];var _0x7b2f3e=[];if(_0x1b4ca0){for(var _0x5ab277=0x0;_0x5ab277<_0x1b4ca0[_0xb7ea('0x4a')];_0x5ab277+=0x1){var _0x1b06b7=_0x1b4ca0[_0x5ab277][_0xb7ea('0x27')]({'plain':!![]});_0x59a0c8[_0xb7ea('0x6b')]=_0x42f3a3[_0xb7ea('0x4c')][_0xb7ea('0x6b')]?_0x42f3a3[_0xb7ea('0x4c')][_0xb7ea('0x6b')]:_0x59a0c8[_0xb7ea('0x6b')];switch(_0x59a0c8['dialCheckDuplicateType']){case _0xb7ea('0x6c'):_0x1fcddd=squel['insert']()[_0xb7ea('0x6d')](_0xb7ea('0x6e'))[_0xb7ea('0x6f')]([_0xb7ea('0x70'),_0xb7ea('0x71'),_0xb7ea('0x72'),_0xb7ea('0x73'),_0xb7ea('0x5d'),_0xb7ea('0x57'),_0xb7ea('0x58')],squel[_0xb7ea('0x74')]()[_0xb7ea('0x75')]('phone',_0xb7ea('0x70'))[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x71'))['field']('id',_0xb7ea('0x72'))[_0xb7ea('0x75')](_0x1b06b7[_0xb7ea('0x77')][_0xb7ea('0x78')](),_0xb7ea('0x73'))[_0xb7ea('0x75')](_0x42f3a3[_0xb7ea('0x49')]['id'][_0xb7ea('0x78')](),'CampaignId')[_0xb7ea('0x75')]('NOW()',_0xb7ea('0x57'))[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x58'))['from']('cm_contacts')['where'](_0xb7ea('0x79'))[_0xb7ea('0x3e')](_0xb7ea('0x7a'),_0x1b06b7[_0xb7ea('0x77')][_0xb7ea('0x78')]())['where'](_0xb7ea('0x7b'))[_0xb7ea('0x3e')](_0xb7ea('0x7c'),squel[_0xb7ea('0x74')]()[_0xb7ea('0x75')](_0xb7ea('0x7d'))[_0xb7ea('0x7e')](_0xb7ea('0x7f'))[_0xb7ea('0x3e')]('CampaignId\x20=\x20?',_0x42f3a3[_0xb7ea('0x49')]['id'][_0xb7ea('0x78')]()))['where'](_0xb7ea('0x7c'),squel[_0xb7ea('0x74')]()[_0xb7ea('0x75')]('COALESCE(phone,\x27\x27)')[_0xb7ea('0x7e')](_0xb7ea('0x6e'))[_0xb7ea('0x3e')]('CampaignId\x20=\x20?',_0x42f3a3['params']['id'][_0xb7ea('0x78')]())))[_0xb7ea('0x78')]();break;case _0xb7ea('0x80'):_0x1fcddd=squel[_0xb7ea('0x81')]()[_0xb7ea('0x6d')](_0xb7ea('0x6e'))[_0xb7ea('0x6f')]([_0xb7ea('0x70'),_0xb7ea('0x71'),_0xb7ea('0x72'),_0xb7ea('0x73'),_0xb7ea('0x5d'),'createdAt',_0xb7ea('0x58')],squel[_0xb7ea('0x74')]()[_0xb7ea('0x75')]('phone','phone')[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x71'))[_0xb7ea('0x75')]('id','ContactId')[_0xb7ea('0x75')](_0x1b06b7[_0xb7ea('0x77')][_0xb7ea('0x78')](),'ListId')[_0xb7ea('0x75')](_0x42f3a3[_0xb7ea('0x49')]['id'][_0xb7ea('0x78')](),'CampaignId')[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x57'))[_0xb7ea('0x75')](_0xb7ea('0x76'),'updatedAt')['from'](_0xb7ea('0x82'))[_0xb7ea('0x3e')](_0xb7ea('0x79'))['where'](_0xb7ea('0x7a'),_0x1b06b7[_0xb7ea('0x77')][_0xb7ea('0x78')]())['where'](_0xb7ea('0x7b'))[_0xb7ea('0x3e')](_0xb7ea('0x7c'),squel[_0xb7ea('0x74')]()[_0xb7ea('0x75')](_0xb7ea('0x83'))[_0xb7ea('0x7e')](_0xb7ea('0x6e'))['where']('CampaignId\x20=\x20?',_0x42f3a3[_0xb7ea('0x49')]['id'][_0xb7ea('0x78')]())))[_0xb7ea('0x78')]();break;default:_0x1fcddd=squel[_0xb7ea('0x81')]()[_0xb7ea('0x6d')]('cm_hopper')[_0xb7ea('0x6f')]([_0xb7ea('0x70'),'scheduledAt',_0xb7ea('0x72'),_0xb7ea('0x73'),_0xb7ea('0x5d'),_0xb7ea('0x57'),_0xb7ea('0x58')],squel[_0xb7ea('0x74')]()[_0xb7ea('0x75')]('phone',_0xb7ea('0x70'))[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x71'))[_0xb7ea('0x75')]('id',_0xb7ea('0x72'))[_0xb7ea('0x75')](_0x1b06b7[_0xb7ea('0x77')][_0xb7ea('0x78')](),_0xb7ea('0x73'))[_0xb7ea('0x75')](_0x42f3a3['params']['id']['toString'](),'CampaignId')[_0xb7ea('0x75')](_0xb7ea('0x76'),'createdAt')[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x58'))[_0xb7ea('0x7e')](_0xb7ea('0x82'))[_0xb7ea('0x3e')](_0xb7ea('0x79'))[_0xb7ea('0x3e')](_0xb7ea('0x7a'),_0x1b06b7[_0xb7ea('0x77')][_0xb7ea('0x78')]())[_0xb7ea('0x3e')](_0xb7ea('0x7b')))[_0xb7ea('0x78')]();}_0x7b2f3e['push'](db[_0xb7ea('0x84')]['query'](_0x1fcddd));}return BPromise['all'](_0x7b2f3e);}})[_0xb7ea('0x25')](function(){return _0x46f4c5;})[_0xb7ea('0x25')](respondWithResult(_0x33b8cf,null))[_0xb7ea('0x47')](handleError(_0x33b8cf,null));};exports[_0xb7ea('0x85')]=function(_0x27150c,_0xf4550a,_0x44a638){return db[_0xb7ea('0x2f')]['find']({'where':{'id':_0x27150c[_0xb7ea('0x49')]['id']}})['then'](handleEntityNotFound(_0xf4550a,null))[_0xb7ea('0x25')](function(_0x113c38){if(_0x113c38){return _0x113c38['removeLists'](_0x27150c[_0xb7ea('0x35')][_0xb7ea('0x69')]);}})[_0xb7ea('0x25')](function(_0x51c01d){if(_0x51c01d){return db[_0xb7ea('0x5c')][_0xb7ea('0x26')]({'where':{'ListId':_0x27150c[_0xb7ea('0x35')]['ids'],'CampaignId':_0x27150c[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](function(){return _0x51c01d;});}})[_0xb7ea('0x25')](respondWithStatusCode(_0xf4550a,null))[_0xb7ea('0x47')](handleError(_0xf4550a,null));};exports[_0xb7ea('0x86')]=function(_0x52775f,_0x2cb202,_0x536aa0){var _0x7cb048={};var _0x2f42a3={};var _0x585bef;var _0x380243;return db[_0xb7ea('0x2f')][_0xb7ea('0x5b')]({'where':{'id':_0x52775f[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x2cb202,null))[_0xb7ea('0x25')](function(_0x1b8d60){if(_0x1b8d60){_0x585bef=_0x1b8d60;_0x2f42a3['model']=_['keys'](db['CmList'][_0xb7ea('0x30')]);_0x2f42a3[_0xb7ea('0x35')]=_[_0xb7ea('0x36')](_0x52775f[_0xb7ea('0x35')]);_0x2f42a3[_0xb7ea('0x37')]=_[_0xb7ea('0x39')](_0x2f42a3[_0xb7ea('0x33')],_0x2f42a3[_0xb7ea('0x35')]);_0x7cb048['attributes']=_[_0xb7ea('0x39')](_0x2f42a3[_0xb7ea('0x33')],qs[_0xb7ea('0x3a')](_0x52775f[_0xb7ea('0x35')][_0xb7ea('0x3a')]));_0x7cb048['attributes']=_0x7cb048[_0xb7ea('0x38')][_0xb7ea('0x4a')]?_0x7cb048[_0xb7ea('0x38')]:_0x2f42a3[_0xb7ea('0x33')];_0x7cb048[_0xb7ea('0x60')]=qs['sort'](_0x52775f[_0xb7ea('0x35')][_0xb7ea('0x3d')]);_0x7cb048[_0xb7ea('0x3e')]=qs[_0xb7ea('0x37')](_[_0xb7ea('0x3f')](_0x52775f[_0xb7ea('0x35')],_0x2f42a3[_0xb7ea('0x37')]));if(_0x52775f[_0xb7ea('0x35')]['filter']){_0x7cb048['where']=_[_0xb7ea('0x41')](_0x7cb048[_0xb7ea('0x3e')],{'$or':_[_0xb7ea('0x34')](_0x7cb048[_0xb7ea('0x38')],function(_0x49152a){var _0x6e67c4={};_0x6e67c4[_0x49152a]={'$like':'%'+_0x52775f[_0xb7ea('0x35')][_0xb7ea('0x40')]+'%'};return _0x6e67c4;})});}_0x7cb048=_[_0xb7ea('0x41')]({},_0x7cb048,_0x52775f[_0xb7ea('0x43')]);return _0x585bef[_0xb7ea('0x86')](_0x7cb048);}})[_0xb7ea('0x25')](function(_0x56787b){if(_0x56787b){_0x380243=_0x56787b[_0xb7ea('0x4a')];if(!_0x52775f[_0xb7ea('0x35')]['hasOwnProperty'](_0xb7ea('0x3c'))){_0x7cb048['limit']=qs['limit'](_0x52775f[_0xb7ea('0x35')]['limit']);_0x7cb048['offset']=qs[_0xb7ea('0x1b')](_0x52775f['query'][_0xb7ea('0x1b')]);}return _0x585bef['getBlackLists'](_0x7cb048);}})[_0xb7ea('0x25')](function(_0x43f355){if(_0x43f355){return _0x43f355?{'count':_0x380243,'rows':_0x43f355}:null;}})[_0xb7ea('0x25')](respondWithResult(_0x2cb202,null))[_0xb7ea('0x47')](handleError(_0x2cb202,null));};exports[_0xb7ea('0x87')]=function(_0x11f10c,_0x4a6dcb,_0x1b3ca1){var _0x2cda15,_0x13e4ea;return db['Campaign'][_0xb7ea('0x55')]({'where':{'id':_0x11f10c[_0xb7ea('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a6dcb,null))['then'](function(_0x58951c){if(_0x58951c){_0x13e4ea=_0x58951c;return _0x58951c[_0xb7ea('0x87')](_0x11f10c[_0xb7ea('0x4c')][_0xb7ea('0x69')],_['omit'](_0x11f10c['body'],[_0xb7ea('0x69'),'id'])||{});}return null;})['spread'](function(_0x13a105){var _0x57e623;_0x2cda15=_0x13a105||[];var _0x574f22=[];if(_0x13a105){for(var _0x478814=0x0;_0x478814<_0x13a105[_0xb7ea('0x4a')];_0x478814+=0x1){var _0x3f381a=_0x13a105[_0x478814][_0xb7ea('0x27')]({'plain':!![]});_0x57e623=squel[_0xb7ea('0x81')]()[_0xb7ea('0x6d')](_0xb7ea('0x88'))[_0xb7ea('0x6f')](['phone',_0xb7ea('0x72'),_0xb7ea('0x73'),_0xb7ea('0x5d'),_0xb7ea('0x57'),_0xb7ea('0x58')],squel[_0xb7ea('0x74')]()['field'](_0xb7ea('0x70'),_0xb7ea('0x70'))['field']('id','ContactId')[_0xb7ea('0x75')](_0x3f381a[_0xb7ea('0x77')][_0xb7ea('0x78')](),_0xb7ea('0x73'))[_0xb7ea('0x75')](_0x11f10c[_0xb7ea('0x49')]['id']['toString'](),_0xb7ea('0x5d'))[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x57'))[_0xb7ea('0x75')](_0xb7ea('0x76'),_0xb7ea('0x58'))[_0xb7ea('0x7e')]('cm_contacts')[_0xb7ea('0x3e')](_0xb7ea('0x79'))[_0xb7ea('0x3e')]('ListId\x20=\x20?',_0x3f381a['CmListId']['toString']())['where'](_0xb7ea('0x7b')))[_0xb7ea('0x78')]();_0x574f22[_0xb7ea('0x89')](db[_0xb7ea('0x84')]['query'](_0x57e623));}return BPromise[_0xb7ea('0x8a')](_0x574f22);}})[_0xb7ea('0x25')](function(){return _0x2cda15;})[_0xb7ea('0x25')](respondWithResult(_0x4a6dcb,null))[_0xb7ea('0x47')](handleError(_0x4a6dcb,null));};exports[_0xb7ea('0x8b')]=function(_0x913e9c,_0x536f50,_0x344919){return db[_0xb7ea('0x2f')][_0xb7ea('0x55')]({'where':{'id':_0x913e9c[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](handleEntityNotFound(_0x536f50,null))[_0xb7ea('0x25')](function(_0x50c695){if(_0x50c695){return _0x50c695[_0xb7ea('0x8b')](_0x913e9c[_0xb7ea('0x35')][_0xb7ea('0x69')]);}})[_0xb7ea('0x25')](function(_0xac5c5e){if(_0xac5c5e){return db[_0xb7ea('0x65')][_0xb7ea('0x26')]({'where':{'ListId':_0x913e9c[_0xb7ea('0x35')][_0xb7ea('0x69')],'CampaignId':_0x913e9c[_0xb7ea('0x49')]['id']}})[_0xb7ea('0x25')](function(){return _0xac5c5e;});}})[_0xb7ea('0x25')](respondWithStatusCode(_0x536f50,null))[_0xb7ea('0x47')](handleError(_0x536f50,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 17b2e15..f0808d3 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x49dd26,_0x9e5a5d){var _0x45f549=function(_0x8a8d93){while(--_0x8a8d93){_0x49dd26['push'](_0x49dd26['shift']());}};_0x45f549(++_0x9e5a5d);}(_0x7a54,0x106));var _0x47a5=function(_0x1c25e5,_0xfb6548){_0x1c25e5=_0x1c25e5-0x0;var _0x4a66cc=_0x7a54[_0x1c25e5];return _0x4a66cc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x7a54,0x106));var _0x47a5=function(_0x6e3d42,_0x434edc){_0x6e3d42=_0x6e3d42-0x0;var _0x3a8a0b=_0x7a54[_0x6e3d42];return _0x3a8a0b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index f265864..8432010 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 _0x1e69=['include','model','map','then','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit'];(function(_0x44c31c,_0x538c1d){var _0x27f211=function(_0x3f4026){while(--_0x3f4026){_0x44c31c['push'](_0x44c31c['shift']());}};_0x27f211(++_0x538c1d);}(_0x1e69,0x85));var _0x91e6=function(_0x769dd2,_0x51c569){_0x769dd2=_0x769dd2-0x0;var _0x103980=_0x1e69[_0x769dd2];return _0x103980;};'use strict';var _=require('lodash');var util=require(_0x91e6('0x0'));var moment=require(_0x91e6('0x1'));var BPromise=require(_0x91e6('0x2'));var rs=require(_0x91e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91e6('0x4'));var logger=require(_0x91e6('0x5'))(_0x91e6('0x6'));var config=require(_0x91e6('0x7'));var jayson=require(_0x91e6('0x8'));var client=jayson[_0x91e6('0x9')][_0x91e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2733bf,_0x1347c3,_0x375184){return new BPromise(function(_0x266fe6,_0x46edd7){return client[_0x91e6('0xb')](_0x2733bf,_0x375184)['then'](function(_0x57682b){logger[_0x91e6('0xc')](_0x91e6('0xd'),_0x1347c3,_0x91e6('0xe'));logger[_0x91e6('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1347c3,_0x91e6('0xe'),JSON[_0x91e6('0x10')](_0x57682b));if(_0x57682b[_0x91e6('0x11')]){if(_0x57682b[_0x91e6('0x11')]['code']===0x1f4){logger[_0x91e6('0x11')](_0x91e6('0xd'),_0x1347c3,_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);return _0x46edd7(_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);}logger[_0x91e6('0x11')]('Campaign,\x20%s,\x20%s',_0x1347c3,_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);return _0x266fe6(_0x57682b[_0x91e6('0x11')][_0x91e6('0x12')]);}else{logger['info'](_0x91e6('0xd'),_0x1347c3,_0x91e6('0xe'));_0x266fe6(_0x57682b['result'][_0x91e6('0x12')]);}})['catch'](function(_0x57d30d){logger['error']('Campaign,\x20%s,\x20%s',_0x1347c3,_0x57d30d);_0x46edd7(_0x57d30d);});});}exports[_0x91e6('0x13')]=function(_0xdc9327){var _0x4b53b0=this;return new Promise(function(_0x5bda45,_0x368329){return db[_0x91e6('0x14')][_0x91e6('0x15')]({'raw':_0xdc9327[_0x91e6('0x16')]?_0xdc9327[_0x91e6('0x16')][_0x91e6('0x17')]===undefined?!![]:![]:!![],'where':_0xdc9327[_0x91e6('0x16')]?_0xdc9327[_0x91e6('0x16')][_0x91e6('0x18')]||null:null,'attributes':_0xdc9327[_0x91e6('0x16')]?_0xdc9327['options'][_0x91e6('0x19')]||null:null,'limit':_0xdc9327[_0x91e6('0x16')]?_0xdc9327[_0x91e6('0x16')][_0x91e6('0x1a')]||null:null,'include':_0xdc9327[_0x91e6('0x16')]?_0xdc9327[_0x91e6('0x16')]['include']?_['map'](_0xdc9327[_0x91e6('0x16')][_0x91e6('0x1b')],function(_0x581fcd){return{'model':db[_0x581fcd[_0x91e6('0x1c')]],'as':_0x581fcd['as'],'attributes':_0x581fcd['attributes'],'include':_0x581fcd[_0x91e6('0x1b')]?_[_0x91e6('0x1d')](_0x581fcd[_0x91e6('0x1b')],function(_0x1024a5){return{'model':db[_0x1024a5[_0x91e6('0x1c')]],'as':_0x1024a5['as'],'attributes':_0x1024a5[_0x91e6('0x19')],'include':_0x1024a5[_0x91e6('0x1b')]?_[_0x91e6('0x1d')](_0x1024a5[_0x91e6('0x1b')],function(_0x18c614){return{'model':db[_0x18c614[_0x91e6('0x1c')]],'as':_0x18c614['as'],'attributes':_0x18c614['attributes']};}):[]};}):[]};}):[]:[]})[_0x91e6('0x1e')](function(_0x360f21){logger[_0x91e6('0xc')](_0x91e6('0x13'),_0xdc9327);logger[_0x91e6('0xf')]('GetCampaign',_0xdc9327,JSON[_0x91e6('0x10')](_0x360f21));_0x5bda45(_0x360f21);})[_0x91e6('0x1f')](function(_0x4ca580){logger[_0x91e6('0x11')](_0x91e6('0x13'),_0x4ca580[_0x91e6('0x12')],_0xdc9327);_0x368329(_0x4b53b0['error'](0x1f4,_0x4ca580[_0x91e6('0x12')]));});});};
\ No newline at end of file
+var _0x16d2=['include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map'];(function(_0x53b6ae,_0x3cb9f4){var _0x34f4b2=function(_0x4b3169){while(--_0x4b3169){_0x53b6ae['push'](_0x53b6ae['shift']());}};_0x34f4b2(++_0x3cb9f4);}(_0x16d2,0x123));var _0x216d=function(_0x449b81,_0x4b2a6f){_0x449b81=_0x449b81-0x0;var _0xb9b60c=_0x16d2[_0x449b81];return _0xb9b60c;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var moment=require(_0x216d('0x2'));var BPromise=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var fs=require('fs');var Redis=require(_0x216d('0x5'));var db=require(_0x216d('0x6'))['db'];var utils=require(_0x216d('0x7'));var logger=require(_0x216d('0x8'))('rpc');var config=require(_0x216d('0x9'));var jayson=require(_0x216d('0xa'));var client=jayson[_0x216d('0xb')][_0x216d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dd8e2,_0x24c831,_0x3e0ada){return new BPromise(function(_0x28da14,_0x57accc){return client[_0x216d('0xd')](_0x1dd8e2,_0x3e0ada)[_0x216d('0xe')](function(_0x35abcf){logger[_0x216d('0xf')](_0x216d('0x10'),_0x24c831,_0x216d('0x11'));logger['debug'](_0x216d('0x12'),_0x24c831,'request\x20sent',JSON[_0x216d('0x13')](_0x35abcf));if(_0x35abcf[_0x216d('0x14')]){if(_0x35abcf[_0x216d('0x14')][_0x216d('0x15')]===0x1f4){logger[_0x216d('0x14')](_0x216d('0x10'),_0x24c831,_0x35abcf['error'][_0x216d('0x16')]);return _0x57accc(_0x35abcf['error'][_0x216d('0x16')]);}logger[_0x216d('0x14')]('Campaign,\x20%s,\x20%s',_0x24c831,_0x35abcf[_0x216d('0x14')][_0x216d('0x16')]);return _0x28da14(_0x35abcf['error'][_0x216d('0x16')]);}else{logger['info'](_0x216d('0x10'),_0x24c831,_0x216d('0x11'));_0x28da14(_0x35abcf[_0x216d('0x17')][_0x216d('0x16')]);}})[_0x216d('0x18')](function(_0x304dfa){logger[_0x216d('0x14')](_0x216d('0x10'),_0x24c831,_0x304dfa);_0x57accc(_0x304dfa);});});}exports[_0x216d('0x19')]=function(_0x53d464){var _0x3b60dd=this;return new Promise(function(_0x5124ab,_0x4ddc51){return db[_0x216d('0x1a')][_0x216d('0x1b')]({'raw':_0x53d464['options']?_0x53d464[_0x216d('0x1c')][_0x216d('0x1d')]===undefined?!![]:![]:!![],'where':_0x53d464['options']?_0x53d464[_0x216d('0x1c')][_0x216d('0x1e')]||null:null,'attributes':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')]['attributes']||null:null,'limit':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')][_0x216d('0x1f')]||null:null,'include':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')]['include']?_[_0x216d('0x20')](_0x53d464[_0x216d('0x1c')][_0x216d('0x21')],function(_0x2880c6){return{'model':db[_0x2880c6[_0x216d('0x22')]],'as':_0x2880c6['as'],'attributes':_0x2880c6['attributes'],'include':_0x2880c6[_0x216d('0x21')]?_[_0x216d('0x20')](_0x2880c6[_0x216d('0x21')],function(_0x5998a1){return{'model':db[_0x5998a1['model']],'as':_0x5998a1['as'],'attributes':_0x5998a1['attributes'],'include':_0x5998a1['include']?_['map'](_0x5998a1[_0x216d('0x21')],function(_0x470d8a){return{'model':db[_0x470d8a[_0x216d('0x22')]],'as':_0x470d8a['as'],'attributes':_0x470d8a[_0x216d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x216d('0xe')](function(_0x47fa6d){logger['info'](_0x216d('0x19'),_0x53d464);logger['debug'](_0x216d('0x19'),_0x53d464,JSON[_0x216d('0x13')](_0x47fa6d));_0x5124ab(_0x47fa6d);})[_0x216d('0x18')](function(_0x20bc16){logger[_0x216d('0x14')](_0x216d('0x19'),_0x20bc16[_0x216d('0x16')],_0x53d464);_0x4ddc51(_0x3b60dd[_0x216d('0x14')](0x1f4,_0x20bc16[_0x216d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 960aefe..266d8ba 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 _0x2303=['getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x2303,0x75));var _0x3230=function(_0x378a00,_0x37f19b){_0x378a00=_0x378a00-0x0;var _0x327605=_0x2303[_0x378a00];return _0x327605;};'use strict';var multer=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3230('0x2'));var auth=require(_0x3230('0x3'));var interaction=require(_0x3230('0x4'));var config=require(_0x3230('0x5'));var controller=require(_0x3230('0x6'));router[_0x3230('0x7')]('/',auth[_0x3230('0x8')](),controller[_0x3230('0x9')]);router[_0x3230('0x7')](_0x3230('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3230('0x7')](_0x3230('0xb'),auth[_0x3230('0x8')](),controller[_0x3230('0xc')]);router[_0x3230('0x7')](_0x3230('0xd'),auth[_0x3230('0x8')](),controller[_0x3230('0xe')]);router[_0x3230('0x7')](_0x3230('0xf'),auth[_0x3230('0x8')](),controller['getHopperFinals']);router[_0x3230('0x7')](_0x3230('0x10'),auth[_0x3230('0x8')](),controller[_0x3230('0x11')]);router[_0x3230('0x7')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x13')]);router[_0x3230('0x7')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x15')]);router['post']('/',auth[_0x3230('0x8')](),controller[_0x3230('0x16')]);router[_0x3230('0x17')](_0x3230('0x18'),auth[_0x3230('0x8')](),controller[_0x3230('0x19')]);router[_0x3230('0x17')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x1a')]);router['post'](_0x3230('0x14'),auth['isAuthenticated'](),controller[_0x3230('0x1b')]);router[_0x3230('0x1c')](_0x3230('0xa'),auth[_0x3230('0x8')](),controller[_0x3230('0x1d')]);router[_0x3230('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x3230('0x1f')]);router['delete'](_0x3230('0x12'),auth['isAuthenticated'](),controller[_0x3230('0x20')]);router[_0x3230('0x1e')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0x36b6=['destroy','removeLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete'];(function(_0x213c2f,_0x394152){var _0x43a27f=function(_0x469ab0){while(--_0x469ab0){_0x213c2f['push'](_0x213c2f['shift']());}};_0x43a27f(++_0x394152);}(_0x36b6,0x1bf));var _0x636b=function(_0x4e4bab,_0x46b901){_0x4e4bab=_0x4e4bab-0x0;var _0x44d282=_0x36b6[_0x4e4bab];return _0x44d282;};'use strict';var multer=require(_0x636b('0x0'));var util=require(_0x636b('0x1'));var path=require(_0x636b('0x2'));var timeout=require('connect-timeout');var express=require(_0x636b('0x3'));var router=express[_0x636b('0x4')]();var fs_extra=require(_0x636b('0x5'));var auth=require(_0x636b('0x6'));var interaction=require(_0x636b('0x7'));var config=require(_0x636b('0x8'));var controller=require(_0x636b('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x636b('0xa')]);router[_0x636b('0xb')](_0x636b('0xc'),auth[_0x636b('0xd')](),controller[_0x636b('0xe')]);router['get'](_0x636b('0xf'),auth[_0x636b('0xd')](),controller[_0x636b('0x10')]);router[_0x636b('0xb')](_0x636b('0x11'),auth[_0x636b('0xd')](),controller[_0x636b('0x12')]);router[_0x636b('0xb')](_0x636b('0x13'),auth[_0x636b('0xd')](),controller[_0x636b('0x14')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x636b('0x15')]);router[_0x636b('0xb')](_0x636b('0x16'),auth[_0x636b('0xd')](),controller[_0x636b('0x17')]);router[_0x636b('0xb')](_0x636b('0x18'),auth[_0x636b('0xd')](),controller[_0x636b('0x19')]);router[_0x636b('0x1a')]('/',auth[_0x636b('0xd')](),controller[_0x636b('0x1b')]);router[_0x636b('0x1a')](_0x636b('0x1c'),auth[_0x636b('0xd')](),controller[_0x636b('0x1d')]);router[_0x636b('0x1a')](_0x636b('0x16'),auth[_0x636b('0xd')](),controller[_0x636b('0x1e')]);router[_0x636b('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0x636b('0x1f')]('/:id',auth[_0x636b('0xd')](),controller[_0x636b('0x20')]);router[_0x636b('0x21')](_0x636b('0xc'),auth[_0x636b('0xd')](),controller[_0x636b('0x22')]);router['delete'](_0x636b('0x16'),auth[_0x636b('0xd')](),controller[_0x636b('0x23')]);router['delete'](_0x636b('0x18'),auth[_0x636b('0xd')](),controller['removeBlackLists']);module[_0x636b('0x24')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 188f72d..34d4710 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 _0x7c4e=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x49475f,_0x31b9bd){var _0x2de658=function(_0x45de79){while(--_0x45de79){_0x49475f['push'](_0x49475f['shift']());}};_0x2de658(++_0x31b9bd);}(_0x7c4e,0x174));var _0xe7c4=function(_0x12ef39,_0x18d320){_0x12ef39=_0x12ef39-0x0;var _0x47a734=_0x7c4e[_0x12ef39];return _0x47a734;};'use strict';var Sequelize=require(_0xe7c4('0x0'));module[_0xe7c4('0x1')]={'key':{'type':Sequelize[_0xe7c4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe7c4('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xe7c4('0x2')]},'name':{'type':Sequelize[_0xe7c4('0x4')],'get':function(){return this[_0xe7c4('0x5')](_0xe7c4('0x6'));}}};
\ No newline at end of file
+var _0x6fd1=['exports','STRING','TEXT','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6fd1,0x77));var _0x16fd=function(_0x5738c8,_0x1217f1){_0x5738c8=_0x5738c8-0x0;var _0x2e5dcd=_0x6fd1[_0x5738c8];return _0x2e5dcd;};'use strict';var Sequelize=require(_0x16fd('0x0'));module[_0x16fd('0x1')]={'key':{'type':Sequelize[_0x16fd('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x16fd('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 62cd443..fea58f9 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 _0x361f=['hasOwnProperty','order','sort','where','pick','filter','options','include','findAll','rows','catch','show','params','includeAll','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length'];(function(_0x388868,_0x3a3378){var _0x683d2a=function(_0xc2e05e){while(--_0xc2e05e){_0x388868['push'](_0x388868['shift']());}};_0x683d2a(++_0x3a3378);}(_0x361f,0x1bc));var _0xf361=function(_0x3f9f68,_0x4820d3){_0x3f9f68=_0x3f9f68-0x0;var _0x1ab658=_0x361f[_0x3f9f68];return _0x1ab658;};'use strict';var emlformat=require(_0xf361('0x0'));var rimraf=require(_0xf361('0x1'));var zipdir=require(_0xf361('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf361('0x3'));var Mustache=require('mustache');var util=require(_0xf361('0x4'));var path=require('path');var sox=require(_0xf361('0x5'));var csv=require(_0xf361('0x6'));var ejs=require(_0xf361('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf361('0x8'));var crypto=require(_0xf361('0x9'));var jsforce=require(_0xf361('0xa'));var deskjs=require(_0xf361('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf361('0xc'));var Redis=require(_0xf361('0xd'));var authService=require(_0xf361('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf361('0xf'));var hardwareService=require(_0xf361('0x10'));var logger=require(_0xf361('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xf361('0x12'));var licenseUtil=require(_0xf361('0x13'));var db=require(_0xf361('0x14'))['db'];function respondWithStatusCode(_0x295eb0,_0x3cee4e){_0x3cee4e=_0x3cee4e||0xcc;return function(_0x16e746){if(_0x16e746){return _0x295eb0[_0xf361('0x15')](_0x3cee4e);}return _0x295eb0[_0xf361('0x16')](_0x3cee4e)[_0xf361('0x17')]();};}function respondWithResult(_0x3812e1,_0x4f578c){_0x4f578c=_0x4f578c||0xc8;return function(_0x16ea6f){if(_0x16ea6f){return _0x3812e1['status'](_0x4f578c)[_0xf361('0x18')](_0x16ea6f);}};}function respondWithFilteredResult(_0x3304f5,_0x2b4162){return function(_0x2277f8){if(_0x2277f8){var _0x57565a=typeof _0x2b4162[_0xf361('0x19')]===_0xf361('0x1a')&&typeof _0x2b4162[_0xf361('0x1b')]===_0xf361('0x1a');var _0x7f3e93=_0x2277f8[_0xf361('0x1c')];var _0x66f8d2=_0x57565a?0x0:_0x2b4162['offset'];var _0x55013f=_0x57565a?_0x2277f8[_0xf361('0x1c')]:_0x2b4162[_0xf361('0x19')]+_0x2b4162[_0xf361('0x1b')];var _0x191770;if(_0x55013f>=_0x7f3e93){_0x55013f=_0x7f3e93;_0x191770=0xc8;}else{_0x191770=0xce;}_0x3304f5['status'](_0x191770);return _0x3304f5['set'](_0xf361('0x1d'),_0x66f8d2+'-'+_0x55013f+'/'+_0x7f3e93)[_0xf361('0x18')](_0x2277f8);}return null;};}function patchUpdates(_0x55e0e6){return function(_0x5e3035){try{jsonpatch['apply'](_0x5e3035,_0x55e0e6,!![]);}catch(_0x2156bb){return BPromise['reject'](_0x2156bb);}return _0x5e3035[_0xf361('0x1e')]();};}function saveUpdates(_0x3e7458,_0x460ad4){return function(_0x2e3295){if(_0x2e3295){return _0x2e3295[_0xf361('0x1f')](_0x3e7458)[_0xf361('0x20')](function(_0x5e1729){return _0x5e1729;});}return null;};}function removeEntity(_0x4683d1,_0x1a3768){return function(_0xad7c0d){if(_0xad7c0d){return _0xad7c0d[_0xf361('0x21')]()[_0xf361('0x20')](function(){var _0x409d42=_0xad7c0d[_0xf361('0x22')]({'plain':!![]});var _0x4635df='CannedAnswers';return db[_0xf361('0x23')][_0xf361('0x21')]({'where':{'type':_0x4635df,'resourceId':_0x409d42['id']}})[_0xf361('0x20')](function(){return _0xad7c0d;});})[_0xf361('0x20')](function(){_0x4683d1[_0xf361('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x227402,_0x538f3c){return function(_0x4851e6){if(!_0x4851e6){_0x227402[_0xf361('0x15')](0x194);}return _0x4851e6;};}function handleError(_0xf731cc,_0xd9a303){_0xd9a303=_0xd9a303||0x1f4;return function(_0x297562){logger[_0xf361('0x24')](_0x297562[_0xf361('0x25')]);if(_0x297562[_0xf361('0x26')]){delete _0x297562['name'];}_0xf731cc[_0xf361('0x16')](_0xd9a303)['send'](_0x297562);};}exports[_0xf361('0x27')]=function(_0x27ba64,_0x3fb029){var _0x1c199b={},_0x2df260={},_0x3bfae8={'count':0x0,'rows':[]};var _0x29f7d6=_[_0xf361('0x28')](db[_0xf361('0x29')][_0xf361('0x2a')],function(_0x1f2f86){return{'name':_0x1f2f86[_0xf361('0x2b')],'type':_0x1f2f86[_0xf361('0x2c')][_0xf361('0x2d')]};});_0x2df260['model']=_['map'](_0x29f7d6,_0xf361('0x26'));_0x2df260[_0xf361('0x2e')]=_[_0xf361('0x2f')](_0x27ba64[_0xf361('0x2e')]);_0x2df260[_0xf361('0x30')]=_[_0xf361('0x31')](_0x2df260['model'],_0x2df260[_0xf361('0x2e')]);_0x1c199b[_0xf361('0x32')]=_[_0xf361('0x31')](_0x2df260[_0xf361('0x33')],qs[_0xf361('0x34')](_0x27ba64[_0xf361('0x2e')]['fields']));_0x1c199b[_0xf361('0x32')]=_0x1c199b[_0xf361('0x32')][_0xf361('0x35')]?_0x1c199b[_0xf361('0x32')]:_0x2df260[_0xf361('0x33')];if(!_0x27ba64[_0xf361('0x2e')][_0xf361('0x36')]('nolimit')){_0x1c199b[_0xf361('0x1b')]=qs[_0xf361('0x1b')](_0x27ba64[_0xf361('0x2e')][_0xf361('0x1b')]);_0x1c199b['offset']=qs[_0xf361('0x19')](_0x27ba64[_0xf361('0x2e')][_0xf361('0x19')]);}_0x1c199b[_0xf361('0x37')]=qs[_0xf361('0x38')](_0x27ba64[_0xf361('0x2e')][_0xf361('0x38')]);_0x1c199b[_0xf361('0x39')]=qs[_0xf361('0x30')](_[_0xf361('0x3a')](_0x27ba64[_0xf361('0x2e')],_0x2df260[_0xf361('0x30')]),_0x29f7d6);if(_0x27ba64[_0xf361('0x2e')][_0xf361('0x3b')]){_0x1c199b[_0xf361('0x39')]=_['merge'](_0x1c199b[_0xf361('0x39')],{'$or':[{'key':{'$like':'%'+_0x27ba64[_0xf361('0x2e')][_0xf361('0x3b')]+'%'}},{'value':{'$like':'%'+_0x27ba64['query'][_0xf361('0x3b')]+'%'}}]});}_0x1c199b=_['merge']({},_0x1c199b,_0x27ba64[_0xf361('0x3c')]);var _0x41248f={'where':_0x1c199b['where']};return db[_0xf361('0x29')][_0xf361('0x1c')](_0x41248f)[_0xf361('0x20')](function(_0x29d883){_0x3bfae8[_0xf361('0x1c')]=_0x29d883;if(_0x27ba64['query']['includeAll']){_0x1c199b[_0xf361('0x3d')]=[{'all':!![]}];}return db[_0xf361('0x29')][_0xf361('0x3e')](_0x1c199b);})[_0xf361('0x20')](function(_0x580b75){_0x3bfae8[_0xf361('0x3f')]=_0x580b75;return _0x3bfae8;})['then'](respondWithFilteredResult(_0x3fb029,_0x1c199b))[_0xf361('0x40')](handleError(_0x3fb029,null));};exports[_0xf361('0x41')]=function(_0x474001,_0x2656a1){var _0x448355={'raw':!![],'where':{'id':_0x474001[_0xf361('0x42')]['id']}},_0x5d0b7c={};_0x5d0b7c[_0xf361('0x33')]=_[_0xf361('0x2f')](db['CannedAnswer'][_0xf361('0x2a')]);_0x5d0b7c['query']=_[_0xf361('0x2f')](_0x474001['query']);_0x5d0b7c[_0xf361('0x30')]=_[_0xf361('0x31')](_0x5d0b7c[_0xf361('0x33')],_0x5d0b7c[_0xf361('0x2e')]);_0x448355[_0xf361('0x32')]=_[_0xf361('0x31')](_0x5d0b7c[_0xf361('0x33')],qs[_0xf361('0x34')](_0x474001[_0xf361('0x2e')][_0xf361('0x34')]));_0x448355['attributes']=_0x448355[_0xf361('0x32')]['length']?_0x448355[_0xf361('0x32')]:_0x5d0b7c[_0xf361('0x33')];if(_0x474001[_0xf361('0x2e')][_0xf361('0x43')]){_0x448355['include']=[{'all':!![]}];}_0x448355=_['merge']({},_0x448355,_0x474001['options']);return db[_0xf361('0x29')]['find'](_0x448355)[_0xf361('0x20')](handleEntityNotFound(_0x2656a1,null))[_0xf361('0x20')](respondWithResult(_0x2656a1,null))[_0xf361('0x40')](handleError(_0x2656a1,null));};exports['update']=function(_0x2f0981,_0x40b489){if(_0x2f0981['body']['id']){delete _0x2f0981[_0xf361('0x44')]['id'];}return db['CannedAnswer'][_0xf361('0x45')]({'where':{'id':_0x2f0981[_0xf361('0x42')]['id']}})[_0xf361('0x20')](handleEntityNotFound(_0x40b489,null))['then'](saveUpdates(_0x2f0981[_0xf361('0x44')],null))['then'](respondWithResult(_0x40b489,null))[_0xf361('0x40')](handleError(_0x40b489,null));};exports[_0xf361('0x21')]=function(_0x13040d,_0x8d3b91){return db[_0xf361('0x29')][_0xf361('0x45')]({'where':{'id':_0x13040d['params']['id']}})[_0xf361('0x20')](handleEntityNotFound(_0x8d3b91,null))[_0xf361('0x20')](removeEntity(_0x8d3b91,null))[_0xf361('0x40')](handleError(_0x8d3b91,null));};exports[_0xf361('0x46')]=function(_0x1f6abc,_0x331bbe){var _0x3c7aa8={'key':_0x1f6abc[_0xf361('0x44')][_0xf361('0x2d')]};if(_0x1f6abc[_0xf361('0x44')][_0xf361('0x47')]){_0x3c7aa8[_0xf361('0x47')]=_0x1f6abc[_0xf361('0x44')][_0xf361('0x47')];}else if(_0x1f6abc[_0xf361('0x44')][_0xf361('0x48')]){_0x3c7aa8['SmsAccountId']=_0x1f6abc[_0xf361('0x44')][_0xf361('0x48')];}else if(_0x1f6abc[_0xf361('0x44')][_0xf361('0x49')]){_0x3c7aa8[_0xf361('0x49')]=_0x1f6abc['body'][_0xf361('0x49')];}else if(_0x1f6abc[_0xf361('0x44')][_0xf361('0x4a')]){_0x3c7aa8[_0xf361('0x4a')]=_0x1f6abc[_0xf361('0x44')][_0xf361('0x4a')];}return db[_0xf361('0x29')][_0xf361('0x45')]({'where':_0x3c7aa8})[_0xf361('0x20')](function(_0x3fef41){if(_0x3fef41){throw new db[(_0xf361('0x4b'))][(_0xf361('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xf361('0x46')](_0x1f6abc['body']);})[_0xf361('0x20')](function(_0x5e5c2e){var _0x43c126=_0x1f6abc[_0xf361('0x4d')][_0xf361('0x22')]({'plain':!![]});if(!_0x43c126)throw new Error(_0xf361('0x4e'));if(_0x43c126[_0xf361('0x4f')]===_0xf361('0x4d')){var _0x1314e9=_0x5e5c2e['get']({'plain':!![]});return db['UserProfileSection'][_0xf361('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x43c126[_0xf361('0x50')]},'raw':!![]})[_0xf361('0x20')](function(_0x5ce6a2){if(_0x5ce6a2&&_0x5ce6a2[_0xf361('0x51')]===0x0){return db[_0xf361('0x23')][_0xf361('0x46')]({'name':_0x1314e9['name'],'resourceId':_0x1314e9['id'],'type':_0x5ce6a2[_0xf361('0x26')],'sectionId':_0x5ce6a2['id']},{})[_0xf361('0x20')](function(){return _0x5e5c2e;});}else{return _0x5e5c2e;}})[_0xf361('0x40')](function(_0x170712){logger[_0xf361('0x24')](_0xf361('0x52'),_0x170712);throw _0x170712;});}return _0x5e5c2e;})[_0xf361('0x20')](respondWithResult(_0x331bbe,0xc9))[_0xf361('0x40')](handleError(_0x331bbe,null));};
\ No newline at end of file
+var _0x0b22=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','destroy','end','error','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x4812c9,_0x154b76){var _0x4de61f=function(_0x42cd33){while(--_0x42cd33){_0x4812c9['push'](_0x4812c9['shift']());}};_0x4de61f(++_0x154b76);}(_0x0b22,0x16c));var _0x20b2=function(_0x4e9eb3,_0x2988b9){_0x4e9eb3=_0x4e9eb3-0x0;var _0xe62fab=_0x0b22[_0x4e9eb3];return _0xe62fab;};'use strict';var emlformat=require(_0x20b2('0x0'));var rimraf=require(_0x20b2('0x1'));var zipdir=require(_0x20b2('0x2'));var jsonpatch=require(_0x20b2('0x3'));var rp=require(_0x20b2('0x4'));var moment=require('moment');var BPromise=require(_0x20b2('0x5'));var Mustache=require(_0x20b2('0x6'));var util=require(_0x20b2('0x7'));var path=require(_0x20b2('0x8'));var sox=require(_0x20b2('0x9'));var csv=require(_0x20b2('0xa'));var ejs=require(_0x20b2('0xb'));var fs=require('fs');var fs_extra=require(_0x20b2('0xc'));var _=require(_0x20b2('0xd'));var squel=require(_0x20b2('0xe'));var crypto=require(_0x20b2('0xf'));var jsforce=require(_0x20b2('0x10'));var deskjs=require(_0x20b2('0x11'));var toCsv=require(_0x20b2('0xa'));var querystring=require(_0x20b2('0x12'));var Papa=require(_0x20b2('0x13'));var Redis=require(_0x20b2('0x14'));var authService=require(_0x20b2('0x15'));var qs=require(_0x20b2('0x16'));var as=require(_0x20b2('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20b2('0x18'))('api');var utils=require(_0x20b2('0x19'));var config=require(_0x20b2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x20b2('0x1b'))['db'];function respondWithStatusCode(_0x144ab7,_0x91bd0e){_0x91bd0e=_0x91bd0e||0xcc;return function(_0x13101e){if(_0x13101e){return _0x144ab7[_0x20b2('0x1c')](_0x91bd0e);}return _0x144ab7[_0x20b2('0x1d')](_0x91bd0e)['end']();};}function respondWithResult(_0x5b04bf,_0x2f08f5){_0x2f08f5=_0x2f08f5||0xc8;return function(_0x19f7f9){if(_0x19f7f9){return _0x5b04bf['status'](_0x2f08f5)['json'](_0x19f7f9);}};}function respondWithFilteredResult(_0x16f216,_0x1b1cac){return function(_0x38800b){if(_0x38800b){var _0x5b3d2a=typeof _0x1b1cac[_0x20b2('0x1e')]===_0x20b2('0x1f')&&typeof _0x1b1cac[_0x20b2('0x20')]===_0x20b2('0x1f');var _0x930705=_0x38800b['count'];var _0x32d451=_0x5b3d2a?0x0:_0x1b1cac['offset'];var _0x9d0c01=_0x5b3d2a?_0x38800b['count']:_0x1b1cac['offset']+_0x1b1cac['limit'];var _0x4ec6f9;if(_0x9d0c01>=_0x930705){_0x9d0c01=_0x930705;_0x4ec6f9=0xc8;}else{_0x4ec6f9=0xce;}_0x16f216['status'](_0x4ec6f9);return _0x16f216[_0x20b2('0x21')](_0x20b2('0x22'),_0x32d451+'-'+_0x9d0c01+'/'+_0x930705)['json'](_0x38800b);}return null;};}function patchUpdates(_0x58d92a){return function(_0x15a4b8){try{jsonpatch[_0x20b2('0x23')](_0x15a4b8,_0x58d92a,!![]);}catch(_0x4c3e24){return BPromise[_0x20b2('0x24')](_0x4c3e24);}return _0x15a4b8[_0x20b2('0x25')]();};}function saveUpdates(_0x3977ec,_0x5b488f){return function(_0x2ae7c1){if(_0x2ae7c1){return _0x2ae7c1[_0x20b2('0x26')](_0x3977ec)[_0x20b2('0x27')](function(_0x42f0cf){return _0x42f0cf;});}return null;};}function removeEntity(_0x59b6b0,_0x55e116){return function(_0x465d0f){if(_0x465d0f){return _0x465d0f['destroy']()[_0x20b2('0x27')](function(){var _0x2f02b1=_0x465d0f[_0x20b2('0x28')]({'plain':!![]});var _0x44358e=_0x20b2('0x29');return db['UserProfileResource'][_0x20b2('0x2a')]({'where':{'type':_0x44358e,'resourceId':_0x2f02b1['id']}})[_0x20b2('0x27')](function(){return _0x465d0f;});})[_0x20b2('0x27')](function(){_0x59b6b0[_0x20b2('0x1d')](0xcc)[_0x20b2('0x2b')]();});}};}function handleEntityNotFound(_0x44bf52,_0x5a43ce){return function(_0x178657){if(!_0x178657){_0x44bf52[_0x20b2('0x1c')](0x194);}return _0x178657;};}function handleError(_0x35eb84,_0x2417b5){_0x2417b5=_0x2417b5||0x1f4;return function(_0x23b02c){logger[_0x20b2('0x2c')](_0x23b02c['stack']);if(_0x23b02c['name']){delete _0x23b02c['name'];}_0x35eb84[_0x20b2('0x1d')](_0x2417b5)['send'](_0x23b02c);};}exports[_0x20b2('0x2d')]=function(_0x4a797a,_0x4312af){var _0x816d40={},_0x21a9c1={},_0x2f7a2a={'count':0x0,'rows':[]};var _0x1efdd0=_[_0x20b2('0x2e')](db[_0x20b2('0x2f')][_0x20b2('0x30')],function(_0x48584b){return{'name':_0x48584b[_0x20b2('0x31')],'type':_0x48584b[_0x20b2('0x32')][_0x20b2('0x33')]};});_0x21a9c1[_0x20b2('0x34')]=_['map'](_0x1efdd0,_0x20b2('0x35'));_0x21a9c1[_0x20b2('0x36')]=_[_0x20b2('0x37')](_0x4a797a[_0x20b2('0x36')]);_0x21a9c1[_0x20b2('0x38')]=_[_0x20b2('0x39')](_0x21a9c1['model'],_0x21a9c1[_0x20b2('0x36')]);_0x816d40['attributes']=_[_0x20b2('0x39')](_0x21a9c1[_0x20b2('0x34')],qs[_0x20b2('0x3a')](_0x4a797a[_0x20b2('0x36')][_0x20b2('0x3a')]));_0x816d40[_0x20b2('0x3b')]=_0x816d40[_0x20b2('0x3b')][_0x20b2('0x3c')]?_0x816d40[_0x20b2('0x3b')]:_0x21a9c1[_0x20b2('0x34')];if(!_0x4a797a[_0x20b2('0x36')][_0x20b2('0x3d')]('nolimit')){_0x816d40[_0x20b2('0x20')]=qs[_0x20b2('0x20')](_0x4a797a[_0x20b2('0x36')][_0x20b2('0x20')]);_0x816d40[_0x20b2('0x1e')]=qs['offset'](_0x4a797a['query'][_0x20b2('0x1e')]);}_0x816d40[_0x20b2('0x3e')]=qs['sort'](_0x4a797a[_0x20b2('0x36')][_0x20b2('0x3f')]);_0x816d40[_0x20b2('0x40')]=qs['filters'](_[_0x20b2('0x41')](_0x4a797a[_0x20b2('0x36')],_0x21a9c1[_0x20b2('0x38')]),_0x1efdd0);if(_0x4a797a['query'][_0x20b2('0x42')]){_0x816d40[_0x20b2('0x40')]=_[_0x20b2('0x43')](_0x816d40[_0x20b2('0x40')],{'$or':[{'key':{'$like':'%'+_0x4a797a[_0x20b2('0x36')][_0x20b2('0x42')]+'%'}},{'value':{'$like':'%'+_0x4a797a[_0x20b2('0x36')][_0x20b2('0x42')]+'%'}}]});}_0x816d40=_[_0x20b2('0x43')]({},_0x816d40,_0x4a797a[_0x20b2('0x44')]);var _0x556497={'where':_0x816d40['where']};return db['CannedAnswer'][_0x20b2('0x45')](_0x556497)[_0x20b2('0x27')](function(_0x1acbef){_0x2f7a2a['count']=_0x1acbef;if(_0x4a797a['query'][_0x20b2('0x46')]){_0x816d40['include']=[{'all':!![]}];}return db[_0x20b2('0x2f')][_0x20b2('0x47')](_0x816d40);})[_0x20b2('0x27')](function(_0x587c2a){_0x2f7a2a[_0x20b2('0x48')]=_0x587c2a;return _0x2f7a2a;})[_0x20b2('0x27')](respondWithFilteredResult(_0x4312af,_0x816d40))[_0x20b2('0x49')](handleError(_0x4312af,null));};exports[_0x20b2('0x4a')]=function(_0x2ac47c,_0x39e905){var _0x1109b9={'raw':!![],'where':{'id':_0x2ac47c[_0x20b2('0x4b')]['id']}},_0x35e124={};_0x35e124[_0x20b2('0x34')]=_[_0x20b2('0x37')](db[_0x20b2('0x2f')][_0x20b2('0x30')]);_0x35e124[_0x20b2('0x36')]=_['keys'](_0x2ac47c['query']);_0x35e124[_0x20b2('0x38')]=_[_0x20b2('0x39')](_0x35e124[_0x20b2('0x34')],_0x35e124[_0x20b2('0x36')]);_0x1109b9['attributes']=_[_0x20b2('0x39')](_0x35e124[_0x20b2('0x34')],qs[_0x20b2('0x3a')](_0x2ac47c[_0x20b2('0x36')][_0x20b2('0x3a')]));_0x1109b9['attributes']=_0x1109b9[_0x20b2('0x3b')][_0x20b2('0x3c')]?_0x1109b9['attributes']:_0x35e124[_0x20b2('0x34')];if(_0x2ac47c[_0x20b2('0x36')][_0x20b2('0x46')]){_0x1109b9['include']=[{'all':!![]}];}_0x1109b9=_['merge']({},_0x1109b9,_0x2ac47c[_0x20b2('0x44')]);return db[_0x20b2('0x2f')][_0x20b2('0x4c')](_0x1109b9)[_0x20b2('0x27')](handleEntityNotFound(_0x39e905,null))[_0x20b2('0x27')](respondWithResult(_0x39e905,null))[_0x20b2('0x49')](handleError(_0x39e905,null));};exports[_0x20b2('0x26')]=function(_0x4ed9a8,_0x5e5e87){if(_0x4ed9a8[_0x20b2('0x4d')]['id']){delete _0x4ed9a8[_0x20b2('0x4d')]['id'];}return db['CannedAnswer'][_0x20b2('0x4c')]({'where':{'id':_0x4ed9a8['params']['id']}})[_0x20b2('0x27')](handleEntityNotFound(_0x5e5e87,null))[_0x20b2('0x27')](saveUpdates(_0x4ed9a8['body'],null))['then'](respondWithResult(_0x5e5e87,null))[_0x20b2('0x49')](handleError(_0x5e5e87,null));};exports[_0x20b2('0x2a')]=function(_0x1ae59e,_0x49b595){return db['CannedAnswer'][_0x20b2('0x4c')]({'where':{'id':_0x1ae59e[_0x20b2('0x4b')]['id']}})[_0x20b2('0x27')](handleEntityNotFound(_0x49b595,null))[_0x20b2('0x27')](removeEntity(_0x49b595,null))[_0x20b2('0x49')](handleError(_0x49b595,null));};exports[_0x20b2('0x4e')]=function(_0x497747,_0x19e40a){var _0x434a0b={'key':_0x497747[_0x20b2('0x4d')][_0x20b2('0x33')]};if(_0x497747['body'][_0x20b2('0x4f')]){_0x434a0b[_0x20b2('0x4f')]=_0x497747[_0x20b2('0x4d')][_0x20b2('0x4f')];}else if(_0x497747[_0x20b2('0x4d')][_0x20b2('0x50')]){_0x434a0b['SmsAccountId']=_0x497747['body'][_0x20b2('0x50')];}else if(_0x497747[_0x20b2('0x4d')][_0x20b2('0x51')]){_0x434a0b[_0x20b2('0x51')]=_0x497747['body'][_0x20b2('0x51')];}else if(_0x497747[_0x20b2('0x4d')]['ChatWebsiteId']){_0x434a0b[_0x20b2('0x52')]=_0x497747[_0x20b2('0x4d')][_0x20b2('0x52')];}return db['CannedAnswer'][_0x20b2('0x4c')]({'where':_0x434a0b})[_0x20b2('0x27')](function(_0x34dca6){if(_0x34dca6){throw new db[(_0x20b2('0x53'))][(_0x20b2('0x54'))](_0x20b2('0x55'));}return db[_0x20b2('0x2f')][_0x20b2('0x4e')](_0x497747[_0x20b2('0x4d')]);})[_0x20b2('0x27')](function(_0x59a6fd){var _0x292a0b=_0x497747[_0x20b2('0x56')][_0x20b2('0x28')]({'plain':!![]});if(!_0x292a0b)throw new Error(_0x20b2('0x57'));if(_0x292a0b[_0x20b2('0x58')]==='user'){var _0xadc779=_0x59a6fd[_0x20b2('0x28')]({'plain':!![]});return db[_0x20b2('0x59')]['find']({'where':{'name':_0x20b2('0x29'),'userProfileId':_0x292a0b[_0x20b2('0x5a')]},'raw':!![]})[_0x20b2('0x27')](function(_0x20fc22){if(_0x20fc22&&_0x20fc22[_0x20b2('0x5b')]===0x0){return db['UserProfileResource'][_0x20b2('0x4e')]({'name':_0xadc779['name'],'resourceId':_0xadc779['id'],'type':_0x20fc22['name'],'sectionId':_0x20fc22['id']},{})['then'](function(){return _0x59a6fd;});}else{return _0x59a6fd;}})[_0x20b2('0x49')](function(_0x59fd99){logger[_0x20b2('0x2c')](_0x20b2('0x5c'),_0x59fd99);throw _0x59fd99;});}return _0x59a6fd;})[_0x20b2('0x27')](respondWithResult(_0x19e40a,0xc9))['catch'](handleError(_0x19e40a,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 93166eb..8523628 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 _0x1bdd=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x43e87d,_0x3a70f3){var _0x378640=function(_0x35cf78){while(--_0x35cf78){_0x43e87d['push'](_0x43e87d['shift']());}};_0x378640(++_0x3a70f3);}(_0x1bdd,0x168));var _0xd1bd=function(_0x379936,_0xd03c71){_0x379936=_0x379936-0x0;var _0x553745=_0x1bdd[_0x379936];return _0x553745;};'use strict';var _=require(_0xd1bd('0x0'));var util=require(_0xd1bd('0x1'));var logger=require('../../config/logger')(_0xd1bd('0x2'));var moment=require(_0xd1bd('0x3'));var BPromise=require('bluebird');var rp=require(_0xd1bd('0x4'));var fs=require('fs');var path=require(_0xd1bd('0x5'));var rimraf=require(_0xd1bd('0x6'));var config=require(_0xd1bd('0x7'));var attributes=require(_0xd1bd('0x8'));module[_0xd1bd('0x9')]=function(_0x35cf24,_0x409a88){return _0x35cf24[_0xd1bd('0xa')](_0xd1bd('0xb'),attributes,{'tableName':_0xd1bd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd1bd('0xd'),'collate':_0xd1bd('0xe')});};
\ No newline at end of file
+var _0xcf9d=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0xde597,_0x3da70a){var _0x32de13=function(_0x596b4a){while(--_0x596b4a){_0xde597['push'](_0xde597['shift']());}};_0x32de13(++_0x3da70a);}(_0xcf9d,0x147));var _0xdcf9=function(_0x3e5879,_0x3aba17){_0x3e5879=_0x3e5879-0x0;var _0x4f0915=_0xcf9d[_0x3e5879];return _0x4f0915;};'use strict';var _=require('lodash');var util=require(_0xdcf9('0x0'));var logger=require(_0xdcf9('0x1'))(_0xdcf9('0x2'));var moment=require(_0xdcf9('0x3'));var BPromise=require(_0xdcf9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcf9('0x5'));var rimraf=require('rimraf');var config=require(_0xdcf9('0x6'));var attributes=require(_0xdcf9('0x7'));module['exports']=function(_0x20db35,_0x2c08d8){return _0x20db35[_0xdcf9('0x8')](_0xdcf9('0x9'),attributes,{'tableName':_0xdcf9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdcf9('0xb'),'collate':_0xdcf9('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index b252f4e..755a4c0 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(_0x214f3f,_0x39b4e5){var _0x2f15d8=function(_0x4db6bb){while(--_0x4db6bb){_0x214f3f['push'](_0x214f3f['shift']());}};_0x2f15d8(++_0x39b4e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x504e69,_0x1c66fd){var _0x1eca13=function(_0x4bf759){while(--_0x4bf759){_0x504e69['push'](_0x504e69['shift']());}};_0x1eca13(++_0x1c66fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 42c86be..7f07579 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 _0xc706=['fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x54f759,_0x4859d9){var _0x3f58ba=function(_0x337e5f){while(--_0x337e5f){_0x54f759['push'](_0x54f759['shift']());}};_0x3f58ba(++_0x4859d9);}(_0xc706,0x1dd));var _0x6c70=function(_0x3cc442,_0x4b0c53){_0x3cc442=_0x3cc442-0x0;var _0x2fed3f=_0xc706[_0x3cc442];return _0x2fed3f;};'use strict';var multer=require(_0x6c70('0x0'));var util=require(_0x6c70('0x1'));var path=require(_0x6c70('0x2'));var timeout=require(_0x6c70('0x3'));var express=require(_0x6c70('0x4'));var router=express[_0x6c70('0x5')]();var fs_extra=require(_0x6c70('0x6'));var auth=require(_0x6c70('0x7'));var interaction=require(_0x6c70('0x8'));var config=require('../../config/environment');var controller=require(_0x6c70('0x9'));router[_0x6c70('0xa')]('/',auth[_0x6c70('0xb')](),controller[_0x6c70('0xc')]);router[_0x6c70('0xa')](_0x6c70('0xd'),auth[_0x6c70('0xb')](),controller[_0x6c70('0xe')]);router[_0x6c70('0xf')]('/',auth[_0x6c70('0xb')](),controller[_0x6c70('0x10')]);router['put'](_0x6c70('0xd'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x11')]);router[_0x6c70('0x12')](_0x6c70('0xd'),auth[_0x6c70('0xb')](),controller[_0x6c70('0x13')]);module[_0x6c70('0x14')]=router;
\ No newline at end of file
+var _0xdb72=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller'];(function(_0xe02272,_0x158c06){var _0x2cc54d=function(_0x511215){while(--_0x511215){_0xe02272['push'](_0xe02272['shift']());}};_0x2cc54d(++_0x158c06);}(_0xdb72,0x89));var _0x2db7=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0xdb72[_0x351b46];return _0x1515df;};'use strict';var multer=require('multer');var util=require(_0x2db7('0x0'));var path=require('path');var timeout=require(_0x2db7('0x1'));var express=require(_0x2db7('0x2'));var router=express[_0x2db7('0x3')]();var fs_extra=require(_0x2db7('0x4'));var auth=require(_0x2db7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2db7('0x6'));router[_0x2db7('0x7')]('/',auth[_0x2db7('0x8')](),controller[_0x2db7('0x9')]);router[_0x2db7('0x7')](_0x2db7('0xa'),auth[_0x2db7('0x8')](),controller['show']);router[_0x2db7('0xb')]('/',auth[_0x2db7('0x8')](),controller[_0x2db7('0xc')]);router[_0x2db7('0xd')](_0x2db7('0xa'),auth[_0x2db7('0x8')](),controller[_0x2db7('0xe')]);router[_0x2db7('0xf')](_0x2db7('0xa'),auth['isAuthenticated'](),controller[_0x2db7('0x10')]);module[_0x2db7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index d208251..58d8d39 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 _0xb226=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xb226,0x11c));var _0x6b22=function(_0x5ab847,_0x124c13){_0x5ab847=_0x5ab847-0x0;var _0xf6db63=_0xb226[_0x5ab847];return _0xf6db63;};'use strict';var Sequelize=require(_0x6b22('0x0'));module[_0x6b22('0x1')]={'calldate':{'type':Sequelize[_0x6b22('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x6b22('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6b22('0x3')]},'dcontext':{'type':Sequelize[_0x6b22('0x3')]},'channel':{'type':Sequelize[_0x6b22('0x3')]},'dstchannel':{'type':Sequelize[_0x6b22('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6b22('0x3')]},'duration':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6b22('0x3')]},'amaflags':{'type':Sequelize[_0x6b22('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6b22('0x3')]},'userfield':{'type':Sequelize[_0x6b22('0x3')]},'uniqueid':{'type':Sequelize[_0x6b22('0x3')]},'linkedid':{'type':Sequelize[_0x6b22('0x3')]},'sequence':{'type':Sequelize[_0x6b22('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6b22('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9224=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x3c5a79,_0x565097){var _0x52835f=function(_0x139063){while(--_0x139063){_0x3c5a79['push'](_0x3c5a79['shift']());}};_0x52835f(++_0x565097);}(_0x9224,0xa3));var _0x4922=function(_0x2bcaca,_0x3b9989){_0x2bcaca=_0x2bcaca-0x0;var _0x3edd25=_0x9224[_0x2bcaca];return _0x3edd25;};'use strict';var Sequelize=require('sequelize');module[_0x4922('0x0')]={'calldate':{'type':Sequelize[_0x4922('0x1')],'allowNull':![],'defaultValue':_0x4922('0x2')},'clid':{'type':Sequelize[_0x4922('0x3')]},'src':{'type':Sequelize[_0x4922('0x3')]},'dst':{'type':Sequelize[_0x4922('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x4922('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x4922('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4922('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4922('0x3')]},'amaflags':{'type':Sequelize[_0x4922('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4922('0x3')]},'userfield':{'type':Sequelize[_0x4922('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x4922('0x3')]},'sequence':{'type':Sequelize[_0x4922('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4922('0x3')]},'tag':{'type':Sequelize[_0x4922('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index df7febe..9dfa1ff 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(_0xeb2378,_0x2d026c){var _0x367389=function(_0x3fe1f1){while(--_0x3fe1f1){_0xeb2378['push'](_0xeb2378['shift']());}};_0x367389(++_0x2d026c);}(_0x0e85,0x7c));var _0x50e8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x0e85[_0x36ed48];return _0x51c63a;};'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 _0x90b5=['nolimit','limit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','then','error','stack','name','send','index','Cdr','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty'];(function(_0x2db79f,_0x51f8dd){var _0x162aac=function(_0x5c8240){while(--_0x5c8240){_0x2db79f['push'](_0x2db79f['shift']());}};_0x162aac(++_0x51f8dd);}(_0x90b5,0x139));var _0x590b=function(_0x4750da,_0x25dd7e){_0x4750da=_0x4750da-0x0;var _0x38cb4d=_0x90b5[_0x4750da];return _0x38cb4d;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x590b('0x1'));var jsonpatch=require(_0x590b('0x2'));var rp=require(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x590b('0x5'));var path=require(_0x590b('0x6'));var sox=require('sox');var csv=require(_0x590b('0x7'));var ejs=require(_0x590b('0x8'));var fs=require('fs');var fs_extra=require(_0x590b('0x9'));var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x7'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x590b('0x12'));var hardwareService=require(_0x590b('0x13'));var logger=require('../../config/logger')(_0x590b('0x14'));var utils=require('../../config/utils');var config=require(_0x590b('0x15'));var licenseUtil=require(_0x590b('0x16'));var db=require(_0x590b('0x17'))['db'];function respondWithStatusCode(_0x477069,_0x527487){_0x527487=_0x527487||0xcc;return function(_0xb0ca22){if(_0xb0ca22){return _0x477069[_0x590b('0x18')](_0x527487);}return _0x477069[_0x590b('0x19')](_0x527487)[_0x590b('0x1a')]();};}function respondWithResult(_0x2e85b1,_0x6ad7e7){_0x6ad7e7=_0x6ad7e7||0xc8;return function(_0x45ac04){if(_0x45ac04){return _0x2e85b1[_0x590b('0x19')](_0x6ad7e7)[_0x590b('0x1b')](_0x45ac04);}};}function respondWithFilteredResult(_0x1fbc84,_0x3fc5ca){return function(_0x260f47){if(_0x260f47){var _0x3e4723=typeof _0x3fc5ca[_0x590b('0x1c')]===_0x590b('0x1d')&&typeof _0x3fc5ca['limit']===_0x590b('0x1d');var _0x530e24=_0x260f47[_0x590b('0x1e')];var _0x115309=_0x3e4723?0x0:_0x3fc5ca[_0x590b('0x1c')];var _0x53337c=_0x3e4723?_0x260f47['count']:_0x3fc5ca[_0x590b('0x1c')]+_0x3fc5ca['limit'];var _0x21e771;if(_0x53337c>=_0x530e24){_0x53337c=_0x530e24;_0x21e771=0xc8;}else{_0x21e771=0xce;}_0x1fbc84[_0x590b('0x19')](_0x21e771);return _0x1fbc84[_0x590b('0x1f')]('Content-Range',_0x115309+'-'+_0x53337c+'/'+_0x530e24)[_0x590b('0x1b')](_0x260f47);}return null;};}function patchUpdates(_0x8ab843){return function(_0x2b8ea0){try{jsonpatch[_0x590b('0x20')](_0x2b8ea0,_0x8ab843,!![]);}catch(_0x4990ba){return BPromise[_0x590b('0x21')](_0x4990ba);}return _0x2b8ea0['save']();};}function saveUpdates(_0x10a339,_0x30dc9f){return function(_0x5bdaba){if(_0x5bdaba){return _0x5bdaba['update'](_0x10a339)[_0x590b('0x22')](function(_0x2bcfca){return _0x2bcfca;});}return null;};}function removeEntity(_0x52bdad,_0x21638c){return function(_0x1045d5){if(_0x1045d5){return _0x1045d5['destroy']()['then'](function(){_0x52bdad[_0x590b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fead,_0x520095){return function(_0x4d3ff9){if(!_0x4d3ff9){_0x39fead[_0x590b('0x18')](0x194);}return _0x4d3ff9;};}function handleError(_0x20571b,_0x5cf6b6){_0x5cf6b6=_0x5cf6b6||0x1f4;return function(_0x1febcd){logger[_0x590b('0x23')](_0x1febcd[_0x590b('0x24')]);if(_0x1febcd[_0x590b('0x25')]){delete _0x1febcd[_0x590b('0x25')];}_0x20571b['status'](_0x5cf6b6)[_0x590b('0x26')](_0x1febcd);};}exports[_0x590b('0x27')]=function(_0x333af8,_0x38a64a){var _0x1ee769={},_0x3b881f={},_0x5ee979={'count':0x0,'rows':[]};var _0x1dfce0=_['map'](db[_0x590b('0x28')][_0x590b('0x29')],function(_0x448ab3){return{'name':_0x448ab3[_0x590b('0x2a')],'type':_0x448ab3['type'][_0x590b('0x2b')]};});_0x3b881f['model']=_[_0x590b('0x2c')](_0x1dfce0,_0x590b('0x25'));_0x3b881f[_0x590b('0x2d')]=_[_0x590b('0x2e')](_0x333af8[_0x590b('0x2d')]);_0x3b881f['filters']=_[_0x590b('0x2f')](_0x3b881f[_0x590b('0x30')],_0x3b881f[_0x590b('0x2d')]);_0x1ee769[_0x590b('0x31')]=_['intersection'](_0x3b881f['model'],qs[_0x590b('0x32')](_0x333af8[_0x590b('0x2d')][_0x590b('0x32')]));_0x1ee769[_0x590b('0x31')]=_0x1ee769['attributes']['length']?_0x1ee769[_0x590b('0x31')]:_0x3b881f['model'];if(!_0x333af8[_0x590b('0x2d')][_0x590b('0x33')](_0x590b('0x34'))){_0x1ee769[_0x590b('0x35')]=qs[_0x590b('0x35')](_0x333af8[_0x590b('0x2d')][_0x590b('0x35')]);_0x1ee769[_0x590b('0x1c')]=qs[_0x590b('0x1c')](_0x333af8[_0x590b('0x2d')]['offset']);}_0x1ee769['order']=qs[_0x590b('0x36')](_0x333af8[_0x590b('0x2d')][_0x590b('0x36')]);_0x1ee769[_0x590b('0x37')]=qs[_0x590b('0x38')](_['pick'](_0x333af8[_0x590b('0x2d')],_0x3b881f[_0x590b('0x38')]),_0x1dfce0);if(_0x333af8[_0x590b('0x2d')][_0x590b('0x39')]){_0x1ee769[_0x590b('0x37')]=_['merge'](_0x1ee769[_0x590b('0x37')],{'$or':_[_0x590b('0x2c')](_0x1dfce0,function(_0x4e3f84){if(_0x4e3f84['type']!==_0x590b('0x3a')){var _0x4be52e={};_0x4be52e[_0x4e3f84[_0x590b('0x25')]]={'$like':'%'+_0x333af8[_0x590b('0x2d')][_0x590b('0x39')]+'%'};return _0x4be52e;}})});}_0x1ee769=_[_0x590b('0x3b')]({},_0x1ee769,_0x333af8[_0x590b('0x3c')]);var _0x419e6a={'where':_0x1ee769[_0x590b('0x37')]};return db[_0x590b('0x28')][_0x590b('0x1e')](_0x419e6a)[_0x590b('0x22')](function(_0x593b35){_0x5ee979[_0x590b('0x1e')]=_0x593b35;if(_0x333af8[_0x590b('0x2d')][_0x590b('0x3d')]){_0x1ee769['include']=[{'all':!![]}];}return db[_0x590b('0x28')][_0x590b('0x3e')](_0x1ee769);})[_0x590b('0x22')](function(_0x114bbe){_0x5ee979[_0x590b('0x3f')]=_0x114bbe;return _0x5ee979;})[_0x590b('0x22')](respondWithFilteredResult(_0x38a64a,_0x1ee769))[_0x590b('0x40')](handleError(_0x38a64a,null));};exports[_0x590b('0x41')]=function(_0x58c62e,_0x7da2e3){var _0x5984c0={'raw':!![],'where':{'id':_0x58c62e[_0x590b('0x42')]['id']}},_0xb345c0={};_0xb345c0[_0x590b('0x30')]=_['keys'](db[_0x590b('0x28')][_0x590b('0x29')]);_0xb345c0[_0x590b('0x2d')]=_[_0x590b('0x2e')](_0x58c62e['query']);_0xb345c0[_0x590b('0x38')]=_[_0x590b('0x2f')](_0xb345c0['model'],_0xb345c0['query']);_0x5984c0['attributes']=_[_0x590b('0x2f')](_0xb345c0[_0x590b('0x30')],qs[_0x590b('0x32')](_0x58c62e['query']['fields']));_0x5984c0[_0x590b('0x31')]=_0x5984c0[_0x590b('0x31')]['length']?_0x5984c0[_0x590b('0x31')]:_0xb345c0[_0x590b('0x30')];if(_0x58c62e[_0x590b('0x2d')][_0x590b('0x3d')]){_0x5984c0[_0x590b('0x43')]=[{'all':!![]}];}_0x5984c0=_[_0x590b('0x3b')]({},_0x5984c0,_0x58c62e[_0x590b('0x3c')]);return db[_0x590b('0x28')][_0x590b('0x44')](_0x5984c0)[_0x590b('0x22')](handleEntityNotFound(_0x7da2e3,null))[_0x590b('0x22')](respondWithResult(_0x7da2e3,null))[_0x590b('0x40')](handleError(_0x7da2e3,null));};exports[_0x590b('0x45')]=function(_0x5e10de,_0x5e79c5){return db[_0x590b('0x28')][_0x590b('0x45')](_0x5e10de[_0x590b('0x46')],{})[_0x590b('0x22')](respondWithResult(_0x5e79c5,0xc9))['catch'](handleError(_0x5e79c5,null));};exports[_0x590b('0x47')]=function(_0x11bb48,_0x2f492a){if(_0x11bb48['body']['id']){delete _0x11bb48[_0x590b('0x46')]['id'];}return db[_0x590b('0x28')]['find']({'where':{'id':_0x11bb48['params']['id']}})[_0x590b('0x22')](handleEntityNotFound(_0x2f492a,null))[_0x590b('0x22')](saveUpdates(_0x11bb48['body'],null))[_0x590b('0x22')](respondWithResult(_0x2f492a,null))[_0x590b('0x40')](handleError(_0x2f492a,null));};exports['destroy']=function(_0x67ee4f,_0xa6c336){return db[_0x590b('0x28')]['find']({'where':{'id':_0x67ee4f['params']['id']}})[_0x590b('0x22')](handleEntityNotFound(_0xa6c336,null))[_0x590b('0x22')](removeEntity(_0xa6c336,null))['catch'](handleError(_0xa6c336,null));};exports[_0x590b('0x48')]=function(_0xd409f5,_0x228203){return db[_0x590b('0x28')][_0x590b('0x48')]()[_0x590b('0x22')](respondWithResult(_0x228203,null))[_0x590b('0x40')](handleError(_0x228203,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 36b7c99..d0a3d3b 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1d805e,_0x45d767){var _0x25b6e6=function(_0x53d563){while(--_0x53d563){_0x1d805e['push'](_0x1d805e['shift']());}};_0x25b6e6(++_0x45d767);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x34c4fe,_0x22a148){var _0x18e196=function(_0x480eda){while(--_0x480eda){_0x34c4fe['push'](_0x34c4fe['shift']());}};_0x18e196(++_0x22a148);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 affbd14..581f9b5 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 _0xc84a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring'];(function(_0xce09a,_0x537b1d){var _0x53ec17=function(_0x14ff12){while(--_0x14ff12){_0xce09a['push'](_0xce09a['shift']());}};_0x53ec17(++_0x537b1d);}(_0xc84a,0x15c));var _0xac84=function(_0x49ee56,_0x273ea6){_0x49ee56=_0x49ee56-0x0;var _0x1ec73f=_0xc84a[_0x49ee56];return _0x1ec73f;};'use strict';var _=require(_0xac84('0x0'));var util=require(_0xac84('0x1'));var moment=require('moment');var BPromise=require(_0xac84('0x2'));var rs=require(_0xac84('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac84('0x4'))['db'];var utils=require(_0xac84('0x5'));var logger=require(_0xac84('0x6'))(_0xac84('0x7'));var config=require(_0xac84('0x8'));var jayson=require(_0xac84('0x9'));var client=jayson['client'][_0xac84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afdee,_0x3be8f0,_0x14618b){return new BPromise(function(_0x1cc6b1,_0x5a962d){return client['request'](_0x5afdee,_0x14618b)[_0xac84('0xb')](function(_0xb752e7){logger['info'](_0xac84('0xc'),_0x3be8f0,_0xac84('0xd'));logger[_0xac84('0xe')](_0xac84('0xf'),_0x3be8f0,_0xac84('0xd'),JSON['stringify'](_0xb752e7));if(_0xb752e7[_0xac84('0x10')]){if(_0xb752e7[_0xac84('0x10')][_0xac84('0x11')]===0x1f4){logger[_0xac84('0x10')]('Cdr,\x20%s,\x20%s',_0x3be8f0,_0xb752e7[_0xac84('0x10')][_0xac84('0x12')]);return _0x5a962d(_0xb752e7[_0xac84('0x10')][_0xac84('0x12')]);}logger[_0xac84('0x10')](_0xac84('0xc'),_0x3be8f0,_0xb752e7[_0xac84('0x10')][_0xac84('0x12')]);return _0x1cc6b1(_0xb752e7['error'][_0xac84('0x12')]);}else{logger[_0xac84('0x13')]('Cdr,\x20%s,\x20%s',_0x3be8f0,_0xac84('0xd'));_0x1cc6b1(_0xb752e7[_0xac84('0x14')][_0xac84('0x12')]);}})[_0xac84('0x15')](function(_0x2722e3){logger['error'](_0xac84('0xc'),_0x3be8f0,_0x2722e3);_0x5a962d(_0x2722e3);});});}
\ No newline at end of file
+var _0x33f4=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x3852b8,_0x31c911){var _0x1d0959=function(_0x5ec33c){while(--_0x5ec33c){_0x3852b8['push'](_0x3852b8['shift']());}};_0x1d0959(++_0x31c911);}(_0x33f4,0xa1));var _0x433f=function(_0x330b65,_0x4cff41){_0x330b65=_0x330b65-0x0;var _0x5ca89a=_0x33f4[_0x330b65];return _0x5ca89a;};'use strict';var _=require(_0x433f('0x0'));var util=require(_0x433f('0x1'));var moment=require('moment');var BPromise=require(_0x433f('0x2'));var rs=require(_0x433f('0x3'));var fs=require('fs');var Redis=require(_0x433f('0x4'));var db=require(_0x433f('0x5'))['db'];var utils=require(_0x433f('0x6'));var logger=require(_0x433f('0x7'))('rpc');var config=require(_0x433f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x433f('0x9')][_0x433f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c426,_0x5dc08d,_0x1c23fa){return new BPromise(function(_0x1df465,_0x41fa00){return client['request'](_0x56c426,_0x1c23fa)[_0x433f('0xb')](function(_0x2aa953){logger[_0x433f('0xc')](_0x433f('0xd'),_0x5dc08d,_0x433f('0xe'));logger[_0x433f('0xf')](_0x433f('0x10'),_0x5dc08d,'request\x20sent',JSON[_0x433f('0x11')](_0x2aa953));if(_0x2aa953['error']){if(_0x2aa953['error'][_0x433f('0x12')]===0x1f4){logger[_0x433f('0x13')](_0x433f('0xd'),_0x5dc08d,_0x2aa953[_0x433f('0x13')][_0x433f('0x14')]);return _0x41fa00(_0x2aa953[_0x433f('0x13')]['message']);}logger[_0x433f('0x13')]('Cdr,\x20%s,\x20%s',_0x5dc08d,_0x2aa953[_0x433f('0x13')][_0x433f('0x14')]);return _0x1df465(_0x2aa953[_0x433f('0x13')]['message']);}else{logger[_0x433f('0xc')](_0x433f('0xd'),_0x5dc08d,_0x433f('0xe'));_0x1df465(_0x2aa953[_0x433f('0x15')]['message']);}})[_0x433f('0x16')](function(_0x52b16f){logger[_0x433f('0x13')]('Cdr,\x20%s,\x20%s',_0x5dc08d,_0x52b16f);_0x41fa00(_0x52b16f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index f140085..5e466c7 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x10b6ae,_0x56a559){var _0x1321e9=function(_0x9b0eb2){while(--_0x9b0eb2){_0x10b6ae['push'](_0x10b6ae['shift']());}};_0x1321e9(++_0x56a559);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x17bccc,_0x4cc003){var _0x16e5fe=function(_0x3f7b2a){while(--_0x3f7b2a){_0x17bccc['push'](_0x17bccc['shift']());}};_0x16e5fe(++_0x4cc003);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index e6ea0e9..adc6b95 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 _0x9620=['TEXT','sequelize','exports','STRING'];(function(_0x92716b,_0x34d560){var _0x1c6218=function(_0x409ca5){while(--_0x409ca5){_0x92716b['push'](_0x92716b['shift']());}};_0x1c6218(++_0x34d560);}(_0x9620,0x189));var _0x0962=function(_0x22e533,_0x5f46bb){_0x22e533=_0x22e533-0x0;var _0x488146=_0x9620[_0x22e533];return _0x488146;};'use strict';var Sequelize=require(_0x0962('0x0'));module[_0x0962('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0962('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0962('0x3')]()},'description':{'type':Sequelize[_0x0962('0x2')]},'interval':{'type':Sequelize[_0x0962('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x8ac7=['exports','STRING','*,*,*,*','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8ac7,0xf7));var _0x78ac=function(_0x1c66d6,_0x3e8697){_0x1c66d6=_0x1c66d6-0x0;var _0xe7c08c=_0x8ac7[_0x1c66d6];return _0xe7c08c;};'use strict';var Sequelize=require(_0x78ac('0x0'));module[_0x78ac('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x78ac('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x78ac('0x2')]},'interval':{'type':Sequelize[_0x78ac('0x2')],'defaultValue':_0x78ac('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c5cc4c4..3a47db2 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 _0x22a4=['offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','show','model','keys','filters','intersection','query','attributes','fields','length','includeAll','include','options','find','catch','body','ChatApplication','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json'];(function(_0x16ccc4,_0x439e40){var _0x2d3fd0=function(_0x16c8e2){while(--_0x16c8e2){_0x16ccc4['push'](_0x16ccc4['shift']());}};_0x2d3fd0(++_0x439e40);}(_0x22a4,0x1cb));var _0x422a=function(_0x14d413,_0x4ab482){_0x14d413=_0x14d413-0x0;var _0x44bc1e=_0x22a4[_0x14d413];return _0x44bc1e;};'use strict';var emlformat=require(_0x422a('0x0'));var rimraf=require(_0x422a('0x1'));var zipdir=require(_0x422a('0x2'));var jsonpatch=require(_0x422a('0x3'));var rp=require(_0x422a('0x4'));var moment=require(_0x422a('0x5'));var BPromise=require(_0x422a('0x6'));var Mustache=require(_0x422a('0x7'));var util=require('util');var path=require(_0x422a('0x8'));var sox=require(_0x422a('0x9'));var csv=require(_0x422a('0xa'));var ejs=require(_0x422a('0xb'));var fs=require('fs');var fs_extra=require(_0x422a('0xc'));var _=require('lodash');var squel=require(_0x422a('0xd'));var crypto=require(_0x422a('0xe'));var jsforce=require(_0x422a('0xf'));var deskjs=require(_0x422a('0x10'));var toCsv=require(_0x422a('0xa'));var querystring=require(_0x422a('0x11'));var Papa=require(_0x422a('0x12'));var Redis=require(_0x422a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x422a('0x14'));var hardwareService=require(_0x422a('0x15'));var logger=require(_0x422a('0x16'))(_0x422a('0x17'));var utils=require(_0x422a('0x18'));var config=require(_0x422a('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xebe70d,_0x4dbed1){_0x4dbed1=_0x4dbed1||0xcc;return function(_0x5a0c59){if(_0x5a0c59){return _0xebe70d['sendStatus'](_0x4dbed1);}return _0xebe70d[_0x422a('0x1a')](_0x4dbed1)[_0x422a('0x1b')]();};}function respondWithResult(_0x11af1f,_0x2dc9b2){_0x2dc9b2=_0x2dc9b2||0xc8;return function(_0x147af5){if(_0x147af5){return _0x11af1f[_0x422a('0x1a')](_0x2dc9b2)[_0x422a('0x1c')](_0x147af5);}};}function respondWithFilteredResult(_0x3504bb,_0xf9fcf7){return function(_0x2ba53b){if(_0x2ba53b){var _0x30b6e9=typeof _0xf9fcf7[_0x422a('0x1d')]===_0x422a('0x1e')&&typeof _0xf9fcf7[_0x422a('0x1f')]===_0x422a('0x1e');var _0x2e8163=_0x2ba53b[_0x422a('0x20')];var _0x5e2507=_0x30b6e9?0x0:_0xf9fcf7[_0x422a('0x1d')];var _0x3c5d86=_0x30b6e9?_0x2ba53b['count']:_0xf9fcf7[_0x422a('0x1d')]+_0xf9fcf7['limit'];var _0x552048;if(_0x3c5d86>=_0x2e8163){_0x3c5d86=_0x2e8163;_0x552048=0xc8;}else{_0x552048=0xce;}_0x3504bb[_0x422a('0x1a')](_0x552048);return _0x3504bb[_0x422a('0x21')](_0x422a('0x22'),_0x5e2507+'-'+_0x3c5d86+'/'+_0x2e8163)[_0x422a('0x1c')](_0x2ba53b);}return null;};}function patchUpdates(_0x194c25){return function(_0x5f9720){try{jsonpatch[_0x422a('0x23')](_0x5f9720,_0x194c25,!![]);}catch(_0x26922a){return BPromise['reject'](_0x26922a);}return _0x5f9720[_0x422a('0x24')]();};}function saveUpdates(_0x3284ed,_0x211d93){return function(_0x3d3213){if(_0x3d3213){return _0x3d3213[_0x422a('0x25')](_0x3284ed)['then'](function(_0x837c81){return _0x837c81;});}return null;};}function removeEntity(_0x33bc88,_0x6e209d){return function(_0x5e3138){if(_0x5e3138){return _0x5e3138[_0x422a('0x26')]()[_0x422a('0x27')](function(){_0x33bc88[_0x422a('0x1a')](0xcc)[_0x422a('0x1b')]();});}};}function handleEntityNotFound(_0xfc8699,_0xa7e1dd){return function(_0xca7e3c){if(!_0xca7e3c){_0xfc8699[_0x422a('0x28')](0x194);}return _0xca7e3c;};}function handleError(_0x535888,_0x911cc9){_0x911cc9=_0x911cc9||0x1f4;return function(_0x15d2ab){logger['error'](_0x15d2ab[_0x422a('0x29')]);if(_0x15d2ab['name']){delete _0x15d2ab[_0x422a('0x2a')];}_0x535888[_0x422a('0x1a')](_0x911cc9)[_0x422a('0x2b')](_0x15d2ab);};}exports[_0x422a('0x2c')]=function(_0x4badf8,_0x3cb362){var _0x2f833e={'raw':!![],'where':{'id':_0x4badf8['params']['id']}},_0x50cc29={};_0x50cc29[_0x422a('0x2d')]=_[_0x422a('0x2e')](db['ChatApplication']['rawAttributes']);_0x50cc29['query']=_['keys'](_0x4badf8['query']);_0x50cc29[_0x422a('0x2f')]=_[_0x422a('0x30')](_0x50cc29[_0x422a('0x2d')],_0x50cc29[_0x422a('0x31')]);_0x2f833e[_0x422a('0x32')]=_['intersection'](_0x50cc29[_0x422a('0x2d')],qs[_0x422a('0x33')](_0x4badf8[_0x422a('0x31')][_0x422a('0x33')]));_0x2f833e[_0x422a('0x32')]=_0x2f833e[_0x422a('0x32')][_0x422a('0x34')]?_0x2f833e['attributes']:_0x50cc29[_0x422a('0x2d')];if(_0x4badf8[_0x422a('0x31')][_0x422a('0x35')]){_0x2f833e[_0x422a('0x36')]=[{'all':!![]}];}_0x2f833e=_['merge']({},_0x2f833e,_0x4badf8[_0x422a('0x37')]);return db['ChatApplication'][_0x422a('0x38')](_0x2f833e)[_0x422a('0x27')](handleEntityNotFound(_0x3cb362,null))['then'](respondWithResult(_0x3cb362,null))[_0x422a('0x39')](handleError(_0x3cb362,null));};exports[_0x422a('0x25')]=function(_0x561040,_0x1fd498){if(_0x561040[_0x422a('0x3a')]['id']){delete _0x561040[_0x422a('0x3a')]['id'];}return db[_0x422a('0x3b')][_0x422a('0x38')]({'where':{'id':_0x561040[_0x422a('0x3c')]['id']}})[_0x422a('0x27')](handleEntityNotFound(_0x1fd498,null))[_0x422a('0x27')](saveUpdates(_0x561040['body'],null))['then'](respondWithResult(_0x1fd498,null))[_0x422a('0x39')](handleError(_0x1fd498,null));};exports[_0x422a('0x26')]=function(_0x45134b,_0x4beffb){return db[_0x422a('0x3b')][_0x422a('0x38')]({'where':{'id':_0x45134b['params']['id']}})['then'](handleEntityNotFound(_0x4beffb,null))[_0x422a('0x27')](removeEntity(_0x4beffb,null))['catch'](handleError(_0x4beffb,null));};
\ No newline at end of file
+var _0xb98f=['lodash','crypto','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','query','keys','intersection','model','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra'];(function(_0x6697b5,_0x263310){var _0x4d8c4e=function(_0x171203){while(--_0x171203){_0x6697b5['push'](_0x6697b5['shift']());}};_0x4d8c4e(++_0x263310);}(_0xb98f,0xce));var _0xfb98=function(_0x230994,_0x4afa4e){_0x230994=_0x230994-0x0;var _0x267bdc=_0xb98f[_0x230994];return _0x267bdc;};'use strict';var emlformat=require(_0xfb98('0x0'));var rimraf=require(_0xfb98('0x1'));var zipdir=require(_0xfb98('0x2'));var jsonpatch=require(_0xfb98('0x3'));var rp=require(_0xfb98('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb98('0x5'));var path=require(_0xfb98('0x6'));var sox=require(_0xfb98('0x7'));var csv=require(_0xfb98('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb98('0x9'));var _=require(_0xfb98('0xa'));var squel=require('squel');var crypto=require(_0xfb98('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb98('0xc'));var authService=require(_0xfb98('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb98('0xe'));var logger=require('../../config/logger')(_0xfb98('0xf'));var utils=require(_0xfb98('0x10'));var config=require(_0xfb98('0x11'));var licenseUtil=require(_0xfb98('0x12'));var db=require(_0xfb98('0x13'))['db'];function respondWithStatusCode(_0x3cc48e,_0x77a949){_0x77a949=_0x77a949||0xcc;return function(_0x1c9933){if(_0x1c9933){return _0x3cc48e[_0xfb98('0x14')](_0x77a949);}return _0x3cc48e[_0xfb98('0x15')](_0x77a949)[_0xfb98('0x16')]();};}function respondWithResult(_0x3cdeb9,_0x14c9a3){_0x14c9a3=_0x14c9a3||0xc8;return function(_0x201b04){if(_0x201b04){return _0x3cdeb9['status'](_0x14c9a3)[_0xfb98('0x17')](_0x201b04);}};}function respondWithFilteredResult(_0x515864,_0x3e7e25){return function(_0x2d4efd){if(_0x2d4efd){var _0x3c6ca5=typeof _0x3e7e25[_0xfb98('0x18')]===_0xfb98('0x19')&&typeof _0x3e7e25['limit']===_0xfb98('0x19');var _0x174e4d=_0x2d4efd[_0xfb98('0x1a')];var _0x14b206=_0x3c6ca5?0x0:_0x3e7e25[_0xfb98('0x18')];var _0x15c4fa=_0x3c6ca5?_0x2d4efd[_0xfb98('0x1a')]:_0x3e7e25[_0xfb98('0x18')]+_0x3e7e25[_0xfb98('0x1b')];var _0x15932f;if(_0x15c4fa>=_0x174e4d){_0x15c4fa=_0x174e4d;_0x15932f=0xc8;}else{_0x15932f=0xce;}_0x515864[_0xfb98('0x15')](_0x15932f);return _0x515864[_0xfb98('0x1c')](_0xfb98('0x1d'),_0x14b206+'-'+_0x15c4fa+'/'+_0x174e4d)[_0xfb98('0x17')](_0x2d4efd);}return null;};}function patchUpdates(_0x23bc24){return function(_0x46a120){try{jsonpatch[_0xfb98('0x1e')](_0x46a120,_0x23bc24,!![]);}catch(_0x50c0d6){return BPromise[_0xfb98('0x1f')](_0x50c0d6);}return _0x46a120[_0xfb98('0x20')]();};}function saveUpdates(_0x14eaff,_0x284b59){return function(_0x4c3f10){if(_0x4c3f10){return _0x4c3f10[_0xfb98('0x21')](_0x14eaff)[_0xfb98('0x22')](function(_0xfa10fc){return _0xfa10fc;});}return null;};}function removeEntity(_0x5078aa,_0x568d6c){return function(_0x433fce){if(_0x433fce){return _0x433fce[_0xfb98('0x23')]()['then'](function(){_0x5078aa[_0xfb98('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x383057,_0x3f97fb){return function(_0x5727b4){if(!_0x5727b4){_0x383057['sendStatus'](0x194);}return _0x5727b4;};}function handleError(_0x25480d,_0x18e638){_0x18e638=_0x18e638||0x1f4;return function(_0x5136a3){logger[_0xfb98('0x24')](_0x5136a3['stack']);if(_0x5136a3[_0xfb98('0x25')]){delete _0x5136a3[_0xfb98('0x25')];}_0x25480d[_0xfb98('0x15')](_0x18e638)[_0xfb98('0x26')](_0x5136a3);};}exports['show']=function(_0x239705,_0x106602){var _0x5cdb18={'raw':!![],'where':{'id':_0x239705['params']['id']}},_0x3c6e77={};_0x3c6e77['model']=_['keys'](db['ChatApplication']['rawAttributes']);_0x3c6e77[_0xfb98('0x27')]=_[_0xfb98('0x28')](_0x239705[_0xfb98('0x27')]);_0x3c6e77['filters']=_[_0xfb98('0x29')](_0x3c6e77[_0xfb98('0x2a')],_0x3c6e77['query']);_0x5cdb18[_0xfb98('0x2b')]=_[_0xfb98('0x29')](_0x3c6e77[_0xfb98('0x2a')],qs[_0xfb98('0x2c')](_0x239705['query'][_0xfb98('0x2c')]));_0x5cdb18[_0xfb98('0x2b')]=_0x5cdb18[_0xfb98('0x2b')]['length']?_0x5cdb18['attributes']:_0x3c6e77[_0xfb98('0x2a')];if(_0x239705['query'][_0xfb98('0x2d')]){_0x5cdb18[_0xfb98('0x2e')]=[{'all':!![]}];}_0x5cdb18=_[_0xfb98('0x2f')]({},_0x5cdb18,_0x239705[_0xfb98('0x30')]);return db[_0xfb98('0x31')][_0xfb98('0x32')](_0x5cdb18)[_0xfb98('0x22')](handleEntityNotFound(_0x106602,null))[_0xfb98('0x22')](respondWithResult(_0x106602,null))[_0xfb98('0x33')](handleError(_0x106602,null));};exports[_0xfb98('0x21')]=function(_0x35bbd4,_0x35100d){if(_0x35bbd4[_0xfb98('0x34')]['id']){delete _0x35bbd4['body']['id'];}return db[_0xfb98('0x31')][_0xfb98('0x32')]({'where':{'id':_0x35bbd4[_0xfb98('0x35')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x35100d,null))[_0xfb98('0x22')](saveUpdates(_0x35bbd4[_0xfb98('0x34')],null))['then'](respondWithResult(_0x35100d,null))['catch'](handleError(_0x35100d,null));};exports[_0xfb98('0x23')]=function(_0x5063aa,_0x538782){return db['ChatApplication']['find']({'where':{'id':_0x5063aa[_0xfb98('0x35')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x538782,null))['then'](removeEntity(_0x538782,null))[_0xfb98('0x33')](handleError(_0x538782,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 55dad53..0be5c04 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 _0xda79=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x29631f,_0xdb767){var _0x486d87=function(_0x33a1bb){while(--_0x33a1bb){_0x29631f['push'](_0x29631f['shift']());}};_0x486d87(++_0xdb767);}(_0xda79,0x6f));var _0x9da7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xda79[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x9da7('0x0'));var util=require(_0x9da7('0x1'));var logger=require(_0x9da7('0x2'))(_0x9da7('0x3'));var moment=require(_0x9da7('0x4'));var BPromise=require(_0x9da7('0x5'));var rp=require(_0x9da7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da7('0x7'));var config=require(_0x9da7('0x8'));var attributes=require(_0x9da7('0x9'));module[_0x9da7('0xa')]=function(_0x55f90a,_0x260bbd){return _0x55f90a[_0x9da7('0xb')](_0x9da7('0xc'),attributes,{'tableName':_0x9da7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9da7('0xe'),'collate':_0x9da7('0xf')});};
\ No newline at end of file
+var _0x4d7f=['path','rimraf','./chatApplication.attributes','define','chat_applications','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x46cb78,_0x3d1e23){var _0x163244=function(_0x53c7f8){while(--_0x53c7f8){_0x46cb78['push'](_0x46cb78['shift']());}};_0x163244(++_0x3d1e23);}(_0x4d7f,0xc1));var _0xf4d7=function(_0x425107,_0x44ec5a){_0x425107=_0x425107-0x0;var _0x33db0f=_0x4d7f[_0x425107];return _0x33db0f;};'use strict';var _=require(_0xf4d7('0x0'));var util=require('util');var logger=require(_0xf4d7('0x1'))('api');var moment=require(_0xf4d7('0x2'));var BPromise=require(_0xf4d7('0x3'));var rp=require(_0xf4d7('0x4'));var fs=require('fs');var path=require(_0xf4d7('0x5'));var rimraf=require(_0xf4d7('0x6'));var config=require('../../config/environment');var attributes=require(_0xf4d7('0x7'));module['exports']=function(_0x2c7ad0,_0x18051f){return _0x2c7ad0[_0xf4d7('0x8')]('ChatApplication',attributes,{'tableName':_0xf4d7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf4d7('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index e285e99..b6f19bc 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 _0xcc3f=['result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x6d56e9,_0x2589e8){var _0x1bd9ae=function(_0x162f18){while(--_0x162f18){_0x6d56e9['push'](_0x6d56e9['shift']());}};_0x1bd9ae(++_0x2589e8);}(_0xcc3f,0x16b));var _0xfcc3=function(_0x4c9763,_0x2ff3fe){_0x4c9763=_0x4c9763-0x0;var _0x4f2df8=_0xcc3f[_0x4c9763];return _0x4f2df8;};'use strict';var _=require('lodash');var util=require(_0xfcc3('0x0'));var moment=require('moment');var BPromise=require(_0xfcc3('0x1'));var rs=require(_0xfcc3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcc3('0x3'))['db'];var utils=require(_0xfcc3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfcc3('0x5'));var jayson=require(_0xfcc3('0x6'));var client=jayson[_0xfcc3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38be46,_0x3af7ca,_0xf3235a){return new BPromise(function(_0x30576a,_0x25ab4b){return client[_0xfcc3('0x8')](_0x38be46,_0xf3235a)['then'](function(_0x2c1b82){logger[_0xfcc3('0x9')](_0xfcc3('0xa'),_0x3af7ca,_0xfcc3('0xb'));logger[_0xfcc3('0xc')](_0xfcc3('0xd'),_0x3af7ca,'request\x20sent',JSON[_0xfcc3('0xe')](_0x2c1b82));if(_0x2c1b82[_0xfcc3('0xf')]){if(_0x2c1b82[_0xfcc3('0xf')]['code']===0x1f4){logger[_0xfcc3('0xf')]('ChatApplication,\x20%s,\x20%s',_0x3af7ca,_0x2c1b82[_0xfcc3('0xf')][_0xfcc3('0x10')]);return _0x25ab4b(_0x2c1b82[_0xfcc3('0xf')][_0xfcc3('0x10')]);}logger[_0xfcc3('0xf')](_0xfcc3('0xa'),_0x3af7ca,_0x2c1b82[_0xfcc3('0xf')][_0xfcc3('0x10')]);return _0x30576a(_0x2c1b82['error'][_0xfcc3('0x10')]);}else{logger[_0xfcc3('0x9')](_0xfcc3('0xa'),_0x3af7ca,'request\x20sent');_0x30576a(_0x2c1b82[_0xfcc3('0x11')][_0xfcc3('0x10')]);}})[_0xfcc3('0x12')](function(_0x4977c1){logger['error'](_0xfcc3('0xa'),_0x3af7ca,_0x4977c1);_0x25ab4b(_0x4977c1);});});}
\ No newline at end of file
+var _0x0155=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4eecb8,_0x4fafc3){var _0x4dd587=function(_0x449b2a){while(--_0x449b2a){_0x4eecb8['push'](_0x4eecb8['shift']());}};_0x4dd587(++_0x4fafc3);}(_0x0155,0x10f));var _0x5015=function(_0x54effc,_0x58f6e4){_0x54effc=_0x54effc-0x0;var _0xf045b2=_0x0155[_0x54effc];return _0xf045b2;};'use strict';var _=require(_0x5015('0x0'));var util=require('util');var moment=require(_0x5015('0x1'));var BPromise=require(_0x5015('0x2'));var rs=require(_0x5015('0x3'));var fs=require('fs');var Redis=require(_0x5015('0x4'));var db=require(_0x5015('0x5'))['db'];var utils=require(_0x5015('0x6'));var logger=require(_0x5015('0x7'))(_0x5015('0x8'));var config=require(_0x5015('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5015('0xa')][_0x5015('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf19f5d,_0x5da182,_0x452d2c){return new BPromise(function(_0xa7bf92,_0x29fabd){return client[_0x5015('0xc')](_0xf19f5d,_0x452d2c)[_0x5015('0xd')](function(_0x2eaf6d){logger[_0x5015('0xe')]('ChatApplication,\x20%s,\x20%s',_0x5da182,_0x5015('0xf'));logger[_0x5015('0x10')](_0x5015('0x11'),_0x5da182,_0x5015('0xf'),JSON[_0x5015('0x12')](_0x2eaf6d));if(_0x2eaf6d[_0x5015('0x13')]){if(_0x2eaf6d[_0x5015('0x13')][_0x5015('0x14')]===0x1f4){logger['error'](_0x5015('0x15'),_0x5da182,_0x2eaf6d['error'][_0x5015('0x16')]);return _0x29fabd(_0x2eaf6d[_0x5015('0x13')]['message']);}logger[_0x5015('0x13')](_0x5015('0x15'),_0x5da182,_0x2eaf6d['error'][_0x5015('0x16')]);return _0xa7bf92(_0x2eaf6d[_0x5015('0x13')][_0x5015('0x16')]);}else{logger[_0x5015('0xe')](_0x5015('0x15'),_0x5da182,_0x5015('0xf'));_0xa7bf92(_0x2eaf6d[_0x5015('0x17')]['message']);}})[_0x5015('0x18')](function(_0x51f04f){logger[_0x5015('0x13')](_0x5015('0x15'),_0x5da182,_0x51f04f);_0x29fabd(_0x51f04f);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 17c3ef5..8513772 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 _0x399e=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','isAuthenticated','delete','destroy','multer','path'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x399e,0x9a));var _0xe399=function(_0x39f5b,_0x224393){_0x39f5b=_0x39f5b-0x0;var _0x29c795=_0x399e[_0x39f5b];return _0x29c795;};'use strict';var multer=require(_0xe399('0x0'));var util=require('util');var path=require(_0xe399('0x1'));var timeout=require(_0xe399('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe399('0x3'));var interaction=require(_0xe399('0x4'));var config=require(_0xe399('0x5'));var controller=require(_0xe399('0x6'));router[_0xe399('0x7')](_0xe399('0x8'),auth['isAuthenticated'](),controller[_0xe399('0x9')]);router['put'](_0xe399('0x8'),auth[_0xe399('0xa')](),controller['update']);router[_0xe399('0xb')](_0xe399('0x8'),auth[_0xe399('0xa')](),controller[_0xe399('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x1a48=['multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','delete','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1a48,0xb6));var _0x81a4=function(_0x48661f,_0x92ed0){_0x48661f=_0x48661f-0x0;var _0x1b79bd=_0x1a48[_0x48661f];return _0x1b79bd;};'use strict';var multer=require(_0x81a4('0x0'));var util=require('util');var path=require(_0x81a4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x81a4('0x2')]();var fs_extra=require(_0x81a4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x81a4('0x4'));var config=require(_0x81a4('0x5'));var controller=require(_0x81a4('0x6'));router[_0x81a4('0x7')](_0x81a4('0x8'),auth[_0x81a4('0x9')](),controller['show']);router[_0x81a4('0xa')](_0x81a4('0x8'),auth[_0x81a4('0x9')](),controller['update']);router[_0x81a4('0xb')](_0x81a4('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x81a4('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4c4b365..a24d2a7 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 _0x2f4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x2f4a[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0xa2f4('0x0'));module[_0xa2f4('0x1')]={'name':{'type':Sequelize[_0xa2f4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa2f4('0x2')]},'write':{'type':Sequelize[_0xa2f4('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9e9f=['exports','STRING','sequelize'];(function(_0x230951,_0x4dad52){var _0xeb26b1=function(_0x25776c){while(--_0x25776c){_0x230951['push'](_0x230951['shift']());}};_0xeb26b1(++_0x4dad52);}(_0x9e9f,0x1cd));var _0xf9e9=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x9e9f[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0xf9e9('0x0'));module[_0xf9e9('0x1')]={'name':{'type':Sequelize[_0xf9e9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 5add183..87c8136 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 _0x89b8=['../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','show','find','create','body','describe','params','ids','omit','getMembers','findOne','order','pick','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','hasOwnProperty','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x89b8,0xa2));var _0x889b=function(_0x3b2261,_0x2d09c1){_0x3b2261=_0x3b2261-0x0;var _0x4c4c01=_0x89b8[_0x3b2261];return _0x4c4c01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x889b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x889b('0x1'));var rp=require(_0x889b('0x2'));var moment=require(_0x889b('0x3'));var BPromise=require(_0x889b('0x4'));var Mustache=require(_0x889b('0x5'));var util=require(_0x889b('0x6'));var path=require(_0x889b('0x7'));var sox=require(_0x889b('0x8'));var csv=require('to-csv');var ejs=require(_0x889b('0x9'));var fs=require('fs');var fs_extra=require(_0x889b('0xa'));var _=require(_0x889b('0xb'));var squel=require('squel');var crypto=require(_0x889b('0xc'));var jsforce=require(_0x889b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x889b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x889b('0xf'));var qs=require(_0x889b('0x10'));var as=require(_0x889b('0x11'));var hardwareService=require(_0x889b('0x12'));var logger=require('../../config/logger')(_0x889b('0x13'));var utils=require(_0x889b('0x14'));var config=require(_0x889b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x889b('0x16')]=_[_0x889b('0x17')](config['redis'],{'host':_0x889b('0x18'),'port':0x18eb});var socket=require(_0x889b('0x19'))(new Redis(config[_0x889b('0x16')]));require(_0x889b('0x1a'))[_0x889b('0x1b')](socket);function respondWithStatusCode(_0x1b7500,_0x4d7073){_0x4d7073=_0x4d7073||0xcc;return function(_0x1ab687){if(_0x1ab687){return _0x1b7500[_0x889b('0x1c')](_0x4d7073);}return _0x1b7500[_0x889b('0x1d')](_0x4d7073)['end']();};}function respondWithResult(_0x5d2f88,_0x2796ea){_0x2796ea=_0x2796ea||0xc8;return function(_0x38ddf2){if(_0x38ddf2){return _0x5d2f88[_0x889b('0x1d')](_0x2796ea)['json'](_0x38ddf2);}};}function respondWithFilteredResult(_0x402fc7,_0x387a5e){return function(_0x961f43){if(_0x961f43){var _0x317013=typeof _0x387a5e[_0x889b('0x1e')]===_0x889b('0x1f')&&typeof _0x387a5e[_0x889b('0x20')]==='undefined';var _0x154a80=_0x961f43[_0x889b('0x21')];var _0x593e10=_0x317013?0x0:_0x387a5e[_0x889b('0x1e')];var _0x3fd58c=_0x317013?_0x961f43[_0x889b('0x21')]:_0x387a5e[_0x889b('0x1e')]+_0x387a5e['limit'];var _0x44f51a;if(_0x3fd58c>=_0x154a80){_0x3fd58c=_0x154a80;_0x44f51a=0xc8;}else{_0x44f51a=0xce;}_0x402fc7[_0x889b('0x1d')](_0x44f51a);return _0x402fc7[_0x889b('0x22')](_0x889b('0x23'),_0x593e10+'-'+_0x3fd58c+'/'+_0x154a80)[_0x889b('0x24')](_0x961f43);}return null;};}function patchUpdates(_0x185d05){return function(_0x212fbf){try{jsonpatch[_0x889b('0x25')](_0x212fbf,_0x185d05,!![]);}catch(_0x40c2ff){return BPromise['reject'](_0x40c2ff);}return _0x212fbf[_0x889b('0x26')]();};}function saveUpdates(_0x3f1587,_0x2bc8a5){return function(_0xf77784){if(_0xf77784){return _0xf77784[_0x889b('0x27')](_0x3f1587)[_0x889b('0x28')](function(_0x42bb50){return _0x42bb50;});}return null;};}function removeEntity(_0x5a3437,_0x176929){return function(_0x4c5ed7){if(_0x4c5ed7){return _0x4c5ed7[_0x889b('0x29')]()[_0x889b('0x28')](function(){_0x5a3437[_0x889b('0x1d')](0xcc)[_0x889b('0x2a')]();});}};}function handleEntityNotFound(_0x5c938e,_0x238d63){return function(_0x152ca9){if(!_0x152ca9){_0x5c938e['sendStatus'](0x194);}return _0x152ca9;};}function handleError(_0xa900a4,_0x33b8f){_0x33b8f=_0x33b8f||0x1f4;return function(_0x314b2b){logger[_0x889b('0x2b')](_0x314b2b[_0x889b('0x2c')]);if(_0x314b2b[_0x889b('0x2d')]){delete _0x314b2b[_0x889b('0x2d')];}_0xa900a4[_0x889b('0x1d')](_0x33b8f)[_0x889b('0x2e')](_0x314b2b);};}exports[_0x889b('0x2f')]=function(_0x48fba4,_0x496c17){var _0x1155d2={},_0x142aa1={},_0x35cc76={'count':0x0,'rows':[]};var _0x388378=_['map'](db[_0x889b('0x30')][_0x889b('0x31')],function(_0x27956b){return{'name':_0x27956b[_0x889b('0x32')],'type':_0x27956b[_0x889b('0x33')]['key']};});_0x142aa1[_0x889b('0x34')]=_[_0x889b('0x35')](_0x388378,_0x889b('0x2d'));_0x142aa1['query']=_[_0x889b('0x36')](_0x48fba4[_0x889b('0x37')]);_0x142aa1[_0x889b('0x38')]=_[_0x889b('0x39')](_0x142aa1[_0x889b('0x34')],_0x142aa1['query']);_0x1155d2[_0x889b('0x3a')]=_['intersection'](_0x142aa1[_0x889b('0x34')],qs['fields'](_0x48fba4['query'][_0x889b('0x3b')]));_0x1155d2[_0x889b('0x3a')]=_0x1155d2[_0x889b('0x3a')][_0x889b('0x3c')]?_0x1155d2['attributes']:_0x142aa1[_0x889b('0x34')];if(!_0x48fba4[_0x889b('0x37')]['hasOwnProperty'](_0x889b('0x3d'))){_0x1155d2[_0x889b('0x20')]=qs[_0x889b('0x20')](_0x48fba4[_0x889b('0x37')]['limit']);_0x1155d2['offset']=qs['offset'](_0x48fba4[_0x889b('0x37')][_0x889b('0x1e')]);}_0x1155d2['order']=qs[_0x889b('0x3e')](_0x48fba4['query'][_0x889b('0x3e')]);_0x1155d2[_0x889b('0x3f')]=qs[_0x889b('0x38')](_['pick'](_0x48fba4[_0x889b('0x37')],_0x142aa1[_0x889b('0x38')]),_0x388378);if(_0x48fba4[_0x889b('0x37')][_0x889b('0x40')]){_0x1155d2[_0x889b('0x3f')]=_['merge'](_0x1155d2[_0x889b('0x3f')],{'$or':_[_0x889b('0x35')](_0x388378,function(_0x1f1c55){if(_0x1f1c55['type']!==_0x889b('0x41')){var _0x114d55={};_0x114d55[_0x1f1c55['name']]={'$like':'%'+_0x48fba4[_0x889b('0x37')]['filter']+'%'};return _0x114d55;}})});}_0x1155d2=_[_0x889b('0x42')]({},_0x1155d2,_0x48fba4[_0x889b('0x43')]);var _0x17e63f={'where':_0x1155d2[_0x889b('0x3f')]};return db[_0x889b('0x30')]['count'](_0x17e63f)['then'](function(_0x31921b){_0x35cc76[_0x889b('0x21')]=_0x31921b;if(_0x48fba4[_0x889b('0x37')]['includeAll']){_0x1155d2[_0x889b('0x44')]=[{'all':!![]}];}return db[_0x889b('0x30')]['findAll'](_0x1155d2);})['then'](function(_0x3bfb1f){_0x35cc76[_0x889b('0x45')]=_0x3bfb1f;return _0x35cc76;})[_0x889b('0x28')](respondWithFilteredResult(_0x496c17,_0x1155d2))[_0x889b('0x46')](handleError(_0x496c17,null));};exports[_0x889b('0x47')]=function(_0x78c9bc,_0x2aa076){var _0x41b5ef={'raw':!![],'where':{'id':_0x78c9bc['params']['id']}},_0x34f748={};_0x34f748['model']=_[_0x889b('0x36')](db[_0x889b('0x30')][_0x889b('0x31')]);_0x34f748[_0x889b('0x37')]=_['keys'](_0x78c9bc[_0x889b('0x37')]);_0x34f748['filters']=_[_0x889b('0x39')](_0x34f748[_0x889b('0x34')],_0x34f748[_0x889b('0x37')]);_0x41b5ef[_0x889b('0x3a')]=_[_0x889b('0x39')](_0x34f748['model'],qs['fields'](_0x78c9bc[_0x889b('0x37')]['fields']));_0x41b5ef[_0x889b('0x3a')]=_0x41b5ef[_0x889b('0x3a')][_0x889b('0x3c')]?_0x41b5ef['attributes']:_0x34f748[_0x889b('0x34')];if(_0x78c9bc[_0x889b('0x37')]['includeAll']){_0x41b5ef[_0x889b('0x44')]=[{'all':!![]}];}_0x41b5ef=_['merge']({},_0x41b5ef,_0x78c9bc[_0x889b('0x43')]);return db[_0x889b('0x30')][_0x889b('0x48')](_0x41b5ef)[_0x889b('0x28')](handleEntityNotFound(_0x2aa076,null))[_0x889b('0x28')](respondWithResult(_0x2aa076,null))[_0x889b('0x46')](handleError(_0x2aa076,null));};exports[_0x889b('0x49')]=function(_0x571683,_0x583081){return db[_0x889b('0x30')]['create'](_0x571683[_0x889b('0x4a')],{})[_0x889b('0x28')](respondWithResult(_0x583081,0xc9))['catch'](handleError(_0x583081,null));};exports['update']=function(_0x44a21e,_0x2a0f82){if(_0x44a21e[_0x889b('0x4a')]['id']){delete _0x44a21e['body']['id'];}return db[_0x889b('0x30')][_0x889b('0x48')]({'where':{'id':_0x44a21e['params']['id']}})[_0x889b('0x28')](handleEntityNotFound(_0x2a0f82,null))['then'](saveUpdates(_0x44a21e[_0x889b('0x4a')],null))['then'](respondWithResult(_0x2a0f82,null))[_0x889b('0x46')](handleError(_0x2a0f82,null));};exports['destroy']=function(_0x5834a4,_0x25e56c){return db[_0x889b('0x30')][_0x889b('0x48')]({'where':{'id':_0x5834a4['params']['id']}})[_0x889b('0x28')](handleEntityNotFound(_0x25e56c,null))[_0x889b('0x28')](removeEntity(_0x25e56c,null))[_0x889b('0x46')](handleError(_0x25e56c,null));};exports[_0x889b('0x4b')]=function(_0x2186e1,_0x5b8d08){return db[_0x889b('0x30')]['describe']()[_0x889b('0x28')](respondWithResult(_0x5b8d08,null))['catch'](handleError(_0x5b8d08,null));};exports['getUnread']=function(_0x354e53,_0x43c74d,_0x37e941){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x354e53['params']['id'],'ToId':_0x354e53['user']['id'],'read':![]}})[_0x889b('0x28')](function(_0x427274){return{'id':_['toInteger'](_0x354e53[_0x889b('0x4c')]['id']),'count':_0x427274};})[_0x889b('0x28')](respondWithResult(_0x43c74d,null))[_0x889b('0x46')](handleError(_0x43c74d,null));};exports['addMembers']=function(_0x15731b,_0x4e8220,_0x2c1a8b){return db[_0x889b('0x30')]['find']({'where':{'id':_0x15731b[_0x889b('0x4c')]['id']}})[_0x889b('0x28')](handleEntityNotFound(_0x4e8220,null))[_0x889b('0x28')](function(_0x32f656){if(_0x32f656){return _0x32f656['addMembers'](_0x15731b[_0x889b('0x4a')][_0x889b('0x4d')],_[_0x889b('0x4e')](_0x15731b[_0x889b('0x4a')],[_0x889b('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x4e8220,null))[_0x889b('0x46')](handleError(_0x4e8220,null));};exports[_0x889b('0x4f')]=function(_0xf08a2a,_0xdf5fd2,_0x212364){var _0x52f358={};var _0x3bd1a7={};var _0x745b91;var _0x203ae0;return db[_0x889b('0x30')][_0x889b('0x50')]({'where':{'id':_0xf08a2a[_0x889b('0x4c')]['id']}})['then'](handleEntityNotFound(_0xdf5fd2,null))[_0x889b('0x28')](function(_0x106817){if(_0x106817){_0x745b91=_0x106817;_0x3bd1a7[_0x889b('0x34')]=_[_0x889b('0x36')](db['User'][_0x889b('0x31')]);_0x3bd1a7[_0x889b('0x37')]=_[_0x889b('0x36')](_0xf08a2a[_0x889b('0x37')]);_0x3bd1a7['filters']=_[_0x889b('0x39')](_0x3bd1a7[_0x889b('0x34')],_0x3bd1a7[_0x889b('0x37')]);_0x52f358[_0x889b('0x3a')]=_[_0x889b('0x39')](_0x3bd1a7[_0x889b('0x34')],qs[_0x889b('0x3b')](_0xf08a2a[_0x889b('0x37')][_0x889b('0x3b')]));_0x52f358[_0x889b('0x3a')]=_0x52f358[_0x889b('0x3a')][_0x889b('0x3c')]?_0x52f358[_0x889b('0x3a')]:_0x3bd1a7[_0x889b('0x34')];_0x52f358[_0x889b('0x51')]=qs[_0x889b('0x3e')](_0xf08a2a[_0x889b('0x37')][_0x889b('0x3e')]);_0x52f358[_0x889b('0x3f')]=qs[_0x889b('0x38')](_[_0x889b('0x52')](_0xf08a2a[_0x889b('0x37')],_0x3bd1a7[_0x889b('0x38')]));if(_0xf08a2a['query'][_0x889b('0x40')]){_0x52f358['where']=_[_0x889b('0x42')](_0x52f358['where'],{'$or':_[_0x889b('0x35')](_0x52f358[_0x889b('0x3a')],function(_0x11454f){var _0x417833={};_0x417833[_0x11454f]={'$like':'%'+_0xf08a2a[_0x889b('0x37')][_0x889b('0x40')]+'%'};return _0x417833;})});}_0x52f358=_[_0x889b('0x42')]({},_0x52f358,_0xf08a2a[_0x889b('0x43')]);return _0x745b91['getMembers'](_0x52f358);}})[_0x889b('0x28')](function(_0x422053){if(_0x422053){_0x203ae0=_0x422053['length'];if(!_0xf08a2a['query']['hasOwnProperty'](_0x889b('0x3d'))){_0x52f358[_0x889b('0x20')]=qs[_0x889b('0x20')](_0xf08a2a[_0x889b('0x37')]['limit']);_0x52f358[_0x889b('0x1e')]=qs[_0x889b('0x1e')](_0xf08a2a['query'][_0x889b('0x1e')]);}return _0x745b91[_0x889b('0x4f')](_0x52f358);}})[_0x889b('0x28')](function(_0x432c0b){if(_0x432c0b){return _0x432c0b?{'count':_0x203ae0,'rows':_0x432c0b}:null;}})[_0x889b('0x28')](respondWithResult(_0xdf5fd2,null))[_0x889b('0x46')](handleError(_0xdf5fd2,null));};exports[_0x889b('0x53')]=function(_0x1bcae6,_0x579324,_0x51363e){return db[_0x889b('0x30')]['find']({'where':{'id':_0x1bcae6[_0x889b('0x4c')]['id']}})[_0x889b('0x28')](handleEntityNotFound(_0x579324,null))[_0x889b('0x28')](function(_0x2437fc){if(_0x2437fc){return _0x2437fc['removeMembers'](_0x1bcae6[_0x889b('0x37')][_0x889b('0x4d')]);}})[_0x889b('0x28')](respondWithStatusCode(_0x579324,null))[_0x889b('0x46')](handleError(_0x579324,null));};exports[_0x889b('0x54')]=function(_0x478fcd,_0x191a07,_0x46cc70){if(_0x478fcd['body']['id']){delete _0x478fcd[_0x889b('0x4a')]['id'];}return db[_0x889b('0x30')][_0x889b('0x48')]({'where':{'id':_0x478fcd[_0x889b('0x4c')]['id']}})[_0x889b('0x28')](handleEntityNotFound(_0x191a07,null))[_0x889b('0x28')](function(_0x2f1ac6){if(_0x2f1ac6){_0x478fcd[_0x889b('0x4a')][_0x889b('0x55')]=_0x2f1ac6['id'];return db[_0x889b('0x56')]['create'](_0x478fcd[_0x889b('0x4a')]);}})[_0x889b('0x28')](respondWithResult(_0x191a07,null))[_0x889b('0x46')](handleError(_0x191a07,null));};exports[_0x889b('0x57')]=function(_0x2e5ef2,_0x5a80e6,_0x2c3cda){var _0x2fcacb={};var _0x52d8d7={};var _0x11efa0;var _0x263432;return db[_0x889b('0x30')][_0x889b('0x50')]({'where':{'id':_0x2e5ef2[_0x889b('0x4c')]['id']}})[_0x889b('0x28')](handleEntityNotFound(_0x5a80e6,null))[_0x889b('0x28')](function(_0x4b8279){if(_0x4b8279){_0x11efa0=_0x4b8279;_0x52d8d7['model']=_['keys'](db[_0x889b('0x56')][_0x889b('0x31')]);_0x52d8d7[_0x889b('0x37')]=_[_0x889b('0x36')](_0x2e5ef2[_0x889b('0x37')]);_0x52d8d7[_0x889b('0x38')]=_[_0x889b('0x39')](_0x52d8d7[_0x889b('0x34')],_0x52d8d7[_0x889b('0x37')]);_0x2fcacb[_0x889b('0x3a')]=_['intersection'](_0x52d8d7['model'],qs[_0x889b('0x3b')](_0x2e5ef2[_0x889b('0x37')][_0x889b('0x3b')]));_0x2fcacb[_0x889b('0x3a')]=_0x2fcacb['attributes'][_0x889b('0x3c')]?_0x2fcacb[_0x889b('0x3a')]:_0x52d8d7[_0x889b('0x34')];_0x2fcacb['order']=qs[_0x889b('0x3e')](_0x2e5ef2[_0x889b('0x37')][_0x889b('0x3e')]);_0x2fcacb[_0x889b('0x3f')]=qs[_0x889b('0x38')](_['pick'](_0x2e5ef2[_0x889b('0x37')],_0x52d8d7[_0x889b('0x38')]));if(_0x2e5ef2[_0x889b('0x37')][_0x889b('0x40')]){_0x2fcacb[_0x889b('0x3f')]=_['merge'](_0x2fcacb[_0x889b('0x3f')],{'$or':_[_0x889b('0x35')](_0x2fcacb[_0x889b('0x3a')],function(_0x25ab61){var _0x26a95a={};_0x26a95a[_0x25ab61]={'$like':'%'+_0x2e5ef2[_0x889b('0x37')][_0x889b('0x40')]+'%'};return _0x26a95a;})});}if(_0x2e5ef2['query'][_0x889b('0x58')]){var _0x4688d8=_0x2e5ef2[_0x889b('0x37')][_0x889b('0x58')]['split'](',');var _0x54a060={};_0x54a060[_0x4688d8[0x0]]={'$gte':moment(_0x4688d8[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2fcacb[_0x889b('0x3f')]=_[_0x889b('0x42')](_0x2fcacb[_0x889b('0x3f')],_0x54a060);}_0x2fcacb=_[_0x889b('0x42')]({},_0x2fcacb,_0x2e5ef2[_0x889b('0x43')]);return _0x11efa0[_0x889b('0x57')](_0x2fcacb);}})[_0x889b('0x28')](function(_0x4819c2){if(_0x4819c2){_0x263432=_0x4819c2[_0x889b('0x3c')];if(!_0x2e5ef2[_0x889b('0x37')][_0x889b('0x59')]('nolimit')){_0x2fcacb[_0x889b('0x20')]=qs[_0x889b('0x20')](_0x2e5ef2[_0x889b('0x37')][_0x889b('0x20')]);_0x2fcacb[_0x889b('0x1e')]=qs[_0x889b('0x1e')](_0x2e5ef2[_0x889b('0x37')][_0x889b('0x1e')]);}return _0x11efa0[_0x889b('0x57')](_0x2fcacb);}})[_0x889b('0x28')](function(_0xcfcfc5){if(_0xcfcfc5){return _0xcfcfc5?{'count':_0x263432,'rows':_0xcfcfc5}:null;}})[_0x889b('0x28')](respondWithResult(_0x5a80e6,null))[_0x889b('0x46')](handleError(_0x5a80e6,null));};
\ No newline at end of file
+var _0xa980=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','name','send','map','ChatGroup','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','describe','ChatInternalMessage','params','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','filter','nolimit','removeMembers','ChatGroupId','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xd1ba08,_0x140501){var _0xcd13e1=function(_0x1fb6ce){while(--_0x1fb6ce){_0xd1ba08['push'](_0xd1ba08['shift']());}};_0xcd13e1(++_0x140501);}(_0xa980,0x164));var _0x0a98=function(_0x1faf7b,_0xbda798){_0x1faf7b=_0x1faf7b-0x0;var _0x4cca5b=_0xa980[_0x1faf7b];return _0x4cca5b;};'use strict';var emlformat=require(_0x0a98('0x0'));var rimraf=require(_0x0a98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a98('0x2'));var rp=require(_0x0a98('0x3'));var moment=require('moment');var BPromise=require(_0x0a98('0x4'));var Mustache=require(_0x0a98('0x5'));var util=require(_0x0a98('0x6'));var path=require('path');var sox=require(_0x0a98('0x7'));var csv=require(_0x0a98('0x8'));var ejs=require(_0x0a98('0x9'));var fs=require('fs');var fs_extra=require(_0x0a98('0xa'));var _=require(_0x0a98('0xb'));var squel=require('squel');var crypto=require(_0x0a98('0xc'));var jsforce=require(_0x0a98('0xd'));var deskjs=require(_0x0a98('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0a98('0xf'));var Papa=require('papaparse');var Redis=require(_0x0a98('0x10'));var authService=require(_0x0a98('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a98('0x12'));var logger=require('../../config/logger')(_0x0a98('0x13'));var utils=require('../../config/utils');var config=require(_0x0a98('0x14'));var licenseUtil=require(_0x0a98('0x15'));var db=require('../../mysqldb')['db'];config[_0x0a98('0x16')]=_[_0x0a98('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a98('0x16')]));require(_0x0a98('0x18'))[_0x0a98('0x19')](socket);function respondWithStatusCode(_0x3905c9,_0x369394){_0x369394=_0x369394||0xcc;return function(_0x1fd4ff){if(_0x1fd4ff){return _0x3905c9[_0x0a98('0x1a')](_0x369394);}return _0x3905c9[_0x0a98('0x1b')](_0x369394)[_0x0a98('0x1c')]();};}function respondWithResult(_0x4f7be0,_0x5d4ba7){_0x5d4ba7=_0x5d4ba7||0xc8;return function(_0x1be2c4){if(_0x1be2c4){return _0x4f7be0[_0x0a98('0x1b')](_0x5d4ba7)[_0x0a98('0x1d')](_0x1be2c4);}};}function respondWithFilteredResult(_0x192436,_0x24a2d8){return function(_0x282b9a){if(_0x282b9a){var _0x177eef=typeof _0x24a2d8[_0x0a98('0x1e')]===_0x0a98('0x1f')&&typeof _0x24a2d8['limit']==='undefined';var _0x1f278c=_0x282b9a[_0x0a98('0x20')];var _0x253dbb=_0x177eef?0x0:_0x24a2d8[_0x0a98('0x1e')];var _0x4c8808=_0x177eef?_0x282b9a[_0x0a98('0x20')]:_0x24a2d8[_0x0a98('0x1e')]+_0x24a2d8[_0x0a98('0x21')];var _0x1143c1;if(_0x4c8808>=_0x1f278c){_0x4c8808=_0x1f278c;_0x1143c1=0xc8;}else{_0x1143c1=0xce;}_0x192436['status'](_0x1143c1);return _0x192436[_0x0a98('0x22')](_0x0a98('0x23'),_0x253dbb+'-'+_0x4c8808+'/'+_0x1f278c)[_0x0a98('0x1d')](_0x282b9a);}return null;};}function patchUpdates(_0x3b5d24){return function(_0x6fbc36){try{jsonpatch['apply'](_0x6fbc36,_0x3b5d24,!![]);}catch(_0x2fced9){return BPromise[_0x0a98('0x24')](_0x2fced9);}return _0x6fbc36[_0x0a98('0x25')]();};}function saveUpdates(_0x46ddbd,_0xccf83a){return function(_0x370793){if(_0x370793){return _0x370793[_0x0a98('0x26')](_0x46ddbd)['then'](function(_0x2fa5a3){return _0x2fa5a3;});}return null;};}function removeEntity(_0x1aa606,_0x1778a6){return function(_0x44a36b){if(_0x44a36b){return _0x44a36b[_0x0a98('0x27')]()[_0x0a98('0x28')](function(){_0x1aa606[_0x0a98('0x1b')](0xcc)[_0x0a98('0x1c')]();});}};}function handleEntityNotFound(_0x7a67a4,_0x2330e2){return function(_0x444cdf){if(!_0x444cdf){_0x7a67a4['sendStatus'](0x194);}return _0x444cdf;};}function handleError(_0x1d7061,_0x5d3274){_0x5d3274=_0x5d3274||0x1f4;return function(_0x39da62){logger[_0x0a98('0x29')](_0x39da62['stack']);if(_0x39da62[_0x0a98('0x2a')]){delete _0x39da62[_0x0a98('0x2a')];}_0x1d7061['status'](_0x5d3274)[_0x0a98('0x2b')](_0x39da62);};}exports['index']=function(_0x222c85,_0x495c5f){var _0x76de17={},_0x93d5cf={},_0x106ee3={'count':0x0,'rows':[]};var _0x1f2957=_[_0x0a98('0x2c')](db[_0x0a98('0x2d')]['rawAttributes'],function(_0x2c983a){return{'name':_0x2c983a[_0x0a98('0x2e')],'type':_0x2c983a['type'][_0x0a98('0x2f')]};});_0x93d5cf[_0x0a98('0x30')]=_[_0x0a98('0x2c')](_0x1f2957,_0x0a98('0x2a'));_0x93d5cf[_0x0a98('0x31')]=_[_0x0a98('0x32')](_0x222c85[_0x0a98('0x31')]);_0x93d5cf[_0x0a98('0x33')]=_[_0x0a98('0x34')](_0x93d5cf['model'],_0x93d5cf[_0x0a98('0x31')]);_0x76de17[_0x0a98('0x35')]=_[_0x0a98('0x34')](_0x93d5cf[_0x0a98('0x30')],qs[_0x0a98('0x36')](_0x222c85[_0x0a98('0x31')][_0x0a98('0x36')]));_0x76de17[_0x0a98('0x35')]=_0x76de17[_0x0a98('0x35')][_0x0a98('0x37')]?_0x76de17[_0x0a98('0x35')]:_0x93d5cf['model'];if(!_0x222c85[_0x0a98('0x31')][_0x0a98('0x38')]('nolimit')){_0x76de17[_0x0a98('0x21')]=qs[_0x0a98('0x21')](_0x222c85[_0x0a98('0x31')]['limit']);_0x76de17[_0x0a98('0x1e')]=qs[_0x0a98('0x1e')](_0x222c85[_0x0a98('0x31')][_0x0a98('0x1e')]);}_0x76de17['order']=qs[_0x0a98('0x39')](_0x222c85[_0x0a98('0x31')][_0x0a98('0x39')]);_0x76de17[_0x0a98('0x3a')]=qs[_0x0a98('0x33')](_[_0x0a98('0x3b')](_0x222c85[_0x0a98('0x31')],_0x93d5cf[_0x0a98('0x33')]),_0x1f2957);if(_0x222c85[_0x0a98('0x31')]['filter']){_0x76de17['where']=_[_0x0a98('0x3c')](_0x76de17['where'],{'$or':_[_0x0a98('0x2c')](_0x1f2957,function(_0x468001){if(_0x468001[_0x0a98('0x3d')]!==_0x0a98('0x3e')){var _0x17355a={};_0x17355a[_0x468001[_0x0a98('0x2a')]]={'$like':'%'+_0x222c85[_0x0a98('0x31')]['filter']+'%'};return _0x17355a;}})});}_0x76de17=_['merge']({},_0x76de17,_0x222c85[_0x0a98('0x3f')]);var _0x188f7a={'where':_0x76de17[_0x0a98('0x3a')]};return db[_0x0a98('0x2d')][_0x0a98('0x20')](_0x188f7a)[_0x0a98('0x28')](function(_0x136208){_0x106ee3['count']=_0x136208;if(_0x222c85[_0x0a98('0x31')][_0x0a98('0x40')]){_0x76de17[_0x0a98('0x41')]=[{'all':!![]}];}return db[_0x0a98('0x2d')][_0x0a98('0x42')](_0x76de17);})[_0x0a98('0x28')](function(_0x2b834e){_0x106ee3[_0x0a98('0x43')]=_0x2b834e;return _0x106ee3;})['then'](respondWithFilteredResult(_0x495c5f,_0x76de17))[_0x0a98('0x44')](handleError(_0x495c5f,null));};exports['show']=function(_0x2e2067,_0x27699b){var _0x2c80b8={'raw':!![],'where':{'id':_0x2e2067['params']['id']}},_0x493744={};_0x493744['model']=_[_0x0a98('0x32')](db['ChatGroup'][_0x0a98('0x45')]);_0x493744[_0x0a98('0x31')]=_[_0x0a98('0x32')](_0x2e2067[_0x0a98('0x31')]);_0x493744['filters']=_[_0x0a98('0x34')](_0x493744[_0x0a98('0x30')],_0x493744[_0x0a98('0x31')]);_0x2c80b8['attributes']=_[_0x0a98('0x34')](_0x493744[_0x0a98('0x30')],qs[_0x0a98('0x36')](_0x2e2067['query'][_0x0a98('0x36')]));_0x2c80b8[_0x0a98('0x35')]=_0x2c80b8[_0x0a98('0x35')][_0x0a98('0x37')]?_0x2c80b8[_0x0a98('0x35')]:_0x493744[_0x0a98('0x30')];if(_0x2e2067[_0x0a98('0x31')][_0x0a98('0x40')]){_0x2c80b8[_0x0a98('0x41')]=[{'all':!![]}];}_0x2c80b8=_[_0x0a98('0x3c')]({},_0x2c80b8,_0x2e2067[_0x0a98('0x3f')]);return db['ChatGroup'][_0x0a98('0x46')](_0x2c80b8)[_0x0a98('0x28')](handleEntityNotFound(_0x27699b,null))[_0x0a98('0x28')](respondWithResult(_0x27699b,null))[_0x0a98('0x44')](handleError(_0x27699b,null));};exports[_0x0a98('0x47')]=function(_0x2e27f3,_0x5053b7){return db[_0x0a98('0x2d')][_0x0a98('0x47')](_0x2e27f3['body'],{})[_0x0a98('0x28')](respondWithResult(_0x5053b7,0xc9))[_0x0a98('0x44')](handleError(_0x5053b7,null));};exports[_0x0a98('0x26')]=function(_0x45e3fb,_0x43668b){if(_0x45e3fb[_0x0a98('0x48')]['id']){delete _0x45e3fb[_0x0a98('0x48')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x45e3fb['params']['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0x43668b,null))[_0x0a98('0x28')](saveUpdates(_0x45e3fb['body'],null))[_0x0a98('0x28')](respondWithResult(_0x43668b,null))['catch'](handleError(_0x43668b,null));};exports[_0x0a98('0x27')]=function(_0x584d64,_0x563e53){return db[_0x0a98('0x2d')][_0x0a98('0x46')]({'where':{'id':_0x584d64['params']['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0x563e53,null))[_0x0a98('0x28')](removeEntity(_0x563e53,null))[_0x0a98('0x44')](handleError(_0x563e53,null));};exports[_0x0a98('0x49')]=function(_0x5db258,_0x4c0457){return db[_0x0a98('0x2d')][_0x0a98('0x49')]()[_0x0a98('0x28')](respondWithResult(_0x4c0457,null))[_0x0a98('0x44')](handleError(_0x4c0457,null));};exports['getUnread']=function(_0x240980,_0x156caa,_0x16ce9f){return db[_0x0a98('0x4a')]['count']({'where':{'ChatGroupId':_0x240980[_0x0a98('0x4b')]['id'],'ToId':_0x240980[_0x0a98('0x4c')]['id'],'read':![]}})[_0x0a98('0x28')](function(_0x1f0e35){return{'id':_[_0x0a98('0x4d')](_0x240980[_0x0a98('0x4b')]['id']),'count':_0x1f0e35};})['then'](respondWithResult(_0x156caa,null))[_0x0a98('0x44')](handleError(_0x156caa,null));};exports[_0x0a98('0x4e')]=function(_0x29e047,_0xc9535a,_0x56abbf){return db[_0x0a98('0x2d')]['find']({'where':{'id':_0x29e047[_0x0a98('0x4b')]['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0xc9535a,null))['then'](function(_0x1567ec){if(_0x1567ec){return _0x1567ec['addMembers'](_0x29e047['body'][_0x0a98('0x4f')],_[_0x0a98('0x50')](_0x29e047[_0x0a98('0x48')],[_0x0a98('0x4f'),'id'])||{});}})['then'](respondWithResult(_0xc9535a,null))['catch'](handleError(_0xc9535a,null));};exports[_0x0a98('0x51')]=function(_0x276e74,_0x45b6a3,_0x5b48d8){var _0xb2475={};var _0x171d5a={};var _0x22a9c4;var _0x34ffd8;return db[_0x0a98('0x2d')][_0x0a98('0x52')]({'where':{'id':_0x276e74[_0x0a98('0x4b')]['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0x45b6a3,null))[_0x0a98('0x28')](function(_0x1a493a){if(_0x1a493a){_0x22a9c4=_0x1a493a;_0x171d5a[_0x0a98('0x30')]=_[_0x0a98('0x32')](db[_0x0a98('0x53')][_0x0a98('0x45')]);_0x171d5a['query']=_[_0x0a98('0x32')](_0x276e74[_0x0a98('0x31')]);_0x171d5a[_0x0a98('0x33')]=_[_0x0a98('0x34')](_0x171d5a[_0x0a98('0x30')],_0x171d5a[_0x0a98('0x31')]);_0xb2475['attributes']=_[_0x0a98('0x34')](_0x171d5a['model'],qs[_0x0a98('0x36')](_0x276e74[_0x0a98('0x31')][_0x0a98('0x36')]));_0xb2475[_0x0a98('0x35')]=_0xb2475[_0x0a98('0x35')][_0x0a98('0x37')]?_0xb2475['attributes']:_0x171d5a[_0x0a98('0x30')];_0xb2475[_0x0a98('0x54')]=qs[_0x0a98('0x39')](_0x276e74[_0x0a98('0x31')][_0x0a98('0x39')]);_0xb2475[_0x0a98('0x3a')]=qs[_0x0a98('0x33')](_['pick'](_0x276e74[_0x0a98('0x31')],_0x171d5a[_0x0a98('0x33')]));if(_0x276e74[_0x0a98('0x31')]['filter']){_0xb2475[_0x0a98('0x3a')]=_[_0x0a98('0x3c')](_0xb2475[_0x0a98('0x3a')],{'$or':_[_0x0a98('0x2c')](_0xb2475[_0x0a98('0x35')],function(_0x3d4448){var _0x9102ce={};_0x9102ce[_0x3d4448]={'$like':'%'+_0x276e74[_0x0a98('0x31')][_0x0a98('0x55')]+'%'};return _0x9102ce;})});}_0xb2475=_[_0x0a98('0x3c')]({},_0xb2475,_0x276e74[_0x0a98('0x3f')]);return _0x22a9c4[_0x0a98('0x51')](_0xb2475);}})[_0x0a98('0x28')](function(_0x3594b0){if(_0x3594b0){_0x34ffd8=_0x3594b0['length'];if(!_0x276e74['query'][_0x0a98('0x38')](_0x0a98('0x56'))){_0xb2475[_0x0a98('0x21')]=qs[_0x0a98('0x21')](_0x276e74[_0x0a98('0x31')][_0x0a98('0x21')]);_0xb2475[_0x0a98('0x1e')]=qs[_0x0a98('0x1e')](_0x276e74['query']['offset']);}return _0x22a9c4['getMembers'](_0xb2475);}})[_0x0a98('0x28')](function(_0x341abf){if(_0x341abf){return _0x341abf?{'count':_0x34ffd8,'rows':_0x341abf}:null;}})['then'](respondWithResult(_0x45b6a3,null))[_0x0a98('0x44')](handleError(_0x45b6a3,null));};exports[_0x0a98('0x57')]=function(_0x5398c8,_0x5a64eb,_0x503254){return db[_0x0a98('0x2d')][_0x0a98('0x46')]({'where':{'id':_0x5398c8[_0x0a98('0x4b')]['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0x5a64eb,null))['then'](function(_0x89ef11){if(_0x89ef11){return _0x89ef11[_0x0a98('0x57')](_0x5398c8[_0x0a98('0x31')][_0x0a98('0x4f')]);}})['then'](respondWithStatusCode(_0x5a64eb,null))[_0x0a98('0x44')](handleError(_0x5a64eb,null));};exports['addMessage']=function(_0x35003a,_0x366308,_0x3862e0){if(_0x35003a[_0x0a98('0x48')]['id']){delete _0x35003a[_0x0a98('0x48')]['id'];}return db['ChatGroup'][_0x0a98('0x46')]({'where':{'id':_0x35003a['params']['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0x366308,null))[_0x0a98('0x28')](function(_0x4bf8ef){if(_0x4bf8ef){_0x35003a['body'][_0x0a98('0x58')]=_0x4bf8ef['id'];return db[_0x0a98('0x4a')][_0x0a98('0x47')](_0x35003a['body']);}})['then'](respondWithResult(_0x366308,null))['catch'](handleError(_0x366308,null));};exports[_0x0a98('0x59')]=function(_0x442f7a,_0x112516,_0x30400c){var _0x47abb3={};var _0x1a533d={};var _0x382c53;var _0x988f64;return db[_0x0a98('0x2d')][_0x0a98('0x52')]({'where':{'id':_0x442f7a[_0x0a98('0x4b')]['id']}})[_0x0a98('0x28')](handleEntityNotFound(_0x112516,null))[_0x0a98('0x28')](function(_0x22068c){if(_0x22068c){_0x382c53=_0x22068c;_0x1a533d[_0x0a98('0x30')]=_[_0x0a98('0x32')](db[_0x0a98('0x4a')][_0x0a98('0x45')]);_0x1a533d['query']=_[_0x0a98('0x32')](_0x442f7a[_0x0a98('0x31')]);_0x1a533d[_0x0a98('0x33')]=_[_0x0a98('0x34')](_0x1a533d['model'],_0x1a533d['query']);_0x47abb3['attributes']=_['intersection'](_0x1a533d[_0x0a98('0x30')],qs['fields'](_0x442f7a[_0x0a98('0x31')][_0x0a98('0x36')]));_0x47abb3['attributes']=_0x47abb3[_0x0a98('0x35')][_0x0a98('0x37')]?_0x47abb3[_0x0a98('0x35')]:_0x1a533d[_0x0a98('0x30')];_0x47abb3[_0x0a98('0x54')]=qs[_0x0a98('0x39')](_0x442f7a['query'][_0x0a98('0x39')]);_0x47abb3['where']=qs[_0x0a98('0x33')](_[_0x0a98('0x3b')](_0x442f7a[_0x0a98('0x31')],_0x1a533d[_0x0a98('0x33')]));if(_0x442f7a[_0x0a98('0x31')]['filter']){_0x47abb3[_0x0a98('0x3a')]=_[_0x0a98('0x3c')](_0x47abb3[_0x0a98('0x3a')],{'$or':_['map'](_0x47abb3['attributes'],function(_0x4859f9){var _0x4f0aa4={};_0x4f0aa4[_0x4859f9]={'$like':'%'+_0x442f7a[_0x0a98('0x31')][_0x0a98('0x55')]+'%'};return _0x4f0aa4;})});}if(_0x442f7a[_0x0a98('0x31')][_0x0a98('0x5a')]){var _0x1061e1=_0x442f7a['query'][_0x0a98('0x5a')]['split'](',');var _0x5ef5ae={};_0x5ef5ae[_0x1061e1[0x0]]={'$gte':moment(_0x1061e1[0x1])['format'](_0x0a98('0x5b'))};_0x47abb3['where']=_['merge'](_0x47abb3[_0x0a98('0x3a')],_0x5ef5ae);}_0x47abb3=_['merge']({},_0x47abb3,_0x442f7a[_0x0a98('0x3f')]);return _0x382c53['getMessages'](_0x47abb3);}})[_0x0a98('0x28')](function(_0x311a79){if(_0x311a79){_0x988f64=_0x311a79[_0x0a98('0x37')];if(!_0x442f7a['query']['hasOwnProperty'](_0x0a98('0x56'))){_0x47abb3['limit']=qs[_0x0a98('0x21')](_0x442f7a[_0x0a98('0x31')][_0x0a98('0x21')]);_0x47abb3['offset']=qs[_0x0a98('0x1e')](_0x442f7a[_0x0a98('0x31')][_0x0a98('0x1e')]);}return _0x382c53[_0x0a98('0x59')](_0x47abb3);}})[_0x0a98('0x28')](function(_0x53da17){if(_0x53da17){return _0x53da17?{'count':_0x988f64,'rows':_0x53da17}:null;}})[_0x0a98('0x28')](respondWithResult(_0x112516,null))[_0x0a98('0x44')](handleError(_0x112516,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 5b74935..0c15d19 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 _0xaf97=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x4fa491,_0x3a9ad4){var _0x332aee=function(_0x59bd7b){while(--_0x59bd7b){_0x4fa491['push'](_0x4fa491['shift']());}};_0x332aee(++_0x3a9ad4);}(_0xaf97,0x15a));var _0x7af9=function(_0x4d6522,_0x21bd89){_0x4d6522=_0x4d6522-0x0;var _0x197192=_0xaf97[_0x4d6522];return _0x197192;};'use strict';var EventEmitter=require(_0x7af9('0x0'));var ChatGroup=require(_0x7af9('0x1'))['db'][_0x7af9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7af9('0x3')](0x0);var events={'afterCreate':_0x7af9('0x4'),'afterUpdate':'update','afterDestroy':_0x7af9('0x5')};function emitEvent(_0x1d6e9f){return function(_0x3fd76e,_0x1dce1d,_0x540a77){ChatGroupEvents[_0x7af9('0x6')](_0x1d6e9f+':'+_0x3fd76e['id'],_0x3fd76e);ChatGroupEvents[_0x7af9('0x6')](_0x1d6e9f,_0x3fd76e);_0x540a77(null);};}for(var e in events){if(events[_0x7af9('0x7')](e)){var event=events[e];ChatGroup[_0x7af9('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xb334=['update','remove','hasOwnProperty','hook','events','../../mysqldb','ChatGroup'];(function(_0x28e1fb,_0x5d4528){var _0x4f64c0=function(_0x22dadf){while(--_0x22dadf){_0x28e1fb['push'](_0x28e1fb['shift']());}};_0x4f64c0(++_0x5d4528);}(_0xb334,0x1bd));var _0x4b33=function(_0x90318e,_0x48f59f){_0x90318e=_0x90318e-0x0;var _0x55e168=_0xb334[_0x90318e];return _0x55e168;};'use strict';var EventEmitter=require(_0x4b33('0x0'));var ChatGroup=require(_0x4b33('0x1'))['db'][_0x4b33('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b33('0x3'),'afterDestroy':_0x4b33('0x4')};function emitEvent(_0x38a00e){return function(_0x22407b,_0x183e61,_0x56db5e){ChatGroupEvents['emit'](_0x38a00e+':'+_0x22407b['id'],_0x22407b);ChatGroupEvents['emit'](_0x38a00e,_0x22407b);_0x56db5e(null);};}for(var e in events){if(events[_0x4b33('0x5')](e)){var event=events[e];ChatGroup[_0x4b33('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 6a4cc96..2e8cad4 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 _0xb878=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment'];(function(_0x16bd7f,_0x4ba1cc){var _0x2a7896=function(_0x7af938){while(--_0x7af938){_0x16bd7f['push'](_0x16bd7f['shift']());}};_0x2a7896(++_0x4ba1cc);}(_0xb878,0xa3));var _0x8b87=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb878[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8b87('0x0'));var util=require(_0x8b87('0x1'));var logger=require(_0x8b87('0x2'))(_0x8b87('0x3'));var moment=require(_0x8b87('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b87('0x5'));var fs=require('fs');var path=require(_0x8b87('0x6'));var rimraf=require(_0x8b87('0x7'));var config=require(_0x8b87('0x8'));var attributes=require(_0x8b87('0x9'));module[_0x8b87('0xa')]=function(_0x5de16d,_0xbac6a8){return _0x5de16d[_0x8b87('0xb')](_0x8b87('0xc'),attributes,{'tableName':_0x8b87('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x290f=['./chatGroup.attributes','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x290f,0x162));var _0xf290=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x290f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf290('0x0'));var util=require('util');var logger=require(_0xf290('0x1'))(_0xf290('0x2'));var moment=require(_0xf290('0x3'));var BPromise=require(_0xf290('0x4'));var rp=require(_0xf290('0x5'));var fs=require('fs');var path=require(_0xf290('0x6'));var rimraf=require(_0xf290('0x7'));var config=require(_0xf290('0x8'));var attributes=require(_0xf290('0x9'));module['exports']=function(_0xb33db3,_0x5ee272){return _0xb33db3[_0xf290('0xa')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 5583019..5885989 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 _0x06f4=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info'];(function(_0x9c3c94,_0x296e5a){var _0x598937=function(_0x2e3c3b){while(--_0x2e3c3b){_0x9c3c94['push'](_0x9c3c94['shift']());}};_0x598937(++_0x296e5a);}(_0x06f4,0x136));var _0x406f=function(_0x2d435d,_0x56edee){_0x2d435d=_0x2d435d-0x0;var _0x38d715=_0x06f4[_0x2d435d];return _0x38d715;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require('moment');var BPromise=require(_0x406f('0x2'));var rs=require(_0x406f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x406f('0x4'));var logger=require('../../config/logger')(_0x406f('0x5'));var config=require(_0x406f('0x6'));var jayson=require(_0x406f('0x7'));var client=jayson[_0x406f('0x8')]['http']({'port':0x232a});config[_0x406f('0x9')]=_['defaults'](config[_0x406f('0x9')],{'host':_0x406f('0xa'),'port':0x18eb});var socket=require(_0x406f('0xb'))(new Redis(config['redis']));require(_0x406f('0xc'))['register'](socket);function respondWithRpcPromise(_0x5b46bf,_0xd817eb,_0x56edc2){return new BPromise(function(_0x28c5a5,_0x4e0e96){return client[_0x406f('0xd')](_0x5b46bf,_0x56edc2)['then'](function(_0xb2c62d){logger[_0x406f('0xe')]('ChatGroup,\x20%s,\x20%s',_0xd817eb,_0x406f('0xf'));logger[_0x406f('0x10')](_0x406f('0x11'),_0xd817eb,_0x406f('0xf'),JSON[_0x406f('0x12')](_0xb2c62d));if(_0xb2c62d[_0x406f('0x13')]){if(_0xb2c62d[_0x406f('0x13')][_0x406f('0x14')]===0x1f4){logger[_0x406f('0x13')](_0x406f('0x15'),_0xd817eb,_0xb2c62d[_0x406f('0x13')]['message']);return _0x4e0e96(_0xb2c62d[_0x406f('0x13')][_0x406f('0x16')]);}logger[_0x406f('0x13')]('ChatGroup,\x20%s,\x20%s',_0xd817eb,_0xb2c62d[_0x406f('0x13')][_0x406f('0x16')]);return _0x28c5a5(_0xb2c62d['error']['message']);}else{logger[_0x406f('0xe')](_0x406f('0x15'),_0xd817eb,'request\x20sent');_0x28c5a5(_0xb2c62d[_0x406f('0x17')]['message']);}})[_0x406f('0x18')](function(_0x3ad3fe){logger[_0x406f('0x13')](_0x406f('0x15'),_0xd817eb,_0x3ad3fe);_0x4e0e96(_0x3ad3fe);});});}
\ No newline at end of file
+var _0x0fda=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x1a7dc2,_0x40596a){_0x1a7dc2=_0x1a7dc2-0x0;var _0x5169cb=_0x0fda[_0x1a7dc2];return _0x5169cb;};'use strict';var _=require(_0xa0fd('0x0'));var util=require('util');var moment=require(_0xa0fd('0x1'));var BPromise=require(_0xa0fd('0x2'));var rs=require(_0xa0fd('0x3'));var fs=require('fs');var Redis=require(_0xa0fd('0x4'));var db=require(_0xa0fd('0x5'))['db'];var utils=require(_0xa0fd('0x6'));var logger=require(_0xa0fd('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa0fd('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xa0fd('0x9')]=_[_0xa0fd('0xa')](config[_0xa0fd('0x9')],{'host':_0xa0fd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0fd('0x9')]));require(_0xa0fd('0xc'))[_0xa0fd('0xd')](socket);function respondWithRpcPromise(_0x322a1a,_0x4e1873,_0x31088d){return new BPromise(function(_0x423616,_0x36634c){return client['request'](_0x322a1a,_0x31088d)[_0xa0fd('0xe')](function(_0x332e66){logger[_0xa0fd('0xf')](_0xa0fd('0x10'),_0x4e1873,_0xa0fd('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4e1873,_0xa0fd('0x11'),JSON[_0xa0fd('0x12')](_0x332e66));if(_0x332e66['error']){if(_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x14')]===0x1f4){logger[_0xa0fd('0x13')](_0xa0fd('0x10'),_0x4e1873,_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x15')]);return _0x36634c(_0x332e66[_0xa0fd('0x13')]['message']);}logger[_0xa0fd('0x13')](_0xa0fd('0x10'),_0x4e1873,_0x332e66['error']['message']);return _0x423616(_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x15')]);}else{logger['info'](_0xa0fd('0x10'),_0x4e1873,_0xa0fd('0x11'));_0x423616(_0x332e66[_0xa0fd('0x16')]['message']);}})['catch'](function(_0x46e15a){logger['error'](_0xa0fd('0x10'),_0x4e1873,_0x46e15a);_0x36634c(_0x46e15a);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e1a914c..652687c 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 _0x5b9b=['chatGroup:','./chatGroup.events','remove','emit'];(function(_0xd04b50,_0x3d635d){var _0x5de236=function(_0x9129b1){while(--_0x9129b1){_0xd04b50['push'](_0xd04b50['shift']());}};_0x5de236(++_0x3d635d);}(_0x5b9b,0x1e9));var _0xb5b9=function(_0x147622,_0x300df4){_0x147622=_0x147622-0x0;var _0x19e095=_0x5b9b[_0x147622];return _0x19e095;};'use strict';var ChatGroupEvents=require(_0xb5b9('0x0'));var events=['save',_0xb5b9('0x1'),'update'];function createListener(_0x4ce575,_0x266895){return function(_0x3ba5f2){_0x266895[_0xb5b9('0x2')](_0x4ce575,_0x3ba5f2);};}function removeListener(_0x499ddd,_0x38d83e){return function(){ChatGroupEvents['removeListener'](_0x499ddd,_0x38d83e);};}exports['register']=function(_0x56f77b){for(var _0x15e803=0x0,_0x363cfb=events['length'];_0x15e803<_0x363cfb;_0x15e803++){var _0x19f2cb=events[_0x15e803];var _0x248e1b=createListener(_0xb5b9('0x3')+_0x19f2cb,_0x56f77b);ChatGroupEvents['on'](_0x19f2cb,_0x248e1b);}};
\ No newline at end of file
+var _0x1640=['./chatGroup.events','save','update','emit','register','chatGroup:'];(function(_0x30f15d,_0x1122c6){var _0x569010=function(_0x3469b0){while(--_0x3469b0){_0x30f15d['push'](_0x30f15d['shift']());}};_0x569010(++_0x1122c6);}(_0x1640,0x126));var _0x0164=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x1640[_0x51020b];return _0x371e47;};'use strict';var ChatGroupEvents=require(_0x0164('0x0'));var events=[_0x0164('0x1'),'remove',_0x0164('0x2')];function createListener(_0xf2d6d,_0x3cd97d){return function(_0x42669b){_0x3cd97d[_0x0164('0x3')](_0xf2d6d,_0x42669b);};}function removeListener(_0xa26aa1,_0x56c8ad){return function(){ChatGroupEvents['removeListener'](_0xa26aa1,_0x56c8ad);};}exports[_0x0164('0x4')]=function(_0x45f512){for(var _0x5a4365=0x0,_0x33457b=events['length'];_0x5a4365<_0x33457b;_0x5a4365++){var _0x34fb5e=events[_0x5a4365];var _0xebfe66=createListener(_0x0164('0x5')+_0x34fb5e,_0x45f512);ChatGroupEvents['on'](_0x34fb5e,_0xebfe66);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 63452c7..c0bad4f 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 _0x90d5=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','addMembers','post','addMessage','/:id','update','delete','destroy','removeMembers','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x90d5,0x1cf));var _0x590d=function(_0x390420,_0x4b20cc){_0x390420=_0x390420-0x0;var _0x3200a0=_0x90d5[_0x390420];return _0x3200a0;};'use strict';var multer=require('multer');var util=require(_0x590d('0x0'));var path=require('path');var timeout=require(_0x590d('0x1'));var express=require(_0x590d('0x2'));var router=express[_0x590d('0x3')]();var fs_extra=require(_0x590d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x590d('0x5'));var config=require(_0x590d('0x6'));var controller=require(_0x590d('0x7'));router[_0x590d('0x8')]('/',auth[_0x590d('0x9')](),controller[_0x590d('0xa')]);router['get'](_0x590d('0xb'),auth[_0x590d('0x9')](),controller[_0x590d('0xc')]);router[_0x590d('0x8')]('/:id',auth[_0x590d('0x9')](),controller[_0x590d('0xd')]);router[_0x590d('0x8')](_0x590d('0xe'),auth[_0x590d('0x9')](),controller[_0x590d('0xf')]);router[_0x590d('0x8')](_0x590d('0x10'),auth[_0x590d('0x9')](),controller['getMembers']);router[_0x590d('0x8')](_0x590d('0x11'),auth[_0x590d('0x9')](),controller[_0x590d('0x12')]);router['post']('/',auth[_0x590d('0x9')](),controller[_0x590d('0x13')]);router['post']('/:id/members',auth[_0x590d('0x9')](),controller[_0x590d('0x14')]);router[_0x590d('0x15')](_0x590d('0x11'),auth[_0x590d('0x9')](),controller[_0x590d('0x16')]);router['put'](_0x590d('0x17'),auth[_0x590d('0x9')](),controller[_0x590d('0x18')]);router[_0x590d('0x19')](_0x590d('0x17'),auth[_0x590d('0x9')](),controller[_0x590d('0x1a')]);router[_0x590d('0x19')](_0x590d('0x10'),auth[_0x590d('0x9')](),controller[_0x590d('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x9df5=['../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','put','update','delete','/:id','removeMembers','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x9df5,0xdb));var _0x59df=function(_0x61ca21,_0x4df1c4){_0x61ca21=_0x61ca21-0x0;var _0x66c284=_0x9df5[_0x61ca21];return _0x66c284;};'use strict';var multer=require(_0x59df('0x0'));var util=require(_0x59df('0x1'));var path=require('path');var timeout=require(_0x59df('0x2'));var express=require(_0x59df('0x3'));var router=express['Router']();var fs_extra=require(_0x59df('0x4'));var auth=require(_0x59df('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x59df('0x6'));var controller=require(_0x59df('0x7'));router[_0x59df('0x8')]('/',auth[_0x59df('0x9')](),controller[_0x59df('0xa')]);router[_0x59df('0x8')](_0x59df('0xb'),auth['isAuthenticated'](),controller[_0x59df('0xc')]);router[_0x59df('0x8')]('/:id',auth[_0x59df('0x9')](),controller[_0x59df('0xd')]);router[_0x59df('0x8')](_0x59df('0xe'),auth[_0x59df('0x9')](),controller[_0x59df('0xf')]);router[_0x59df('0x8')](_0x59df('0x10'),auth['isAuthenticated'](),controller[_0x59df('0x11')]);router['get'](_0x59df('0x12'),auth['isAuthenticated'](),controller[_0x59df('0x13')]);router[_0x59df('0x14')]('/',auth[_0x59df('0x9')](),controller['create']);router[_0x59df('0x14')](_0x59df('0x10'),auth[_0x59df('0x9')](),controller[_0x59df('0x15')]);router[_0x59df('0x14')](_0x59df('0x12'),auth[_0x59df('0x9')](),controller['addMessage']);router[_0x59df('0x16')]('/:id',auth[_0x59df('0x9')](),controller[_0x59df('0x17')]);router[_0x59df('0x18')](_0x59df('0x19'),auth[_0x59df('0x9')](),controller['destroy']);router[_0x59df('0x18')](_0x59df('0x10'),auth['isAuthenticated'](),controller[_0x59df('0x1a')]);module[_0x59df('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index ed61cd4..d79019c 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 _0x0c1a=['exports','BOOLEAN','star','TEXT','STRING','DATE','out','sequelize'];(function(_0x6c85cf,_0x1cc257){var _0x4fd865=function(_0x3a06f3){while(--_0x3a06f3){_0x6c85cf['push'](_0x6c85cf['shift']());}};_0x4fd865(++_0x1cc257);}(_0x0c1a,0x127));var _0xa0c1=function(_0x46b5f1,_0x2b463f){_0x46b5f1=_0x46b5f1-0x0;var _0x1ab245=_0x0c1a[_0x46b5f1];return _0x1ab245;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'closed':{'type':Sequelize[_0xa0c1('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xa0c1('0x3'),'thumb'),'defaultValue':_0xa0c1('0x3')},'ratingMessage':{'type':Sequelize[_0xa0c1('0x4')]},'pathTranscript':{'type':Sequelize[_0xa0c1('0x4')]},'mailTranscript':{'type':Sequelize[_0xa0c1('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa0c1('0x6')]},'disposition':{'type':Sequelize[_0xa0c1('0x5')]},'secondDisposition':{'type':Sequelize[_0xa0c1('0x5')]},'thirdDisposition':{'type':Sequelize[_0xa0c1('0x5')]},'note':{'type':Sequelize[_0xa0c1('0x5')]},'browserName':{'type':Sequelize[_0xa0c1('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xa0c1('0x5')]},'osVersion':{'type':Sequelize[_0xa0c1('0x5')]},'deviceModel':{'type':Sequelize[_0xa0c1('0x5')]},'deviceVendor':{'type':Sequelize[_0xa0c1('0x5')]},'deviceType':{'type':Sequelize[_0xa0c1('0x5')]},'referer':{'type':Sequelize[_0xa0c1('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa0c1('0x4')]('long')},'read1stAt':{'type':Sequelize[_0xa0c1('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa0c1('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa0c1('0x5')]},'customerPort':{'type':Sequelize[_0xa0c1('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa0c1('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2f68=['DATE','STRING','long','out','exports','BOOLEAN','INTEGER','ENUM','thumb','TEXT'];(function(_0x4d6675,_0x23beaa){var _0x2bd5bc=function(_0x573d07){while(--_0x573d07){_0x4d6675['push'](_0x4d6675['shift']());}};_0x2bd5bc(++_0x23beaa);}(_0x2f68,0x9a));var _0x82f6=function(_0x1d770b,_0x59ae9b){_0x1d770b=_0x1d770b-0x0;var _0x69b670=_0x2f68[_0x1d770b];return _0x69b670;};'use strict';var Sequelize=require('sequelize');module[_0x82f6('0x0')]={'closed':{'type':Sequelize[_0x82f6('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x82f6('0x2')]},'ratingType':{'type':Sequelize[_0x82f6('0x3')]('star',_0x82f6('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x82f6('0x5')]},'pathTranscript':{'type':Sequelize[_0x82f6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x82f6('0x6')]},'disposition':{'type':Sequelize[_0x82f6('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x82f6('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x82f6('0x7')]},'osVersion':{'type':Sequelize[_0x82f6('0x7')]},'deviceModel':{'type':Sequelize[_0x82f6('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x82f6('0x7')]},'referer':{'type':Sequelize[_0x82f6('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x82f6('0x5')](_0x82f6('0x8'))},'read1stAt':{'type':Sequelize[_0x82f6('0x6')]},'lastMsgAt':{'type':Sequelize[_0x82f6('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x82f6('0x3')]('in',_0x82f6('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x82f6('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x82f6('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c40a398..3884de7 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 _0x8603=['Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','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','mailTranscript','addMessage','ids','omit','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','Attachment','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','render','contact','agent','interaction','account','Users','fullname','Tags','TagIds','split','push','catch','index','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','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','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','forEach','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','customUpdate','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','mimetype','attachmentDownload'];(function(_0xaff2d9,_0x561d58){var _0x680eb9=function(_0x2ed898){while(--_0x2ed898){_0xaff2d9['push'](_0xaff2d9['shift']());}};_0x680eb9(++_0x561d58);}(_0x8603,0x190));var _0x3860=function(_0x294bd1,_0x24e0cb){_0x294bd1=_0x294bd1-0x0;var _0x55603d=_0x8603[_0x294bd1];return _0x55603d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3860('0x10'));var hardwareService=require(_0x3860('0x11'));var logger=require('../../config/logger')(_0x3860('0x12'));var utils=require(_0x3860('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3860('0x14'));var db=require(_0x3860('0x15'))['db'];config[_0x3860('0x16')]=_[_0x3860('0x17')](config[_0x3860('0x16')],{'host':_0x3860('0x18'),'port':0x18eb});var socket=require(_0x3860('0x19'))(new Redis(config[_0x3860('0x16')]));require(_0x3860('0x1a'))[_0x3860('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232b});var client9004=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1055b3,_0xfa0c9a,_0x2d8a3a,_0x378305){return new BPromise(function(_0x311fdb,_0x3c0d91){var _0x3e51b4=_0x378305||client;return _0x3e51b4[_0x3860('0x1e')](_0x1055b3,_0x2d8a3a)['then'](function(_0x4863bd){logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));logger['debug'](_0x3860('0x22'),_0xfa0c9a,_0x3860('0x21'),JSON[_0x3860('0x23')](_0x4863bd));if(_0x4863bd[_0x3860('0x24')]){if(_0x4863bd[_0x3860('0x24')][_0x3860('0x25')]===0x1f4){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);return _0x3c0d91(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')]['message']);return _0x311fdb(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}else{logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));_0x311fdb(_0x4863bd['result'][_0x3860('0x26')]);}})['catch'](function(_0x577750){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x577750);_0x3c0d91(_0x577750);});});}function respondWithStatusCode(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0xcc;return function(_0x5f42d5){if(_0x5f42d5){return _0x54b5ec[_0x3860('0x27')](_0x4d9a90);}return _0x54b5ec[_0x3860('0x28')](_0x4d9a90)[_0x3860('0x29')]();};}function respondWithResult(_0x371f3a,_0x9332a5){_0x9332a5=_0x9332a5||0xc8;return function(_0x228d34){if(_0x228d34){return _0x371f3a['status'](_0x9332a5)['json'](_0x228d34);}};}function respondWithFilteredResult(_0x389bd0,_0x1f1809){return function(_0x5a9af2){if(_0x5a9af2){var _0x2551f4=typeof _0x1f1809[_0x3860('0x2a')]===_0x3860('0x2b')&&typeof _0x1f1809[_0x3860('0x2c')]===_0x3860('0x2b');var _0x4bbae9=_0x5a9af2[_0x3860('0x2d')];var _0xf624ba=_0x2551f4?0x0:_0x1f1809[_0x3860('0x2a')];var _0x4bd90c=_0x2551f4?_0x5a9af2[_0x3860('0x2d')]:_0x1f1809['offset']+_0x1f1809[_0x3860('0x2c')];var _0x4825f0;if(_0x4bd90c>=_0x4bbae9){_0x4bd90c=_0x4bbae9;_0x4825f0=0xc8;}else{_0x4825f0=0xce;}_0x389bd0[_0x3860('0x28')](_0x4825f0);return _0x389bd0[_0x3860('0x2e')](_0x3860('0x2f'),_0xf624ba+'-'+_0x4bd90c+'/'+_0x4bbae9)['json'](_0x5a9af2);}return null;};}function patchUpdates(_0x39c751){return function(_0x451b0c){try{jsonpatch['apply'](_0x451b0c,_0x39c751,!![]);}catch(_0x1c94cc){return BPromise['reject'](_0x1c94cc);}return _0x451b0c[_0x3860('0x30')]();};}function saveUpdates(_0x3a577a,_0x35185c){return function(_0x2fc231){if(_0x2fc231){return _0x2fc231[_0x3860('0x31')](_0x3a577a)[_0x3860('0x32')](function(_0x1d3fd0){return _0x1d3fd0;});}return null;};}function removeEntity(_0x4d30bc,_0x1a48b6){return function(_0x396ccf){if(_0x396ccf){return _0x396ccf['destroy']()[_0x3860('0x32')](function(){_0x4d30bc[_0x3860('0x28')](0xcc)[_0x3860('0x29')]();});}};}function handleEntityNotFound(_0x5af661,_0x523cc1){return function(_0x285b1b){if(!_0x285b1b){_0x5af661[_0x3860('0x27')](0x194);}return _0x285b1b;};}function handleError(_0x3abf18,_0xa921ed){_0xa921ed=_0xa921ed||0x1f4;return function(_0x59271f){logger['error'](_0x59271f[_0x3860('0x33')]);if(_0x59271f[_0x3860('0x34')]){delete _0x59271f[_0x3860('0x34')];}_0x3abf18[_0x3860('0x28')](_0xa921ed)[_0x3860('0x35')](_0x59271f);};}function getMustacheRender(_0x4df2a9,_0x424424){return Mustache[_0x3860('0x36')](_0x4df2a9,_['merge'](_0x424424['body'],{'contact':_0x424424[_0x3860('0x37')],'message':_0x424424[_0x3860('0x26')],'agent':_0x424424[_0x3860('0x38')],'interaction':_0x424424[_0x3860('0x39')],'account':_0x424424[_0x3860('0x3a')]}))||'';}function getInteractionUsers(_0x592311,_0x28f04d){return new BPromise(function(_0x510aef,_0x112600){try{if(_0x28f04d[_0x592311['id']]){_0x592311[_0x3860('0x3b')]=_['map'](_0x28f04d[_0x592311['id']],function(_0x36d9bd){return{'id':_0x36d9bd['id'],'fullname':_0x36d9bd[_0x3860('0x3c')]};});}}catch(_0x4f3303){_0x112600(_0x4f3303);}_0x510aef(_0x592311);});}function getInteractionTags(_0x1ef9aa,_0xc7d34d){return new BPromise(function(_0x15bd2c,_0xf346e){try{if(_0x1ef9aa['TagIds']){_0x1ef9aa[_0x3860('0x3d')]=[];_0x1ef9aa[_0x3860('0x3e')][_0x3860('0x3f')](',')['forEach'](function(_0x3a87e5){_0x1ef9aa['Tags'][_0x3860('0x40')](_0xc7d34d[_0x3a87e5]);});}delete _0x1ef9aa[_0x3860('0x3e')];}catch(_0x405bfc){_0xf346e(_0x405bfc);}_0x15bd2c(_0x1ef9aa);});}function updateChatInteraction(_0x3f613f,_0x2220c8,_0x3f4216){return new BPromise(function(_0x4e0a44,_0xbbbf01){return getInteractionUsers(_0x3f613f,_0x3f4216)[_0x3860('0x32')](function(_0x5dc78f){return getInteractionTags(_0x5dc78f,_0x2220c8);})['then'](function(_0x2938d4){_0x4e0a44(_0x2938d4);})[_0x3860('0x41')](function(_0x4f2f53){_0xbbbf01(_0x4f2f53);});});}exports[_0x3860('0x42')]=function(_0x30d8eb,_0x4c6c23){var _0xa6791a={},_0x56a650={},_0x392dc3={'count':0x0,'rows':[]};var _0x37e5c3=_[_0x3860('0x43')](db[_0x3860('0x44')][_0x3860('0x45')],function(_0x15ebbd){return{'name':_0x15ebbd[_0x3860('0x46')],'type':_0x15ebbd[_0x3860('0x47')][_0x3860('0x48')]};});_0x56a650[_0x3860('0x49')]=_[_0x3860('0x43')](_0x37e5c3,'name');_0x56a650[_0x3860('0x4a')]=_['keys'](_0x30d8eb[_0x3860('0x4a')]);_0x56a650[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],_0x56a650[_0x3860('0x4a')]);_0xa6791a[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],qs['fields'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x4e')]));_0xa6791a[_0x3860('0x4d')]=_0xa6791a['attributes'][_0x3860('0x4f')]?_0xa6791a[_0x3860('0x4d')]:_0x56a650[_0x3860('0x49')];if(!_0x30d8eb[_0x3860('0x4a')]['hasOwnProperty']('nolimit')){_0xa6791a[_0x3860('0x2c')]=qs['limit'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x2c')]);_0xa6791a[_0x3860('0x2a')]=qs['offset'](_0x30d8eb[_0x3860('0x4a')]['offset']);}_0xa6791a[_0x3860('0x50')]=qs['sort'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x51')]);_0xa6791a[_0x3860('0x52')]=qs['filters'](_['pick'](_0x30d8eb[_0x3860('0x4a')],_0x56a650[_0x3860('0x4b')]),_0x37e5c3);var _0x478dd9=[];var _0x3910f5=squel['select']()[_0x3860('0x53')]('id')[_0x3860('0x53')](_0x3860('0x34'))[_0x3860('0x53')](_0x3860('0x54'))[_0x3860('0x55')](_0x3860('0x56'));var _0x5a9987=squel[_0x3860('0x57')]()[_0x3860('0x53')](_0x3860('0x58'))[_0x3860('0x53')](_0x3860('0x59'))[_0x3860('0x53')]('ui.ChatInteractionId')[_0x3860('0x55')](_0x3860('0x5a'),'ui')[_0x3860('0x5b')](_0x3860('0x5c'),'u',_0x3860('0x5d'));var _0x1e2b5d=squel[_0x3860('0x57')]()[_0x3860('0x55')]('chat_interactions','i')[_0x3860('0x5b')](_0x3860('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3860('0x5b')](_0x3860('0x5c'),'o',_0x3860('0x5f'))['left_join'](_0x3860('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3860('0x5b')](_0x3860('0x61'),'me',_0x3860('0x62'))[_0x3860('0x5b')](_0x3860('0x63'),'it',_0x3860('0x64'))[_0x3860('0x5b')](_0x3860('0x56'),'t',_0x3860('0x65'));var _0x151492=squel[_0x3860('0x66')]();var _0x2bac24=[];var _0x58147d=squel['expr']();var _0x5111e0;if(_0x30d8eb[_0x3860('0x4a')]['search']){_0x5111e0=as['parseSearch'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x67')]);var _0x2ff440=_0x5111e0[_0x3860('0x68')];for(var _0x3d6c17=0x0;_0x3d6c17<_0x5111e0[_0x3860('0x69')]['length'];_0x3d6c17++){var _0x49ec68=_0x5111e0['conditions'][_0x3d6c17];var _0x1d6c70='i';var _0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,['name',_0x49ec68[_0x3860('0x53')]]);if(!_0x1c1da4){switch(_0x49ec68['field']){case _0x3860('0x6b'):if(_0x49ec68[_0x3860('0x6c')]==0x1){_0x1e2b5d['having']('`'+_0x49ec68[_0x3860('0x53')]+_0x3860('0x6d'));}else{_0x1e2b5d[_0x3860('0x6e')]('`'+_0x49ec68[_0x3860('0x53')]+'`\x20>\x200');}break;case _0x3860('0x6f'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){if(_0x49ec68['value']['split']('\x20')[_0x3860('0x4f')]>0x1){_0x151492[_0x2ff440](_0x3860('0x72'),qs[_0x3860('0x73')](_0x49ec68[_0x3860('0x6c')]),null);}else{var _0x28a8b4='%'+_0x49ec68[_0x3860('0x6c')]+'%';_0x151492[_0x2ff440]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x28a8b4,_0x28a8b4,_0x28a8b4);}}else{_0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,[_0x3860('0x34'),'ContactId']);_0x49ec68[_0x3860('0x53')]=_0x3860('0x74');_0x3427a5=as[_0x3860('0x75')](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x77'):var _0x27e5ab=_0x49ec68[_0x3860('0x6c')][_0x3860('0x3f')](',')['map'](function(_0x1ae31b){return Number(_0x1ae31b);});_0x27e5ab[_0x3860('0x78')](function(_0x1c33dc){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c33dc+',%');});_0x2bac24=_['union'](_0x2bac24,_0x27e5ab);break;case _0x3860('0x79'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){_0x151492[_0x2ff440](_0x3860('0x7a'),'%'+_0x49ec68[_0x3860('0x6c')]+'%',null);}else{_0x1c1da4=_['find'](_0x37e5c3,['name',_0x3860('0x7b')]);_0x49ec68[_0x3860('0x53')]='UserId';_0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5['value'][_0x3860('0x7c')],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x7d'):_0x3427a5=as['buildExpression']('me',null,_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);break;}}else{var _0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5['text'],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);}}}else{var _0x49c356=_(_0x30d8eb[_0x3860('0x4a')])[_0x3860('0x7e')]()[_0x3860('0x43')](function(_0x2fd2f4){return _[_0x3860('0x7f')](_0x37e5c3,[_0x3860('0x34'),_0x2fd2f4])?_0x2fd2f4:undefined;})['compact']()[_0x3860('0x6c')]();if(!_[_0x3860('0x80')](_0x49c356)){_0x49c356[_0x3860('0x78')](function(_0x5d7cc4){if(_0x5d7cc4===_0x3860('0x81')){_0x1e2b5d['where'](_0x3860('0x82'),[][_0x3860('0x83')](_0x30d8eb['query'][_0x5d7cc4]));}else if(_0x5d7cc4===_0x3860('0x84')){var _0x2cd731=JSON[_0x3860('0x85')](_0x30d8eb['query'][_0x5d7cc4])['$gte'];var _0x5a282a=JSON['parse'](_0x30d8eb[_0x3860('0x4a')][_0x5d7cc4])[_0x3860('0x86')];_0x1e2b5d[_0x3860('0x52')](_0x3860('0x87'),_0x2cd731,_0x5a282a);}else{if(_0x30d8eb['query'][_0x5d7cc4]==='null'){_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x88'));}else{_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x89'),_0x30d8eb['query'][_0x5d7cc4]);}}});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8a')]){if(_0x30d8eb['query']['read']==0x1){_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8b'));}else{_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8c'));}}if(_0x30d8eb['query']['tag']){_0x2bac24=_[_0x3860('0x8d')](_0x30d8eb['query'][_0x3860('0x8e')])?_0x30d8eb[_0x3860('0x4a')]['tag']:new Array(_0x30d8eb['query']['tag']);_0x2bac24[_0x3860('0x78')](function(_0x36116e){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36116e+',%');});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]){var _0x2351fe=_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x3860('0x90')](/'/g,'\x27\x27');if(qs[_0x3860('0x91')](_0x2351fe)){_0x151492['or'](_0x3860('0x92'),_0x2351fe+'%');}else{_0x151492['or'](_0x3860('0x93'),qs[_0x3860('0x73')](_0x2351fe))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2351fe+'%');}}}_0x1e2b5d[_0x3860('0x52')](_0x151492);_0x1e2b5d[_0x3860('0x94')](_0x3860('0x95'));var _0x41ee6f={'type':db[_0x3860('0x96')]['QueryTypes']['SELECT'],'raw':!![]};var _0x196c50=_0x1e2b5d[_0x3860('0x97')]();_0x196c50[_0x3860('0x53')](_0x3860('0x95'));_0x196c50[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));if(_0xa6791a['order']){_0xa6791a[_0x3860('0x50')][_0x3860('0x78')](function(_0x58eddd){var _0x1ff95b=_0x58eddd[0x0]===_0x3860('0x99')?_0x58eddd[0x0]:'i.'+_0x58eddd[0x0];_0x1e2b5d[_0x3860('0x50')](_0x1ff95b,_0x58eddd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3860('0x80')](_0x2bac24)){_0x1e2b5d[_0x3860('0x6e')](_0x58147d);_0x196c50['where'](_0x3860('0x9a'),_0x2bac24);}BPromise['resolve']()[_0x3860('0x32')](function(){if(!_0x5111e0){if(_0x30d8eb[_0x3860('0x4a')]['ChatWebsiteId'])return;_0x196c50[_0x3860('0x52')](_0x3860('0x9b'));_0x1e2b5d[_0x3860('0x52')](_0x3860('0x9b'));return;}if(_0x30d8eb[_0x3860('0x9c')]['role']!==_0x3860('0x38'))return;return _0x30d8eb[_0x3860('0x9c')][_0x3860('0x9d')]({'attributes':['id'],'raw':!![]})[_0x3860('0x32')](function(_0x3c9837){if(_['isEmpty'](_0x3c9837)){_0x196c50['where'](_0x3860('0x9e'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x196c50[_0x3860('0x52')](_0x3860('0x82'),_[_0x3860('0x43')](_0x3c9837,'id'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3860('0x43')](_0x3c9837,'id'));}});})['then'](function(){if(_0x30d8eb[_0x3860('0x9c')][_0x3860('0x9f')]===_0x3860('0x38')&&!_0x5111e0&&!_0x30d8eb[_0x3860('0x4a')][_0x3860('0x81')])return[];return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x196c50['toString'](),_0x41ee6f);})[_0x3860('0x32')](function(_0x47396d){_0x392dc3['count']=_0x47396d['length'];if(_0x392dc3['count']===0x0)return[];return db['sequelize'][_0x3860('0x4a')](_0x3910f5[_0x3860('0xa1')](),_0x41ee6f)[_0x3860('0x32')](function(_0x1482cd){_0x478dd9=_[_0x3860('0xa2')](_0x1482cd,'id');_0x41ee6f=_[_0x3860('0xa3')](_0x41ee6f,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30d8eb[_0x3860('0x4a')]['fields']){_0xa6791a[_0x3860('0x4d')][_0x3860('0x78')](function(_0x897ea0){_0x1e2b5d[_0x3860('0x53')]('i.'+_0x897ea0);});}else{_0x1e2b5d[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa4'),_0x3860('0xa5'));_0x1e2b5d[_0x3860('0x53')]('a.mandatoryDisposition',_0x3860('0xa6'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa7'),'contactName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa8'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa9'),'Contact.firstName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaa'),_0x3860('0xab'));_0x1e2b5d['field'](_0x3860('0xac'),_0x3860('0xad'));_0x1e2b5d[_0x3860('0x53')]('c.phone',_0x3860('0xae'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaf'),'Contact.mobile');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xb0'),_0x3860('0xb1'));_0x1e2b5d['field'](_0x3860('0xb2'),_0x3860('0xb3'));_0x1e2b5d[_0x3860('0x53')]('o.internal',_0x3860('0xb4'));_0x1e2b5d['field'](_0x3860('0xb5'),'TagIds');}if(_0xa6791a[_0x3860('0x2c')])_0x1e2b5d[_0x3860('0x2c')](_0xa6791a[_0x3860('0x2c')]);if(_0xa6791a[_0x3860('0x2a')])_0x1e2b5d[_0x3860('0x2a')](_0xa6791a[_0x3860('0x2a')]);return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x1e2b5d[_0x3860('0xa1')](),_0x41ee6f);})[_0x3860('0x32')](function(_0x10b4e8){if(_0x10b4e8[_0x3860('0x4f')]>0x0)_0x5a9987[_0x3860('0x52')](_0x3860('0xb6'),_[_0x3860('0x43')](_0x10b4e8,'id'));return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x5a9987[_0x3860('0xa1')](),_0x41ee6f)['then'](function(_0x37575b){var _0x1d6d2b=_[_0x3860('0xb7')](_0x37575b,_0x3860('0xb8'));var _0x3e6bf8=[];_0x10b4e8[_0x3860('0x78')](function(_0xffe2a1){_0x3e6bf8[_0x3860('0x40')](updateChatInteraction(_0xffe2a1,_0x478dd9,_0x1d6d2b));});return BPromise[_0x3860('0xb9')](_0x3e6bf8);});});})[_0x3860('0x32')](function(_0x3b932d){_0x392dc3['rows']=_0x3b932d;return _0x392dc3;})[_0x3860('0x32')](respondWithFilteredResult(_0x4c6c23,_0xa6791a))[_0x3860('0x41')](handleError(_0x4c6c23,null));};exports[_0x3860('0xba')]=function(_0x6334ca,_0x4a929e){var _0x1a1994={'raw':![],'where':{'id':_0x6334ca[_0x3860('0xbb')]['id']}},_0x2ece36={};_0x2ece36[_0x3860('0x49')]=_['keys'](db[_0x3860('0x44')]['rawAttributes']);_0x2ece36['query']=_[_0x3860('0x7e')](_0x6334ca[_0x3860('0x4a')]);_0x2ece36[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],_0x2ece36[_0x3860('0x4a')]);_0x1a1994[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x6334ca[_0x3860('0x4a')][_0x3860('0x4e')]));_0x1a1994[_0x3860('0x4d')]=_0x1a1994['attributes'][_0x3860('0x4f')]?_0x1a1994['attributes']:_0x2ece36[_0x3860('0x49')];if(_0x6334ca[_0x3860('0x4a')]['includeAll']){_0x1a1994[_0x3860('0xbc')]=[{'all':!![]}];}_0x1a1994=_[_0x3860('0xa3')]({},_0x1a1994,_0x6334ca[_0x3860('0xbd')]);return db[_0x3860('0x44')][_0x3860('0x6a')](_0x1a1994)[_0x3860('0x32')](handleEntityNotFound(_0x4a929e,null))[_0x3860('0x32')](respondWithResult(_0x4a929e,null))['catch'](handleError(_0x4a929e,null));};exports[_0x3860('0xbe')]=function(_0x6d1819,_0x9e1682){return db[_0x3860('0x44')][_0x3860('0xbe')](_0x6d1819['body'],{})[_0x3860('0x32')](respondWithResult(_0x9e1682,0xc9))['catch'](handleError(_0x9e1682,null));};exports['update']=function(_0x56af8c,_0x1059a4){if(_0x56af8c[_0x3860('0x7d')]['id']){delete _0x56af8c[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x56af8c[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x1059a4,null))[_0x3860('0x32')](saveUpdates(_0x56af8c['body'],null))[_0x3860('0x32')](respondWithResult(_0x1059a4,null))[_0x3860('0x41')](handleError(_0x1059a4,null));};exports['destroy']=function(_0x490884,_0x4428eb){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x490884['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4428eb,null))['then'](removeEntity(_0x4428eb,null))[_0x3860('0x41')](handleError(_0x4428eb,null));};exports['describe']=function(_0x41fd53,_0xf91fc2){return db['ChatInteraction'][_0x3860('0xbf')]()[_0x3860('0x32')](respondWithResult(_0xf91fc2,null))['catch'](handleError(_0xf91fc2,null));};exports[_0x3860('0xc0')]=function(_0x398bc1,_0x3312c4){var _0x501519=_0x398bc1[_0x3860('0xbb')]['id'];var _0x47fba5;var _0x3e3dac;var _0x18b845;return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x501519}})[_0x3860('0x32')](function(_0x2b1dc1){_0x47fba5=_0x2b1dc1;return db[_0x3860('0xc2')][_0x3860('0xc1')]({'where':{'id':_0x2b1dc1['ChatWebsiteId']},'attributes':['id',_0x3860('0xc3'),_0x3860('0xc4'),'vidaooTopic','vidaooNote',_0x3860('0xc5')],'raw':!![]});})['then'](function(_0xe27f6b){if(_0xe27f6b&&_0xe27f6b[_0x3860('0xc3')]&&_0xe27f6b['vidaooEscalation']){_0x3e3dac=_0xe27f6b;var _0x1041bf={'interaction':{'id':_0x501519},'agent':{'id':_0x398bc1['user']['id'],'name':_0x398bc1[_0x3860('0x9c')]['name'],'fullname':_0x398bc1[_0x3860('0x9c')][_0x3860('0x3c')],'email':_0x398bc1[_0x3860('0x9c')][_0x3860('0xc6')]},'contact':_0x398bc1['body'][_0x3860('0x37')],'account':_0x398bc1[_0x3860('0x7d')][_0x3860('0x3a')]};var _0x1e1baf={'rejectUnauthorized':![],'method':'POST','url':_0x3860('0xc7'),'headers':{'X-APIKEY':_0xe27f6b[_0x3860('0xc3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x398bc1['user'][_0x3860('0xc6')]],'buttons':null,'topic':_0x3e3dac[_0x3860('0xc8')],'note':_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xca')])?null:getMustacheRender(_0x3e3dac['vidaooNote'],_0x1041bf),'metadata':null},'redirect':_0x3860('0xcb'),'json':!![]};try{if(!_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xc5')])){var _0x1ce6e6=getMustacheRender(_0x3e3dac['vidaooMetadata'],_0x1041bf);var _0x1df44=JSON['parse'](_0x1ce6e6);_0x1e1baf['body']['metadata']=_0x1df44;}}catch(_0x15b53f){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1e1baf);}else{throw new db[(_0x3860('0x96'))]['ValidationError'](_0x3860('0xcd'));}})[_0x3860('0x32')](function(_0x21c052){_0x18b845=_0x21c052;if(_0x18b845['id']){var _0x3a920b={'body':_0x18b845['join_url'],'ChatWebsiteId':_0x3e3dac['id'],'ChatInteractionId':_0x47fba5['id'],'direction':_0x3860('0xce'),'UserId':_0x398bc1[_0x3860('0x9c')]['id']};return db[_0x3860('0xcf')]['create'](_0x3a920b,{});}else{throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x47fba5['updateAttributes']({'vidaooSessionId':_0x18b845['id']});})['then'](respondWithResult(_0x3312c4,null))[_0x3860('0x41')](handleError(_0x3312c4,null));};exports[_0x3860('0xd0')]=function(_0x2a09a2,_0x266347){if(_0x2a09a2[_0x3860('0x7d')]['id']){delete _0x2a09a2[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')]['find']({'where':{'id':_0x2a09a2['params']['id']},'include':[{'model':db['CmContact'],'as':_0x3860('0x6f')}]})[_0x3860('0x32')](handleEntityNotFound(_0x266347,null))[_0x3860('0x32')](saveUpdates(_0x2a09a2['body'],null))[_0x3860('0x32')](respondWithResult(_0x266347,null))['catch'](handleError(_0x266347,null));};exports['abandon']=function(_0x5f0700,_0x46f630,_0x505ba2){if(_0x5f0700['body']['id']){delete _0x5f0700[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x5f0700[_0x3860('0xbb')]['id']}})['then'](function(_0x53392b){if(!_0x53392b){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3860('0xd1'),0x194,'entity\x20not\x20found');_0x46f630['sendStatus'](0x194);}else{if(_0x53392b[_0x3860('0x7b')]){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))](_0x3860('0xd2'));}}return _0x53392b;})['then'](function(_0x6e541d){if(_0x6e541d){return _0x6e541d[_0x3860('0x31')]({'closed':_0x5f0700[_0x3860('0x7d')][_0x3860('0xd3')],'disposition':_0x5f0700['body']['disposition']})[_0x3860('0x32')](function(_0x55c19c){return _0x55c19c;});}})[_0x3860('0x32')](function(_0x4ab85d){return respondWithRpcPromise(_0x3860('0xd4'),_0x3860('0xd1'),_0x5f0700[_0x3860('0x7d')],client9004);})[_0x3860('0x32')](respondWithResult(_0x46f630,null))[_0x3860('0x41')](handleError(_0x46f630,null));};exports['attachmentUpload']=function(_0x5d3c4d,_0x5e3c54,_0x39e855){_0x5d3c4d[_0x3860('0x7d')][_0x3860('0x34')]=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd6')];_0x5d3c4d['body'][_0x3860('0xd7')]=_0x5d3c4d[_0x3860('0xd5')]['filename'];_0x5d3c4d[_0x3860('0x7d')]['type']=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd8')];return db['Attachment'][_0x3860('0xbe')](_0x5d3c4d[_0x3860('0x7d')])[_0x3860('0x32')](respondWithResult(_0x5e3c54,0xc9))[_0x3860('0x41')](handleError(_0x5e3c54,null));};exports[_0x3860('0xd9')]=function(_0x3e2dfc,_0x135e84,_0x199bbc){return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc[_0x3860('0xbb')]['id']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null))['then'](function(_0x369a4b){if(_0x369a4b){if(_0x369a4b['closed']){return _0x135e84[_0x3860('0x28')](0x193)['json']({'status':0x193,'message':_0x3860('0xda')});}return db['Attachment'][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc['query']['attachId']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null));}})[_0x3860('0x32')](function(_0xa152b4){if(_0xa152b4){var _0x28931d=_0xa152b4[_0x3860('0xdb')]!==null;var _0x5e65a2=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xde'));if(_0x28931d){_0x5e65a2=path[_0x3860('0xdc')](_0x5e65a2,_0x3860('0xdf'));}var _0x268658=path['join'](_0x5e65a2,_0xa152b4[_0x3860('0xd7')]);return _0x135e84['download'](_0x268658);}})[_0x3860('0x41')](handleError(_0x135e84,null));};exports[_0x3860('0xe0')]=function(_0x118c4e,_0x471da9){var _0x244ceb=null;var _0x24f8a6=null;var _0x532349=null;var _0x17fa12=null;if(_0x118c4e[_0x3860('0x7d')]['id']){delete _0x118c4e[_0x3860('0x7d')]['id'];}if(_0x118c4e[_0x3860('0x7d')]['mailTranscript']){_0x17fa12=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xe1'),util[_0x3860('0xe2')](_0x3860('0xe3'),Date[_0x3860('0xe4')]()));_0x118c4e['body'][_0x3860('0xe5')]=_0x17fa12;}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x118c4e[_0x3860('0xbb')]['id']},'include':[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x471da9,null))[_0x3860('0x32')](saveUpdates(_0x118c4e[_0x3860('0x7d')],null))['then'](function(_0x276828){if(_0x276828){_0x244ceb=_0x276828;return db[_0x3860('0xc2')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x81')]}});}})[_0x3860('0x32')](function(_0x1740d0){if(_0x1740d0){_0x532349=_0x1740d0;return db[_0x3860('0xe7')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x74')]}});}})[_0x3860('0x32')](function(_0x975c7f){if(_0x975c7f){_0x24f8a6=_0x975c7f;if(_0x17fa12){var _0x23207b=null;for(var _0x1a1366=0x1;_0x1a1366<_0x244ceb[_0x3860('0xe6')][_0x3860('0x4f')];++_0x1a1366){_0x23207b=_0x244ceb['Messages'][_0x1a1366];var _0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');var _0x1290e7=_0x118c4e[_0x3860('0x7d')]['customer']||util[_0x3860('0xe2')](_0x3860('0xe8'),_0x3860('0xeb'),_0x23207b['ContactId']);switch(_0x532349[_0x3860('0xec')]){case _0x3860('0xed'):_0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');break;case _0x3860('0xee'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0xef')]||_0x23207b['User'][_0x3860('0x3c')]:_0x3860('0xea');break;case _0x3860('0xf0'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0x3c')]:_0x3860('0xea');break;default:_0x56566c=_0x23207b[_0x3860('0x7b')]?util['format']('%s%d',_0x532349[_0x3860('0xe9')],_0x23207b['UserId']):_0x3860('0xea');}var _0x15314d=util[_0x3860('0xe2')](_0x3860('0xf1'),moment(_0x23207b[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0xf2')),_0x23207b[_0x3860('0xf3')]==='in'?_0x1290e7:_0x56566c,_0x23207b['body']);if(!_0x23207b[_0x3860('0xf4')]){fs[_0x3860('0xf5')](_0x17fa12,_0x15314d);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3860('0xf6')],'as':'Smtp','raw':!![]}]});}}})[_0x3860('0x32')](function(_0x2bf644){if(_0x2bf644&&_0x2bf644[_0x3860('0xf7')]&&_0x118c4e[_0x3860('0x7d')]){var _0xd95981={'tls':{'rejectUnauthorized':![]}};if(_0x2bf644[_0x3860('0xf7')][_0x3860('0xf8')]){_0xd95981[_0x3860('0xf8')]=_0x2bf644['Smtp']['service'];}else{_0xd95981[_0x3860('0xf9')]=_0x2bf644['Smtp'][_0x3860('0xf9')];_0xd95981[_0x3860('0xfa')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfa')];_0xd95981[_0x3860('0xfb')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfb')];}if(_0x2bf644['Smtp']['authentication']){_0xd95981[_0x3860('0xfc')]={'user':_0x2bf644[_0x3860('0xf7')][_0x3860('0x9c')],'pass':_0x2bf644['Smtp'][_0x3860('0xfd')]};}return respondWithRpcPromise(_0x3860('0xfe'),_0x3860('0xff'),{'account':_0xd95981,'message':{'from':util['format'](_0x3860('0x100'),_0x2bf644[_0x3860('0x34')],_0x2bf644['email']||_0x2bf644['Smtp']['user']),'to':_0x118c4e['body']['mailTranscript'],'subject':_0x3860('0x101'),'text':util[_0x3860('0xe2')](_0x3860('0x102'),_0x118c4e[_0x3860('0x7d')][_0x3860('0x103')]),'attachments':[{'path':_0x17fa12}]}})['then'](function(){return _0x244ceb;})[_0x3860('0x41')](function(_0x5235e){console['error'](_0x5235e);});}else{return _0x244ceb;}})[_0x3860('0x32')](respondWithStatusCode(_0x471da9,0xc8))[_0x3860('0x41')](handleError(_0x471da9,null));};exports[_0x3860('0x104')]=function(_0x38cdf1,_0x4ab7b2,_0x4c8a10){return db['ChatMessage'][_0x3860('0x6a')]({'where':{'id':_0x38cdf1['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4ab7b2,null))[_0x3860('0x32')](function(_0x2adf67){if(_0x2adf67){return _0x2adf67[_0x3860('0x104')](_0x38cdf1[_0x3860('0x7d')][_0x3860('0x105')],_[_0x3860('0x106')](_0x38cdf1[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{});}})[_0x3860('0x32')](respondWithResult(_0x4ab7b2,null))[_0x3860('0x41')](handleError(_0x4ab7b2,null));};exports[_0x3860('0x107')]=function(_0x173790,_0x20d0d2,_0x8d3ad7){var _0xf1e9ab={'raw':![],'where':{}};var _0xcf350b={};var _0x1348e0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x173790['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x20d0d2,null))[_0x3860('0x32')](function(_0x11d0ab){if(_0x11d0ab){_0xcf350b[_0x3860('0x49')]=_[_0x3860('0x7e')](db[_0x3860('0xcf')][_0x3860('0x45')]);_0xcf350b[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x173790['query']);_0xcf350b[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],_0xcf350b[_0x3860('0x4a')]);_0xf1e9ab[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],qs['fields'](_0x173790[_0x3860('0x4a')][_0x3860('0x4e')]));_0xf1e9ab[_0x3860('0x4d')]=_0xf1e9ab['attributes'][_0x3860('0x4f')]?_0xf1e9ab[_0x3860('0x4d')]:_0xcf350b[_0x3860('0x49')];if(!_0x173790['query']['hasOwnProperty'](_0x3860('0x108'))){_0xf1e9ab[_0x3860('0x2c')]=qs['limit'](_0x173790[_0x3860('0x4a')]['limit']);_0xf1e9ab[_0x3860('0x2a')]=qs[_0x3860('0x2a')](_0x173790['query'][_0x3860('0x2a')]);}_0xf1e9ab['order']=qs[_0x3860('0x51')](_0x173790[_0x3860('0x4a')][_0x3860('0x51')]);_0xf1e9ab[_0x3860('0x52')]=qs[_0x3860('0x4b')](_[_0x3860('0x109')](_0x173790[_0x3860('0x4a')],_0xcf350b['filters']));_0xf1e9ab[_0x3860('0x52')]['ChatInteractionId']=_0x11d0ab['id'];if(_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]){_0xf1e9ab['where']=_['merge'](_0xf1e9ab[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0xf1e9ab[_0x3860('0x4d')],function(_0x234f93){var _0x5ed001={};_0x5ed001[_0x234f93]={'$like':'%'+_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]+'%'};return _0x5ed001;})});}if(_0x173790[_0x3860('0x4a')]['$gte']){var _0x1ac962=_0x173790[_0x3860('0x4a')]['$gte'][_0x3860('0x3f')](',');var _0x35dbfe={};_0x35dbfe[_0x1ac962[0x0]]={'$gte':moment(_0x1ac962[0x1])[_0x3860('0xe2')](_0x3860('0x10a'))};_0xf1e9ab[_0x3860('0x52')]=_[_0x3860('0xa3')](_0xf1e9ab[_0x3860('0x52')],_0x35dbfe);}_0xf1e9ab=_['merge']({},_0xf1e9ab,_0x173790[_0x3860('0xbd')]);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0xf1e9ab[_0x3860('0x52')]})[_0x3860('0x32')](function(_0x54ebd7){_0x1348e0[_0x3860('0x2d')]=_0x54ebd7;if(_0x173790[_0x3860('0x4a')][_0x3860('0x10b')]){_0xf1e9ab[_0x3860('0xbc')]=[{'all':!![]}];}return db[_0x3860('0xcf')][_0x3860('0x10c')](_0xf1e9ab);})['then'](function(_0x16457e){_0x1348e0[_0x3860('0x10d')]=_0x16457e;return _0x1348e0;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x20d0d2,_0xf1e9ab))[_0x3860('0x41')](handleError(_0x20d0d2,null));};exports[_0x3860('0x10e')]=function(_0x2b6605,_0x11409b,_0x187e3b){var _0x4fb4f3={'where':{}},_0x21b179={},_0x28b7a2={'count':0x0,'rows':[]};return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x2b6605[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x11409b,null))[_0x3860('0x32')](function(_0x2ca2e7){if(_0x2ca2e7){_0x21b179[_0x3860('0x49')]=_['keys'](db[_0x3860('0xcf')][_0x3860('0x45')]);_0x21b179[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x2b6605[_0x3860('0x4a')]);_0x21b179[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],_0x21b179[_0x3860('0x4a')]);_0x4fb4f3[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x4e')]));_0x4fb4f3['attributes']=_0x4fb4f3[_0x3860('0x4d')][_0x3860('0x4f')]?_0x4fb4f3[_0x3860('0x4d')]:_0x21b179[_0x3860('0x49')];if(!_0x2b6605[_0x3860('0x4a')][_0x3860('0x10f')](_0x3860('0x108'))){_0x4fb4f3[_0x3860('0x2c')]=qs[_0x3860('0x2c')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x2c')]);_0x4fb4f3[_0x3860('0x2a')]=qs['offset'](_0x2b6605[_0x3860('0x4a')]['offset']);}_0x4fb4f3[_0x3860('0x50')]=qs['sort'](_0x2b6605[_0x3860('0x4a')]['sort']);_0x4fb4f3[_0x3860('0x52')]=qs[_0x3860('0x4b')](_['pick'](_0x2b6605[_0x3860('0x4a')],_0x21b179[_0x3860('0x4b')]));_0x4fb4f3[_0x3860('0x52')][_0x3860('0xb8')]=_0x2ca2e7['id'];if(_0x2b6605[_0x3860('0x4a')]['filter']){_0x4fb4f3['where']=_[_0x3860('0xa3')](_0x4fb4f3[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0x4fb4f3[_0x3860('0x4d')],function(_0x31a537){var _0x438121={};_0x438121[_0x31a537]={'$like':'%'+_0x2b6605[_0x3860('0x4a')]['filter']+'%'};return _0x438121;})});}_0x4fb4f3[_0x3860('0x52')]['secret']=![];if(_0x2b6605[_0x3860('0x4a')]['id']){_0x4fb4f3[_0x3860('0x52')]['id']={'$gt':_0x2b6605[_0x3860('0x4a')]['id']};}_0x4fb4f3=_[_0x3860('0xa3')]({},_0x4fb4f3,_0x2b6605['options']);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0x4fb4f3['where']})[_0x3860('0x32')](function(_0x4d4366){_0x28b7a2[_0x3860('0x2d')]=_0x4d4366;_0x4fb4f3[_0x3860('0xbc')]=[];if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x110')]){_0x4fb4f3[_0x3860('0xbc')][_0x3860('0x40')]({'model':db[_0x3860('0x79')],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c'),'alias']});}if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x10b')]){_0x4fb4f3[_0x3860('0xbc')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4fb4f3);})['then'](function(_0x39c52e){_0x28b7a2[_0x3860('0x10d')]=_0x39c52e;return _0x28b7a2;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x11409b,_0x4fb4f3))[_0x3860('0x41')](handleError(_0x11409b,null));};exports[_0x3860('0x111')]=function(_0x185040,_0x14cef9,_0x5e1ed4){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x185040[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x14cef9,null))['then'](function(_0xbc013a){if(_0xbc013a){return _0xbc013a[_0x3860('0x112')](_0x185040['body'][_0x3860('0x105')],_[_0x3860('0x106')](_0x185040[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{})[_0x3860('0x113')](function(){return db[_0x3860('0x77')][_0x3860('0x10c')]({'attributes':['id',_0x3860('0x34'),_0x3860('0x54')],'where':{'id':_0x185040[_0x3860('0x7d')][_0x3860('0x105')]}});})[_0x3860('0x32')](function(_0x57f603){socket['emit'](_0x3860('0x114'),{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]});return{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]};});}})[_0x3860('0x32')](respondWithResult(_0x14cef9,null))[_0x3860('0x41')](handleError(_0x14cef9,null));};exports[_0x3860('0x115')]=function(_0x2e2ff3,_0x27c591,_0x8b9a7a){return db['ChatInteraction'][_0x3860('0x6a')]({'where':{'id':_0x2e2ff3[_0x3860('0xbb')]['id']}})['then'](handleEntityNotFound(_0x27c591,null))[_0x3860('0x32')](function(_0x5ecd57){if(_0x5ecd57){return _0x5ecd57['removeTags'](_0x2e2ff3['query'][_0x3860('0x105')]);}})[_0x3860('0x32')](respondWithStatusCode(_0x27c591,null))[_0x3860('0x41')](handleError(_0x27c591,null));};exports[_0x3860('0x116')]=function(_0x39524a,_0xa0492b){var _0x4d44de=moment()[_0x3860('0x117')]()[_0x3860('0xa1')]();var _0x1dcd01=path['join'](config[_0x3860('0xdd')],_0x3860('0x118'),_0x3860('0x119'),'tmp');var _0x198422=path['join'](config[_0x3860('0xdd')],'server',_0x3860('0x119'),_0x3860('0x11a'));var _0x1a97c1=path[_0x3860('0xdc')](_0x1dcd01,_0x4d44de);var _0x4cc748=util[_0x3860('0xe2')]('transcript-%d-%s.zip',_0x39524a[_0x3860('0xbb')]['id'],_0x4d44de);var _0x18fd61=path['join'](_0x1dcd01,_0x4cc748);var _0x39eb63=[];_0x39eb63[_0x3860('0x40')]({'model':db['User'],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c')],'raw':!![]});_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0xe7')],'as':_0x3860('0x6f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x39524a[_0x3860('0x4a')]['attachments']){_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0x11b')],'as':'Attachment','raw':!![]});}var _0x134dfd=[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'attributes':['id','body',_0x3860('0x84'),'direction','secret','read'],'include':_0x39eb63}];_0x134dfd['push']({'model':db['ChatWebsite'],'as':_0x3860('0x11c'),'attributes':['id',_0x3860('0x34')]});_0x134dfd['push']({'model':db[_0x3860('0x79')],'as':_0x3860('0x11d'),'attributes':['id',_0x3860('0x3c')]});return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x39524a[_0x3860('0xbb')]['id']},'include':_0x134dfd})[_0x3860('0x32')](handleEntityNotFound(_0xa0492b,null))['then'](function(_0x2fe51b){if(_0x2fe51b){var _0x51bf5a=_0x2fe51b['get']({'plain':!![]});fs[_0x3860('0x11e')](_0x1a97c1);var _0x33abf1={'channel':_0x3860('0x11f'),'account':_0x51bf5a[_0x3860('0x11c')][_0x3860('0x34')],'agent':_0x51bf5a['Owner']?_0x51bf5a[_0x3860('0x11d')]['fullname']:_0x3860('0x120'),'createdAt':moment(_0x51bf5a['createdAt'])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'closedAt':_0x51bf5a[_0x3860('0xd3')]?moment(_0x51bf5a[_0x3860('0x121')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')]():'','disposition':_0x51bf5a[_0x3860('0x122')],'chatInfo':{'browser':_0x51bf5a['browserName'],'os':_0x51bf5a[_0x3860('0x123')],'referer':_0x51bf5a[_0x3860('0x124')],'customerIp':_0x51bf5a[_0x3860('0x125')],'customerPort':_0x51bf5a[_0x3860('0x126')]?_0x51bf5a[_0x3860('0x126')]:'N.A.'},'messages':_(_0x51bf5a[_0x3860('0xe6')])[_0x3860('0x127')]()['filter']({'secret':![]})['map'](function(_0x5b23d2){if(_0x5b23d2[_0x3860('0x11b')]){var _0x409781=path[_0x3860('0xdc')](_0x198422,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')]);if(fs[_0x3860('0x128')](_0x409781)){fs[_0x3860('0x129')](_0x409781)[_0x3860('0x12a')](fs[_0x3860('0x12b')](path[_0x3860('0xdc')](_0x1a97c1,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')])));}}return{'date':moment(_0x5b23d2[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'sender':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?_0x5b23d2[_0x3860('0x79')]?_0x5b23d2['User'][_0x3860('0x3c')]:_0x3860('0xea'):_0x5b23d2[_0x3860('0x6f')]['firstName']+(_0x5b23d2[_0x3860('0x6f')][_0x3860('0x12c')]?'\x20'+_0x5b23d2['Contact'][_0x3860('0x12c')]:''),'body':_0x5b23d2['Attachment']?_0x5b23d2['Attachment'][_0x3860('0xd7')]:_0x5b23d2[_0x3860('0x7d')],'direction':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?'A':'C','secret':_0x5b23d2[_0x3860('0xf4')],'read':_0x5b23d2[_0x3860('0x8a')],'attachment':_0x5b23d2['Attachment']};})[_0x3860('0x6c')]()};return ejs[_0x3860('0x12d')](path[_0x3860('0xdc')](config['root'],_0x3860('0x118'),_0x3860('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x33abf1})[_0x3860('0x32')](function(_0x5c5755){var _0x5dfb3b=path[_0x3860('0xdc')](_0x1a97c1,_0x3860('0x12f')+_0x51bf5a['id']+'-'+_0x4d44de+_0x3860('0x130'));var _0x1eba76={'path':_0x5dfb3b,'channel':'Chat','interactionId':_0x51bf5a['id']};return pdf[_0x3860('0x131')](_0x5c5755,_0x1eba76);})['then'](function(){return new BPromise(function(_0x34ad82,_0x44ac65){zipdir(_0x1a97c1,{'saveTo':_0x18fd61},function(_0x43cc98,_0xd9ff70){if(_0x43cc98)return _0x44ac65(_0x43cc98);return _0x34ad82(_0xd9ff70);});})['then'](function(){return new BPromise(function(_0x52e611,_0x4ccefa){rimraf(_0x1a97c1,function(_0x2c90b){if(_0x2c90b)_0x4ccefa(_0x2c90b);return _0x52e611();});});})[_0x3860('0x32')](function(){return _0xa0492b[_0x3860('0x116')](_0x18fd61,_0x4cc748,function(_0x3046f4){if(_0x3046f4){console[_0x3860('0x132')](_0x3860('0x133'),_0x3046f4);}else{fs[_0x3860('0x134')](_0x18fd61);}});});});}else{return _0xa0492b['sendStatus'](0xc8);}})[_0x3860('0x41')](handleError(_0xa0492b,null));};
\ No newline at end of file
+var _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','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','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x2eb318,_0xa45186){var _0x3ff206=function(_0x5861e6){while(--_0x5861e6){_0x2eb318['push'](_0x2eb318['shift']());}};_0x3ff206(++_0xa45186);}(_0xea28,0x13a));var _0x8ea2=function(_0x1991a2,_0xd4a778){_0x1991a2=_0x1991a2-0x0;var _0x307dde=_0xea28[_0x1991a2];return _0x307dde;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 38de980..8bb45e7 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 _0xebf5=['update','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x582d37,_0xc34a90){var _0x4aa6b6=function(_0x47224a){while(--_0x47224a){_0x582d37['push'](_0x582d37['shift']());}};_0x4aa6b6(++_0xc34a90);}(_0xebf5,0xe9));var _0x5ebf=function(_0x5d2d25,_0x432a4c){_0x5d2d25=_0x5d2d25-0x0;var _0x39b068=_0xebf5[_0x5d2d25];return _0x39b068;};'use strict';var EventEmitter=require(_0x5ebf('0x0'));var ChatInteraction=require(_0x5ebf('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x5ebf('0x1'))['db'][_0x5ebf('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5ebf('0x3')](0x0);var events={'afterCreate':_0x5ebf('0x4'),'afterUpdate':_0x5ebf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36d45f){return function(_0x64e13b,_0x48b318,_0x31ff1b){_0x64e13b['getUsers']({'attributes':['id'],'raw':!![]})[_0x5ebf('0x6')](function(_0x321a50){_0x64e13b[_0x5ebf('0x7')](_0x5ebf('0x8'),_0x321a50[_0x5ebf('0x9')](function(_0x3bb40c){return{'id':_0x3bb40c['id']};}));return ChatMessage[_0x5ebf('0xa')]({'where':{'ChatInteractionId':_0x64e13b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x157c32){_0x64e13b[_0x5ebf('0x7')]('unreadMessages',_0x157c32[_0x5ebf('0xb')]);ChatInteractionEvents[_0x5ebf('0xc')](_0x36d45f+':'+_0x64e13b['id'],_0x64e13b);ChatInteractionEvents['emit'](_0x36d45f,_0x64e13b);_0x31ff1b(null);})[_0x5ebf('0xd')](_0x31ff1b(null));};}for(var e in events){if(events[_0x5ebf('0xe')](e)){var event=events[e];ChatInteraction[_0x5ebf('0xf')](e,emitEvent(event));}}module[_0x5ebf('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc813=['setMaxListeners','save','update','remove','then','setDataValue','map','findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x5cb96c,_0xddb4e9){var _0xb1ea47=function(_0x315896){while(--_0x315896){_0x5cb96c['push'](_0x5cb96c['shift']());}};_0xb1ea47(++_0xddb4e9);}(_0xc813,0x1bd));var _0x3c81=function(_0x30584f,_0x4a1f96){_0x30584f=_0x30584f-0x0;var _0x2a31e1=_0xc813[_0x30584f];return _0x2a31e1;};'use strict';var EventEmitter=require(_0x3c81('0x0'));var ChatInteraction=require(_0x3c81('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x3c81('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3c81('0x3')](0x0);var events={'afterCreate':_0x3c81('0x4'),'afterUpdate':_0x3c81('0x5'),'afterDestroy':_0x3c81('0x6')};function emitEvent(_0x39f5c6){return function(_0xc68dca,_0x2dfcbb,_0x8897b4){_0xc68dca['getUsers']({'attributes':['id'],'raw':!![]})[_0x3c81('0x7')](function(_0x28f3f6){_0xc68dca[_0x3c81('0x8')]('Users',_0x28f3f6[_0x3c81('0x9')](function(_0x4ed889){return{'id':_0x4ed889['id']};}));return ChatMessage[_0x3c81('0xa')]({'where':{'ChatInteractionId':_0xc68dca['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c81('0x7')](function(_0x1bad34){_0xc68dca['setDataValue']('unreadMessages',_0x1bad34[_0x3c81('0xb')]);ChatInteractionEvents[_0x3c81('0xc')](_0x39f5c6+':'+_0xc68dca['id'],_0xc68dca);ChatInteractionEvents['emit'](_0x39f5c6,_0xc68dca);_0x8897b4(null);})['catch'](_0x8897b4(null));};}for(var e in events){if(events[_0x3c81('0xd')](e)){var event=events[e];ChatInteraction[_0x3c81('0xe')](e,emitEvent(event));}}module[_0x3c81('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c648314..a4e58ed 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 _0x1fd0=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2b8b2a,_0x938d0f){var _0x2ab9ad=function(_0x19e14f){while(--_0x19e14f){_0x2b8b2a['push'](_0x2b8b2a['shift']());}};_0x2ab9ad(++_0x938d0f);}(_0x1fd0,0xfe));var _0x01fd=function(_0x4271c2,_0x42df11){_0x4271c2=_0x4271c2-0x0;var _0xe769df=_0x1fd0[_0x4271c2];return _0xe769df;};'use strict';var _=require(_0x01fd('0x0'));var util=require(_0x01fd('0x1'));var logger=require(_0x01fd('0x2'))(_0x01fd('0x3'));var moment=require(_0x01fd('0x4'));var BPromise=require(_0x01fd('0x5'));var rp=require(_0x01fd('0x6'));var fs=require('fs');var path=require(_0x01fd('0x7'));var rimraf=require(_0x01fd('0x8'));var config=require(_0x01fd('0x9'));var attributes=require(_0x01fd('0xa'));module[_0x01fd('0xb')]=function(_0x5650c4,_0x280d15){return _0x5650c4[_0x01fd('0xc')](_0x01fd('0xd'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x117d75,_0x1d6a97,_0x5d6593){if(_0x117d75[_0x01fd('0xe')](_0x01fd('0xf'))){_0x117d75['closedAt']=moment()[_0x01fd('0x10')](_0x01fd('0x11'));}_0x5d6593(null,_0x117d75);}},'charset':_0x01fd('0x12'),'collate':_0x01fd('0x13')});};
\ No newline at end of file
+var _0xa5dc=['define','ChatInteraction','chat_interactions','closed','format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x17c02a,_0x806adc){var _0x142d4a=function(_0x1301c6){while(--_0x1301c6){_0x17c02a['push'](_0x17c02a['shift']());}};_0x142d4a(++_0x806adc);}(_0xa5dc,0xac));var _0xca5d=function(_0x5742c4,_0x5d94fc){_0x5742c4=_0x5742c4-0x0;var _0x3eecc9=_0xa5dc[_0x5742c4];return _0x3eecc9;};'use strict';var _=require('lodash');var util=require(_0xca5d('0x0'));var logger=require(_0xca5d('0x1'))(_0xca5d('0x2'));var moment=require(_0xca5d('0x3'));var BPromise=require('bluebird');var rp=require(_0xca5d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca5d('0x5'));var config=require(_0xca5d('0x6'));var attributes=require(_0xca5d('0x7'));module['exports']=function(_0x4657ca,_0x30d911){return _0x4657ca[_0xca5d('0x8')](_0xca5d('0x9'),attributes,{'tableName':_0xca5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11e038,_0x1a31a5,_0xad2028){if(_0x11e038['changed'](_0xca5d('0xb'))){_0x11e038['closedAt']=moment()[_0xca5d('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0xad2028(null,_0x11e038);}},'charset':_0xca5d('0xd'),'collate':_0xca5d('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index eadc748..a5dc0e7 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 _0x088b=['find','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatInteraction,\x20%s,\x20%s','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','limit','AddTagsToChatInteraction'];(function(_0x5a2d7c,_0x35c14f){var _0x3f2252=function(_0x213ac5){while(--_0x213ac5){_0x5a2d7c['push'](_0x5a2d7c['shift']());}};_0x3f2252(++_0x35c14f);}(_0x088b,0x13a));var _0xb088=function(_0x103277,_0x15a2a2){_0x103277=_0x103277-0x0;var _0x45c58f=_0x088b[_0x103277];return _0x45c58f;};'use strict';var _=require(_0xb088('0x0'));var util=require(_0xb088('0x1'));var moment=require(_0xb088('0x2'));var BPromise=require(_0xb088('0x3'));var rs=require(_0xb088('0x4'));var fs=require('fs');var Redis=require(_0xb088('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb088('0x6'));var logger=require(_0xb088('0x7'))(_0xb088('0x8'));var config=require(_0xb088('0x9'));var jayson=require(_0xb088('0xa'));var client=jayson[_0xb088('0xb')][_0xb088('0xc')]({'port':0x232a});config[_0xb088('0xd')]=_[_0xb088('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb088('0xf'))(new Redis(config[_0xb088('0xd')]));require(_0xb088('0x10'))[_0xb088('0x11')](socket);function respondWithRpcPromise(_0x3a98a1,_0x49b56a,_0x143d4b){return new BPromise(function(_0x4e07de,_0x1fe168){return client[_0xb088('0x12')](_0x3a98a1,_0x143d4b)[_0xb088('0x13')](function(_0x211bab){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x49b56a,_0xb088('0x14'));logger[_0xb088('0x15')](_0xb088('0x16'),_0x49b56a,'request\x20sent',JSON[_0xb088('0x17')](_0x211bab));if(_0x211bab['error']){if(_0x211bab[_0xb088('0x18')][_0xb088('0x19')]===0x1f4){logger[_0xb088('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x49b56a,_0x211bab[_0xb088('0x18')]['message']);return _0x1fe168(_0x211bab[_0xb088('0x18')][_0xb088('0x1a')]);}logger[_0xb088('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x49b56a,_0x211bab[_0xb088('0x18')][_0xb088('0x1a')]);return _0x4e07de(_0x211bab['error'][_0xb088('0x1a')]);}else{logger[_0xb088('0x1b')](_0xb088('0x1c'),_0x49b56a,_0xb088('0x14'));_0x4e07de(_0x211bab['result'][_0xb088('0x1a')]);}})[_0xb088('0x1d')](function(_0x4a34e2){logger['error'](_0xb088('0x1c'),_0x49b56a,_0x4a34e2);_0x1fe168(_0x4a34e2);});});}exports[_0xb088('0x1e')]=function(_0xdf1a98){var _0x3b5db2=this;return new Promise(function(_0x20416a,_0x173801){return db[_0xb088('0x1f')][_0xb088('0x20')](_0xdf1a98['body'],{'raw':_0xdf1a98[_0xb088('0x21')]?_0xdf1a98[_0xb088('0x21')][_0xb088('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf1a98[_0xb088('0x21')]?_0xdf1a98[_0xb088('0x21')][_0xb088('0x23')]||null:null,'attributes':_0xdf1a98[_0xb088('0x21')]?_0xdf1a98[_0xb088('0x21')]['attributes']||null:null,'limit':_0xdf1a98[_0xb088('0x21')]?_0xdf1a98[_0xb088('0x21')][_0xb088('0x24')]||null:null})['then'](function(_0x54e697){logger[_0xb088('0x1b')]('UpdateChatInteraction',_0xdf1a98);logger[_0xb088('0x15')](_0xb088('0x1e'),_0xdf1a98,JSON[_0xb088('0x17')](_0x54e697));_0x20416a(_0x54e697);})['catch'](function(_0x156bee){logger['error'](_0xb088('0x1e'),_0x156bee[_0xb088('0x1a')],_0xdf1a98);_0x173801(_0x3b5db2[_0xb088('0x18')](0x1f4,_0x156bee[_0xb088('0x1a')]));});});};exports[_0xb088('0x25')]=function(_0x4892de){return new Promise(function(_0x56d858,_0x476a37){return db[_0xb088('0x1f')][_0xb088('0x26')]({'where':_0x4892de[_0xb088('0x21')]?_0x4892de['options'][_0xb088('0x23')]||null:null})[_0xb088('0x13')](function(_0x125386){if(_0x125386){return _0x125386['addTags'](_0x4892de[_0xb088('0x27')][_0xb088('0x28')],_[_0xb088('0x29')](_0x4892de[_0xb088('0x27')],[_0xb088('0x28'),'id'])||{});}})[_0xb088('0x2a')](function(_0x16dead){logger[_0xb088('0x1b')](_0xb088('0x2b'),_0x4892de);logger[_0xb088('0x15')](_0xb088('0x2b'),_0x4892de,JSON[_0xb088('0x17')](_0x16dead));_0x56d858(_0x16dead);})[_0xb088('0x1d')](function(_0x18232a){logger[_0xb088('0x18')](_0xb088('0x2b'),_0x18232a['message'],_0x4892de);_0x476a37(_this[_0xb088('0x18')](0x1f4,_0x18232a[_0xb088('0x1a')]));});});};
\ No newline at end of file
+var _0xedc4=['register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','then','UpdateChatInteraction','find','addTags','ids','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','localhost','socket.io-emitter','./chatInteraction.socket'];(function(_0x17eb11,_0x25d8c6){var _0x559093=function(_0x1bf619){while(--_0x1bf619){_0x17eb11['push'](_0x17eb11['shift']());}};_0x559093(++_0x25d8c6);}(_0xedc4,0x166));var _0x4edc=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xedc4[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x4edc('0x0'));var moment=require('moment');var BPromise=require(_0x4edc('0x1'));var rs=require(_0x4edc('0x2'));var fs=require('fs');var Redis=require(_0x4edc('0x3'));var db=require(_0x4edc('0x4'))['db'];var utils=require(_0x4edc('0x5'));var logger=require(_0x4edc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4edc('0x7')]({'port':0x232a});config[_0x4edc('0x8')]=_['defaults'](config['redis'],{'host':_0x4edc('0x9'),'port':0x18eb});var socket=require(_0x4edc('0xa'))(new Redis(config[_0x4edc('0x8')]));require(_0x4edc('0xb'))[_0x4edc('0xc')](socket);function respondWithRpcPromise(_0x1043e3,_0x58a413,_0x34f23d){return new BPromise(function(_0x37378a,_0x15f9c3){return client[_0x4edc('0xd')](_0x1043e3,_0x34f23d)['then'](function(_0x250b4b){logger[_0x4edc('0xe')](_0x4edc('0xf'),_0x58a413,_0x4edc('0x10'));logger[_0x4edc('0x11')](_0x4edc('0x12'),_0x58a413,_0x4edc('0x10'),JSON[_0x4edc('0x13')](_0x250b4b));if(_0x250b4b[_0x4edc('0x14')]){if(_0x250b4b['error']['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x58a413,_0x250b4b[_0x4edc('0x14')]['message']);return _0x15f9c3(_0x250b4b[_0x4edc('0x14')][_0x4edc('0x15')]);}logger[_0x4edc('0x14')](_0x4edc('0xf'),_0x58a413,_0x250b4b[_0x4edc('0x14')][_0x4edc('0x15')]);return _0x37378a(_0x250b4b[_0x4edc('0x14')][_0x4edc('0x15')]);}else{logger[_0x4edc('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x58a413,_0x4edc('0x10'));_0x37378a(_0x250b4b['result'][_0x4edc('0x15')]);}})[_0x4edc('0x16')](function(_0x5368b0){logger[_0x4edc('0x14')](_0x4edc('0xf'),_0x58a413,_0x5368b0);_0x15f9c3(_0x5368b0);});});}exports['UpdateChatInteraction']=function(_0x4460e3){var _0x49c652=this;return new Promise(function(_0x6ef155,_0xaa6412){return db[_0x4edc('0x17')][_0x4edc('0x18')](_0x4460e3[_0x4edc('0x19')],{'raw':_0x4460e3[_0x4edc('0x1a')]?_0x4460e3[_0x4edc('0x1a')][_0x4edc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4460e3[_0x4edc('0x1a')]?_0x4460e3[_0x4edc('0x1a')][_0x4edc('0x1c')]||null:null,'attributes':_0x4460e3[_0x4edc('0x1a')]?_0x4460e3[_0x4edc('0x1a')][_0x4edc('0x1d')]||null:null,'limit':_0x4460e3[_0x4edc('0x1a')]?_0x4460e3['options'][_0x4edc('0x1e')]||null:null})[_0x4edc('0x1f')](function(_0x447622){logger[_0x4edc('0xe')](_0x4edc('0x20'),_0x4460e3);logger['debug'](_0x4edc('0x20'),_0x4460e3,JSON[_0x4edc('0x13')](_0x447622));_0x6ef155(_0x447622);})[_0x4edc('0x16')](function(_0x37f27f){logger['error']('UpdateChatInteraction',_0x37f27f['message'],_0x4460e3);_0xaa6412(_0x49c652[_0x4edc('0x14')](0x1f4,_0x37f27f[_0x4edc('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x147358){return new Promise(function(_0x514c4b,_0x47b1e1){return db[_0x4edc('0x17')][_0x4edc('0x21')]({'where':_0x147358[_0x4edc('0x1a')]?_0x147358[_0x4edc('0x1a')][_0x4edc('0x1c')]||null:null})[_0x4edc('0x1f')](function(_0x5bd8c0){if(_0x5bd8c0){return _0x5bd8c0[_0x4edc('0x22')](_0x147358[_0x4edc('0x19')][_0x4edc('0x23')],_['omit'](_0x147358['body'],['ids','id'])||{});}})['spread'](function(_0x6086e4){logger['info']('AddTags',_0x147358);logger[_0x4edc('0x11')](_0x4edc('0x24'),_0x147358,JSON['stringify'](_0x6086e4));_0x514c4b(_0x6086e4);})[_0x4edc('0x16')](function(_0x4b649){logger[_0x4edc('0x14')](_0x4edc('0x24'),_0x4b649[_0x4edc('0x15')],_0x147358);_0x47b1e1(_this[_0x4edc('0x14')](0x1f4,_0x4b649[_0x4edc('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 74d22ed..439535f 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 _0x4e40=['emit','removeListener','register','length','./chatInteraction.events','save','update'];(function(_0x3eaf5e,_0x3c9120){var _0x2e7aad=function(_0x493cef){while(--_0x493cef){_0x3eaf5e['push'](_0x3eaf5e['shift']());}};_0x2e7aad(++_0x3c9120);}(_0x4e40,0x1a8));var _0x04e4=function(_0x3944a9,_0x4fd80c){_0x3944a9=_0x3944a9-0x0;var _0x2f219d=_0x4e40[_0x3944a9];return _0x2f219d;};'use strict';var ChatInteractionEvents=require(_0x04e4('0x0'));var events=[_0x04e4('0x1'),'remove',_0x04e4('0x2')];function createListener(_0x5b6331,_0x4c6433){return function(_0x5d30a0){_0x4c6433[_0x04e4('0x3')](_0x5b6331,_0x5d30a0);};}function removeListener(_0x3b9914,_0x1abfb3){return function(){ChatInteractionEvents[_0x04e4('0x4')](_0x3b9914,_0x1abfb3);};}exports[_0x04e4('0x5')]=function(_0x5449cb){for(var _0x548e85=0x0,_0x3b5163=events[_0x04e4('0x6')];_0x548e85<_0x3b5163;_0x548e85++){var _0x33f304=events[_0x548e85];var _0x20cdc2=createListener('chatInteraction:'+_0x33f304,_0x5449cb);ChatInteractionEvents['on'](_0x33f304,_0x20cdc2);}};
\ No newline at end of file
+var _0xf5af=['length','save','remove','emit','removeListener','register'];(function(_0x322652,_0x5a85c0){var _0x5d5e88=function(_0x5ce853){while(--_0x5ce853){_0x322652['push'](_0x322652['shift']());}};_0x5d5e88(++_0x5a85c0);}(_0xf5af,0x175));var _0xff5a=function(_0x4a1cb6,_0x2401f4){_0x4a1cb6=_0x4a1cb6-0x0;var _0x5c33cf=_0xf5af[_0x4a1cb6];return _0x5c33cf;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xff5a('0x0'),_0xff5a('0x1'),'update'];function createListener(_0x1430cc,_0x50b57e){return function(_0x13bee2){_0x50b57e[_0xff5a('0x2')](_0x1430cc,_0x13bee2);};}function removeListener(_0x19757e,_0x257f92){return function(){ChatInteractionEvents[_0xff5a('0x3')](_0x19757e,_0x257f92);};}exports[_0xff5a('0x4')]=function(_0x6d4e2c){for(var _0x10f065=0x0,_0x263053=events[_0xff5a('0x5')];_0x10f065<_0x263053;_0x10f065++){var _0x48f26c=events[_0x10f065];var _0x235f8d=createListener('chatInteraction:'+_0x48f26c,_0x6d4e2c);ChatInteractionEvents['on'](_0x48f26c,_0x235f8d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 88a6686..c108b2b 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 _0xc7dd=['server/files/attachments/','format','%s-%s','now','replace','single','file','addMessage','tracked','chatinteraction:addtags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc7dd,0x7d));var _0xdc7d=function(_0x12f451,_0x3b618f){_0x12f451=_0x12f451-0x0;var _0x5e9589=_0xc7dd[_0x12f451];return _0x5e9589;};'use strict';var multer=require(_0xdc7d('0x0'));var util=require(_0xdc7d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc7d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdc7d('0x3'));var interaction=require(_0xdc7d('0x4'));var config=require(_0xdc7d('0x5'));var controller=require('./chatInteraction.controller');router[_0xdc7d('0x6')]('/',auth['isAuthenticated'](),controller[_0xdc7d('0x7')]);router[_0xdc7d('0x6')](_0xdc7d('0x8'),auth[_0xdc7d('0x9')](),controller['describe']);router['get'](_0xdc7d('0xa'),auth['isChatInteractionAuthorized'](),controller[_0xdc7d('0xb')]);router['get']('/:id/attachment_download',auth[_0xdc7d('0xc')](),controller[_0xdc7d('0xd')]);router['get'](_0xdc7d('0xe'),auth[_0xdc7d('0x9')](),controller['getMessages']);router[_0xdc7d('0x6')](_0xdc7d('0xf'),auth[_0xdc7d('0xc')](),controller[_0xdc7d('0x10')]);router[_0xdc7d('0x6')](_0xdc7d('0x11'),auth[_0xdc7d('0x9')](),controller['download']);router[_0xdc7d('0x12')]('/',auth[_0xdc7d('0x9')](),controller[_0xdc7d('0x13')]);router['post'](_0xdc7d('0x14'),auth[_0xdc7d('0x9')](),controller[_0xdc7d('0x15')]);var upload=multer({'storage':multer[_0xdc7d('0x16')]({'destination':function(_0x272377,_0x512496,_0x1e3da3){_0x1e3da3(null,path[_0xdc7d('0x17')](config[_0xdc7d('0x18')],_0xdc7d('0x19')));},'filename':function(_0x4a1ac1,_0x559789,_0x4fb979){_0x4fb979(null,util[_0xdc7d('0x1a')](_0xdc7d('0x1b'),Date[_0xdc7d('0x1c')](),_0x559789['originalname'][_0xdc7d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdc7d('0x12')]('/:id/attachment_upload',upload[_0xdc7d('0x1e')](_0xdc7d('0x1f')),controller['attachmentUpload']);router[_0xdc7d('0x12')]('/:id/messages',auth[_0xdc7d('0xc')](),controller[_0xdc7d('0x20')]);router[_0xdc7d('0x12')]('/:id/tags',auth[_0xdc7d('0x9')](),interaction[_0xdc7d('0x21')]('chat',_0xdc7d('0x22')),controller['addTags']);router[_0xdc7d('0x23')](_0xdc7d('0xa'),auth[_0xdc7d('0x9')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0xdc7d('0x24')]);router['put'](_0xdc7d('0x25'),controller[_0xdc7d('0x26')]);router[_0xdc7d('0x23')](_0xdc7d('0x27'),auth[_0xdc7d('0xc')](),controller[_0xdc7d('0x28')]);router[_0xdc7d('0x23')](_0xdc7d('0x29'),controller[_0xdc7d('0x2a')]);router[_0xdc7d('0x2b')](_0xdc7d('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0xdc7d('0x2c'),_0xdc7d('0x2d')),controller[_0xdc7d('0x2e')]);router[_0xdc7d('0x2b')](_0xdc7d('0x2f'),auth['isAuthenticated'](),controller[_0xdc7d('0x30')]);module[_0xdc7d('0x31')]=router;
\ No newline at end of file
+var _0x7c59=['exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','now','replace','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags'];(function(_0x4ca78f,_0x127edb){var _0xe3729e=function(_0x4a79e7){while(--_0x4a79e7){_0x4ca78f['push'](_0x4ca78f['shift']());}};_0xe3729e(++_0x127edb);}(_0x7c59,0x1eb));var _0x97c5=function(_0x1eab31,_0x31fbe4){_0x1eab31=_0x1eab31-0x0;var _0x1335b7=_0x7c59[_0x1eab31];return _0x1335b7;};'use strict';var multer=require('multer');var util=require(_0x97c5('0x0'));var path=require(_0x97c5('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c5('0x2'));var router=express[_0x97c5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x97c5('0x4'));var interaction=require(_0x97c5('0x5'));var config=require('../../config/environment');var controller=require(_0x97c5('0x6'));router[_0x97c5('0x7')]('/',auth[_0x97c5('0x8')](),controller[_0x97c5('0x9')]);router[_0x97c5('0x7')](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0xb')]);router[_0x97c5('0x7')](_0x97c5('0xc'),auth[_0x97c5('0xd')](),controller['show']);router[_0x97c5('0x7')](_0x97c5('0xe'),auth[_0x97c5('0xd')](),controller[_0x97c5('0xf')]);router[_0x97c5('0x7')](_0x97c5('0x10'),auth[_0x97c5('0x8')](),controller['getMessages']);router[_0x97c5('0x7')](_0x97c5('0x11'),auth[_0x97c5('0xd')](),controller[_0x97c5('0x12')]);router[_0x97c5('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x97c5('0x13')]);router[_0x97c5('0x14')]('/',auth['isAuthenticated'](),controller[_0x97c5('0x15')]);router[_0x97c5('0x14')](_0x97c5('0x16'),auth['isAuthenticated'](),controller[_0x97c5('0x17')]);var upload=multer({'storage':multer[_0x97c5('0x18')]({'destination':function(_0x871c74,_0x43b242,_0x1b5e83){_0x1b5e83(null,path['join'](config['root'],_0x97c5('0x19')));},'filename':function(_0x366912,_0x16529c,_0x1c3c43){_0x1c3c43(null,util[_0x97c5('0x1a')]('%s-%s',Date[_0x97c5('0x1b')](),_0x16529c['originalname'][_0x97c5('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x97c5('0x1d'),upload['single'](_0x97c5('0x1e')),controller[_0x97c5('0x1f')]);router[_0x97c5('0x14')]('/:id/messages',auth[_0x97c5('0xd')](),controller['addMessage']);router[_0x97c5('0x14')](_0x97c5('0x20'),auth[_0x97c5('0x8')](),interaction[_0x97c5('0x21')](_0x97c5('0x22'),_0x97c5('0x23')),controller['addTags']);router[_0x97c5('0x24')](_0x97c5('0xc'),auth[_0x97c5('0x8')](),interaction['tracked'](_0x97c5('0x22'),_0x97c5('0x25')),controller[_0x97c5('0x26')]);router[_0x97c5('0x24')](_0x97c5('0x27'),controller[_0x97c5('0x28')]);router[_0x97c5('0x24')](_0x97c5('0x29'),auth[_0x97c5('0xd')](),controller[_0x97c5('0x2a')]);router['put'](_0x97c5('0x2b'),controller['close']);router[_0x97c5('0x2c')](_0x97c5('0xc'),auth[_0x97c5('0x8')](),interaction[_0x97c5('0x21')](_0x97c5('0x22'),_0x97c5('0x2d')),controller[_0x97c5('0x2e')]);router[_0x97c5('0x2c')]('/:id/tags',auth[_0x97c5('0x8')](),controller[_0x97c5('0x2f')]);module[_0x97c5('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 10a3059..930edc6 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 _0x9c41=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2bc40d,_0x241a88){var _0x5d77d1=function(_0x4ad7be){while(--_0x4ad7be){_0x2bc40d['push'](_0x2bc40d['shift']());}};_0x5d77d1(++_0x241a88);}(_0x9c41,0x125));var _0x19c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c41[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x19c4('0x0'));module[_0x19c4('0x1')]={'body':{'type':Sequelize['TEXT'](_0x19c4('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x19c4('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x19c4('0x4')]}};
\ No newline at end of file
+var _0x9400=['sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x46d9cc,_0x4ec9ce){var _0xc70e83=function(_0x350790){while(--_0x350790){_0x46d9cc['push'](_0x46d9cc['shift']());}};_0xc70e83(++_0x4ec9ce);}(_0x9400,0x11d));var _0x0940=function(_0x4066e3,_0x3a8116){_0x4066e3=_0x4066e3-0x0;var _0x1fc542=_0x9400[_0x4066e3];return _0x1fc542;};'use strict';var Sequelize=require(_0x0940('0x0'));module[_0x0940('0x1')]={'body':{'type':Sequelize[_0x0940('0x2')](_0x0940('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0940('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 5562b0f..ebe5d97 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 _0x0b53=['squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','ChatInternalMessage','rows','show','params','merge','find','catch','create','body','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash'];(function(_0x40d7f6,_0x489e50){var _0x2bfda6=function(_0x25af44){while(--_0x25af44){_0x40d7f6['push'](_0x40d7f6['shift']());}};_0x2bfda6(++_0x489e50);}(_0x0b53,0x1c7));var _0x30b5=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x0b53[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0x30b5('0x0'));var rimraf=require(_0x30b5('0x1'));var zipdir=require(_0x30b5('0x2'));var jsonpatch=require(_0x30b5('0x3'));var rp=require(_0x30b5('0x4'));var moment=require(_0x30b5('0x5'));var BPromise=require(_0x30b5('0x6'));var Mustache=require(_0x30b5('0x7'));var util=require('util');var path=require(_0x30b5('0x8'));var sox=require('sox');var csv=require(_0x30b5('0x9'));var ejs=require(_0x30b5('0xa'));var fs=require('fs');var fs_extra=require(_0x30b5('0xb'));var _=require(_0x30b5('0xc'));var squel=require(_0x30b5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x30b5('0xe'));var toCsv=require(_0x30b5('0x9'));var querystring=require(_0x30b5('0xf'));var Papa=require(_0x30b5('0x10'));var Redis=require(_0x30b5('0x11'));var authService=require(_0x30b5('0x12'));var qs=require(_0x30b5('0x13'));var as=require(_0x30b5('0x14'));var hardwareService=require(_0x30b5('0x15'));var logger=require(_0x30b5('0x16'))(_0x30b5('0x17'));var utils=require('../../config/utils');var config=require(_0x30b5('0x18'));var licenseUtil=require(_0x30b5('0x19'));var db=require(_0x30b5('0x1a'))['db'];config['redis']=_[_0x30b5('0x1b')](config[_0x30b5('0x1c')],{'host':_0x30b5('0x1d'),'port':0x18eb});var socket=require(_0x30b5('0x1e'))(new Redis(config['redis']));require(_0x30b5('0x1f'))[_0x30b5('0x20')](socket);function respondWithStatusCode(_0x482f79,_0x48335b){_0x48335b=_0x48335b||0xcc;return function(_0x149bc9){if(_0x149bc9){return _0x482f79[_0x30b5('0x21')](_0x48335b);}return _0x482f79[_0x30b5('0x22')](_0x48335b)[_0x30b5('0x23')]();};}function respondWithResult(_0xbd5afb,_0x3d58d0){_0x3d58d0=_0x3d58d0||0xc8;return function(_0x2edc5f){if(_0x2edc5f){return _0xbd5afb[_0x30b5('0x22')](_0x3d58d0)[_0x30b5('0x24')](_0x2edc5f);}};}function respondWithFilteredResult(_0x165b8,_0xba4f57){return function(_0x274d57){if(_0x274d57){var _0x37e461=typeof _0xba4f57[_0x30b5('0x25')]===_0x30b5('0x26')&&typeof _0xba4f57['limit']===_0x30b5('0x26');var _0x3dfbaa=_0x274d57[_0x30b5('0x27')];var _0xbf157c=_0x37e461?0x0:_0xba4f57[_0x30b5('0x25')];var _0x2e5e0e=_0x37e461?_0x274d57[_0x30b5('0x27')]:_0xba4f57['offset']+_0xba4f57[_0x30b5('0x28')];var _0x452f08;if(_0x2e5e0e>=_0x3dfbaa){_0x2e5e0e=_0x3dfbaa;_0x452f08=0xc8;}else{_0x452f08=0xce;}_0x165b8[_0x30b5('0x22')](_0x452f08);return _0x165b8[_0x30b5('0x29')](_0x30b5('0x2a'),_0xbf157c+'-'+_0x2e5e0e+'/'+_0x3dfbaa)[_0x30b5('0x24')](_0x274d57);}return null;};}function patchUpdates(_0xfae486){return function(_0x3585a6){try{jsonpatch[_0x30b5('0x2b')](_0x3585a6,_0xfae486,!![]);}catch(_0x111cc9){return BPromise[_0x30b5('0x2c')](_0x111cc9);}return _0x3585a6[_0x30b5('0x2d')]();};}function saveUpdates(_0x501963,_0x2b7a7f){return function(_0xfc778e){if(_0xfc778e){return _0xfc778e[_0x30b5('0x2e')](_0x501963)[_0x30b5('0x2f')](function(_0x4cb9bc){return _0x4cb9bc;});}return null;};}function removeEntity(_0x8a2127,_0x41bb9d){return function(_0x541a80){if(_0x541a80){return _0x541a80[_0x30b5('0x30')]()[_0x30b5('0x2f')](function(){_0x8a2127[_0x30b5('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1abcc8,_0x2e2a5d){return function(_0x2b03c5){if(!_0x2b03c5){_0x1abcc8[_0x30b5('0x21')](0x194);}return _0x2b03c5;};}function handleError(_0x37be5d,_0xa9855c){_0xa9855c=_0xa9855c||0x1f4;return function(_0x1ebca8){logger['error'](_0x1ebca8[_0x30b5('0x31')]);if(_0x1ebca8[_0x30b5('0x32')]){delete _0x1ebca8[_0x30b5('0x32')];}_0x37be5d[_0x30b5('0x22')](_0xa9855c)['send'](_0x1ebca8);};}exports[_0x30b5('0x33')]=function(_0x424931,_0x4b3c25){var _0x46f0a7={},_0x20b04b={},_0x2a3d90={'count':0x0,'rows':[]};var _0x177331=_[_0x30b5('0x34')](db['ChatInternalMessage'][_0x30b5('0x35')],function(_0x3d9841){return{'name':_0x3d9841[_0x30b5('0x36')],'type':_0x3d9841[_0x30b5('0x37')][_0x30b5('0x38')]};});_0x20b04b[_0x30b5('0x39')]=_[_0x30b5('0x34')](_0x177331,_0x30b5('0x32'));_0x20b04b[_0x30b5('0x3a')]=_[_0x30b5('0x3b')](_0x424931['query']);_0x20b04b[_0x30b5('0x3c')]=_[_0x30b5('0x3d')](_0x20b04b['model'],_0x20b04b[_0x30b5('0x3a')]);_0x46f0a7['attributes']=_[_0x30b5('0x3d')](_0x20b04b[_0x30b5('0x39')],qs[_0x30b5('0x3e')](_0x424931[_0x30b5('0x3a')][_0x30b5('0x3e')]));_0x46f0a7[_0x30b5('0x3f')]=_0x46f0a7[_0x30b5('0x3f')][_0x30b5('0x40')]?_0x46f0a7[_0x30b5('0x3f')]:_0x20b04b[_0x30b5('0x39')];if(!_0x424931[_0x30b5('0x3a')]['hasOwnProperty'](_0x30b5('0x41'))){_0x46f0a7[_0x30b5('0x28')]=qs[_0x30b5('0x28')](_0x424931[_0x30b5('0x3a')][_0x30b5('0x28')]);_0x46f0a7[_0x30b5('0x25')]=qs[_0x30b5('0x25')](_0x424931[_0x30b5('0x3a')]['offset']);}_0x46f0a7[_0x30b5('0x42')]=qs[_0x30b5('0x43')](_0x424931[_0x30b5('0x3a')][_0x30b5('0x43')]);_0x46f0a7['where']=qs[_0x30b5('0x3c')](_[_0x30b5('0x44')](_0x424931[_0x30b5('0x3a')],_0x20b04b['filters']),_0x177331);if(_0x424931['query'][_0x30b5('0x45')]){_0x46f0a7['where']=_['merge'](_0x46f0a7[_0x30b5('0x46')],{'$or':_[_0x30b5('0x34')](_0x177331,function(_0x1dc443){if(_0x1dc443[_0x30b5('0x37')]!==_0x30b5('0x47')){var _0x40e174={};_0x40e174[_0x1dc443['name']]={'$like':'%'+_0x424931[_0x30b5('0x3a')][_0x30b5('0x45')]+'%'};return _0x40e174;}})});}_0x46f0a7=_['merge']({},_0x46f0a7,_0x424931[_0x30b5('0x48')]);var _0x5b9c3c={'where':_0x46f0a7[_0x30b5('0x46')]};return db['ChatInternalMessage'][_0x30b5('0x27')](_0x5b9c3c)[_0x30b5('0x2f')](function(_0x54434d){_0x2a3d90[_0x30b5('0x27')]=_0x54434d;if(_0x424931[_0x30b5('0x3a')][_0x30b5('0x49')]){_0x46f0a7[_0x30b5('0x4a')]=[{'all':!![]}];}return db[_0x30b5('0x4b')]['findAll'](_0x46f0a7);})[_0x30b5('0x2f')](function(_0x2ad42a){_0x2a3d90[_0x30b5('0x4c')]=_0x2ad42a;return _0x2a3d90;})[_0x30b5('0x2f')](respondWithFilteredResult(_0x4b3c25,_0x46f0a7))['catch'](handleError(_0x4b3c25,null));};exports[_0x30b5('0x4d')]=function(_0x4dbc5b,_0x20ecc6){var _0x11026e={'raw':!![],'where':{'id':_0x4dbc5b[_0x30b5('0x4e')]['id']}},_0x2b02e0={};_0x2b02e0[_0x30b5('0x39')]=_[_0x30b5('0x3b')](db[_0x30b5('0x4b')]['rawAttributes']);_0x2b02e0['query']=_[_0x30b5('0x3b')](_0x4dbc5b[_0x30b5('0x3a')]);_0x2b02e0['filters']=_[_0x30b5('0x3d')](_0x2b02e0[_0x30b5('0x39')],_0x2b02e0[_0x30b5('0x3a')]);_0x11026e[_0x30b5('0x3f')]=_[_0x30b5('0x3d')](_0x2b02e0[_0x30b5('0x39')],qs[_0x30b5('0x3e')](_0x4dbc5b[_0x30b5('0x3a')][_0x30b5('0x3e')]));_0x11026e[_0x30b5('0x3f')]=_0x11026e[_0x30b5('0x3f')][_0x30b5('0x40')]?_0x11026e['attributes']:_0x2b02e0['model'];if(_0x4dbc5b[_0x30b5('0x3a')][_0x30b5('0x49')]){_0x11026e[_0x30b5('0x4a')]=[{'all':!![]}];}_0x11026e=_[_0x30b5('0x4f')]({},_0x11026e,_0x4dbc5b[_0x30b5('0x48')]);return db[_0x30b5('0x4b')][_0x30b5('0x50')](_0x11026e)['then'](handleEntityNotFound(_0x20ecc6,null))[_0x30b5('0x2f')](respondWithResult(_0x20ecc6,null))[_0x30b5('0x51')](handleError(_0x20ecc6,null));};exports[_0x30b5('0x52')]=function(_0x49a07a,_0x2d798f){return db[_0x30b5('0x4b')][_0x30b5('0x52')](_0x49a07a[_0x30b5('0x53')],{})[_0x30b5('0x2f')](respondWithResult(_0x2d798f,0xc9))[_0x30b5('0x51')](handleError(_0x2d798f,null));};exports['update']=function(_0x201388,_0x4bfaed){if(_0x201388[_0x30b5('0x53')]['id']){delete _0x201388[_0x30b5('0x53')]['id'];}return db[_0x30b5('0x4b')]['find']({'where':{'id':_0x201388[_0x30b5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4bfaed,null))[_0x30b5('0x2f')](saveUpdates(_0x201388[_0x30b5('0x53')],null))['then'](respondWithResult(_0x4bfaed,null))['catch'](handleError(_0x4bfaed,null));};exports[_0x30b5('0x30')]=function(_0x32055c,_0x3cb333){return db['ChatInternalMessage'][_0x30b5('0x50')]({'where':{'id':_0x32055c['params']['id']}})[_0x30b5('0x2f')](handleEntityNotFound(_0x3cb333,null))[_0x30b5('0x2f')](removeEntity(_0x3cb333,null))[_0x30b5('0x51')](handleError(_0x3cb333,null));};exports[_0x30b5('0x54')]=function(_0x4c9acc,_0x5762fa){return db[_0x30b5('0x4b')]['describe']()[_0x30b5('0x2f')](respondWithResult(_0x5762fa,null))['catch'](handleError(_0x5762fa,null));};function wrapUser(_0x515a49){return function(_0x45d2e5){var _0x17620c=_0x515a49[_0x30b5('0x55')]({'plain':!![]});_0x17620c[_0x30b5('0x56')]=[];if(_0x45d2e5){_0x17620c['lastMessageAt']=_0x45d2e5[_0x30b5('0x57')];_0x17620c[_0x30b5('0x58')]=_0x45d2e5;}else{_0x17620c[_0x30b5('0x59')]=moment(0x0)[_0x30b5('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x17620c[_0x30b5('0x58')]={};}return _0x17620c;};}exports[_0x30b5('0x5b')]=function(_0x48bfbc,_0x5e9b85,_0x2e9c14){var _0x127ee7=[];return db[_0x30b5('0x5c')][_0x30b5('0x5d')]({'where':{'role':[_0x30b5('0x5e'),_0x30b5('0x5f'),_0x30b5('0x60')]},'attributes':['id',_0x30b5('0x61'),_0x30b5('0x32'),_0x30b5('0x62'),_0x30b5('0x63'),'internal',_0x30b5('0x64'),_0x30b5('0x65'),_0x30b5('0x66'),'showWebBar'],'order':qs[_0x30b5('0x43')]('-online'),'include':[{'model':db[_0x30b5('0x67')],'as':_0x30b5('0x68'),'attributes':['id',_0x30b5('0x32'),_0x30b5('0x37')],'through':{'attributes':[]}}]})['then'](function(_0x4e9c4f){if(_0x4e9c4f){var _0x586ff6=_0x48bfbc['user'][_0x30b5('0x55')]({'plain':!![]});if(!_0x586ff6)throw new Error(_0x30b5('0x69'));if(_0x586ff6[_0x30b5('0x62')]===_0x30b5('0x60')){return db[_0x30b5('0x6a')][_0x30b5('0x50')]({'where':{'name':'Agents','userProfileId':_0x586ff6[_0x30b5('0x6b')]},'raw':!![]})[_0x30b5('0x2f')](function(_0x37b7e8){if(_0x37b7e8){if(_0x37b7e8[_0x30b5('0x6c')]===0x0){return db['UserProfileResource'][_0x30b5('0x5d')]({'where':{'sectionId':_0x37b7e8['id']},'raw':!![]})[_0x30b5('0x2f')](function(_0x46c11a){var _0x205eeb=[];if(_[_0x30b5('0x6d')](_0x46c11a)){_0x205eeb=_[_0x30b5('0x45')](_0x4e9c4f,function(_0x135800){if(_0x135800[_0x30b5('0x62')]!==_0x30b5('0x5e')){return _0x135800;}});return _0x205eeb;}else{for(var _0x54a988=0x0;_0x54a988<_0x4e9c4f[_0x30b5('0x40')];_0x54a988++){var _0x3fa41e=_0x4e9c4f[_0x54a988];if(_0x3fa41e[_0x30b5('0x62')]===_0x30b5('0x5e')){var _0x184826=_[_0x30b5('0x50')](_0x46c11a,function(_0x4b900d){return _0x4b900d[_0x30b5('0x6e')]===_0x3fa41e['id'];});if(_0x184826)_0x205eeb['push'](_0x3fa41e);}else{_0x205eeb[_0x30b5('0x6f')](_0x3fa41e);}}return _0x205eeb;}});}else{return _0x4e9c4f;}}else{var _0x1713e0=_[_0x30b5('0x45')](_0x4e9c4f,function(_0xda44f8){if(_0xda44f8[_0x30b5('0x62')]!==_0x30b5('0x5e')){return _0xda44f8;}});return _0x1713e0;}});}else{return _0x4e9c4f;}}})[_0x30b5('0x2f')](function(_0x47802d){var _0x159b5f=[];if(_0x47802d){_0x127ee7=_0x47802d;for(var _0x1026ce=0x0;_0x1026ce<_0x47802d[_0x30b5('0x40')];_0x1026ce+=0x1){_0x127ee7[_0x1026ce][_0x30b5('0x56')]=[];_0x159b5f[_0x30b5('0x6f')](db[_0x30b5('0x4b')][_0x30b5('0x50')]({'where':{'FromId':[_0x48bfbc['user']['id'],_0x47802d[_0x1026ce]['id']],'ToId':[_0x48bfbc[_0x30b5('0x60')]['id'],_0x47802d[_0x1026ce]['id']],'ChatGroupId':null},'attributes':['id',_0x30b5('0x57'),_0x30b5('0x70'),_0x30b5('0x71'),_0x30b5('0x72'),_0x30b5('0x53')],'order':qs[_0x30b5('0x43')](_0x30b5('0x73')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x30b5('0x2f')](wrapUser(_0x47802d[_0x1026ce])));}return BPromise[_0x30b5('0x74')](_0x159b5f);}return[];})[_0x30b5('0x2f')](function(_0x3cde6a){return{'rows':_0x3cde6a,'count':_0x3cde6a[_0x30b5('0x40')]};})[_0x30b5('0x2f')](respondWithResult(_0x5e9b85,null))[_0x30b5('0x51')](handleError(_0x5e9b85,null));};
\ No newline at end of file
+var _0x2f54=['count','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','resourceId','FromId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','set','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x420eb0,_0x1fb312){var _0x5d80a5=function(_0x224e84){while(--_0x224e84){_0x420eb0['push'](_0x420eb0['shift']());}};_0x5d80a5(++_0x1fb312);}(_0x2f54,0x1f3));var _0x42f5=function(_0x4482af,_0x2df282){_0x4482af=_0x4482af-0x0;var _0x1874e5=_0x2f54[_0x4482af];return _0x1874e5;};'use strict';var emlformat=require(_0x42f5('0x0'));var rimraf=require(_0x42f5('0x1'));var zipdir=require(_0x42f5('0x2'));var jsonpatch=require(_0x42f5('0x3'));var rp=require(_0x42f5('0x4'));var moment=require('moment');var BPromise=require(_0x42f5('0x5'));var Mustache=require('mustache');var util=require(_0x42f5('0x6'));var path=require('path');var sox=require(_0x42f5('0x7'));var csv=require(_0x42f5('0x8'));var ejs=require(_0x42f5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x42f5('0xa'));var jsforce=require(_0x42f5('0xb'));var deskjs=require(_0x42f5('0xc'));var toCsv=require(_0x42f5('0x8'));var querystring=require(_0x42f5('0xd'));var Papa=require(_0x42f5('0xe'));var Redis=require(_0x42f5('0xf'));var authService=require(_0x42f5('0x10'));var qs=require(_0x42f5('0x11'));var as=require(_0x42f5('0x12'));var hardwareService=require(_0x42f5('0x13'));var logger=require(_0x42f5('0x14'))(_0x42f5('0x15'));var utils=require(_0x42f5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x42f5('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x42f5('0x18')](config[_0x42f5('0x19')],{'host':_0x42f5('0x1a'),'port':0x18eb});var socket=require(_0x42f5('0x1b'))(new Redis(config[_0x42f5('0x19')]));require(_0x42f5('0x1c'))[_0x42f5('0x1d')](socket);function respondWithStatusCode(_0x522284,_0x29b176){_0x29b176=_0x29b176||0xcc;return function(_0x486342){if(_0x486342){return _0x522284[_0x42f5('0x1e')](_0x29b176);}return _0x522284['status'](_0x29b176)['end']();};}function respondWithResult(_0x29c00e,_0x4a4c50){_0x4a4c50=_0x4a4c50||0xc8;return function(_0x96701e){if(_0x96701e){return _0x29c00e[_0x42f5('0x1f')](_0x4a4c50)[_0x42f5('0x20')](_0x96701e);}};}function respondWithFilteredResult(_0x144675,_0xfa92ba){return function(_0x2c2387){if(_0x2c2387){var _0x5879ae=typeof _0xfa92ba[_0x42f5('0x21')]==='undefined'&&typeof _0xfa92ba['limit']==='undefined';var _0x220104=_0x2c2387['count'];var _0x2c5ec1=_0x5879ae?0x0:_0xfa92ba['offset'];var _0x1b67a7=_0x5879ae?_0x2c2387['count']:_0xfa92ba[_0x42f5('0x21')]+_0xfa92ba[_0x42f5('0x22')];var _0xf6ecff;if(_0x1b67a7>=_0x220104){_0x1b67a7=_0x220104;_0xf6ecff=0xc8;}else{_0xf6ecff=0xce;}_0x144675['status'](_0xf6ecff);return _0x144675[_0x42f5('0x23')]('Content-Range',_0x2c5ec1+'-'+_0x1b67a7+'/'+_0x220104)[_0x42f5('0x20')](_0x2c2387);}return null;};}function patchUpdates(_0x411279){return function(_0x201d15){try{jsonpatch[_0x42f5('0x24')](_0x201d15,_0x411279,!![]);}catch(_0x5cd647){return BPromise[_0x42f5('0x25')](_0x5cd647);}return _0x201d15[_0x42f5('0x26')]();};}function saveUpdates(_0xc91c7f,_0x55367c){return function(_0x6fcd13){if(_0x6fcd13){return _0x6fcd13[_0x42f5('0x27')](_0xc91c7f)['then'](function(_0x5af1e1){return _0x5af1e1;});}return null;};}function removeEntity(_0x2b8ce9,_0x34c607){return function(_0x2868b6){if(_0x2868b6){return _0x2868b6[_0x42f5('0x28')]()[_0x42f5('0x29')](function(){_0x2b8ce9[_0x42f5('0x1f')](0xcc)[_0x42f5('0x2a')]();});}};}function handleEntityNotFound(_0x1afb9f,_0x49651a){return function(_0x3fbca3){if(!_0x3fbca3){_0x1afb9f[_0x42f5('0x1e')](0x194);}return _0x3fbca3;};}function handleError(_0x5c5ba5,_0x191a95){_0x191a95=_0x191a95||0x1f4;return function(_0x5c07fa){logger['error'](_0x5c07fa[_0x42f5('0x2b')]);if(_0x5c07fa[_0x42f5('0x2c')]){delete _0x5c07fa[_0x42f5('0x2c')];}_0x5c5ba5[_0x42f5('0x1f')](_0x191a95)[_0x42f5('0x2d')](_0x5c07fa);};}exports[_0x42f5('0x2e')]=function(_0x571bd3,_0x57b1ce){var _0x31c055={},_0xbee25={},_0x5b5d66={'count':0x0,'rows':[]};var _0x2a0763=_[_0x42f5('0x2f')](db[_0x42f5('0x30')][_0x42f5('0x31')],function(_0xba9b3d){return{'name':_0xba9b3d['fieldName'],'type':_0xba9b3d[_0x42f5('0x32')][_0x42f5('0x33')]};});_0xbee25[_0x42f5('0x34')]=_[_0x42f5('0x2f')](_0x2a0763,_0x42f5('0x2c'));_0xbee25[_0x42f5('0x35')]=_['keys'](_0x571bd3[_0x42f5('0x35')]);_0xbee25[_0x42f5('0x36')]=_[_0x42f5('0x37')](_0xbee25[_0x42f5('0x34')],_0xbee25[_0x42f5('0x35')]);_0x31c055[_0x42f5('0x38')]=_['intersection'](_0xbee25['model'],qs[_0x42f5('0x39')](_0x571bd3[_0x42f5('0x35')]['fields']));_0x31c055[_0x42f5('0x38')]=_0x31c055['attributes']['length']?_0x31c055[_0x42f5('0x38')]:_0xbee25[_0x42f5('0x34')];if(!_0x571bd3[_0x42f5('0x35')][_0x42f5('0x3a')]('nolimit')){_0x31c055[_0x42f5('0x22')]=qs[_0x42f5('0x22')](_0x571bd3[_0x42f5('0x35')][_0x42f5('0x22')]);_0x31c055[_0x42f5('0x21')]=qs[_0x42f5('0x21')](_0x571bd3[_0x42f5('0x35')][_0x42f5('0x21')]);}_0x31c055[_0x42f5('0x3b')]=qs[_0x42f5('0x3c')](_0x571bd3[_0x42f5('0x35')]['sort']);_0x31c055[_0x42f5('0x3d')]=qs[_0x42f5('0x36')](_[_0x42f5('0x3e')](_0x571bd3[_0x42f5('0x35')],_0xbee25['filters']),_0x2a0763);if(_0x571bd3[_0x42f5('0x35')][_0x42f5('0x3f')]){_0x31c055['where']=_[_0x42f5('0x40')](_0x31c055[_0x42f5('0x3d')],{'$or':_[_0x42f5('0x2f')](_0x2a0763,function(_0x9520a0){if(_0x9520a0[_0x42f5('0x32')]!==_0x42f5('0x41')){var _0xf0107e={};_0xf0107e[_0x9520a0[_0x42f5('0x2c')]]={'$like':'%'+_0x571bd3['query'][_0x42f5('0x3f')]+'%'};return _0xf0107e;}})});}_0x31c055=_[_0x42f5('0x40')]({},_0x31c055,_0x571bd3['options']);var _0x59b313={'where':_0x31c055[_0x42f5('0x3d')]};return db[_0x42f5('0x30')][_0x42f5('0x42')](_0x59b313)['then'](function(_0x16604c){_0x5b5d66[_0x42f5('0x42')]=_0x16604c;if(_0x571bd3[_0x42f5('0x35')][_0x42f5('0x43')]){_0x31c055[_0x42f5('0x44')]=[{'all':!![]}];}return db[_0x42f5('0x30')][_0x42f5('0x45')](_0x31c055);})['then'](function(_0x2727d1){_0x5b5d66['rows']=_0x2727d1;return _0x5b5d66;})[_0x42f5('0x29')](respondWithFilteredResult(_0x57b1ce,_0x31c055))[_0x42f5('0x46')](handleError(_0x57b1ce,null));};exports[_0x42f5('0x47')]=function(_0x4d8161,_0x352e62){var _0x354f7c={'raw':!![],'where':{'id':_0x4d8161[_0x42f5('0x48')]['id']}},_0x547c14={};_0x547c14[_0x42f5('0x34')]=_[_0x42f5('0x49')](db['ChatInternalMessage'][_0x42f5('0x31')]);_0x547c14[_0x42f5('0x35')]=_[_0x42f5('0x49')](_0x4d8161[_0x42f5('0x35')]);_0x547c14[_0x42f5('0x36')]=_[_0x42f5('0x37')](_0x547c14['model'],_0x547c14[_0x42f5('0x35')]);_0x354f7c[_0x42f5('0x38')]=_[_0x42f5('0x37')](_0x547c14[_0x42f5('0x34')],qs['fields'](_0x4d8161[_0x42f5('0x35')][_0x42f5('0x39')]));_0x354f7c['attributes']=_0x354f7c[_0x42f5('0x38')]['length']?_0x354f7c[_0x42f5('0x38')]:_0x547c14[_0x42f5('0x34')];if(_0x4d8161['query'][_0x42f5('0x43')]){_0x354f7c[_0x42f5('0x44')]=[{'all':!![]}];}_0x354f7c=_[_0x42f5('0x40')]({},_0x354f7c,_0x4d8161[_0x42f5('0x4a')]);return db[_0x42f5('0x30')][_0x42f5('0x4b')](_0x354f7c)['then'](handleEntityNotFound(_0x352e62,null))['then'](respondWithResult(_0x352e62,null))[_0x42f5('0x46')](handleError(_0x352e62,null));};exports['create']=function(_0x8d035c,_0x25e3a8){return db[_0x42f5('0x30')][_0x42f5('0x4c')](_0x8d035c[_0x42f5('0x4d')],{})['then'](respondWithResult(_0x25e3a8,0xc9))[_0x42f5('0x46')](handleError(_0x25e3a8,null));};exports[_0x42f5('0x27')]=function(_0x4e388f,_0x5be7fd){if(_0x4e388f[_0x42f5('0x4d')]['id']){delete _0x4e388f['body']['id'];}return db[_0x42f5('0x30')][_0x42f5('0x4b')]({'where':{'id':_0x4e388f[_0x42f5('0x48')]['id']}})['then'](handleEntityNotFound(_0x5be7fd,null))[_0x42f5('0x29')](saveUpdates(_0x4e388f[_0x42f5('0x4d')],null))['then'](respondWithResult(_0x5be7fd,null))[_0x42f5('0x46')](handleError(_0x5be7fd,null));};exports[_0x42f5('0x28')]=function(_0x172044,_0x2d5664){return db[_0x42f5('0x30')][_0x42f5('0x4b')]({'where':{'id':_0x172044[_0x42f5('0x48')]['id']}})[_0x42f5('0x29')](handleEntityNotFound(_0x2d5664,null))['then'](removeEntity(_0x2d5664,null))['catch'](handleError(_0x2d5664,null));};exports[_0x42f5('0x4e')]=function(_0x411526,_0x2874f4){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x2874f4,null))[_0x42f5('0x46')](handleError(_0x2874f4,null));};function wrapUser(_0x143fcb){return function(_0x25ea77){var _0x55b92a=_0x143fcb[_0x42f5('0x4f')]({'plain':!![]});_0x55b92a[_0x42f5('0x50')]=[];if(_0x25ea77){_0x55b92a[_0x42f5('0x51')]=_0x25ea77[_0x42f5('0x52')];_0x55b92a[_0x42f5('0x53')]=_0x25ea77;}else{_0x55b92a[_0x42f5('0x51')]=moment(0x0)['format'](_0x42f5('0x54'));_0x55b92a['lastMessage']={};}return _0x55b92a;};}exports[_0x42f5('0x55')]=function(_0x47bba6,_0x2c1542,_0x1acfca){var _0x1562c7=[];return db[_0x42f5('0x56')][_0x42f5('0x45')]({'where':{'role':[_0x42f5('0x57'),_0x42f5('0x58'),'user']},'attributes':['id',_0x42f5('0x59'),_0x42f5('0x2c'),_0x42f5('0x5a'),_0x42f5('0x5b'),_0x42f5('0x5c'),_0x42f5('0x5d'),_0x42f5('0x5e'),_0x42f5('0x5f'),_0x42f5('0x60')],'order':qs[_0x42f5('0x3c')](_0x42f5('0x61')),'include':[{'model':db[_0x42f5('0x62')],'as':_0x42f5('0x63'),'attributes':['id',_0x42f5('0x2c'),_0x42f5('0x32')],'through':{'attributes':[]}}]})[_0x42f5('0x29')](function(_0x2f5ee1){if(_0x2f5ee1){var _0x4ab09a=_0x47bba6[_0x42f5('0x64')][_0x42f5('0x4f')]({'plain':!![]});if(!_0x4ab09a)throw new Error(_0x42f5('0x65'));if(_0x4ab09a[_0x42f5('0x5a')]===_0x42f5('0x64')){return db[_0x42f5('0x66')][_0x42f5('0x4b')]({'where':{'name':_0x42f5('0x67'),'userProfileId':_0x4ab09a[_0x42f5('0x68')]},'raw':!![]})[_0x42f5('0x29')](function(_0x18e6b4){if(_0x18e6b4){if(_0x18e6b4[_0x42f5('0x69')]===0x0){return db[_0x42f5('0x6a')][_0x42f5('0x45')]({'where':{'sectionId':_0x18e6b4['id']},'raw':!![]})[_0x42f5('0x29')](function(_0x4eac96){var _0x40f2f6=[];if(_[_0x42f5('0x6b')](_0x4eac96)){_0x40f2f6=_[_0x42f5('0x3f')](_0x2f5ee1,function(_0x537bad){if(_0x537bad[_0x42f5('0x5a')]!=='agent'){return _0x537bad;}});return _0x40f2f6;}else{for(var _0x1975dd=0x0;_0x1975dd<_0x2f5ee1[_0x42f5('0x6c')];_0x1975dd++){var _0x1a7970=_0x2f5ee1[_0x1975dd];if(_0x1a7970['role']==='agent'){var _0x4753c2=_[_0x42f5('0x4b')](_0x4eac96,function(_0x14aec7){return _0x14aec7[_0x42f5('0x6d')]===_0x1a7970['id'];});if(_0x4753c2)_0x40f2f6['push'](_0x1a7970);}else{_0x40f2f6['push'](_0x1a7970);}}return _0x40f2f6;}});}else{return _0x2f5ee1;}}else{var _0x5eb00e=_[_0x42f5('0x3f')](_0x2f5ee1,function(_0x5256d0){if(_0x5256d0[_0x42f5('0x5a')]!==_0x42f5('0x57')){return _0x5256d0;}});return _0x5eb00e;}});}else{return _0x2f5ee1;}}})['then'](function(_0x3bb734){var _0x363fb7=[];if(_0x3bb734){_0x1562c7=_0x3bb734;for(var _0x2ba29c=0x0;_0x2ba29c<_0x3bb734['length'];_0x2ba29c+=0x1){_0x1562c7[_0x2ba29c]['messages']=[];_0x363fb7['push'](db['ChatInternalMessage'][_0x42f5('0x4b')]({'where':{'FromId':[_0x47bba6[_0x42f5('0x64')]['id'],_0x3bb734[_0x2ba29c]['id']],'ToId':[_0x47bba6[_0x42f5('0x64')]['id'],_0x3bb734[_0x2ba29c]['id']],'ChatGroupId':null},'attributes':['id',_0x42f5('0x52'),_0x42f5('0x6e'),'ToId',_0x42f5('0x6f'),_0x42f5('0x4d')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x42f5('0x29')](wrapUser(_0x3bb734[_0x2ba29c])));}return BPromise[_0x42f5('0x70')](_0x363fb7);}return[];})[_0x42f5('0x29')](function(_0x10cf1f){return{'rows':_0x10cf1f,'count':_0x10cf1f[_0x42f5('0x6c')]};})[_0x42f5('0x29')](respondWithResult(_0x2c1542,null))[_0x42f5('0x46')](handleError(_0x2c1542,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 29806de..4d5cc3d 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 _0xb672=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb672,0x1a2));var _0x2b67=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb672[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2b67('0x0'));var ChatInternalMessage=require(_0x2b67('0x1'))['db'][_0x2b67('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2b67('0x3')](0x0);var events={'afterCreate':_0x2b67('0x4'),'afterUpdate':_0x2b67('0x5'),'afterDestroy':_0x2b67('0x6')};function emitEvent(_0x21f086){return function(_0x12afb0,_0x10d4c7,_0x530d41){ChatInternalMessageEvents[_0x2b67('0x7')](_0x21f086+':'+_0x12afb0['id'],_0x12afb0);ChatInternalMessageEvents[_0x2b67('0x7')](_0x21f086,_0x12afb0);_0x530d41(null);};}for(var e in events){if(events[_0x2b67('0x8')](e)){var event=events[e];ChatInternalMessage[_0x2b67('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x5f7b=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x3b5d45,_0x597509){var _0x3cbc78=function(_0x667d99){while(--_0x667d99){_0x3b5d45['push'](_0x3b5d45['shift']());}};_0x3cbc78(++_0x597509);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x5f7b[_0x3070dc];return _0x431489;};'use strict';var EventEmitter=require(_0xb5f7('0x0'));var ChatInternalMessage=require(_0xb5f7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb5f7('0x2')](0x0);var events={'afterCreate':_0xb5f7('0x3'),'afterUpdate':_0xb5f7('0x4'),'afterDestroy':_0xb5f7('0x5')};function emitEvent(_0xf4fd79){return function(_0x42baf5,_0x29396c,_0x5f3190){ChatInternalMessageEvents[_0xb5f7('0x6')](_0xf4fd79+':'+_0x42baf5['id'],_0x42baf5);ChatInternalMessageEvents['emit'](_0xf4fd79,_0x42baf5);_0x5f3190(null);};}for(var e in events){if(events[_0xb5f7('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb5f7('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 4c7400b..3fde13e 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 _0x6c5f=['utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4'];(function(_0x42a44a,_0x15ca12){var _0x1e6ab6=function(_0x5c5a3f){while(--_0x5c5a3f){_0x42a44a['push'](_0x42a44a['shift']());}};_0x1e6ab6(++_0x15ca12);}(_0x6c5f,0x17a));var _0xf6c5=function(_0x2a91f5,_0x3aa32c){_0x2a91f5=_0x2a91f5-0x0;var _0x37c730=_0x6c5f[_0x2a91f5];return _0x37c730;};'use strict';var _=require('lodash');var util=require(_0xf6c5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf6c5('0x1'));var BPromise=require(_0xf6c5('0x2'));var rp=require(_0xf6c5('0x3'));var fs=require('fs');var path=require(_0xf6c5('0x4'));var rimraf=require(_0xf6c5('0x5'));var config=require(_0xf6c5('0x6'));var attributes=require(_0xf6c5('0x7'));module[_0xf6c5('0x8')]=function(_0x92d87e,_0x193234){return _0x92d87e[_0xf6c5('0x9')](_0xf6c5('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6c5('0xb'),'collate':_0xf6c5('0xc')});};
\ No newline at end of file
+var _0xf264=['utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x30f3b2,_0x1cb187){var _0x617eea=function(_0x5bb435){while(--_0x5bb435){_0x30f3b2['push'](_0x30f3b2['shift']());}};_0x617eea(++_0x1cb187);}(_0xf264,0xc1));var _0x4f26=function(_0x38c8e6,_0x2ef09c){_0x38c8e6=_0x38c8e6-0x0;var _0x29dc53=_0xf264[_0x38c8e6];return _0x29dc53;};'use strict';var _=require(_0x4f26('0x0'));var util=require(_0x4f26('0x1'));var logger=require(_0x4f26('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4f26('0x3'));var rp=require(_0x4f26('0x4'));var fs=require('fs');var path=require(_0x4f26('0x5'));var rimraf=require('rimraf');var config=require(_0x4f26('0x6'));var attributes=require(_0x4f26('0x7'));module['exports']=function(_0x442fb9,_0x3242a7){return _0x442fb9[_0x4f26('0x8')](_0x4f26('0x9'),attributes,{'tableName':_0x4f26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4f26('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9479b09..a51e91d 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 _0x6841=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','register','request','then','info'];(function(_0x555e03,_0x2ff54f){var _0x2336ac=function(_0xeac734){while(--_0xeac734){_0x555e03['push'](_0x555e03['shift']());}};_0x2336ac(++_0x2ff54f);}(_0x6841,0xc6));var _0x1684=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x6841[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x1684('0x0'));var util=require(_0x1684('0x1'));var moment=require(_0x1684('0x2'));var BPromise=require(_0x1684('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1684('0x4'));var db=require(_0x1684('0x5'))['db'];var utils=require(_0x1684('0x6'));var logger=require(_0x1684('0x7'))(_0x1684('0x8'));var config=require(_0x1684('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1684('0xa')]['http']({'port':0x232a});config[_0x1684('0xb')]=_[_0x1684('0xc')](config['redis'],{'host':_0x1684('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1684('0xb')]));require('./chatInternalMessage.socket')[_0x1684('0xe')](socket);function respondWithRpcPromise(_0x296cbb,_0x3b624a,_0x37408f){return new BPromise(function(_0x276484,_0x1d7286){return client[_0x1684('0xf')](_0x296cbb,_0x37408f)[_0x1684('0x10')](function(_0x24fe97){logger[_0x1684('0x11')](_0x1684('0x12'),_0x3b624a,_0x1684('0x13'));logger[_0x1684('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3b624a,_0x1684('0x13'),JSON[_0x1684('0x15')](_0x24fe97));if(_0x24fe97[_0x1684('0x16')]){if(_0x24fe97[_0x1684('0x16')][_0x1684('0x17')]===0x1f4){logger[_0x1684('0x16')](_0x1684('0x12'),_0x3b624a,_0x24fe97[_0x1684('0x16')][_0x1684('0x18')]);return _0x1d7286(_0x24fe97[_0x1684('0x16')]['message']);}logger[_0x1684('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x3b624a,_0x24fe97[_0x1684('0x16')][_0x1684('0x18')]);return _0x276484(_0x24fe97[_0x1684('0x16')]['message']);}else{logger[_0x1684('0x11')](_0x1684('0x12'),_0x3b624a,_0x1684('0x13'));_0x276484(_0x24fe97[_0x1684('0x19')][_0x1684('0x18')]);}})[_0x1684('0x1a')](function(_0x2f348a){logger[_0x1684('0x16')](_0x1684('0x12'),_0x3b624a,_0x2f348a);_0x1d7286(_0x2f348a);});});}
\ No newline at end of file
+var _0x1da1=['localhost','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x4368da,_0x4fb9a3){var _0x415dfc=function(_0x5e0e48){while(--_0x5e0e48){_0x4368da['push'](_0x4368da['shift']());}};_0x415dfc(++_0x4fb9a3);}(_0x1da1,0x1a4));var _0x11da=function(_0x311ada,_0xee7f0b){_0x311ada=_0x311ada-0x0;var _0x448d19=_0x1da1[_0x311ada];return _0x448d19;};'use strict';var _=require(_0x11da('0x0'));var util=require(_0x11da('0x1'));var moment=require(_0x11da('0x2'));var BPromise=require(_0x11da('0x3'));var rs=require(_0x11da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11da('0x5'));var logger=require(_0x11da('0x6'))(_0x11da('0x7'));var config=require('../../config/environment');var jayson=require(_0x11da('0x8'));var client=jayson[_0x11da('0x9')][_0x11da('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x11da('0xb')],{'host':_0x11da('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x11da('0xb')]));require(_0x11da('0xd'))['register'](socket);function respondWithRpcPromise(_0xece2e9,_0xd8df99,_0x3768d7){return new BPromise(function(_0x2848d3,_0x419fc6){return client[_0x11da('0xe')](_0xece2e9,_0x3768d7)[_0x11da('0xf')](function(_0x392c37){logger[_0x11da('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xd8df99,_0x11da('0x11'));logger[_0x11da('0x12')](_0x11da('0x13'),_0xd8df99,_0x11da('0x11'),JSON[_0x11da('0x14')](_0x392c37));if(_0x392c37['error']){if(_0x392c37[_0x11da('0x15')][_0x11da('0x16')]===0x1f4){logger[_0x11da('0x15')](_0x11da('0x17'),_0xd8df99,_0x392c37[_0x11da('0x15')]['message']);return _0x419fc6(_0x392c37[_0x11da('0x15')]['message']);}logger[_0x11da('0x15')](_0x11da('0x17'),_0xd8df99,_0x392c37[_0x11da('0x15')][_0x11da('0x18')]);return _0x2848d3(_0x392c37[_0x11da('0x15')][_0x11da('0x18')]);}else{logger[_0x11da('0x10')](_0x11da('0x17'),_0xd8df99,_0x11da('0x11'));_0x2848d3(_0x392c37[_0x11da('0x19')][_0x11da('0x18')]);}})[_0x11da('0x1a')](function(_0x4c4cc6){logger[_0x11da('0x15')](_0x11da('0x17'),_0xd8df99,_0x4c4cc6);_0x419fc6(_0x4c4cc6);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index ae20e2c..b2eaed9 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 _0x8a36=['update','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x15a83d,_0xb6113c){var _0x1e083d=function(_0x556957){while(--_0x556957){_0x15a83d['push'](_0x15a83d['shift']());}};_0x1e083d(++_0xb6113c);}(_0x8a36,0x9e));var _0x68a3=function(_0x23d16b,_0x4a0b80){_0x23d16b=_0x23d16b-0x0;var _0x2c00f9=_0x8a36[_0x23d16b];return _0x2c00f9;};'use strict';var ChatInternalMessageEvents=require(_0x68a3('0x0'));var events=['save',_0x68a3('0x1'),_0x68a3('0x2')];function createListener(_0x442104,_0x498f6b){return function(_0x1eb8d6){_0x498f6b['emit'](_0x442104,_0x1eb8d6);};}function removeListener(_0x4c499f,_0x5b9bd2){return function(){ChatInternalMessageEvents['removeListener'](_0x4c499f,_0x5b9bd2);};}exports['register']=function(_0x63cd26){for(var _0x575e03=0x0,_0x573753=events['length'];_0x575e03<_0x573753;_0x575e03++){var _0x3880c1=events[_0x575e03];var _0x1ac8c5=createListener(_0x68a3('0x3')+_0x3880c1,_0x63cd26);ChatInternalMessageEvents['on'](_0x3880c1,_0x1ac8c5);}};
\ No newline at end of file
+var _0x6f7f=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x138908,_0x5dc238){var _0x35275c=function(_0x4d147b){while(--_0x4d147b){_0x138908['push'](_0x138908['shift']());}};_0x35275c(++_0x5dc238);}(_0x6f7f,0x95));var _0xf6f7=function(_0x1450c2,_0x54a781){_0x1450c2=_0x1450c2-0x0;var _0x56bc56=_0x6f7f[_0x1450c2];return _0x56bc56;};'use strict';var ChatInternalMessageEvents=require(_0xf6f7('0x0'));var events=[_0xf6f7('0x1'),_0xf6f7('0x2'),_0xf6f7('0x3')];function createListener(_0x40e605,_0xc63f23){return function(_0x17c481){_0xc63f23[_0xf6f7('0x4')](_0x40e605,_0x17c481);};}function removeListener(_0x325c3d,_0x4bc63f){return function(){ChatInternalMessageEvents[_0xf6f7('0x5')](_0x325c3d,_0x4bc63f);};}exports[_0xf6f7('0x6')]=function(_0x28c1ff){for(var _0x251a9b=0x0,_0x4735b1=events[_0xf6f7('0x7')];_0x251a9b<_0x4735b1;_0x251a9b++){var _0x252e9b=events[_0x251a9b];var _0x27dcd1=createListener(_0xf6f7('0x8')+_0x252e9b,_0x28c1ff);ChatInternalMessageEvents['on'](_0x252e9b,_0x27dcd1);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7af7eb5..8de274a 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 _0x1ae8=['describe','/users','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x2b6e42,_0x21a83e){var _0x37a98e=function(_0x5546ae){while(--_0x5546ae){_0x2b6e42['push'](_0x2b6e42['shift']());}};_0x37a98e(++_0x21a83e);}(_0x1ae8,0x9b));var _0x81ae=function(_0x4fb927,_0x42f767){_0x4fb927=_0x4fb927-0x0;var _0x2178ba=_0x1ae8[_0x4fb927];return _0x2178ba;};'use strict';var multer=require(_0x81ae('0x0'));var util=require(_0x81ae('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x81ae('0x2'));var router=express[_0x81ae('0x3')]();var fs_extra=require(_0x81ae('0x4'));var auth=require(_0x81ae('0x5'));var interaction=require(_0x81ae('0x6'));var config=require(_0x81ae('0x7'));var controller=require(_0x81ae('0x8'));router[_0x81ae('0x9')]('/',auth[_0x81ae('0xa')](),controller[_0x81ae('0xb')]);router[_0x81ae('0x9')](_0x81ae('0xc'),auth['isAuthenticated'](),controller[_0x81ae('0xd')]);router[_0x81ae('0x9')](_0x81ae('0xe'),auth[_0x81ae('0xa')](),controller['getUsers']);router[_0x81ae('0x9')]('/:id',auth[_0x81ae('0xa')](),controller[_0x81ae('0xf')]);router[_0x81ae('0x10')]('/',auth[_0x81ae('0xa')](),controller[_0x81ae('0x11')]);router[_0x81ae('0x12')](_0x81ae('0x13'),controller[_0x81ae('0x14')]);router[_0x81ae('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x81ae('0x16')]);module[_0x81ae('0x17')]=router;
\ No newline at end of file
+var _0x8ca8=['isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get'];(function(_0x2868ec,_0x29cc3a){var _0x48555c=function(_0x3b20c6){while(--_0x3b20c6){_0x2868ec['push'](_0x2868ec['shift']());}};_0x48555c(++_0x29cc3a);}(_0x8ca8,0x138));var _0x88ca=function(_0x5d5620,_0x3af923){_0x5d5620=_0x5d5620-0x0;var _0x40b9a=_0x8ca8[_0x5d5620];return _0x40b9a;};'use strict';var multer=require(_0x88ca('0x0'));var util=require(_0x88ca('0x1'));var path=require(_0x88ca('0x2'));var timeout=require(_0x88ca('0x3'));var express=require(_0x88ca('0x4'));var router=express['Router']();var fs_extra=require(_0x88ca('0x5'));var auth=require(_0x88ca('0x6'));var interaction=require(_0x88ca('0x7'));var config=require('../../config/environment');var controller=require(_0x88ca('0x8'));router[_0x88ca('0x9')]('/',auth[_0x88ca('0xa')](),controller[_0x88ca('0xb')]);router[_0x88ca('0x9')](_0x88ca('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x88ca('0xd'),auth[_0x88ca('0xa')](),controller[_0x88ca('0xe')]);router[_0x88ca('0x9')](_0x88ca('0xf'),auth[_0x88ca('0xa')](),controller[_0x88ca('0x10')]);router[_0x88ca('0x11')]('/',auth[_0x88ca('0xa')](),controller[_0x88ca('0x12')]);router[_0x88ca('0x13')](_0x88ca('0xf'),controller[_0x88ca('0x14')]);router['delete'](_0x88ca('0xf'),auth[_0x88ca('0xa')](),controller[_0x88ca('0x15')]);module[_0x88ca('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 727acf1..181775a 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 _0x9703=['ENUM','out','STRING','TEXT','medium','BOOLEAN'];(function(_0x789b5e,_0x48a84e){var _0x2922ae=function(_0x3e9817){while(--_0x3e9817){_0x789b5e['push'](_0x789b5e['shift']());}};_0x2922ae(++_0x48a84e);}(_0x9703,0xdb));var _0x3970=function(_0x2bf031,_0x2e84d8){_0x2bf031=_0x2bf031-0x0;var _0x215504=_0x9703[_0x2bf031];return _0x215504;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3970('0x0')](_0x3970('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3970('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3970('0x3')]('in','out'),'defaultValue':_0x3970('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3970('0x5')]},'providerResponse':{'type':Sequelize[_0x3970('0x0')]}};
\ No newline at end of file
+var _0xc04a=['STRING','sequelize','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x2e8aac,_0x27a922){var _0xf51dcf=function(_0x16bf54){while(--_0x16bf54){_0x2e8aac['push'](_0x2e8aac['shift']());}};_0xf51dcf(++_0x27a922);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac04('0x0'));module['exports']={'body':{'type':Sequelize[_0xac04('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xac04('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xac04('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xac04('0x3')]('in','out'),'defaultValue':_0xac04('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xac04('0x5')]},'providerName':{'type':Sequelize[_0xac04('0x6')]},'providerResponse':{'type':Sequelize[_0xac04('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index a4be0de..901fe42 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 _0x9a80=['update','destroy','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','ChatMessage','includeAll','include','findAll','rows','show','params','intersection','fields','find','body','describe','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','parse','formData','chat-interactions','RejectMessage','rejectMessage','sequelize','internal','interface','reject','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x394d73,_0x37f6bc){var _0x226422=function(_0x2fa25b){while(--_0x2fa25b){_0x394d73['push'](_0x394d73['shift']());}};_0x226422(++_0x37f6bc);}(_0x9a80,0x1d8));var _0x09a8=function(_0xa24a55,_0x5143fe){_0xa24a55=_0xa24a55-0x0;var _0x37439c=_0x9a80[_0xa24a55];return _0x37439c;};'use strict';var emlformat=require(_0x09a8('0x0'));var rimraf=require(_0x09a8('0x1'));var zipdir=require(_0x09a8('0x2'));var jsonpatch=require(_0x09a8('0x3'));var rp=require(_0x09a8('0x4'));var moment=require(_0x09a8('0x5'));var BPromise=require(_0x09a8('0x6'));var Mustache=require(_0x09a8('0x7'));var util=require(_0x09a8('0x8'));var path=require(_0x09a8('0x9'));var sox=require(_0x09a8('0xa'));var csv=require(_0x09a8('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09a8('0xc'));var _=require(_0x09a8('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x09a8('0xe'));var deskjs=require(_0x09a8('0xf'));var toCsv=require(_0x09a8('0xb'));var querystring=require(_0x09a8('0x10'));var Papa=require(_0x09a8('0x11'));var Redis=require(_0x09a8('0x12'));var authService=require(_0x09a8('0x13'));var qs=require(_0x09a8('0x14'));var as=require(_0x09a8('0x15'));var hardwareService=require(_0x09a8('0x16'));var logger=require(_0x09a8('0x17'))(_0x09a8('0x18'));var utils=require(_0x09a8('0x19'));var config=require(_0x09a8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x09a8('0x1b'))['db'];config[_0x09a8('0x1c')]=_[_0x09a8('0x1d')](config['redis'],{'host':_0x09a8('0x1e'),'port':0x18eb});var socket=require(_0x09a8('0x1f'))(new Redis(config['redis']));require(_0x09a8('0x20'))['register'](socket);var jayson=require(_0x09a8('0x21'));var client=jayson['client'][_0x09a8('0x22')]({'port':0x232c});var client9002=jayson[_0x09a8('0x23')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cb763,_0x5e86a8,_0x40fb60,_0x5e5eff){return new BPromise(function(_0x485f3b,_0x24d8c5){var _0x451347=_0x5e5eff||client;return _0x451347[_0x09a8('0x24')](_0x5cb763,_0x40fb60)[_0x09a8('0x25')](function(_0x2b7819){logger[_0x09a8('0x26')](_0x09a8('0x27'),_0x5e86a8,_0x09a8('0x28'));logger[_0x09a8('0x29')](_0x09a8('0x2a'),_0x5e86a8,_0x09a8('0x28'),JSON['stringify'](_0x2b7819));if(_0x2b7819[_0x09a8('0x2b')]){if(_0x2b7819['error'][_0x09a8('0x2c')]===0x1f4){logger[_0x09a8('0x2b')](_0x09a8('0x27'),_0x5e86a8,_0x2b7819[_0x09a8('0x2b')][_0x09a8('0x2d')]);return _0x24d8c5(_0x2b7819[_0x09a8('0x2b')][_0x09a8('0x2d')]);}logger[_0x09a8('0x2b')](_0x09a8('0x27'),_0x5e86a8,_0x2b7819['error'][_0x09a8('0x2d')]);return _0x485f3b(_0x2b7819['error'][_0x09a8('0x2d')]);}else{logger[_0x09a8('0x26')](_0x09a8('0x27'),_0x5e86a8,_0x09a8('0x28'));_0x485f3b(_0x2b7819[_0x09a8('0x2e')][_0x09a8('0x2d')]);}})[_0x09a8('0x2f')](function(_0x3cff03){logger['error'](_0x09a8('0x27'),_0x5e86a8,_0x3cff03);_0x24d8c5(_0x3cff03);});});}function respondWithStatusCode(_0x2390cb,_0xf1be){_0xf1be=_0xf1be||0xcc;return function(_0x4137fc){if(_0x4137fc){return _0x2390cb[_0x09a8('0x30')](_0xf1be);}return _0x2390cb[_0x09a8('0x31')](_0xf1be)[_0x09a8('0x32')]();};}function respondWithResult(_0xa547a2,_0xfa448b){_0xfa448b=_0xfa448b||0xc8;return function(_0x372234){if(_0x372234){return _0xa547a2['status'](_0xfa448b)[_0x09a8('0x33')](_0x372234);}};}function respondWithFilteredResult(_0x427c82,_0x36df33){return function(_0x203a36){if(_0x203a36){var _0x3df085=typeof _0x36df33[_0x09a8('0x34')]==='undefined'&&typeof _0x36df33[_0x09a8('0x35')]===_0x09a8('0x36');var _0x492da1=_0x203a36[_0x09a8('0x37')];var _0x3a57f6=_0x3df085?0x0:_0x36df33[_0x09a8('0x34')];var _0x40b2f1=_0x3df085?_0x203a36[_0x09a8('0x37')]:_0x36df33[_0x09a8('0x34')]+_0x36df33[_0x09a8('0x35')];var _0x19c83c;if(_0x40b2f1>=_0x492da1){_0x40b2f1=_0x492da1;_0x19c83c=0xc8;}else{_0x19c83c=0xce;}_0x427c82[_0x09a8('0x31')](_0x19c83c);return _0x427c82['set']('Content-Range',_0x3a57f6+'-'+_0x40b2f1+'/'+_0x492da1)[_0x09a8('0x33')](_0x203a36);}return null;};}function patchUpdates(_0x55b4a4){return function(_0x19d7d7){try{jsonpatch['apply'](_0x19d7d7,_0x55b4a4,!![]);}catch(_0x13f643){return BPromise['reject'](_0x13f643);}return _0x19d7d7['save']();};}function saveUpdates(_0x582f5b,_0xf3d35a){return function(_0x1bdafd){if(_0x1bdafd){return _0x1bdafd[_0x09a8('0x38')](_0x582f5b)['then'](function(_0x2cd4a5){return _0x2cd4a5;});}return null;};}function removeEntity(_0x253292,_0x1c04bb){return function(_0x4c0822){if(_0x4c0822){return _0x4c0822[_0x09a8('0x39')]()[_0x09a8('0x25')](function(){_0x253292[_0x09a8('0x31')](0xcc)[_0x09a8('0x32')]();});}};}function handleEntityNotFound(_0x26a646,_0x58edb2){return function(_0x9148e8){if(!_0x9148e8){_0x26a646[_0x09a8('0x30')](0x194);}return _0x9148e8;};}function handleError(_0x273227,_0x44022e){_0x44022e=_0x44022e||0x1f4;return function(_0x11dca7){logger[_0x09a8('0x2b')](_0x11dca7['stack']);if(_0x11dca7[_0x09a8('0x3a')]){delete _0x11dca7[_0x09a8('0x3a')];}_0x273227[_0x09a8('0x31')](_0x44022e)['send'](_0x11dca7);};}exports[_0x09a8('0x3b')]=function(_0x34edf5,_0x12fc13){var _0x3f3210={},_0xb9c44e={},_0x106e97={'count':0x0,'rows':[]};var _0x8e9dbc=_[_0x09a8('0x3c')](db['ChatMessage'][_0x09a8('0x3d')],function(_0x54a21a){return{'name':_0x54a21a[_0x09a8('0x3e')],'type':_0x54a21a[_0x09a8('0x3f')][_0x09a8('0x40')]};});_0xb9c44e['model']=_[_0x09a8('0x3c')](_0x8e9dbc,'name');_0xb9c44e['query']=_[_0x09a8('0x41')](_0x34edf5[_0x09a8('0x42')]);_0xb9c44e[_0x09a8('0x43')]=_['intersection'](_0xb9c44e[_0x09a8('0x44')],_0xb9c44e[_0x09a8('0x42')]);_0x3f3210[_0x09a8('0x45')]=_['intersection'](_0xb9c44e['model'],qs['fields'](_0x34edf5['query']['fields']));_0x3f3210['attributes']=_0x3f3210[_0x09a8('0x45')][_0x09a8('0x46')]?_0x3f3210[_0x09a8('0x45')]:_0xb9c44e['model'];if(!_0x34edf5[_0x09a8('0x42')][_0x09a8('0x47')](_0x09a8('0x48'))){_0x3f3210[_0x09a8('0x35')]=qs[_0x09a8('0x35')](_0x34edf5[_0x09a8('0x42')]['limit']);_0x3f3210[_0x09a8('0x34')]=qs[_0x09a8('0x34')](_0x34edf5[_0x09a8('0x42')]['offset']);}_0x3f3210[_0x09a8('0x49')]=qs[_0x09a8('0x4a')](_0x34edf5[_0x09a8('0x42')][_0x09a8('0x4a')]);_0x3f3210['where']=qs[_0x09a8('0x43')](_['pick'](_0x34edf5[_0x09a8('0x42')],_0xb9c44e['filters']),_0x8e9dbc);if(_0x34edf5[_0x09a8('0x42')][_0x09a8('0x4b')]){_0x3f3210[_0x09a8('0x4c')]=_[_0x09a8('0x4d')](_0x3f3210[_0x09a8('0x4c')],{'$or':_['map'](_0x8e9dbc,function(_0x23105f){if(_0x23105f[_0x09a8('0x3f')]!=='VIRTUAL'){var _0x16c4f5={};_0x16c4f5[_0x23105f[_0x09a8('0x3a')]]={'$like':'%'+_0x34edf5[_0x09a8('0x42')][_0x09a8('0x4b')]+'%'};return _0x16c4f5;}})});}_0x3f3210=_[_0x09a8('0x4d')]({},_0x3f3210,_0x34edf5[_0x09a8('0x4e')]);var _0x17d6c3={'where':_0x3f3210['where']};return db[_0x09a8('0x4f')][_0x09a8('0x37')](_0x17d6c3)[_0x09a8('0x25')](function(_0x16163c){_0x106e97['count']=_0x16163c;if(_0x34edf5[_0x09a8('0x42')][_0x09a8('0x50')]){_0x3f3210[_0x09a8('0x51')]=[{'all':!![]}];}return db[_0x09a8('0x4f')][_0x09a8('0x52')](_0x3f3210);})['then'](function(_0x5c5c12){_0x106e97[_0x09a8('0x53')]=_0x5c5c12;return _0x106e97;})['then'](respondWithFilteredResult(_0x12fc13,_0x3f3210))[_0x09a8('0x2f')](handleError(_0x12fc13,null));};exports[_0x09a8('0x54')]=function(_0x184526,_0x3aa36a){var _0x92ffcb={'raw':!![],'where':{'id':_0x184526[_0x09a8('0x55')]['id']}},_0x5357ed={};_0x5357ed['model']=_[_0x09a8('0x41')](db[_0x09a8('0x4f')]['rawAttributes']);_0x5357ed[_0x09a8('0x42')]=_[_0x09a8('0x41')](_0x184526['query']);_0x5357ed['filters']=_['intersection'](_0x5357ed[_0x09a8('0x44')],_0x5357ed[_0x09a8('0x42')]);_0x92ffcb[_0x09a8('0x45')]=_[_0x09a8('0x56')](_0x5357ed[_0x09a8('0x44')],qs[_0x09a8('0x57')](_0x184526[_0x09a8('0x42')][_0x09a8('0x57')]));_0x92ffcb['attributes']=_0x92ffcb[_0x09a8('0x45')]['length']?_0x92ffcb[_0x09a8('0x45')]:_0x5357ed[_0x09a8('0x44')];if(_0x184526[_0x09a8('0x42')]['includeAll']){_0x92ffcb[_0x09a8('0x51')]=[{'all':!![]}];}_0x92ffcb=_[_0x09a8('0x4d')]({},_0x92ffcb,_0x184526[_0x09a8('0x4e')]);return db[_0x09a8('0x4f')][_0x09a8('0x58')](_0x92ffcb)[_0x09a8('0x25')](handleEntityNotFound(_0x3aa36a,null))[_0x09a8('0x25')](respondWithResult(_0x3aa36a,null))[_0x09a8('0x2f')](handleError(_0x3aa36a,null));};exports['create']=function(_0x3ea283,_0x4a1e5b){return db['ChatMessage']['create'](_0x3ea283[_0x09a8('0x59')],{})[_0x09a8('0x25')](respondWithResult(_0x4a1e5b,0xc9))[_0x09a8('0x2f')](handleError(_0x4a1e5b,null));};exports['update']=function(_0x511203,_0x5b36c5){if(_0x511203[_0x09a8('0x59')]['id']){delete _0x511203['body']['id'];}return db[_0x09a8('0x4f')][_0x09a8('0x58')]({'where':{'id':_0x511203[_0x09a8('0x55')]['id']}})[_0x09a8('0x25')](handleEntityNotFound(_0x5b36c5,null))[_0x09a8('0x25')](saveUpdates(_0x511203[_0x09a8('0x59')],null))['then'](respondWithResult(_0x5b36c5,null))[_0x09a8('0x2f')](handleError(_0x5b36c5,null));};exports[_0x09a8('0x39')]=function(_0x3614c8,_0x2d5f1d){return db[_0x09a8('0x4f')]['find']({'where':{'id':_0x3614c8[_0x09a8('0x55')]['id']}})[_0x09a8('0x25')](handleEntityNotFound(_0x2d5f1d,null))[_0x09a8('0x25')](removeEntity(_0x2d5f1d,null))[_0x09a8('0x2f')](handleError(_0x2d5f1d,null));};exports[_0x09a8('0x5a')]=function(_0x2f8b5f,_0x92eb71){return db[_0x09a8('0x4f')]['describe']()[_0x09a8('0x25')](respondWithResult(_0x92eb71,null))['catch'](handleError(_0x92eb71,null));};var interaction_log=require(_0x09a8('0x17'))('chat-interactions');exports['accept']=function(_0x52b38f,_0x59cce4,_0x478146){var _0x127b26={'agent':{},'channel':_0x09a8('0x5b')};if(_0x52b38f[_0x09a8('0x59')]['id']){delete _0x52b38f['body']['id'];}_0x52b38f[_0x09a8('0x59')][_0x09a8('0x5c')]=!![];_0x52b38f[_0x09a8('0x59')][_0x09a8('0x5d')]=moment()[_0x09a8('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x52b38f[_0x09a8('0x59')]['UserId']=_0x52b38f[_0x09a8('0x59')][_0x09a8('0x5f')]||_0x52b38f[_0x09a8('0x60')]['id'];_0x127b26[_0x09a8('0x61')]['id']=_0x52b38f[_0x09a8('0x59')][_0x09a8('0x5f')];return db[_0x09a8('0x4f')][_0x09a8('0x58')]({'where':{'id':_0x52b38f[_0x09a8('0x55')]['id'],'UserId':null}})[_0x09a8('0x25')](handleEntityNotFound(_0x59cce4,null))[_0x09a8('0x25')](saveUpdates(_0x52b38f[_0x09a8('0x59')],null))[_0x09a8('0x25')](function(_0x4a6886){if(_0x4a6886){_0x127b26[_0x09a8('0x2d')]=_0x4a6886[_0x09a8('0x62')]({'plain':!![]});return db[_0x09a8('0x63')][_0x09a8('0x58')]({'where':{'id':_0x4a6886[_0x09a8('0x64')]}});}return null;})[_0x09a8('0x25')](handleEntityNotFound(_0x59cce4,null))[_0x09a8('0x25')](function(_0x377409){if(_0x377409){return _0x377409['update']({'UserId':_0x52b38f[_0x09a8('0x59')][_0x09a8('0x5f')],'read1stAt':_['isNil'](_0x377409[_0x09a8('0x65')])?moment()[_0x09a8('0x5e')](_0x09a8('0x66')):undefined});}return null;})[_0x09a8('0x25')](function(_0x145927){if(_0x145927){_0x127b26[_0x09a8('0x67')]=_0x145927[_0x09a8('0x62')]({'plain':!![]});interaction_log[_0x09a8('0x26')](_0x09a8('0x68'),_0x52b38f['user']['id'],_0x52b38f[_0x09a8('0x60')][_0x09a8('0x3a')],_0x52b38f[_0x09a8('0x60')][_0x09a8('0x69')],_0x127b26[_0x09a8('0x67')]['id'],_0x52b38f[_0x09a8('0x59')]?JSON[_0x09a8('0x6a')](_0x52b38f[_0x09a8('0x59')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x127b26);}return null;})[_0x09a8('0x25')](function(_0x437999){var _0x4009d1=_0x09a8('0x6b')+_0x437999[_0x09a8('0x2d')][_0x09a8('0x6c')];return db['sequelize']['query'](_0x4009d1,{'type':db[_0x09a8('0x6d')][_0x09a8('0x6e')][_0x09a8('0x6f')],'raw':!![]})[_0x09a8('0x25')](function(_0x1d624f){return _0x1d624f;});})[_0x09a8('0x25')](function(_0xd7e2e9){if(_0xd7e2e9){_0x127b26['message'][_0x09a8('0x70')]=_0xd7e2e9[0x0];if(!_0x52b38f[_0x09a8('0x59')][_0x09a8('0x5f')])return;return db['User'][_0x09a8('0x58')]({'where':{'id':_0x52b38f[_0x09a8('0x59')]['UserId'],'role':_0x09a8('0x61')},'attributes':['id',_0x09a8('0x3a'),_0x09a8('0x71'),_0x09a8('0x72'),'internal'],'raw':!![]});}return null;})[_0x09a8('0x25')](function(_0x17fa8f){if(!_0x17fa8f)return null;_0x127b26[_0x09a8('0x2d')]['agent']=_0x17fa8f;return _0x127b26;})[_0x09a8('0x25')](function(_0x139786){if(_0x139786){if(_0x52b38f['body'][_0x09a8('0x73')]){_0x127b26['message']['interface']=util[_0x09a8('0x5e')](_0x09a8('0x74'),_0x52b38f['user'][_0x09a8('0x3a')]);_0x127b26['message']['channel']=_0x127b26[_0x09a8('0x75')];_0x127b26['message'][_0x09a8('0x76')]=_0x127b26[_0x09a8('0x75')];_0x127b26[_0x09a8('0x2d')][_0x09a8('0x77')]=_0x09a8('0x78');return respondWithRpcPromise(_0x09a8('0x79'),_0x09a8('0x79'),{'event':'acceptmessage','message':_[_0x09a8('0x4d')](_0x127b26[_0x09a8('0x2d')],JSON[_0x09a8('0x7a')](_0x127b26[_0x09a8('0x67')][_0x09a8('0x7b')]))},client9002)['then'](function(){return _0x127b26;});}return _0x127b26;}return null;})[_0x09a8('0x25')](respondWithResult(_0x59cce4,null))['catch'](handleError(_0x59cce4,null));};var interaction_log=require(_0x09a8('0x17'))(_0x09a8('0x7c'));exports['reject']=function(_0x4d3ddb,_0x366b97,_0x434174){var _0x5adead={'agent':{},'channel':'chat'};if(_0x4d3ddb[_0x09a8('0x59')]['id']){delete _0x4d3ddb[_0x09a8('0x59')]['id'];}_0x4d3ddb['body'][_0x09a8('0x5f')]=_0x4d3ddb[_0x09a8('0x59')][_0x09a8('0x5f')]||_0x4d3ddb[_0x09a8('0x60')]['id'];_0x5adead[_0x09a8('0x61')]['id']=_0x4d3ddb[_0x09a8('0x59')][_0x09a8('0x5f')];return db['ChatMessage'][_0x09a8('0x58')]({'where':{'id':_0x4d3ddb['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x366b97,null))[_0x09a8('0x25')](function(_0x1d6a21){if(_0x1d6a21){_0x5adead['message']=_0x1d6a21[_0x09a8('0x62')]({'plain':!![]});return db[_0x09a8('0x63')][_0x09a8('0x58')]({'where':{'id':_0x1d6a21[_0x09a8('0x64')]}});}return null;})[_0x09a8('0x25')](handleEntityNotFound(_0x366b97,null))[_0x09a8('0x25')](function(_0x5a65ed){if(_0x5a65ed){_0x5adead[_0x09a8('0x67')]=_0x5a65ed[_0x09a8('0x62')]({'plain':!![]});interaction_log[_0x09a8('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d3ddb[_0x09a8('0x60')]['id'],_0x4d3ddb[_0x09a8('0x60')][_0x09a8('0x3a')],_0x4d3ddb[_0x09a8('0x60')]['role'],_0x5adead[_0x09a8('0x67')]['id'],_0x4d3ddb[_0x09a8('0x59')]?JSON[_0x09a8('0x6a')](_0x4d3ddb['body']):'null');return respondWithRpcPromise(_0x09a8('0x7d'),_0x09a8('0x7e'),_0x5adead);}return null;})[_0x09a8('0x25')](function(_0x20535f){var _0x27e49a=_0x09a8('0x6b')+_0x20535f[_0x09a8('0x2d')]['ContactId'];return db[_0x09a8('0x7f')]['query'](_0x27e49a,{'type':db[_0x09a8('0x6d')][_0x09a8('0x6e')][_0x09a8('0x6f')],'raw':!![]})[_0x09a8('0x25')](function(_0xab4bf3){return _0xab4bf3;});})['then'](function(_0x1bd9f7){if(_0x1bd9f7){_0x5adead[_0x09a8('0x2d')]['contact']=_0x1bd9f7[0x0];if(!_0x4d3ddb[_0x09a8('0x59')][_0x09a8('0x5f')])return;return db['User']['find']({'where':{'id':_0x4d3ddb[_0x09a8('0x59')][_0x09a8('0x5f')],'role':_0x09a8('0x61')},'attributes':['id',_0x09a8('0x3a'),_0x09a8('0x71'),_0x09a8('0x72'),_0x09a8('0x80')],'raw':!![]});}return null;})[_0x09a8('0x25')](function(_0x5b3083){if(!_0x5b3083)return null;_0x5adead[_0x09a8('0x2d')][_0x09a8('0x61')]=_0x5b3083;return _0x5adead;})[_0x09a8('0x25')](function(_0x269cd1){if(_0x269cd1){_0x269cd1[_0x09a8('0x2d')][_0x09a8('0x81')]=util[_0x09a8('0x5e')]('SIP/%s',_0x4d3ddb[_0x09a8('0x60')][_0x09a8('0x3a')]);_0x269cd1[_0x09a8('0x2d')][_0x09a8('0x75')]=_0x5adead[_0x09a8('0x75')];_0x269cd1[_0x09a8('0x2d')][_0x09a8('0x76')]=_0x5adead[_0x09a8('0x75')];_0x269cd1[_0x09a8('0x2d')][_0x09a8('0x77')]=_0x09a8('0x82');respondWithRpcPromise(_0x09a8('0x79'),'EventManager',{'event':_0x09a8('0x83'),'message':_[_0x09a8('0x4d')](_0x5adead[_0x09a8('0x2d')],JSON[_0x09a8('0x7a')](_0x5adead[_0x09a8('0x67')][_0x09a8('0x7b')]))},client9002);return _0x5adead;}return null;})[_0x09a8('0x25')](respondWithResult(_0x366b97,null))[_0x09a8('0x2f')](handleError(_0x366b97,null));};
\ No newline at end of file
+var _0x6733=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','show','rawAttributes','length','include','find','create','body','params','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','parse','formData','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','internal','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','client','http','then','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','keys','query','filters'];(function(_0x5704b1,_0xbc7e5c){var _0x2c4b2a=function(_0x5deb10){while(--_0x5deb10){_0x5704b1['push'](_0x5704b1['shift']());}};_0x2c4b2a(++_0xbc7e5c);}(_0x6733,0x149));var _0x3673=function(_0x455ebd,_0x4aad19){_0x455ebd=_0x455ebd-0x0;var _0x188d1b=_0x6733[_0x455ebd];return _0x188d1b;};'use strict';var emlformat=require(_0x3673('0x0'));var rimraf=require(_0x3673('0x1'));var zipdir=require(_0x3673('0x2'));var jsonpatch=require(_0x3673('0x3'));var rp=require(_0x3673('0x4'));var moment=require(_0x3673('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3673('0x6'));var path=require(_0x3673('0x7'));var sox=require(_0x3673('0x8'));var csv=require(_0x3673('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3673('0xa'));var _=require(_0x3673('0xb'));var squel=require(_0x3673('0xc'));var crypto=require('crypto');var jsforce=require(_0x3673('0xd'));var deskjs=require(_0x3673('0xe'));var toCsv=require(_0x3673('0x9'));var querystring=require('querystring');var Papa=require(_0x3673('0xf'));var Redis=require(_0x3673('0x10'));var authService=require(_0x3673('0x11'));var qs=require(_0x3673('0x12'));var as=require(_0x3673('0x13'));var hardwareService=require(_0x3673('0x14'));var logger=require(_0x3673('0x15'))(_0x3673('0x16'));var utils=require('../../config/utils');var config=require(_0x3673('0x17'));var licenseUtil=require(_0x3673('0x18'));var db=require(_0x3673('0x19'))['db'];config['redis']=_[_0x3673('0x1a')](config['redis'],{'host':_0x3673('0x1b'),'port':0x18eb});var socket=require(_0x3673('0x1c'))(new Redis(config[_0x3673('0x1d')]));require(_0x3673('0x1e'))[_0x3673('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3673('0x20')][_0x3673('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x40653e,_0x2ccf82,_0x5aac5f,_0x4dbd90){return new BPromise(function(_0x5c7ff7,_0x1f48e7){var _0x169f42=_0x4dbd90||client;return _0x169f42['request'](_0x40653e,_0x5aac5f)[_0x3673('0x22')](function(_0x24ca40){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2ccf82,_0x3673('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2ccf82,_0x3673('0x23'),JSON[_0x3673('0x24')](_0x24ca40));if(_0x24ca40[_0x3673('0x25')]){if(_0x24ca40[_0x3673('0x25')][_0x3673('0x26')]===0x1f4){logger['error'](_0x3673('0x27'),_0x2ccf82,_0x24ca40[_0x3673('0x25')]['message']);return _0x1f48e7(_0x24ca40[_0x3673('0x25')]['message']);}logger[_0x3673('0x25')](_0x3673('0x27'),_0x2ccf82,_0x24ca40[_0x3673('0x25')][_0x3673('0x28')]);return _0x5c7ff7(_0x24ca40[_0x3673('0x25')][_0x3673('0x28')]);}else{logger[_0x3673('0x29')](_0x3673('0x27'),_0x2ccf82,_0x3673('0x23'));_0x5c7ff7(_0x24ca40['result'][_0x3673('0x28')]);}})[_0x3673('0x2a')](function(_0x3c1ea8){logger[_0x3673('0x25')](_0x3673('0x27'),_0x2ccf82,_0x3c1ea8);_0x1f48e7(_0x3c1ea8);});});}function respondWithStatusCode(_0x460edb,_0x5c8221){_0x5c8221=_0x5c8221||0xcc;return function(_0x3c24f3){if(_0x3c24f3){return _0x460edb[_0x3673('0x2b')](_0x5c8221);}return _0x460edb[_0x3673('0x2c')](_0x5c8221)[_0x3673('0x2d')]();};}function respondWithResult(_0x5e4e9f,_0x2aec92){_0x2aec92=_0x2aec92||0xc8;return function(_0xfbd634){if(_0xfbd634){return _0x5e4e9f[_0x3673('0x2c')](_0x2aec92)[_0x3673('0x2e')](_0xfbd634);}};}function respondWithFilteredResult(_0x4bac56,_0x22f475){return function(_0x622fc){if(_0x622fc){var _0xb9335f=typeof _0x22f475[_0x3673('0x2f')]===_0x3673('0x30')&&typeof _0x22f475[_0x3673('0x31')]===_0x3673('0x30');var _0x1a1e80=_0x622fc[_0x3673('0x32')];var _0x4bcff0=_0xb9335f?0x0:_0x22f475[_0x3673('0x2f')];var _0x44c1b4=_0xb9335f?_0x622fc[_0x3673('0x32')]:_0x22f475[_0x3673('0x2f')]+_0x22f475[_0x3673('0x31')];var _0x510cbb;if(_0x44c1b4>=_0x1a1e80){_0x44c1b4=_0x1a1e80;_0x510cbb=0xc8;}else{_0x510cbb=0xce;}_0x4bac56[_0x3673('0x2c')](_0x510cbb);return _0x4bac56['set'](_0x3673('0x33'),_0x4bcff0+'-'+_0x44c1b4+'/'+_0x1a1e80)[_0x3673('0x2e')](_0x622fc);}return null;};}function patchUpdates(_0x4f82ff){return function(_0x4d60d6){try{jsonpatch[_0x3673('0x34')](_0x4d60d6,_0x4f82ff,!![]);}catch(_0x10e854){return BPromise[_0x3673('0x35')](_0x10e854);}return _0x4d60d6[_0x3673('0x36')]();};}function saveUpdates(_0x5649bc,_0x1c686e){return function(_0x5194dc){if(_0x5194dc){return _0x5194dc[_0x3673('0x37')](_0x5649bc)[_0x3673('0x22')](function(_0xba4bff){return _0xba4bff;});}return null;};}function removeEntity(_0x1ecc52,_0x48c971){return function(_0xf14e63){if(_0xf14e63){return _0xf14e63[_0x3673('0x38')]()[_0x3673('0x22')](function(){_0x1ecc52[_0x3673('0x2c')](0xcc)[_0x3673('0x2d')]();});}};}function handleEntityNotFound(_0xb8352,_0x10a7e3){return function(_0x4d5788){if(!_0x4d5788){_0xb8352[_0x3673('0x2b')](0x194);}return _0x4d5788;};}function handleError(_0x142408,_0x59226e){_0x59226e=_0x59226e||0x1f4;return function(_0x3736c7){logger['error'](_0x3736c7[_0x3673('0x39')]);if(_0x3736c7[_0x3673('0x3a')]){delete _0x3736c7['name'];}_0x142408[_0x3673('0x2c')](_0x59226e)[_0x3673('0x3b')](_0x3736c7);};}exports[_0x3673('0x3c')]=function(_0x5ae3c2,_0x39de1d){var _0x39b4e8={},_0x12688e={},_0x5da851={'count':0x0,'rows':[]};var _0x53e4a6=_[_0x3673('0x3d')](db[_0x3673('0x3e')]['rawAttributes'],function(_0x3d7e23){return{'name':_0x3d7e23[_0x3673('0x3f')],'type':_0x3d7e23[_0x3673('0x40')][_0x3673('0x41')]};});_0x12688e[_0x3673('0x42')]=_[_0x3673('0x3d')](_0x53e4a6,'name');_0x12688e['query']=_[_0x3673('0x43')](_0x5ae3c2[_0x3673('0x44')]);_0x12688e[_0x3673('0x45')]=_[_0x3673('0x46')](_0x12688e[_0x3673('0x42')],_0x12688e[_0x3673('0x44')]);_0x39b4e8[_0x3673('0x47')]=_[_0x3673('0x46')](_0x12688e[_0x3673('0x42')],qs[_0x3673('0x48')](_0x5ae3c2[_0x3673('0x44')]['fields']));_0x39b4e8[_0x3673('0x47')]=_0x39b4e8[_0x3673('0x47')]['length']?_0x39b4e8[_0x3673('0x47')]:_0x12688e[_0x3673('0x42')];if(!_0x5ae3c2[_0x3673('0x44')][_0x3673('0x49')](_0x3673('0x4a'))){_0x39b4e8[_0x3673('0x31')]=qs[_0x3673('0x31')](_0x5ae3c2['query']['limit']);_0x39b4e8['offset']=qs[_0x3673('0x2f')](_0x5ae3c2[_0x3673('0x44')][_0x3673('0x2f')]);}_0x39b4e8[_0x3673('0x4b')]=qs[_0x3673('0x4c')](_0x5ae3c2[_0x3673('0x44')]['sort']);_0x39b4e8[_0x3673('0x4d')]=qs[_0x3673('0x45')](_['pick'](_0x5ae3c2[_0x3673('0x44')],_0x12688e['filters']),_0x53e4a6);if(_0x5ae3c2[_0x3673('0x44')][_0x3673('0x4e')]){_0x39b4e8[_0x3673('0x4d')]=_['merge'](_0x39b4e8[_0x3673('0x4d')],{'$or':_[_0x3673('0x3d')](_0x53e4a6,function(_0x591501){if(_0x591501['type']!==_0x3673('0x4f')){var _0x373c9d={};_0x373c9d[_0x591501['name']]={'$like':'%'+_0x5ae3c2[_0x3673('0x44')][_0x3673('0x4e')]+'%'};return _0x373c9d;}})});}_0x39b4e8=_[_0x3673('0x50')]({},_0x39b4e8,_0x5ae3c2[_0x3673('0x51')]);var _0x17d256={'where':_0x39b4e8[_0x3673('0x4d')]};return db[_0x3673('0x3e')][_0x3673('0x32')](_0x17d256)[_0x3673('0x22')](function(_0x454708){_0x5da851['count']=_0x454708;if(_0x5ae3c2[_0x3673('0x44')][_0x3673('0x52')]){_0x39b4e8['include']=[{'all':!![]}];}return db[_0x3673('0x3e')][_0x3673('0x53')](_0x39b4e8);})[_0x3673('0x22')](function(_0x467e4a){_0x5da851['rows']=_0x467e4a;return _0x5da851;})[_0x3673('0x22')](respondWithFilteredResult(_0x39de1d,_0x39b4e8))[_0x3673('0x2a')](handleError(_0x39de1d,null));};exports[_0x3673('0x54')]=function(_0x5f2cff,_0x3eee78){var _0x92b627={'raw':!![],'where':{'id':_0x5f2cff['params']['id']}},_0x4c2338={};_0x4c2338['model']=_[_0x3673('0x43')](db['ChatMessage'][_0x3673('0x55')]);_0x4c2338[_0x3673('0x44')]=_[_0x3673('0x43')](_0x5f2cff['query']);_0x4c2338[_0x3673('0x45')]=_[_0x3673('0x46')](_0x4c2338[_0x3673('0x42')],_0x4c2338[_0x3673('0x44')]);_0x92b627[_0x3673('0x47')]=_['intersection'](_0x4c2338[_0x3673('0x42')],qs[_0x3673('0x48')](_0x5f2cff['query']['fields']));_0x92b627[_0x3673('0x47')]=_0x92b627['attributes'][_0x3673('0x56')]?_0x92b627[_0x3673('0x47')]:_0x4c2338['model'];if(_0x5f2cff[_0x3673('0x44')][_0x3673('0x52')]){_0x92b627[_0x3673('0x57')]=[{'all':!![]}];}_0x92b627=_[_0x3673('0x50')]({},_0x92b627,_0x5f2cff[_0x3673('0x51')]);return db[_0x3673('0x3e')][_0x3673('0x58')](_0x92b627)[_0x3673('0x22')](handleEntityNotFound(_0x3eee78,null))[_0x3673('0x22')](respondWithResult(_0x3eee78,null))[_0x3673('0x2a')](handleError(_0x3eee78,null));};exports[_0x3673('0x59')]=function(_0x2929ff,_0x404a20){return db[_0x3673('0x3e')]['create'](_0x2929ff[_0x3673('0x5a')],{})[_0x3673('0x22')](respondWithResult(_0x404a20,0xc9))['catch'](handleError(_0x404a20,null));};exports['update']=function(_0x1b50f2,_0x607186){if(_0x1b50f2[_0x3673('0x5a')]['id']){delete _0x1b50f2['body']['id'];}return db[_0x3673('0x3e')][_0x3673('0x58')]({'where':{'id':_0x1b50f2['params']['id']}})[_0x3673('0x22')](handleEntityNotFound(_0x607186,null))['then'](saveUpdates(_0x1b50f2[_0x3673('0x5a')],null))['then'](respondWithResult(_0x607186,null))[_0x3673('0x2a')](handleError(_0x607186,null));};exports[_0x3673('0x38')]=function(_0x5730e7,_0x2bcf4a){return db[_0x3673('0x3e')][_0x3673('0x58')]({'where':{'id':_0x5730e7[_0x3673('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2bcf4a,null))[_0x3673('0x22')](removeEntity(_0x2bcf4a,null))[_0x3673('0x2a')](handleError(_0x2bcf4a,null));};exports[_0x3673('0x5c')]=function(_0x4152ca,_0x4fb68a){return db[_0x3673('0x3e')][_0x3673('0x5c')]()[_0x3673('0x22')](respondWithResult(_0x4fb68a,null))[_0x3673('0x2a')](handleError(_0x4fb68a,null));};var interaction_log=require(_0x3673('0x15'))(_0x3673('0x5d'));exports[_0x3673('0x5e')]=function(_0x2c77a3,_0x51f9c8,_0x1be76d){var _0x4fc6e8={'agent':{},'channel':_0x3673('0x5f')};if(_0x2c77a3[_0x3673('0x5a')]['id']){delete _0x2c77a3['body']['id'];}_0x2c77a3[_0x3673('0x5a')]['read']=!![];_0x2c77a3[_0x3673('0x5a')][_0x3673('0x60')]=moment()[_0x3673('0x61')](_0x3673('0x62'));_0x2c77a3[_0x3673('0x5a')][_0x3673('0x63')]=_0x2c77a3['body']['UserId']||_0x2c77a3[_0x3673('0x64')]['id'];_0x4fc6e8[_0x3673('0x65')]['id']=_0x2c77a3['body']['UserId'];return db[_0x3673('0x3e')][_0x3673('0x58')]({'where':{'id':_0x2c77a3[_0x3673('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51f9c8,null))[_0x3673('0x22')](saveUpdates(_0x2c77a3[_0x3673('0x5a')],null))[_0x3673('0x22')](function(_0x5371bc){if(_0x5371bc){_0x4fc6e8['message']=_0x5371bc['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5371bc['ChatInteractionId']}});}return null;})[_0x3673('0x22')](handleEntityNotFound(_0x51f9c8,null))[_0x3673('0x22')](function(_0x19168d){if(_0x19168d){return _0x19168d[_0x3673('0x37')]({'UserId':_0x2c77a3[_0x3673('0x5a')][_0x3673('0x63')],'read1stAt':_[_0x3673('0x66')](_0x19168d['read1stAt'])?moment()['format'](_0x3673('0x62')):undefined});}return null;})[_0x3673('0x22')](function(_0x5b26ca){if(_0x5b26ca){_0x4fc6e8[_0x3673('0x67')]=_0x5b26ca['get']({'plain':!![]});interaction_log[_0x3673('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c77a3[_0x3673('0x64')]['id'],_0x2c77a3['user'][_0x3673('0x3a')],_0x2c77a3[_0x3673('0x64')][_0x3673('0x68')],_0x4fc6e8['interaction']['id'],_0x2c77a3[_0x3673('0x5a')]?JSON[_0x3673('0x24')](_0x2c77a3['body']):_0x3673('0x69'));return respondWithRpcPromise(_0x3673('0x6a'),_0x3673('0x6b'),_0x4fc6e8);}return null;})['then'](function(_0x5a1879){var _0x395acc=_0x3673('0x6c')+_0x5a1879[_0x3673('0x28')]['ContactId'];return db[_0x3673('0x6d')]['query'](_0x395acc,{'type':db[_0x3673('0x6e')][_0x3673('0x6f')][_0x3673('0x70')],'raw':!![]})[_0x3673('0x22')](function(_0x290ea8){return _0x290ea8;});})[_0x3673('0x22')](function(_0x8398ee){if(_0x8398ee){_0x4fc6e8[_0x3673('0x28')][_0x3673('0x71')]=_0x8398ee[0x0];if(!_0x2c77a3[_0x3673('0x5a')][_0x3673('0x63')])return;return db[_0x3673('0x72')][_0x3673('0x58')]({'where':{'id':_0x2c77a3['body'][_0x3673('0x63')],'role':'agent'},'attributes':['id',_0x3673('0x3a'),_0x3673('0x73'),'email','internal'],'raw':!![]});}return null;})[_0x3673('0x22')](function(_0x543e48){if(!_0x543e48)return null;_0x4fc6e8[_0x3673('0x28')]['agent']=_0x543e48;return _0x4fc6e8;})['then'](function(_0x165d2d){if(_0x165d2d){if(_0x2c77a3[_0x3673('0x5a')][_0x3673('0x74')]){_0x4fc6e8[_0x3673('0x28')][_0x3673('0x75')]=util[_0x3673('0x61')](_0x3673('0x76'),_0x2c77a3[_0x3673('0x64')][_0x3673('0x3a')]);_0x4fc6e8[_0x3673('0x28')][_0x3673('0x77')]=_0x4fc6e8[_0x3673('0x77')];_0x4fc6e8[_0x3673('0x28')][_0x3673('0x78')]=_0x4fc6e8[_0x3673('0x77')];_0x4fc6e8[_0x3673('0x28')][_0x3673('0x79')]=_0x3673('0x5e');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3673('0x7a'),'message':_[_0x3673('0x50')](_0x4fc6e8[_0x3673('0x28')],JSON[_0x3673('0x7b')](_0x4fc6e8[_0x3673('0x67')][_0x3673('0x7c')]))},client9002)[_0x3673('0x22')](function(){return _0x4fc6e8;});}return _0x4fc6e8;}return null;})[_0x3673('0x22')](respondWithResult(_0x51f9c8,null))['catch'](handleError(_0x51f9c8,null));};var interaction_log=require(_0x3673('0x15'))(_0x3673('0x5d'));exports[_0x3673('0x35')]=function(_0x3201b4,_0x192fe6,_0x15c21d){var _0x57c9a5={'agent':{},'channel':_0x3673('0x5f')};if(_0x3201b4[_0x3673('0x5a')]['id']){delete _0x3201b4[_0x3673('0x5a')]['id'];}_0x3201b4[_0x3673('0x5a')][_0x3673('0x63')]=_0x3201b4[_0x3673('0x5a')]['UserId']||_0x3201b4[_0x3673('0x64')]['id'];_0x57c9a5[_0x3673('0x65')]['id']=_0x3201b4[_0x3673('0x5a')]['UserId'];return db['ChatMessage'][_0x3673('0x58')]({'where':{'id':_0x3201b4[_0x3673('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x192fe6,null))[_0x3673('0x22')](function(_0x159a77){if(_0x159a77){_0x57c9a5[_0x3673('0x28')]=_0x159a77[_0x3673('0x7d')]({'plain':!![]});return db[_0x3673('0x7e')][_0x3673('0x58')]({'where':{'id':_0x159a77[_0x3673('0x7f')]}});}return null;})['then'](handleEntityNotFound(_0x192fe6,null))[_0x3673('0x22')](function(_0x4ee287){if(_0x4ee287){_0x57c9a5[_0x3673('0x67')]=_0x4ee287['get']({'plain':!![]});interaction_log['info'](_0x3673('0x80'),_0x3201b4[_0x3673('0x64')]['id'],_0x3201b4['user'][_0x3673('0x3a')],_0x3201b4[_0x3673('0x64')][_0x3673('0x68')],_0x57c9a5[_0x3673('0x67')]['id'],_0x3201b4[_0x3673('0x5a')]?JSON['stringify'](_0x3201b4['body']):_0x3673('0x69'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x57c9a5);}return null;})[_0x3673('0x22')](function(_0x17a5bc){var _0x93ac9c=_0x3673('0x6c')+_0x17a5bc[_0x3673('0x28')][_0x3673('0x81')];return db[_0x3673('0x6d')]['query'](_0x93ac9c,{'type':db[_0x3673('0x6e')][_0x3673('0x6f')][_0x3673('0x70')],'raw':!![]})[_0x3673('0x22')](function(_0x52ee59){return _0x52ee59;});})[_0x3673('0x22')](function(_0x394932){if(_0x394932){_0x57c9a5[_0x3673('0x28')][_0x3673('0x71')]=_0x394932[0x0];if(!_0x3201b4[_0x3673('0x5a')][_0x3673('0x63')])return;return db[_0x3673('0x72')][_0x3673('0x58')]({'where':{'id':_0x3201b4[_0x3673('0x5a')][_0x3673('0x63')],'role':_0x3673('0x65')},'attributes':['id',_0x3673('0x3a'),_0x3673('0x73'),'email',_0x3673('0x82')],'raw':!![]});}return null;})[_0x3673('0x22')](function(_0x3acc17){if(!_0x3acc17)return null;_0x57c9a5[_0x3673('0x28')]['agent']=_0x3acc17;return _0x57c9a5;})['then'](function(_0x5c9961){if(_0x5c9961){_0x5c9961[_0x3673('0x28')][_0x3673('0x75')]=util[_0x3673('0x61')]('SIP/%s',_0x3201b4[_0x3673('0x64')]['name']);_0x5c9961[_0x3673('0x28')][_0x3673('0x77')]=_0x57c9a5[_0x3673('0x77')];_0x5c9961[_0x3673('0x28')][_0x3673('0x78')]=_0x57c9a5['channel'];_0x5c9961[_0x3673('0x28')]['event']=_0x3673('0x35');respondWithRpcPromise('EventManager',_0x3673('0x83'),{'event':_0x3673('0x84'),'message':_[_0x3673('0x50')](_0x57c9a5['message'],JSON[_0x3673('0x7b')](_0x57c9a5[_0x3673('0x67')][_0x3673('0x7c')]))},client9002);return _0x57c9a5;}return null;})[_0x3673('0x22')](respondWithResult(_0x192fe6,null))[_0x3673('0x2a')](handleError(_0x192fe6,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 1bac143..38dd240 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 _0xf702=['hasOwnProperty','exports','events','ChatMessage','setMaxListeners','save','update','emit'];(function(_0x3d20ee,_0x208821){var _0x2ad298=function(_0x2d92da){while(--_0x2d92da){_0x3d20ee['push'](_0x3d20ee['shift']());}};_0x2ad298(++_0x208821);}(_0xf702,0x16a));var _0x2f70=function(_0x83e8ae,_0x42b5cc){_0x83e8ae=_0x83e8ae-0x0;var _0x3a9c2b=_0xf702[_0x83e8ae];return _0x3a9c2b;};'use strict';var EventEmitter=require(_0x2f70('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x2f70('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2f70('0x2')](0x0);var events={'afterCreate':_0x2f70('0x3'),'afterUpdate':_0x2f70('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e5297){return function(_0x5e418c,_0x2ec4f7,_0x3532ce){ChatMessageEvents[_0x2f70('0x5')](_0x3e5297+':'+_0x5e418c['id'],_0x5e418c);ChatMessageEvents[_0x2f70('0x5')](_0x3e5297,_0x5e418c);_0x3532ce(null);};}for(var e in events){if(events[_0x2f70('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2f70('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x808a=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x5d6180,_0x42e0c0){var _0x5a17ad=function(_0xbd76cc){while(--_0xbd76cc){_0x5d6180['push'](_0x5d6180['shift']());}};_0x5a17ad(++_0x42e0c0);}(_0x808a,0x65));var _0xa808=function(_0x265721,_0x1503f2){_0x265721=_0x265721-0x0;var _0x11ec95=_0x808a[_0x265721];return _0x11ec95;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xa808('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa808('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa808('0x2')};function emitEvent(_0x4d72d9){return function(_0x17588f,_0x32e634,_0x1e7a0f){ChatMessageEvents[_0xa808('0x3')](_0x4d72d9+':'+_0x17588f['id'],_0x17588f);ChatMessageEvents[_0xa808('0x3')](_0x4d72d9,_0x17588f);_0x1e7a0f(null);};}for(var e in events){if(events[_0xa808('0x4')](e)){var event=events[e];ChatMessage[_0xa808('0x5')](e,emitEvent(event));}}module[_0xa808('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index aa21749..639cf7a 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 _0xa486=['isNil','findOne','then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xa486,0xd5));var _0x6a48=function(_0xd1836d,_0x212921){_0xd1836d=_0xd1836d-0x0;var _0x94f044=_0xa486[_0xd1836d];return _0x94f044;};'use strict';var _=require(_0x6a48('0x0'));var util=require('util');var logger=require(_0x6a48('0x1'))(_0x6a48('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a48('0x3'));var fs=require('fs');var path=require(_0x6a48('0x4'));var rimraf=require(_0x6a48('0x5'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x6a48('0x6')]=function(_0x3531c6,_0x1e4059){return _0x3531c6['define'](_0x6a48('0x7'),attributes,{'tableName':_0x6a48('0x8'),'paranoid':![],'indexes':[{'name':_0x6a48('0x9'),'fields':[_0x6a48('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2839e2,_0xf2aff3,_0x2c67a0){var _0x325077=_0x3531c6[_0x6a48('0xb')];var _0x45a159=_0x2839e2[_0x6a48('0xc')]({'plain':!![]});if(_0x45a159[_0x6a48('0xd')]['toLowerCase']()==='in'||_0x45a159[_0x6a48('0xd')][_0x6a48('0xe')]()===_0x6a48('0xf')&&!_0x45a159[_0x6a48('0x10')]&&!_[_0x6a48('0x11')](_0x45a159['UserId'])){_0x325077['ChatInteraction'][_0x6a48('0x12')]({'where':{'id':_0x45a159['ChatInteractionId']}})[_0x6a48('0x13')](function(_0x1b0be2){if(_0x1b0be2){_0x1b0be2['update']({'lastMsgAt':_0x45a159[_0x6a48('0x14')],'lastMsgDirection':_0x45a159[_0x6a48('0xd')][_0x6a48('0xe')]()});}})['catch'](function(_0x3f3775){console['error'](_0x3f3775);});}_0x2c67a0();}},'charset':_0x6a48('0x15'),'collate':_0x6a48('0x16')});};
\ No newline at end of file
+var _0xe29e=['catch','error','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe29e,0x188));var _0xee29=function(_0x3a9047,_0x6b36c2){_0x3a9047=_0x3a9047-0x0;var _0x2c23a3=_0xe29e[_0x3a9047];return _0x2c23a3;};'use strict';var _=require('lodash');var util=require(_0xee29('0x0'));var logger=require(_0xee29('0x1'))(_0xee29('0x2'));var moment=require(_0xee29('0x3'));var BPromise=require(_0xee29('0x4'));var rp=require(_0xee29('0x5'));var fs=require('fs');var path=require(_0xee29('0x6'));var rimraf=require(_0xee29('0x7'));var config=require(_0xee29('0x8'));var attributes=require('./chatMessage.attributes');module[_0xee29('0x9')]=function(_0x15b7c1,_0x1f503a){return _0x15b7c1[_0xee29('0xa')](_0xee29('0xb'),attributes,{'tableName':_0xee29('0xc'),'paranoid':![],'indexes':[{'name':_0xee29('0xd'),'fields':[_0xee29('0xe')],'type':_0xee29('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x291bc5,_0x2d8d74,_0x5edc84){var _0x1a6406=_0x15b7c1[_0xee29('0x10')];var _0x5788d6=_0x291bc5[_0xee29('0x11')]({'plain':!![]});if(_0x5788d6['direction'][_0xee29('0x12')]()==='in'||_0x5788d6[_0xee29('0x13')][_0xee29('0x12')]()===_0xee29('0x14')&&!_0x5788d6['secret']&&!_[_0xee29('0x15')](_0x5788d6[_0xee29('0x16')])){_0x1a6406[_0xee29('0x17')][_0xee29('0x18')]({'where':{'id':_0x5788d6[_0xee29('0x19')]}})[_0xee29('0x1a')](function(_0x18e557){if(_0x18e557){_0x18e557['update']({'lastMsgAt':_0x5788d6[_0xee29('0x1b')],'lastMsgDirection':_0x5788d6[_0xee29('0x13')][_0xee29('0x12')]()});}})[_0xee29('0x1c')](function(_0x34750e){console[_0xee29('0x1d')](_0x34750e);});}_0x5edc84();}},'charset':'utf8mb4','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 a1723de..aa08cb3 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 _0x39f8=['stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatMessage.socket','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x45df35,_0x2a678b){var _0x296707=function(_0xc797d8){while(--_0xc797d8){_0x45df35['push'](_0x45df35['shift']());}};_0x296707(++_0x2a678b);}(_0x39f8,0x70));var _0x839f=function(_0x45a588,_0x2361a9){_0x45a588=_0x45a588-0x0;var _0x180796=_0x39f8[_0x45a588];return _0x180796;};'use strict';var _=require(_0x839f('0x0'));var util=require(_0x839f('0x1'));var moment=require(_0x839f('0x2'));var BPromise=require(_0x839f('0x3'));var rs=require(_0x839f('0x4'));var fs=require('fs');var Redis=require(_0x839f('0x5'));var db=require(_0x839f('0x6'))['db'];var utils=require(_0x839f('0x7'));var logger=require(_0x839f('0x8'))('rpc');var config=require(_0x839f('0x9'));var jayson=require(_0x839f('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x839f('0xb')]=_['defaults'](config['redis'],{'host':_0x839f('0xc'),'port':0x18eb});var socket=require(_0x839f('0xd'))(new Redis(config[_0x839f('0xb')]));require(_0x839f('0xe'))['register'](socket);function respondWithRpcPromise(_0x282c01,_0x4533cb,_0x4bcf2f){return new BPromise(function(_0x229a2d,_0x3c12c3){return client[_0x839f('0xf')](_0x282c01,_0x4bcf2f)['then'](function(_0x5f14ef){logger[_0x839f('0x10')]('ChatMessage,\x20%s,\x20%s',_0x4533cb,_0x839f('0x11'));logger[_0x839f('0x12')](_0x839f('0x13'),_0x4533cb,_0x839f('0x11'),JSON[_0x839f('0x14')](_0x5f14ef));if(_0x5f14ef[_0x839f('0x15')]){if(_0x5f14ef['error'][_0x839f('0x16')]===0x1f4){logger[_0x839f('0x15')](_0x839f('0x17'),_0x4533cb,_0x5f14ef['error']['message']);return _0x3c12c3(_0x5f14ef[_0x839f('0x15')][_0x839f('0x18')]);}logger[_0x839f('0x15')](_0x839f('0x17'),_0x4533cb,_0x5f14ef[_0x839f('0x15')][_0x839f('0x18')]);return _0x229a2d(_0x5f14ef[_0x839f('0x15')][_0x839f('0x18')]);}else{logger['info'](_0x839f('0x17'),_0x4533cb,_0x839f('0x11'));_0x229a2d(_0x5f14ef[_0x839f('0x19')]['message']);}})[_0x839f('0x1a')](function(_0x1b3029){logger[_0x839f('0x15')](_0x839f('0x17'),_0x4533cb,_0x1b3029);_0x3c12c3(_0x1b3029);});});}exports[_0x839f('0x1b')]=function(_0x58fbee){var _0x55ffa2=this;return new Promise(function(_0x99d720,_0x4c2c72){return db[_0x839f('0x1c')][_0x839f('0x1d')](_0x58fbee[_0x839f('0x1e')],{'raw':_0x58fbee['options']?_0x58fbee['options'][_0x839f('0x1f')]===undefined?!![]:![]:!![]})[_0x839f('0x20')](function(_0x7cbd5b){logger[_0x839f('0x10')](_0x839f('0x1b'),_0x58fbee);logger[_0x839f('0x12')](_0x839f('0x1b'),_0x58fbee,JSON[_0x839f('0x14')](_0x7cbd5b));_0x99d720(_0x7cbd5b);})[_0x839f('0x1a')](function(_0x33df6e){logger['error']('CreateChatMessage',_0x33df6e[_0x839f('0x18')],_0x58fbee);_0x4c2c72(_0x55ffa2[_0x839f('0x15')](0x1f4,_0x33df6e[_0x839f('0x18')]));});});};
\ No newline at end of file
+var _0x7fcf=['../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','body','raw','lodash','util','bluebird','randomstring'];(function(_0x1ea301,_0x52a75e){var _0x36d758=function(_0x57eaed){while(--_0x57eaed){_0x1ea301['push'](_0x1ea301['shift']());}};_0x36d758(++_0x52a75e);}(_0x7fcf,0x128));var _0xf7fc=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7fcf[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xf7fc('0x0'));var util=require(_0xf7fc('0x1'));var moment=require('moment');var BPromise=require(_0xf7fc('0x2'));var rs=require(_0xf7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf7fc('0x4'));var logger=require(_0xf7fc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7fc('0x6'));var client=jayson[_0xf7fc('0x7')][_0xf7fc('0x8')]({'port':0x232a});config['redis']=_[_0xf7fc('0x9')](config[_0xf7fc('0xa')],{'host':_0xf7fc('0xb'),'port':0x18eb});var socket=require(_0xf7fc('0xc'))(new Redis(config['redis']));require(_0xf7fc('0xd'))[_0xf7fc('0xe')](socket);function respondWithRpcPromise(_0x3e20b9,_0x5c1f8f,_0xace7db){return new BPromise(function(_0x1d60ae,_0x1d75a3){return client[_0xf7fc('0xf')](_0x3e20b9,_0xace7db)[_0xf7fc('0x10')](function(_0x4db12e){logger['info'](_0xf7fc('0x11'),_0x5c1f8f,_0xf7fc('0x12'));logger[_0xf7fc('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5c1f8f,_0xf7fc('0x12'),JSON[_0xf7fc('0x14')](_0x4db12e));if(_0x4db12e['error']){if(_0x4db12e[_0xf7fc('0x15')][_0xf7fc('0x16')]===0x1f4){logger[_0xf7fc('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5c1f8f,_0x4db12e[_0xf7fc('0x15')][_0xf7fc('0x17')]);return _0x1d75a3(_0x4db12e[_0xf7fc('0x15')][_0xf7fc('0x17')]);}logger[_0xf7fc('0x15')](_0xf7fc('0x11'),_0x5c1f8f,_0x4db12e[_0xf7fc('0x15')][_0xf7fc('0x17')]);return _0x1d60ae(_0x4db12e['error'][_0xf7fc('0x17')]);}else{logger[_0xf7fc('0x18')](_0xf7fc('0x11'),_0x5c1f8f,_0xf7fc('0x12'));_0x1d60ae(_0x4db12e['result']['message']);}})[_0xf7fc('0x19')](function(_0x2226dc){logger[_0xf7fc('0x15')](_0xf7fc('0x11'),_0x5c1f8f,_0x2226dc);_0x1d75a3(_0x2226dc);});});}exports[_0xf7fc('0x1a')]=function(_0x493060){var _0x2634d1=this;return new Promise(function(_0x2ef355,_0x5052c0){return db[_0xf7fc('0x1b')]['create'](_0x493060[_0xf7fc('0x1c')],{'raw':_0x493060['options']?_0x493060['options'][_0xf7fc('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2926e2){logger[_0xf7fc('0x18')](_0xf7fc('0x1a'),_0x493060);logger[_0xf7fc('0x13')]('CreateChatMessage',_0x493060,JSON[_0xf7fc('0x14')](_0x2926e2));_0x2ef355(_0x2926e2);})['catch'](function(_0x43ede9){logger[_0xf7fc('0x15')](_0xf7fc('0x1a'),_0x43ede9[_0xf7fc('0x17')],_0x493060);_0x5052c0(_0x2634d1['error'](0x1f4,_0x43ede9['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index b4ef36f..c4baea4 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 _0x8ece=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x3ddce0,_0x11741e){var _0x567d64=function(_0x29a45b){while(--_0x29a45b){_0x3ddce0['push'](_0x3ddce0['shift']());}};_0x567d64(++_0x11741e);}(_0x8ece,0x195));var _0xe8ec=function(_0x1f4ea0,_0xf62d9b){_0x1f4ea0=_0x1f4ea0-0x0;var _0xc3d0ca=_0x8ece[_0x1f4ea0];return _0xc3d0ca;};'use strict';var ChatMessageEvents=require(_0xe8ec('0x0'));var events=[_0xe8ec('0x1'),_0xe8ec('0x2'),_0xe8ec('0x3')];function createListener(_0x4dd5dd,_0x47b1c1){return function(_0xe18b82){_0x47b1c1[_0xe8ec('0x4')](_0x4dd5dd,_0xe18b82);};}function removeListener(_0x5047e7,_0x433734){return function(){ChatMessageEvents[_0xe8ec('0x5')](_0x5047e7,_0x433734);};}exports['register']=function(_0x346577){for(var _0x23fa35=0x0,_0x64ed4c=events[_0xe8ec('0x6')];_0x23fa35<_0x64ed4c;_0x23fa35++){var _0x3682cb=events[_0x23fa35];var _0x122f36=createListener(_0xe8ec('0x7')+_0x3682cb,_0x346577);ChatMessageEvents['on'](_0x3682cb,_0x122f36);}};
\ No newline at end of file
+var _0xa41a=['emit','removeListener','./chatMessage.events','save','update'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xa41a,0x6b));var _0xaa41=function(_0xb3928,_0x16a3b5){_0xb3928=_0xb3928-0x0;var _0x5bca72=_0xa41a[_0xb3928];return _0x5bca72;};'use strict';var ChatMessageEvents=require(_0xaa41('0x0'));var events=[_0xaa41('0x1'),'remove',_0xaa41('0x2')];function createListener(_0x2a96ba,_0x43654a){return function(_0xc5ce74){_0x43654a[_0xaa41('0x3')](_0x2a96ba,_0xc5ce74);};}function removeListener(_0x3168be,_0x42896b){return function(){ChatMessageEvents[_0xaa41('0x4')](_0x3168be,_0x42896b);};}exports['register']=function(_0x2122a0){for(var _0x1ec9d4=0x0,_0x54bc5a=events['length'];_0x1ec9d4<_0x54bc5a;_0x1ec9d4++){var _0x179545=events[_0x1ec9d4];var _0x202cce=createListener('chatMessage:'+_0x179545,_0x2122a0);ChatMessageEvents['on'](_0x179545,_0x202cce);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 59f587a..7db2db0 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 _0xb314=['accept','reject','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','put','update'];(function(_0x34981e,_0x46cde5){var _0x41d93e=function(_0x22faba){while(--_0x22faba){_0x34981e['push'](_0x34981e['shift']());}};_0x41d93e(++_0x46cde5);}(_0xb314,0x173));var _0x4b31=function(_0x46b450,_0x1ba431){_0x46b450=_0x46b450-0x0;var _0x2f8c22=_0xb314[_0x46b450];return _0x2f8c22;};'use strict';var multer=require(_0x4b31('0x0'));var util=require('util');var path=require(_0x4b31('0x1'));var timeout=require(_0x4b31('0x2'));var express=require(_0x4b31('0x3'));var router=express[_0x4b31('0x4')]();var fs_extra=require(_0x4b31('0x5'));var auth=require(_0x4b31('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4b31('0x7'));router[_0x4b31('0x8')]('/',auth[_0x4b31('0x9')](),controller[_0x4b31('0xa')]);router['get'](_0x4b31('0xb'),auth[_0x4b31('0x9')](),controller[_0x4b31('0xc')]);router['get'](_0x4b31('0xd'),auth[_0x4b31('0x9')](),controller[_0x4b31('0xe')]);router[_0x4b31('0xf')]('/',auth[_0x4b31('0x9')](),interaction[_0x4b31('0x10')](_0x4b31('0x11'),'chatmessage:create'),controller['create']);router[_0x4b31('0x12')]('/:id',controller[_0x4b31('0x13')]);router[_0x4b31('0x12')]('/:id/accept',auth[_0x4b31('0x9')](),controller[_0x4b31('0x14')]);router['put']('/:id/reject',auth[_0x4b31('0x9')](),controller[_0x4b31('0x15')]);router[_0x4b31('0x16')](_0x4b31('0xd'),auth[_0x4b31('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x2c0d=['tracked','chat','chatmessage:create','update','put','accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','post'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x2c0d,0x12a));var _0xd2c0=function(_0x587b84,_0x58fd72){_0x587b84=_0x587b84-0x0;var _0x208284=_0x2c0d[_0x587b84];return _0x208284;};'use strict';var multer=require(_0xd2c0('0x0'));var util=require(_0xd2c0('0x1'));var path=require(_0xd2c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2c0('0x3'));var router=express[_0xd2c0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2c0('0x5'));var config=require(_0xd2c0('0x6'));var controller=require(_0xd2c0('0x7'));router[_0xd2c0('0x8')]('/',auth[_0xd2c0('0x9')](),controller[_0xd2c0('0xa')]);router[_0xd2c0('0x8')](_0xd2c0('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xd2c0('0xc'),auth[_0xd2c0('0x9')](),controller['show']);router[_0xd2c0('0xd')]('/',auth[_0xd2c0('0x9')](),interaction[_0xd2c0('0xe')](_0xd2c0('0xf'),_0xd2c0('0x10')),controller['create']);router['put'](_0xd2c0('0xc'),controller[_0xd2c0('0x11')]);router[_0xd2c0('0x12')]('/:id/accept',auth[_0xd2c0('0x9')](),controller[_0xd2c0('0x13')]);router[_0xd2c0('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0xd2c0('0x14')]);router[_0xd2c0('0x15')]('/:id',auth[_0xd2c0('0x9')](),controller[_0xd2c0('0x16')]);module[_0xd2c0('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 da9adc5..fb27613 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 _0xe108=['TEXT','sequelize','exports'];(function(_0x2b0dc2,_0x22ad9b){var _0x3a5883=function(_0x1ae973){while(--_0x1ae973){_0x2b0dc2['push'](_0x2b0dc2['shift']());}};_0x3a5883(++_0x22ad9b);}(_0xe108,0xd9));var _0x8e10=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0xe108[_0x1a1b6e];return _0x571e2c;};'use strict';var Sequelize=require(_0x8e10('0x0'));module[_0x8e10('0x1')]={'body':{'type':Sequelize[_0x8e10('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x4c15=['sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c15,0x1c4));var _0x54c1=function(_0x3b04f2,_0x1e54d9){_0x3b04f2=_0x3b04f2-0x0;var _0x2ba2b4=_0x4c15[_0x3b04f2];return _0x2ba2b4;};'use strict';var Sequelize=require(_0x54c1('0x0'));module[_0x54c1('0x1')]={'body':{'type':Sequelize[_0x54c1('0x2')](_0x54c1('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index f5276fa..371361f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x531b95,_0x17e320){var _0x4d4e0f=function(_0x1ab346){while(--_0x1ab346){_0x531b95['push'](_0x531b95['shift']());}};_0x4d4e0f(++_0x17e320);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7a54,0x106));var _0x47a5=function(_0x5c9bdc,_0x207c22){_0x5c9bdc=_0x5c9bdc-0x0;var _0x477fe1=_0x7a54[_0x5c9bdc];return _0x477fe1;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 72fa32e..11ccf3a 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 _0xe535=['api','moment','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe535,0x6a));var _0x5e53=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xe535[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x5e53('0x0'));var util=require(_0x5e53('0x1'));var logger=require('../../config/logger')(_0x5e53('0x2'));var moment=require(_0x5e53('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e53('0x4'));var rimraf=require(_0x5e53('0x5'));var config=require(_0x5e53('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x5e53('0x7')]=function(_0x25725b,_0x1734bb){return _0x25725b[_0x5e53('0x8')](_0x5e53('0x9'),attributes,{'tableName':_0x5e53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5e53('0xb')});};
\ No newline at end of file
+var _0xffb3=['../../config/logger','moment','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x568bd7,_0x893b0){var _0x56844c=function(_0x512153){while(--_0x512153){_0x568bd7['push'](_0x568bd7['shift']());}};_0x56844c(++_0x893b0);}(_0xffb3,0x8d));var _0x3ffb=function(_0x47977b,_0x544e67){_0x47977b=_0x47977b-0x0;var _0x117401=_0xffb3[_0x47977b];return _0x117401;};'use strict';var _=require(_0x3ffb('0x0'));var util=require(_0x3ffb('0x1'));var logger=require(_0x3ffb('0x2'))('api');var moment=require(_0x3ffb('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ffb('0x4'));var fs=require('fs');var path=require(_0x3ffb('0x5'));var rimraf=require('rimraf');var config=require(_0x3ffb('0x6'));var attributes=require(_0x3ffb('0x7'));module[_0x3ffb('0x8')]=function(_0x379c7b,_0x1de242){return _0x379c7b['define'](_0x3ffb('0x9'),attributes,{'tableName':_0x3ffb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ffb('0xb'),'collate':_0x3ffb('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 51825f2..284acff 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 _0x0c19=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug'];(function(_0x5338ad,_0x2b68c3){var _0x1130f0=function(_0x4794e1){while(--_0x4794e1){_0x5338ad['push'](_0x5338ad['shift']());}};_0x1130f0(++_0x2b68c3);}(_0x0c19,0x168));var _0x90c1=function(_0x4ce144,_0x56dfbd){_0x4ce144=_0x4ce144-0x0;var _0x35ead8=_0x0c19[_0x4ce144];return _0x35ead8;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var moment=require(_0x90c1('0x2'));var BPromise=require('bluebird');var rs=require(_0x90c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90c1('0x4'))['db'];var utils=require(_0x90c1('0x5'));var logger=require(_0x90c1('0x6'))(_0x90c1('0x7'));var config=require(_0x90c1('0x8'));var jayson=require(_0x90c1('0x9'));var client=jayson[_0x90c1('0xa')][_0x90c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x385df5,_0x494834,_0x497faa){return new BPromise(function(_0x4975bb,_0x186a94){return client['request'](_0x385df5,_0x497faa)['then'](function(_0x5f4e85){logger[_0x90c1('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x494834,'request\x20sent');logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x494834,'request\x20sent',JSON[_0x90c1('0xf')](_0x5f4e85));if(_0x5f4e85[_0x90c1('0x10')]){if(_0x5f4e85[_0x90c1('0x10')][_0x90c1('0x11')]===0x1f4){logger[_0x90c1('0x10')](_0x90c1('0x12'),_0x494834,_0x5f4e85['error'][_0x90c1('0x13')]);return _0x186a94(_0x5f4e85[_0x90c1('0x10')][_0x90c1('0x13')]);}logger[_0x90c1('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x494834,_0x5f4e85['error'][_0x90c1('0x13')]);return _0x4975bb(_0x5f4e85['error'][_0x90c1('0x13')]);}else{logger[_0x90c1('0xc')](_0x90c1('0x12'),_0x494834,_0x90c1('0x14'));_0x4975bb(_0x5f4e85['result'][_0x90c1('0x13')]);}})[_0x90c1('0x15')](function(_0x3b31a4){logger[_0x90c1('0x10')](_0x90c1('0x12'),_0x494834,_0x3b31a4);_0x186a94(_0x3b31a4);});});}
\ No newline at end of file
+var _0xb40c=['request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x242838,_0x15bdc7){var _0x17309c=function(_0x502add){while(--_0x502add){_0x242838['push'](_0x242838['shift']());}};_0x17309c(++_0x15bdc7);}(_0xb40c,0x79));var _0xcb40=function(_0x213803,_0x1648a7){_0x213803=_0x213803-0x0;var _0xee5426=_0xb40c[_0x213803];return _0xee5426;};'use strict';var _=require(_0xcb40('0x0'));var util=require(_0xcb40('0x1'));var moment=require(_0xcb40('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb40('0x4'))['db'];var utils=require(_0xcb40('0x5'));var logger=require('../../config/logger')(_0xcb40('0x6'));var config=require(_0xcb40('0x7'));var jayson=require(_0xcb40('0x8'));var client=jayson[_0xcb40('0x9')][_0xcb40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3549f7,_0x5ed422,_0x51fdd8){return new BPromise(function(_0x21658c,_0x328f0a){return client[_0xcb40('0xb')](_0x3549f7,_0x51fdd8)[_0xcb40('0xc')](function(_0x23d1eb){logger['info'](_0xcb40('0xd'),_0x5ed422,_0xcb40('0xe'));logger['debug'](_0xcb40('0xf'),_0x5ed422,_0xcb40('0xe'),JSON[_0xcb40('0x10')](_0x23d1eb));if(_0x23d1eb[_0xcb40('0x11')]){if(_0x23d1eb['error'][_0xcb40('0x12')]===0x1f4){logger[_0xcb40('0x11')](_0xcb40('0xd'),_0x5ed422,_0x23d1eb[_0xcb40('0x11')][_0xcb40('0x13')]);return _0x328f0a(_0x23d1eb[_0xcb40('0x11')][_0xcb40('0x13')]);}logger[_0xcb40('0x11')](_0xcb40('0xd'),_0x5ed422,_0x23d1eb[_0xcb40('0x11')][_0xcb40('0x13')]);return _0x21658c(_0x23d1eb[_0xcb40('0x11')]['message']);}else{logger['info'](_0xcb40('0xd'),_0x5ed422,_0xcb40('0xe'));_0x21658c(_0x23d1eb[_0xcb40('0x14')][_0xcb40('0x13')]);}})[_0xcb40('0x15')](function(_0x302822){logger[_0xcb40('0x11')](_0xcb40('0xd'),_0x5ed422,_0x302822);_0x328f0a(_0x302822);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 2d58efb..056ed0e 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 _0x828c=['create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0x828c,0xbd));var _0xc828=function(_0x245b66,_0x474c4f){_0x245b66=_0x245b66-0x0;var _0x3240c9=_0x828c[_0x245b66];return _0x3240c9;};'use strict';var multer=require(_0xc828('0x0'));var util=require('util');var path=require(_0xc828('0x1'));var timeout=require(_0xc828('0x2'));var express=require(_0xc828('0x3'));var router=express[_0xc828('0x4')]();var fs_extra=require(_0xc828('0x5'));var auth=require(_0xc828('0x6'));var interaction=require(_0xc828('0x7'));var config=require(_0xc828('0x8'));var controller=require(_0xc828('0x9'));router[_0xc828('0xa')]('/',auth[_0xc828('0xb')](),controller[_0xc828('0xc')]);router[_0xc828('0xa')](_0xc828('0xd'),auth[_0xc828('0xb')](),controller[_0xc828('0xe')]);router[_0xc828('0xa')](_0xc828('0xf'),auth[_0xc828('0xb')](),controller[_0xc828('0x10')]);router[_0xc828('0x11')]('/',auth['isAuthenticated'](),controller[_0xc828('0x12')]);router[_0xc828('0x13')](_0xc828('0xf'),auth[_0xc828('0xb')](),controller[_0xc828('0x14')]);router[_0xc828('0x15')](_0xc828('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xc828('0x16')]=router;
\ No newline at end of file
+var _0x3984=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x2d68c2,_0x10efec){var _0x4f5a47=function(_0x4109df){while(--_0x4109df){_0x2d68c2['push'](_0x2d68c2['shift']());}};_0x4f5a47(++_0x10efec);}(_0x3984,0xd8));var _0x4398=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x3984[_0x1d04b5];return _0x161342;};'use strict';var multer=require('multer');var util=require(_0x4398('0x0'));var path=require(_0x4398('0x1'));var timeout=require(_0x4398('0x2'));var express=require(_0x4398('0x3'));var router=express[_0x4398('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4398('0x5'));var interaction=require(_0x4398('0x6'));var config=require(_0x4398('0x7'));var controller=require(_0x4398('0x8'));router[_0x4398('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4398('0xa'),auth[_0x4398('0xb')](),controller['describe']);router['get']('/:id',auth[_0x4398('0xb')](),controller[_0x4398('0xc')]);router[_0x4398('0xd')]('/',auth[_0x4398('0xb')](),controller[_0x4398('0xe')]);router[_0x4398('0xf')](_0x4398('0x10'),auth[_0x4398('0xb')](),controller['update']);router[_0x4398('0x11')](_0x4398('0x10'),auth[_0x4398('0xb')](),controller[_0x4398('0x12')]);module[_0x4398('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a5d9a2c..3da6fb3 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 _0x0cd4=['timeout','INTEGER','STRING','ENUM','mouseOver'];(function(_0x54ff45,_0x1ad967){var _0x40d81e=function(_0x35c241){while(--_0x35c241){_0x54ff45['push'](_0x54ff45['shift']());}};_0x40d81e(++_0x1ad967);}(_0x0cd4,0x93));var _0x40cd=function(_0x4e2f68,_0x490fe5){_0x4e2f68=_0x4e2f68-0x0;var _0x783f9d=_0x0cd4[_0x4e2f68];return _0x783f9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x40cd('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x40cd('0x1')](_0x40cd('0x2'),_0x40cd('0x3')),'defaultValue':_0x40cd('0x2')},'selector':{'type':Sequelize[_0x40cd('0x0')]},'timeout':{'type':Sequelize[_0x40cd('0x4')]}};
\ No newline at end of file
+var _0xfe5b=['ENUM','mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0xa29b94,_0x473ccd){var _0x2da5c3=function(_0xc06bea){while(--_0xc06bea){_0xa29b94['push'](_0xa29b94['shift']());}};_0x2da5c3(++_0x473ccd);}(_0xfe5b,0x16b));var _0xbfe5=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xfe5b[_0x40bffc];return _0x3007e9;};'use strict';var Sequelize=require(_0xbfe5('0x0'));module[_0xbfe5('0x1')]={'name':{'type':Sequelize[_0xbfe5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbfe5('0x3')](_0xbfe5('0x4'),'timeout'),'defaultValue':_0xbfe5('0x4')},'selector':{'type':Sequelize[_0xbfe5('0x2')]},'timeout':{'type':Sequelize[_0xbfe5('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f491c76..9e08882 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 _0x36bb=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','show','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','fields','length','merge','options','catch','create','body','params','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x12e509,_0x3fd09a){var _0x4bafbc=function(_0x340572){while(--_0x340572){_0x12e509['push'](_0x12e509['shift']());}};_0x4bafbc(++_0x3fd09a);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb36b('0x0'));var rimraf=require(_0xb36b('0x1'));var zipdir=require(_0xb36b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb36b('0x3'));var moment=require(_0xb36b('0x4'));var BPromise=require(_0xb36b('0x5'));var Mustache=require(_0xb36b('0x6'));var util=require(_0xb36b('0x7'));var path=require(_0xb36b('0x8'));var sox=require(_0xb36b('0x9'));var csv=require(_0xb36b('0xa'));var ejs=require(_0xb36b('0xb'));var fs=require('fs');var fs_extra=require(_0xb36b('0xc'));var _=require(_0xb36b('0xd'));var squel=require(_0xb36b('0xe'));var crypto=require(_0xb36b('0xf'));var jsforce=require(_0xb36b('0x10'));var deskjs=require(_0xb36b('0x11'));var toCsv=require(_0xb36b('0xa'));var querystring=require(_0xb36b('0x12'));var Papa=require(_0xb36b('0x13'));var Redis=require(_0xb36b('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb36b('0x15'));var as=require(_0xb36b('0x16'));var hardwareService=require(_0xb36b('0x17'));var logger=require('../../config/logger')(_0xb36b('0x18'));var utils=require(_0xb36b('0x19'));var config=require(_0xb36b('0x1a'));var licenseUtil=require(_0xb36b('0x1b'));var db=require(_0xb36b('0x1c'))['db'];function respondWithStatusCode(_0x11f775,_0x1ad623){_0x1ad623=_0x1ad623||0xcc;return function(_0x1c266a){if(_0x1c266a){return _0x11f775[_0xb36b('0x1d')](_0x1ad623);}return _0x11f775[_0xb36b('0x1e')](_0x1ad623)[_0xb36b('0x1f')]();};}function respondWithResult(_0x59af21,_0x1aef0b){_0x1aef0b=_0x1aef0b||0xc8;return function(_0x4c2c46){if(_0x4c2c46){return _0x59af21['status'](_0x1aef0b)[_0xb36b('0x20')](_0x4c2c46);}};}function respondWithFilteredResult(_0x329f60,_0x23e960){return function(_0x4b74f1){if(_0x4b74f1){var _0x5c7255=typeof _0x23e960[_0xb36b('0x21')]==='undefined'&&typeof _0x23e960[_0xb36b('0x22')]===_0xb36b('0x23');var _0xfe29fc=_0x4b74f1[_0xb36b('0x24')];var _0x53ec0e=_0x5c7255?0x0:_0x23e960[_0xb36b('0x21')];var _0x211a91=_0x5c7255?_0x4b74f1[_0xb36b('0x24')]:_0x23e960['offset']+_0x23e960[_0xb36b('0x22')];var _0x572d88;if(_0x211a91>=_0xfe29fc){_0x211a91=_0xfe29fc;_0x572d88=0xc8;}else{_0x572d88=0xce;}_0x329f60[_0xb36b('0x1e')](_0x572d88);return _0x329f60[_0xb36b('0x25')](_0xb36b('0x26'),_0x53ec0e+'-'+_0x211a91+'/'+_0xfe29fc)[_0xb36b('0x20')](_0x4b74f1);}return null;};}function patchUpdates(_0x4049fa){return function(_0x5f6648){try{jsonpatch[_0xb36b('0x27')](_0x5f6648,_0x4049fa,!![]);}catch(_0x5c68de){return BPromise[_0xb36b('0x28')](_0x5c68de);}return _0x5f6648['save']();};}function saveUpdates(_0x218995,_0x52b74f){return function(_0x3b8030){if(_0x3b8030){return _0x3b8030[_0xb36b('0x29')](_0x218995)[_0xb36b('0x2a')](function(_0x174795){return _0x174795;});}return null;};}function removeEntity(_0x2fe32e,_0x5f4a25){return function(_0x474083){if(_0x474083){return _0x474083[_0xb36b('0x2b')]()[_0xb36b('0x2a')](function(){_0x2fe32e['status'](0xcc)[_0xb36b('0x1f')]();});}};}function handleEntityNotFound(_0x4a58d4,_0x5dbe3b){return function(_0x50e8e4){if(!_0x50e8e4){_0x4a58d4[_0xb36b('0x1d')](0x194);}return _0x50e8e4;};}function handleError(_0x1d904e,_0x2e8402){_0x2e8402=_0x2e8402||0x1f4;return function(_0x5c4aee){logger[_0xb36b('0x2c')](_0x5c4aee[_0xb36b('0x2d')]);if(_0x5c4aee[_0xb36b('0x2e')]){delete _0x5c4aee[_0xb36b('0x2e')];}_0x1d904e['status'](_0x2e8402)['send'](_0x5c4aee);};}exports[_0xb36b('0x2f')]=function(_0x2724bf,_0x24149b){var _0x138f74={'raw':!![],'where':{'id':_0x2724bf['params']['id']}},_0x4aabf5={};_0x4aabf5[_0xb36b('0x30')]=_['keys'](db[_0xb36b('0x31')][_0xb36b('0x32')]);_0x4aabf5['query']=_[_0xb36b('0x33')](_0x2724bf[_0xb36b('0x34')]);_0x4aabf5[_0xb36b('0x35')]=_[_0xb36b('0x36')](_0x4aabf5[_0xb36b('0x30')],_0x4aabf5[_0xb36b('0x34')]);_0x138f74[_0xb36b('0x37')]=_[_0xb36b('0x36')](_0x4aabf5[_0xb36b('0x30')],qs[_0xb36b('0x38')](_0x2724bf[_0xb36b('0x34')][_0xb36b('0x38')]));_0x138f74['attributes']=_0x138f74['attributes'][_0xb36b('0x39')]?_0x138f74[_0xb36b('0x37')]:_0x4aabf5['model'];if(_0x2724bf[_0xb36b('0x34')]['includeAll']){_0x138f74['include']=[{'all':!![]}];}_0x138f74=_[_0xb36b('0x3a')]({},_0x138f74,_0x2724bf[_0xb36b('0x3b')]);return db[_0xb36b('0x31')]['find'](_0x138f74)['then'](handleEntityNotFound(_0x24149b,null))[_0xb36b('0x2a')](respondWithResult(_0x24149b,null))[_0xb36b('0x3c')](handleError(_0x24149b,null));};exports[_0xb36b('0x3d')]=function(_0x46bde0,_0x39c80e){return db[_0xb36b('0x31')]['create'](_0x46bde0[_0xb36b('0x3e')],{})[_0xb36b('0x2a')](respondWithResult(_0x39c80e,0xc9))[_0xb36b('0x3c')](handleError(_0x39c80e,null));};exports[_0xb36b('0x29')]=function(_0x301e12,_0x185bb2){if(_0x301e12[_0xb36b('0x3e')]['id']){delete _0x301e12[_0xb36b('0x3e')]['id'];}return db[_0xb36b('0x31')]['find']({'where':{'id':_0x301e12[_0xb36b('0x3f')]['id']}})[_0xb36b('0x2a')](handleEntityNotFound(_0x185bb2,null))[_0xb36b('0x2a')](saveUpdates(_0x301e12['body'],null))[_0xb36b('0x2a')](respondWithResult(_0x185bb2,null))[_0xb36b('0x3c')](handleError(_0x185bb2,null));};exports[_0xb36b('0x2b')]=function(_0x26b77f,_0x55b694){return db['ChatProactiveAction'][_0xb36b('0x40')]({'where':{'id':_0x26b77f[_0xb36b('0x3f')]['id']}})[_0xb36b('0x2a')](handleEntityNotFound(_0x55b694,null))[_0xb36b('0x2a')](removeEntity(_0x55b694,null))[_0xb36b('0x3c')](handleError(_0x55b694,null));};
\ No newline at end of file
+var _0x37c5=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','update','then','stack','name','show','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','ChatProactiveAction','body','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x37c5,0xa7));var _0x537c=function(_0x507df1,_0x48e5c3){_0x507df1=_0x507df1-0x0;var _0x45aa0d=_0x37c5[_0x507df1];return _0x45aa0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x537c('0x0'));var zipdir=require(_0x537c('0x1'));var jsonpatch=require(_0x537c('0x2'));var rp=require(_0x537c('0x3'));var moment=require(_0x537c('0x4'));var BPromise=require(_0x537c('0x5'));var Mustache=require(_0x537c('0x6'));var util=require(_0x537c('0x7'));var path=require(_0x537c('0x8'));var sox=require(_0x537c('0x9'));var csv=require('to-csv');var ejs=require(_0x537c('0xa'));var fs=require('fs');var fs_extra=require(_0x537c('0xb'));var _=require(_0x537c('0xc'));var squel=require('squel');var crypto=require(_0x537c('0xd'));var jsforce=require(_0x537c('0xe'));var deskjs=require(_0x537c('0xf'));var toCsv=require(_0x537c('0x10'));var querystring=require('querystring');var Papa=require(_0x537c('0x11'));var Redis=require(_0x537c('0x12'));var authService=require(_0x537c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x537c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x537c('0x15'));var utils=require('../../config/utils');var config=require(_0x537c('0x16'));var licenseUtil=require(_0x537c('0x17'));var db=require(_0x537c('0x18'))['db'];function respondWithStatusCode(_0x473606,_0x1ecb98){_0x1ecb98=_0x1ecb98||0xcc;return function(_0x4554be){if(_0x4554be){return _0x473606[_0x537c('0x19')](_0x1ecb98);}return _0x473606[_0x537c('0x1a')](_0x1ecb98)[_0x537c('0x1b')]();};}function respondWithResult(_0x577981,_0x8d0c3){_0x8d0c3=_0x8d0c3||0xc8;return function(_0x405e39){if(_0x405e39){return _0x577981[_0x537c('0x1a')](_0x8d0c3)[_0x537c('0x1c')](_0x405e39);}};}function respondWithFilteredResult(_0x116453,_0x392421){return function(_0x2158e2){if(_0x2158e2){var _0x3776c3=typeof _0x392421[_0x537c('0x1d')]==='undefined'&&typeof _0x392421[_0x537c('0x1e')]==='undefined';var _0x55df08=_0x2158e2[_0x537c('0x1f')];var _0x237be8=_0x3776c3?0x0:_0x392421[_0x537c('0x1d')];var _0x5f3776=_0x3776c3?_0x2158e2[_0x537c('0x1f')]:_0x392421[_0x537c('0x1d')]+_0x392421['limit'];var _0x5ca4d5;if(_0x5f3776>=_0x55df08){_0x5f3776=_0x55df08;_0x5ca4d5=0xc8;}else{_0x5ca4d5=0xce;}_0x116453[_0x537c('0x1a')](_0x5ca4d5);return _0x116453['set']('Content-Range',_0x237be8+'-'+_0x5f3776+'/'+_0x55df08)[_0x537c('0x1c')](_0x2158e2);}return null;};}function patchUpdates(_0x32be40){return function(_0x5cfd81){try{jsonpatch[_0x537c('0x20')](_0x5cfd81,_0x32be40,!![]);}catch(_0x259ab2){return BPromise['reject'](_0x259ab2);}return _0x5cfd81['save']();};}function saveUpdates(_0x1a91d1,_0x47bece){return function(_0x5d8b9e){if(_0x5d8b9e){return _0x5d8b9e[_0x537c('0x21')](_0x1a91d1)[_0x537c('0x22')](function(_0x13fd5e){return _0x13fd5e;});}return null;};}function removeEntity(_0x28a35a,_0x3698bc){return function(_0x26ab7d){if(_0x26ab7d){return _0x26ab7d['destroy']()[_0x537c('0x22')](function(){_0x28a35a[_0x537c('0x1a')](0xcc)[_0x537c('0x1b')]();});}};}function handleEntityNotFound(_0xcd7d47,_0x428e5d){return function(_0x4b6af1){if(!_0x4b6af1){_0xcd7d47['sendStatus'](0x194);}return _0x4b6af1;};}function handleError(_0x59442f,_0x403ff6){_0x403ff6=_0x403ff6||0x1f4;return function(_0x1fa0ca){logger['error'](_0x1fa0ca[_0x537c('0x23')]);if(_0x1fa0ca[_0x537c('0x24')]){delete _0x1fa0ca[_0x537c('0x24')];}_0x59442f['status'](_0x403ff6)['send'](_0x1fa0ca);};}exports[_0x537c('0x25')]=function(_0x44cc94,_0x11c11e){var _0x4e5f18={'raw':!![],'where':{'id':_0x44cc94['params']['id']}},_0x49d60b={};_0x49d60b[_0x537c('0x26')]=_[_0x537c('0x27')](db['ChatProactiveAction']['rawAttributes']);_0x49d60b['query']=_['keys'](_0x44cc94[_0x537c('0x28')]);_0x49d60b[_0x537c('0x29')]=_[_0x537c('0x2a')](_0x49d60b['model'],_0x49d60b[_0x537c('0x28')]);_0x4e5f18[_0x537c('0x2b')]=_[_0x537c('0x2a')](_0x49d60b['model'],qs[_0x537c('0x2c')](_0x44cc94[_0x537c('0x28')][_0x537c('0x2c')]));_0x4e5f18['attributes']=_0x4e5f18['attributes'][_0x537c('0x2d')]?_0x4e5f18[_0x537c('0x2b')]:_0x49d60b[_0x537c('0x26')];if(_0x44cc94[_0x537c('0x28')][_0x537c('0x2e')]){_0x4e5f18[_0x537c('0x2f')]=[{'all':!![]}];}_0x4e5f18=_[_0x537c('0x30')]({},_0x4e5f18,_0x44cc94[_0x537c('0x31')]);return db['ChatProactiveAction']['find'](_0x4e5f18)[_0x537c('0x22')](handleEntityNotFound(_0x11c11e,null))[_0x537c('0x22')](respondWithResult(_0x11c11e,null))['catch'](handleError(_0x11c11e,null));};exports[_0x537c('0x32')]=function(_0xf7a818,_0x116b5e){return db[_0x537c('0x33')][_0x537c('0x32')](_0xf7a818['body'],{})[_0x537c('0x22')](respondWithResult(_0x116b5e,0xc9))['catch'](handleError(_0x116b5e,null));};exports['update']=function(_0x552154,_0x5cea88){if(_0x552154[_0x537c('0x34')]['id']){delete _0x552154[_0x537c('0x34')]['id'];}return db[_0x537c('0x33')][_0x537c('0x35')]({'where':{'id':_0x552154[_0x537c('0x36')]['id']}})[_0x537c('0x22')](handleEntityNotFound(_0x5cea88,null))[_0x537c('0x22')](saveUpdates(_0x552154[_0x537c('0x34')],null))[_0x537c('0x22')](respondWithResult(_0x5cea88,null))[_0x537c('0x37')](handleError(_0x5cea88,null));};exports[_0x537c('0x38')]=function(_0x2dcbca,_0x28b222){return db[_0x537c('0x33')]['find']({'where':{'id':_0x2dcbca[_0x537c('0x36')]['id']}})['then'](handleEntityNotFound(_0x28b222,null))[_0x537c('0x22')](removeEntity(_0x28b222,null))[_0x537c('0x37')](handleError(_0x28b222,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2a05a5c..881d609 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 _0xd1a4=['./chatProactiveAction.attributes','exports','define','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xd1a4,0x107));var _0x4d1a=function(_0x3e1dff,_0xd692fd){_0x3e1dff=_0x3e1dff-0x0;var _0x598672=_0xd1a4[_0x3e1dff];return _0x598672;};'use strict';var _=require('lodash');var util=require(_0x4d1a('0x0'));var logger=require(_0x4d1a('0x1'))(_0x4d1a('0x2'));var moment=require('moment');var BPromise=require(_0x4d1a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d1a('0x4'));var rimraf=require(_0x4d1a('0x5'));var config=require(_0x4d1a('0x6'));var attributes=require(_0x4d1a('0x7'));module[_0x4d1a('0x8')]=function(_0x422773,_0x175f71){return _0x422773[_0x4d1a('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe833=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x301bb2,_0xc4169c){var _0x51b5ec=function(_0x3e36e7){while(--_0x3e36e7){_0x301bb2['push'](_0x301bb2['shift']());}};_0x51b5ec(++_0xc4169c);}(_0xe833,0xd3));var _0x3e83=function(_0x25865b,_0x341f3d){_0x25865b=_0x25865b-0x0;var _0x56175b=_0xe833[_0x25865b];return _0x56175b;};'use strict';var _=require(_0x3e83('0x0'));var util=require(_0x3e83('0x1'));var logger=require(_0x3e83('0x2'))(_0x3e83('0x3'));var moment=require(_0x3e83('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e83('0x5'));var fs=require('fs');var path=require(_0x3e83('0x6'));var rimraf=require(_0x3e83('0x7'));var config=require(_0x3e83('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x3e83('0x9')]=function(_0x2a28ac,_0x5e1424){return _0x2a28ac[_0x3e83('0xa')](_0x3e83('0xb'),attributes,{'tableName':_0x3e83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 56a4c3c..ecd17fe 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 _0xaf3a=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x843ff,_0x339e63){var _0x20a2ce=function(_0x2677a7){while(--_0x2677a7){_0x843ff['push'](_0x843ff['shift']());}};_0x20a2ce(++_0x339e63);}(_0xaf3a,0x148));var _0xaaf3=function(_0xc9cd47,_0x35a546){_0xc9cd47=_0xc9cd47-0x0;var _0x26827e=_0xaf3a[_0xc9cd47];return _0x26827e;};'use strict';var _=require(_0xaaf3('0x0'));var util=require(_0xaaf3('0x1'));var moment=require(_0xaaf3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaf3('0x3'));var db=require(_0xaaf3('0x4'))['db'];var utils=require(_0xaaf3('0x5'));var logger=require(_0xaaf3('0x6'))(_0xaaf3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1c1b,_0x58bb01,_0x2cd3d2){return new BPromise(function(_0x373b7e,_0xa2892a){return client[_0xaaf3('0x8')](_0x5c1c1b,_0x2cd3d2)[_0xaaf3('0x9')](function(_0x3f96cb){logger['info'](_0xaaf3('0xa'),_0x58bb01,_0xaaf3('0xb'));logger['debug'](_0xaaf3('0xc'),_0x58bb01,_0xaaf3('0xb'),JSON[_0xaaf3('0xd')](_0x3f96cb));if(_0x3f96cb[_0xaaf3('0xe')]){if(_0x3f96cb[_0xaaf3('0xe')]['code']===0x1f4){logger[_0xaaf3('0xe')](_0xaaf3('0xa'),_0x58bb01,_0x3f96cb[_0xaaf3('0xe')]['message']);return _0xa2892a(_0x3f96cb[_0xaaf3('0xe')]['message']);}logger[_0xaaf3('0xe')](_0xaaf3('0xa'),_0x58bb01,_0x3f96cb[_0xaaf3('0xe')][_0xaaf3('0xf')]);return _0x373b7e(_0x3f96cb[_0xaaf3('0xe')][_0xaaf3('0xf')]);}else{logger['info'](_0xaaf3('0xa'),_0x58bb01,'request\x20sent');_0x373b7e(_0x3f96cb[_0xaaf3('0x10')][_0xaaf3('0xf')]);}})['catch'](function(_0x2a03b0){logger[_0xaaf3('0xe')](_0xaaf3('0xa'),_0x58bb01,_0x2a03b0);_0xa2892a(_0x2a03b0);});});}
\ No newline at end of file
+var _0x928a=['../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x271e7d,_0x5667b7){var _0x5d8692=function(_0x34b1f0){while(--_0x34b1f0){_0x271e7d['push'](_0x271e7d['shift']());}};_0x5d8692(++_0x5667b7);}(_0x928a,0x19b));var _0xa928=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x928a[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0xa928('0x0'));var moment=require(_0xa928('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa928('0x2'));var db=require(_0xa928('0x3'))['db'];var utils=require(_0xa928('0x4'));var logger=require(_0xa928('0x5'))(_0xa928('0x6'));var config=require(_0xa928('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa928('0x8')][_0xa928('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49a47d,_0x1b9614,_0x1f5192){return new BPromise(function(_0x419d6e,_0x288dec){return client[_0xa928('0xa')](_0x49a47d,_0x1f5192)[_0xa928('0xb')](function(_0x39acdd){logger[_0xa928('0xc')](_0xa928('0xd'),_0x1b9614,_0xa928('0xe'));logger[_0xa928('0xf')](_0xa928('0x10'),_0x1b9614,_0xa928('0xe'),JSON[_0xa928('0x11')](_0x39acdd));if(_0x39acdd[_0xa928('0x12')]){if(_0x39acdd[_0xa928('0x12')]['code']===0x1f4){logger[_0xa928('0x12')](_0xa928('0xd'),_0x1b9614,_0x39acdd[_0xa928('0x12')][_0xa928('0x13')]);return _0x288dec(_0x39acdd['error'][_0xa928('0x13')]);}logger[_0xa928('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x1b9614,_0x39acdd['error'][_0xa928('0x13')]);return _0x419d6e(_0x39acdd[_0xa928('0x12')][_0xa928('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x1b9614,_0xa928('0xe'));_0x419d6e(_0x39acdd[_0xa928('0x14')]['message']);}})[_0xa928('0x15')](function(_0x1e3622){logger[_0xa928('0x12')](_0xa928('0xd'),_0x1b9614,_0x1e3622);_0x288dec(_0x1e3622);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index c1304ab..a12acdd 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x4f0b66,_0x2dc518){var _0x2660ee=function(_0x45b4d4){while(--_0x45b4d4){_0x4f0b66['push'](_0x4f0b66['shift']());}};_0x2660ee(++_0x2dc518);}(_0xd8fb,0x99));var _0xbd8f=function(_0x11de33,_0x2947b2){_0x11de33=_0x11de33-0x0;var _0x34ffb1=_0xd8fb[_0x11de33];return _0x34ffb1;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
+var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x2bd8,0x130));var _0x82bd=function(_0x1ab500,_0x3f27a8){_0x1ab500=_0x1ab500-0x0;var _0x23e01b=_0x2bd8[_0x1ab500];return _0x23e01b;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index b930573..c28e0c6 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 _0x2b93=['rrmemory','beepall','roundrobin','exports','name','STRING','ENUM'];(function(_0x261e64,_0x4cc616){var _0xd05e0a=function(_0x460bd1){while(--_0x460bd1){_0x261e64['push'](_0x261e64['shift']());}};_0xd05e0a(++_0x4cc616);}(_0x2b93,0xce));var _0x32b9=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x2b93[_0x52085a];return _0x5afc1a;};'use strict';var Sequelize=require('sequelize');module[_0x32b9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x32b9('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x32b9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x32b9('0x3')](_0x32b9('0x4'),_0x32b9('0x5'),_0x32b9('0x6'))}};
\ No newline at end of file
+var _0x1442=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x58d3a6,_0x3cae7a){var _0x242932=function(_0x1a4896){while(--_0x1a4896){_0x58d3a6['push'](_0x58d3a6['shift']());}};_0x242932(++_0x3cae7a);}(_0x1442,0xa2));var _0x2144=function(_0x37f3c4,_0x4d3cbf){_0x37f3c4=_0x37f3c4-0x0;var _0x12764a=_0x1442[_0x37f3c4];return _0x12764a;};'use strict';var Sequelize=require(_0x2144('0x0'));module[_0x2144('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2144('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2144('0x3')]},'timeout':{'type':Sequelize[_0x2144('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2144('0x5')](_0x2144('0x6'),_0x2144('0x7'),_0x2144('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 23ac0db..7349ddf 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 _0x6428=['request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','get','UserProfileResource','stack','send','index','map','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','UserChatQueue','rawAttributes','User','UserId','chatPause','updatedAt','createdAt','format','%s/%s','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s'];(function(_0x5af7f1,_0xe41703){var _0x377013=function(_0x2135ff){while(--_0x2135ff){_0x5af7f1['push'](_0x5af7f1['shift']());}};_0x377013(++_0xe41703);}(_0x6428,0x111));var _0x8642=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x6428[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8642('0x0'));var jsonpatch=require(_0x8642('0x1'));var rp=require(_0x8642('0x2'));var moment=require(_0x8642('0x3'));var BPromise=require(_0x8642('0x4'));var Mustache=require('mustache');var util=require(_0x8642('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8642('0x6'));var ejs=require(_0x8642('0x7'));var fs=require('fs');var fs_extra=require(_0x8642('0x8'));var _=require('lodash');var squel=require(_0x8642('0x9'));var crypto=require(_0x8642('0xa'));var jsforce=require(_0x8642('0xb'));var deskjs=require(_0x8642('0xc'));var toCsv=require(_0x8642('0x6'));var querystring=require('querystring');var Papa=require(_0x8642('0xd'));var Redis=require(_0x8642('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8642('0xf'));var logger=require(_0x8642('0x10'))(_0x8642('0x11'));var utils=require('../../config/utils');var config=require(_0x8642('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8642('0x13'))['db'];config['redis']=_[_0x8642('0x14')](config[_0x8642('0x15')],{'host':_0x8642('0x16'),'port':0x18eb});var socket=require(_0x8642('0x17'))(new Redis(config['redis']));require(_0x8642('0x18'))[_0x8642('0x19')](socket);var jayson=require(_0x8642('0x1a'));var client=jayson['client'][_0x8642('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2f5d0f,_0x2b5abb,_0x1e8df6,_0x48c1e7){return new BPromise(function(_0x3a95b5,_0x28233c){var _0x15c6fa=_0x48c1e7||client;return _0x15c6fa[_0x8642('0x1c')](_0x2f5d0f,_0x1e8df6)[_0x8642('0x1d')](function(_0x19f6cc){logger['info'](_0x8642('0x1e'),_0x2b5abb,_0x8642('0x1f'));logger[_0x8642('0x20')](_0x8642('0x21'),_0x2b5abb,_0x8642('0x1f'),JSON[_0x8642('0x22')](_0x19f6cc));if(_0x19f6cc['error']){if(_0x19f6cc['error'][_0x8642('0x23')]===0x1f4){logger[_0x8642('0x24')](_0x8642('0x1e'),_0x2b5abb,_0x19f6cc[_0x8642('0x24')][_0x8642('0x25')]);return _0x28233c(_0x19f6cc[_0x8642('0x24')]['message']);}logger[_0x8642('0x24')](_0x8642('0x1e'),_0x2b5abb,_0x19f6cc[_0x8642('0x24')][_0x8642('0x25')]);return _0x3a95b5(_0x19f6cc[_0x8642('0x24')][_0x8642('0x25')]);}else{logger[_0x8642('0x26')](_0x8642('0x1e'),_0x2b5abb,_0x8642('0x1f'));_0x3a95b5(_0x19f6cc['result'][_0x8642('0x25')]);}})[_0x8642('0x27')](function(_0x1d8949){logger[_0x8642('0x24')](_0x8642('0x1e'),_0x2b5abb,_0x1d8949);_0x28233c(_0x1d8949);});});}function respondWithStatusCode(_0x4dd720,_0x492e7d){_0x492e7d=_0x492e7d||0xcc;return function(_0x1e66e1){if(_0x1e66e1){return _0x4dd720[_0x8642('0x28')](_0x492e7d);}return _0x4dd720[_0x8642('0x29')](_0x492e7d)[_0x8642('0x2a')]();};}function respondWithResult(_0x25418a,_0x27d04a){_0x27d04a=_0x27d04a||0xc8;return function(_0x18cec0){if(_0x18cec0){return _0x25418a['status'](_0x27d04a)[_0x8642('0x2b')](_0x18cec0);}};}function respondWithFilteredResult(_0x982e43,_0x3bd213){return function(_0x2dd7ec){if(_0x2dd7ec){var _0x44678d=typeof _0x3bd213[_0x8642('0x2c')]===_0x8642('0x2d')&&typeof _0x3bd213[_0x8642('0x2e')]===_0x8642('0x2d');var _0x1f4856=_0x2dd7ec['count'];var _0x50d605=_0x44678d?0x0:_0x3bd213[_0x8642('0x2c')];var _0x47e495=_0x44678d?_0x2dd7ec[_0x8642('0x2f')]:_0x3bd213[_0x8642('0x2c')]+_0x3bd213[_0x8642('0x2e')];var _0x2d1667;if(_0x47e495>=_0x1f4856){_0x47e495=_0x1f4856;_0x2d1667=0xc8;}else{_0x2d1667=0xce;}_0x982e43[_0x8642('0x29')](_0x2d1667);return _0x982e43[_0x8642('0x30')]('Content-Range',_0x50d605+'-'+_0x47e495+'/'+_0x1f4856)[_0x8642('0x2b')](_0x2dd7ec);}return null;};}function patchUpdates(_0x1d000c){return function(_0x9645a9){try{jsonpatch[_0x8642('0x31')](_0x9645a9,_0x1d000c,!![]);}catch(_0x7a396c){return BPromise[_0x8642('0x32')](_0x7a396c);}return _0x9645a9[_0x8642('0x33')]();};}function saveUpdates(_0x495297,_0x3012e5){return function(_0x3ec589){if(_0x3ec589){return _0x3ec589['update'](_0x495297)[_0x8642('0x1d')](function(_0x2519b6){return _0x2519b6;});}return null;};}function removeEntity(_0x463496,_0x25cc91){return function(_0x4c8e35){if(_0x4c8e35){return _0x4c8e35['destroy']()['then'](function(){var _0x1f84ba=_0x4c8e35[_0x8642('0x34')]({'plain':!![]});var _0x2872bd='ChatQueues';return db[_0x8642('0x35')]['destroy']({'where':{'type':_0x2872bd,'resourceId':_0x1f84ba['id']}})[_0x8642('0x1d')](function(){return _0x4c8e35;});})['then'](function(){_0x463496[_0x8642('0x29')](0xcc)[_0x8642('0x2a')]();});}};}function handleEntityNotFound(_0x143a3b,_0x3a2d31){return function(_0x3527f7){if(!_0x3527f7){_0x143a3b[_0x8642('0x28')](0x194);}return _0x3527f7;};}function handleError(_0x22b532,_0x7c17e1){_0x7c17e1=_0x7c17e1||0x1f4;return function(_0x4dc03b){logger[_0x8642('0x24')](_0x4dc03b[_0x8642('0x36')]);if(_0x4dc03b['name']){delete _0x4dc03b['name'];}_0x22b532[_0x8642('0x29')](_0x7c17e1)[_0x8642('0x37')](_0x4dc03b);};}exports[_0x8642('0x38')]=function(_0x36e4a3,_0x1c1168){var _0x5a5310={},_0x3c13d4={},_0x10762a={'count':0x0,'rows':[]};var _0x172b76=_[_0x8642('0x39')](db['ChatQueue']['rawAttributes'],function(_0x5c8318){return{'name':_0x5c8318[_0x8642('0x3a')],'type':_0x5c8318[_0x8642('0x3b')][_0x8642('0x3c')]};});_0x3c13d4[_0x8642('0x3d')]=_[_0x8642('0x39')](_0x172b76,'name');_0x3c13d4['query']=_[_0x8642('0x3e')](_0x36e4a3['query']);_0x3c13d4[_0x8642('0x3f')]=_[_0x8642('0x40')](_0x3c13d4[_0x8642('0x3d')],_0x3c13d4['query']);_0x5a5310[_0x8642('0x41')]=_[_0x8642('0x40')](_0x3c13d4[_0x8642('0x3d')],qs[_0x8642('0x42')](_0x36e4a3['query'][_0x8642('0x42')]));_0x5a5310[_0x8642('0x41')]=_0x5a5310['attributes'][_0x8642('0x43')]?_0x5a5310[_0x8642('0x41')]:_0x3c13d4[_0x8642('0x3d')];if(!_0x36e4a3['query'][_0x8642('0x44')](_0x8642('0x45'))){_0x5a5310['limit']=qs[_0x8642('0x2e')](_0x36e4a3[_0x8642('0x46')]['limit']);_0x5a5310[_0x8642('0x2c')]=qs[_0x8642('0x2c')](_0x36e4a3[_0x8642('0x46')][_0x8642('0x2c')]);}_0x5a5310[_0x8642('0x47')]=qs[_0x8642('0x48')](_0x36e4a3[_0x8642('0x46')][_0x8642('0x48')]);_0x5a5310[_0x8642('0x49')]=qs[_0x8642('0x3f')](_[_0x8642('0x4a')](_0x36e4a3[_0x8642('0x46')],_0x3c13d4[_0x8642('0x3f')]),_0x172b76);if(_0x36e4a3[_0x8642('0x46')][_0x8642('0x4b')]){_0x5a5310['where']=_[_0x8642('0x4c')](_0x5a5310[_0x8642('0x49')],{'$or':_[_0x8642('0x39')](_0x172b76,function(_0x3ec5f4){if(_0x3ec5f4[_0x8642('0x3b')]!==_0x8642('0x4d')){var _0x30d90e={};_0x30d90e[_0x3ec5f4['name']]={'$like':'%'+_0x36e4a3[_0x8642('0x46')][_0x8642('0x4b')]+'%'};return _0x30d90e;}})});}_0x5a5310=_[_0x8642('0x4c')]({},_0x5a5310,_0x36e4a3[_0x8642('0x4e')]);var _0x185c9b={'where':_0x5a5310[_0x8642('0x49')]};return db[_0x8642('0x4f')]['count'](_0x185c9b)['then'](function(_0x3d49a3){_0x10762a[_0x8642('0x2f')]=_0x3d49a3;if(_0x36e4a3['query'][_0x8642('0x50')]){_0x5a5310[_0x8642('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0x8642('0x52')](_0x5a5310);})[_0x8642('0x1d')](function(_0x46e29c){_0x10762a[_0x8642('0x53')]=_0x46e29c;return _0x10762a;})[_0x8642('0x1d')](respondWithFilteredResult(_0x1c1168,_0x5a5310))[_0x8642('0x27')](handleError(_0x1c1168,null));};exports[_0x8642('0x54')]=function(_0x1a5920,_0x26121f){var _0x33a398={'raw':!![],'where':{'id':_0x1a5920[_0x8642('0x55')]['id']}},_0x57f3a4={};_0x57f3a4[_0x8642('0x3d')]=_['keys'](db[_0x8642('0x4f')]['rawAttributes']);_0x57f3a4[_0x8642('0x46')]=_[_0x8642('0x3e')](_0x1a5920[_0x8642('0x46')]);_0x57f3a4[_0x8642('0x3f')]=_[_0x8642('0x40')](_0x57f3a4[_0x8642('0x3d')],_0x57f3a4[_0x8642('0x46')]);_0x33a398['attributes']=_[_0x8642('0x40')](_0x57f3a4[_0x8642('0x3d')],qs[_0x8642('0x42')](_0x1a5920[_0x8642('0x46')]['fields']));_0x33a398[_0x8642('0x41')]=_0x33a398['attributes']['length']?_0x33a398[_0x8642('0x41')]:_0x57f3a4['model'];if(_0x1a5920[_0x8642('0x46')]['includeAll']){_0x33a398[_0x8642('0x51')]=[{'all':!![]}];}_0x33a398=_[_0x8642('0x4c')]({},_0x33a398,_0x1a5920[_0x8642('0x4e')]);return db[_0x8642('0x4f')][_0x8642('0x56')](_0x33a398)[_0x8642('0x1d')](handleEntityNotFound(_0x26121f,null))[_0x8642('0x1d')](respondWithResult(_0x26121f,null))[_0x8642('0x27')](handleError(_0x26121f,null));};exports[_0x8642('0x57')]=function(_0x2ebd51,_0x45934f){return db[_0x8642('0x4f')][_0x8642('0x57')](_0x2ebd51['body'],{})[_0x8642('0x1d')](function(_0x330696){var _0x3ea73f=_0x2ebd51[_0x8642('0x58')]['get']({'plain':!![]});if(!_0x3ea73f)throw new Error(_0x8642('0x59'));if(_0x3ea73f[_0x8642('0x5a')]===_0x8642('0x58')){var _0x104c43=_0x330696[_0x8642('0x34')]({'plain':!![]});var _0x1ec3b8=_0x8642('0x5b');return db[_0x8642('0x5c')][_0x8642('0x56')]({'where':{'name':_0x1ec3b8,'userProfileId':_0x3ea73f[_0x8642('0x5d')]},'raw':!![]})['then'](function(_0x455d47){if(_0x455d47&&_0x455d47[_0x8642('0x5e')]===0x0){return db[_0x8642('0x35')][_0x8642('0x57')]({'name':_0x104c43[_0x8642('0x5f')],'resourceId':_0x104c43['id'],'type':_0x455d47[_0x8642('0x5f')],'sectionId':_0x455d47['id']},{})[_0x8642('0x1d')](function(){return _0x330696;});}else{return _0x330696;}})[_0x8642('0x27')](function(_0x224cb0){logger[_0x8642('0x24')](_0x8642('0x60'),_0x224cb0);throw _0x224cb0;});}return _0x330696;})[_0x8642('0x1d')](respondWithResult(_0x45934f,0xc9))[_0x8642('0x27')](handleError(_0x45934f,null));};exports[_0x8642('0x61')]=function(_0x5cadc8,_0x361a22){if(_0x5cadc8[_0x8642('0x62')]['id']){delete _0x5cadc8[_0x8642('0x62')]['id'];}return db[_0x8642('0x4f')][_0x8642('0x56')]({'where':{'id':_0x5cadc8[_0x8642('0x55')]['id']}})['then'](handleEntityNotFound(_0x361a22,null))[_0x8642('0x1d')](saveUpdates(_0x5cadc8[_0x8642('0x62')],null))[_0x8642('0x1d')](respondWithResult(_0x361a22,null))[_0x8642('0x27')](handleError(_0x361a22,null));};exports[_0x8642('0x63')]=function(_0x29691a,_0xf3c8d7){return db['ChatQueue'][_0x8642('0x56')]({'where':{'id':_0x29691a[_0x8642('0x55')]['id']}})[_0x8642('0x1d')](handleEntityNotFound(_0xf3c8d7,null))[_0x8642('0x1d')](removeEntity(_0xf3c8d7,null))[_0x8642('0x27')](handleError(_0xf3c8d7,null));};exports[_0x8642('0x64')]=function(_0x42a1d0,_0x3fe8e9){return db[_0x8642('0x4f')][_0x8642('0x64')]()[_0x8642('0x1d')](respondWithResult(_0x3fe8e9,null))[_0x8642('0x27')](handleError(_0x3fe8e9,null));};exports['getMembers']=function(_0x4c02fd,_0x7c3ee9,_0x491f65){var _0x3a5ef6={'raw':!![],'where':{}},_0x41ab52={},_0x337308;return db[_0x8642('0x4f')]['findOne']({'where':{'id':_0x4c02fd[_0x8642('0x55')]['id']}})['then'](handleEntityNotFound(_0x7c3ee9,null))[_0x8642('0x1d')](function(_0x427650){if(_0x427650){_0x337308=_0x427650[_0x8642('0x34')]({'plain':!![]});_0x41ab52[_0x8642('0x3d')]=_[_0x8642('0x3e')](db[_0x8642('0x65')][_0x8642('0x66')]);_0x41ab52[_0x8642('0x46')]=_[_0x8642('0x3e')](_0x4c02fd[_0x8642('0x46')]);_0x41ab52[_0x8642('0x3f')]=_[_0x8642('0x40')](_0x41ab52['model'],_0x41ab52[_0x8642('0x46')]);_0x3a5ef6[_0x8642('0x41')]=_[_0x8642('0x40')](_0x41ab52['model'],qs[_0x8642('0x42')](_0x4c02fd[_0x8642('0x46')][_0x8642('0x42')]));_0x3a5ef6[_0x8642('0x41')]=_0x3a5ef6[_0x8642('0x41')]['length']?_0x3a5ef6['attributes']:_0x41ab52[_0x8642('0x3d')];if(!_0x4c02fd['query']['hasOwnProperty'](_0x8642('0x45'))){_0x3a5ef6[_0x8642('0x2e')]=qs[_0x8642('0x2e')](_0x4c02fd[_0x8642('0x46')][_0x8642('0x2e')]);_0x3a5ef6[_0x8642('0x2c')]=qs['offset'](_0x4c02fd[_0x8642('0x46')][_0x8642('0x2c')]);}_0x3a5ef6[_0x8642('0x47')]=qs[_0x8642('0x48')](_0x4c02fd['query'][_0x8642('0x48')]);_0x3a5ef6[_0x8642('0x49')]=qs[_0x8642('0x3f')](_['pick'](_0x4c02fd[_0x8642('0x46')],_0x41ab52['filters']));_0x3a5ef6[_0x8642('0x49')]['ChatQueueId']=_0x427650['id'];if(_0x4c02fd[_0x8642('0x46')][_0x8642('0x4b')]){_0x3a5ef6[_0x8642('0x49')]=_[_0x8642('0x4c')](_0x3a5ef6['where'],{'$or':_[_0x8642('0x39')](_0x3a5ef6[_0x8642('0x41')],function(_0x42e08a){var _0x270bab={};_0x270bab[_0x42e08a]={'$like':'%'+_0x4c02fd[_0x8642('0x46')][_0x8642('0x4b')]+'%'};return _0x270bab;})});}_0x3a5ef6=_[_0x8642('0x4c')]({},_0x3a5ef6,_0x4c02fd[_0x8642('0x4e')]);return db['UserChatQueue']['findAll'](_0x3a5ef6);}})[_0x8642('0x1d')](function(_0x244e17){if(_0x244e17){return db[_0x8642('0x67')]['findAndCountAll']({'where':{'id':_[_0x8642('0x39')](_0x244e17,_0x8642('0x68')),'role':'agent'},'attributes':['id',_0x8642('0x5f'),_0x8642('0x69'),_0x8642('0x6a'),_0x8642('0x6b')]});}})[_0x8642('0x1d')](function(_0x14904f){if(_0x14904f){return{'count':_0x14904f[_0x8642('0x2f')],'rows':_[_0x8642('0x39')](_0x14904f[_0x8642('0x53')],function(_0x2307ff){return{'membername':_0x2307ff[_0x8642('0x5f')],'UserId':_0x2307ff['id'],'queue_name':_0x337308[_0x8642('0x5f')],'ChatQueueId':_0x337308['id'],'interface':util[_0x8642('0x6c')](_0x8642('0x6d'),'SIP',_0x2307ff[_0x8642('0x5f')]),'penalty':0x0,'paused':_0x2307ff[_0x8642('0x69')],'createdAt':_0x2307ff[_0x8642('0x6b')],'updatedAt':_0x2307ff['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8642('0x1d')](respondWithFilteredResult(_0x7c3ee9,_0x3a5ef6))[_0x8642('0x27')](handleError(_0x7c3ee9,null));};exports['getTeams']=function(_0x43f9da,_0x2371df,_0x174d8b){var _0x49cbc8={};var _0x3e1876={};var _0x422695;var _0x2a1a2b;return db['ChatQueue'][_0x8642('0x6e')]({'where':{'id':_0x43f9da['params']['id']}})[_0x8642('0x1d')](handleEntityNotFound(_0x2371df,null))['then'](function(_0x20b70f){if(_0x20b70f){_0x422695=_0x20b70f;_0x3e1876[_0x8642('0x3d')]=_[_0x8642('0x3e')](db[_0x8642('0x6f')][_0x8642('0x66')]);_0x3e1876[_0x8642('0x46')]=_[_0x8642('0x3e')](_0x43f9da['query']);_0x3e1876[_0x8642('0x3f')]=_['intersection'](_0x3e1876[_0x8642('0x3d')],_0x3e1876[_0x8642('0x46')]);_0x49cbc8[_0x8642('0x41')]=_[_0x8642('0x40')](_0x3e1876[_0x8642('0x3d')],qs[_0x8642('0x42')](_0x43f9da[_0x8642('0x46')][_0x8642('0x42')]));_0x49cbc8[_0x8642('0x41')]=_0x49cbc8[_0x8642('0x41')]['length']?_0x49cbc8[_0x8642('0x41')]:_0x3e1876['model'];_0x49cbc8[_0x8642('0x47')]=qs[_0x8642('0x48')](_0x43f9da['query'][_0x8642('0x48')]);_0x49cbc8[_0x8642('0x49')]=qs[_0x8642('0x3f')](_['pick'](_0x43f9da[_0x8642('0x46')],_0x3e1876[_0x8642('0x3f')]));if(_0x43f9da['query'][_0x8642('0x4b')]){_0x49cbc8[_0x8642('0x49')]=_['merge'](_0x49cbc8[_0x8642('0x49')],{'$or':_[_0x8642('0x39')](_0x49cbc8['attributes'],function(_0x24cba0){var _0x2a1c12={};_0x2a1c12[_0x24cba0]={'$like':'%'+_0x43f9da[_0x8642('0x46')][_0x8642('0x4b')]+'%'};return _0x2a1c12;})});}_0x49cbc8=_[_0x8642('0x4c')]({},_0x49cbc8,_0x43f9da[_0x8642('0x4e')]);return _0x422695[_0x8642('0x70')](_0x49cbc8);}})[_0x8642('0x1d')](function(_0x474529){if(_0x474529){_0x2a1a2b=_0x474529['length'];if(!_0x43f9da[_0x8642('0x46')][_0x8642('0x44')]('nolimit')){_0x49cbc8['limit']=qs[_0x8642('0x2e')](_0x43f9da[_0x8642('0x46')][_0x8642('0x2e')]);_0x49cbc8['offset']=qs[_0x8642('0x2c')](_0x43f9da[_0x8642('0x46')][_0x8642('0x2c')]);}return _0x422695['getTeams'](_0x49cbc8);}})[_0x8642('0x1d')](function(_0x709986){if(_0x709986){return _0x709986?{'count':_0x2a1a2b,'rows':_0x709986}:null;}})[_0x8642('0x1d')](respondWithResult(_0x2371df,null))[_0x8642('0x27')](handleError(_0x2371df,null));};exports[_0x8642('0x71')]=function(_0x1448a1,_0x182aff,_0x20bce4){var _0x5465e4=_0x1448a1[_0x8642('0x62')][_0x8642('0x72')];return db['Team'][_0x8642('0x52')]({'where':{'id':_0x5465e4},'attributes':['id'],'include':[{'model':db[_0x8642('0x67')],'as':_0x8642('0x73'),'attributes':['id','name',_0x8642('0x74'),_0x8642('0x75'),_0x8642('0x76')],'raw':!![]}]})[_0x8642('0x1d')](function(_0x3d370f){if(_0x3d370f){var _0x2b20b7=_[_0x8642('0x77')](_0x3d370f,function(_0x9cccf2){var _0x4aad68=_0x9cccf2[_0x8642('0x34')]({'plain':!![]});return _0x4aad68[_0x8642('0x73')];});return db[_0x8642('0x4f')]['find']({'where':{'id':_0x1448a1[_0x8642('0x55')]['id']}})[_0x8642('0x1d')](function(_0x3daef5){return db[_0x8642('0x78')]['transaction'](function(_0x1b6e25){return _0x3daef5['addTeams'](_0x5465e4,{'transaction':_0x1b6e25})['then'](function(){return BPromise['each'](_0x2b20b7,function(_0x27ddd6){return db[_0x8642('0x65')][_0x8642('0x79')]({'where':{'UserId':_0x27ddd6['id'],'ChatQueueId':_0x1448a1['params']['id']},'transaction':_0x1b6e25});});})[_0x8642('0x1d')](function(){_0x2b20b7[_0x8642('0x7a')](function(_0x2181a7){socket[_0x8642('0x7b')](_0x8642('0x7c'),{'UserId':_0x2181a7['id'],'ChatQueueId':_0x3daef5['id']});});});});});}})[_0x8642('0x1d')](respondWithStatusCode(_0x182aff,null))[_0x8642('0x27')](handleError(_0x182aff,null));};exports[_0x8642('0x7d')]=function(_0x13f4cb,_0x493b0b,_0xcf1060){return db[_0x8642('0x6f')][_0x8642('0x52')]({'where':{'id':_0x13f4cb['query'][_0x8642('0x72')]},'attributes':['id'],'include':[{'model':db[_0x8642('0x67')],'as':_0x8642('0x73'),'attributes':['id'],'raw':!![]}]})[_0x8642('0x1d')](handleEntityNotFound(_0x493b0b,null))[_0x8642('0x1d')](function(_0x242b42){var _0x50df4a=_[_0x8642('0x39')](_0x242b42,'id');var _0x4dbae9=[];var _0x1fe51d=[];var _0x2c7435=squel[_0x8642('0x7e')]();_0x2c7435[_0x8642('0x7f')](_0x8642('0x80'))[_0x8642('0x81')](_0x8642('0x82'),'tq')['join'](_0x8642('0x83'),'ut',_0x8642('0x84'))[_0x8642('0x49')]('ChatQueueId\x20=\x20?',_0x13f4cb[_0x8642('0x55')]['id']);for(var _0x1bfdfa=0x0;_0x1bfdfa<_0x242b42[_0x8642('0x43')];_0x1bfdfa+=0x1){let _0x58ac24=_0x242b42[_0x1bfdfa];for(var _0x144c4d=0x0;_0x144c4d<_0x58ac24[_0x8642('0x73')][_0x8642('0x43')];_0x144c4d+=0x1){let _0x20f95d=_0x58ac24['Agents'][_0x144c4d];var _0x18bb9f=_0x2c7435[_0x8642('0x85')]();_0x18bb9f[_0x8642('0x49')](_0x8642('0x86'),_0x20f95d['id']);_0x1fe51d[_0x8642('0x87')](db[_0x8642('0x78')]['query'](_0x18bb9f[_0x8642('0x88')](),{'type':db[_0x8642('0x78')][_0x8642('0x89')][_0x8642('0x8a')]})['then'](function(_0x21b643){if(_0x21b643[_0x8642('0x43')]===0x1){return _0x20f95d['id'];}else{var _0x5599ae=_[_0x8642('0x8b')](_['map'](_0x21b643,_0x8642('0x8c')),function(_0x404640){return _['includes'](_0x50df4a,_0x404640);});if(_0x5599ae){return _0x20f95d['id'];}}}));}}return BPromise[_0x8642('0x8d')](_0x1fe51d)[_0x8642('0x1d')](function(_0x501927){_0x4dbae9=_(_0x4dbae9)['union'](_0x501927)[_0x8642('0x8e')]()[_0x8642('0x8f')]();return db[_0x8642('0x4f')][_0x8642('0x56')]({'where':{'id':_0x13f4cb[_0x8642('0x55')]['id']}})[_0x8642('0x1d')](function(_0x2196f9){return db[_0x8642('0x78')]['transaction'](function(_0x400160){return _0x2196f9['removeTeams'](_0x13f4cb[_0x8642('0x46')][_0x8642('0x72')],{'transaction':_0x400160})[_0x8642('0x1d')](function(){if(!_[_0x8642('0x90')](_0x4dbae9)){return _0x2196f9['removeAgents'](_0x4dbae9,{'transaction':_0x400160});}})[_0x8642('0x1d')](function(){_0x4dbae9[_0x8642('0x7a')](function(_0x7a3c16){socket[_0x8642('0x7b')](_0x8642('0x91'),{'UserId':_0x7a3c16,'ChatQueueId':_0x2196f9['id']});});});});});});})[_0x8642('0x1d')](respondWithStatusCode(_0x493b0b,null))[_0x8642('0x27')](handleError(_0x493b0b,null));};exports[_0x8642('0x92')]=function(_0xf23fd2,_0x4bf88c,_0x5bd44f){return db[_0x8642('0x4f')][_0x8642('0x56')]({'where':{'id':_0xf23fd2[_0x8642('0x55')]['id']}})[_0x8642('0x1d')](handleEntityNotFound(_0x4bf88c,null))[_0x8642('0x1d')](function(_0x133c33){if(_0x133c33){return _0x133c33['addAgents'](_0xf23fd2[_0x8642('0x62')]['ids'],_[_0x8642('0x93')](_0xf23fd2[_0x8642('0x62')],[_0x8642('0x72'),'id'])||{})[_0x8642('0x94')](function(_0x5984d6){for(var _0x3985d7=0x0;_0x3985d7<_0xf23fd2[_0x8642('0x62')]['ids'][_0x8642('0x43')];_0x3985d7+=0x1){socket[_0x8642('0x7b')](_0x8642('0x7c'),{'UserId':Number(_0xf23fd2[_0x8642('0x62')][_0x8642('0x72')][_0x3985d7]),'ChatQueueId':Number(_0xf23fd2[_0x8642('0x55')]['id'])});}return _0x5984d6;});}})[_0x8642('0x1d')](respondWithResult(_0x4bf88c,null))[_0x8642('0x27')](handleError(_0x4bf88c,null));};exports[_0x8642('0x95')]=function(_0x335d8a,_0x300753,_0x544edb){return db[_0x8642('0x4f')]['find']({'where':{'id':_0x335d8a[_0x8642('0x55')]['id']}})[_0x8642('0x1d')](handleEntityNotFound(_0x300753,null))[_0x8642('0x1d')](function(_0x2de4c5){if(_0x2de4c5){return _0x2de4c5[_0x8642('0x95')](_0x335d8a[_0x8642('0x46')][_0x8642('0x72')])[_0x8642('0x1d')](function(){if(_[_0x8642('0x96')](_0x335d8a['query'][_0x8642('0x72')])){for(var _0x1e514c=0x0;_0x1e514c<_0x335d8a['query']['ids'][_0x8642('0x43')];_0x1e514c+=0x1){socket[_0x8642('0x7b')](_0x8642('0x91'),{'UserId':Number(_0x335d8a['query'][_0x8642('0x72')][_0x1e514c]),'ChatQueueId':Number(_0x335d8a[_0x8642('0x55')]['id'])});}}else{socket[_0x8642('0x7b')](_0x8642('0x91'),{'UserId':Number(_0x335d8a[_0x8642('0x46')]['ids']),'ChatQueueId':Number(_0x335d8a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x300753,null))[_0x8642('0x27')](handleError(_0x300753,null));};exports[_0x8642('0x97')]=function(_0x39d88d,_0x2b0d75,_0x2d2f26){var _0x5dc664={};var _0x1ad323={};var _0xcaeba6;var _0x5b1274;return db[_0x8642('0x4f')][_0x8642('0x6e')]({'where':{'id':_0x39d88d['params']['id']}})[_0x8642('0x1d')](handleEntityNotFound(_0x2b0d75,null))[_0x8642('0x1d')](function(_0x3d9832){if(_0x3d9832){_0xcaeba6=_0x3d9832;_0x1ad323['model']=_[_0x8642('0x3e')](db['User'][_0x8642('0x66')]);_0x1ad323['query']=_[_0x8642('0x3e')](_0x39d88d['query']);_0x1ad323[_0x8642('0x3f')]=_[_0x8642('0x40')](_0x1ad323[_0x8642('0x3d')],_0x1ad323[_0x8642('0x46')]);_0x5dc664[_0x8642('0x41')]=_['intersection'](_0x1ad323[_0x8642('0x3d')],qs[_0x8642('0x42')](_0x39d88d['query'][_0x8642('0x42')]));_0x5dc664['attributes']=_0x5dc664[_0x8642('0x41')][_0x8642('0x43')]?_0x5dc664['attributes']:_0x1ad323[_0x8642('0x3d')];_0x5dc664[_0x8642('0x47')]=qs[_0x8642('0x48')](_0x39d88d[_0x8642('0x46')][_0x8642('0x48')]);_0x5dc664[_0x8642('0x49')]=qs['filters'](_[_0x8642('0x4a')](_0x39d88d[_0x8642('0x46')],_0x1ad323[_0x8642('0x3f')]));if(_0x39d88d[_0x8642('0x46')][_0x8642('0x4b')]){_0x5dc664['where']=_[_0x8642('0x4c')](_0x5dc664['where'],{'$or':_[_0x8642('0x39')](_0x5dc664[_0x8642('0x41')],function(_0x260ca0){var _0x23bffa={};_0x23bffa[_0x260ca0]={'$like':'%'+_0x39d88d[_0x8642('0x46')][_0x8642('0x4b')]+'%'};return _0x23bffa;})});}_0x5dc664=_[_0x8642('0x4c')]({},_0x5dc664,_0x39d88d['options']);return _0xcaeba6[_0x8642('0x97')](_0x5dc664);}})['then'](function(_0x50e722){if(_0x50e722){_0x5b1274=_0x50e722[_0x8642('0x43')];if(!_0x39d88d[_0x8642('0x46')][_0x8642('0x44')](_0x8642('0x45'))){_0x5dc664[_0x8642('0x2e')]=qs['limit'](_0x39d88d[_0x8642('0x46')][_0x8642('0x2e')]);_0x5dc664['offset']=qs[_0x8642('0x2c')](_0x39d88d[_0x8642('0x46')][_0x8642('0x2c')]);}return _0xcaeba6[_0x8642('0x97')](_0x5dc664);}})[_0x8642('0x1d')](function(_0x22d9e8){if(_0x22d9e8){return _0x22d9e8?{'count':_0x5b1274,'rows':_0x22d9e8}:null;}})[_0x8642('0x1d')](respondWithResult(_0x2b0d75,null))[_0x8642('0x27')](handleError(_0x2b0d75,null));};
\ No newline at end of file
+var _0xc667=['update','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','order','sort','where','merge','filter','options','include','findAll','rows','params','intersection','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','hasOwnProperty','nolimit','pick','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','Team','ids','online','voicePause','interface','Agents','transaction','addTeams','findOrCreate','forEach','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','sequelize','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x3357c4,_0xffb532){var _0x2c9a62=function(_0x317e58){while(--_0x317e58){_0x3357c4['push'](_0x3357c4['shift']());}};_0x2c9a62(++_0xffb532);}(_0xc667,0x66));var _0x7c66=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc667[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x7c66('0x0'));var rimraf=require(_0x7c66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7c66('0x2'));var moment=require(_0x7c66('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c66('0x4'));var util=require(_0x7c66('0x5'));var path=require(_0x7c66('0x6'));var sox=require(_0x7c66('0x7'));var csv=require(_0x7c66('0x8'));var ejs=require(_0x7c66('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c66('0xa'));var squel=require('squel');var crypto=require(_0x7c66('0xb'));var jsforce=require(_0x7c66('0xc'));var deskjs=require(_0x7c66('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7c66('0xe'));var Papa=require(_0x7c66('0xf'));var Redis=require(_0x7c66('0x10'));var authService=require(_0x7c66('0x11'));var qs=require(_0x7c66('0x12'));var as=require(_0x7c66('0x13'));var hardwareService=require(_0x7c66('0x14'));var logger=require(_0x7c66('0x15'))('api');var utils=require(_0x7c66('0x16'));var config=require(_0x7c66('0x17'));var licenseUtil=require(_0x7c66('0x18'));var db=require(_0x7c66('0x19'))['db'];config[_0x7c66('0x1a')]=_['defaults'](config[_0x7c66('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c66('0x1b'))(new Redis(config[_0x7c66('0x1a')]));require(_0x7c66('0x1c'))[_0x7c66('0x1d')](socket);var jayson=require(_0x7c66('0x1e'));var client=jayson[_0x7c66('0x1f')][_0x7c66('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1e9315,_0x23dccf,_0x4f4da8,_0x27f9b4){return new BPromise(function(_0x2e41e8,_0x2e8d57){var _0x26fe44=_0x27f9b4||client;return _0x26fe44[_0x7c66('0x21')](_0x1e9315,_0x4f4da8)[_0x7c66('0x22')](function(_0x5b7965){logger[_0x7c66('0x23')]('ChatQueue,\x20%s,\x20%s',_0x23dccf,'request\x20sent');logger[_0x7c66('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23dccf,'request\x20sent',JSON['stringify'](_0x5b7965));if(_0x5b7965[_0x7c66('0x25')]){if(_0x5b7965[_0x7c66('0x25')][_0x7c66('0x26')]===0x1f4){logger[_0x7c66('0x25')](_0x7c66('0x27'),_0x23dccf,_0x5b7965[_0x7c66('0x25')][_0x7c66('0x28')]);return _0x2e8d57(_0x5b7965[_0x7c66('0x25')][_0x7c66('0x28')]);}logger[_0x7c66('0x25')]('ChatQueue,\x20%s,\x20%s',_0x23dccf,_0x5b7965[_0x7c66('0x25')][_0x7c66('0x28')]);return _0x2e41e8(_0x5b7965[_0x7c66('0x25')][_0x7c66('0x28')]);}else{logger[_0x7c66('0x23')]('ChatQueue,\x20%s,\x20%s',_0x23dccf,'request\x20sent');_0x2e41e8(_0x5b7965[_0x7c66('0x29')][_0x7c66('0x28')]);}})['catch'](function(_0x3a6510){logger[_0x7c66('0x25')](_0x7c66('0x27'),_0x23dccf,_0x3a6510);_0x2e8d57(_0x3a6510);});});}function respondWithStatusCode(_0x45e187,_0x4e7681){_0x4e7681=_0x4e7681||0xcc;return function(_0x193e2c){if(_0x193e2c){return _0x45e187[_0x7c66('0x2a')](_0x4e7681);}return _0x45e187[_0x7c66('0x2b')](_0x4e7681)[_0x7c66('0x2c')]();};}function respondWithResult(_0x518288,_0x2c452a){_0x2c452a=_0x2c452a||0xc8;return function(_0x4fbcf8){if(_0x4fbcf8){return _0x518288['status'](_0x2c452a)[_0x7c66('0x2d')](_0x4fbcf8);}};}function respondWithFilteredResult(_0x3cdd8a,_0x10fad3){return function(_0xa5aa01){if(_0xa5aa01){var _0x5c641b=typeof _0x10fad3[_0x7c66('0x2e')]===_0x7c66('0x2f')&&typeof _0x10fad3[_0x7c66('0x30')]===_0x7c66('0x2f');var _0x1d8f0b=_0xa5aa01[_0x7c66('0x31')];var _0x4287a8=_0x5c641b?0x0:_0x10fad3[_0x7c66('0x2e')];var _0x23dd8a=_0x5c641b?_0xa5aa01['count']:_0x10fad3[_0x7c66('0x2e')]+_0x10fad3['limit'];var _0x407262;if(_0x23dd8a>=_0x1d8f0b){_0x23dd8a=_0x1d8f0b;_0x407262=0xc8;}else{_0x407262=0xce;}_0x3cdd8a['status'](_0x407262);return _0x3cdd8a[_0x7c66('0x32')]('Content-Range',_0x4287a8+'-'+_0x23dd8a+'/'+_0x1d8f0b)[_0x7c66('0x2d')](_0xa5aa01);}return null;};}function patchUpdates(_0x3ba427){return function(_0x2ec486){try{jsonpatch[_0x7c66('0x33')](_0x2ec486,_0x3ba427,!![]);}catch(_0x56cd2e){return BPromise[_0x7c66('0x34')](_0x56cd2e);}return _0x2ec486[_0x7c66('0x35')]();};}function saveUpdates(_0x219006,_0x53169a){return function(_0x123a91){if(_0x123a91){return _0x123a91[_0x7c66('0x36')](_0x219006)[_0x7c66('0x22')](function(_0x4eef3e){return _0x4eef3e;});}return null;};}function removeEntity(_0x127b4b,_0x359f98){return function(_0x3a64c3){if(_0x3a64c3){return _0x3a64c3[_0x7c66('0x37')]()[_0x7c66('0x22')](function(){var _0x43cd95=_0x3a64c3[_0x7c66('0x38')]({'plain':!![]});var _0x5bca7f=_0x7c66('0x39');return db[_0x7c66('0x3a')][_0x7c66('0x37')]({'where':{'type':_0x5bca7f,'resourceId':_0x43cd95['id']}})[_0x7c66('0x22')](function(){return _0x3a64c3;});})[_0x7c66('0x22')](function(){_0x127b4b['status'](0xcc)[_0x7c66('0x2c')]();});}};}function handleEntityNotFound(_0x5213ac,_0x1dd4e8){return function(_0x38b560){if(!_0x38b560){_0x5213ac['sendStatus'](0x194);}return _0x38b560;};}function handleError(_0x3a645f,_0x25c7d6){_0x25c7d6=_0x25c7d6||0x1f4;return function(_0x33e1ef){logger[_0x7c66('0x25')](_0x33e1ef[_0x7c66('0x3b')]);if(_0x33e1ef['name']){delete _0x33e1ef[_0x7c66('0x3c')];}_0x3a645f['status'](_0x25c7d6)['send'](_0x33e1ef);};}exports[_0x7c66('0x3d')]=function(_0x879892,_0x20f81c){var _0x5685ba={},_0x1c757d={},_0x1c286e={'count':0x0,'rows':[]};var _0x32d411=_[_0x7c66('0x3e')](db[_0x7c66('0x3f')][_0x7c66('0x40')],function(_0x2e95aa){return{'name':_0x2e95aa[_0x7c66('0x41')],'type':_0x2e95aa[_0x7c66('0x42')][_0x7c66('0x43')]};});_0x1c757d['model']=_[_0x7c66('0x3e')](_0x32d411,'name');_0x1c757d[_0x7c66('0x44')]=_[_0x7c66('0x45')](_0x879892['query']);_0x1c757d[_0x7c66('0x46')]=_['intersection'](_0x1c757d[_0x7c66('0x47')],_0x1c757d['query']);_0x5685ba['attributes']=_['intersection'](_0x1c757d[_0x7c66('0x47')],qs[_0x7c66('0x48')](_0x879892[_0x7c66('0x44')]['fields']));_0x5685ba['attributes']=_0x5685ba[_0x7c66('0x49')][_0x7c66('0x4a')]?_0x5685ba[_0x7c66('0x49')]:_0x1c757d['model'];if(!_0x879892[_0x7c66('0x44')]['hasOwnProperty']('nolimit')){_0x5685ba[_0x7c66('0x30')]=qs[_0x7c66('0x30')](_0x879892['query'][_0x7c66('0x30')]);_0x5685ba[_0x7c66('0x2e')]=qs[_0x7c66('0x2e')](_0x879892[_0x7c66('0x44')]['offset']);}_0x5685ba[_0x7c66('0x4b')]=qs['sort'](_0x879892[_0x7c66('0x44')][_0x7c66('0x4c')]);_0x5685ba[_0x7c66('0x4d')]=qs[_0x7c66('0x46')](_['pick'](_0x879892[_0x7c66('0x44')],_0x1c757d[_0x7c66('0x46')]),_0x32d411);if(_0x879892[_0x7c66('0x44')]['filter']){_0x5685ba[_0x7c66('0x4d')]=_[_0x7c66('0x4e')](_0x5685ba[_0x7c66('0x4d')],{'$or':_['map'](_0x32d411,function(_0x4b1e4f){if(_0x4b1e4f['type']!=='VIRTUAL'){var _0x1bcca2={};_0x1bcca2[_0x4b1e4f['name']]={'$like':'%'+_0x879892[_0x7c66('0x44')][_0x7c66('0x4f')]+'%'};return _0x1bcca2;}})});}_0x5685ba=_[_0x7c66('0x4e')]({},_0x5685ba,_0x879892[_0x7c66('0x50')]);var _0x154bc4={'where':_0x5685ba[_0x7c66('0x4d')]};return db['ChatQueue'][_0x7c66('0x31')](_0x154bc4)['then'](function(_0x13552c){_0x1c286e[_0x7c66('0x31')]=_0x13552c;if(_0x879892[_0x7c66('0x44')]['includeAll']){_0x5685ba[_0x7c66('0x51')]=[{'all':!![]}];}return db[_0x7c66('0x3f')][_0x7c66('0x52')](_0x5685ba);})['then'](function(_0x20f5d2){_0x1c286e[_0x7c66('0x53')]=_0x20f5d2;return _0x1c286e;})['then'](respondWithFilteredResult(_0x20f81c,_0x5685ba))['catch'](handleError(_0x20f81c,null));};exports['show']=function(_0x10ea50,_0x5eba9b){var _0x5d12e1={'raw':!![],'where':{'id':_0x10ea50[_0x7c66('0x54')]['id']}},_0x481e3e={};_0x481e3e[_0x7c66('0x47')]=_[_0x7c66('0x45')](db[_0x7c66('0x3f')][_0x7c66('0x40')]);_0x481e3e['query']=_[_0x7c66('0x45')](_0x10ea50[_0x7c66('0x44')]);_0x481e3e['filters']=_[_0x7c66('0x55')](_0x481e3e[_0x7c66('0x47')],_0x481e3e[_0x7c66('0x44')]);_0x5d12e1[_0x7c66('0x49')]=_[_0x7c66('0x55')](_0x481e3e[_0x7c66('0x47')],qs['fields'](_0x10ea50[_0x7c66('0x44')]['fields']));_0x5d12e1[_0x7c66('0x49')]=_0x5d12e1['attributes'][_0x7c66('0x4a')]?_0x5d12e1[_0x7c66('0x49')]:_0x481e3e[_0x7c66('0x47')];if(_0x10ea50[_0x7c66('0x44')][_0x7c66('0x56')]){_0x5d12e1['include']=[{'all':!![]}];}_0x5d12e1=_['merge']({},_0x5d12e1,_0x10ea50[_0x7c66('0x50')]);return db['ChatQueue']['find'](_0x5d12e1)['then'](handleEntityNotFound(_0x5eba9b,null))[_0x7c66('0x22')](respondWithResult(_0x5eba9b,null))[_0x7c66('0x57')](handleError(_0x5eba9b,null));};exports[_0x7c66('0x58')]=function(_0x28572f,_0xea27f){return db[_0x7c66('0x3f')][_0x7c66('0x58')](_0x28572f[_0x7c66('0x59')],{})['then'](function(_0x386160){var _0x4ac478=_0x28572f[_0x7c66('0x5a')][_0x7c66('0x38')]({'plain':!![]});if(!_0x4ac478)throw new Error(_0x7c66('0x5b'));if(_0x4ac478[_0x7c66('0x5c')]===_0x7c66('0x5a')){var _0x4751de=_0x386160['get']({'plain':!![]});var _0x78f201=_0x7c66('0x39');return db[_0x7c66('0x5d')][_0x7c66('0x5e')]({'where':{'name':_0x78f201,'userProfileId':_0x4ac478['userProfileId']},'raw':!![]})[_0x7c66('0x22')](function(_0x3a09a8){if(_0x3a09a8&&_0x3a09a8[_0x7c66('0x5f')]===0x0){return db[_0x7c66('0x3a')][_0x7c66('0x58')]({'name':_0x4751de[_0x7c66('0x3c')],'resourceId':_0x4751de['id'],'type':_0x3a09a8[_0x7c66('0x3c')],'sectionId':_0x3a09a8['id']},{})[_0x7c66('0x22')](function(){return _0x386160;});}else{return _0x386160;}})[_0x7c66('0x57')](function(_0x57e39e){logger[_0x7c66('0x25')](_0x7c66('0x60'),_0x57e39e);throw _0x57e39e;});}return _0x386160;})[_0x7c66('0x22')](respondWithResult(_0xea27f,0xc9))[_0x7c66('0x57')](handleError(_0xea27f,null));};exports['update']=function(_0x1cd2a5,_0x3981b0){if(_0x1cd2a5[_0x7c66('0x59')]['id']){delete _0x1cd2a5['body']['id'];}return db[_0x7c66('0x3f')]['find']({'where':{'id':_0x1cd2a5['params']['id']}})[_0x7c66('0x22')](handleEntityNotFound(_0x3981b0,null))['then'](saveUpdates(_0x1cd2a5[_0x7c66('0x59')],null))[_0x7c66('0x22')](respondWithResult(_0x3981b0,null))[_0x7c66('0x57')](handleError(_0x3981b0,null));};exports[_0x7c66('0x37')]=function(_0x389c67,_0x3c4879){return db[_0x7c66('0x3f')]['find']({'where':{'id':_0x389c67['params']['id']}})[_0x7c66('0x22')](handleEntityNotFound(_0x3c4879,null))[_0x7c66('0x22')](removeEntity(_0x3c4879,null))[_0x7c66('0x57')](handleError(_0x3c4879,null));};exports['describe']=function(_0x5d28e8,_0x4782e9){return db['ChatQueue'][_0x7c66('0x61')]()['then'](respondWithResult(_0x4782e9,null))[_0x7c66('0x57')](handleError(_0x4782e9,null));};exports['getMembers']=function(_0x1030d8,_0x558803,_0x4ea5ee){var _0x2fa63d={'raw':!![],'where':{}},_0x275d40={},_0x16267d;return db[_0x7c66('0x3f')][_0x7c66('0x62')]({'where':{'id':_0x1030d8[_0x7c66('0x54')]['id']}})['then'](handleEntityNotFound(_0x558803,null))[_0x7c66('0x22')](function(_0x8de73b){if(_0x8de73b){_0x16267d=_0x8de73b[_0x7c66('0x38')]({'plain':!![]});_0x275d40[_0x7c66('0x47')]=_[_0x7c66('0x45')](db[_0x7c66('0x63')]['rawAttributes']);_0x275d40[_0x7c66('0x44')]=_[_0x7c66('0x45')](_0x1030d8[_0x7c66('0x44')]);_0x275d40['filters']=_[_0x7c66('0x55')](_0x275d40[_0x7c66('0x47')],_0x275d40[_0x7c66('0x44')]);_0x2fa63d['attributes']=_[_0x7c66('0x55')](_0x275d40[_0x7c66('0x47')],qs[_0x7c66('0x48')](_0x1030d8['query'][_0x7c66('0x48')]));_0x2fa63d[_0x7c66('0x49')]=_0x2fa63d[_0x7c66('0x49')][_0x7c66('0x4a')]?_0x2fa63d[_0x7c66('0x49')]:_0x275d40[_0x7c66('0x47')];if(!_0x1030d8[_0x7c66('0x44')][_0x7c66('0x64')](_0x7c66('0x65'))){_0x2fa63d[_0x7c66('0x30')]=qs[_0x7c66('0x30')](_0x1030d8[_0x7c66('0x44')][_0x7c66('0x30')]);_0x2fa63d[_0x7c66('0x2e')]=qs[_0x7c66('0x2e')](_0x1030d8['query'][_0x7c66('0x2e')]);}_0x2fa63d['order']=qs[_0x7c66('0x4c')](_0x1030d8['query'][_0x7c66('0x4c')]);_0x2fa63d[_0x7c66('0x4d')]=qs['filters'](_[_0x7c66('0x66')](_0x1030d8[_0x7c66('0x44')],_0x275d40[_0x7c66('0x46')]));_0x2fa63d[_0x7c66('0x4d')]['ChatQueueId']=_0x8de73b['id'];if(_0x1030d8[_0x7c66('0x44')][_0x7c66('0x4f')]){_0x2fa63d[_0x7c66('0x4d')]=_[_0x7c66('0x4e')](_0x2fa63d[_0x7c66('0x4d')],{'$or':_['map'](_0x2fa63d[_0x7c66('0x49')],function(_0x2eece6){var _0x538674={};_0x538674[_0x2eece6]={'$like':'%'+_0x1030d8[_0x7c66('0x44')][_0x7c66('0x4f')]+'%'};return _0x538674;})});}_0x2fa63d=_[_0x7c66('0x4e')]({},_0x2fa63d,_0x1030d8[_0x7c66('0x50')]);return db[_0x7c66('0x63')]['findAll'](_0x2fa63d);}})[_0x7c66('0x22')](function(_0x47cf07){if(_0x47cf07){return db[_0x7c66('0x67')][_0x7c66('0x68')]({'where':{'id':_[_0x7c66('0x3e')](_0x47cf07,_0x7c66('0x69')),'role':_0x7c66('0x6a')},'attributes':['id','name','chatPause',_0x7c66('0x6b'),_0x7c66('0x6c')]});}})[_0x7c66('0x22')](function(_0x4699c4){if(_0x4699c4){return{'count':_0x4699c4[_0x7c66('0x31')],'rows':_[_0x7c66('0x3e')](_0x4699c4[_0x7c66('0x53')],function(_0x35b07b){return{'membername':_0x35b07b[_0x7c66('0x3c')],'UserId':_0x35b07b['id'],'queue_name':_0x16267d[_0x7c66('0x3c')],'ChatQueueId':_0x16267d['id'],'interface':util[_0x7c66('0x6d')](_0x7c66('0x6e'),_0x7c66('0x6f'),_0x35b07b['name']),'penalty':0x0,'paused':_0x35b07b[_0x7c66('0x70')],'createdAt':_0x35b07b[_0x7c66('0x6c')],'updatedAt':_0x35b07b[_0x7c66('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c66('0x22')](respondWithFilteredResult(_0x558803,_0x2fa63d))[_0x7c66('0x57')](handleError(_0x558803,null));};exports[_0x7c66('0x71')]=function(_0x396e51,_0x89b920,_0x34c60d){var _0x3d7f4a={};var _0x29c6c4={};var _0x3d2b4d;var _0x14ae04;return db[_0x7c66('0x3f')]['findOne']({'where':{'id':_0x396e51['params']['id']}})[_0x7c66('0x22')](handleEntityNotFound(_0x89b920,null))[_0x7c66('0x22')](function(_0x548e90){if(_0x548e90){_0x3d2b4d=_0x548e90;_0x29c6c4['model']=_[_0x7c66('0x45')](db[_0x7c66('0x72')]['rawAttributes']);_0x29c6c4['query']=_[_0x7c66('0x45')](_0x396e51[_0x7c66('0x44')]);_0x29c6c4[_0x7c66('0x46')]=_['intersection'](_0x29c6c4['model'],_0x29c6c4[_0x7c66('0x44')]);_0x3d7f4a[_0x7c66('0x49')]=_[_0x7c66('0x55')](_0x29c6c4[_0x7c66('0x47')],qs[_0x7c66('0x48')](_0x396e51[_0x7c66('0x44')][_0x7c66('0x48')]));_0x3d7f4a[_0x7c66('0x49')]=_0x3d7f4a[_0x7c66('0x49')][_0x7c66('0x4a')]?_0x3d7f4a['attributes']:_0x29c6c4[_0x7c66('0x47')];_0x3d7f4a[_0x7c66('0x4b')]=qs[_0x7c66('0x4c')](_0x396e51[_0x7c66('0x44')][_0x7c66('0x4c')]);_0x3d7f4a[_0x7c66('0x4d')]=qs[_0x7c66('0x46')](_[_0x7c66('0x66')](_0x396e51['query'],_0x29c6c4[_0x7c66('0x46')]));if(_0x396e51[_0x7c66('0x44')][_0x7c66('0x4f')]){_0x3d7f4a[_0x7c66('0x4d')]=_[_0x7c66('0x4e')](_0x3d7f4a[_0x7c66('0x4d')],{'$or':_[_0x7c66('0x3e')](_0x3d7f4a[_0x7c66('0x49')],function(_0x154687){var _0x543482={};_0x543482[_0x154687]={'$like':'%'+_0x396e51[_0x7c66('0x44')][_0x7c66('0x4f')]+'%'};return _0x543482;})});}_0x3d7f4a=_['merge']({},_0x3d7f4a,_0x396e51[_0x7c66('0x50')]);return _0x3d2b4d['getTeams'](_0x3d7f4a);}})['then'](function(_0x2ada88){if(_0x2ada88){_0x14ae04=_0x2ada88[_0x7c66('0x4a')];if(!_0x396e51[_0x7c66('0x44')][_0x7c66('0x64')](_0x7c66('0x65'))){_0x3d7f4a['limit']=qs['limit'](_0x396e51['query'][_0x7c66('0x30')]);_0x3d7f4a['offset']=qs['offset'](_0x396e51[_0x7c66('0x44')]['offset']);}return _0x3d2b4d['getTeams'](_0x3d7f4a);}})['then'](function(_0x357070){if(_0x357070){return _0x357070?{'count':_0x14ae04,'rows':_0x357070}:null;}})[_0x7c66('0x22')](respondWithResult(_0x89b920,null))['catch'](handleError(_0x89b920,null));};exports['addTeams']=function(_0x443584,_0x58e477,_0xf60b8a){var _0x469de2=_0x443584[_0x7c66('0x59')][_0x7c66('0x73')];return db[_0x7c66('0x72')][_0x7c66('0x52')]({'where':{'id':_0x469de2},'attributes':['id'],'include':[{'model':db[_0x7c66('0x67')],'as':'Agents','attributes':['id',_0x7c66('0x3c'),_0x7c66('0x74'),_0x7c66('0x75'),_0x7c66('0x76')],'raw':!![]}]})['then'](function(_0x7094dc){if(_0x7094dc){var _0x15e8f2=_['flatMap'](_0x7094dc,function(_0x51b79c){var _0x432b10=_0x51b79c[_0x7c66('0x38')]({'plain':!![]});return _0x432b10[_0x7c66('0x77')];});return db[_0x7c66('0x3f')][_0x7c66('0x5e')]({'where':{'id':_0x443584[_0x7c66('0x54')]['id']}})[_0x7c66('0x22')](function(_0x12cd04){return db['sequelize'][_0x7c66('0x78')](function(_0x11f8d2){return _0x12cd04[_0x7c66('0x79')](_0x469de2,{'transaction':_0x11f8d2})[_0x7c66('0x22')](function(){return BPromise['each'](_0x15e8f2,function(_0x3587c9){return db['UserChatQueue'][_0x7c66('0x7a')]({'where':{'UserId':_0x3587c9['id'],'ChatQueueId':_0x443584[_0x7c66('0x54')]['id']},'transaction':_0x11f8d2});});})[_0x7c66('0x22')](function(){_0x15e8f2[_0x7c66('0x7b')](function(_0x7d5f1b){socket[_0x7c66('0x7c')](_0x7c66('0x7d'),{'UserId':_0x7d5f1b['id'],'ChatQueueId':_0x12cd04['id']});});});});});}})[_0x7c66('0x22')](respondWithStatusCode(_0x58e477,null))[_0x7c66('0x57')](handleError(_0x58e477,null));};exports[_0x7c66('0x7e')]=function(_0x30ce30,_0x471730,_0x3a3e75){return db[_0x7c66('0x72')][_0x7c66('0x52')]({'where':{'id':_0x30ce30[_0x7c66('0x44')][_0x7c66('0x73')]},'attributes':['id'],'include':[{'model':db[_0x7c66('0x67')],'as':_0x7c66('0x77'),'attributes':['id'],'raw':!![]}]})[_0x7c66('0x22')](handleEntityNotFound(_0x471730,null))[_0x7c66('0x22')](function(_0x109fda){var _0x5a1dd8=_[_0x7c66('0x3e')](_0x109fda,'id');var _0x28551b=[];var _0x175313=[];var _0x22b794=squel[_0x7c66('0x7f')]();_0x22b794[_0x7c66('0x80')](_0x7c66('0x81'))[_0x7c66('0x82')](_0x7c66('0x83'),'tq')[_0x7c66('0x84')](_0x7c66('0x85'),'ut',_0x7c66('0x86'))[_0x7c66('0x4d')](_0x7c66('0x87'),_0x30ce30[_0x7c66('0x54')]['id']);for(var _0x335568=0x0;_0x335568<_0x109fda[_0x7c66('0x4a')];_0x335568+=0x1){let _0x1a4035=_0x109fda[_0x335568];for(var _0x752323=0x0;_0x752323<_0x1a4035['Agents'][_0x7c66('0x4a')];_0x752323+=0x1){let _0x1e8c91=_0x1a4035[_0x7c66('0x77')][_0x752323];var _0x3b3887=_0x22b794[_0x7c66('0x88')]();_0x3b3887[_0x7c66('0x4d')](_0x7c66('0x89'),_0x1e8c91['id']);_0x175313[_0x7c66('0x8a')](db[_0x7c66('0x8b')][_0x7c66('0x44')](_0x3b3887[_0x7c66('0x8c')](),{'type':db[_0x7c66('0x8b')][_0x7c66('0x8d')][_0x7c66('0x8e')]})[_0x7c66('0x22')](function(_0x226047){if(_0x226047['length']===0x1){return _0x1e8c91['id'];}else{var _0x415aac=_[_0x7c66('0x8f')](_[_0x7c66('0x3e')](_0x226047,'TeamId'),function(_0x1dfa84){return _[_0x7c66('0x90')](_0x5a1dd8,_0x1dfa84);});if(_0x415aac){return _0x1e8c91['id'];}}}));}}return BPromise['all'](_0x175313)[_0x7c66('0x22')](function(_0x9538e){_0x28551b=_(_0x28551b)[_0x7c66('0x91')](_0x9538e)[_0x7c66('0x92')]()[_0x7c66('0x93')]();return db[_0x7c66('0x3f')]['find']({'where':{'id':_0x30ce30[_0x7c66('0x54')]['id']}})[_0x7c66('0x22')](function(_0x57fdfd){return db['sequelize'][_0x7c66('0x78')](function(_0x56a2d8){return _0x57fdfd[_0x7c66('0x7e')](_0x30ce30[_0x7c66('0x44')][_0x7c66('0x73')],{'transaction':_0x56a2d8})['then'](function(){if(!_[_0x7c66('0x94')](_0x28551b)){return _0x57fdfd[_0x7c66('0x95')](_0x28551b,{'transaction':_0x56a2d8});}})[_0x7c66('0x22')](function(){_0x28551b[_0x7c66('0x7b')](function(_0x38c5ca){socket[_0x7c66('0x7c')](_0x7c66('0x96'),{'UserId':_0x38c5ca,'ChatQueueId':_0x57fdfd['id']});});});});});});})[_0x7c66('0x22')](respondWithStatusCode(_0x471730,null))[_0x7c66('0x57')](handleError(_0x471730,null));};exports[_0x7c66('0x97')]=function(_0x4f12e9,_0x154e80,_0xc37258){return db[_0x7c66('0x3f')][_0x7c66('0x5e')]({'where':{'id':_0x4f12e9[_0x7c66('0x54')]['id']}})['then'](handleEntityNotFound(_0x154e80,null))[_0x7c66('0x22')](function(_0x16fa61){if(_0x16fa61){return _0x16fa61['addAgents'](_0x4f12e9['body'][_0x7c66('0x73')],_[_0x7c66('0x98')](_0x4f12e9['body'],[_0x7c66('0x73'),'id'])||{})[_0x7c66('0x99')](function(_0xd7787b){for(var _0x4c5987=0x0;_0x4c5987<_0x4f12e9[_0x7c66('0x59')][_0x7c66('0x73')][_0x7c66('0x4a')];_0x4c5987+=0x1){socket[_0x7c66('0x7c')](_0x7c66('0x7d'),{'UserId':Number(_0x4f12e9[_0x7c66('0x59')][_0x7c66('0x73')][_0x4c5987]),'ChatQueueId':Number(_0x4f12e9[_0x7c66('0x54')]['id'])});}return _0xd7787b;});}})[_0x7c66('0x22')](respondWithResult(_0x154e80,null))[_0x7c66('0x57')](handleError(_0x154e80,null));};exports[_0x7c66('0x95')]=function(_0x24efe4,_0x3b1447,_0x5c2b50){return db['ChatQueue'][_0x7c66('0x5e')]({'where':{'id':_0x24efe4[_0x7c66('0x54')]['id']}})[_0x7c66('0x22')](handleEntityNotFound(_0x3b1447,null))[_0x7c66('0x22')](function(_0xb7ba91){if(_0xb7ba91){return _0xb7ba91['removeAgents'](_0x24efe4[_0x7c66('0x44')]['ids'])['then'](function(){if(_[_0x7c66('0x9a')](_0x24efe4[_0x7c66('0x44')]['ids'])){for(var _0x3d7dbf=0x0;_0x3d7dbf<_0x24efe4[_0x7c66('0x44')][_0x7c66('0x73')]['length'];_0x3d7dbf+=0x1){socket['emit'](_0x7c66('0x96'),{'UserId':Number(_0x24efe4[_0x7c66('0x44')][_0x7c66('0x73')][_0x3d7dbf]),'ChatQueueId':Number(_0x24efe4['params']['id'])});}}else{socket[_0x7c66('0x7c')](_0x7c66('0x96'),{'UserId':Number(_0x24efe4[_0x7c66('0x44')][_0x7c66('0x73')]),'ChatQueueId':Number(_0x24efe4[_0x7c66('0x54')]['id'])});}});}})[_0x7c66('0x22')](respondWithStatusCode(_0x3b1447,null))[_0x7c66('0x57')](handleError(_0x3b1447,null));};exports[_0x7c66('0x9b')]=function(_0x220461,_0x4c432a,_0x4fd2c0){var _0x27b7e9={};var _0x522070={};var _0x5d92e1;var _0x106518;return db[_0x7c66('0x3f')][_0x7c66('0x62')]({'where':{'id':_0x220461[_0x7c66('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c432a,null))[_0x7c66('0x22')](function(_0x1e7d72){if(_0x1e7d72){_0x5d92e1=_0x1e7d72;_0x522070[_0x7c66('0x47')]=_[_0x7c66('0x45')](db['User']['rawAttributes']);_0x522070[_0x7c66('0x44')]=_[_0x7c66('0x45')](_0x220461[_0x7c66('0x44')]);_0x522070[_0x7c66('0x46')]=_[_0x7c66('0x55')](_0x522070[_0x7c66('0x47')],_0x522070['query']);_0x27b7e9[_0x7c66('0x49')]=_[_0x7c66('0x55')](_0x522070[_0x7c66('0x47')],qs[_0x7c66('0x48')](_0x220461[_0x7c66('0x44')][_0x7c66('0x48')]));_0x27b7e9[_0x7c66('0x49')]=_0x27b7e9[_0x7c66('0x49')][_0x7c66('0x4a')]?_0x27b7e9[_0x7c66('0x49')]:_0x522070['model'];_0x27b7e9[_0x7c66('0x4b')]=qs[_0x7c66('0x4c')](_0x220461[_0x7c66('0x44')][_0x7c66('0x4c')]);_0x27b7e9[_0x7c66('0x4d')]=qs[_0x7c66('0x46')](_['pick'](_0x220461[_0x7c66('0x44')],_0x522070[_0x7c66('0x46')]));if(_0x220461[_0x7c66('0x44')]['filter']){_0x27b7e9['where']=_[_0x7c66('0x4e')](_0x27b7e9[_0x7c66('0x4d')],{'$or':_['map'](_0x27b7e9[_0x7c66('0x49')],function(_0x2916e4){var _0x50d3c8={};_0x50d3c8[_0x2916e4]={'$like':'%'+_0x220461[_0x7c66('0x44')][_0x7c66('0x4f')]+'%'};return _0x50d3c8;})});}_0x27b7e9=_['merge']({},_0x27b7e9,_0x220461['options']);return _0x5d92e1[_0x7c66('0x9b')](_0x27b7e9);}})[_0x7c66('0x22')](function(_0x3c4cee){if(_0x3c4cee){_0x106518=_0x3c4cee[_0x7c66('0x4a')];if(!_0x220461['query']['hasOwnProperty'](_0x7c66('0x65'))){_0x27b7e9[_0x7c66('0x30')]=qs[_0x7c66('0x30')](_0x220461[_0x7c66('0x44')][_0x7c66('0x30')]);_0x27b7e9[_0x7c66('0x2e')]=qs[_0x7c66('0x2e')](_0x220461['query']['offset']);}return _0x5d92e1[_0x7c66('0x9b')](_0x27b7e9);}})[_0x7c66('0x22')](function(_0x20302b){if(_0x20302b){return _0x20302b?{'count':_0x106518,'rows':_0x20302b}:null;}})[_0x7c66('0x22')](respondWithResult(_0x4c432a,null))[_0x7c66('0x57')](handleError(_0x4c432a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 363389c..d5d7608 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 _0x4cdb=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x29bf4,_0x7285fa){var _0x5762e0=function(_0x33fa22){while(--_0x33fa22){_0x29bf4['push'](_0x29bf4['shift']());}};_0x5762e0(++_0x7285fa);}(_0x4cdb,0x182));var _0xb4cd=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x4cdb[_0x1b1e76];return _0x3d743a;};'use strict';var EventEmitter=require(_0xb4cd('0x0'));var ChatQueue=require(_0xb4cd('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb4cd('0x2'),'afterUpdate':'update','afterDestroy':_0xb4cd('0x3')};function emitEvent(_0x2cb515){return function(_0x474e26,_0x61f3d3,_0x3c33dc){ChatQueueEvents[_0xb4cd('0x4')](_0x2cb515+':'+_0x474e26['id'],_0x474e26);ChatQueueEvents[_0xb4cd('0x4')](_0x2cb515,_0x474e26);_0x3c33dc(null);};}for(var e in events){if(events[_0xb4cd('0x5')](e)){var event=events[e];ChatQueue[_0xb4cd('0x6')](e,emitEvent(event));}}module[_0xb4cd('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x01d0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x01d0,0x14e));var _0x001d=function(_0x5da167,_0x465e69){_0x5da167=_0x5da167-0x0;var _0x4d798c=_0x01d0[_0x5da167];return _0x4d798c;};'use strict';var EventEmitter=require(_0x001d('0x0'));var ChatQueue=require(_0x001d('0x1'))['db'][_0x001d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x001d('0x3')](0x0);var events={'afterCreate':_0x001d('0x4'),'afterUpdate':'update','afterDestroy':_0x001d('0x5')};function emitEvent(_0x1b5408){return function(_0x332a01,_0x262c10,_0x1e59fa){ChatQueueEvents[_0x001d('0x6')](_0x1b5408+':'+_0x332a01['id'],_0x332a01);ChatQueueEvents[_0x001d('0x6')](_0x1b5408,_0x332a01);_0x1e59fa(null);};}for(var e in events){if(events[_0x001d('0x7')](e)){var event=events[e];ChatQueue[_0x001d('0x8')](e,emitEvent(event));}}module[_0x001d('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 6b32e13..53893c4 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 _0xe313=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird','path'];(function(_0x4b8482,_0x1c185c){var _0x24956d=function(_0x521707){while(--_0x521707){_0x4b8482['push'](_0x4b8482['shift']());}};_0x24956d(++_0x1c185c);}(_0xe313,0x133));var _0x3e31=function(_0x4265fc,_0x16308a){_0x4265fc=_0x4265fc-0x0;var _0x50acfc=_0xe313[_0x4265fc];return _0x50acfc;};'use strict';var _=require(_0x3e31('0x0'));var util=require('util');var logger=require(_0x3e31('0x1'))(_0x3e31('0x2'));var moment=require('moment');var BPromise=require(_0x3e31('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e31('0x4'));var rimraf=require(_0x3e31('0x5'));var config=require(_0x3e31('0x6'));var attributes=require(_0x3e31('0x7'));module[_0x3e31('0x8')]=function(_0x33bb0c,_0xaaa4c9){return _0x33bb0c[_0x3e31('0x9')](_0x3e31('0xa'),attributes,{'tableName':_0x3e31('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f4e=['exports','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7f4e,0x1f2));var _0xe7f4=function(_0x58b437,_0x2c8a17){_0x58b437=_0x58b437-0x0;var _0xa671e4=_0x7f4e[_0x58b437];return _0xa671e4;};'use strict';var _=require(_0xe7f4('0x0'));var util=require('util');var logger=require(_0xe7f4('0x1'))(_0xe7f4('0x2'));var moment=require(_0xe7f4('0x3'));var BPromise=require(_0xe7f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe7f4('0x5'));var config=require(_0xe7f4('0x6'));var attributes=require(_0xe7f4('0x7'));module[_0xe7f4('0x8')]=function(_0x16b00a,_0x37a8f4){return _0x16b00a['define'](_0xe7f4('0x9'),attributes,{'tableName':_0xe7f4('0xa'),'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 a2b328d..fbfc42a 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 _0x4cdf=['request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','map','model','then','debug','ShowChatQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x4947e3,_0x21f2ee){var _0x1911e5=function(_0x193c1b){while(--_0x193c1b){_0x4947e3['push'](_0x4947e3['shift']());}};_0x1911e5(++_0x21f2ee);}(_0x4cdf,0x180));var _0xf4cd=function(_0x493f18,_0x13790f){_0x493f18=_0x493f18-0x0;var _0x593769=_0x4cdf[_0x493f18];return _0x593769;};'use strict';var _=require(_0xf4cd('0x0'));var util=require(_0xf4cd('0x1'));var moment=require(_0xf4cd('0x2'));var BPromise=require(_0xf4cd('0x3'));var rs=require(_0xf4cd('0x4'));var fs=require('fs');var Redis=require(_0xf4cd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4cd('0x6'));var logger=require(_0xf4cd('0x7'))('rpc');var config=require(_0xf4cd('0x8'));var jayson=require(_0xf4cd('0x9'));var client=jayson[_0xf4cd('0xa')][_0xf4cd('0xb')]({'port':0x232a});config[_0xf4cd('0xc')]=_['defaults'](config[_0xf4cd('0xc')],{'host':_0xf4cd('0xd'),'port':0x18eb});var socket=require(_0xf4cd('0xe'))(new Redis(config[_0xf4cd('0xc')]));require('./chatQueue.socket')[_0xf4cd('0xf')](socket);function respondWithRpcPromise(_0x8778f1,_0x1ab042,_0x3ebf3e){return new BPromise(function(_0x427676,_0x1489c5){return client[_0xf4cd('0x10')](_0x8778f1,_0x3ebf3e)['then'](function(_0x45c46f){logger[_0xf4cd('0x11')](_0xf4cd('0x12'),_0x1ab042,'request\x20sent');logger['debug'](_0xf4cd('0x13'),_0x1ab042,_0xf4cd('0x14'),JSON[_0xf4cd('0x15')](_0x45c46f));if(_0x45c46f['error']){if(_0x45c46f[_0xf4cd('0x16')][_0xf4cd('0x17')]===0x1f4){logger[_0xf4cd('0x16')](_0xf4cd('0x12'),_0x1ab042,_0x45c46f[_0xf4cd('0x16')][_0xf4cd('0x18')]);return _0x1489c5(_0x45c46f['error'][_0xf4cd('0x18')]);}logger[_0xf4cd('0x16')](_0xf4cd('0x12'),_0x1ab042,_0x45c46f[_0xf4cd('0x16')]['message']);return _0x427676(_0x45c46f[_0xf4cd('0x16')][_0xf4cd('0x18')]);}else{logger[_0xf4cd('0x11')](_0xf4cd('0x12'),_0x1ab042,'request\x20sent');_0x427676(_0x45c46f['result'][_0xf4cd('0x18')]);}})[_0xf4cd('0x19')](function(_0x50c289){logger[_0xf4cd('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1ab042,_0x50c289);_0x1489c5(_0x50c289);});});}exports[_0xf4cd('0x1a')]=function(_0x82e1e5){var _0x40de42=this;return new Promise(function(_0xea3404,_0x36ab1a){return db[_0xf4cd('0x1b')][_0xf4cd('0x1c')]({'raw':_0x82e1e5[_0xf4cd('0x1d')]?_0x82e1e5[_0xf4cd('0x1d')][_0xf4cd('0x1e')]===undefined?!![]:![]:!![],'where':_0x82e1e5['options']?_0x82e1e5[_0xf4cd('0x1d')]['where']||null:null,'attributes':_0x82e1e5['options']?_0x82e1e5[_0xf4cd('0x1d')][_0xf4cd('0x1f')]||null:null,'limit':_0x82e1e5[_0xf4cd('0x1d')]?_0x82e1e5[_0xf4cd('0x1d')]['limit']||null:null,'include':_0x82e1e5['options']?_0x82e1e5['options'][_0xf4cd('0x20')]?_[_0xf4cd('0x21')](_0x82e1e5[_0xf4cd('0x1d')][_0xf4cd('0x20')],function(_0x5617ce){return{'model':db[_0x5617ce['model']],'as':_0x5617ce['as'],'attributes':_0x5617ce[_0xf4cd('0x1f')],'include':_0x5617ce[_0xf4cd('0x20')]?_[_0xf4cd('0x21')](_0x5617ce[_0xf4cd('0x20')],function(_0x1b314c){return{'model':db[_0x1b314c['model']],'as':_0x1b314c['as'],'attributes':_0x1b314c[_0xf4cd('0x1f')],'include':_0x1b314c[_0xf4cd('0x20')]?_[_0xf4cd('0x21')](_0x1b314c[_0xf4cd('0x20')],function(_0x5348a0){return{'model':db[_0x5348a0[_0xf4cd('0x22')]],'as':_0x5348a0['as'],'attributes':_0x5348a0[_0xf4cd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf4cd('0x23')](function(_0x2c2390){logger[_0xf4cd('0x11')]('GetChatQueue',_0x82e1e5);logger[_0xf4cd('0x24')]('GetChatQueue',_0x82e1e5,JSON[_0xf4cd('0x15')](_0x2c2390));_0xea3404(_0x2c2390);})[_0xf4cd('0x19')](function(_0x3fb418){logger[_0xf4cd('0x16')]('GetChatQueue',_0x3fb418['message'],_0x82e1e5);_0x36ab1a(_0x40de42['error'](0x1f4,_0x3fb418[_0xf4cd('0x18')]));});});};exports[_0xf4cd('0x25')]=function(_0x30efc3){var _0x459577=this;return new Promise(function(_0x36ccb0,_0x1e8820){return db[_0xf4cd('0x1b')][_0xf4cd('0x26')]({'raw':_0x30efc3[_0xf4cd('0x1d')]?_0x30efc3['options']['raw']===undefined?!![]:![]:!![],'where':_0x30efc3[_0xf4cd('0x1d')]?_0x30efc3[_0xf4cd('0x1d')][_0xf4cd('0x27')]||null:null,'attributes':_0x30efc3[_0xf4cd('0x1d')]?_0x30efc3['options'][_0xf4cd('0x1f')]||null:null,'include':_0x30efc3[_0xf4cd('0x1d')]?_0x30efc3[_0xf4cd('0x1d')][_0xf4cd('0x20')]?_[_0xf4cd('0x21')](_0x30efc3[_0xf4cd('0x1d')][_0xf4cd('0x20')],function(_0x2e4d3f){return{'model':db[_0x2e4d3f[_0xf4cd('0x22')]],'as':_0x2e4d3f['as'],'attributes':_0x2e4d3f[_0xf4cd('0x1f')],'include':_0x2e4d3f[_0xf4cd('0x20')]?_[_0xf4cd('0x21')](_0x2e4d3f[_0xf4cd('0x20')],function(_0x544d7d){return{'model':db[_0x544d7d[_0xf4cd('0x22')]],'as':_0x544d7d['as'],'attributes':_0x544d7d['attributes'],'include':_0x544d7d['include']?_['map'](_0x544d7d[_0xf4cd('0x20')],function(_0x1865b1){return{'model':db[_0x1865b1[_0xf4cd('0x22')]],'as':_0x1865b1['as'],'attributes':_0x1865b1[_0xf4cd('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49c8c3){logger[_0xf4cd('0x11')](_0xf4cd('0x25'),_0x30efc3);logger['debug'](_0xf4cd('0x25'),_0x30efc3,JSON[_0xf4cd('0x15')](_0x49c8c3));_0x36ccb0(_0x49c8c3);})[_0xf4cd('0x19')](function(_0x2186f4){logger['error']('ShowChatQueue',_0x2186f4[_0xf4cd('0x18')],_0x30efc3);_0x1e8820(_0x459577[_0xf4cd('0x16')](0x1f4,_0x2186f4[_0xf4cd('0x18')]));});});};
\ No newline at end of file
+var _0x84ae=['message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetChatQueue','ShowChatQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x1e0e09,_0x53c664){var _0x4e05a1=function(_0x53ee7e){while(--_0x53ee7e){_0x1e0e09['push'](_0x1e0e09['shift']());}};_0x4e05a1(++_0x53c664);}(_0x84ae,0x101));var _0xe84a=function(_0x5b1edc,_0xd5fa84){_0x5b1edc=_0x5b1edc-0x0;var _0xe44ac8=_0x84ae[_0x5b1edc];return _0xe44ac8;};'use strict';var _=require(_0xe84a('0x0'));var util=require(_0xe84a('0x1'));var moment=require(_0xe84a('0x2'));var BPromise=require(_0xe84a('0x3'));var rs=require(_0xe84a('0x4'));var fs=require('fs');var Redis=require(_0xe84a('0x5'));var db=require(_0xe84a('0x6'))['db'];var utils=require(_0xe84a('0x7'));var logger=require(_0xe84a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe84a('0x9')]['http']({'port':0x232a});config[_0xe84a('0xa')]=_[_0xe84a('0xb')](config[_0xe84a('0xa')],{'host':_0xe84a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe84a('0xa')]));require(_0xe84a('0xd'))[_0xe84a('0xe')](socket);function respondWithRpcPromise(_0x5c47f9,_0x2a7d97,_0x17f161){return new BPromise(function(_0x368c9f,_0xbfda9c){return client[_0xe84a('0xf')](_0x5c47f9,_0x17f161)[_0xe84a('0x10')](function(_0x57ed4e){logger[_0xe84a('0x11')](_0xe84a('0x12'),_0x2a7d97,_0xe84a('0x13'));logger[_0xe84a('0x14')](_0xe84a('0x15'),_0x2a7d97,'request\x20sent',JSON['stringify'](_0x57ed4e));if(_0x57ed4e['error']){if(_0x57ed4e[_0xe84a('0x16')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2a7d97,_0x57ed4e[_0xe84a('0x16')][_0xe84a('0x17')]);return _0xbfda9c(_0x57ed4e[_0xe84a('0x16')][_0xe84a('0x17')]);}logger[_0xe84a('0x16')](_0xe84a('0x12'),_0x2a7d97,_0x57ed4e[_0xe84a('0x16')][_0xe84a('0x17')]);return _0x368c9f(_0x57ed4e['error'][_0xe84a('0x17')]);}else{logger[_0xe84a('0x11')](_0xe84a('0x12'),_0x2a7d97,_0xe84a('0x13'));_0x368c9f(_0x57ed4e[_0xe84a('0x18')][_0xe84a('0x17')]);}})[_0xe84a('0x19')](function(_0x1ed66a){logger[_0xe84a('0x16')](_0xe84a('0x12'),_0x2a7d97,_0x1ed66a);_0xbfda9c(_0x1ed66a);});});}exports['GetChatQueue']=function(_0x5cdde7){var _0x38a40a=this;return new Promise(function(_0x5c0177,_0x5aad8a){return db[_0xe84a('0x1a')][_0xe84a('0x1b')]({'raw':_0x5cdde7[_0xe84a('0x1c')]?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cdde7['options']?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x1e')]||null:null,'attributes':_0x5cdde7[_0xe84a('0x1c')]?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x1f')]||null:null,'limit':_0x5cdde7[_0xe84a('0x1c')]?_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x20')]||null:null,'include':_0x5cdde7['options']?_0x5cdde7['options']['include']?_[_0xe84a('0x21')](_0x5cdde7[_0xe84a('0x1c')][_0xe84a('0x22')],function(_0x594fdd){return{'model':db[_0x594fdd[_0xe84a('0x23')]],'as':_0x594fdd['as'],'attributes':_0x594fdd[_0xe84a('0x1f')],'include':_0x594fdd[_0xe84a('0x22')]?_[_0xe84a('0x21')](_0x594fdd[_0xe84a('0x22')],function(_0x30a53c){return{'model':db[_0x30a53c[_0xe84a('0x23')]],'as':_0x30a53c['as'],'attributes':_0x30a53c['attributes'],'include':_0x30a53c[_0xe84a('0x22')]?_['map'](_0x30a53c[_0xe84a('0x22')],function(_0x2a9bf){return{'model':db[_0x2a9bf[_0xe84a('0x23')]],'as':_0x2a9bf['as'],'attributes':_0x2a9bf[_0xe84a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da546){logger[_0xe84a('0x11')](_0xe84a('0x24'),_0x5cdde7);logger[_0xe84a('0x14')](_0xe84a('0x24'),_0x5cdde7,JSON['stringify'](_0x5da546));_0x5c0177(_0x5da546);})[_0xe84a('0x19')](function(_0x569ef4){logger['error'](_0xe84a('0x24'),_0x569ef4['message'],_0x5cdde7);_0x5aad8a(_0x38a40a[_0xe84a('0x16')](0x1f4,_0x569ef4[_0xe84a('0x17')]));});});};exports[_0xe84a('0x25')]=function(_0x2ce18e){var _0x440c64=this;return new Promise(function(_0x536896,_0x35b677){return db['ChatQueue'][_0xe84a('0x26')]({'raw':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e[_0xe84a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e[_0xe84a('0x1c')][_0xe84a('0x1e')]||null:null,'attributes':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e[_0xe84a('0x1c')]['attributes']||null:null,'include':_0x2ce18e[_0xe84a('0x1c')]?_0x2ce18e['options'][_0xe84a('0x22')]?_['map'](_0x2ce18e['options'][_0xe84a('0x22')],function(_0x4e62dc){return{'model':db[_0x4e62dc[_0xe84a('0x23')]],'as':_0x4e62dc['as'],'attributes':_0x4e62dc[_0xe84a('0x1f')],'include':_0x4e62dc[_0xe84a('0x22')]?_[_0xe84a('0x21')](_0x4e62dc[_0xe84a('0x22')],function(_0xe750c5){return{'model':db[_0xe750c5[_0xe84a('0x23')]],'as':_0xe750c5['as'],'attributes':_0xe750c5[_0xe84a('0x1f')],'include':_0xe750c5[_0xe84a('0x22')]?_[_0xe84a('0x21')](_0xe750c5['include'],function(_0x4bea08){return{'model':db[_0x4bea08[_0xe84a('0x23')]],'as':_0x4bea08['as'],'attributes':_0x4bea08[_0xe84a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe84a('0x10')](function(_0x5ad492){logger['info'](_0xe84a('0x25'),_0x2ce18e);logger['debug'](_0xe84a('0x25'),_0x2ce18e,JSON[_0xe84a('0x27')](_0x5ad492));_0x536896(_0x5ad492);})[_0xe84a('0x19')](function(_0x43e172){logger[_0xe84a('0x16')](_0xe84a('0x25'),_0x43e172['message'],_0x2ce18e);_0x35b677(_0x440c64[_0xe84a('0x16')](0x1f4,_0x43e172['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 0daea7d..691a370 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 _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x137788,_0x5bb392){var _0x4cdf67=function(_0x43a0e3){while(--_0x43a0e3){_0x137788['push'](_0x137788['shift']());}};_0x4cdf67(++_0x5bb392);}(_0x2123,0x190));var _0x3212=function(_0x122743,_0x32bc14){_0x122743=_0x122743-0x0;var _0x14fc59=_0x2123[_0x122743];return _0x14fc59;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
+var _0xb469=['./chatQueue.events','save','remove','update','register'];(function(_0x92cab,_0x2c51f8){var _0x426485=function(_0x1b8038){while(--_0x1b8038){_0x92cab['push'](_0x92cab['shift']());}};_0x426485(++_0x2c51f8);}(_0xb469,0x13b));var _0x9b46=function(_0x31b970,_0x513b93){_0x31b970=_0x31b970-0x0;var _0x167869=_0xb469[_0x31b970];return _0x167869;};'use strict';var ChatQueueEvents=require(_0x9b46('0x0'));var events=[_0x9b46('0x1'),_0x9b46('0x2'),_0x9b46('0x3')];function createListener(_0x1a41e8,_0x895347){return function(_0x9212ae){_0x895347['emit'](_0x1a41e8,_0x9212ae);};}function removeListener(_0x31f853,_0x45322f){return function(){ChatQueueEvents['removeListener'](_0x31f853,_0x45322f);};}exports[_0x9b46('0x4')]=function(_0x405d1c){for(var _0x50b49e=0x0,_0x1b2dd3=events['length'];_0x50b49e<_0x1b2dd3;_0x50b49e++){var _0x4c1ed9=events[_0x50b49e];var _0x34c0de=createListener('chatQueue:'+_0x4c1ed9,_0x405d1c);ChatQueueEvents['on'](_0x4c1ed9,_0x34c0de);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index d4e4b33..3fa24a5 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x5fc3[_0x5b7788];return _0x573871;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x5ba482,_0x277785){_0x5ba482=_0x5ba482-0x0;var _0x51b0a4=_0x3e74[_0x5ba482];return _0x51b0a4;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('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 c07c6e5..f1de203 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 _0xb453=['moment','sequelize','STRING','DATE'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb453,0x1e8));var _0x3b45=function(_0xe0c67e,_0x3d62af){_0xe0c67e=_0xe0c67e-0x0;var _0x7d8e09=_0xb453[_0xe0c67e];return _0x7d8e09;};'use strict';var moment=require(_0x3b45('0x0'));var Sequelize=require(_0x3b45('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3b45('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3b45('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3b45('0x3')]},'exitAt':{'type':Sequelize[_0x3b45('0x3')]},'reason':{'type':Sequelize[_0x3b45('0x2')]}};
\ No newline at end of file
+var _0xe168=['DATE','sequelize','exports','STRING'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xe168,0x79));var _0x8e16=function(_0xd2732c,_0x467e35){_0xd2732c=_0xd2732c-0x0;var _0x258f4a=_0xe168[_0xd2732c];return _0x258f4a;};'use strict';var moment=require('moment');var Sequelize=require(_0x8e16('0x0'));module[_0x8e16('0x1')]={'uniqueid':{'type':Sequelize[_0x8e16('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x8e16('0x2')]},'joinAt':{'type':Sequelize[_0x8e16('0x3')]},'leaveAt':{'type':Sequelize[_0x8e16('0x3')]},'acceptAt':{'type':Sequelize[_0x8e16('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b241a2f..985b0b5 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 _0x905a=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','catch','create','body','find','params','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x905a,0xeb));var _0xa905=function(_0x5107ae,_0x2a6e97){_0x5107ae=_0x5107ae-0x0;var _0xa36b8e=_0x905a[_0x5107ae];return _0xa36b8e;};'use strict';var emlformat=require(_0xa905('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa905('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa905('0x2'));var BPromise=require(_0xa905('0x3'));var Mustache=require(_0xa905('0x4'));var util=require(_0xa905('0x5'));var path=require(_0xa905('0x6'));var sox=require(_0xa905('0x7'));var csv=require(_0xa905('0x8'));var ejs=require(_0xa905('0x9'));var fs=require('fs');var fs_extra=require(_0xa905('0xa'));var _=require(_0xa905('0xb'));var squel=require(_0xa905('0xc'));var crypto=require(_0xa905('0xd'));var jsforce=require(_0xa905('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa905('0x8'));var querystring=require('querystring');var Papa=require(_0xa905('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa905('0x10'));var as=require(_0xa905('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa905('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa905('0x13'));var licenseUtil=require(_0xa905('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e06c,_0x3272df){_0x3272df=_0x3272df||0xcc;return function(_0x1caa49){if(_0x1caa49){return _0x54e06c[_0xa905('0x15')](_0x3272df);}return _0x54e06c[_0xa905('0x16')](_0x3272df)[_0xa905('0x17')]();};}function respondWithResult(_0xbe0d64,_0x4c42a4){_0x4c42a4=_0x4c42a4||0xc8;return function(_0x3ec259){if(_0x3ec259){return _0xbe0d64['status'](_0x4c42a4)[_0xa905('0x18')](_0x3ec259);}};}function respondWithFilteredResult(_0x97332d,_0x5990c8){return function(_0x58341f){if(_0x58341f){var _0x5b7b12=typeof _0x5990c8[_0xa905('0x19')]===_0xa905('0x1a')&&typeof _0x5990c8[_0xa905('0x1b')]===_0xa905('0x1a');var _0x185c1c=_0x58341f[_0xa905('0x1c')];var _0x1439d5=_0x5b7b12?0x0:_0x5990c8[_0xa905('0x19')];var _0xa59b33=_0x5b7b12?_0x58341f[_0xa905('0x1c')]:_0x5990c8[_0xa905('0x19')]+_0x5990c8[_0xa905('0x1b')];var _0x56c09f;if(_0xa59b33>=_0x185c1c){_0xa59b33=_0x185c1c;_0x56c09f=0xc8;}else{_0x56c09f=0xce;}_0x97332d[_0xa905('0x16')](_0x56c09f);return _0x97332d[_0xa905('0x1d')](_0xa905('0x1e'),_0x1439d5+'-'+_0xa59b33+'/'+_0x185c1c)[_0xa905('0x18')](_0x58341f);}return null;};}function patchUpdates(_0x14930d){return function(_0x36e094){try{jsonpatch['apply'](_0x36e094,_0x14930d,!![]);}catch(_0x4194a8){return BPromise[_0xa905('0x1f')](_0x4194a8);}return _0x36e094[_0xa905('0x20')]();};}function saveUpdates(_0x3193ca,_0x5c4b50){return function(_0x1da420){if(_0x1da420){return _0x1da420[_0xa905('0x21')](_0x3193ca)[_0xa905('0x22')](function(_0x1689a5){return _0x1689a5;});}return null;};}function removeEntity(_0x50a44a,_0x53d476){return function(_0x23fb4e){if(_0x23fb4e){return _0x23fb4e[_0xa905('0x23')]()['then'](function(){_0x50a44a[_0xa905('0x16')](0xcc)[_0xa905('0x17')]();});}};}function handleEntityNotFound(_0x447f6c,_0x182967){return function(_0x59fb12){if(!_0x59fb12){_0x447f6c[_0xa905('0x15')](0x194);}return _0x59fb12;};}function handleError(_0x3ad10c,_0x4bed6e){_0x4bed6e=_0x4bed6e||0x1f4;return function(_0x3e3067){logger[_0xa905('0x24')](_0x3e3067[_0xa905('0x25')]);if(_0x3e3067[_0xa905('0x26')]){delete _0x3e3067[_0xa905('0x26')];}_0x3ad10c[_0xa905('0x16')](_0x4bed6e)[_0xa905('0x27')](_0x3e3067);};}exports['index']=function(_0x3f391d,_0x32cf90){var _0x38c35d={},_0x4071c0={},_0x2713db={'count':0x0,'rows':[]};var _0x5d99eb=_['map'](db[_0xa905('0x28')][_0xa905('0x29')],function(_0x951d2e){return{'name':_0x951d2e[_0xa905('0x2a')],'type':_0x951d2e['type'][_0xa905('0x2b')]};});_0x4071c0[_0xa905('0x2c')]=_[_0xa905('0x2d')](_0x5d99eb,_0xa905('0x26'));_0x4071c0[_0xa905('0x2e')]=_['keys'](_0x3f391d[_0xa905('0x2e')]);_0x4071c0[_0xa905('0x2f')]=_[_0xa905('0x30')](_0x4071c0[_0xa905('0x2c')],_0x4071c0[_0xa905('0x2e')]);_0x38c35d[_0xa905('0x31')]=_['intersection'](_0x4071c0[_0xa905('0x2c')],qs[_0xa905('0x32')](_0x3f391d[_0xa905('0x2e')][_0xa905('0x32')]));_0x38c35d[_0xa905('0x31')]=_0x38c35d['attributes'][_0xa905('0x33')]?_0x38c35d['attributes']:_0x4071c0[_0xa905('0x2c')];if(!_0x3f391d[_0xa905('0x2e')][_0xa905('0x34')](_0xa905('0x35'))){_0x38c35d['limit']=qs[_0xa905('0x1b')](_0x3f391d[_0xa905('0x2e')]['limit']);_0x38c35d[_0xa905('0x19')]=qs['offset'](_0x3f391d[_0xa905('0x2e')]['offset']);}_0x38c35d[_0xa905('0x36')]=qs['sort'](_0x3f391d[_0xa905('0x2e')][_0xa905('0x37')]);_0x38c35d[_0xa905('0x38')]=qs[_0xa905('0x2f')](_[_0xa905('0x39')](_0x3f391d[_0xa905('0x2e')],_0x4071c0[_0xa905('0x2f')]),_0x5d99eb);if(_0x3f391d[_0xa905('0x2e')][_0xa905('0x3a')]){_0x38c35d[_0xa905('0x38')]=_[_0xa905('0x3b')](_0x38c35d['where'],{'$or':_[_0xa905('0x2d')](_0x5d99eb,function(_0xe08a81){if(_0xe08a81['type']!==_0xa905('0x3c')){var _0x271c32={};_0x271c32[_0xe08a81['name']]={'$like':'%'+_0x3f391d[_0xa905('0x2e')][_0xa905('0x3a')]+'%'};return _0x271c32;}})});}_0x38c35d=_['merge']({},_0x38c35d,_0x3f391d[_0xa905('0x3d')]);var _0x4b22f9={'where':_0x38c35d[_0xa905('0x38')]};return db[_0xa905('0x28')]['count'](_0x4b22f9)[_0xa905('0x22')](function(_0x4a8f02){_0x2713db[_0xa905('0x1c')]=_0x4a8f02;if(_0x3f391d['query'][_0xa905('0x3e')]){_0x38c35d[_0xa905('0x3f')]=[{'all':!![]}];}return db[_0xa905('0x28')][_0xa905('0x40')](_0x38c35d);})[_0xa905('0x22')](function(_0x193edc){_0x2713db[_0xa905('0x41')]=_0x193edc;return _0x2713db;})[_0xa905('0x22')](respondWithFilteredResult(_0x32cf90,_0x38c35d))['catch'](handleError(_0x32cf90,null));};exports[_0xa905('0x42')]=function(_0x1e10a7,_0x5a44dc){var _0x274f7a={'raw':!![],'where':{'id':_0x1e10a7['params']['id']}},_0x1d6033={};_0x1d6033[_0xa905('0x2c')]=_[_0xa905('0x43')](db['ChatQueueReport'][_0xa905('0x29')]);_0x1d6033[_0xa905('0x2e')]=_[_0xa905('0x43')](_0x1e10a7[_0xa905('0x2e')]);_0x1d6033[_0xa905('0x2f')]=_[_0xa905('0x30')](_0x1d6033[_0xa905('0x2c')],_0x1d6033[_0xa905('0x2e')]);_0x274f7a[_0xa905('0x31')]=_[_0xa905('0x30')](_0x1d6033[_0xa905('0x2c')],qs['fields'](_0x1e10a7[_0xa905('0x2e')]['fields']));_0x274f7a['attributes']=_0x274f7a[_0xa905('0x31')]['length']?_0x274f7a[_0xa905('0x31')]:_0x1d6033['model'];if(_0x1e10a7['query'][_0xa905('0x3e')]){_0x274f7a['include']=[{'all':!![]}];}_0x274f7a=_[_0xa905('0x3b')]({},_0x274f7a,_0x1e10a7['options']);return db['ChatQueueReport']['find'](_0x274f7a)['then'](handleEntityNotFound(_0x5a44dc,null))[_0xa905('0x22')](respondWithResult(_0x5a44dc,null))[_0xa905('0x44')](handleError(_0x5a44dc,null));};exports[_0xa905('0x45')]=function(_0x2ca873,_0x5c9e8a){return db[_0xa905('0x28')]['create'](_0x2ca873['body'],{})[_0xa905('0x22')](respondWithResult(_0x5c9e8a,0xc9))[_0xa905('0x44')](handleError(_0x5c9e8a,null));};exports[_0xa905('0x21')]=function(_0x1e1089,_0x10e0b7){if(_0x1e1089[_0xa905('0x46')]['id']){delete _0x1e1089[_0xa905('0x46')]['id'];}return db[_0xa905('0x28')][_0xa905('0x47')]({'where':{'id':_0x1e1089[_0xa905('0x48')]['id']}})[_0xa905('0x22')](handleEntityNotFound(_0x10e0b7,null))[_0xa905('0x22')](saveUpdates(_0x1e1089[_0xa905('0x46')],null))[_0xa905('0x22')](respondWithResult(_0x10e0b7,null))[_0xa905('0x44')](handleError(_0x10e0b7,null));};exports[_0xa905('0x23')]=function(_0x29d44a,_0x2af289){return db[_0xa905('0x28')][_0xa905('0x47')]({'where':{'id':_0x29d44a[_0xa905('0x48')]['id']}})[_0xa905('0x22')](handleEntityNotFound(_0x2af289,null))[_0xa905('0x22')](removeEntity(_0x2af289,null))[_0xa905('0x44')](handleError(_0x2af289,null));};exports['describe']=function(_0x9d2c41,_0x3e32e6){return db['ChatQueueReport']['describe']()[_0xa905('0x22')](respondWithResult(_0x3e32e6,null))[_0xa905('0x44')](handleError(_0x3e32e6,null));};
\ No newline at end of file
+var _0xbc48=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','ChatQueueReport','length','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5361a4,_0x418f91){var _0x48b674=function(_0x4c99a2){while(--_0x4c99a2){_0x5361a4['push'](_0x5361a4['shift']());}};_0x48b674(++_0x418f91);}(_0xbc48,0x111));var _0x8bc4=function(_0x28afbe,_0x4d655b){_0x28afbe=_0x28afbe-0x0;var _0x16a494=_0xbc48[_0x28afbe];return _0x16a494;};'use strict';var emlformat=require(_0x8bc4('0x0'));var rimraf=require(_0x8bc4('0x1'));var zipdir=require(_0x8bc4('0x2'));var jsonpatch=require(_0x8bc4('0x3'));var rp=require('request-promise');var moment=require(_0x8bc4('0x4'));var BPromise=require(_0x8bc4('0x5'));var Mustache=require(_0x8bc4('0x6'));var util=require(_0x8bc4('0x7'));var path=require('path');var sox=require(_0x8bc4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bc4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8bc4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8bc4('0xb'));var querystring=require(_0x8bc4('0xc'));var Papa=require(_0x8bc4('0xd'));var Redis=require(_0x8bc4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8bc4('0xf'));var as=require(_0x8bc4('0x10'));var hardwareService=require(_0x8bc4('0x11'));var logger=require(_0x8bc4('0x12'))(_0x8bc4('0x13'));var utils=require(_0x8bc4('0x14'));var config=require(_0x8bc4('0x15'));var licenseUtil=require(_0x8bc4('0x16'));var db=require(_0x8bc4('0x17'))['db'];function respondWithStatusCode(_0x1f842d,_0xf04517){_0xf04517=_0xf04517||0xcc;return function(_0x1ec0e2){if(_0x1ec0e2){return _0x1f842d[_0x8bc4('0x18')](_0xf04517);}return _0x1f842d[_0x8bc4('0x19')](_0xf04517)[_0x8bc4('0x1a')]();};}function respondWithResult(_0x55e23a,_0x2617dc){_0x2617dc=_0x2617dc||0xc8;return function(_0x198f18){if(_0x198f18){return _0x55e23a[_0x8bc4('0x19')](_0x2617dc)[_0x8bc4('0x1b')](_0x198f18);}};}function respondWithFilteredResult(_0x2e1213,_0x3e3690){return function(_0x5cd8f7){if(_0x5cd8f7){var _0x4d2530=typeof _0x3e3690['offset']===_0x8bc4('0x1c')&&typeof _0x3e3690['limit']===_0x8bc4('0x1c');var _0x45244b=_0x5cd8f7[_0x8bc4('0x1d')];var _0x5982e6=_0x4d2530?0x0:_0x3e3690[_0x8bc4('0x1e')];var _0x968929=_0x4d2530?_0x5cd8f7['count']:_0x3e3690[_0x8bc4('0x1e')]+_0x3e3690['limit'];var _0x659ae3;if(_0x968929>=_0x45244b){_0x968929=_0x45244b;_0x659ae3=0xc8;}else{_0x659ae3=0xce;}_0x2e1213['status'](_0x659ae3);return _0x2e1213['set'](_0x8bc4('0x1f'),_0x5982e6+'-'+_0x968929+'/'+_0x45244b)[_0x8bc4('0x1b')](_0x5cd8f7);}return null;};}function patchUpdates(_0x415598){return function(_0x3c5dba){try{jsonpatch[_0x8bc4('0x20')](_0x3c5dba,_0x415598,!![]);}catch(_0xf0a578){return BPromise[_0x8bc4('0x21')](_0xf0a578);}return _0x3c5dba[_0x8bc4('0x22')]();};}function saveUpdates(_0x26c5e9,_0x3b402f){return function(_0x148fda){if(_0x148fda){return _0x148fda['update'](_0x26c5e9)[_0x8bc4('0x23')](function(_0x33f5b1){return _0x33f5b1;});}return null;};}function removeEntity(_0x23329e,_0x546d83){return function(_0x327e90){if(_0x327e90){return _0x327e90[_0x8bc4('0x24')]()['then'](function(){_0x23329e[_0x8bc4('0x19')](0xcc)[_0x8bc4('0x1a')]();});}};}function handleEntityNotFound(_0x45118c,_0x4cb042){return function(_0x324e59){if(!_0x324e59){_0x45118c['sendStatus'](0x194);}return _0x324e59;};}function handleError(_0x57b437,_0xb44005){_0xb44005=_0xb44005||0x1f4;return function(_0x29aef5){logger[_0x8bc4('0x25')](_0x29aef5[_0x8bc4('0x26')]);if(_0x29aef5[_0x8bc4('0x27')]){delete _0x29aef5[_0x8bc4('0x27')];}_0x57b437[_0x8bc4('0x19')](_0xb44005)[_0x8bc4('0x28')](_0x29aef5);};}exports['index']=function(_0x56f462,_0x2f9cf4){var _0x39f657={},_0x3bada3={},_0x44fc89={'count':0x0,'rows':[]};var _0x134760=_[_0x8bc4('0x29')](db['ChatQueueReport'][_0x8bc4('0x2a')],function(_0x88f990){return{'name':_0x88f990[_0x8bc4('0x2b')],'type':_0x88f990[_0x8bc4('0x2c')]['key']};});_0x3bada3[_0x8bc4('0x2d')]=_[_0x8bc4('0x29')](_0x134760,_0x8bc4('0x27'));_0x3bada3[_0x8bc4('0x2e')]=_[_0x8bc4('0x2f')](_0x56f462['query']);_0x3bada3[_0x8bc4('0x30')]=_['intersection'](_0x3bada3[_0x8bc4('0x2d')],_0x3bada3[_0x8bc4('0x2e')]);_0x39f657[_0x8bc4('0x31')]=_[_0x8bc4('0x32')](_0x3bada3['model'],qs['fields'](_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x33')]));_0x39f657[_0x8bc4('0x31')]=_0x39f657[_0x8bc4('0x31')]['length']?_0x39f657['attributes']:_0x3bada3['model'];if(!_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x34')](_0x8bc4('0x35'))){_0x39f657['limit']=qs['limit'](_0x56f462['query']['limit']);_0x39f657['offset']=qs[_0x8bc4('0x1e')](_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x1e')]);}_0x39f657['order']=qs[_0x8bc4('0x36')](_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x36')]);_0x39f657['where']=qs[_0x8bc4('0x30')](_[_0x8bc4('0x37')](_0x56f462[_0x8bc4('0x2e')],_0x3bada3[_0x8bc4('0x30')]),_0x134760);if(_0x56f462[_0x8bc4('0x2e')]['filter']){_0x39f657[_0x8bc4('0x38')]=_[_0x8bc4('0x39')](_0x39f657[_0x8bc4('0x38')],{'$or':_['map'](_0x134760,function(_0xe9a913){if(_0xe9a913[_0x8bc4('0x2c')]!==_0x8bc4('0x3a')){var _0x14a511={};_0x14a511[_0xe9a913[_0x8bc4('0x27')]]={'$like':'%'+_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x3b')]+'%'};return _0x14a511;}})});}_0x39f657=_[_0x8bc4('0x39')]({},_0x39f657,_0x56f462[_0x8bc4('0x3c')]);var _0x2fb60d={'where':_0x39f657[_0x8bc4('0x38')]};return db['ChatQueueReport']['count'](_0x2fb60d)[_0x8bc4('0x23')](function(_0x1f89f2){_0x44fc89['count']=_0x1f89f2;if(_0x56f462[_0x8bc4('0x2e')][_0x8bc4('0x3d')]){_0x39f657[_0x8bc4('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x39f657);})[_0x8bc4('0x23')](function(_0x31be57){_0x44fc89[_0x8bc4('0x3f')]=_0x31be57;return _0x44fc89;})[_0x8bc4('0x23')](respondWithFilteredResult(_0x2f9cf4,_0x39f657))[_0x8bc4('0x40')](handleError(_0x2f9cf4,null));};exports[_0x8bc4('0x41')]=function(_0x270a7c,_0x53d524){var _0x4cceab={'raw':!![],'where':{'id':_0x270a7c['params']['id']}},_0x23f7a5={};_0x23f7a5['model']=_[_0x8bc4('0x2f')](db[_0x8bc4('0x42')][_0x8bc4('0x2a')]);_0x23f7a5[_0x8bc4('0x2e')]=_[_0x8bc4('0x2f')](_0x270a7c[_0x8bc4('0x2e')]);_0x23f7a5['filters']=_[_0x8bc4('0x32')](_0x23f7a5[_0x8bc4('0x2d')],_0x23f7a5['query']);_0x4cceab[_0x8bc4('0x31')]=_['intersection'](_0x23f7a5[_0x8bc4('0x2d')],qs['fields'](_0x270a7c[_0x8bc4('0x2e')][_0x8bc4('0x33')]));_0x4cceab[_0x8bc4('0x31')]=_0x4cceab['attributes'][_0x8bc4('0x43')]?_0x4cceab[_0x8bc4('0x31')]:_0x23f7a5[_0x8bc4('0x2d')];if(_0x270a7c[_0x8bc4('0x2e')]['includeAll']){_0x4cceab['include']=[{'all':!![]}];}_0x4cceab=_[_0x8bc4('0x39')]({},_0x4cceab,_0x270a7c[_0x8bc4('0x3c')]);return db[_0x8bc4('0x42')]['find'](_0x4cceab)['then'](handleEntityNotFound(_0x53d524,null))[_0x8bc4('0x23')](respondWithResult(_0x53d524,null))['catch'](handleError(_0x53d524,null));};exports[_0x8bc4('0x44')]=function(_0x38da9c,_0x1c758c){return db[_0x8bc4('0x42')][_0x8bc4('0x44')](_0x38da9c[_0x8bc4('0x45')],{})[_0x8bc4('0x23')](respondWithResult(_0x1c758c,0xc9))[_0x8bc4('0x40')](handleError(_0x1c758c,null));};exports[_0x8bc4('0x46')]=function(_0x2b739f,_0x188bce){if(_0x2b739f[_0x8bc4('0x45')]['id']){delete _0x2b739f[_0x8bc4('0x45')]['id'];}return db[_0x8bc4('0x42')][_0x8bc4('0x47')]({'where':{'id':_0x2b739f[_0x8bc4('0x48')]['id']}})['then'](handleEntityNotFound(_0x188bce,null))[_0x8bc4('0x23')](saveUpdates(_0x2b739f[_0x8bc4('0x45')],null))[_0x8bc4('0x23')](respondWithResult(_0x188bce,null))[_0x8bc4('0x40')](handleError(_0x188bce,null));};exports[_0x8bc4('0x24')]=function(_0x1c7b27,_0x1e6641){return db[_0x8bc4('0x42')]['find']({'where':{'id':_0x1c7b27[_0x8bc4('0x48')]['id']}})[_0x8bc4('0x23')](handleEntityNotFound(_0x1e6641,null))[_0x8bc4('0x23')](removeEntity(_0x1e6641,null))[_0x8bc4('0x40')](handleError(_0x1e6641,null));};exports['describe']=function(_0x47623a,_0x47d108){return db[_0x8bc4('0x42')]['describe']()[_0x8bc4('0x23')](respondWithResult(_0x47d108,null))[_0x8bc4('0x40')](handleError(_0x47d108,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index c2b324e..03eed32 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 8a976cf..12305a4 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 _0x7dab=['info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x7dab,0x122));var _0xb7da=function(_0xc8939d,_0x5d77c8){_0xc8939d=_0xc8939d-0x0;var _0x46f913=_0x7dab[_0xc8939d];return _0x46f913;};'use strict';var _=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var moment=require(_0xb7da('0x2'));var BPromise=require(_0xb7da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7da('0x5'))(_0xb7da('0x6'));var config=require(_0xb7da('0x7'));var jayson=require(_0xb7da('0x8'));var client=jayson['client'][_0xb7da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59c57e,_0x58cb99,_0x52c047){return new BPromise(function(_0xd14541,_0x1a8390){return client[_0xb7da('0xa')](_0x59c57e,_0x52c047)[_0xb7da('0xb')](function(_0x4af85c){logger['info'](_0xb7da('0xc'),_0x58cb99,'request\x20sent');logger[_0xb7da('0xd')](_0xb7da('0xe'),_0x58cb99,_0xb7da('0xf'),JSON[_0xb7da('0x10')](_0x4af85c));if(_0x4af85c[_0xb7da('0x11')]){if(_0x4af85c[_0xb7da('0x11')][_0xb7da('0x12')]===0x1f4){logger[_0xb7da('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58cb99,_0x4af85c['error'][_0xb7da('0x13')]);return _0x1a8390(_0x4af85c[_0xb7da('0x11')][_0xb7da('0x13')]);}logger['error'](_0xb7da('0xc'),_0x58cb99,_0x4af85c['error']['message']);return _0xd14541(_0x4af85c['error'][_0xb7da('0x13')]);}else{logger[_0xb7da('0x14')](_0xb7da('0xc'),_0x58cb99,_0xb7da('0xf'));_0xd14541(_0x4af85c[_0xb7da('0x15')]['message']);}})[_0xb7da('0x16')](function(_0x147503){logger['error'](_0xb7da('0xc'),_0x58cb99,_0x147503);_0x1a8390(_0x147503);});});}exports[_0xb7da('0x17')]=function(_0x49d6d2){var _0x562525=this;return new Promise(function(_0x1ef395,_0x157bd0){return db[_0xb7da('0x18')]['create'](_0x49d6d2[_0xb7da('0x19')],{'raw':_0x49d6d2[_0xb7da('0x1a')]?_0x49d6d2[_0xb7da('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xb7da('0xb')](function(_0x49457c){logger[_0xb7da('0x14')](_0xb7da('0x17'),_0x49d6d2);logger[_0xb7da('0xd')](_0xb7da('0x17'),_0x49d6d2,JSON[_0xb7da('0x10')](_0x49457c));_0x1ef395(_0x49457c);})[_0xb7da('0x16')](function(_0x19e58e){logger['error'](_0xb7da('0x17'),_0x19e58e[_0xb7da('0x13')],_0x49d6d2);_0x157bd0(_0x562525[_0xb7da('0x11')](0x1f4,_0x19e58e[_0xb7da('0x13')]));});});};exports[_0xb7da('0x1b')]=function(_0x4694a0){var _0x81f431=this;return new Promise(function(_0x3c4eab,_0xa9093d){return db[_0xb7da('0x18')][_0xb7da('0x1c')](_0x4694a0[_0xb7da('0x19')],{'raw':_0x4694a0[_0xb7da('0x1a')]?_0x4694a0[_0xb7da('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4694a0['options']?_0x4694a0[_0xb7da('0x1a')][_0xb7da('0x1d')]||null:null,'attributes':_0x4694a0['options']?_0x4694a0['options'][_0xb7da('0x1e')]||null:null,'limit':_0x4694a0[_0xb7da('0x1a')]?_0x4694a0['options']['limit']||null:null})[_0xb7da('0xb')](function(_0x428e1f){logger['info']('UpdateChatQueueReport',_0x4694a0);logger[_0xb7da('0xd')](_0xb7da('0x1b'),_0x4694a0,JSON[_0xb7da('0x10')](_0x428e1f));_0x3c4eab(_0x428e1f);})[_0xb7da('0x16')](function(_0x45a752){logger[_0xb7da('0x11')](_0xb7da('0x1b'),_0x45a752[_0xb7da('0x13')],_0x4694a0);_0xa9093d(_0x81f431[_0xb7da('0x11')](0x1f4,_0x45a752[_0xb7da('0x13')]));});});};
\ No newline at end of file
+var _0xf3e5=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','options','raw','catch','ChatQueueReport','body','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf3e5,0xc3));var _0x5f3e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xf3e5[_0x411add];return _0x238242;};'use strict';var _=require(_0x5f3e('0x0'));var util=require(_0x5f3e('0x1'));var moment=require(_0x5f3e('0x2'));var BPromise=require(_0x5f3e('0x3'));var rs=require(_0x5f3e('0x4'));var fs=require('fs');var Redis=require(_0x5f3e('0x5'));var db=require(_0x5f3e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f3e('0x7'))(_0x5f3e('0x8'));var config=require(_0x5f3e('0x9'));var jayson=require(_0x5f3e('0xa'));var client=jayson[_0x5f3e('0xb')][_0x5f3e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f146c,_0xd43485,_0x23c665){return new BPromise(function(_0x3b9fd3,_0x55ba3f){return client[_0x5f3e('0xd')](_0x5f146c,_0x23c665)[_0x5f3e('0xe')](function(_0x1faa10){logger[_0x5f3e('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0xd43485,_0x5f3e('0x10'));logger[_0x5f3e('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xd43485,_0x5f3e('0x10'),JSON[_0x5f3e('0x12')](_0x1faa10));if(_0x1faa10[_0x5f3e('0x13')]){if(_0x1faa10[_0x5f3e('0x13')][_0x5f3e('0x14')]===0x1f4){logger[_0x5f3e('0x13')](_0x5f3e('0x15'),_0xd43485,_0x1faa10[_0x5f3e('0x13')]['message']);return _0x55ba3f(_0x1faa10['error']['message']);}logger[_0x5f3e('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xd43485,_0x1faa10[_0x5f3e('0x13')]['message']);return _0x3b9fd3(_0x1faa10[_0x5f3e('0x13')][_0x5f3e('0x16')]);}else{logger[_0x5f3e('0xf')](_0x5f3e('0x15'),_0xd43485,'request\x20sent');_0x3b9fd3(_0x1faa10[_0x5f3e('0x17')][_0x5f3e('0x16')]);}})['catch'](function(_0x564154){logger['error'](_0x5f3e('0x15'),_0xd43485,_0x564154);_0x55ba3f(_0x564154);});});}exports[_0x5f3e('0x18')]=function(_0x5af38d){var _0x3a643b=this;return new Promise(function(_0x45e6e0,_0x50c4c0){return db['ChatQueueReport']['create'](_0x5af38d['body'],{'raw':_0x5af38d[_0x5f3e('0x19')]?_0x5af38d['options'][_0x5f3e('0x1a')]===undefined?!![]:![]:!![]})[_0x5f3e('0xe')](function(_0x36d43d){logger['info'](_0x5f3e('0x18'),_0x5af38d);logger['debug'](_0x5f3e('0x18'),_0x5af38d,JSON[_0x5f3e('0x12')](_0x36d43d));_0x45e6e0(_0x36d43d);})[_0x5f3e('0x1b')](function(_0x892c54){logger['error'](_0x5f3e('0x18'),_0x892c54[_0x5f3e('0x16')],_0x5af38d);_0x50c4c0(_0x3a643b['error'](0x1f4,_0x892c54[_0x5f3e('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0xb56463){var _0x22e90e=this;return new Promise(function(_0x3c0cba,_0x225b25){return db[_0x5f3e('0x1c')]['update'](_0xb56463[_0x5f3e('0x1d')],{'raw':_0xb56463[_0x5f3e('0x19')]?_0xb56463[_0x5f3e('0x19')][_0x5f3e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb56463['options']?_0xb56463[_0x5f3e('0x19')][_0x5f3e('0x1e')]||null:null,'attributes':_0xb56463['options']?_0xb56463[_0x5f3e('0x19')][_0x5f3e('0x1f')]||null:null,'limit':_0xb56463[_0x5f3e('0x19')]?_0xb56463[_0x5f3e('0x19')][_0x5f3e('0x20')]||null:null})[_0x5f3e('0xe')](function(_0x56ce37){logger[_0x5f3e('0xf')](_0x5f3e('0x21'),_0xb56463);logger[_0x5f3e('0x11')](_0x5f3e('0x21'),_0xb56463,JSON[_0x5f3e('0x12')](_0x56ce37));_0x3c0cba(_0x56ce37);})[_0x5f3e('0x1b')](function(_0x5f4b0e){logger['error'](_0x5f3e('0x21'),_0x5f4b0e['message'],_0xb56463);_0x225b25(_0x22e90e[_0x5f3e('0x13')](0x1f4,_0x5f4b0e['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 602223e..8526dcc 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 _0xaf6e=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','update'];(function(_0x5c27b6,_0x4a3c28){var _0x284ce4=function(_0x29fa20){while(--_0x29fa20){_0x5c27b6['push'](_0x5c27b6['shift']());}};_0x284ce4(++_0x4a3c28);}(_0xaf6e,0xab));var _0xeaf6=function(_0x5955b5,_0x395ff7){_0x5955b5=_0x5955b5-0x0;var _0x433350=_0xaf6e[_0x5955b5];return _0x433350;};'use strict';var multer=require(_0xeaf6('0x0'));var util=require(_0xeaf6('0x1'));var path=require(_0xeaf6('0x2'));var timeout=require(_0xeaf6('0x3'));var express=require(_0xeaf6('0x4'));var router=express['Router']();var fs_extra=require(_0xeaf6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeaf6('0x6'));var config=require(_0xeaf6('0x7'));var controller=require(_0xeaf6('0x8'));router['get']('/',auth[_0xeaf6('0x9')](),controller[_0xeaf6('0xa')]);router[_0xeaf6('0xb')](_0xeaf6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xeaf6('0xb')](_0xeaf6('0xd'),auth[_0xeaf6('0x9')](),controller[_0xeaf6('0xe')]);router[_0xeaf6('0xf')]('/',auth[_0xeaf6('0x9')](),controller['create']);router[_0xeaf6('0x10')]('/:id',auth[_0xeaf6('0x9')](),controller[_0xeaf6('0x11')]);router[_0xeaf6('0x12')](_0xeaf6('0xd'),auth['isAuthenticated'](),controller[_0xeaf6('0x13')]);module[_0xeaf6('0x14')]=router;
\ No newline at end of file
+var _0x3f64=['isAuthenticated','get','describe','/:id','post','create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4c53f7,_0x58ead6){var _0x26d53a=function(_0x2cc709){while(--_0x2cc709){_0x4c53f7['push'](_0x4c53f7['shift']());}};_0x26d53a(++_0x58ead6);}(_0x3f64,0x159));var _0x43f6=function(_0x4d8cca,_0x349870){_0x4d8cca=_0x4d8cca-0x0;var _0xe6f1e1=_0x3f64[_0x4d8cca];return _0xe6f1e1;};'use strict';var multer=require('multer');var util=require(_0x43f6('0x0'));var path=require(_0x43f6('0x1'));var timeout=require(_0x43f6('0x2'));var express=require(_0x43f6('0x3'));var router=express['Router']();var fs_extra=require(_0x43f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43f6('0x5'));var config=require(_0x43f6('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x43f6('0x7')](),controller['index']);router[_0x43f6('0x8')]('/describe',auth[_0x43f6('0x7')](),controller[_0x43f6('0x9')]);router[_0x43f6('0x8')](_0x43f6('0xa'),auth[_0x43f6('0x7')](),controller['show']);router[_0x43f6('0xb')]('/',auth['isAuthenticated'](),controller[_0x43f6('0xc')]);router['put'](_0x43f6('0xa'),auth[_0x43f6('0x7')](),controller[_0x43f6('0xd')]);router['delete'](_0x43f6('0xa'),auth[_0x43f6('0x7')](),controller[_0x43f6('0xe')]);module[_0x43f6('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 907b0c7..b528b80 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4abc3f,_0x1d4e88){var _0x1f0442=function(_0x597ea0){while(--_0x597ea0){_0x4abc3f['push'](_0x4abc3f['shift']());}};_0x1f0442(++_0x1d4e88);}(_0xf4eb,0xec));var _0xbf4e=function(_0x39e416,_0x1f616d){_0x39e416=_0x39e416-0x0;var _0x3665be=_0xf4eb[_0x39e416];return _0x3665be;};'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
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x154e61,_0xa11a5){var _0x323d74=function(_0x570d12){while(--_0x570d12){_0x154e61['push'](_0x154e61['shift']());}};_0x323d74(++_0xa11a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0xcb91[_0x491cbe];return _0x59449d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index b348753..e2f196a 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 _0x3f35=['offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','ChatTransferReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','end','status'];(function(_0x1e8094,_0x10d02b){var _0x518667=function(_0x4bf45b){while(--_0x4bf45b){_0x1e8094['push'](_0x1e8094['shift']());}};_0x518667(++_0x10d02b);}(_0x3f35,0x14f));var _0x53f3=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x3f35[_0x172133];return _0x2460e5;};'use strict';var emlformat=require(_0x53f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53f3('0x1'));var jsonpatch=require(_0x53f3('0x2'));var rp=require(_0x53f3('0x3'));var moment=require(_0x53f3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x53f3('0x5'));var util=require(_0x53f3('0x6'));var path=require(_0x53f3('0x7'));var sox=require(_0x53f3('0x8'));var csv=require(_0x53f3('0x9'));var ejs=require(_0x53f3('0xa'));var fs=require('fs');var fs_extra=require(_0x53f3('0xb'));var _=require('lodash');var squel=require(_0x53f3('0xc'));var crypto=require(_0x53f3('0xd'));var jsforce=require(_0x53f3('0xe'));var deskjs=require(_0x53f3('0xf'));var toCsv=require(_0x53f3('0x9'));var querystring=require('querystring');var Papa=require(_0x53f3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x53f3('0x11'));var as=require(_0x53f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53f3('0x13'))(_0x53f3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x53f3('0x15'));var db=require(_0x53f3('0x16'))['db'];function respondWithStatusCode(_0x3322f2,_0x2dba0a){_0x2dba0a=_0x2dba0a||0xcc;return function(_0x1a3ae9){if(_0x1a3ae9){return _0x3322f2['sendStatus'](_0x2dba0a);}return _0x3322f2['status'](_0x2dba0a)[_0x53f3('0x17')]();};}function respondWithResult(_0x4c3ed5,_0x96a463){_0x96a463=_0x96a463||0xc8;return function(_0x4be8b1){if(_0x4be8b1){return _0x4c3ed5[_0x53f3('0x18')](_0x96a463)['json'](_0x4be8b1);}};}function respondWithFilteredResult(_0x5ac285,_0x364ea5){return function(_0x52d460){if(_0x52d460){var _0x2cef1b=typeof _0x364ea5[_0x53f3('0x19')]===_0x53f3('0x1a')&&typeof _0x364ea5['limit']===_0x53f3('0x1a');var _0x431b87=_0x52d460[_0x53f3('0x1b')];var _0x4dd543=_0x2cef1b?0x0:_0x364ea5[_0x53f3('0x19')];var _0x38ff71=_0x2cef1b?_0x52d460[_0x53f3('0x1b')]:_0x364ea5['offset']+_0x364ea5[_0x53f3('0x1c')];var _0x267208;if(_0x38ff71>=_0x431b87){_0x38ff71=_0x431b87;_0x267208=0xc8;}else{_0x267208=0xce;}_0x5ac285[_0x53f3('0x18')](_0x267208);return _0x5ac285[_0x53f3('0x1d')](_0x53f3('0x1e'),_0x4dd543+'-'+_0x38ff71+'/'+_0x431b87)['json'](_0x52d460);}return null;};}function patchUpdates(_0x3ef071){return function(_0x4c1463){try{jsonpatch[_0x53f3('0x1f')](_0x4c1463,_0x3ef071,!![]);}catch(_0x485441){return BPromise[_0x53f3('0x20')](_0x485441);}return _0x4c1463[_0x53f3('0x21')]();};}function saveUpdates(_0x3b3a73,_0x284df2){return function(_0x42b550){if(_0x42b550){return _0x42b550[_0x53f3('0x22')](_0x3b3a73)[_0x53f3('0x23')](function(_0x59e6ac){return _0x59e6ac;});}return null;};}function removeEntity(_0x50b59e,_0x2f99cc){return function(_0x40d1a7){if(_0x40d1a7){return _0x40d1a7[_0x53f3('0x24')]()[_0x53f3('0x23')](function(){_0x50b59e[_0x53f3('0x18')](0xcc)[_0x53f3('0x17')]();});}};}function handleEntityNotFound(_0xbee97a,_0x9aa5d8){return function(_0x1f43cb){if(!_0x1f43cb){_0xbee97a[_0x53f3('0x25')](0x194);}return _0x1f43cb;};}function handleError(_0x4cb07c,_0x3302b2){_0x3302b2=_0x3302b2||0x1f4;return function(_0xf84f7e){logger['error'](_0xf84f7e[_0x53f3('0x26')]);if(_0xf84f7e[_0x53f3('0x27')]){delete _0xf84f7e[_0x53f3('0x27')];}_0x4cb07c[_0x53f3('0x18')](_0x3302b2)[_0x53f3('0x28')](_0xf84f7e);};}exports[_0x53f3('0x29')]=function(_0x4d4147,_0x3b9c0f){var _0x9499b3={},_0x5ba851={},_0x13bfed={'count':0x0,'rows':[]};var _0x12a7bb=_['map'](db[_0x53f3('0x2a')]['rawAttributes'],function(_0x53a056){return{'name':_0x53a056[_0x53f3('0x2b')],'type':_0x53a056[_0x53f3('0x2c')]['key']};});_0x5ba851[_0x53f3('0x2d')]=_[_0x53f3('0x2e')](_0x12a7bb,'name');_0x5ba851[_0x53f3('0x2f')]=_[_0x53f3('0x30')](_0x4d4147[_0x53f3('0x2f')]);_0x5ba851[_0x53f3('0x31')]=_['intersection'](_0x5ba851[_0x53f3('0x2d')],_0x5ba851['query']);_0x9499b3[_0x53f3('0x32')]=_[_0x53f3('0x33')](_0x5ba851[_0x53f3('0x2d')],qs['fields'](_0x4d4147[_0x53f3('0x2f')][_0x53f3('0x34')]));_0x9499b3['attributes']=_0x9499b3['attributes'][_0x53f3('0x35')]?_0x9499b3['attributes']:_0x5ba851[_0x53f3('0x2d')];if(!_0x4d4147[_0x53f3('0x2f')][_0x53f3('0x36')](_0x53f3('0x37'))){_0x9499b3[_0x53f3('0x1c')]=qs[_0x53f3('0x1c')](_0x4d4147[_0x53f3('0x2f')][_0x53f3('0x1c')]);_0x9499b3[_0x53f3('0x19')]=qs[_0x53f3('0x19')](_0x4d4147[_0x53f3('0x2f')]['offset']);}_0x9499b3['order']=qs[_0x53f3('0x38')](_0x4d4147['query']['sort']);_0x9499b3[_0x53f3('0x39')]=qs[_0x53f3('0x31')](_[_0x53f3('0x3a')](_0x4d4147[_0x53f3('0x2f')],_0x5ba851['filters']),_0x12a7bb);if(_0x4d4147[_0x53f3('0x2f')][_0x53f3('0x3b')]){_0x9499b3['where']=_[_0x53f3('0x3c')](_0x9499b3[_0x53f3('0x39')],{'$or':_['map'](_0x12a7bb,function(_0x4b13ad){if(_0x4b13ad[_0x53f3('0x2c')]!==_0x53f3('0x3d')){var _0x423357={};_0x423357[_0x4b13ad[_0x53f3('0x27')]]={'$like':'%'+_0x4d4147[_0x53f3('0x2f')][_0x53f3('0x3b')]+'%'};return _0x423357;}})});}_0x9499b3=_['merge']({},_0x9499b3,_0x4d4147[_0x53f3('0x3e')]);var _0x3cc4ff={'where':_0x9499b3[_0x53f3('0x39')]};return db[_0x53f3('0x2a')]['count'](_0x3cc4ff)[_0x53f3('0x23')](function(_0x1620b0){_0x13bfed['count']=_0x1620b0;if(_0x4d4147[_0x53f3('0x2f')][_0x53f3('0x3f')]){_0x9499b3['include']=[{'all':!![]}];}return db[_0x53f3('0x2a')]['findAll'](_0x9499b3);})['then'](function(_0x288798){_0x13bfed['rows']=_0x288798;return _0x13bfed;})[_0x53f3('0x23')](respondWithFilteredResult(_0x3b9c0f,_0x9499b3))[_0x53f3('0x40')](handleError(_0x3b9c0f,null));};exports[_0x53f3('0x41')]=function(_0x1375e2,_0x541900){var _0x5b2cdd={'raw':!![],'where':{'id':_0x1375e2[_0x53f3('0x42')]['id']}},_0x2bdc06={};_0x2bdc06[_0x53f3('0x2d')]=_[_0x53f3('0x30')](db[_0x53f3('0x2a')]['rawAttributes']);_0x2bdc06['query']=_[_0x53f3('0x30')](_0x1375e2[_0x53f3('0x2f')]);_0x2bdc06[_0x53f3('0x31')]=_[_0x53f3('0x33')](_0x2bdc06[_0x53f3('0x2d')],_0x2bdc06[_0x53f3('0x2f')]);_0x5b2cdd[_0x53f3('0x32')]=_[_0x53f3('0x33')](_0x2bdc06['model'],qs[_0x53f3('0x34')](_0x1375e2[_0x53f3('0x2f')][_0x53f3('0x34')]));_0x5b2cdd[_0x53f3('0x32')]=_0x5b2cdd[_0x53f3('0x32')][_0x53f3('0x35')]?_0x5b2cdd[_0x53f3('0x32')]:_0x2bdc06[_0x53f3('0x2d')];if(_0x1375e2[_0x53f3('0x2f')][_0x53f3('0x3f')]){_0x5b2cdd[_0x53f3('0x43')]=[{'all':!![]}];}_0x5b2cdd=_[_0x53f3('0x3c')]({},_0x5b2cdd,_0x1375e2['options']);return db[_0x53f3('0x2a')]['find'](_0x5b2cdd)['then'](handleEntityNotFound(_0x541900,null))['then'](respondWithResult(_0x541900,null))[_0x53f3('0x40')](handleError(_0x541900,null));};exports[_0x53f3('0x44')]=function(_0x4e9965,_0x9c6c68){return db[_0x53f3('0x2a')][_0x53f3('0x44')](_0x4e9965[_0x53f3('0x45')],{})[_0x53f3('0x23')](respondWithResult(_0x9c6c68,0xc9))[_0x53f3('0x40')](handleError(_0x9c6c68,null));};exports['update']=function(_0x3eaeb6,_0xc9e8e1){if(_0x3eaeb6['body']['id']){delete _0x3eaeb6['body']['id'];}return db[_0x53f3('0x2a')][_0x53f3('0x46')]({'where':{'id':_0x3eaeb6[_0x53f3('0x42')]['id']}})['then'](handleEntityNotFound(_0xc9e8e1,null))['then'](saveUpdates(_0x3eaeb6[_0x53f3('0x45')],null))[_0x53f3('0x23')](respondWithResult(_0xc9e8e1,null))[_0x53f3('0x40')](handleError(_0xc9e8e1,null));};exports[_0x53f3('0x24')]=function(_0xb695f6,_0x318acd){return db['ChatTransferReport'][_0x53f3('0x46')]({'where':{'id':_0xb695f6[_0x53f3('0x42')]['id']}})[_0x53f3('0x23')](handleEntityNotFound(_0x318acd,null))['then'](removeEntity(_0x318acd,null))[_0x53f3('0x40')](handleError(_0x318acd,null));};exports['describe']=function(_0x2e66fa,_0x31f1a3){return db[_0x53f3('0x2a')][_0x53f3('0x47')]()[_0x53f3('0x23')](respondWithResult(_0x31f1a3,null))['catch'](handleError(_0x31f1a3,null));};
\ No newline at end of file
+var _0xa745=['end','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','merge','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x55516f,_0x598082){var _0x52c2b9=function(_0x1803dc){while(--_0x1803dc){_0x55516f['push'](_0x55516f['shift']());}};_0x52c2b9(++_0x598082);}(_0xa745,0xc4));var _0x5a74=function(_0xa2813,_0x223068){_0xa2813=_0xa2813-0x0;var _0x5b27d1=_0xa745[_0xa2813];return _0x5b27d1;};'use strict';var emlformat=require(_0x5a74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a74('0x1'));var jsonpatch=require(_0x5a74('0x2'));var rp=require(_0x5a74('0x3'));var moment=require('moment');var BPromise=require(_0x5a74('0x4'));var Mustache=require('mustache');var util=require(_0x5a74('0x5'));var path=require(_0x5a74('0x6'));var sox=require(_0x5a74('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a74('0x8'));var _=require(_0x5a74('0x9'));var squel=require(_0x5a74('0xa'));var crypto=require(_0x5a74('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a74('0xc'));var toCsv=require(_0x5a74('0xd'));var querystring=require(_0x5a74('0xe'));var Papa=require(_0x5a74('0xf'));var Redis=require(_0x5a74('0x10'));var authService=require(_0x5a74('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5a74('0x12'));var hardwareService=require(_0x5a74('0x13'));var logger=require(_0x5a74('0x14'))(_0x5a74('0x15'));var utils=require(_0x5a74('0x16'));var config=require(_0x5a74('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a74('0x18'))['db'];function respondWithStatusCode(_0xed08be,_0x4b0ff3){_0x4b0ff3=_0x4b0ff3||0xcc;return function(_0x4afee9){if(_0x4afee9){return _0xed08be[_0x5a74('0x19')](_0x4b0ff3);}return _0xed08be[_0x5a74('0x1a')](_0x4b0ff3)['end']();};}function respondWithResult(_0x28c816,_0x3177d0){_0x3177d0=_0x3177d0||0xc8;return function(_0xd777ec){if(_0xd777ec){return _0x28c816[_0x5a74('0x1a')](_0x3177d0)['json'](_0xd777ec);}};}function respondWithFilteredResult(_0x4b548d,_0x34ab70){return function(_0x20988b){if(_0x20988b){var _0x545b0a=typeof _0x34ab70[_0x5a74('0x1b')]==='undefined'&&typeof _0x34ab70['limit']===_0x5a74('0x1c');var _0x412609=_0x20988b['count'];var _0x512e97=_0x545b0a?0x0:_0x34ab70['offset'];var _0x35feeb=_0x545b0a?_0x20988b[_0x5a74('0x1d')]:_0x34ab70['offset']+_0x34ab70[_0x5a74('0x1e')];var _0x4bb7a5;if(_0x35feeb>=_0x412609){_0x35feeb=_0x412609;_0x4bb7a5=0xc8;}else{_0x4bb7a5=0xce;}_0x4b548d[_0x5a74('0x1a')](_0x4bb7a5);return _0x4b548d[_0x5a74('0x1f')](_0x5a74('0x20'),_0x512e97+'-'+_0x35feeb+'/'+_0x412609)['json'](_0x20988b);}return null;};}function patchUpdates(_0x2909b0){return function(_0x54eaaa){try{jsonpatch[_0x5a74('0x21')](_0x54eaaa,_0x2909b0,!![]);}catch(_0x3cfdbd){return BPromise[_0x5a74('0x22')](_0x3cfdbd);}return _0x54eaaa[_0x5a74('0x23')]();};}function saveUpdates(_0x10eea5,_0x3382c7){return function(_0x1b5512){if(_0x1b5512){return _0x1b5512[_0x5a74('0x24')](_0x10eea5)[_0x5a74('0x25')](function(_0xc729c7){return _0xc729c7;});}return null;};}function removeEntity(_0x11eaf6,_0x18be63){return function(_0x215d58){if(_0x215d58){return _0x215d58['destroy']()['then'](function(){_0x11eaf6[_0x5a74('0x1a')](0xcc)[_0x5a74('0x26')]();});}};}function handleEntityNotFound(_0x4ef147,_0x2c5308){return function(_0x554a77){if(!_0x554a77){_0x4ef147[_0x5a74('0x19')](0x194);}return _0x554a77;};}function handleError(_0x1e59a7,_0x71d35d){_0x71d35d=_0x71d35d||0x1f4;return function(_0x14adcf){logger[_0x5a74('0x27')](_0x14adcf[_0x5a74('0x28')]);if(_0x14adcf[_0x5a74('0x29')]){delete _0x14adcf[_0x5a74('0x29')];}_0x1e59a7[_0x5a74('0x1a')](_0x71d35d)[_0x5a74('0x2a')](_0x14adcf);};}exports[_0x5a74('0x2b')]=function(_0x23f3e8,_0x598780){var _0x58f0c2={},_0x413aa1={},_0x4341ad={'count':0x0,'rows':[]};var _0x40fe3c=_[_0x5a74('0x2c')](db[_0x5a74('0x2d')]['rawAttributes'],function(_0x3a8216){return{'name':_0x3a8216[_0x5a74('0x2e')],'type':_0x3a8216[_0x5a74('0x2f')][_0x5a74('0x30')]};});_0x413aa1[_0x5a74('0x31')]=_['map'](_0x40fe3c,_0x5a74('0x29'));_0x413aa1[_0x5a74('0x32')]=_[_0x5a74('0x33')](_0x23f3e8[_0x5a74('0x32')]);_0x413aa1[_0x5a74('0x34')]=_[_0x5a74('0x35')](_0x413aa1[_0x5a74('0x31')],_0x413aa1[_0x5a74('0x32')]);_0x58f0c2[_0x5a74('0x36')]=_[_0x5a74('0x35')](_0x413aa1[_0x5a74('0x31')],qs[_0x5a74('0x37')](_0x23f3e8['query']['fields']));_0x58f0c2['attributes']=_0x58f0c2[_0x5a74('0x36')][_0x5a74('0x38')]?_0x58f0c2[_0x5a74('0x36')]:_0x413aa1['model'];if(!_0x23f3e8['query'][_0x5a74('0x39')](_0x5a74('0x3a'))){_0x58f0c2[_0x5a74('0x1e')]=qs['limit'](_0x23f3e8[_0x5a74('0x32')][_0x5a74('0x1e')]);_0x58f0c2['offset']=qs[_0x5a74('0x1b')](_0x23f3e8[_0x5a74('0x32')][_0x5a74('0x1b')]);}_0x58f0c2[_0x5a74('0x3b')]=qs['sort'](_0x23f3e8[_0x5a74('0x32')]['sort']);_0x58f0c2['where']=qs['filters'](_[_0x5a74('0x3c')](_0x23f3e8[_0x5a74('0x32')],_0x413aa1[_0x5a74('0x34')]),_0x40fe3c);if(_0x23f3e8['query'][_0x5a74('0x3d')]){_0x58f0c2[_0x5a74('0x3e')]=_['merge'](_0x58f0c2[_0x5a74('0x3e')],{'$or':_[_0x5a74('0x2c')](_0x40fe3c,function(_0x2d08e2){if(_0x2d08e2['type']!==_0x5a74('0x3f')){var _0x45ff7b={};_0x45ff7b[_0x2d08e2[_0x5a74('0x29')]]={'$like':'%'+_0x23f3e8[_0x5a74('0x32')]['filter']+'%'};return _0x45ff7b;}})});}_0x58f0c2=_['merge']({},_0x58f0c2,_0x23f3e8[_0x5a74('0x40')]);var _0x7ab4fb={'where':_0x58f0c2['where']};return db[_0x5a74('0x2d')][_0x5a74('0x1d')](_0x7ab4fb)[_0x5a74('0x25')](function(_0xa920a4){_0x4341ad['count']=_0xa920a4;if(_0x23f3e8['query']['includeAll']){_0x58f0c2[_0x5a74('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x5a74('0x42')](_0x58f0c2);})[_0x5a74('0x25')](function(_0x59521f){_0x4341ad['rows']=_0x59521f;return _0x4341ad;})[_0x5a74('0x25')](respondWithFilteredResult(_0x598780,_0x58f0c2))[_0x5a74('0x43')](handleError(_0x598780,null));};exports[_0x5a74('0x44')]=function(_0xde0a9d,_0x5c5305){var _0x24807a={'raw':!![],'where':{'id':_0xde0a9d[_0x5a74('0x45')]['id']}},_0x56254c={};_0x56254c['model']=_[_0x5a74('0x33')](db[_0x5a74('0x2d')][_0x5a74('0x46')]);_0x56254c[_0x5a74('0x32')]=_[_0x5a74('0x33')](_0xde0a9d[_0x5a74('0x32')]);_0x56254c[_0x5a74('0x34')]=_['intersection'](_0x56254c['model'],_0x56254c[_0x5a74('0x32')]);_0x24807a[_0x5a74('0x36')]=_[_0x5a74('0x35')](_0x56254c[_0x5a74('0x31')],qs['fields'](_0xde0a9d[_0x5a74('0x32')][_0x5a74('0x37')]));_0x24807a[_0x5a74('0x36')]=_0x24807a[_0x5a74('0x36')]['length']?_0x24807a['attributes']:_0x56254c[_0x5a74('0x31')];if(_0xde0a9d['query'][_0x5a74('0x47')]){_0x24807a[_0x5a74('0x41')]=[{'all':!![]}];}_0x24807a=_[_0x5a74('0x48')]({},_0x24807a,_0xde0a9d[_0x5a74('0x40')]);return db['ChatTransferReport'][_0x5a74('0x49')](_0x24807a)[_0x5a74('0x25')](handleEntityNotFound(_0x5c5305,null))['then'](respondWithResult(_0x5c5305,null))[_0x5a74('0x43')](handleError(_0x5c5305,null));};exports[_0x5a74('0x4a')]=function(_0xe47972,_0x1d1a67){return db[_0x5a74('0x2d')][_0x5a74('0x4a')](_0xe47972[_0x5a74('0x4b')],{})[_0x5a74('0x25')](respondWithResult(_0x1d1a67,0xc9))[_0x5a74('0x43')](handleError(_0x1d1a67,null));};exports['update']=function(_0x470c4a,_0x504ca0){if(_0x470c4a['body']['id']){delete _0x470c4a['body']['id'];}return db['ChatTransferReport'][_0x5a74('0x49')]({'where':{'id':_0x470c4a['params']['id']}})['then'](handleEntityNotFound(_0x504ca0,null))[_0x5a74('0x25')](saveUpdates(_0x470c4a['body'],null))[_0x5a74('0x25')](respondWithResult(_0x504ca0,null))[_0x5a74('0x43')](handleError(_0x504ca0,null));};exports[_0x5a74('0x4c')]=function(_0x430553,_0x557220){return db[_0x5a74('0x2d')][_0x5a74('0x49')]({'where':{'id':_0x430553[_0x5a74('0x45')]['id']}})['then'](handleEntityNotFound(_0x557220,null))['then'](removeEntity(_0x557220,null))[_0x5a74('0x43')](handleError(_0x557220,null));};exports[_0x5a74('0x4d')]=function(_0x3601fa,_0x47c2f8){return db['ChatTransferReport'][_0x5a74('0x4d')]()[_0x5a74('0x25')](respondWithResult(_0x47c2f8,null))[_0x5a74('0x43')](handleError(_0x47c2f8,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index af76ade..e51cf0b 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 _0x7b6e=['request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x26a706,_0x25cc80){var _0x1bcd7c=function(_0x4af445){while(--_0x4af445){_0x26a706['push'](_0x26a706['shift']());}};_0x1bcd7c(++_0x25cc80);}(_0x7b6e,0xa2));var _0xe7b6=function(_0x18515d,_0x5c442b){_0x18515d=_0x18515d-0x0;var _0x175db2=_0x7b6e[_0x18515d];return _0x175db2;};'use strict';var _=require(_0xe7b6('0x0'));var util=require(_0xe7b6('0x1'));var logger=require(_0xe7b6('0x2'))(_0xe7b6('0x3'));var moment=require(_0xe7b6('0x4'));var BPromise=require(_0xe7b6('0x5'));var rp=require(_0xe7b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7b6('0x7'));var config=require(_0xe7b6('0x8'));var attributes=require(_0xe7b6('0x9'));module[_0xe7b6('0xa')]=function(_0x3a6593,_0x5797ca){return _0x3a6593[_0xe7b6('0xb')]('ChatTransferReport',attributes,{'tableName':_0xe7b6('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe7b6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3cf=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatTransferReport'];(function(_0x43ec1a,_0x50b962){var _0x2ca3a3=function(_0x48164a){while(--_0x48164a){_0x43ec1a['push'](_0x43ec1a['shift']());}};_0x2ca3a3(++_0x50b962);}(_0xa3cf,0x77));var _0xfa3c=function(_0x5ac05c,_0x103d35){_0x5ac05c=_0x5ac05c-0x0;var _0x5d19e8=_0xa3cf[_0x5ac05c];return _0x5d19e8;};'use strict';var _=require(_0xfa3c('0x0'));var util=require(_0xfa3c('0x1'));var logger=require(_0xfa3c('0x2'))(_0xfa3c('0x3'));var moment=require(_0xfa3c('0x4'));var BPromise=require(_0xfa3c('0x5'));var rp=require(_0xfa3c('0x6'));var fs=require('fs');var path=require(_0xfa3c('0x7'));var rimraf=require('rimraf');var config=require(_0xfa3c('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xfa3c('0x9')]=function(_0x572139,_0x2eb5d6){return _0x572139['define'](_0xfa3c('0xa'),attributes,{'tableName':_0xfa3c('0xb'),'paranoid':![],'indexes':[{'name':_0xfa3c('0xc'),'fields':[_0xfa3c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 4166dc7..f607ff6 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 _0x224e=['../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xa5c484,_0x52348a){var _0x546e5c=function(_0xa425d){while(--_0xa425d){_0xa5c484['push'](_0xa5c484['shift']());}};_0x546e5c(++_0x52348a);}(_0x224e,0xf4));var _0xe224=function(_0x8faf50,_0x5b1919){_0x8faf50=_0x8faf50-0x0;var _0x3f0578=_0x224e[_0x8faf50];return _0x3f0578;};'use strict';var _=require(_0xe224('0x0'));var util=require(_0xe224('0x1'));var moment=require(_0xe224('0x2'));var BPromise=require(_0xe224('0x3'));var rs=require(_0xe224('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe224('0x5'))['db'];var utils=require(_0xe224('0x6'));var logger=require('../../config/logger')(_0xe224('0x7'));var config=require(_0xe224('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe224('0x9')][_0xe224('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2182f4,_0x4c5db5,_0x399f64){return new BPromise(function(_0x374d6c,_0x4ace60){return client[_0xe224('0xb')](_0x2182f4,_0x399f64)['then'](function(_0x314d97){logger[_0xe224('0xc')](_0xe224('0xd'),_0x4c5db5,_0xe224('0xe'));logger['debug'](_0xe224('0xf'),_0x4c5db5,_0xe224('0xe'),JSON['stringify'](_0x314d97));if(_0x314d97['error']){if(_0x314d97['error'][_0xe224('0x10')]===0x1f4){logger['error'](_0xe224('0xd'),_0x4c5db5,_0x314d97[_0xe224('0x11')]['message']);return _0x4ace60(_0x314d97[_0xe224('0x11')][_0xe224('0x12')]);}logger['error'](_0xe224('0xd'),_0x4c5db5,_0x314d97[_0xe224('0x11')]['message']);return _0x374d6c(_0x314d97[_0xe224('0x11')]['message']);}else{logger[_0xe224('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x4c5db5,'request\x20sent');_0x374d6c(_0x314d97[_0xe224('0x13')][_0xe224('0x12')]);}})[_0xe224('0x14')](function(_0x4ec46d){logger[_0xe224('0x11')](_0xe224('0xd'),_0x4c5db5,_0x4ec46d);_0x4ace60(_0x4ec46d);});});}
\ No newline at end of file
+var _0xf7cb=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43af80,_0x1a300e){var _0x26c0ea=function(_0x3fb0b6){while(--_0x3fb0b6){_0x43af80['push'](_0x43af80['shift']());}};_0x26c0ea(++_0x1a300e);}(_0xf7cb,0xd5));var _0xbf7c=function(_0x32ab71,_0x19575d){_0x32ab71=_0x32ab71-0x0;var _0x47b4d7=_0xf7cb[_0x32ab71];return _0x47b4d7;};'use strict';var _=require(_0xbf7c('0x0'));var util=require(_0xbf7c('0x1'));var moment=require(_0xbf7c('0x2'));var BPromise=require(_0xbf7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf7c('0x4'));var db=require(_0xbf7c('0x5'))['db'];var utils=require(_0xbf7c('0x6'));var logger=require(_0xbf7c('0x7'))(_0xbf7c('0x8'));var config=require('../../config/environment');var jayson=require(_0xbf7c('0x9'));var client=jayson[_0xbf7c('0xa')][_0xbf7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25a09c,_0x3d35df,_0x3556de){return new BPromise(function(_0x3fdb69,_0x11daac){return client['request'](_0x25a09c,_0x3556de)[_0xbf7c('0xc')](function(_0x1c2187){logger[_0xbf7c('0xd')](_0xbf7c('0xe'),_0x3d35df,_0xbf7c('0xf'));logger[_0xbf7c('0x10')](_0xbf7c('0x11'),_0x3d35df,_0xbf7c('0xf'),JSON[_0xbf7c('0x12')](_0x1c2187));if(_0x1c2187[_0xbf7c('0x13')]){if(_0x1c2187[_0xbf7c('0x13')]['code']===0x1f4){logger[_0xbf7c('0x13')](_0xbf7c('0xe'),_0x3d35df,_0x1c2187[_0xbf7c('0x13')][_0xbf7c('0x14')]);return _0x11daac(_0x1c2187[_0xbf7c('0x13')][_0xbf7c('0x14')]);}logger[_0xbf7c('0x13')](_0xbf7c('0xe'),_0x3d35df,_0x1c2187[_0xbf7c('0x13')][_0xbf7c('0x14')]);return _0x3fdb69(_0x1c2187[_0xbf7c('0x13')][_0xbf7c('0x14')]);}else{logger[_0xbf7c('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x3d35df,_0xbf7c('0xf'));_0x3fdb69(_0x1c2187[_0xbf7c('0x15')][_0xbf7c('0x14')]);}})[_0xbf7c('0x16')](function(_0x3ce670){logger['error'](_0xbf7c('0xe'),_0x3d35df,_0x3ce670);_0x11daac(_0x3ce670);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 32d5f64..35e2eb4 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 _0xb3ed=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','update'];(function(_0x321c18,_0x368364){var _0x227195=function(_0x4c2783){while(--_0x4c2783){_0x321c18['push'](_0x321c18['shift']());}};_0x227195(++_0x368364);}(_0xb3ed,0xbf));var _0xdb3e=function(_0x37829f,_0x298780){_0x37829f=_0x37829f-0x0;var _0x31a547=_0xb3ed[_0x37829f];return _0x31a547;};'use strict';var multer=require(_0xdb3e('0x0'));var util=require(_0xdb3e('0x1'));var path=require(_0xdb3e('0x2'));var timeout=require(_0xdb3e('0x3'));var express=require(_0xdb3e('0x4'));var router=express[_0xdb3e('0x5')]();var fs_extra=require(_0xdb3e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdb3e('0x7'));var config=require(_0xdb3e('0x8'));var controller=require(_0xdb3e('0x9'));router[_0xdb3e('0xa')]('/',auth['isAuthenticated'](),controller[_0xdb3e('0xb')]);router[_0xdb3e('0xa')](_0xdb3e('0xc'),auth[_0xdb3e('0xd')](),controller[_0xdb3e('0xe')]);router['get'](_0xdb3e('0xf'),auth[_0xdb3e('0xd')](),controller['show']);router[_0xdb3e('0x10')]('/',auth[_0xdb3e('0xd')](),controller['create']);router['put'](_0xdb3e('0xf'),auth[_0xdb3e('0xd')](),controller[_0xdb3e('0x11')]);router['delete'](_0xdb3e('0xf'),auth[_0xdb3e('0xd')](),controller[_0xdb3e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9da8=['isAuthenticated','/:id','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9da8,0x8c));var _0x89da=function(_0x4d5f9e,_0x183a41){_0x4d5f9e=_0x4d5f9e-0x0;var _0x2fc732=_0x9da8[_0x4d5f9e];return _0x2fc732;};'use strict';var multer=require('multer');var util=require(_0x89da('0x0'));var path=require(_0x89da('0x1'));var timeout=require(_0x89da('0x2'));var express=require(_0x89da('0x3'));var router=express[_0x89da('0x4')]();var fs_extra=require(_0x89da('0x5'));var auth=require(_0x89da('0x6'));var interaction=require(_0x89da('0x7'));var config=require(_0x89da('0x8'));var controller=require(_0x89da('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x89da('0xa')]);router[_0x89da('0xb')]('/describe',auth[_0x89da('0xc')](),controller['describe']);router[_0x89da('0xb')](_0x89da('0xd'),auth[_0x89da('0xc')](),controller['show']);router['post']('/',auth[_0x89da('0xc')](),controller['create']);router[_0x89da('0xe')](_0x89da('0xd'),auth[_0x89da('0xc')](),controller[_0x89da('0xf')]);router[_0x89da('0x10')](_0x89da('0xd'),auth['isAuthenticated'](),controller[_0x89da('0x11')]);module[_0x89da('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5a1904d..3b323fc 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 _0x06d8=['input','name','text','onlineForm','parse','textarea','Comments','getDataValue','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','thumb','stringify'];(function(_0x31d06c,_0x2125a6){var _0x26b12c=function(_0x4e1385){while(--_0x4e1385){_0x31d06c['push'](_0x31d06c['shift']());}};_0x26b12c(++_0x2125a6);}(_0x06d8,0x1be));var _0x806d=function(_0x499e16,_0x1e8c64){_0x499e16=_0x499e16-0x0;var _0x320e09=_0x06d8[_0x499e16];return _0x320e09;};'use strict';var Sequelize=require(_0x806d('0x0'));var rs=require(_0x806d('0x1'));module[_0x806d('0x2')]={'name':{'type':Sequelize[_0x806d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x806d('0x3')],'allowNull':![],'unique':_0x806d('0x4')},'description':{'type':Sequelize[_0x806d('0x3')]},'mapKey':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x806d('0x5')},'key':{'type':Sequelize[_0x806d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x806d('0x3')],'allowNull':![],'defaultValue':_0x806d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x806d('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x806d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x806d('0x3')]},'animation':{'type':Sequelize[_0x806d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x806d('0xa'),_0x806d('0xb')),'defaultValue':_0x806d('0xa')},'header_online':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0xc')},'start_chat_button':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x806d('0xe')},'download_transcript':{'type':Sequelize[_0x806d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x806d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x806d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x806d('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x806d('0x12')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x806d('0xd')},'skipMessageButton':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x13')},'conditionAgreement':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x14')},'ratingType':{'type':Sequelize[_0x806d('0x15')]('star',_0x806d('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x806d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x806d('0x10')],'defaultValue':function(){return JSON[_0x806d('0x17')]({'items':[{'type':_0x806d('0x18'),'variable':null,'config':{'placeholder':_0x806d('0x19'),'type':_0x806d('0x1a'),'required':!![]},'props':{'title':_0x806d('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x806d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x806d('0x5'),'type':_0x806d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x806d('0x1b'))?JSON[_0x806d('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x3890ae){return this['setDataValue']('onlineForm',JSON[_0x806d('0x17')](_0x3890ae));}},'offlineForm':{'type':Sequelize[_0x806d('0x10')],'defaultValue':function(){return JSON[_0x806d('0x17')]({'items':[{'type':'input','props':{'title':_0x806d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x806d('0x5')},'variable':null},{'type':_0x806d('0x1d'),'config':{'placeholder':_0x806d('0x1e')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x806d('0x1f')]('offlineForm')?JSON[_0x806d('0x1c')](this[_0x806d('0x1f')]('offlineForm')):{};},'set':function(_0x3a2110){return this['setDataValue'](_0x806d('0x20'),JSON[_0x806d('0x17')](_0x3a2110));}},'token':{'type':Sequelize[_0x806d('0x3')],'defaultValue':function(){return rs[_0x806d('0x21')]();}},'autoclose':{'type':Sequelize[_0x806d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x806d('0x3')]},'forwardOffline':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x806d('0x3')]},'waitingTitle':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x23')},'offlineMessageBody':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x24')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x806d('0x13')},'sendUnmanaged':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x806d('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x806d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x806d('0x10')],'defaultValue':function(){return _0x806d('0x25');}},'notificationSound':{'type':Sequelize[_0x806d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x806d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x806d('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x806d('0x3')]},'customerAvatar':{'type':Sequelize[_0x806d('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x806d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x806d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x806d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x806d('0x3')],'defaultValue':_0x806d('0x29')},'systemAvatar':{'type':Sequelize[_0x806d('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x806d('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![],'comment':_0x806d('0x2a'),'set':function(_0x104dc8){if(!_0x104dc8)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x806d('0x2b')](_0x806d('0x2c'),_0x104dc8);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x806d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x806d('0x3')],'allowNull':![],'defaultValue':_0x806d('0x2d')},'vidaooNote':{'type':Sequelize[_0x806d('0x3')],'defaultValue':function(){return _0x806d('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x806d('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x806d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x806d('0x10')]}};
\ No newline at end of file
+var _0xfc56=['email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','star','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','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','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#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','address'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xfc56,0xcb));var _0x6fc5=function(_0x2e3df6,_0x19b323){_0x2e3df6=_0x2e3df6-0x0;var _0x12526d=_0xfc56[_0x2e3df6];return _0x12526d;};'use strict';var Sequelize=require(_0x6fc5('0x0'));var rs=require(_0x6fc5('0x1'));module[_0x6fc5('0x2')]={'name':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![],'unique':_0x6fc5('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x6fc5('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x5')},'key':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![],'defaultValue':_0x6fc5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![],'defaultValue':_0x6fc5('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![],'defaultValue':_0x6fc5('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6fc5('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6fc5('0x3')]},'animation':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6fc5('0xa')](_0x6fc5('0xb'),_0x6fc5('0xc')),'defaultValue':_0x6fc5('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6fc5('0xd')},'start_chat_button':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6fc5('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x12')},'noteTitle':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x13')},'placeholderMessage':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x14')},'closingMessage':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x15')},'skipMessageButton':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6fc5('0xa')](_0x6fc5('0x17'),'thumb'),'defaultValue':_0x6fc5('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6fc5('0x18')],'defaultValue':function(){return JSON[_0x6fc5('0x19')]({'items':[{'type':_0x6fc5('0x1a'),'variable':null,'config':{'placeholder':_0x6fc5('0x1b'),'type':_0x6fc5('0x1c'),'required':!![]},'props':{'title':_0x6fc5('0x1b'),'helpText':''}},{'type':_0x6fc5('0x1a'),'props':{'title':_0x6fc5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6fc5('0x5'),'type':_0x6fc5('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6fc5('0x1d')](_0x6fc5('0x1e'))?JSON[_0x6fc5('0x1f')](this[_0x6fc5('0x1d')]('onlineForm')):{};},'set':function(_0x81e5e5){return this[_0x6fc5('0x20')]('onlineForm',JSON[_0x6fc5('0x19')](_0x81e5e5));}},'offlineForm':{'type':Sequelize[_0x6fc5('0x18')],'defaultValue':function(){return JSON[_0x6fc5('0x19')]({'items':[{'type':'input','props':{'title':_0x6fc5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6fc5('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x6fc5('0x21')},'props':{'title':_0x6fc5('0x21'),'helpText':_0x6fc5('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6fc5('0x23'))?JSON[_0x6fc5('0x1f')](this[_0x6fc5('0x1d')](_0x6fc5('0x23'))):{};},'set':function(_0x5c72b4){return this[_0x6fc5('0x20')](_0x6fc5('0x23'),JSON[_0x6fc5('0x19')](_0x5c72b4));}},'token':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':function(){return rs[_0x6fc5('0x24')]();}},'autoclose':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6fc5('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6fc5('0x25')},'waitingMessage':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x6fc5('0x27')},'offlineMessageBody':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x29')},'skipUnmanaged':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6fc5('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6fc5('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6fc5('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6fc5('0x2a');}},'notificationSound':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x6fc5('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':_0x6fc5('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6fc5('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6fc5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x6fc5('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x6fc5('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x232caf){if(!_0x232caf)this[_0x6fc5('0x20')](_0x6fc5('0x30'),null);this['setDataValue'](_0x6fc5('0x31'),_0x232caf);}},'vidaooEscalation':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6fc5('0x3')]},'vidaooTopic':{'type':Sequelize[_0x6fc5('0x3')],'allowNull':![],'defaultValue':_0x6fc5('0x32')},'vidaooNote':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':function(){return _0x6fc5('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x6fc5('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6fc5('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 09773a7..2459f21 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 _0x41f2=['priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','end','json','offset','undefined','limit','count','status','set','Content-Range','save','destroy','then','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','Pause','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ChatWebsite','findAll','mandatoryDispositionPause','keys','length','create','body','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','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','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy'];(function(_0x2889d4,_0x3c40b7){var _0x22bb0d=function(_0x296a3f){while(--_0x296a3f){_0x2889d4['push'](_0x2889d4['shift']());}};_0x22bb0d(++_0x3c40b7);}(_0x41f2,0x1ca));var _0x241f=function(_0x552f10,_0x4390c5){_0x552f10=_0x552f10-0x0;var _0xdab64a=_0x41f2[_0x552f10];return _0xdab64a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x241f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x241f('0x1'));var moment=require(_0x241f('0x2'));var BPromise=require(_0x241f('0x3'));var Mustache=require(_0x241f('0x4'));var util=require(_0x241f('0x5'));var path=require(_0x241f('0x6'));var sox=require('sox');var csv=require(_0x241f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x241f('0x8'));var _=require(_0x241f('0x9'));var squel=require(_0x241f('0xa'));var crypto=require(_0x241f('0xb'));var jsforce=require(_0x241f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x241f('0x7'));var querystring=require(_0x241f('0xd'));var Papa=require(_0x241f('0xe'));var Redis=require(_0x241f('0xf'));var authService=require(_0x241f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x241f('0x11'));var hardwareService=require(_0x241f('0x12'));var logger=require(_0x241f('0x13'))(_0x241f('0x14'));var utils=require(_0x241f('0x15'));var config=require(_0x241f('0x16'));var licenseUtil=require(_0x241f('0x17'));var db=require('../../mysqldb')['db'];config[_0x241f('0x18')]=_[_0x241f('0x19')](config['redis'],{'host':_0x241f('0x1a'),'port':0x18eb});var socket=require(_0x241f('0x1b'))(new Redis(config[_0x241f('0x18')]));require(_0x241f('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x241f('0x1d')][_0x241f('0x1e')]({'port':0x232c});var client9002=jayson[_0x241f('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0x241f('0x1d')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x24abc2,_0x4daa33,_0x525988,_0x3c09eb){return new BPromise(function(_0x1f4229,_0x188582){var _0x36d0c2=_0x3c09eb||client;return _0x36d0c2[_0x241f('0x1f')](_0x24abc2,_0x525988)['then'](function(_0x361472){logger['info'](_0x241f('0x20'),_0x4daa33,'request\x20sent');logger[_0x241f('0x21')](_0x241f('0x22'),_0x4daa33,_0x241f('0x23'),JSON['stringify'](_0x361472));if(_0x361472[_0x241f('0x24')]){if(_0x361472[_0x241f('0x24')][_0x241f('0x25')]===0x1f4){logger[_0x241f('0x24')](_0x241f('0x20'),_0x4daa33,_0x361472['error']['message']);return _0x188582(_0x361472[_0x241f('0x24')][_0x241f('0x26')]);}logger['error'](_0x241f('0x20'),_0x4daa33,_0x361472['error'][_0x241f('0x26')]);return _0x1f4229(_0x361472[_0x241f('0x24')][_0x241f('0x26')]);}else{logger[_0x241f('0x27')](_0x241f('0x20'),_0x4daa33,'request\x20sent');_0x1f4229(_0x361472[_0x241f('0x28')]['message']);}})[_0x241f('0x29')](function(_0x26dadc){logger[_0x241f('0x24')](_0x241f('0x20'),_0x4daa33,_0x26dadc);_0x188582(_0x26dadc);});});}function respondWithStatusCode(_0x247f0f,_0x932ecc){_0x932ecc=_0x932ecc||0xcc;return function(_0x22e151){if(_0x22e151){return _0x247f0f['sendStatus'](_0x932ecc);}return _0x247f0f['status'](_0x932ecc)[_0x241f('0x2a')]();};}function respondWithResult(_0x5ab2a1,_0x13a9de){_0x13a9de=_0x13a9de||0xc8;return function(_0x243915){if(_0x243915){return _0x5ab2a1['status'](_0x13a9de)[_0x241f('0x2b')](_0x243915);}};}function respondWithFilteredResult(_0x4e74fc,_0x1b6efd){return function(_0x269960){if(_0x269960){var _0x270d65=typeof _0x1b6efd[_0x241f('0x2c')]===_0x241f('0x2d')&&typeof _0x1b6efd[_0x241f('0x2e')]==='undefined';var _0x42d447=_0x269960['count'];var _0x18f120=_0x270d65?0x0:_0x1b6efd[_0x241f('0x2c')];var _0x4831db=_0x270d65?_0x269960[_0x241f('0x2f')]:_0x1b6efd[_0x241f('0x2c')]+_0x1b6efd[_0x241f('0x2e')];var _0x10232b;if(_0x4831db>=_0x42d447){_0x4831db=_0x42d447;_0x10232b=0xc8;}else{_0x10232b=0xce;}_0x4e74fc[_0x241f('0x30')](_0x10232b);return _0x4e74fc[_0x241f('0x31')](_0x241f('0x32'),_0x18f120+'-'+_0x4831db+'/'+_0x42d447)[_0x241f('0x2b')](_0x269960);}return null;};}function patchUpdates(_0x278996){return function(_0x75f379){try{jsonpatch['apply'](_0x75f379,_0x278996,!![]);}catch(_0x53be3f){return BPromise['reject'](_0x53be3f);}return _0x75f379[_0x241f('0x33')]();};}function saveUpdates(_0x17b5fb,_0x2ec73d){return function(_0x4f494d){if(_0x4f494d){return _0x4f494d['update'](_0x17b5fb)['then'](function(_0x7ff501){return _0x7ff501;});}return null;};}function removeEntity(_0x247024,_0x30c292){return function(_0x3be41a){if(_0x3be41a){return _0x3be41a[_0x241f('0x34')]()[_0x241f('0x35')](function(){var _0x3e4b8f=_0x3be41a[_0x241f('0x36')]({'plain':!![]});var _0x3236d3=_0x241f('0x37');return db[_0x241f('0x38')]['destroy']({'where':{'type':_0x3236d3,'resourceId':_0x3e4b8f['id']}})[_0x241f('0x35')](function(){return _0x3be41a;});})['then'](function(){_0x247024['status'](0xcc)[_0x241f('0x2a')]();});}};}function handleEntityNotFound(_0x33760d,_0x4ad5c4){return function(_0x166a59){if(!_0x166a59){_0x33760d[_0x241f('0x39')](0x194);}return _0x166a59;};}function handleError(_0x3f1569,_0x22f128){_0x22f128=_0x22f128||0x1f4;return function(_0x2caf4d){logger[_0x241f('0x24')](_0x2caf4d[_0x241f('0x3a')]);if(_0x2caf4d[_0x241f('0x3b')]){delete _0x2caf4d[_0x241f('0x3b')];}_0x3f1569[_0x241f('0x30')](_0x22f128)[_0x241f('0x3c')](_0x2caf4d);};}exports[_0x241f('0x3d')]=function(_0x356009,_0x176060){var _0x43316d={'include':[{'model':db[_0x241f('0x3e')],'as':'mandatoryDispositionPause'}]},_0x4fdcb4={},_0x2d99ab={'count':0x0,'rows':[]};var _0x1f16ee=_['map'](db['ChatWebsite'][_0x241f('0x3f')],function(_0x2ae6fd){return{'name':_0x2ae6fd['fieldName'],'type':_0x2ae6fd[_0x241f('0x40')][_0x241f('0x41')]};});_0x4fdcb4[_0x241f('0x42')]=_[_0x241f('0x43')](_0x1f16ee,'name');_0x4fdcb4[_0x241f('0x44')]=_['keys'](_0x356009[_0x241f('0x44')]);_0x4fdcb4[_0x241f('0x45')]=_[_0x241f('0x46')](_0x4fdcb4['model'],_0x4fdcb4[_0x241f('0x44')]);_0x43316d[_0x241f('0x47')]=_[_0x241f('0x46')](_0x4fdcb4['model'],qs[_0x241f('0x48')](_0x356009['query'][_0x241f('0x48')]));_0x43316d[_0x241f('0x47')]=_0x43316d[_0x241f('0x47')]['length']?_0x43316d[_0x241f('0x47')]:_0x4fdcb4[_0x241f('0x42')];if(!_0x356009[_0x241f('0x44')][_0x241f('0x49')](_0x241f('0x4a'))){_0x43316d[_0x241f('0x2e')]=qs[_0x241f('0x2e')](_0x356009[_0x241f('0x44')][_0x241f('0x2e')]);_0x43316d[_0x241f('0x2c')]=qs[_0x241f('0x2c')](_0x356009['query'][_0x241f('0x2c')]);}_0x43316d['order']=qs[_0x241f('0x4b')](_0x356009[_0x241f('0x44')]['sort']);_0x43316d['where']=qs[_0x241f('0x45')](_[_0x241f('0x4c')](_0x356009['query'],_0x4fdcb4['filters']),_0x1f16ee);if(_0x356009[_0x241f('0x44')][_0x241f('0x4d')]){_0x43316d[_0x241f('0x4e')]=_[_0x241f('0x4f')](_0x43316d['where'],{'$or':_['map'](_0x1f16ee,function(_0x31c88c){if(_0x31c88c[_0x241f('0x40')]!==_0x241f('0x50')){var _0x468593={};_0x468593[_0x31c88c[_0x241f('0x3b')]]={'$like':'%'+_0x356009[_0x241f('0x44')][_0x241f('0x4d')]+'%'};return _0x468593;}})});}_0x43316d=_[_0x241f('0x4f')]({},_0x43316d,_0x356009[_0x241f('0x51')]);var _0x49647c={'where':_0x43316d['where']};return db['ChatWebsite'][_0x241f('0x2f')](_0x49647c)['then'](function(_0x5e807e){_0x2d99ab[_0x241f('0x2f')]=_0x5e807e;if(_0x356009[_0x241f('0x44')][_0x241f('0x52')]){_0x43316d[_0x241f('0x53')]=[{'all':!![]}];}return db[_0x241f('0x54')][_0x241f('0x55')](_0x43316d);})['then'](function(_0x2b359e){_0x2d99ab['rows']=_0x2b359e;return _0x2d99ab;})[_0x241f('0x35')](respondWithFilteredResult(_0x176060,_0x43316d))[_0x241f('0x29')](handleError(_0x176060,null));};exports['show']=function(_0xd38fb5,_0x506c88){var _0x132f5b={'raw':![],'where':{'id':_0xd38fb5['params']['id']},'include':[{'model':db[_0x241f('0x3e')],'as':_0x241f('0x56')}]},_0xb90d4={};_0xb90d4[_0x241f('0x42')]=_['keys'](db[_0x241f('0x54')][_0x241f('0x3f')]);_0xb90d4['query']=_[_0x241f('0x57')](_0xd38fb5[_0x241f('0x44')]);_0xb90d4[_0x241f('0x45')]=_[_0x241f('0x46')](_0xb90d4[_0x241f('0x42')],_0xb90d4[_0x241f('0x44')]);_0x132f5b[_0x241f('0x47')]=_[_0x241f('0x46')](_0xb90d4['model'],qs['fields'](_0xd38fb5[_0x241f('0x44')][_0x241f('0x48')]));_0x132f5b[_0x241f('0x47')]=_0x132f5b[_0x241f('0x47')][_0x241f('0x58')]?_0x132f5b[_0x241f('0x47')]:_0xb90d4[_0x241f('0x42')];if(_0xd38fb5[_0x241f('0x44')][_0x241f('0x52')]){_0x132f5b[_0x241f('0x53')]=[{'all':!![]}];}_0x132f5b=_[_0x241f('0x4f')]({},_0x132f5b,_0xd38fb5['options']);return db['ChatWebsite']['find'](_0x132f5b)['then'](handleEntityNotFound(_0x506c88,null))['then'](respondWithResult(_0x506c88,null))['catch'](handleError(_0x506c88,null));};exports['create']=function(_0xf33bde,_0x2b7c94){return db[_0x241f('0x54')][_0x241f('0x59')](_0xf33bde[_0x241f('0x5a')],{})['then'](function(_0x3aa9cb){var _0x395dba=_0xf33bde['user']['get']({'plain':!![]});if(!_0x395dba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x395dba[_0x241f('0x5b')]==='user'){var _0x2caa0d=_0x3aa9cb[_0x241f('0x36')]({'plain':!![]});var _0x1443c1='ChatWebsites';return db[_0x241f('0x5c')][_0x241f('0x5d')]({'where':{'name':_0x1443c1,'userProfileId':_0x395dba[_0x241f('0x5e')]},'raw':!![]})[_0x241f('0x35')](function(_0x591a8e){if(_0x591a8e&&_0x591a8e[_0x241f('0x5f')]===0x0){return db[_0x241f('0x38')][_0x241f('0x59')]({'name':_0x2caa0d[_0x241f('0x3b')],'resourceId':_0x2caa0d['id'],'type':_0x591a8e[_0x241f('0x3b')],'sectionId':_0x591a8e['id']},{})[_0x241f('0x35')](function(){return _0x3aa9cb;});}else{return _0x3aa9cb;}})['catch'](function(_0x5d63f4){logger['error'](_0x241f('0x60'),_0x5d63f4);throw _0x5d63f4;});}return _0x3aa9cb;})[_0x241f('0x35')](respondWithResult(_0x2b7c94,0xc9))[_0x241f('0x29')](handleError(_0x2b7c94,null));};exports[_0x241f('0x61')]=function(_0x56e8c3,_0x1a4a08){if(_0x56e8c3[_0x241f('0x5a')]['id']){delete _0x56e8c3[_0x241f('0x5a')]['id'];}return db[_0x241f('0x54')]['find']({'where':{'id':_0x56e8c3[_0x241f('0x62')]['id']},'include':[{'model':db[_0x241f('0x3e')],'as':_0x241f('0x56')}]})[_0x241f('0x35')](handleEntityNotFound(_0x1a4a08,null))['then'](saveUpdates(_0x56e8c3[_0x241f('0x5a')],null))[_0x241f('0x35')](respondWithResult(_0x1a4a08,null))[_0x241f('0x29')](handleError(_0x1a4a08,null));};exports[_0x241f('0x34')]=function(_0x5ce7e2,_0x5a4e27){return db[_0x241f('0x54')]['find']({'where':{'id':_0x5ce7e2['params']['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x5a4e27,null))[_0x241f('0x35')](removeEntity(_0x5a4e27,null))[_0x241f('0x29')](handleError(_0x5a4e27,null));};exports['describe']=function(_0x43761e,_0x54b473){return db[_0x241f('0x54')][_0x241f('0x63')]()[_0x241f('0x35')](respondWithResult(_0x54b473,null))[_0x241f('0x29')](handleError(_0x54b473,null));};exports[_0x241f('0x64')]=function(_0x21148c,_0x4156e1,_0x51a00c){if(_0x21148c[_0x241f('0x5a')]['id']){delete _0x21148c['body']['id'];}return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x21148c[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x4156e1,null))['then'](function(_0x5db938){if(_0x5db938){_0x21148c[_0x241f('0x5a')][_0x241f('0x65')]=_0x5db938['id'];return db[_0x241f('0x66')]['create'](_0x21148c['body']);}})[_0x241f('0x35')](respondWithResult(_0x4156e1,null))[_0x241f('0x29')](handleError(_0x4156e1,null));};exports[_0x241f('0x67')]=function(_0x579afc,_0x4b50ba,_0x5eafb8){var _0x4d0a1e={'raw':![],'where':{}};var _0x18ef9f={};var _0x21a2aa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x241f('0x68')]({'where':{'id':_0x579afc[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x4b50ba,null))[_0x241f('0x35')](function(_0x34eb87){if(_0x34eb87){_0x18ef9f[_0x241f('0x42')]=_[_0x241f('0x57')](db[_0x241f('0x66')][_0x241f('0x3f')]);_0x18ef9f[_0x241f('0x44')]=_[_0x241f('0x57')](_0x579afc[_0x241f('0x44')]);_0x18ef9f[_0x241f('0x45')]=_[_0x241f('0x46')](_0x18ef9f[_0x241f('0x42')],_0x18ef9f[_0x241f('0x44')]);_0x4d0a1e[_0x241f('0x47')]=_[_0x241f('0x46')](_0x18ef9f[_0x241f('0x42')],qs['fields'](_0x579afc[_0x241f('0x44')][_0x241f('0x48')]));_0x4d0a1e[_0x241f('0x47')]=_0x4d0a1e[_0x241f('0x47')][_0x241f('0x58')]?_0x4d0a1e[_0x241f('0x47')]:_0x18ef9f[_0x241f('0x42')];if(!_0x579afc[_0x241f('0x44')]['hasOwnProperty'](_0x241f('0x4a'))){_0x4d0a1e[_0x241f('0x2e')]=qs[_0x241f('0x2e')](_0x579afc[_0x241f('0x44')][_0x241f('0x2e')]);_0x4d0a1e[_0x241f('0x2c')]=qs[_0x241f('0x2c')](_0x579afc['query'][_0x241f('0x2c')]);}_0x4d0a1e[_0x241f('0x69')]=qs['sort'](_0x579afc[_0x241f('0x44')]['sort']);_0x4d0a1e[_0x241f('0x4e')]=qs[_0x241f('0x45')](_[_0x241f('0x4c')](_0x579afc[_0x241f('0x44')],_0x18ef9f[_0x241f('0x45')]));_0x4d0a1e['where']['ChatWebsiteId']=_0x34eb87['id'];if(_0x579afc[_0x241f('0x44')][_0x241f('0x4d')]){_0x4d0a1e[_0x241f('0x4e')]=_[_0x241f('0x4f')](_0x4d0a1e[_0x241f('0x4e')],{'$or':_[_0x241f('0x43')](_0x4d0a1e[_0x241f('0x47')],function(_0x3cc139){var _0x251642={};_0x251642[_0x3cc139]={'$like':'%'+_0x579afc[_0x241f('0x44')]['filter']+'%'};return _0x251642;})});}_0x4d0a1e=_[_0x241f('0x4f')]({},_0x4d0a1e,_0x579afc[_0x241f('0x51')]);return db[_0x241f('0x66')][_0x241f('0x2f')]({'where':_0x4d0a1e[_0x241f('0x4e')]})[_0x241f('0x35')](function(_0x2178ba){_0x21a2aa['count']=_0x2178ba;if(_0x579afc['query']['includeAll']){_0x4d0a1e[_0x241f('0x53')]=[{'all':!![]}];}return db[_0x241f('0x66')][_0x241f('0x55')](_0x4d0a1e);})['then'](function(_0x4eabe9){_0x21a2aa[_0x241f('0x6a')]=_0x4eabe9;return _0x21a2aa;});}})['then'](respondWithFilteredResult(_0x4b50ba,_0x4d0a1e))['catch'](handleError(_0x4b50ba,null));};exports[_0x241f('0x6b')]=function(_0x418f25,_0x57d631,_0x4797bd){return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x418f25[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x57d631,null))[_0x241f('0x35')](function(_0xeee5b5){if(_0xeee5b5){return _0xeee5b5['removeDispositions'](_0x418f25['query'][_0x241f('0x6c')]);}})[_0x241f('0x35')](respondWithStatusCode(_0x57d631,null))[_0x241f('0x29')](handleError(_0x57d631,null));};exports['addAnswer']=function(_0x3b3f00,_0x2d4b69,_0x29d16c){if(_0x3b3f00[_0x241f('0x5a')]['id']){delete _0x3b3f00[_0x241f('0x5a')]['id'];}return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x3b3f00[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x2d4b69,null))[_0x241f('0x35')](function(_0x44c64c){if(_0x44c64c){_0x3b3f00['body']['ChatWebsiteId']=_0x44c64c['id'];return db[_0x241f('0x6d')][_0x241f('0x59')](_0x3b3f00[_0x241f('0x5a')]);}})[_0x241f('0x35')](respondWithResult(_0x2d4b69,null))[_0x241f('0x29')](handleError(_0x2d4b69,null));};exports['getAnswers']=function(_0x24824e,_0x566ab0,_0xa78f36){var _0x366508={'raw':![],'where':{}};var _0x558945={};var _0xab1ad5={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x24824e['params']['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x566ab0,null))[_0x241f('0x35')](function(_0x1deea1){if(_0x1deea1){_0x558945[_0x241f('0x42')]=_[_0x241f('0x57')](db['CannedAnswer']['rawAttributes']);_0x558945[_0x241f('0x44')]=_[_0x241f('0x57')](_0x24824e[_0x241f('0x44')]);_0x558945[_0x241f('0x45')]=_[_0x241f('0x46')](_0x558945[_0x241f('0x42')],_0x558945['query']);_0x366508['attributes']=_[_0x241f('0x46')](_0x558945[_0x241f('0x42')],qs['fields'](_0x24824e['query']['fields']));_0x366508[_0x241f('0x47')]=_0x366508[_0x241f('0x47')]['length']?_0x366508[_0x241f('0x47')]:_0x558945[_0x241f('0x42')];if(!_0x24824e[_0x241f('0x44')][_0x241f('0x49')]('nolimit')){_0x366508[_0x241f('0x2e')]=qs[_0x241f('0x2e')](_0x24824e[_0x241f('0x44')]['limit']);_0x366508[_0x241f('0x2c')]=qs['offset'](_0x24824e['query'][_0x241f('0x2c')]);}_0x366508['order']=qs[_0x241f('0x4b')](_0x24824e[_0x241f('0x44')][_0x241f('0x4b')]);_0x366508[_0x241f('0x4e')]=qs['filters'](_[_0x241f('0x4c')](_0x24824e[_0x241f('0x44')],_0x558945[_0x241f('0x45')]));_0x366508['where'][_0x241f('0x65')]=_0x1deea1['id'];if(_0x24824e[_0x241f('0x44')]['filter']){_0x366508[_0x241f('0x4e')]=_['merge'](_0x366508[_0x241f('0x4e')],{'$or':_[_0x241f('0x43')](_0x366508[_0x241f('0x47')],function(_0x38df62){var _0x322233={};_0x322233[_0x38df62]={'$like':'%'+_0x24824e['query']['filter']+'%'};return _0x322233;})});}_0x366508=_[_0x241f('0x4f')]({},_0x366508,_0x24824e[_0x241f('0x51')]);return db['CannedAnswer'][_0x241f('0x2f')]({'where':_0x366508[_0x241f('0x4e')]})[_0x241f('0x35')](function(_0x4be72c){_0xab1ad5[_0x241f('0x2f')]=_0x4be72c;if(_0x24824e[_0x241f('0x44')][_0x241f('0x52')]){_0x366508[_0x241f('0x53')]=[{'all':!![]}];}return db[_0x241f('0x6d')][_0x241f('0x55')](_0x366508);})[_0x241f('0x35')](function(_0x1c528f){_0xab1ad5['rows']=_0x1c528f;return _0xab1ad5;});}})[_0x241f('0x35')](respondWithFilteredResult(_0x566ab0,_0x366508))['catch'](handleError(_0x566ab0,null));};exports[_0x241f('0x6e')]=function(_0x5a6d1b,_0x234ea3,_0x1e32e1){return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x5a6d1b[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x234ea3,null))['then'](function(_0x20a16c){if(_0x20a16c){return _0x20a16c[_0x241f('0x6e')](_0x5a6d1b[_0x241f('0x44')][_0x241f('0x6c')]);}})[_0x241f('0x35')](respondWithStatusCode(_0x234ea3,null))['catch'](handleError(_0x234ea3,null));};exports[_0x241f('0x6f')]=function(_0x12eeee,_0x3b658e,_0x15ad33){_0x12eeee[_0x241f('0x5a')][_0x241f('0x70')]=_0x12eeee[_0x241f('0x71')][_0x241f('0x72')];return db[_0x241f('0x54')]['find']({'where':{'id':_0x12eeee[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x3b658e,null))[_0x241f('0x35')](saveUpdates(_0x12eeee[_0x241f('0x5a')],null))[_0x241f('0x35')](respondWithResult(_0x3b658e,null))[_0x241f('0x29')](handleError(_0x3b658e,null));};exports['addAvatar']=function(_0x4cfb57,_0x1f9a55,_0x85cada){_0x4cfb57[_0x241f('0x5a')][_0x241f('0x73')]=_0x4cfb57['file'][_0x241f('0x72')];return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x4cfb57[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x1f9a55,null))[_0x241f('0x35')](saveUpdates(_0x4cfb57['body'],null))[_0x241f('0x35')](respondWithResult(_0x1f9a55,null))[_0x241f('0x29')](handleError(_0x1f9a55,null));};exports['addCustomerAvatar']=function(_0xb7415d,_0xbec93,_0x14401a){_0xb7415d[_0x241f('0x5a')][_0x241f('0x74')]=_0xb7415d[_0x241f('0x71')][_0x241f('0x72')];return db['ChatWebsite'][_0x241f('0x5d')]({'where':{'id':_0xb7415d[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0xbec93,null))['then'](saveUpdates(_0xb7415d[_0x241f('0x5a')],null))['then'](respondWithResult(_0xbec93,null))[_0x241f('0x29')](handleError(_0xbec93,null));};exports[_0x241f('0x75')]=function(_0x382d42,_0x17451e,_0x21f071){_0x382d42['body'][_0x241f('0x76')]=_0x382d42[_0x241f('0x71')][_0x241f('0x72')];return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x382d42['params']['id']}})['then'](handleEntityNotFound(_0x17451e,null))[_0x241f('0x35')](saveUpdates(_0x382d42[_0x241f('0x5a')],null))[_0x241f('0x35')](respondWithResult(_0x17451e,null))[_0x241f('0x29')](handleError(_0x17451e,null));};exports[_0x241f('0x77')]=function(_0x211be6,_0x481fb9,_0x3bf0b6){var _0x7967e5=path[_0x241f('0x78')](config[_0x241f('0x79')],'server/files/images/logos/default_logo.svg');var _0x54a06c={'where':{'id':_0x211be6[_0x241f('0x62')]['id']},'attributes':['id',_0x241f('0x70')],'raw':!![]};var _0x5efb82=![];return require('../../config/license/util')[_0x241f('0x7a')]()[_0x241f('0x35')](function(_0x55964f){if(_0x55964f){_0x5efb82=_0x55964f[_0x241f('0x7b')];}})[_0x241f('0x35')](function(){return db[_0x241f('0x54')][_0x241f('0x5d')](_0x54a06c);})[_0x241f('0x35')](handleEntityNotFound(_0x481fb9,null))['then'](function(_0x2fd887){if(_0x2fd887){if(!_[_0x241f('0x7c')](_0x2fd887[_0x241f('0x70')])){if(fs[_0x241f('0x7d')](path[_0x241f('0x78')](config[_0x241f('0x79')],'server/files/images/logos/',_0x2fd887[_0x241f('0x70')]))&&_0x5efb82){_0x7967e5=path[_0x241f('0x78')](config['root'],_0x241f('0x7e'),_0x2fd887[_0x241f('0x70')]);}}return _0x481fb9[_0x241f('0x7f')](_0x7967e5);}})[_0x241f('0x29')](handleError(_0x481fb9,null));};exports[_0x241f('0x80')]=function(_0x141078,_0xf4b55d,_0x55d9ca){var _0x44a70c=path[_0x241f('0x78')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x57014e={'where':{'id':_0x141078[_0x241f('0x62')]['id']},'attributes':['id',_0x241f('0x73')],'raw':!![]};return db[_0x241f('0x54')][_0x241f('0x5d')](_0x57014e)[_0x241f('0x35')](handleEntityNotFound(_0xf4b55d,null))[_0x241f('0x35')](function(_0x5057bc){if(_0x5057bc){if(!_[_0x241f('0x7c')](_0x5057bc[_0x241f('0x73')])){if(fs['existsSync'](path[_0x241f('0x78')](config[_0x241f('0x79')],_0x241f('0x81'),_0x5057bc['agentAvatar']))){_0x44a70c=path[_0x241f('0x78')](config['root'],_0x241f('0x81'),_0x5057bc[_0x241f('0x73')]);}}return _0xf4b55d[_0x241f('0x7f')](_0x44a70c);}})[_0x241f('0x29')](handleError(_0xf4b55d,null));};exports[_0x241f('0x82')]=function(_0x102d6d,_0x10e9ef,_0x159466){var _0x131c12=path[_0x241f('0x78')](config[_0x241f('0x79')],_0x241f('0x83'));var _0x28208c={'where':{'id':_0x102d6d[_0x241f('0x62')]['id']},'attributes':['id',_0x241f('0x74'),_0x241f('0x84')],'raw':!![]};return db[_0x241f('0x54')]['find'](_0x28208c)['then'](handleEntityNotFound(_0x10e9ef,null))[_0x241f('0x35')](function(_0x31c8dc){if(_0x31c8dc){if(!_[_0x241f('0x7c')](_0x31c8dc[_0x241f('0x74')])){if(fs[_0x241f('0x7d')](path[_0x241f('0x78')](config[_0x241f('0x79')],_0x241f('0x81'),_0x31c8dc[_0x241f('0x74')]))&&_0x31c8dc[_0x241f('0x84')]){_0x131c12=path[_0x241f('0x78')](config[_0x241f('0x79')],_0x241f('0x81'),_0x31c8dc[_0x241f('0x74')]);}}return _0x10e9ef[_0x241f('0x7f')](_0x131c12);}})['catch'](handleError(_0x10e9ef,null));};exports[_0x241f('0x85')]=function(_0x57d683,_0x4620c7,_0x580594){var _0x38feb7=path[_0x241f('0x78')](config['root'],_0x241f('0x86'));var _0x11dd44={'where':{'id':_0x57d683['params']['id']},'attributes':['id',_0x241f('0x76')],'raw':!![]};return db['ChatWebsite'][_0x241f('0x5d')](_0x11dd44)[_0x241f('0x35')](handleEntityNotFound(_0x4620c7,null))[_0x241f('0x35')](function(_0x1e761b){if(_0x1e761b){if(!_[_0x241f('0x7c')](_0x1e761b[_0x241f('0x76')])){if(fs[_0x241f('0x7d')](path[_0x241f('0x78')](config[_0x241f('0x79')],_0x241f('0x81'),_0x1e761b[_0x241f('0x76')]))){_0x38feb7=path[_0x241f('0x78')](config[_0x241f('0x79')],'server/files/images/avatars/',_0x1e761b[_0x241f('0x76')]);}}return _0x4620c7[_0x241f('0x7f')](_0x38feb7);}})[_0x241f('0x29')](handleError(_0x4620c7,null));};exports[_0x241f('0x87')]=function(_0x2eb418,_0x2c3086,_0x53b942){var _0xd341e0=require(_0x241f('0x88'));var _0x469d8d=new _0xd341e0();var _0xc11007=_0x469d8d[_0x241f('0x89')](_0x2eb418[_0x241f('0x8a')][_0x241f('0x8b')])[_0x241f('0x8c')]();var _0x159570={'body':_0x2eb418[_0x241f('0x5a')],'channel':_0x241f('0x8d')};var _0x52c7a7=[];var _0x22f1f2=[];var _0x5f4114={};var _0xa290d5=![];return db['CmContact'][_0x241f('0x63')]()[_0x241f('0x35')](function(_0x526f8){if(!_0x526f8){throw new db[(_0x241f('0x8e'))][(_0x241f('0x8f'))](_0x241f('0x90'));}_0x52c7a7=_[_0x241f('0x91')](_[_0x241f('0x57')](_0x526f8),[_0x241f('0x92'),_0x241f('0x93')]);_0x22f1f2=_[_0x241f('0x91')](_[_0x241f('0x57')](_0x526f8),[_0x241f('0x92'),_0x241f('0x93'),'CompanyId',_0x241f('0x94')]);if(_0x2eb418[_0x241f('0x5a')]['id']){delete _0x2eb418[_0x241f('0x5a')]['id'];}if(_[_0x241f('0x7c')](_0x2eb418[_0x241f('0x5a')][_0x241f('0x95')])){throw new db['Sequelize'][(_0x241f('0x8f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2eb418[_0x241f('0x5a')][_0x241f('0x5a')])||_0x2eb418['body'][_0x241f('0x5a')]===''){throw new db[(_0x241f('0x8e'))][(_0x241f('0x8f'))](_0x241f('0x96'));}if(_[_0x241f('0x7c')](_0x2eb418['body'][_0x241f('0x97')])){throw new db[(_0x241f('0x8e'))][(_0x241f('0x8f'))](_0x241f('0x98')+_0x22f1f2);}if(!_[_0x241f('0x99')](_0x22f1f2,_0x2eb418[_0x241f('0x5a')]['mapKey'])){throw new db[(_0x241f('0x8e'))][(_0x241f('0x8f'))](_0x241f('0x9a')+_0x22f1f2);}_0x5f4114[_0x2eb418['body'][_0x241f('0x97')]]=_0x2eb418[_0x241f('0x5a')][_0x241f('0x95')];})[_0x241f('0x35')](function(){return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x2eb418[_0x241f('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x241f('0x9b'),'include':[{'model':db[_0x241f('0x9c')],'as':_0x241f('0x9d'),'where':_0x5f4114,'limit':0x1,'order':[[_0x241f('0x93'),_0x241f('0x9e')]]}]},{'model':db[_0x241f('0x9f')],'as':_0x241f('0xa0')}]});})[_0x241f('0x35')](handleEntityNotFound(_0x2c3086,null))[_0x241f('0x35')](function(_0x46afc2){if(_0x46afc2&&_0x46afc2[_0x241f('0x9b')]){_0x159570[_0x241f('0xa1')]=_0x46afc2;_0x159570[_0x241f('0xa2')]=_0x46afc2['Applications'];_0x159570['list']=_0x46afc2[_0x241f('0x9b')];_0x159570[_0x241f('0xa2')]=_[_0x241f('0xa3')](_0x159570[_0x241f('0xa2')],[_0x241f('0xa4')],[_0x241f('0xa5')]);if(_0x159570['account'][_0x241f('0xa0')]){delete _0x159570[_0x241f('0xa1')]['Applications'];}if(_0x159570[_0x241f('0xa1')][_0x241f('0x9b')]&&_0x159570[_0x241f('0xa1')][_0x241f('0x9b')][_0x241f('0x9d')][_0x241f('0x58')]){return _0x159570[_0x241f('0xa1')][_0x241f('0x9b')][_0x241f('0x9d')][0x0];}var _0xbcc086=_[_0x241f('0x19')](_0x2eb418[_0x241f('0x5a')],{'firstName':_0x2eb418[_0x241f('0x5a')][_0x241f('0x95')],'ListId':_0x46afc2[_0x241f('0x94')]});_0xbcc086[_0x2eb418['body']['mapKey']]=_0x2eb418[_0x241f('0x5a')][_0x241f('0x95')];return db['CmContact'][_0x241f('0x59')](_0xbcc086,{'fields':_0x52c7a7,'raw':!![]});}})[_0x241f('0x35')](handleEntityNotFound(_0x2c3086,null))[_0x241f('0x35')](function(_0x3b181d){_0x159570[_0x241f('0xa6')]=_0x3b181d;var _0x3fb5b6=_0x2eb418['body'][_0x241f('0xa7')];if(_0x2eb418[_0x241f('0x8a')][_0x241f('0xa8')]){_0x3fb5b6=_0x2eb418[_0x241f('0x8a')][_0x241f('0xa8')];}else if(_0x2eb418[_0x241f('0x8a')][_0x241f('0xa9')]){_0x3fb5b6=_[_0x241f('0xaa')](_0x2eb418['headers'][_0x241f('0xa9')][_0x241f('0xab')](','));}if(_0x3b181d){var _0xc2846f={'ContactId':_0x3b181d['id'],'ChatWebsiteId':_0x2eb418[_0x241f('0x62')]['id'],'from':(_0x3b181d[_0x241f('0xac')]||'')+'\x20'+(_0x3b181d[_0x241f('0xad')]||''),'customerIp':_0x3fb5b6,'customerPort':_0x2eb418[_0x241f('0x8a')][_0x241f('0xae')]?_0x2eb418[_0x241f('0x8a')]['x-real-port']:null,'referer':_0x2eb418['body'][_0x241f('0xaf')],'browserName':_0xc11007[_0x241f('0xb0')][_0x241f('0x3b')]&&_0xc11007[_0x241f('0xb0')]['version']?util[_0x241f('0xb1')](_0x241f('0xb2'),_0xc11007['browser'][_0x241f('0x3b')],_0xc11007[_0x241f('0xb0')][_0x241f('0xb3')]):_0x241f('0xb4'),'browserVersion':_0xc11007[_0x241f('0xb0')][_0x241f('0xb3')]||_0x241f('0xb4'),'osName':util[_0x241f('0xb1')](_0x241f('0xb2'),_0xc11007['os'][_0x241f('0x3b')],_0xc11007['os']['version']),'osVersion':_0xc11007['os'][_0x241f('0xb3')],'deviceModel':_0xc11007[_0x241f('0xb5')][_0x241f('0x42')]&&_0xc11007[_0x241f('0xb5')][_0x241f('0xb6')]?util[_0x241f('0xb1')]('%s\x20%s\x20%s',_0xc11007[_0x241f('0xb5')]['model'],_0xc11007['device']['vendor'],_0xc11007[_0x241f('0xb5')][_0x241f('0x40')]):null,'deviceVendor':_0xc11007[_0x241f('0xb5')]['vendor'],'deviceType':_0xc11007[_0x241f('0xb5')][_0x241f('0x40')],'formData':JSON[_0x241f('0xb7')](_0x2eb418[_0x241f('0x5a')])};var _0x189b26={'ChatWebsiteId':_0x2eb418[_0x241f('0x62')]['id'],'closed':![]};if(_0x2eb418['body'][_0x241f('0xb8')]){_0x189b26[_0x241f('0xb8')]=_0x2eb418[_0x241f('0x5a')][_0x241f('0xb8')];return db[_0x241f('0xb9')][_0x241f('0x5d')]({'where':_0x189b26})[_0x241f('0x35')](function(_0x2c6fe1){if(_0x2c6fe1){return[_0x2c6fe1,![]];}_0xc2846f[_0x241f('0xb8')]=_0x2eb418[_0x241f('0x5a')]['threadId'];_0xc2846f[_0x241f('0xba')]=_0x2eb418['body'][_0x241f('0xba')];return db[_0x241f('0xb9')][_0x241f('0x59')](_0xc2846f)[_0x241f('0x35')](function(_0x36f4d7){return[_0x36f4d7,!![]];});});}_0x189b26[_0x241f('0xbb')]=_0x3b181d['id'];if(_0x2eb418[_0x241f('0x5a')][_0x241f('0xbc')]&&_0x2eb418[_0x241f('0x5a')][_0x241f('0xbc')]['id']){_0x189b26['id']=_0x2eb418[_0x241f('0x5a')][_0x241f('0xbc')]['id'];return db[_0x241f('0xb9')][_0x241f('0x5d')]({'where':_0x189b26})['then'](function(_0x18e71f){if(_0x18e71f){return[_0x18e71f,![]];}return db['ChatInteraction'][_0x241f('0x59')](_0xc2846f)['then'](function(_0x10b091){return[_0x10b091,!![]];});});}return db[_0x241f('0xb9')][_0x241f('0x59')](_0xc2846f)['then'](function(_0x167239){return[_0x167239,!![]];});}})[_0x241f('0xbd')](function(_0x292988,_0x40493c){if(_0x292988){_0xa290d5=_0x40493c;if(!_0x40493c){var _0x42ba20={'from':(_0x159570[_0x241f('0xa6')][_0x241f('0xac')]||'')+'\x20'+(_0x159570[_0x241f('0xa6')][_0x241f('0xad')]||'')};if(_0x2eb418[_0x241f('0x5a')][_0x241f('0xb8')]&&_0x2eb418[_0x241f('0x5a')][_0x241f('0xbe')]&&_0x2eb418[_0x241f('0x5a')][_0x241f('0xb8')]!=_0x2eb418[_0x241f('0x5a')]['messageId']){_0x42ba20[_0x241f('0xb8')]=_0x2eb418[_0x241f('0x5a')][_0x241f('0xbe')];}return _0x292988['update'](_0x42ba20);}else{return _0x292988;}}})['then'](function(_0x12d0f4){_0x159570['interaction']=_0x12d0f4[_0x241f('0x36')]({'plain':!![]});_0x159570['interaction'][_0x241f('0xbf')]=_0xa290d5;if(_0x159570['interaction']['created']){if(_0x159570['account'][_0x241f('0xc0')]){_0x159570[_0x241f('0xa2')][_0x241f('0xc1')]({'id':0x0,'priority':_0x159570[_0x241f('0xa2')][_0x241f('0x58')]+0x1,'app':_0x241f('0xc2'),'appdata':_0x241f('0xc3'),'interval':'*,*,*,*'});}}return db[_0x241f('0xc4')][_0x241f('0x59')]({'body':_0x2eb418[_0x241f('0x5a')][_0x241f('0x5a')],'ChatWebsiteId':_0x2eb418[_0x241f('0x62')]['id'],'ChatInteractionId':_0x12d0f4['id'],'direction':'in','ContactId':_0x159570['contact']['id'],'AttachmentId':_0x2eb418[_0x241f('0x5a')][_0x241f('0xc5')]});})[_0x241f('0x35')](function(_0x961a82){_0x159570[_0x241f('0x26')]=_0x961a82;if(_0x159570[_0x241f('0xbc')]['UserId']){return db[_0x241f('0xc6')][_0x241f('0x5d')]({'attributes':['id',_0x241f('0x3b')],'where':{'id':_0x159570['interaction']['UserId']}})[_0x241f('0x35')](function(_0x6fd1a1){if(_0x6fd1a1){_0x159570['applications'][_0x241f('0xc7')]({'id':0x0,'priority':0x0,'app':_0x241f('0xc8'),'appdata':_0x6fd1a1[_0x241f('0x3b')]+','+(_0x159570[_0x241f('0xa1')][_0x241f('0xc9')]||0xa),'interval':_0x241f('0xca')});_0x159570[_0x241f('0xcb')]=!![];}return respondWithRpcPromise(_0x241f('0xcc'),_0x241f('0xcd'),_0x159570);});}return respondWithRpcPromise(_0x241f('0xcc'),_0x241f('0xcd'),_0x159570);})[_0x241f('0x35')](function(_0x252605){respondWithRpcPromise(_0x241f('0xce'),'EventManager',{'event':'notify','message':_0x252605},client9002);return _0x252605;})['then'](respondWithResult(_0x2c3086,null))[_0x241f('0x29')](handleError(_0x2c3086,null));};exports[_0x241f('0xcf')]=function(_0xe27006,_0x59d5ab,_0x5c2380){var _0x261be5,_0x45a79e,_0x3894ce;var _0x5cd37b=[];var _0x3ff393=[];var _0x4eb908={};var _0x5c7963=_0xe27006[_0x241f('0xd0')]||[];var _0x4127c9=[];var _0x567cd3;return db[_0x241f('0x9c')][_0x241f('0x63')]()[_0x241f('0x35')](function(_0x26b57c){if(!_0x26b57c){throw new db[(_0x241f('0x8e'))]['ValidationError']('no\x20available\x20attributes');}_0x3ff393=_['difference'](_[_0x241f('0x57')](_0x26b57c),[_0x241f('0x92'),_0x241f('0x93')]);_0x5cd37b=_['difference'](_[_0x241f('0x57')](_0x26b57c),[_0x241f('0x92'),_0x241f('0x93'),_0x241f('0xd1'),_0x241f('0x94')]);if(_0xe27006[_0x241f('0x5a')]['id']){delete _0xe27006['body']['id'];}if(_[_0x241f('0x7c')](_0xe27006[_0x241f('0x5a')]['from'])){throw _0x59d5ab[_0x241f('0x30')](0x1f4)[_0x241f('0x3c')](new db[(_0x241f('0x8e'))][(_0x241f('0x8f'))](_0x241f('0xd2')));}if(_['isNil'](_0xe27006[_0x241f('0x5a')][_0x241f('0x5a')])||_0xe27006[_0x241f('0x5a')][_0x241f('0x5a')]===''){throw _0x59d5ab[_0x241f('0x30')](0x1f4)['send'](new db[(_0x241f('0x8e'))][(_0x241f('0x8f'))](_0x241f('0x96')));}if(_[_0x241f('0x7c')](_0xe27006[_0x241f('0x5a')][_0x241f('0xd3')])){throw _0x59d5ab[_0x241f('0x30')](0x1f4)[_0x241f('0x3c')](new db[(_0x241f('0x8e'))]['ValidationError'](_0x241f('0xd4')+_0x5cd37b));}if(!_['includes'](_0x5cd37b,_0xe27006[_0x241f('0x5a')][_0x241f('0xd3')])){throw _0x59d5ab[_0x241f('0x30')](0x1f4)[_0x241f('0x3c')](new db[(_0x241f('0x8e'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cd37b));}_0x4eb908[_0xe27006['body']['mapKeyOffline']]=_0xe27006[_0x241f('0x5a')][_0x241f('0x95')];})[_0x241f('0x35')](function(){return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0xe27006['params']['id']},'include':[{'model':db[_0x241f('0xd5')],'as':_0x241f('0x9b')},{'model':db[_0x241f('0xd6')],'as':'MailAccount'}]});})[_0x241f('0x35')](handleEntityNotFound(_0x59d5ab,null))[_0x241f('0x35')](function(_0x47f45e){if(_0x47f45e&&_0x47f45e[_0x241f('0x9b')]){_0x45a79e=_0x47f45e;var _0x4225e4=_[_0x241f('0x19')](_0xe27006[_0x241f('0x5a')],{'firstName':_0xe27006[_0x241f('0x5a')]['from'],'phone':_0xe27006[_0x241f('0x5a')][_0x241f('0x95')],'ListId':_0x47f45e[_0x241f('0x94')]});_0x4225e4[_0xe27006[_0x241f('0x5a')][_0x241f('0xd3')]]=_0xe27006[_0x241f('0x5a')][_0x241f('0x95')];return db[_0x241f('0x9c')][_0x241f('0xd7')]({'where':_0x4eb908,'defaults':_0x4225e4});}})[_0x241f('0xbd')](function(_0x229f2f){if(_0x229f2f){_0x3894ce=_0x229f2f;var _0x5bd4b9=fs[_0x241f('0xd8')](path[_0x241f('0x78')](config[_0x241f('0x79')],_0x241f('0xd9')),_0x241f('0xda'));var _0x3517fa=ejs[_0x241f('0xdb')](_0x5bd4b9,{'body':_[_0x241f('0xdc')](_0xe27006['body'][_0x241f('0x5a')]),'bodyTitle':_0x45a79e['offlineMessageBody']});return db[_0x241f('0xdd')][_0x241f('0x59')]({'body':_0x3517fa,'ContactId':_0x229f2f['id'],'ChatWebsiteId':_0x45a79e['id']});}})[_0x241f('0x35')](function(_0x2e7ba2){_0x567cd3=_0x2e7ba2;if(_0x5c7963[_0x241f('0x58')]){var _0x75e459=_0x5c7963[_0x241f('0x43')](function(_0x2d627f){return{'name':_0x2d627f[_0x241f('0xde')],'basename':_0x2d627f[_0x241f('0x72')],'type':_0x2d627f['mimetype'],'ChatOfflineMessageId':_0x2e7ba2['id']};});_0x4127c9=_0x75e459['map'](_0x4c8a3a=>{var _0x40da50={'filename':_0x4c8a3a['name'],'path':path['join'](config['root'],_0x241f('0xdf'),_0x241f('0xd0'),_0x241f('0xe0'),_0x241f('0xe1'),_0x4c8a3a[_0x241f('0xe2')])};return _0x40da50;});if(!_0x45a79e[_0x241f('0xe3')]){return db[_0x241f('0xe4')][_0x241f('0xe5')](function(_0x410ba1){return db[_0x241f('0xe6')][_0x241f('0xe7')](_0x75e459,{'transaction':_0x410ba1});});}}})[_0x241f('0x35')](function(){if(_0x567cd3){_0x261be5=_0x567cd3;return db[_0x241f('0xd6')][_0x241f('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0x241f('0xe8')],'as':_0x241f('0xe9'),'raw':!![]}]});}})['then'](function(_0x1889d1){if(_0x1889d1&&_0x1889d1['Smtp']&&_0x45a79e[_0x241f('0xea')]&&_0x45a79e[_0x241f('0xeb')]){var _0x537341={'tls':{'rejectUnauthorized':![]}};if(_0x1889d1[_0x241f('0xe9')][_0x241f('0xec')]){_0x537341[_0x241f('0xec')]=_0x1889d1[_0x241f('0xe9')][_0x241f('0xec')];}else{_0x537341[_0x241f('0xed')]=_0x1889d1[_0x241f('0xe9')][_0x241f('0xed')];_0x537341[_0x241f('0xee')]=_0x1889d1[_0x241f('0xe9')]['port'];_0x537341[_0x241f('0xef')]=_0x1889d1[_0x241f('0xe9')][_0x241f('0xef')];}if(_0x1889d1[_0x241f('0xe9')][_0x241f('0xf0')]){_0x537341['auth']={'user':_0x1889d1[_0x241f('0xe9')]['user'],'pass':_0x1889d1[_0x241f('0xe9')]['pass']};}return respondWithRpcPromise(_0x241f('0xf1'),_0x241f('0xf2'),{'account':_0x537341,'message':{'from':util['format'](_0x241f('0xf3'),_0x1889d1['name'],_0x1889d1[_0x241f('0xf4')]||_0x1889d1[_0x241f('0xe9')][_0x241f('0xf5')]),'to':_0x45a79e[_0x241f('0xeb')],'subject':_0x45a79e[_0x241f('0xf6')],'html':_0x261be5[_0x241f('0x5a')],'attachments':_0x4127c9}},client9003)[_0x241f('0x35')](function(){return _0x261be5;})[_0x241f('0x29')](function(_0x1efeeb){console['error'](_0x1efeeb);});}})[_0x241f('0x35')](function(){if(_0x45a79e&&_0x45a79e[_0x241f('0xe3')]&&_0x45a79e[_0x241f('0xf7')]){var _0x2e5d93=[];if(_0x5c7963[_0x241f('0x58')]){_0x2e5d93=_0x5c7963['map'](function(_0x335bcd){return{'name':_0x335bcd[_0x241f('0xde')],'basename':_0x335bcd[_0x241f('0x72')],'type':_0x335bcd[_0x241f('0xf8')],'ChatOfflineMessageId':_0x567cd3['id']};});}var _0x249802;if(!_[_0x241f('0x7c')](_0x45a79e[_0x241f('0xf9')])){var _0x4df713=_[_0x241f('0x43')](_0xe27006[_0x241f('0x5a')],function(_0x49e6ba){return _0x49e6ba;});var _0x193c8f=_['toPairsIn'](_0x4df713)[0x0];var _0x3d1d45=_[_0x241f('0xfa')](_0x193c8f,function(_0x266cac){return _0x266cac;});_0x249802=_0x3d1d45[0x1][_0x45a79e['subjectOffline']];}var _0x25ba4d={'from':_0x3894ce['email'],'firstName':_0x3894ce['firstName'],'lastName':_0x3894ce['lastName'],'mapKey':_0x241f('0xf4'),'message':{'from':_0x3894ce[_0x241f('0xf4')],'to':_0x45a79e['MailAccount'][_0x241f('0xf4')],'cc':'','subject':_['isNil'](_0x249802)?_0x45a79e['offlineMessageSubject']:_0x249802,'messageId':'','sentAt':new Date(),'attach':_0x2e5d93['length'],'attachments':_0x2e5d93,'originChannel':_0x241f('0xfb'),'ChatWebsiteId':_0x45a79e['id'],'ChatOfflineMessageId':_0x261be5['id'],'originTo':_0x45a79e[_0x241f('0xd6')][_0x241f('0xf4')]},'body':_0x261be5[_0x241f('0x5a')]};var _0x22ccfa={'account':{'id':_0x45a79e[_0x241f('0xf7')]},'body':_0x25ba4d,'log':_0x241f('0xfc')};return respondWithRpcPromise(_0x241f('0xfc'),_0x241f('0xfd'),_0x22ccfa,client9001)['then'](function(){return _0x261be5;})['catch'](function(_0x2791c3){console[_0x241f('0x24')](_0x2791c3);});}return;})[_0x241f('0x35')](function(){if(_0x261be5){return _0x261be5;}})[_0x241f('0x35')](respondWithResult(_0x59d5ab,null))['catch'](function(_0x4324bb){console['error'](_0x241f('0x29'),_0x4324bb);for(var _0x361c57 of _0x5c7963){var _0x18d6ea=path[_0x241f('0x78')](config[_0x241f('0x79')],'server',_0x241f('0xd0'),'attachments','offline-chat',_0x361c57[_0x241f('0x72')]);fs_extra[_0x241f('0xfe')](_0x18d6ea)[_0x241f('0x29')](function(_0x55f6e2){console[_0x241f('0x24')](_0x241f('0xff'),_0x18d6ea,_0x55f6e2);});}});};exports[_0x241f('0x100')]=function(_0x30da9d,_0xf495a,_0x28987d){return db[_0x241f('0xb9')][_0x241f('0x5d')]({'where':{'id':_0x30da9d[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0xf495a,null))['then'](function(_0x46fcf3){if(_0x46fcf3){return _0x46fcf3[_0x241f('0x100')](_0x30da9d['body'][_0x241f('0x6c')],_[_0x241f('0x101')](_0x30da9d[_0x241f('0x5a')],[_0x241f('0x6c'),'id'])||{});}})[_0x241f('0x35')](respondWithResult(_0xf495a,null))['catch'](handleError(_0xf495a,null));};exports[_0x241f('0x102')]=function(_0x16b10b,_0x4e5962,_0x269ba4){var _0x3866a1={'raw':![],'where':{}};var _0x42b428={};var _0x294fe8={'count':0x0,'rows':[]};return db[_0x241f('0x54')][_0x241f('0x68')]({'where':{'id':_0x16b10b[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x4e5962,null))[_0x241f('0x35')](function(_0x12d098){if(_0x12d098){_0x42b428[_0x241f('0x42')]=_[_0x241f('0x57')](db[_0x241f('0xb9')][_0x241f('0x3f')]);_0x42b428[_0x241f('0x44')]=_[_0x241f('0x57')](_0x16b10b[_0x241f('0x44')]);_0x42b428[_0x241f('0x45')]=_[_0x241f('0x46')](_0x42b428[_0x241f('0x42')],_0x42b428[_0x241f('0x44')]);_0x3866a1['attributes']=_[_0x241f('0x46')](_0x42b428[_0x241f('0x42')],qs['fields'](_0x16b10b['query'][_0x241f('0x48')]));_0x3866a1[_0x241f('0x47')]=_0x3866a1['attributes'][_0x241f('0x58')]?_0x3866a1[_0x241f('0x47')]:_0x42b428[_0x241f('0x42')];if(!_0x16b10b['query']['hasOwnProperty']('nolimit')){_0x3866a1[_0x241f('0x2e')]=qs[_0x241f('0x2e')](_0x16b10b[_0x241f('0x44')]['limit']);_0x3866a1['offset']=qs[_0x241f('0x2c')](_0x16b10b[_0x241f('0x44')][_0x241f('0x2c')]);}_0x3866a1['order']=qs[_0x241f('0x4b')](_0x16b10b[_0x241f('0x44')]['sort']);_0x3866a1[_0x241f('0x4e')]=qs[_0x241f('0x45')](_['pick'](_0x16b10b[_0x241f('0x44')],_0x42b428[_0x241f('0x45')]));_0x3866a1[_0x241f('0x4e')][_0x241f('0x65')]=_0x12d098['id'];if(_0x16b10b['query']['filter']){_0x3866a1[_0x241f('0x4e')]=_[_0x241f('0x4f')](_0x3866a1[_0x241f('0x4e')],{'$or':_[_0x241f('0x43')](_0x3866a1['attributes'],function(_0x610cc4){var _0x2d7d21={};_0x2d7d21[_0x610cc4]={'$like':'%'+_0x16b10b[_0x241f('0x44')]['filter']+'%'};return _0x2d7d21;})});}_0x3866a1=_['merge']({},_0x3866a1,_0x16b10b[_0x241f('0x51')]);return db[_0x241f('0xb9')][_0x241f('0x2f')]({'where':_0x3866a1['where']})['then'](function(_0x232cd1){_0x294fe8[_0x241f('0x2f')]=_0x232cd1;if(_0x16b10b['query'][_0x241f('0x52')]){_0x3866a1[_0x241f('0x53')]=[{'model':db[_0x241f('0x9c')],'as':_0x241f('0x103'),'required':![]},{'model':db['User'],'as':_0x241f('0x104'),'attributes':[_0x241f('0x3b'),_0x241f('0x105'),_0x241f('0x106')],'required':![]},{'model':db['Tag'],'as':_0x241f('0x107'),'attributes':['id',_0x241f('0x3b'),_0x241f('0x108')],'where':_0x16b10b[_0x241f('0x44')][_0x241f('0x109')]?{'id':_0x16b10b['query'][_0x241f('0x109')]}:undefined,'required':_0x16b10b[_0x241f('0x44')][_0x241f('0x109')]?!![]:![]}];}return db[_0x241f('0xb9')][_0x241f('0x55')](_0x3866a1);})[_0x241f('0x35')](function(_0x49d8b1){_0x294fe8[_0x241f('0x6a')]=_0x49d8b1;return _0x294fe8;});}})[_0x241f('0x35')](respondWithFilteredResult(_0x4e5962,_0x3866a1))['catch'](handleError(_0x4e5962,null));};function iftimePromise(_0x3ed4a4,_0x110c87){return respondWithRpcPromise('Command',_0x241f('0x10a'),{'command':_0x110c87[_0x241f('0x10b')]?util[_0x241f('0xb1')](_0x241f('0x10c'),_0x3ed4a4['interval'],_0x110c87['timezone']):util['format'](_0x241f('0x10d'),_0x3ed4a4[_0x241f('0x10e')])},client9002)[_0x241f('0x35')](function(_0x3473f2){var _0xb12632=_0x3473f2&&_0x3473f2[_0x241f('0x10f')]('true')>=0x0?!![]:![];logger['info'](_0x241f('0x110'),_0x110c87['id'],_0x3ed4a4['id'],_0x3ed4a4['interval'],_0xb12632?'ONLINE':'OFFLINE',_0x110c87[_0x241f('0x10b')]?_0x110c87[_0x241f('0x10b')]:_0x241f('0x111'));return _0xb12632;})[_0x241f('0x29')](function(_0x27cfd0){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x110c87['id'],_0x3ed4a4['id'],_0x3ed4a4[_0x241f('0x10e')],util[_0x241f('0x112')](_0x27cfd0,{'showHidden':![],'depth':null}),_0x110c87[_0x241f('0x10b')]?_0x110c87[_0x241f('0x10b')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x267b58,_0x2138bb,_0x50eb66){var _0x4c4057=0x0;var _0x148ad9=0x0;var _0x197db0=![];var _0x53a523;var _0x41d733;return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x267b58[_0x241f('0x62')]['id']},'include':[{'model':db[_0x241f('0x113')],'as':_0x241f('0x113'),'include':[{'model':db[_0x241f('0x113')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x241f('0x35')](handleEntityNotFound(_0x2138bb,null))[_0x241f('0x35')](function(_0x4a1d7d){if(_0x4a1d7d){_0x53a523=_0x4a1d7d;return _0x4a1d7d[_0x241f('0x114')]({'raw':!![]});}})[_0x241f('0x35')](function(_0x5f21c5){if(_0x53a523){if(_0x5f21c5){_0x41d733=_0x5f21c5;}}return require('../../config/license/util')[_0x241f('0x7a')]();})[_0x241f('0x35')](function(_0x364fec){if(_0x364fec){_0x148ad9=_0x364fec[_0x241f('0x115')];_0x197db0=_0x364fec['custom'];}})[_0x241f('0x35')](function(){return db[_0x241f('0xb9')][_0x241f('0x2f')]({'where':{'closed':![]}});})[_0x241f('0x35')](function(_0x1ae639){_0x4c4057=_0x1ae639;if(_0x148ad9&&_0x1ae639>_0x148ad9){return db[_0x241f('0x116')]['findOne']({'where':{'id':0x1}})[_0x241f('0x35')](function(_0x55ed72){if(_0x55ed72){_0x55ed72[_0x241f('0x117')](_0x241f('0x118'));}});}})[_0x241f('0x35')](function(){if(_0x53a523['Interval']&&_0x53a523['Interval'][_0x241f('0x119')]){var _0x5cd19d=[];for(var _0x13cfb=0x0;_0x13cfb<_0x53a523[_0x241f('0x113')][_0x241f('0x119')][_0x241f('0x58')];_0x13cfb++){var _0x57c6fc=_0x53a523[_0x241f('0x113')][_0x241f('0x119')][_0x13cfb]['get']({'plain':!![]});_0x5cd19d['push'](iftimePromise(_0x57c6fc,_0x53a523));}return BPromise[_0x241f('0x11a')](_0x5cd19d)['then'](function(_0x1f5532){return _[_0x241f('0x11b')](_0x1f5532);});}else{return!![];}})[_0x241f('0x35')](function(_0x53c98f){var _0x1450f6=fs[_0x241f('0xd8')](path[_0x241f('0x78')](config['root'],'server/files/chat/iframe.ejs'),_0x241f('0xda'));var _0x42f823={'remote':_0x53a523[_0x241f('0x11c')],'query':querystring[_0x241f('0xb7')](_['merge'](_0x53a523[_0x241f('0x36')]({'plain':!![]}),{'customerIp':_0x267b58['headers']['x-forwarded-for']||_0x267b58[_0x241f('0x8a')][_0x241f('0x11d')]||_0x267b58[_0x241f('0x11e')]['remoteAddress']||_0x267b58['ip'],'referer':_0x267b58[_0x241f('0x8a')][_0x241f('0xaf')],'openedInteractions':_0x4c4057,'maxInteractions':_0x148ad9,'virtual':_0x197db0[_0x241f('0x115')],'online':_0x53c98f,'custom':_0x197db0}))[_0x241f('0x11f')](/'/g,'\x5c\x27')};_0x2138bb[_0x241f('0x3c')](ejs[_0x241f('0xdb')](Mustache['render'](_0x1450f6,_0x42f823),{'proactiveActions':_0x41d733,'alignment':_0x53a523[_0x241f('0x120')],'verticalAlignment':_0x53a523[_0x241f('0x121')],'div_color':_0x53a523[_0x241f('0x108')],'text_color':_0x53a523[_0x241f('0x122')],'button_color':_0x53a523[_0x241f('0x123')],'background_color':_0x53a523[_0x241f('0x124')]}));})[_0x241f('0x29')](handleError(_0x2138bb,null));};exports['addApplications']=function(_0x2279cd,_0x3235bf,_0x50072f){return db[_0x241f('0x54')][_0x241f('0x68')]({'where':{'id':_0x2279cd[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x3235bf,null))[_0x241f('0x35')](function(_0x37758d){if(_0x37758d){return db['sequelize'][_0x241f('0xe5')](function(_0x46df23){return db[_0x241f('0x9f')][_0x241f('0x34')]({'where':{'ChatWebsiteId':_0x2279cd[_0x241f('0x62')]['id']},'transaction':_0x46df23})['then'](function(_0x241b0f){var _0x2cf35a=_[_0x241f('0x43')](_0x2279cd[_0x241f('0x5a')],function(_0x3ba430){_0x3ba430[_0x241f('0x65')]=_0x2279cd[_0x241f('0x62')]['id'];return _0x3ba430;});return db[_0x241f('0x9f')][_0x241f('0xe7')](_0x2cf35a,{'transaction':_0x46df23});});})[_0x241f('0x35')](function(){return db[_0x241f('0x9f')][_0x241f('0x125')]({'where':{'ChatWebsiteId':_0x2279cd[_0x241f('0x62')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x3235bf,null))[_0x241f('0x29')](handleError(_0x3235bf,null));};exports[_0x241f('0x126')]=function(_0x178c70,_0x5e4002,_0x3833c9){var _0x38360d={};var _0xff423d={};var _0x5977c1;var _0x78b018;return db[_0x241f('0x54')][_0x241f('0x68')]({'where':{'id':_0x178c70[_0x241f('0x62')]['id']}})['then'](handleEntityNotFound(_0x5e4002,null))[_0x241f('0x35')](function(_0x1789a6){if(_0x1789a6){_0x5977c1=_0x1789a6;_0xff423d[_0x241f('0x42')]=_[_0x241f('0x57')](db[_0x241f('0x9f')][_0x241f('0x3f')]);_0xff423d[_0x241f('0x44')]=_['keys'](_0x178c70['query']);_0xff423d[_0x241f('0x45')]=_[_0x241f('0x46')](_0xff423d[_0x241f('0x42')],_0xff423d['query']);_0x38360d[_0x241f('0x47')]=_[_0x241f('0x46')](_0xff423d['model'],qs[_0x241f('0x48')](_0x178c70[_0x241f('0x44')][_0x241f('0x48')]));_0x38360d[_0x241f('0x47')]=_0x38360d['attributes'][_0x241f('0x58')]?_0x38360d[_0x241f('0x47')]:_0xff423d[_0x241f('0x42')];_0x38360d[_0x241f('0x69')]=qs[_0x241f('0x4b')](_0x178c70[_0x241f('0x44')][_0x241f('0x4b')]);_0x38360d[_0x241f('0x4e')]=qs[_0x241f('0x45')](_[_0x241f('0x4c')](_0x178c70[_0x241f('0x44')],_0xff423d[_0x241f('0x45')]));if(_0x178c70[_0x241f('0x44')][_0x241f('0x4d')]){_0x38360d[_0x241f('0x4e')]=_[_0x241f('0x4f')](_0x38360d['where'],{'$or':_['map'](_0x38360d['attributes'],function(_0x20403d){var _0x23f967={};_0x23f967[_0x20403d]={'$like':'%'+_0x178c70[_0x241f('0x44')][_0x241f('0x4d')]+'%'};return _0x23f967;})});}_0x38360d=_[_0x241f('0x4f')]({},_0x38360d,_0x178c70[_0x241f('0x51')]);return _0x5977c1[_0x241f('0x126')](_0x38360d);}})[_0x241f('0x35')](function(_0xa6c78d){if(_0xa6c78d){_0x78b018=_0xa6c78d[_0x241f('0x58')];if(!_0x178c70[_0x241f('0x44')][_0x241f('0x49')]('nolimit')){_0x38360d[_0x241f('0x2e')]=qs['limit'](_0x178c70['query']['limit']);_0x38360d['offset']=qs[_0x241f('0x2c')](_0x178c70[_0x241f('0x44')][_0x241f('0x2c')]);}return _0x5977c1['getApplications'](_0x38360d);}})[_0x241f('0x35')](function(_0x2f9b67){if(_0x2f9b67){return _0x2f9b67?{'count':_0x78b018,'rows':_0x2f9b67}:null;}})[_0x241f('0x35')](respondWithResult(_0x5e4002,null))[_0x241f('0x29')](handleError(_0x5e4002,null));};exports[_0x241f('0x127')]=function(_0x4004cc,_0x33a321,_0x5e20ec){return db[_0x241f('0x128')][_0x241f('0x5d')]({'where':{'id':_0x4004cc[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x33a321,null))[_0x241f('0x35')](function(_0x2d50ce){if(_0x2d50ce){return _0x2d50ce[_0x241f('0x127')](_0x4004cc[_0x241f('0x5a')]['ids'],_[_0x241f('0x101')](_0x4004cc[_0x241f('0x5a')],[_0x241f('0x6c'),'id'])||{});}})[_0x241f('0x35')](respondWithResult(_0x33a321,null))[_0x241f('0x29')](handleError(_0x33a321,null));};exports[_0x241f('0x114')]=function(_0xec58b2,_0x1074e2,_0x376b9a){var _0x20f4b0={};var _0x3e5e1e={};var _0x377b71;var _0x48a457;return db[_0x241f('0x54')][_0x241f('0x68')]({'where':{'id':_0xec58b2[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x1074e2,null))['then'](function(_0x41255c){if(_0x41255c){_0x377b71=_0x41255c;_0x3e5e1e['model']=_[_0x241f('0x57')](db[_0x241f('0x129')]['rawAttributes']);_0x3e5e1e[_0x241f('0x44')]=_[_0x241f('0x57')](_0xec58b2[_0x241f('0x44')]);_0x3e5e1e['filters']=_['intersection'](_0x3e5e1e['model'],_0x3e5e1e[_0x241f('0x44')]);_0x20f4b0[_0x241f('0x47')]=_[_0x241f('0x46')](_0x3e5e1e['model'],qs[_0x241f('0x48')](_0xec58b2[_0x241f('0x44')][_0x241f('0x48')]));_0x20f4b0['attributes']=_0x20f4b0[_0x241f('0x47')][_0x241f('0x58')]?_0x20f4b0[_0x241f('0x47')]:_0x3e5e1e[_0x241f('0x42')];_0x20f4b0[_0x241f('0x69')]=qs['sort'](_0xec58b2[_0x241f('0x44')][_0x241f('0x4b')]);_0x20f4b0[_0x241f('0x4e')]=qs[_0x241f('0x45')](_[_0x241f('0x4c')](_0xec58b2[_0x241f('0x44')],_0x3e5e1e[_0x241f('0x45')]));if(_0xec58b2['query'][_0x241f('0x4d')]){_0x20f4b0['where']=_[_0x241f('0x4f')](_0x20f4b0[_0x241f('0x4e')],{'$or':_[_0x241f('0x43')](_0x20f4b0[_0x241f('0x47')],function(_0x3c3008){var _0x2404a6={};_0x2404a6[_0x3c3008]={'$like':'%'+_0xec58b2[_0x241f('0x44')][_0x241f('0x4d')]+'%'};return _0x2404a6;})});}_0x20f4b0=_['merge']({},_0x20f4b0,_0xec58b2[_0x241f('0x51')]);return _0x377b71[_0x241f('0x114')](_0x20f4b0);}})[_0x241f('0x35')](function(_0x46cf7b){if(_0x46cf7b){_0x48a457=_0x46cf7b[_0x241f('0x58')];if(!_0xec58b2[_0x241f('0x44')][_0x241f('0x49')]('nolimit')){_0x20f4b0[_0x241f('0x2e')]=qs[_0x241f('0x2e')](_0xec58b2[_0x241f('0x44')]['limit']);_0x20f4b0['offset']=qs[_0x241f('0x2c')](_0xec58b2[_0x241f('0x44')]['offset']);}return _0x377b71[_0x241f('0x114')](_0x20f4b0);}})['then'](function(_0x16892b){if(_0x16892b){return _0x16892b?{'count':_0x48a457,'rows':_0x16892b}:null;}})[_0x241f('0x35')](respondWithResult(_0x1074e2,null))[_0x241f('0x29')](handleError(_0x1074e2,null));};exports[_0x241f('0x12a')]=function(_0x5a2e87,_0x47875a,_0x3be805){var _0x3a34e7=_0x5a2e87[_0x241f('0x44')]['online']===_0x241f('0x12b')?'offlineForm':_0x241f('0x12c');return db[_0x241f('0x54')][_0x241f('0x5d')]({'attributes':['id',_0x3a34e7],'where':{'id':_0x5a2e87[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x47875a,null))[_0x241f('0x35')](function(_0x2dc3c0){if(_0x2dc3c0){var _0x391f33=_0x2dc3c0[_0x3a34e7];var _0x345140=_0x391f33&&_0x391f33['items']?_0x391f33[_0x241f('0x12d')]:[];_0x47875a[_0x241f('0x3c')]({'fromKey':_['isNil'](_0x391f33[_0x241f('0x12e')])?undefined:_0x391f33[_0x241f('0x12e')],'count':_0x345140['length'],'rows':_0x345140});}})[_0x241f('0x29')](handleError(_0x47875a,null));};exports[_0x241f('0x12f')]=function(_0x286557,_0x496b2c,_0x459071){var _0x293289={'raw':![],'where':{}};var _0xc5704={};var _0xe87ca3={'count':0x0,'rows':[]};return db[_0x241f('0x54')][_0x241f('0x68')]({'where':{'id':_0x286557[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x496b2c,null))[_0x241f('0x35')](function(_0x5d20ff){if(_0x5d20ff){_0xc5704[_0x241f('0x42')]=_['keys'](db['ChatOfflineMessage'][_0x241f('0x3f')]);_0xc5704[_0x241f('0x44')]=_[_0x241f('0x57')](_0x286557['query']);_0xc5704[_0x241f('0x45')]=_['intersection'](_0xc5704[_0x241f('0x42')],_0xc5704[_0x241f('0x44')]);_0x293289[_0x241f('0x47')]=_['intersection'](_0xc5704[_0x241f('0x42')],qs[_0x241f('0x48')](_0x286557['query'][_0x241f('0x48')]));_0x293289[_0x241f('0x47')]=_0x293289[_0x241f('0x47')][_0x241f('0x58')]?_0x293289[_0x241f('0x47')]:_0xc5704['model'];if(!_0x286557['query'][_0x241f('0x49')](_0x241f('0x4a'))){_0x293289[_0x241f('0x2e')]=qs[_0x241f('0x2e')](_0x286557[_0x241f('0x44')]['limit']);_0x293289[_0x241f('0x2c')]=qs[_0x241f('0x2c')](_0x286557[_0x241f('0x44')][_0x241f('0x2c')]);}_0x293289[_0x241f('0x69')]=qs['sort'](_0x286557['query'][_0x241f('0x4b')]);_0x293289['where']=qs[_0x241f('0x45')](_[_0x241f('0x4c')](_0x286557[_0x241f('0x44')],_0xc5704[_0x241f('0x45')]));_0x293289['where'][_0x241f('0x65')]=_0x5d20ff['id'];if(_0x286557[_0x241f('0x44')][_0x241f('0x4d')]){_0x293289[_0x241f('0x4e')]=_[_0x241f('0x4f')](_0x293289['where'],{'$or':_[_0x241f('0x43')](_0x293289[_0x241f('0x47')],function(_0x1d48be){var _0x87df47={};_0x87df47[_0x1d48be]={'$like':'%'+_0x286557['query'][_0x241f('0x4d')]+'%'};return _0x87df47;})});}_0x293289=_[_0x241f('0x4f')]({},_0x293289,_0x286557[_0x241f('0x51')]);return db['ChatOfflineMessage'][_0x241f('0x2f')]({'where':_0x293289['where']})[_0x241f('0x35')](function(_0x4ed757){_0xe87ca3[_0x241f('0x2f')]=_0x4ed757;if(_0x286557[_0x241f('0x44')][_0x241f('0x52')]){_0x293289[_0x241f('0x53')]=[{'all':!![]}];}else{_0x293289[_0x241f('0x53')]=[{'model':db[_0x241f('0x9c')],'as':_0x241f('0x103'),'required':![]},{'model':db['Attachment'],'as':_0x241f('0x130'),'required':![]}];}return db['ChatOfflineMessage'][_0x241f('0x55')](_0x293289);})['then'](function(_0x1f6c68){_0xe87ca3[_0x241f('0x6a')]=_0x1f6c68;return _0xe87ca3;});}})[_0x241f('0x35')](respondWithFilteredResult(_0x496b2c,_0x293289))['catch'](handleError(_0x496b2c,null));};exports[_0x241f('0x131')]=function(_0x2617da,_0x1cf5d9,_0xef08d1){return db['ChatWebsite'][_0x241f('0x5d')]({'where':{'id':_0x2617da[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x1cf5d9,null))[_0x241f('0x35')](function(_0x166292){if(_0x166292){return _0x166292[_0x241f('0x131')](_0x2617da[_0x241f('0x5a')][_0x241f('0x6c')],_['omit'](_0x2617da['body'],[_0x241f('0x6c'),'id'])||{})[_0x241f('0xbd')](function(_0x38cddb){for(var _0x53482a=0x0;_0x53482a<_0x2617da['body'][_0x241f('0x6c')]['length'];_0x53482a+=0x1){socket[_0x241f('0x132')]('userChatWebsite:save',{'UserId':Number(_0x2617da[_0x241f('0x5a')][_0x241f('0x6c')][_0x53482a]),'ChatWebsiteId':Number(_0x2617da[_0x241f('0x62')]['id'])});}return _0x38cddb;});}})[_0x241f('0x35')](respondWithResult(_0x1cf5d9,null))['catch'](handleError(_0x1cf5d9,null));};exports[_0x241f('0x133')]=function(_0x188750,_0x23c88e,_0x89099f){return db[_0x241f('0x54')][_0x241f('0x5d')]({'where':{'id':_0x188750[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x23c88e,null))[_0x241f('0x35')](function(_0xb557e8){if(_0xb557e8){return _0xb557e8['removeAgents'](_0x188750[_0x241f('0x44')][_0x241f('0x6c')])[_0x241f('0x35')](function(){if(_[_0x241f('0x134')](_0x188750[_0x241f('0x44')][_0x241f('0x6c')])){for(var _0x45ef2e=0x0;_0x45ef2e<_0x188750['query']['ids'][_0x241f('0x58')];_0x45ef2e+=0x1){socket[_0x241f('0x132')](_0x241f('0x135'),{'UserId':Number(_0x188750[_0x241f('0x44')][_0x241f('0x6c')][_0x45ef2e]),'ChatWebsiteId':Number(_0x188750['params']['id'])});}}else{socket[_0x241f('0x132')](_0x241f('0x135'),{'UserId':Number(_0x188750[_0x241f('0x44')][_0x241f('0x6c')]),'ChatWebsiteId':Number(_0x188750[_0x241f('0x62')]['id'])});}});}})[_0x241f('0x35')](respondWithStatusCode(_0x23c88e,null))[_0x241f('0x29')](handleError(_0x23c88e,null));};exports[_0x241f('0x136')]=function(_0x28db6a,_0x4aa358,_0x40ef9a){var _0x487391={};var _0x55782e={};var _0x258c8c;var _0xb247ed;return db['ChatWebsite']['findOne']({'where':{'id':_0x28db6a[_0x241f('0x62')]['id']}})[_0x241f('0x35')](handleEntityNotFound(_0x4aa358,null))['then'](function(_0x541cdc){if(_0x541cdc){_0x258c8c=_0x541cdc;_0x55782e[_0x241f('0x42')]=_[_0x241f('0x57')](db[_0x241f('0xc6')][_0x241f('0x3f')]);_0x55782e[_0x241f('0x44')]=_['keys'](_0x28db6a[_0x241f('0x44')]);_0x55782e[_0x241f('0x45')]=_[_0x241f('0x46')](_0x55782e[_0x241f('0x42')],_0x55782e[_0x241f('0x44')]);_0x487391[_0x241f('0x47')]=_['intersection'](_0x55782e[_0x241f('0x42')],qs[_0x241f('0x48')](_0x28db6a[_0x241f('0x44')][_0x241f('0x48')]));_0x487391[_0x241f('0x47')]=_0x487391[_0x241f('0x47')][_0x241f('0x58')]?_0x487391['attributes']:_0x55782e[_0x241f('0x42')];_0x487391[_0x241f('0x69')]=qs[_0x241f('0x4b')](_0x28db6a[_0x241f('0x44')][_0x241f('0x4b')]);_0x487391[_0x241f('0x4e')]=qs[_0x241f('0x45')](_['pick'](_0x28db6a[_0x241f('0x44')],_0x55782e[_0x241f('0x45')]));if(_0x28db6a['query']['filter']){_0x487391['where']=_[_0x241f('0x4f')](_0x487391['where'],{'$or':_[_0x241f('0x43')](_0x487391[_0x241f('0x47')],function(_0x5a5374){var _0x35ddfe={};_0x35ddfe[_0x5a5374]={'$like':'%'+_0x28db6a[_0x241f('0x44')][_0x241f('0x4d')]+'%'};return _0x35ddfe;})});}_0x487391=_[_0x241f('0x4f')]({},_0x487391,_0x28db6a[_0x241f('0x51')]);return _0x258c8c[_0x241f('0x136')](_0x487391);}})['then'](function(_0x95c028){if(_0x95c028){_0xb247ed=_0x95c028[_0x241f('0x58')];if(!_0x28db6a[_0x241f('0x44')][_0x241f('0x49')](_0x241f('0x4a'))){_0x487391['limit']=qs[_0x241f('0x2e')](_0x28db6a['query'][_0x241f('0x2e')]);_0x487391[_0x241f('0x2c')]=qs['offset'](_0x28db6a[_0x241f('0x44')]['offset']);}return _0x258c8c[_0x241f('0x136')](_0x487391);}})['then'](function(_0x460e58){if(_0x460e58){return _0x460e58?{'count':_0xb247ed,'rows':_0x460e58}:null;}})[_0x241f('0x35')](respondWithResult(_0x4aa358,null))[_0x241f('0x29')](handleError(_0x4aa358,null));};
\ No newline at end of file
+var _0x108e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','sort','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sitepic','filename','agentAvatar','addCustomerAvatar','customerAvatar','file','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','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','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','Applications','account','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','referer','browser','version','unknown','%s\x20%s','device','format','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','applications','push','unmanaged','ChatMessage','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','subjectOffline','mapValues','lastName','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','files','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','chatLicenseExceeded','all','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','color_button','addApplications','transaction','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','get','ChatWebsites','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','where','pick','filter','merge','type','options','includeAll','include','ChatWebsite','findAll','rows','catch','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x108e,0xd1));var _0xe108=function(_0x51b1a8,_0xe1e127){_0x51b1a8=_0x51b1a8-0x0;var _0x4379a8=_0x108e[_0x51b1a8];return _0x4379a8;};'use strict';var emlformat=require(_0xe108('0x0'));var rimraf=require(_0xe108('0x1'));var zipdir=require(_0xe108('0x2'));var jsonpatch=require(_0xe108('0x3'));var rp=require(_0xe108('0x4'));var moment=require(_0xe108('0x5'));var BPromise=require(_0xe108('0x6'));var Mustache=require(_0xe108('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe108('0x8'));var csv=require('to-csv');var ejs=require(_0xe108('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe108('0xa'));var squel=require('squel');var crypto=require(_0xe108('0xb'));var jsforce=require(_0xe108('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe108('0xd'));var querystring=require(_0xe108('0xe'));var Papa=require(_0xe108('0xf'));var Redis=require(_0xe108('0x10'));var authService=require(_0xe108('0x11'));var qs=require(_0xe108('0x12'));var as=require(_0xe108('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe108('0x14'));var utils=require(_0xe108('0x15'));var config=require(_0xe108('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe108('0x17'))['db'];config[_0xe108('0x18')]=_[_0xe108('0x19')](config[_0xe108('0x18')],{'host':_0xe108('0x1a'),'port':0x18eb});var socket=require(_0xe108('0x1b'))(new Redis(config[_0xe108('0x18')]));require(_0xe108('0x1c'))[_0xe108('0x1d')](socket);var jayson=require(_0xe108('0x1e'));var client=jayson[_0xe108('0x1f')][_0xe108('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xe108('0x20')]({'port':0x232a});var client9003=jayson[_0xe108('0x1f')][_0xe108('0x20')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x53e7f4,_0x8d15f1,_0x2755c8,_0x520d72){return new BPromise(function(_0x4c6cf3,_0x3619f1){var _0x22a394=_0x520d72||client;return _0x22a394[_0xe108('0x21')](_0x53e7f4,_0x2755c8)[_0xe108('0x22')](function(_0x87143f){logger[_0xe108('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x8d15f1,'request\x20sent');logger['debug'](_0xe108('0x24'),_0x8d15f1,_0xe108('0x25'),JSON[_0xe108('0x26')](_0x87143f));if(_0x87143f[_0xe108('0x27')]){if(_0x87143f[_0xe108('0x27')][_0xe108('0x28')]===0x1f4){logger[_0xe108('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x8d15f1,_0x87143f[_0xe108('0x27')][_0xe108('0x29')]);return _0x3619f1(_0x87143f[_0xe108('0x27')][_0xe108('0x29')]);}logger[_0xe108('0x27')](_0xe108('0x2a'),_0x8d15f1,_0x87143f['error'][_0xe108('0x29')]);return _0x4c6cf3(_0x87143f[_0xe108('0x27')][_0xe108('0x29')]);}else{logger['info'](_0xe108('0x2a'),_0x8d15f1,_0xe108('0x25'));_0x4c6cf3(_0x87143f[_0xe108('0x2b')][_0xe108('0x29')]);}})['catch'](function(_0xc5aab){logger[_0xe108('0x27')](_0xe108('0x2a'),_0x8d15f1,_0xc5aab);_0x3619f1(_0xc5aab);});});}function respondWithStatusCode(_0x4196bb,_0x1d9733){_0x1d9733=_0x1d9733||0xcc;return function(_0x6d63b1){if(_0x6d63b1){return _0x4196bb['sendStatus'](_0x1d9733);}return _0x4196bb[_0xe108('0x2c')](_0x1d9733)['end']();};}function respondWithResult(_0x3a09e6,_0x5262a5){_0x5262a5=_0x5262a5||0xc8;return function(_0x3daa01){if(_0x3daa01){return _0x3a09e6[_0xe108('0x2c')](_0x5262a5)[_0xe108('0x2d')](_0x3daa01);}};}function respondWithFilteredResult(_0x39534f,_0x40524d){return function(_0x3c7c78){if(_0x3c7c78){var _0x5a8384=typeof _0x40524d[_0xe108('0x2e')]===_0xe108('0x2f')&&typeof _0x40524d[_0xe108('0x30')]===_0xe108('0x2f');var _0x5a185c=_0x3c7c78['count'];var _0x230cbd=_0x5a8384?0x0:_0x40524d[_0xe108('0x2e')];var _0x37bdc7=_0x5a8384?_0x3c7c78[_0xe108('0x31')]:_0x40524d[_0xe108('0x2e')]+_0x40524d[_0xe108('0x30')];var _0x5b3eea;if(_0x37bdc7>=_0x5a185c){_0x37bdc7=_0x5a185c;_0x5b3eea=0xc8;}else{_0x5b3eea=0xce;}_0x39534f['status'](_0x5b3eea);return _0x39534f[_0xe108('0x32')]('Content-Range',_0x230cbd+'-'+_0x37bdc7+'/'+_0x5a185c)[_0xe108('0x2d')](_0x3c7c78);}return null;};}function patchUpdates(_0x4584f1){return function(_0x1b3357){try{jsonpatch[_0xe108('0x33')](_0x1b3357,_0x4584f1,!![]);}catch(_0x3f3894){return BPromise[_0xe108('0x34')](_0x3f3894);}return _0x1b3357[_0xe108('0x35')]();};}function saveUpdates(_0x349ca1,_0x4d3b01){return function(_0x5afbad){if(_0x5afbad){return _0x5afbad['update'](_0x349ca1)[_0xe108('0x22')](function(_0xbd688){return _0xbd688;});}return null;};}function removeEntity(_0x570424,_0x6bd226){return function(_0x3c6cf7){if(_0x3c6cf7){return _0x3c6cf7[_0xe108('0x36')]()[_0xe108('0x22')](function(){var _0x4d86f3=_0x3c6cf7[_0xe108('0x37')]({'plain':!![]});var _0x3c73c9=_0xe108('0x38');return db['UserProfileResource'][_0xe108('0x36')]({'where':{'type':_0x3c73c9,'resourceId':_0x4d86f3['id']}})[_0xe108('0x22')](function(){return _0x3c6cf7;});})['then'](function(){_0x570424[_0xe108('0x2c')](0xcc)[_0xe108('0x39')]();});}};}function handleEntityNotFound(_0x2807b1,_0x269223){return function(_0x1d5405){if(!_0x1d5405){_0x2807b1[_0xe108('0x3a')](0x194);}return _0x1d5405;};}function handleError(_0x3cf3b4,_0xe68bc1){_0xe68bc1=_0xe68bc1||0x1f4;return function(_0x2d534b){logger[_0xe108('0x27')](_0x2d534b[_0xe108('0x3b')]);if(_0x2d534b[_0xe108('0x3c')]){delete _0x2d534b[_0xe108('0x3c')];}_0x3cf3b4[_0xe108('0x2c')](_0xe68bc1)[_0xe108('0x3d')](_0x2d534b);};}exports[_0xe108('0x3e')]=function(_0x2e6c13,_0x3c1810){var _0x458102={'include':[{'model':db[_0xe108('0x3f')],'as':_0xe108('0x40')}]},_0x52e88c={},_0x5b651c={'count':0x0,'rows':[]};var _0x29127e=_[_0xe108('0x41')](db['ChatWebsite'][_0xe108('0x42')],function(_0x1460c9){return{'name':_0x1460c9[_0xe108('0x43')],'type':_0x1460c9['type'][_0xe108('0x44')]};});_0x52e88c[_0xe108('0x45')]=_[_0xe108('0x41')](_0x29127e,'name');_0x52e88c['query']=_[_0xe108('0x46')](_0x2e6c13['query']);_0x52e88c[_0xe108('0x47')]=_[_0xe108('0x48')](_0x52e88c[_0xe108('0x45')],_0x52e88c[_0xe108('0x49')]);_0x458102[_0xe108('0x4a')]=_[_0xe108('0x48')](_0x52e88c[_0xe108('0x45')],qs[_0xe108('0x4b')](_0x2e6c13['query'][_0xe108('0x4b')]));_0x458102[_0xe108('0x4a')]=_0x458102[_0xe108('0x4a')]['length']?_0x458102['attributes']:_0x52e88c['model'];if(!_0x2e6c13[_0xe108('0x49')]['hasOwnProperty']('nolimit')){_0x458102[_0xe108('0x30')]=qs['limit'](_0x2e6c13[_0xe108('0x49')][_0xe108('0x30')]);_0x458102[_0xe108('0x2e')]=qs['offset'](_0x2e6c13[_0xe108('0x49')][_0xe108('0x2e')]);}_0x458102['order']=qs['sort'](_0x2e6c13['query']['sort']);_0x458102[_0xe108('0x4c')]=qs[_0xe108('0x47')](_[_0xe108('0x4d')](_0x2e6c13[_0xe108('0x49')],_0x52e88c[_0xe108('0x47')]),_0x29127e);if(_0x2e6c13['query'][_0xe108('0x4e')]){_0x458102['where']=_[_0xe108('0x4f')](_0x458102[_0xe108('0x4c')],{'$or':_[_0xe108('0x41')](_0x29127e,function(_0x1b3a0c){if(_0x1b3a0c[_0xe108('0x50')]!=='VIRTUAL'){var _0x21871e={};_0x21871e[_0x1b3a0c[_0xe108('0x3c')]]={'$like':'%'+_0x2e6c13[_0xe108('0x49')][_0xe108('0x4e')]+'%'};return _0x21871e;}})});}_0x458102=_[_0xe108('0x4f')]({},_0x458102,_0x2e6c13[_0xe108('0x51')]);var _0x595efb={'where':_0x458102[_0xe108('0x4c')]};return db['ChatWebsite'][_0xe108('0x31')](_0x595efb)[_0xe108('0x22')](function(_0x1b5602){_0x5b651c[_0xe108('0x31')]=_0x1b5602;if(_0x2e6c13[_0xe108('0x49')][_0xe108('0x52')]){_0x458102[_0xe108('0x53')]=[{'all':!![]}];}return db[_0xe108('0x54')][_0xe108('0x55')](_0x458102);})[_0xe108('0x22')](function(_0x60c4e9){_0x5b651c[_0xe108('0x56')]=_0x60c4e9;return _0x5b651c;})[_0xe108('0x22')](respondWithFilteredResult(_0x3c1810,_0x458102))[_0xe108('0x57')](handleError(_0x3c1810,null));};exports['show']=function(_0x1fcd2a,_0x15ec3d){var _0x33ce82={'raw':![],'where':{'id':_0x1fcd2a['params']['id']},'include':[{'model':db[_0xe108('0x3f')],'as':'mandatoryDispositionPause'}]},_0x457638={};_0x457638[_0xe108('0x45')]=_[_0xe108('0x46')](db['ChatWebsite'][_0xe108('0x42')]);_0x457638['query']=_[_0xe108('0x46')](_0x1fcd2a[_0xe108('0x49')]);_0x457638[_0xe108('0x47')]=_[_0xe108('0x48')](_0x457638[_0xe108('0x45')],_0x457638[_0xe108('0x49')]);_0x33ce82[_0xe108('0x4a')]=_[_0xe108('0x48')](_0x457638[_0xe108('0x45')],qs[_0xe108('0x4b')](_0x1fcd2a['query']['fields']));_0x33ce82[_0xe108('0x4a')]=_0x33ce82['attributes'][_0xe108('0x58')]?_0x33ce82[_0xe108('0x4a')]:_0x457638[_0xe108('0x45')];if(_0x1fcd2a[_0xe108('0x49')]['includeAll']){_0x33ce82[_0xe108('0x53')]=[{'all':!![]}];}_0x33ce82=_[_0xe108('0x4f')]({},_0x33ce82,_0x1fcd2a[_0xe108('0x51')]);return db[_0xe108('0x54')][_0xe108('0x59')](_0x33ce82)['then'](handleEntityNotFound(_0x15ec3d,null))[_0xe108('0x22')](respondWithResult(_0x15ec3d,null))[_0xe108('0x57')](handleError(_0x15ec3d,null));};exports[_0xe108('0x5a')]=function(_0x42f640,_0x393bfa){return db[_0xe108('0x54')][_0xe108('0x5a')](_0x42f640['body'],{})['then'](function(_0x34a681){var _0x4264a1=_0x42f640[_0xe108('0x5b')]['get']({'plain':!![]});if(!_0x4264a1)throw new Error(_0xe108('0x5c'));if(_0x4264a1['role']===_0xe108('0x5b')){var _0x25215d=_0x34a681[_0xe108('0x37')]({'plain':!![]});var _0x5a2b7e=_0xe108('0x38');return db[_0xe108('0x5d')][_0xe108('0x59')]({'where':{'name':_0x5a2b7e,'userProfileId':_0x4264a1['userProfileId']},'raw':!![]})[_0xe108('0x22')](function(_0x165630){if(_0x165630&&_0x165630[_0xe108('0x5e')]===0x0){return db['UserProfileResource'][_0xe108('0x5a')]({'name':_0x25215d[_0xe108('0x3c')],'resourceId':_0x25215d['id'],'type':_0x165630[_0xe108('0x3c')],'sectionId':_0x165630['id']},{})['then'](function(){return _0x34a681;});}else{return _0x34a681;}})[_0xe108('0x57')](function(_0x468a5d){logger[_0xe108('0x27')](_0xe108('0x5f'),_0x468a5d);throw _0x468a5d;});}return _0x34a681;})['then'](respondWithResult(_0x393bfa,0xc9))[_0xe108('0x57')](handleError(_0x393bfa,null));};exports[_0xe108('0x60')]=function(_0x8b5975,_0x590e63){if(_0x8b5975[_0xe108('0x61')]['id']){delete _0x8b5975[_0xe108('0x61')]['id'];}return db['ChatWebsite'][_0xe108('0x59')]({'where':{'id':_0x8b5975[_0xe108('0x62')]['id']},'include':[{'model':db[_0xe108('0x3f')],'as':_0xe108('0x40')}]})[_0xe108('0x22')](handleEntityNotFound(_0x590e63,null))[_0xe108('0x22')](saveUpdates(_0x8b5975[_0xe108('0x61')],null))[_0xe108('0x22')](respondWithResult(_0x590e63,null))[_0xe108('0x57')](handleError(_0x590e63,null));};exports['destroy']=function(_0x2b2778,_0x128d81){return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x2b2778[_0xe108('0x62')]['id']}})['then'](handleEntityNotFound(_0x128d81,null))[_0xe108('0x22')](removeEntity(_0x128d81,null))[_0xe108('0x57')](handleError(_0x128d81,null));};exports[_0xe108('0x63')]=function(_0x2c127f,_0x23c138){return db[_0xe108('0x54')]['describe']()[_0xe108('0x22')](respondWithResult(_0x23c138,null))[_0xe108('0x57')](handleError(_0x23c138,null));};exports[_0xe108('0x64')]=function(_0x2a8b92,_0xcf09d,_0x557686){if(_0x2a8b92[_0xe108('0x61')]['id']){delete _0x2a8b92[_0xe108('0x61')]['id'];}return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x2a8b92[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0xcf09d,null))[_0xe108('0x22')](function(_0x3c4fd3){if(_0x3c4fd3){_0x2a8b92[_0xe108('0x61')][_0xe108('0x65')]=_0x3c4fd3['id'];return db[_0xe108('0x66')][_0xe108('0x5a')](_0x2a8b92[_0xe108('0x61')]);}})['then'](respondWithResult(_0xcf09d,null))[_0xe108('0x57')](handleError(_0xcf09d,null));};exports[_0xe108('0x67')]=function(_0x233579,_0x2e6615,_0x3a549a){var _0x3a55b9={'raw':![],'where':{}};var _0x1caca6={};var _0x26d40e={'count':0x0,'rows':[]};return db[_0xe108('0x54')][_0xe108('0x68')]({'where':{'id':_0x233579[_0xe108('0x62')]['id']}})['then'](handleEntityNotFound(_0x2e6615,null))[_0xe108('0x22')](function(_0x5d4bd6){if(_0x5d4bd6){_0x1caca6[_0xe108('0x45')]=_['keys'](db[_0xe108('0x66')]['rawAttributes']);_0x1caca6[_0xe108('0x49')]=_[_0xe108('0x46')](_0x233579[_0xe108('0x49')]);_0x1caca6[_0xe108('0x47')]=_[_0xe108('0x48')](_0x1caca6['model'],_0x1caca6[_0xe108('0x49')]);_0x3a55b9[_0xe108('0x4a')]=_[_0xe108('0x48')](_0x1caca6[_0xe108('0x45')],qs['fields'](_0x233579[_0xe108('0x49')][_0xe108('0x4b')]));_0x3a55b9['attributes']=_0x3a55b9[_0xe108('0x4a')][_0xe108('0x58')]?_0x3a55b9['attributes']:_0x1caca6['model'];if(!_0x233579[_0xe108('0x49')][_0xe108('0x69')](_0xe108('0x6a'))){_0x3a55b9['limit']=qs[_0xe108('0x30')](_0x233579[_0xe108('0x49')][_0xe108('0x30')]);_0x3a55b9['offset']=qs['offset'](_0x233579[_0xe108('0x49')]['offset']);}_0x3a55b9[_0xe108('0x6b')]=qs['sort'](_0x233579[_0xe108('0x49')][_0xe108('0x6c')]);_0x3a55b9['where']=qs['filters'](_[_0xe108('0x4d')](_0x233579['query'],_0x1caca6[_0xe108('0x47')]));_0x3a55b9[_0xe108('0x4c')][_0xe108('0x65')]=_0x5d4bd6['id'];if(_0x233579[_0xe108('0x49')][_0xe108('0x4e')]){_0x3a55b9[_0xe108('0x4c')]=_[_0xe108('0x4f')](_0x3a55b9['where'],{'$or':_[_0xe108('0x41')](_0x3a55b9[_0xe108('0x4a')],function(_0x5024e9){var _0x5bb5f2={};_0x5bb5f2[_0x5024e9]={'$like':'%'+_0x233579[_0xe108('0x49')]['filter']+'%'};return _0x5bb5f2;})});}_0x3a55b9=_[_0xe108('0x4f')]({},_0x3a55b9,_0x233579[_0xe108('0x51')]);return db[_0xe108('0x66')]['count']({'where':_0x3a55b9[_0xe108('0x4c')]})[_0xe108('0x22')](function(_0x472489){_0x26d40e['count']=_0x472489;if(_0x233579[_0xe108('0x49')][_0xe108('0x52')]){_0x3a55b9['include']=[{'all':!![]}];}return db['Disposition'][_0xe108('0x55')](_0x3a55b9);})['then'](function(_0x2a0102){_0x26d40e['rows']=_0x2a0102;return _0x26d40e;});}})[_0xe108('0x22')](respondWithFilteredResult(_0x2e6615,_0x3a55b9))[_0xe108('0x57')](handleError(_0x2e6615,null));};exports[_0xe108('0x6d')]=function(_0x159941,_0x518c49,_0x4c410c){return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x159941['params']['id']}})['then'](handleEntityNotFound(_0x518c49,null))['then'](function(_0x279b66){if(_0x279b66){return _0x279b66[_0xe108('0x6d')](_0x159941[_0xe108('0x49')][_0xe108('0x6e')]);}})[_0xe108('0x22')](respondWithStatusCode(_0x518c49,null))[_0xe108('0x57')](handleError(_0x518c49,null));};exports[_0xe108('0x6f')]=function(_0x5d42be,_0x1fc90a,_0x564461){if(_0x5d42be[_0xe108('0x61')]['id']){delete _0x5d42be['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x5d42be['params']['id']}})['then'](handleEntityNotFound(_0x1fc90a,null))['then'](function(_0x263b80){if(_0x263b80){_0x5d42be[_0xe108('0x61')]['ChatWebsiteId']=_0x263b80['id'];return db[_0xe108('0x70')][_0xe108('0x5a')](_0x5d42be[_0xe108('0x61')]);}})[_0xe108('0x22')](respondWithResult(_0x1fc90a,null))[_0xe108('0x57')](handleError(_0x1fc90a,null));};exports['getAnswers']=function(_0x4a5fe8,_0x26a4f7,_0x5dc8ad){var _0x452557={'raw':![],'where':{}};var _0x2ae9bc={};var _0x482bbd={'count':0x0,'rows':[]};return db[_0xe108('0x54')][_0xe108('0x68')]({'where':{'id':_0x4a5fe8[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x26a4f7,null))[_0xe108('0x22')](function(_0x1ab958){if(_0x1ab958){_0x2ae9bc['model']=_['keys'](db['CannedAnswer'][_0xe108('0x42')]);_0x2ae9bc[_0xe108('0x49')]=_[_0xe108('0x46')](_0x4a5fe8[_0xe108('0x49')]);_0x2ae9bc['filters']=_[_0xe108('0x48')](_0x2ae9bc['model'],_0x2ae9bc[_0xe108('0x49')]);_0x452557['attributes']=_[_0xe108('0x48')](_0x2ae9bc[_0xe108('0x45')],qs[_0xe108('0x4b')](_0x4a5fe8['query'][_0xe108('0x4b')]));_0x452557[_0xe108('0x4a')]=_0x452557[_0xe108('0x4a')][_0xe108('0x58')]?_0x452557[_0xe108('0x4a')]:_0x2ae9bc[_0xe108('0x45')];if(!_0x4a5fe8[_0xe108('0x49')]['hasOwnProperty'](_0xe108('0x6a'))){_0x452557['limit']=qs['limit'](_0x4a5fe8[_0xe108('0x49')][_0xe108('0x30')]);_0x452557['offset']=qs[_0xe108('0x2e')](_0x4a5fe8[_0xe108('0x49')][_0xe108('0x2e')]);}_0x452557[_0xe108('0x6b')]=qs['sort'](_0x4a5fe8[_0xe108('0x49')][_0xe108('0x6c')]);_0x452557[_0xe108('0x4c')]=qs[_0xe108('0x47')](_['pick'](_0x4a5fe8[_0xe108('0x49')],_0x2ae9bc[_0xe108('0x47')]));_0x452557[_0xe108('0x4c')]['ChatWebsiteId']=_0x1ab958['id'];if(_0x4a5fe8['query'][_0xe108('0x4e')]){_0x452557[_0xe108('0x4c')]=_[_0xe108('0x4f')](_0x452557[_0xe108('0x4c')],{'$or':_[_0xe108('0x41')](_0x452557[_0xe108('0x4a')],function(_0x4e78e9){var _0xe7c143={};_0xe7c143[_0x4e78e9]={'$like':'%'+_0x4a5fe8[_0xe108('0x49')][_0xe108('0x4e')]+'%'};return _0xe7c143;})});}_0x452557=_[_0xe108('0x4f')]({},_0x452557,_0x4a5fe8[_0xe108('0x51')]);return db[_0xe108('0x70')]['count']({'where':_0x452557[_0xe108('0x4c')]})[_0xe108('0x22')](function(_0x5776b3){_0x482bbd[_0xe108('0x31')]=_0x5776b3;if(_0x4a5fe8[_0xe108('0x49')][_0xe108('0x52')]){_0x452557[_0xe108('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe108('0x55')](_0x452557);})[_0xe108('0x22')](function(_0x55005b){_0x482bbd[_0xe108('0x56')]=_0x55005b;return _0x482bbd;});}})[_0xe108('0x22')](respondWithFilteredResult(_0x26a4f7,_0x452557))[_0xe108('0x57')](handleError(_0x26a4f7,null));};exports[_0xe108('0x71')]=function(_0x36e1fd,_0x25c2d7,_0x547aa8){return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x36e1fd['params']['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x25c2d7,null))['then'](function(_0x8fdaa6){if(_0x8fdaa6){return _0x8fdaa6[_0xe108('0x71')](_0x36e1fd[_0xe108('0x49')][_0xe108('0x6e')]);}})[_0xe108('0x22')](respondWithStatusCode(_0x25c2d7,null))['catch'](handleError(_0x25c2d7,null));};exports['addLogo']=function(_0x3383e1,_0xbc1ff4,_0x2947da){_0x3383e1[_0xe108('0x61')][_0xe108('0x72')]=_0x3383e1['file'][_0xe108('0x73')];return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x3383e1[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0xbc1ff4,null))[_0xe108('0x22')](saveUpdates(_0x3383e1[_0xe108('0x61')],null))[_0xe108('0x22')](respondWithResult(_0xbc1ff4,null))['catch'](handleError(_0xbc1ff4,null));};exports['addAvatar']=function(_0x406bd7,_0x3dee8e,_0x27f2cc){_0x406bd7[_0xe108('0x61')][_0xe108('0x74')]=_0x406bd7['file']['filename'];return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x406bd7['params']['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x3dee8e,null))[_0xe108('0x22')](saveUpdates(_0x406bd7['body'],null))[_0xe108('0x22')](respondWithResult(_0x3dee8e,null))['catch'](handleError(_0x3dee8e,null));};exports[_0xe108('0x75')]=function(_0x217569,_0x46932d,_0x5428dc){_0x217569[_0xe108('0x61')][_0xe108('0x76')]=_0x217569[_0xe108('0x77')]['filename'];return db[_0xe108('0x54')]['find']({'where':{'id':_0x217569[_0xe108('0x62')]['id']}})['then'](handleEntityNotFound(_0x46932d,null))[_0xe108('0x22')](saveUpdates(_0x217569[_0xe108('0x61')],null))['then'](respondWithResult(_0x46932d,null))[_0xe108('0x57')](handleError(_0x46932d,null));};exports['addSystemAvatar']=function(_0x31f23c,_0x319011,_0x314cac){_0x31f23c[_0xe108('0x61')][_0xe108('0x78')]=_0x31f23c[_0xe108('0x77')]['filename'];return db[_0xe108('0x54')]['find']({'where':{'id':_0x31f23c[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x319011,null))[_0xe108('0x22')](saveUpdates(_0x31f23c['body'],null))[_0xe108('0x22')](respondWithResult(_0x319011,null))['catch'](handleError(_0x319011,null));};exports[_0xe108('0x79')]=function(_0x17b933,_0x220b03,_0x96344b){var _0x45797e=path[_0xe108('0x7a')](config[_0xe108('0x7b')],_0xe108('0x7c'));var _0x36c86f={'where':{'id':_0x17b933[_0xe108('0x62')]['id']},'attributes':['id',_0xe108('0x72')],'raw':!![]};var _0x4fe5a8=![];return require('../../config/license/util')[_0xe108('0x7d')]()[_0xe108('0x22')](function(_0x67f951){if(_0x67f951){_0x4fe5a8=_0x67f951[_0xe108('0x7e')];}})[_0xe108('0x22')](function(){return db[_0xe108('0x54')][_0xe108('0x59')](_0x36c86f);})[_0xe108('0x22')](handleEntityNotFound(_0x220b03,null))[_0xe108('0x22')](function(_0x4b4d95){if(_0x4b4d95){if(!_[_0xe108('0x7f')](_0x4b4d95['sitepic'])){if(fs[_0xe108('0x80')](path['join'](config[_0xe108('0x7b')],_0xe108('0x81'),_0x4b4d95[_0xe108('0x72')]))&&_0x4fe5a8){_0x45797e=path[_0xe108('0x7a')](config[_0xe108('0x7b')],'server/files/images/logos/',_0x4b4d95[_0xe108('0x72')]);}}return _0x220b03[_0xe108('0x82')](_0x45797e);}})['catch'](handleError(_0x220b03,null));};exports[_0xe108('0x83')]=function(_0xc1275f,_0x3efc2f,_0x1fb2cc){var _0x4f5d6c=path[_0xe108('0x7a')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x4d6f62={'where':{'id':_0xc1275f['params']['id']},'attributes':['id',_0xe108('0x74')],'raw':!![]};return db[_0xe108('0x54')][_0xe108('0x59')](_0x4d6f62)[_0xe108('0x22')](handleEntityNotFound(_0x3efc2f,null))[_0xe108('0x22')](function(_0x25f339){if(_0x25f339){if(!_[_0xe108('0x7f')](_0x25f339[_0xe108('0x74')])){if(fs[_0xe108('0x80')](path['join'](config['root'],_0xe108('0x84'),_0x25f339[_0xe108('0x74')]))){_0x4f5d6c=path['join'](config[_0xe108('0x7b')],_0xe108('0x84'),_0x25f339['agentAvatar']);}}return _0x3efc2f[_0xe108('0x82')](_0x4f5d6c);}})[_0xe108('0x57')](handleError(_0x3efc2f,null));};exports[_0xe108('0x85')]=function(_0x3dc8ca,_0x5d637a,_0x6a8bc){var _0x31b1e7=path['join'](config[_0xe108('0x7b')],_0xe108('0x86'));var _0x28fc0a={'where':{'id':_0x3dc8ca[_0xe108('0x62')]['id']},'attributes':['id',_0xe108('0x76'),'showCustomerAvatar'],'raw':!![]};return db[_0xe108('0x54')][_0xe108('0x59')](_0x28fc0a)[_0xe108('0x22')](handleEntityNotFound(_0x5d637a,null))[_0xe108('0x22')](function(_0x5ccef4){if(_0x5ccef4){if(!_[_0xe108('0x7f')](_0x5ccef4[_0xe108('0x76')])){if(fs['existsSync'](path[_0xe108('0x7a')](config[_0xe108('0x7b')],'server/files/images/avatars/',_0x5ccef4['customerAvatar']))&&_0x5ccef4[_0xe108('0x87')]){_0x31b1e7=path['join'](config[_0xe108('0x7b')],'server/files/images/avatars/',_0x5ccef4[_0xe108('0x76')]);}}return _0x5d637a[_0xe108('0x82')](_0x31b1e7);}})[_0xe108('0x57')](handleError(_0x5d637a,null));};exports[_0xe108('0x88')]=function(_0xa4352a,_0x4099c3,_0x542de5){var _0x311292=path['join'](config[_0xe108('0x7b')],_0xe108('0x89'));var _0x3ec869={'where':{'id':_0xa4352a[_0xe108('0x62')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe108('0x54')][_0xe108('0x59')](_0x3ec869)[_0xe108('0x22')](handleEntityNotFound(_0x4099c3,null))['then'](function(_0x567357){if(_0x567357){if(!_[_0xe108('0x7f')](_0x567357[_0xe108('0x78')])){if(fs[_0xe108('0x80')](path['join'](config[_0xe108('0x7b')],_0xe108('0x84'),_0x567357[_0xe108('0x78')]))){_0x311292=path[_0xe108('0x7a')](config['root'],_0xe108('0x84'),_0x567357[_0xe108('0x78')]);}}return _0x4099c3[_0xe108('0x82')](_0x311292);}})['catch'](handleError(_0x4099c3,null));};exports[_0xe108('0x8a')]=function(_0x3e22f9,_0x10809e,_0x185378){var _0x24d112=require(_0xe108('0x8b'));var _0x1ff3da=new _0x24d112();var _0x23ec1b=_0x1ff3da[_0xe108('0x8c')](_0x3e22f9[_0xe108('0x8d')][_0xe108('0x8e')])[_0xe108('0x8f')]();var _0x21ebd8={'body':_0x3e22f9[_0xe108('0x61')],'channel':_0xe108('0x90')};var _0x280d89=[];var _0x400b47=[];var _0x2c62d7={};var _0x49ddac=![];return db[_0xe108('0x91')][_0xe108('0x63')]()[_0xe108('0x22')](function(_0x4b28a0){if(!_0x4b28a0){throw new db[(_0xe108('0x92'))][(_0xe108('0x93'))]('no\x20available\x20attributes');}_0x280d89=_[_0xe108('0x94')](_['keys'](_0x4b28a0),[_0xe108('0x95'),_0xe108('0x96')]);_0x400b47=_['difference'](_['keys'](_0x4b28a0),[_0xe108('0x95'),_0xe108('0x96'),_0xe108('0x97'),'ListId']);if(_0x3e22f9[_0xe108('0x61')]['id']){delete _0x3e22f9[_0xe108('0x61')]['id'];}if(_[_0xe108('0x7f')](_0x3e22f9['body'][_0xe108('0x98')])){throw new db[(_0xe108('0x92'))]['ValidationError'](_0xe108('0x99'));}if(_['isNil'](_0x3e22f9[_0xe108('0x61')][_0xe108('0x61')])||_0x3e22f9['body'][_0xe108('0x61')]===''){throw new db['Sequelize'][(_0xe108('0x93'))](_0xe108('0x9a'));}if(_['isNil'](_0x3e22f9[_0xe108('0x61')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xe108('0x9b')+_0x400b47);}if(!_[_0xe108('0x9c')](_0x400b47,_0x3e22f9[_0xe108('0x61')]['mapKey'])){throw new db['Sequelize'][(_0xe108('0x93'))](_0xe108('0x9d')+_0x400b47);}_0x2c62d7[_0x3e22f9[_0xe108('0x61')][_0xe108('0x9e')]]=_0x3e22f9[_0xe108('0x61')]['from'];})[_0xe108('0x22')](function(){return db[_0xe108('0x54')]['find']({'where':{'id':_0x3e22f9[_0xe108('0x62')]['id']},'include':[{'model':db[_0xe108('0x9f')],'as':_0xe108('0xa0'),'include':[{'model':db[_0xe108('0x91')],'as':_0xe108('0xa1'),'where':_0x2c62d7,'limit':0x1,'order':[[_0xe108('0x96'),_0xe108('0xa2')]]}]},{'model':db['ChatApplication'],'as':_0xe108('0xa3')}]});})[_0xe108('0x22')](handleEntityNotFound(_0x10809e,null))[_0xe108('0x22')](function(_0x44975f){if(_0x44975f&&_0x44975f[_0xe108('0xa0')]){_0x21ebd8[_0xe108('0xa4')]=_0x44975f;_0x21ebd8['applications']=_0x44975f[_0xe108('0xa3')];_0x21ebd8['list']=_0x44975f['List'];_0x21ebd8['applications']=_[_0xe108('0xa5')](_0x21ebd8['applications'],['priority'],[_0xe108('0xa6')]);if(_0x21ebd8[_0xe108('0xa4')][_0xe108('0xa3')]){delete _0x21ebd8[_0xe108('0xa4')]['Applications'];}if(_0x21ebd8[_0xe108('0xa4')][_0xe108('0xa0')]&&_0x21ebd8[_0xe108('0xa4')][_0xe108('0xa0')][_0xe108('0xa1')][_0xe108('0x58')]){return _0x21ebd8[_0xe108('0xa4')][_0xe108('0xa0')][_0xe108('0xa1')][0x0];}var _0x5a9725=_[_0xe108('0x19')](_0x3e22f9[_0xe108('0x61')],{'firstName':_0x3e22f9[_0xe108('0x61')][_0xe108('0x98')],'ListId':_0x44975f['ListId']});_0x5a9725[_0x3e22f9[_0xe108('0x61')]['mapKey']]=_0x3e22f9[_0xe108('0x61')][_0xe108('0x98')];return db['CmContact']['create'](_0x5a9725,{'fields':_0x280d89,'raw':!![]});}})[_0xe108('0x22')](handleEntityNotFound(_0x10809e,null))['then'](function(_0xc7d5f3){_0x21ebd8[_0xe108('0xa7')]=_0xc7d5f3;var _0x3470c6=_0x3e22f9[_0xe108('0x61')][_0xe108('0xa8')];if(_0x3e22f9['headers'][_0xe108('0xa9')]){_0x3470c6=_0x3e22f9[_0xe108('0x8d')][_0xe108('0xa9')];}else if(_0x3e22f9[_0xe108('0x8d')][_0xe108('0xaa')]){_0x3470c6=_[_0xe108('0xab')](_0x3e22f9[_0xe108('0x8d')]['x-forwarded-for'][_0xe108('0xac')](','));}if(_0xc7d5f3){var _0x13619e={'ContactId':_0xc7d5f3['id'],'ChatWebsiteId':_0x3e22f9['params']['id'],'from':(_0xc7d5f3[_0xe108('0xad')]||'')+'\x20'+(_0xc7d5f3['lastName']||''),'customerIp':_0x3470c6,'customerPort':_0x3e22f9[_0xe108('0x8d')]['x-real-port']?_0x3e22f9['headers']['x-real-port']:null,'referer':_0x3e22f9[_0xe108('0x61')][_0xe108('0xae')],'browserName':_0x23ec1b[_0xe108('0xaf')][_0xe108('0x3c')]&&_0x23ec1b[_0xe108('0xaf')][_0xe108('0xb0')]?util['format']('%s\x20%s',_0x23ec1b['browser']['name'],_0x23ec1b[_0xe108('0xaf')][_0xe108('0xb0')]):_0xe108('0xb1'),'browserVersion':_0x23ec1b[_0xe108('0xaf')][_0xe108('0xb0')]||'unknown','osName':util['format'](_0xe108('0xb2'),_0x23ec1b['os'][_0xe108('0x3c')],_0x23ec1b['os'][_0xe108('0xb0')]),'osVersion':_0x23ec1b['os']['version'],'deviceModel':_0x23ec1b['device']['model']&&_0x23ec1b[_0xe108('0xb3')]['vendor']?util[_0xe108('0xb4')]('%s\x20%s\x20%s',_0x23ec1b[_0xe108('0xb3')][_0xe108('0x45')],_0x23ec1b[_0xe108('0xb3')]['vendor'],_0x23ec1b[_0xe108('0xb3')]['type']):null,'deviceVendor':_0x23ec1b[_0xe108('0xb3')][_0xe108('0xb5')],'deviceType':_0x23ec1b[_0xe108('0xb3')][_0xe108('0x50')],'formData':JSON[_0xe108('0x26')](_0x3e22f9[_0xe108('0x61')])};var _0x2e411c={'ChatWebsiteId':_0x3e22f9['params']['id'],'closed':![]};if(_0x3e22f9[_0xe108('0x61')][_0xe108('0xb6')]){_0x2e411c[_0xe108('0xb6')]=_0x3e22f9[_0xe108('0x61')][_0xe108('0xb6')];return db[_0xe108('0xb7')]['find']({'where':_0x2e411c})[_0xe108('0x22')](function(_0x1b303b){if(_0x1b303b){return[_0x1b303b,![]];}_0x13619e[_0xe108('0xb6')]=_0x3e22f9[_0xe108('0x61')][_0xe108('0xb6')];_0x13619e[_0xe108('0xb8')]=_0x3e22f9[_0xe108('0x61')][_0xe108('0xb8')];return db[_0xe108('0xb7')][_0xe108('0x5a')](_0x13619e)[_0xe108('0x22')](function(_0x4b1539){return[_0x4b1539,!![]];});});}_0x2e411c[_0xe108('0xb9')]=_0xc7d5f3['id'];if(_0x3e22f9[_0xe108('0x61')][_0xe108('0xba')]&&_0x3e22f9[_0xe108('0x61')][_0xe108('0xba')]['id']){_0x2e411c['id']=_0x3e22f9[_0xe108('0x61')][_0xe108('0xba')]['id'];return db['ChatInteraction'][_0xe108('0x59')]({'where':_0x2e411c})['then'](function(_0x157358){if(_0x157358){return[_0x157358,![]];}return db[_0xe108('0xb7')][_0xe108('0x5a')](_0x13619e)[_0xe108('0x22')](function(_0x13f943){return[_0x13f943,!![]];});});}return db[_0xe108('0xb7')][_0xe108('0x5a')](_0x13619e)[_0xe108('0x22')](function(_0x6aa08a){return[_0x6aa08a,!![]];});}})[_0xe108('0xbb')](function(_0x1cb3a3,_0x469c5f){if(_0x1cb3a3){_0x49ddac=_0x469c5f;if(!_0x469c5f){var _0x8aa8e6={'from':(_0x21ebd8[_0xe108('0xa7')]['firstName']||'')+'\x20'+(_0x21ebd8['contact']['lastName']||'')};if(_0x3e22f9[_0xe108('0x61')][_0xe108('0xb6')]&&_0x3e22f9['body'][_0xe108('0xbc')]&&_0x3e22f9['body'][_0xe108('0xb6')]!=_0x3e22f9['body'][_0xe108('0xbc')]){_0x8aa8e6[_0xe108('0xb6')]=_0x3e22f9[_0xe108('0x61')][_0xe108('0xbc')];}return _0x1cb3a3['update'](_0x8aa8e6);}else{return _0x1cb3a3;}}})[_0xe108('0x22')](function(_0x5c26ee){_0x21ebd8[_0xe108('0xba')]=_0x5c26ee['get']({'plain':!![]});_0x21ebd8['interaction'][_0xe108('0xbd')]=_0x49ddac;if(_0x21ebd8[_0xe108('0xba')][_0xe108('0xbd')]){if(_0x21ebd8[_0xe108('0xa4')][_0xe108('0xbe')]){_0x21ebd8[_0xe108('0xbf')][_0xe108('0xc0')]({'id':0x0,'priority':_0x21ebd8[_0xe108('0xbf')][_0xe108('0x58')]+0x1,'app':'close','appdata':_0xe108('0xc1'),'interval':'*,*,*,*'});}}return db[_0xe108('0xc2')][_0xe108('0x5a')]({'body':_0x3e22f9['body'][_0xe108('0x61')],'ChatWebsiteId':_0x3e22f9[_0xe108('0x62')]['id'],'ChatInteractionId':_0x5c26ee['id'],'direction':'in','ContactId':_0x21ebd8[_0xe108('0xa7')]['id'],'AttachmentId':_0x3e22f9[_0xe108('0x61')]['AttachmentId']});})[_0xe108('0x22')](function(_0x556dbe){_0x21ebd8[_0xe108('0x29')]=_0x556dbe;if(_0x21ebd8['interaction']['UserId']){return db[_0xe108('0xc3')][_0xe108('0x59')]({'attributes':['id',_0xe108('0x3c')],'where':{'id':_0x21ebd8[_0xe108('0xba')]['UserId']}})['then'](function(_0x38b230){if(_0x38b230){_0x21ebd8[_0xe108('0xbf')][_0xe108('0xc4')]({'id':0x0,'priority':0x0,'app':_0xe108('0xc5'),'appdata':_0x38b230[_0xe108('0x3c')]+','+(_0x21ebd8[_0xe108('0xa4')]['waitForTheAssignedAgent']||0xa),'interval':_0xe108('0xc6')});_0x21ebd8[_0xe108('0xc7')]=!![];}return respondWithRpcPromise(_0xe108('0xc8'),_0xe108('0xc9'),_0x21ebd8);});}return respondWithRpcPromise(_0xe108('0xc8'),_0xe108('0xc9'),_0x21ebd8);})[_0xe108('0x22')](function(_0x52cac4){respondWithRpcPromise(_0xe108('0xca'),_0xe108('0xca'),{'event':_0xe108('0x8a'),'message':_0x52cac4},client9002);return _0x52cac4;})['then'](respondWithResult(_0x10809e,null))[_0xe108('0x57')](handleError(_0x10809e,null));};exports[_0xe108('0xcb')]=function(_0x147b4d,_0x1e8e1c,_0x4810e3){var _0x2b2cff,_0x4ce14d,_0x118e7c;var _0x6e58bc=[];var _0xc50fd4=[];var _0x519b04={};var _0x5e1dc1=_0x147b4d['files']||[];var _0x2a4ec6=[];var _0x40ef03;return db[_0xe108('0x91')][_0xe108('0x63')]()['then'](function(_0x25765a){if(!_0x25765a){throw new db[(_0xe108('0x92'))]['ValidationError']('no\x20available\x20attributes');}_0xc50fd4=_[_0xe108('0x94')](_[_0xe108('0x46')](_0x25765a),[_0xe108('0x95'),'updatedAt']);_0x6e58bc=_[_0xe108('0x94')](_[_0xe108('0x46')](_0x25765a),[_0xe108('0x95'),_0xe108('0x96'),_0xe108('0x97'),'ListId']);if(_0x147b4d[_0xe108('0x61')]['id']){delete _0x147b4d[_0xe108('0x61')]['id'];}if(_['isNil'](_0x147b4d[_0xe108('0x61')][_0xe108('0x98')])){throw _0x1e8e1c[_0xe108('0x2c')](0x1f4)[_0xe108('0x3d')](new db[(_0xe108('0x92'))]['ValidationError'](_0xe108('0x99')));}if(_[_0xe108('0x7f')](_0x147b4d[_0xe108('0x61')][_0xe108('0x61')])||_0x147b4d[_0xe108('0x61')][_0xe108('0x61')]===''){throw _0x1e8e1c['status'](0x1f4)['send'](new db[(_0xe108('0x92'))][(_0xe108('0x93'))](_0xe108('0x9a')));}if(_['isNil'](_0x147b4d[_0xe108('0x61')][_0xe108('0xcc')])){throw _0x1e8e1c[_0xe108('0x2c')](0x1f4)[_0xe108('0x3d')](new db[(_0xe108('0x92'))][(_0xe108('0x93'))](_0xe108('0xcd')+_0x6e58bc));}if(!_[_0xe108('0x9c')](_0x6e58bc,_0x147b4d[_0xe108('0x61')]['mapKeyOffline'])){throw _0x1e8e1c[_0xe108('0x2c')](0x1f4)[_0xe108('0x3d')](new db['Sequelize'][(_0xe108('0x93'))](_0xe108('0xce')+_0x6e58bc));}_0x519b04[_0x147b4d[_0xe108('0x61')][_0xe108('0xcc')]]=_0x147b4d[_0xe108('0x61')][_0xe108('0x98')];})[_0xe108('0x22')](function(){return db[_0xe108('0x54')]['find']({'where':{'id':_0x147b4d[_0xe108('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0xe108('0xa0')},{'model':db[_0xe108('0xcf')],'as':_0xe108('0xcf')}]});})['then'](handleEntityNotFound(_0x1e8e1c,null))['then'](function(_0x1ab5cd){if(_0x1ab5cd&&_0x1ab5cd[_0xe108('0xa0')]){_0x4ce14d=_0x1ab5cd;var _0x3ba92b=_['defaults'](_0x147b4d[_0xe108('0x61')],{'firstName':_0x147b4d[_0xe108('0x61')][_0xe108('0x98')],'phone':_0x147b4d['body'][_0xe108('0x98')],'ListId':_0x1ab5cd['ListId']});_0x3ba92b[_0x147b4d[_0xe108('0x61')][_0xe108('0xcc')]]=_0x147b4d[_0xe108('0x61')]['from'];return db[_0xe108('0x91')]['findOrCreate']({'where':_0x519b04,'defaults':_0x3ba92b});}})[_0xe108('0xbb')](function(_0x47fd7e){if(_0x47fd7e){_0x118e7c=_0x47fd7e;var _0x59b44c=fs[_0xe108('0xd0')](path['join'](config[_0xe108('0x7b')],_0xe108('0xd1')),_0xe108('0xd2'));var _0x37b031=ejs[_0xe108('0xd3')](_0x59b44c,{'body':_[_0xe108('0xd4')](_0x147b4d[_0xe108('0x61')]['body']),'bodyTitle':_0x4ce14d[_0xe108('0xd5')]});return db['ChatOfflineMessage']['create']({'body':_0x37b031,'ContactId':_0x47fd7e['id'],'ChatWebsiteId':_0x4ce14d['id']});}})[_0xe108('0x22')](function(_0xb0de9f){_0x40ef03=_0xb0de9f;if(_0x5e1dc1[_0xe108('0x58')]){var _0x12b951=_0x5e1dc1[_0xe108('0x41')](function(_0x498d73){return{'name':_0x498d73[_0xe108('0xd6')],'basename':_0x498d73['filename'],'type':_0x498d73[_0xe108('0xd7')],'ChatOfflineMessageId':_0xb0de9f['id']};});_0x2a4ec6=_0x12b951['map'](_0x39fa2c=>{var _0xd8ff24={'filename':_0x39fa2c[_0xe108('0x3c')],'path':path[_0xe108('0x7a')](config[_0xe108('0x7b')],_0xe108('0xd8'),'files',_0xe108('0xd9'),'offline-chat',_0x39fa2c[_0xe108('0xda')])};return _0xd8ff24;});if(!_0x4ce14d['openNewInteraction']){return db[_0xe108('0xdb')]['transaction'](function(_0x3aa244){return db[_0xe108('0xdc')][_0xe108('0xdd')](_0x12b951,{'transaction':_0x3aa244});});}}})[_0xe108('0x22')](function(){if(_0x40ef03){_0x2b2cff=_0x40ef03;return db['MailAccount'][_0xe108('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xe108('0xde')],'as':'Smtp','raw':!![]}]});}})[_0xe108('0x22')](function(_0x19f8cb){if(_0x19f8cb&&_0x19f8cb[_0xe108('0xdf')]&&_0x4ce14d['forwardOffline']&&_0x4ce14d[_0xe108('0xe0')]){var _0x169666={'tls':{'rejectUnauthorized':![]}};if(_0x19f8cb['Smtp']['service']){_0x169666[_0xe108('0xe1')]=_0x19f8cb[_0xe108('0xdf')][_0xe108('0xe1')];}else{_0x169666[_0xe108('0xe2')]=_0x19f8cb[_0xe108('0xdf')][_0xe108('0xe2')];_0x169666[_0xe108('0xe3')]=_0x19f8cb[_0xe108('0xdf')][_0xe108('0xe3')];_0x169666[_0xe108('0xe4')]=_0x19f8cb[_0xe108('0xdf')]['secure'];}if(_0x19f8cb[_0xe108('0xdf')]['authentication']){_0x169666[_0xe108('0xe5')]={'user':_0x19f8cb['Smtp'][_0xe108('0x5b')],'pass':_0x19f8cb[_0xe108('0xdf')][_0xe108('0xe6')]};}return respondWithRpcPromise(_0xe108('0xe7'),'sendMail',{'account':_0x169666,'message':{'from':util[_0xe108('0xb4')](_0xe108('0xe8'),_0x19f8cb[_0xe108('0x3c')],_0x19f8cb[_0xe108('0xe9')]||_0x19f8cb[_0xe108('0xdf')]['user']),'to':_0x4ce14d[_0xe108('0xe0')],'subject':_0x4ce14d['offlineMessageSubject'],'html':_0x2b2cff[_0xe108('0x61')],'attachments':_0x2a4ec6}},client9003)[_0xe108('0x22')](function(){return _0x2b2cff;})[_0xe108('0x57')](function(_0x5b9bd8){console[_0xe108('0x27')](_0x5b9bd8);});}})[_0xe108('0x22')](function(){if(_0x4ce14d&&_0x4ce14d[_0xe108('0xea')]&&_0x4ce14d['MailAccountId']){var _0x3bca92=[];if(_0x5e1dc1[_0xe108('0x58')]){_0x3bca92=_0x5e1dc1[_0xe108('0x41')](function(_0x1133e1){return{'name':_0x1133e1[_0xe108('0xd6')],'basename':_0x1133e1[_0xe108('0x73')],'type':_0x1133e1[_0xe108('0xd7')],'ChatOfflineMessageId':_0x40ef03['id']};});}var _0x514616;if(!_['isNil'](_0x4ce14d[_0xe108('0xeb')])){var _0x3eccc9=_[_0xe108('0x41')](_0x147b4d[_0xe108('0x61')],function(_0xb538da){return _0xb538da;});var _0x592d43=_['toPairsIn'](_0x3eccc9)[0x0];var _0x59025b=_[_0xe108('0xec')](_0x592d43,function(_0x4613fe){return _0x4613fe;});_0x514616=_0x59025b[0x1][_0x4ce14d[_0xe108('0xeb')]];}var _0x264a92={'from':_0x118e7c[_0xe108('0xe9')],'firstName':_0x118e7c[_0xe108('0xad')],'lastName':_0x118e7c[_0xe108('0xed')],'mapKey':_0xe108('0xe9'),'message':{'from':_0x118e7c['email'],'to':_0x4ce14d[_0xe108('0xcf')]['email'],'cc':'','subject':_['isNil'](_0x514616)?_0x4ce14d[_0xe108('0xee')]:_0x514616,'messageId':'','sentAt':new Date(),'attach':_0x3bca92[_0xe108('0x58')],'attachments':_0x3bca92,'originChannel':_0xe108('0xef'),'ChatWebsiteId':_0x4ce14d['id'],'ChatOfflineMessageId':_0x2b2cff['id'],'originTo':_0x4ce14d[_0xe108('0xcf')]['email']},'body':_0x2b2cff[_0xe108('0x61')]};var _0x122c40={'account':{'id':_0x4ce14d[_0xe108('0xf0')]},'body':_0x264a92,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xe108('0xf1'),'notifyMail',_0x122c40,client9001)[_0xe108('0x22')](function(){return _0x2b2cff;})[_0xe108('0x57')](function(_0x266283){console[_0xe108('0x27')](_0x266283);});}return;})[_0xe108('0x22')](function(){if(_0x2b2cff){return _0x2b2cff;}})[_0xe108('0x22')](respondWithResult(_0x1e8e1c,null))[_0xe108('0x57')](function(_0x42692d){console[_0xe108('0x27')](_0xe108('0x57'),_0x42692d);for(var _0x5d552a of _0x5e1dc1){var _0x298578=path[_0xe108('0x7a')](config['root'],_0xe108('0xd8'),_0xe108('0xf2'),_0xe108('0xd9'),_0xe108('0xf3'),_0x5d552a[_0xe108('0x73')]);fs_extra['remove'](_0x298578)[_0xe108('0x57')](function(_0x57ec38){console[_0xe108('0x27')](_0xe108('0xf4'),_0x298578,_0x57ec38);});}});};exports[_0xe108('0xf5')]=function(_0x2388c8,_0x2d06df,_0x2ce91e){return db[_0xe108('0xb7')][_0xe108('0x59')]({'where':{'id':_0x2388c8[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x2d06df,null))[_0xe108('0x22')](function(_0x2c6215){if(_0x2c6215){return _0x2c6215['addInteraction'](_0x2388c8[_0xe108('0x61')][_0xe108('0x6e')],_['omit'](_0x2388c8['body'],['ids','id'])||{});}})[_0xe108('0x22')](respondWithResult(_0x2d06df,null))['catch'](handleError(_0x2d06df,null));};exports['getInteractions']=function(_0x2cd0c3,_0x2f89da,_0x211ef4){var _0x3b8539={'raw':![],'where':{}};var _0xe17042={};var _0x464f57={'count':0x0,'rows':[]};return db[_0xe108('0x54')]['findOne']({'where':{'id':_0x2cd0c3[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x2f89da,null))[_0xe108('0x22')](function(_0x4feba4){if(_0x4feba4){_0xe17042[_0xe108('0x45')]=_['keys'](db['ChatInteraction'][_0xe108('0x42')]);_0xe17042[_0xe108('0x49')]=_[_0xe108('0x46')](_0x2cd0c3[_0xe108('0x49')]);_0xe17042[_0xe108('0x47')]=_[_0xe108('0x48')](_0xe17042[_0xe108('0x45')],_0xe17042[_0xe108('0x49')]);_0x3b8539[_0xe108('0x4a')]=_[_0xe108('0x48')](_0xe17042['model'],qs[_0xe108('0x4b')](_0x2cd0c3[_0xe108('0x49')][_0xe108('0x4b')]));_0x3b8539[_0xe108('0x4a')]=_0x3b8539[_0xe108('0x4a')][_0xe108('0x58')]?_0x3b8539[_0xe108('0x4a')]:_0xe17042[_0xe108('0x45')];if(!_0x2cd0c3[_0xe108('0x49')][_0xe108('0x69')](_0xe108('0x6a'))){_0x3b8539[_0xe108('0x30')]=qs[_0xe108('0x30')](_0x2cd0c3['query'][_0xe108('0x30')]);_0x3b8539[_0xe108('0x2e')]=qs[_0xe108('0x2e')](_0x2cd0c3['query'][_0xe108('0x2e')]);}_0x3b8539['order']=qs[_0xe108('0x6c')](_0x2cd0c3[_0xe108('0x49')][_0xe108('0x6c')]);_0x3b8539['where']=qs['filters'](_[_0xe108('0x4d')](_0x2cd0c3[_0xe108('0x49')],_0xe17042[_0xe108('0x47')]));_0x3b8539[_0xe108('0x4c')][_0xe108('0x65')]=_0x4feba4['id'];if(_0x2cd0c3[_0xe108('0x49')][_0xe108('0x4e')]){_0x3b8539['where']=_[_0xe108('0x4f')](_0x3b8539[_0xe108('0x4c')],{'$or':_[_0xe108('0x41')](_0x3b8539[_0xe108('0x4a')],function(_0x4008ae){var _0x3358ca={};_0x3358ca[_0x4008ae]={'$like':'%'+_0x2cd0c3['query'][_0xe108('0x4e')]+'%'};return _0x3358ca;})});}_0x3b8539=_[_0xe108('0x4f')]({},_0x3b8539,_0x2cd0c3['options']);return db[_0xe108('0xb7')][_0xe108('0x31')]({'where':_0x3b8539[_0xe108('0x4c')]})['then'](function(_0x398998){_0x464f57[_0xe108('0x31')]=_0x398998;if(_0x2cd0c3[_0xe108('0x49')][_0xe108('0x52')]){_0x3b8539[_0xe108('0x53')]=[{'model':db[_0xe108('0x91')],'as':_0xe108('0xf6'),'required':![]},{'model':db[_0xe108('0xc3')],'as':'Owner','attributes':[_0xe108('0x3c'),'fullname',_0xe108('0xf7')],'required':![]},{'model':db[_0xe108('0xf8')],'as':_0xe108('0xf9'),'attributes':['id',_0xe108('0x3c'),_0xe108('0xfa')],'where':_0x2cd0c3['query'][_0xe108('0xfb')]?{'id':_0x2cd0c3[_0xe108('0x49')]['tag']}:undefined,'required':_0x2cd0c3[_0xe108('0x49')][_0xe108('0xfb')]?!![]:![]}];}return db[_0xe108('0xb7')][_0xe108('0x55')](_0x3b8539);})[_0xe108('0x22')](function(_0x2f0309){_0x464f57[_0xe108('0x56')]=_0x2f0309;return _0x464f57;});}})[_0xe108('0x22')](respondWithFilteredResult(_0x2f89da,_0x3b8539))[_0xe108('0x57')](handleError(_0x2f89da,null));};function iftimePromise(_0x30cdaa,_0x1e2233){return respondWithRpcPromise('Command',_0xe108('0xfc'),{'command':_0x1e2233[_0xe108('0xfd')]?util['format'](_0xe108('0xfe'),_0x30cdaa['interval'],_0x1e2233[_0xe108('0xfd')]):util['format'](_0xe108('0xff'),_0x30cdaa[_0xe108('0x100')])},client9002)['then'](function(_0x54a5a9){var _0x6700c4=_0x54a5a9&&_0x54a5a9['indexOf'](_0xe108('0x101'))>=0x0?!![]:![];logger[_0xe108('0x23')](_0xe108('0x102'),_0x1e2233['id'],_0x30cdaa['id'],_0x30cdaa['interval'],_0x6700c4?_0xe108('0x103'):_0xe108('0x104'),_0x1e2233[_0xe108('0xfd')]?_0x1e2233[_0xe108('0xfd')]:_0xe108('0x105'));return _0x6700c4;})[_0xe108('0x57')](function(_0x2d4763){logger['error'](_0xe108('0x102'),_0x1e2233['id'],_0x30cdaa['id'],_0x30cdaa[_0xe108('0x100')],util[_0xe108('0x106')](_0x2d4763,{'showHidden':![],'depth':null}),_0x1e2233[_0xe108('0xfd')]?_0x1e2233[_0xe108('0xfd')]:_0xe108('0x105'));return![];});}exports[_0xe108('0xfc')]=function(_0x54c17c,_0x5957b8,_0x4e0703){var _0x3e8d9c=0x0;var _0x38ee37=0x0;var _0x3f84c9=![];var _0x208c4b;var _0x3e4445;return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x54c17c['params']['id']},'include':[{'model':db[_0xe108('0x107')],'as':_0xe108('0x107'),'include':[{'model':db[_0xe108('0x107')],'as':_0xe108('0x108'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xe108('0x22')](handleEntityNotFound(_0x5957b8,null))['then'](function(_0x571dbf){if(_0x571dbf){_0x208c4b=_0x571dbf;return _0x571dbf[_0xe108('0x109')]({'raw':!![]});}})[_0xe108('0x22')](function(_0x56577b){if(_0x208c4b){if(_0x56577b){_0x3e4445=_0x56577b;}}return require(_0xe108('0x10a'))[_0xe108('0x7d')]();})[_0xe108('0x22')](function(_0x1c408f){if(_0x1c408f){_0x38ee37=_0x1c408f[_0xe108('0x10b')];_0x3f84c9=_0x1c408f[_0xe108('0x7e')];}})[_0xe108('0x22')](function(){return db[_0xe108('0xb7')][_0xe108('0x31')]({'where':{'closed':![]}});})['then'](function(_0x4b29c7){_0x3e8d9c=_0x4b29c7;if(_0x38ee37&&_0x4b29c7>_0x38ee37){return db[_0xe108('0x10c')][_0xe108('0x68')]({'where':{'id':0x1}})[_0xe108('0x22')](function(_0x1c15dc){if(_0x1c15dc){_0x1c15dc['increment'](_0xe108('0x10d'));}});}})[_0xe108('0x22')](function(){if(_0x208c4b[_0xe108('0x107')]&&_0x208c4b[_0xe108('0x107')][_0xe108('0x108')]){var _0x2c042c=[];for(var _0x70131f=0x0;_0x70131f<_0x208c4b[_0xe108('0x107')][_0xe108('0x108')][_0xe108('0x58')];_0x70131f++){var _0x546306=_0x208c4b['Interval'][_0xe108('0x108')][_0x70131f][_0xe108('0x37')]({'plain':!![]});_0x2c042c[_0xe108('0xc0')](iftimePromise(_0x546306,_0x208c4b));}return BPromise[_0xe108('0x10e')](_0x2c042c)['then'](function(_0x1d4492){return _['some'](_0x1d4492);});}else{return!![];}})['then'](function(_0x166838){var _0x271c65=fs[_0xe108('0xd0')](path[_0xe108('0x7a')](config[_0xe108('0x7b')],'server/files/chat/iframe.ejs'),_0xe108('0xd2'));var _0x4746dc={'remote':_0x208c4b[_0xe108('0x10f')],'query':querystring[_0xe108('0x26')](_[_0xe108('0x4f')](_0x208c4b['get']({'plain':!![]}),{'customerIp':_0x54c17c[_0xe108('0x8d')][_0xe108('0xaa')]||_0x54c17c['headers'][_0xe108('0x110')]||_0x54c17c[_0xe108('0x111')]['remoteAddress']||_0x54c17c['ip'],'referer':_0x54c17c['headers'][_0xe108('0xae')],'openedInteractions':_0x3e8d9c,'maxInteractions':_0x38ee37,'virtual':_0x3f84c9[_0xe108('0x10b')],'online':_0x166838,'custom':_0x3f84c9}))[_0xe108('0x112')](/'/g,'\x5c\x27')};_0x5957b8['send'](ejs[_0xe108('0xd3')](Mustache[_0xe108('0xd3')](_0x271c65,_0x4746dc),{'proactiveActions':_0x3e4445,'alignment':_0x208c4b[_0xe108('0x113')],'verticalAlignment':_0x208c4b[_0xe108('0x114')],'div_color':_0x208c4b[_0xe108('0xfa')],'text_color':_0x208c4b[_0xe108('0x115')],'button_color':_0x208c4b[_0xe108('0x116')],'background_color':_0x208c4b['backgroundColor']}));})[_0xe108('0x57')](handleError(_0x5957b8,null));};exports[_0xe108('0x117')]=function(_0x2e5984,_0x57b4b4,_0x41defb){return db[_0xe108('0x54')][_0xe108('0x68')]({'where':{'id':_0x2e5984[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x57b4b4,null))['then'](function(_0x1e9468){if(_0x1e9468){return db[_0xe108('0xdb')][_0xe108('0x118')](function(_0xb859a5){return db['ChatApplication'][_0xe108('0x36')]({'where':{'ChatWebsiteId':_0x2e5984[_0xe108('0x62')]['id']},'transaction':_0xb859a5})[_0xe108('0x22')](function(_0x454ce5){var _0x50d5a6=_[_0xe108('0x41')](_0x2e5984[_0xe108('0x61')],function(_0x3351d6){_0x3351d6['ChatWebsiteId']=_0x2e5984[_0xe108('0x62')]['id'];return _0x3351d6;});return db[_0xe108('0x119')][_0xe108('0xdd')](_0x50d5a6,{'transaction':_0xb859a5});});})[_0xe108('0x22')](function(){return db['ChatApplication'][_0xe108('0x11a')]({'where':{'ChatWebsiteId':_0x2e5984[_0xe108('0x62')]['id']},'order':_0xe108('0x11b')});});}})[_0xe108('0x22')](respondWithResult(_0x57b4b4,null))['catch'](handleError(_0x57b4b4,null));};exports[_0xe108('0x11c')]=function(_0x51e45c,_0x184bcd,_0x3d304f){var _0x395b51={};var _0x2df19e={};var _0x4f2f5f;var _0x484d40;return db['ChatWebsite'][_0xe108('0x68')]({'where':{'id':_0x51e45c[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x184bcd,null))[_0xe108('0x22')](function(_0x170966){if(_0x170966){_0x4f2f5f=_0x170966;_0x2df19e[_0xe108('0x45')]=_[_0xe108('0x46')](db[_0xe108('0x119')][_0xe108('0x42')]);_0x2df19e[_0xe108('0x49')]=_[_0xe108('0x46')](_0x51e45c[_0xe108('0x49')]);_0x2df19e[_0xe108('0x47')]=_[_0xe108('0x48')](_0x2df19e[_0xe108('0x45')],_0x2df19e[_0xe108('0x49')]);_0x395b51[_0xe108('0x4a')]=_[_0xe108('0x48')](_0x2df19e[_0xe108('0x45')],qs[_0xe108('0x4b')](_0x51e45c[_0xe108('0x49')][_0xe108('0x4b')]));_0x395b51[_0xe108('0x4a')]=_0x395b51[_0xe108('0x4a')]['length']?_0x395b51['attributes']:_0x2df19e[_0xe108('0x45')];_0x395b51[_0xe108('0x6b')]=qs['sort'](_0x51e45c[_0xe108('0x49')]['sort']);_0x395b51[_0xe108('0x4c')]=qs['filters'](_[_0xe108('0x4d')](_0x51e45c[_0xe108('0x49')],_0x2df19e['filters']));if(_0x51e45c[_0xe108('0x49')]['filter']){_0x395b51[_0xe108('0x4c')]=_['merge'](_0x395b51[_0xe108('0x4c')],{'$or':_['map'](_0x395b51[_0xe108('0x4a')],function(_0x479cf2){var _0x41407d={};_0x41407d[_0x479cf2]={'$like':'%'+_0x51e45c[_0xe108('0x49')][_0xe108('0x4e')]+'%'};return _0x41407d;})});}_0x395b51=_[_0xe108('0x4f')]({},_0x395b51,_0x51e45c[_0xe108('0x51')]);return _0x4f2f5f[_0xe108('0x11c')](_0x395b51);}})[_0xe108('0x22')](function(_0x4d5140){if(_0x4d5140){_0x484d40=_0x4d5140[_0xe108('0x58')];if(!_0x51e45c[_0xe108('0x49')]['hasOwnProperty'](_0xe108('0x6a'))){_0x395b51[_0xe108('0x30')]=qs[_0xe108('0x30')](_0x51e45c['query'][_0xe108('0x30')]);_0x395b51[_0xe108('0x2e')]=qs['offset'](_0x51e45c[_0xe108('0x49')][_0xe108('0x2e')]);}return _0x4f2f5f['getApplications'](_0x395b51);}})[_0xe108('0x22')](function(_0xe2e092){if(_0xe2e092){return _0xe2e092?{'count':_0x484d40,'rows':_0xe2e092}:null;}})[_0xe108('0x22')](respondWithResult(_0x184bcd,null))[_0xe108('0x57')](handleError(_0x184bcd,null));};exports[_0xe108('0x11d')]=function(_0x292e28,_0x559614,_0x344517){return db[_0xe108('0x11e')]['find']({'where':{'id':_0x292e28[_0xe108('0x62')]['id']}})['then'](handleEntityNotFound(_0x559614,null))[_0xe108('0x22')](function(_0x2e15ba){if(_0x2e15ba){return _0x2e15ba[_0xe108('0x11d')](_0x292e28[_0xe108('0x61')]['ids'],_['omit'](_0x292e28[_0xe108('0x61')],[_0xe108('0x6e'),'id'])||{});}})[_0xe108('0x22')](respondWithResult(_0x559614,null))[_0xe108('0x57')](handleError(_0x559614,null));};exports[_0xe108('0x109')]=function(_0x2326f2,_0x321d50,_0x4614cc){var _0x4b709b={};var _0x34b1b8={};var _0x1a86c6;var _0x17b291;return db[_0xe108('0x54')][_0xe108('0x68')]({'where':{'id':_0x2326f2['params']['id']}})['then'](handleEntityNotFound(_0x321d50,null))['then'](function(_0x223ce7){if(_0x223ce7){_0x1a86c6=_0x223ce7;_0x34b1b8['model']=_['keys'](db[_0xe108('0x11f')][_0xe108('0x42')]);_0x34b1b8['query']=_[_0xe108('0x46')](_0x2326f2[_0xe108('0x49')]);_0x34b1b8[_0xe108('0x47')]=_[_0xe108('0x48')](_0x34b1b8['model'],_0x34b1b8[_0xe108('0x49')]);_0x4b709b[_0xe108('0x4a')]=_['intersection'](_0x34b1b8[_0xe108('0x45')],qs[_0xe108('0x4b')](_0x2326f2['query'][_0xe108('0x4b')]));_0x4b709b[_0xe108('0x4a')]=_0x4b709b['attributes'][_0xe108('0x58')]?_0x4b709b['attributes']:_0x34b1b8[_0xe108('0x45')];_0x4b709b[_0xe108('0x6b')]=qs[_0xe108('0x6c')](_0x2326f2[_0xe108('0x49')]['sort']);_0x4b709b[_0xe108('0x4c')]=qs[_0xe108('0x47')](_[_0xe108('0x4d')](_0x2326f2[_0xe108('0x49')],_0x34b1b8[_0xe108('0x47')]));if(_0x2326f2[_0xe108('0x49')]['filter']){_0x4b709b[_0xe108('0x4c')]=_['merge'](_0x4b709b['where'],{'$or':_['map'](_0x4b709b['attributes'],function(_0x47d013){var _0x122145={};_0x122145[_0x47d013]={'$like':'%'+_0x2326f2[_0xe108('0x49')][_0xe108('0x4e')]+'%'};return _0x122145;})});}_0x4b709b=_['merge']({},_0x4b709b,_0x2326f2['options']);return _0x1a86c6['getProactiveActions'](_0x4b709b);}})[_0xe108('0x22')](function(_0xf265fe){if(_0xf265fe){_0x17b291=_0xf265fe[_0xe108('0x58')];if(!_0x2326f2[_0xe108('0x49')][_0xe108('0x69')](_0xe108('0x6a'))){_0x4b709b['limit']=qs[_0xe108('0x30')](_0x2326f2[_0xe108('0x49')][_0xe108('0x30')]);_0x4b709b[_0xe108('0x2e')]=qs[_0xe108('0x2e')](_0x2326f2['query'][_0xe108('0x2e')]);}return _0x1a86c6[_0xe108('0x109')](_0x4b709b);}})[_0xe108('0x22')](function(_0x15ed51){if(_0x15ed51){return _0x15ed51?{'count':_0x17b291,'rows':_0x15ed51}:null;}})[_0xe108('0x22')](respondWithResult(_0x321d50,null))[_0xe108('0x57')](handleError(_0x321d50,null));};exports[_0xe108('0x120')]=function(_0x7a49eb,_0x5e356e,_0x3e43c5){var _0x132789=_0x7a49eb['query'][_0xe108('0x121')]===_0xe108('0x122')?_0xe108('0x123'):_0xe108('0x124');return db['ChatWebsite'][_0xe108('0x59')]({'attributes':['id',_0x132789],'where':{'id':_0x7a49eb[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x5e356e,null))[_0xe108('0x22')](function(_0x41c5c2){if(_0x41c5c2){var _0x21ece8=_0x41c5c2[_0x132789];var _0x1ed51c=_0x21ece8&&_0x21ece8[_0xe108('0x125')]?_0x21ece8['items']:[];_0x5e356e[_0xe108('0x3d')]({'fromKey':_[_0xe108('0x7f')](_0x21ece8[_0xe108('0x126')])?undefined:_0x21ece8['fromKey'],'count':_0x1ed51c[_0xe108('0x58')],'rows':_0x1ed51c});}})['catch'](handleError(_0x5e356e,null));};exports['getOfflineMessages']=function(_0x5043a6,_0x7afedd,_0x4d7299){var _0x23ba23={'raw':![],'where':{}};var _0x485f90={};var _0x1a9a01={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe108('0x68')]({'where':{'id':_0x5043a6[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x7afedd,null))[_0xe108('0x22')](function(_0x5ababe){if(_0x5ababe){_0x485f90[_0xe108('0x45')]=_[_0xe108('0x46')](db[_0xe108('0x127')][_0xe108('0x42')]);_0x485f90[_0xe108('0x49')]=_[_0xe108('0x46')](_0x5043a6['query']);_0x485f90['filters']=_[_0xe108('0x48')](_0x485f90[_0xe108('0x45')],_0x485f90[_0xe108('0x49')]);_0x23ba23[_0xe108('0x4a')]=_['intersection'](_0x485f90[_0xe108('0x45')],qs['fields'](_0x5043a6[_0xe108('0x49')][_0xe108('0x4b')]));_0x23ba23[_0xe108('0x4a')]=_0x23ba23[_0xe108('0x4a')][_0xe108('0x58')]?_0x23ba23[_0xe108('0x4a')]:_0x485f90[_0xe108('0x45')];if(!_0x5043a6['query'][_0xe108('0x69')](_0xe108('0x6a'))){_0x23ba23[_0xe108('0x30')]=qs[_0xe108('0x30')](_0x5043a6[_0xe108('0x49')][_0xe108('0x30')]);_0x23ba23['offset']=qs['offset'](_0x5043a6[_0xe108('0x49')][_0xe108('0x2e')]);}_0x23ba23[_0xe108('0x6b')]=qs[_0xe108('0x6c')](_0x5043a6[_0xe108('0x49')][_0xe108('0x6c')]);_0x23ba23[_0xe108('0x4c')]=qs[_0xe108('0x47')](_['pick'](_0x5043a6[_0xe108('0x49')],_0x485f90[_0xe108('0x47')]));_0x23ba23[_0xe108('0x4c')][_0xe108('0x65')]=_0x5ababe['id'];if(_0x5043a6[_0xe108('0x49')][_0xe108('0x4e')]){_0x23ba23[_0xe108('0x4c')]=_[_0xe108('0x4f')](_0x23ba23[_0xe108('0x4c')],{'$or':_[_0xe108('0x41')](_0x23ba23[_0xe108('0x4a')],function(_0x23fb1){var _0x3751ee={};_0x3751ee[_0x23fb1]={'$like':'%'+_0x5043a6[_0xe108('0x49')][_0xe108('0x4e')]+'%'};return _0x3751ee;})});}_0x23ba23=_[_0xe108('0x4f')]({},_0x23ba23,_0x5043a6[_0xe108('0x51')]);return db[_0xe108('0x127')][_0xe108('0x31')]({'where':_0x23ba23['where']})[_0xe108('0x22')](function(_0x3eb120){_0x1a9a01[_0xe108('0x31')]=_0x3eb120;if(_0x5043a6[_0xe108('0x49')][_0xe108('0x52')]){_0x23ba23[_0xe108('0x53')]=[{'all':!![]}];}else{_0x23ba23[_0xe108('0x53')]=[{'model':db[_0xe108('0x91')],'as':_0xe108('0xf6'),'required':![]},{'model':db[_0xe108('0xdc')],'as':_0xe108('0x128'),'required':![]}];}return db[_0xe108('0x127')]['findAll'](_0x23ba23);})[_0xe108('0x22')](function(_0x35e6f2){_0x1a9a01[_0xe108('0x56')]=_0x35e6f2;return _0x1a9a01;});}})[_0xe108('0x22')](respondWithFilteredResult(_0x7afedd,_0x23ba23))[_0xe108('0x57')](handleError(_0x7afedd,null));};exports[_0xe108('0x129')]=function(_0x212d4e,_0xd3663,_0x2dad3e){return db[_0xe108('0x54')][_0xe108('0x59')]({'where':{'id':_0x212d4e[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0xd3663,null))[_0xe108('0x22')](function(_0x116e5a){if(_0x116e5a){return _0x116e5a[_0xe108('0x129')](_0x212d4e[_0xe108('0x61')][_0xe108('0x6e')],_['omit'](_0x212d4e['body'],[_0xe108('0x6e'),'id'])||{})[_0xe108('0xbb')](function(_0x124cf7){for(var _0x16d655=0x0;_0x16d655<_0x212d4e[_0xe108('0x61')][_0xe108('0x6e')]['length'];_0x16d655+=0x1){socket[_0xe108('0x12a')](_0xe108('0x12b'),{'UserId':Number(_0x212d4e[_0xe108('0x61')]['ids'][_0x16d655]),'ChatWebsiteId':Number(_0x212d4e[_0xe108('0x62')]['id'])});}return _0x124cf7;});}})[_0xe108('0x22')](respondWithResult(_0xd3663,null))[_0xe108('0x57')](handleError(_0xd3663,null));};exports[_0xe108('0x12c')]=function(_0x3890a7,_0x1c4a6f,_0x3ecdbc){return db['ChatWebsite'][_0xe108('0x59')]({'where':{'id':_0x3890a7['params']['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x1c4a6f,null))[_0xe108('0x22')](function(_0x445e3e){if(_0x445e3e){return _0x445e3e[_0xe108('0x12c')](_0x3890a7['query'][_0xe108('0x6e')])[_0xe108('0x22')](function(){if(_[_0xe108('0x12d')](_0x3890a7[_0xe108('0x49')]['ids'])){for(var _0xfa56b5=0x0;_0xfa56b5<_0x3890a7['query'][_0xe108('0x6e')]['length'];_0xfa56b5+=0x1){socket[_0xe108('0x12a')](_0xe108('0x12e'),{'UserId':Number(_0x3890a7[_0xe108('0x49')]['ids'][_0xfa56b5]),'ChatWebsiteId':Number(_0x3890a7[_0xe108('0x62')]['id'])});}}else{socket[_0xe108('0x12a')](_0xe108('0x12e'),{'UserId':Number(_0x3890a7[_0xe108('0x49')][_0xe108('0x6e')]),'ChatWebsiteId':Number(_0x3890a7[_0xe108('0x62')]['id'])});}});}})[_0xe108('0x22')](respondWithStatusCode(_0x1c4a6f,null))['catch'](handleError(_0x1c4a6f,null));};exports[_0xe108('0x12f')]=function(_0x4a023d,_0x30d75b,_0xc27c1f){var _0x4dd64c={};var _0xb28547={};var _0xd3f050;var _0x21a391;return db[_0xe108('0x54')]['findOne']({'where':{'id':_0x4a023d[_0xe108('0x62')]['id']}})[_0xe108('0x22')](handleEntityNotFound(_0x30d75b,null))['then'](function(_0x1cf7cb){if(_0x1cf7cb){_0xd3f050=_0x1cf7cb;_0xb28547[_0xe108('0x45')]=_['keys'](db['User']['rawAttributes']);_0xb28547['query']=_[_0xe108('0x46')](_0x4a023d[_0xe108('0x49')]);_0xb28547[_0xe108('0x47')]=_[_0xe108('0x48')](_0xb28547['model'],_0xb28547['query']);_0x4dd64c[_0xe108('0x4a')]=_[_0xe108('0x48')](_0xb28547[_0xe108('0x45')],qs[_0xe108('0x4b')](_0x4a023d[_0xe108('0x49')][_0xe108('0x4b')]));_0x4dd64c[_0xe108('0x4a')]=_0x4dd64c[_0xe108('0x4a')][_0xe108('0x58')]?_0x4dd64c[_0xe108('0x4a')]:_0xb28547[_0xe108('0x45')];_0x4dd64c['order']=qs['sort'](_0x4a023d['query'][_0xe108('0x6c')]);_0x4dd64c[_0xe108('0x4c')]=qs[_0xe108('0x47')](_[_0xe108('0x4d')](_0x4a023d[_0xe108('0x49')],_0xb28547[_0xe108('0x47')]));if(_0x4a023d[_0xe108('0x49')][_0xe108('0x4e')]){_0x4dd64c['where']=_[_0xe108('0x4f')](_0x4dd64c[_0xe108('0x4c')],{'$or':_['map'](_0x4dd64c[_0xe108('0x4a')],function(_0xb511ab){var _0x9f01ed={};_0x9f01ed[_0xb511ab]={'$like':'%'+_0x4a023d[_0xe108('0x49')][_0xe108('0x4e')]+'%'};return _0x9f01ed;})});}_0x4dd64c=_[_0xe108('0x4f')]({},_0x4dd64c,_0x4a023d[_0xe108('0x51')]);return _0xd3f050[_0xe108('0x12f')](_0x4dd64c);}})[_0xe108('0x22')](function(_0xb6ded0){if(_0xb6ded0){_0x21a391=_0xb6ded0[_0xe108('0x58')];if(!_0x4a023d['query'][_0xe108('0x69')](_0xe108('0x6a'))){_0x4dd64c[_0xe108('0x30')]=qs['limit'](_0x4a023d[_0xe108('0x49')][_0xe108('0x30')]);_0x4dd64c['offset']=qs[_0xe108('0x2e')](_0x4a023d[_0xe108('0x49')][_0xe108('0x2e')]);}return _0xd3f050[_0xe108('0x12f')](_0x4dd64c);}})[_0xe108('0x22')](function(_0x5f14c7){if(_0x5f14c7){return _0x5f14c7?{'count':_0x21a391,'rows':_0x5f14c7}:null;}})[_0xe108('0x22')](respondWithResult(_0x30d75b,null))[_0xe108('0x57')](handleError(_0x30d75b,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 2e4d800..cb56ffb 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 _0xf767=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xf767,0x76));var _0x7f76=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xf767[_0x4c06a3];return _0x7ff53c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x7f76('0x0'))['db'][_0x7f76('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7f76('0x2')](0x0);var events={'afterCreate':_0x7f76('0x3'),'afterUpdate':_0x7f76('0x4'),'afterDestroy':'remove'};function emitEvent(_0x396137){return function(_0x2aa5e1,_0x40ba50,_0x25cd62){ChatWebsiteEvents['emit'](_0x396137+':'+_0x2aa5e1['id'],_0x2aa5e1);ChatWebsiteEvents[_0x7f76('0x5')](_0x396137,_0x2aa5e1);_0x25cd62(null);};}for(var e in events){if(events[_0x7f76('0x6')](e)){var event=events[e];ChatWebsite[_0x7f76('0x7')](e,emitEvent(event));}}module[_0x7f76('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x96a2=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1a660d,_0x182bba){var _0x3c1a19=function(_0x49f149){while(--_0x49f149){_0x1a660d['push'](_0x1a660d['shift']());}};_0x3c1a19(++_0x182bba);}(_0x96a2,0x96));var _0x296a=function(_0xc8510,_0x548104){_0xc8510=_0xc8510-0x0;var _0x19920f=_0x96a2[_0xc8510];return _0x19920f;};'use strict';var EventEmitter=require(_0x296a('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x296a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x296a('0x2')](0x0);var events={'afterCreate':_0x296a('0x3'),'afterUpdate':_0x296a('0x4'),'afterDestroy':_0x296a('0x5')};function emitEvent(_0x45919f){return function(_0x142815,_0x420fc5,_0x27edfb){ChatWebsiteEvents[_0x296a('0x6')](_0x45919f+':'+_0x142815['id'],_0x142815);ChatWebsiteEvents[_0x296a('0x6')](_0x45919f,_0x142815);_0x27edfb(null);};}for(var e in events){if(events[_0x296a('0x7')](e)){var event=events[e];ChatWebsite[_0x296a('0x8')](e,emitEvent(event));}}module[_0x296a('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index e197d19..0484581 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 _0x3a2f=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','bluebird'];(function(_0x3210f9,_0x5babff){var _0x1d4783=function(_0x4806e1){while(--_0x4806e1){_0x3210f9['push'](_0x3210f9['shift']());}};_0x1d4783(++_0x5babff);}(_0x3a2f,0xb2));var _0xf3a2=function(_0x3e17c1,_0x165414){_0x3e17c1=_0x3e17c1-0x0;var _0x5f2c49=_0x3a2f[_0x3e17c1];return _0x5f2c49;};'use strict';var _=require(_0xf3a2('0x0'));var util=require(_0xf3a2('0x1'));var logger=require(_0xf3a2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf3a2('0x3'));var rp=require(_0xf3a2('0x4'));var fs=require('fs');var path=require(_0xf3a2('0x5'));var rimraf=require(_0xf3a2('0x6'));var config=require(_0xf3a2('0x7'));var attributes=require(_0xf3a2('0x8'));module[_0xf3a2('0x9')]=function(_0x3327a9,_0x25ffc0){return _0x3327a9[_0xf3a2('0xa')](_0xf3a2('0xb'),attributes,{'tableName':_0xf3a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd710=['api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites','../../config/logger'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xd710,0xba));var _0x0d71=function(_0x173f7d,_0x2f6531){_0x173f7d=_0x173f7d-0x0;var _0x41f927=_0xd710[_0x173f7d];return _0x41f927;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d71('0x0'))(_0x0d71('0x1'));var moment=require(_0x0d71('0x2'));var BPromise=require(_0x0d71('0x3'));var rp=require(_0x0d71('0x4'));var fs=require('fs');var path=require(_0x0d71('0x5'));var rimraf=require(_0x0d71('0x6'));var config=require('../../config/environment');var attributes=require(_0x0d71('0x7'));module[_0x0d71('0x8')]=function(_0x421cbc,_0x3bab43){return _0x421cbc[_0x0d71('0x9')]('ChatWebsite',attributes,{'tableName':_0x0d71('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 195549d..57e299c 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 _0x4550=['client','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4550,0x108));var _0x0455=function(_0x2fdc1a,_0x2a0a5a){_0x2fdc1a=_0x2fdc1a-0x0;var _0x51fb16=_0x4550[_0x2fdc1a];return _0x51fb16;};'use strict';var _=require(_0x0455('0x0'));var util=require(_0x0455('0x1'));var moment=require(_0x0455('0x2'));var BPromise=require(_0x0455('0x3'));var rs=require(_0x0455('0x4'));var fs=require('fs');var Redis=require(_0x0455('0x5'));var db=require(_0x0455('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0455('0x7'))(_0x0455('0x8'));var config=require(_0x0455('0x9'));var jayson=require(_0x0455('0xa'));var client=jayson[_0x0455('0xb')]['http']({'port':0x232a});config[_0x0455('0xc')]=_[_0x0455('0xd')](config['redis'],{'host':_0x0455('0xe'),'port':0x18eb});var socket=require(_0x0455('0xf'))(new Redis(config[_0x0455('0xc')]));require('./chatWebsite.socket')[_0x0455('0x10')](socket);function respondWithRpcPromise(_0x35533f,_0x190193,_0x32606e){return new BPromise(function(_0x1f57a1,_0x11bf56){return client['request'](_0x35533f,_0x32606e)[_0x0455('0x11')](function(_0x35696f){logger[_0x0455('0x12')](_0x0455('0x13'),_0x190193,'request\x20sent');logger[_0x0455('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x190193,_0x0455('0x15'),JSON['stringify'](_0x35696f));if(_0x35696f[_0x0455('0x16')]){if(_0x35696f['error'][_0x0455('0x17')]===0x1f4){logger[_0x0455('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x190193,_0x35696f[_0x0455('0x16')][_0x0455('0x18')]);return _0x11bf56(_0x35696f[_0x0455('0x16')]['message']);}logger[_0x0455('0x16')](_0x0455('0x13'),_0x190193,_0x35696f[_0x0455('0x16')][_0x0455('0x18')]);return _0x1f57a1(_0x35696f[_0x0455('0x16')][_0x0455('0x18')]);}else{logger[_0x0455('0x12')](_0x0455('0x13'),_0x190193,_0x0455('0x15'));_0x1f57a1(_0x35696f['result'][_0x0455('0x18')]);}})['catch'](function(_0x176d5f){logger['error'](_0x0455('0x13'),_0x190193,_0x176d5f);_0x11bf56(_0x176d5f);});});}
\ No newline at end of file
+var _0x7805=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','request\x20sent','debug','error','code','message','info','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x2d45d2,_0x4f5c12){var _0x5c4ea2=function(_0x234c21){while(--_0x234c21){_0x2d45d2['push'](_0x2d45d2['shift']());}};_0x5c4ea2(++_0x4f5c12);}(_0x7805,0x132));var _0x5780=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x7805[_0x59162a];return _0x35e50d;};'use strict';var _=require(_0x5780('0x0'));var util=require(_0x5780('0x1'));var moment=require('moment');var BPromise=require(_0x5780('0x2'));var rs=require(_0x5780('0x3'));var fs=require('fs');var Redis=require(_0x5780('0x4'));var db=require(_0x5780('0x5'))['db'];var utils=require(_0x5780('0x6'));var logger=require('../../config/logger')(_0x5780('0x7'));var config=require(_0x5780('0x8'));var jayson=require(_0x5780('0x9'));var client=jayson[_0x5780('0xa')]['http']({'port':0x232a});config['redis']=_[_0x5780('0xb')](config['redis'],{'host':_0x5780('0xc'),'port':0x18eb});var socket=require(_0x5780('0xd'))(new Redis(config[_0x5780('0xe')]));require(_0x5780('0xf'))[_0x5780('0x10')](socket);function respondWithRpcPromise(_0x2493de,_0xfff859,_0x3b7417){return new BPromise(function(_0x313bb0,_0xa05da5){return client[_0x5780('0x11')](_0x2493de,_0x3b7417)[_0x5780('0x12')](function(_0x2dadb4){logger['info']('ChatWebsite,\x20%s,\x20%s',_0xfff859,_0x5780('0x13'));logger[_0x5780('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xfff859,'request\x20sent',JSON['stringify'](_0x2dadb4));if(_0x2dadb4[_0x5780('0x15')]){if(_0x2dadb4[_0x5780('0x15')][_0x5780('0x16')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xfff859,_0x2dadb4[_0x5780('0x15')][_0x5780('0x17')]);return _0xa05da5(_0x2dadb4[_0x5780('0x15')][_0x5780('0x17')]);}logger[_0x5780('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xfff859,_0x2dadb4[_0x5780('0x15')][_0x5780('0x17')]);return _0x313bb0(_0x2dadb4[_0x5780('0x15')][_0x5780('0x17')]);}else{logger[_0x5780('0x18')](_0x5780('0x19'),_0xfff859,'request\x20sent');_0x313bb0(_0x2dadb4[_0x5780('0x1a')][_0x5780('0x17')]);}})[_0x5780('0x1b')](function(_0x385a8d){logger[_0x5780('0x15')](_0x5780('0x19'),_0xfff859,_0x385a8d);_0xa05da5(_0x385a8d);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8e1e5a5..dea1a39 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 _0x6aa4=['update','emit','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x2cf579,_0x410fac){var _0x5195cf=function(_0x44a99e){while(--_0x44a99e){_0x2cf579['push'](_0x2cf579['shift']());}};_0x5195cf(++_0x410fac);}(_0x6aa4,0x11d));var _0x46aa=function(_0x48dc02,_0x4a7530){_0x48dc02=_0x48dc02-0x0;var _0x3d8532=_0x6aa4[_0x48dc02];return _0x3d8532;};'use strict';var ChatWebsiteEvents=require(_0x46aa('0x0'));var events=[_0x46aa('0x1'),_0x46aa('0x2'),_0x46aa('0x3')];function createListener(_0x388019,_0x405e69){return function(_0x472678){_0x405e69[_0x46aa('0x4')](_0x388019,_0x472678);};}function removeListener(_0x1143f3,_0x206f15){return function(){ChatWebsiteEvents['removeListener'](_0x1143f3,_0x206f15);};}exports['register']=function(_0x47081f){for(var _0x48f0d0=0x0,_0x1eedb0=events['length'];_0x48f0d0<_0x1eedb0;_0x48f0d0++){var _0x4ae7a5=events[_0x48f0d0];var _0x5a1aca=createListener(_0x46aa('0x5')+_0x4ae7a5,_0x47081f);ChatWebsiteEvents['on'](_0x4ae7a5,_0x5a1aca);}};
\ No newline at end of file
+var _0x50d6=['emit','register','length','./chatWebsite.events','save','remove','update'];(function(_0x12f6da,_0x40a24f){var _0x2af65b=function(_0x2a653b){while(--_0x2a653b){_0x12f6da['push'](_0x12f6da['shift']());}};_0x2af65b(++_0x40a24f);}(_0x50d6,0x184));var _0x650d=function(_0x1fe809,_0x433222){_0x1fe809=_0x1fe809-0x0;var _0x59c58c=_0x50d6[_0x1fe809];return _0x59c58c;};'use strict';var ChatWebsiteEvents=require(_0x650d('0x0'));var events=[_0x650d('0x1'),_0x650d('0x2'),_0x650d('0x3')];function createListener(_0x39ee8f,_0x3713a8){return function(_0x4cc4a5){_0x3713a8[_0x650d('0x4')](_0x39ee8f,_0x4cc4a5);};}function removeListener(_0x333c53,_0x5f3276){return function(){ChatWebsiteEvents['removeListener'](_0x333c53,_0x5f3276);};}exports[_0x650d('0x5')]=function(_0x128cd8){for(var _0xb42d5b=0x0,_0xf32b06=events[_0x650d('0x6')];_0xb42d5b<_0xf32b06;_0xb42d5b++){var _0x1917a3=events[_0xb42d5b];var _0x1e3a30=createListener('chatWebsite:'+_0x1917a3,_0x128cd8);ChatWebsiteEvents['on'](_0x1917a3,_0x1e3a30);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9b1aebb..b67b3a2 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 _0x4397=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','addLogo','root','server/files/images/avatars/','/:id/avatar','file','addAvatar','addCustomerAvatar','single','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x39bd33,_0x2d1d3b){var _0xd5248e=function(_0xe42359){while(--_0xe42359){_0x39bd33['push'](_0x39bd33['shift']());}};_0xd5248e(++_0x2d1d3b);}(_0x4397,0x12f));var _0x7439=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x4397[_0x367a3d];return _0x460539;};'use strict';var multer=require(_0x7439('0x0'));var util=require(_0x7439('0x1'));var path=require(_0x7439('0x2'));var timeout=require(_0x7439('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7439('0x4'));var auth=require(_0x7439('0x5'));var interaction=require(_0x7439('0x6'));var config=require(_0x7439('0x7'));var controller=require(_0x7439('0x8'));router[_0x7439('0x9')]('/',auth[_0x7439('0xa')](),controller[_0x7439('0xb')]);router[_0x7439('0x9')](_0x7439('0xc'),auth[_0x7439('0xa')](),controller['describe']);router[_0x7439('0x9')](_0x7439('0xd'),auth[_0x7439('0xa')](),controller[_0x7439('0xe')]);router[_0x7439('0x9')](_0x7439('0xf'),auth[_0x7439('0xa')](),controller[_0x7439('0x10')]);router[_0x7439('0x9')](_0x7439('0x11'),auth[_0x7439('0xa')](),controller[_0x7439('0x12')]);router['get']('/:id/logo',controller['getLogo']);router[_0x7439('0x9')]('/:id/avatar',controller[_0x7439('0x13')]);router[_0x7439('0x9')](_0x7439('0x14'),controller[_0x7439('0x15')]);router['get'](_0x7439('0x16'),controller[_0x7439('0x17')]);router[_0x7439('0x9')]('/:id/interactions',auth[_0x7439('0xa')](),controller[_0x7439('0x18')]);router[_0x7439('0x9')]('/:id/snippet',controller['getSnippet']);router[_0x7439('0x9')](_0x7439('0x19'),auth[_0x7439('0xa')](),controller[_0x7439('0x1a')]);router[_0x7439('0x9')](_0x7439('0x1b'),auth[_0x7439('0xa')](),controller[_0x7439('0x1c')]);router['get'](_0x7439('0x1d'),controller[_0x7439('0x1e')]);router['get'](_0x7439('0x1f'),auth[_0x7439('0xa')](),controller[_0x7439('0x20')]);router['get'](_0x7439('0x21'),auth['isAuthenticated'](),controller[_0x7439('0x22')]);router[_0x7439('0x23')]('/',auth[_0x7439('0xa')](),controller[_0x7439('0x24')]);router[_0x7439('0x23')](_0x7439('0xf'),auth[_0x7439('0xa')](),controller[_0x7439('0x25')]);router['post'](_0x7439('0x11'),auth[_0x7439('0xa')](),controller[_0x7439('0x26')]);var upload=multer({'storage':multer[_0x7439('0x27')]({'destination':function(_0x9d53f9,_0x5591a4,_0x5e9a22){_0x5e9a22(null,path[_0x7439('0x28')](config['root'],_0x7439('0x29')));},'filename':function(_0x7e18ca,_0x343019,_0x13f06a){_0x13f06a(null,util[_0x7439('0x2a')](_0x7439('0x2b'),Date[_0x7439('0x2c')](),_0x343019[_0x7439('0x2d')]));}})});router['post']('/:id/logo',upload['single']('file'),controller[_0x7439('0x2e')]);var upload=multer({'storage':multer[_0x7439('0x27')]({'destination':function(_0x219133,_0x2c65e1,_0x163a22){_0x163a22(null,path[_0x7439('0x28')](config[_0x7439('0x2f')],_0x7439('0x30')));},'filename':function(_0x4f9d7e,_0x1ce3e1,_0x361097){_0x361097(null,util[_0x7439('0x2a')](_0x7439('0x2b'),Date[_0x7439('0x2c')](),_0x1ce3e1['originalname']));}})});router[_0x7439('0x23')](_0x7439('0x31'),upload['single'](_0x7439('0x32')),controller[_0x7439('0x33')]);var upload=multer({'storage':multer[_0x7439('0x27')]({'destination':function(_0x2b569b,_0x4dbe69,_0x3e743d){_0x3e743d(null,path[_0x7439('0x28')](config[_0x7439('0x2f')],_0x7439('0x30')));},'filename':function(_0x5695a0,_0xf6e438,_0x223675){_0x223675(null,util[_0x7439('0x2a')](_0x7439('0x2b'),Date[_0x7439('0x2c')](),_0xf6e438[_0x7439('0x2d')]));}})});router[_0x7439('0x23')](_0x7439('0x14'),upload['single']('file'),controller[_0x7439('0x34')]);var upload=multer({'storage':multer[_0x7439('0x27')]({'destination':function(_0x597757,_0x2a1e29,_0x26ce2a){_0x26ce2a(null,path[_0x7439('0x28')](config['root'],_0x7439('0x30')));},'filename':function(_0x1898db,_0x12ab2f,_0x18c3b3){_0x18c3b3(null,util[_0x7439('0x2a')](_0x7439('0x2b'),Date[_0x7439('0x2c')](),_0x12ab2f[_0x7439('0x2d')]));}})});router['post'](_0x7439('0x16'),upload[_0x7439('0x35')](_0x7439('0x32')),controller[_0x7439('0x36')]);router[_0x7439('0x23')]('/:id/notify',controller[_0x7439('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x7439('0x27')]({'destination':function(_0x13f5d5,_0x1feabf,_0x5d77c7){const _0x41cae9=path[_0x7439('0x28')](config['root'],_0x7439('0x38'),_0x7439('0x39'),_0x7439('0x3a'));fs_extra[_0x7439('0x3b')](_0x41cae9,function(){_0x5d77c7(null,_0x41cae9);});},'filename':function(_0x5b38aa,_0x562b24,_0x5eb33d){const _0x3472d8=_0x562b24[_0x7439('0x2d')][_0x7439('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a0b1d=path[_0x7439('0x3d')](_0x3472d8);const _0x4ce9a2=Date[_0x7439('0x2c')]()+'-'+_0x3472d8['replace'](_0x2a0b1d,'')+_0x2a0b1d;_0x5eb33d(null,_0x4ce9a2);}})});router[_0x7439('0x23')](_0x7439('0x3e'),offlineUploadMulter[_0x7439('0x3f')](),controller['offline']);router['post']('/:id/interactions',auth[_0x7439('0xa')](),controller[_0x7439('0x40')]);router[_0x7439('0x23')](_0x7439('0x19'),auth[_0x7439('0xa')](),controller[_0x7439('0x41')]);router[_0x7439('0x23')](_0x7439('0x1b'),auth['isAuthenticated'](),controller[_0x7439('0x42')]);router[_0x7439('0x23')](_0x7439('0x21'),auth['isAuthenticated'](),controller[_0x7439('0x43')]);router[_0x7439('0x44')](_0x7439('0xd'),auth[_0x7439('0xa')](),controller[_0x7439('0x45')]);router[_0x7439('0x46')](_0x7439('0xd'),auth['isAuthenticated'](),controller[_0x7439('0x47')]);router[_0x7439('0x46')](_0x7439('0xf'),auth[_0x7439('0xa')](),controller[_0x7439('0x48')]);router[_0x7439('0x46')](_0x7439('0x11'),auth[_0x7439('0xa')](),controller[_0x7439('0x49')]);router[_0x7439('0x46')](_0x7439('0x21'),auth[_0x7439('0xa')](),controller[_0x7439('0x4a')]);module[_0x7439('0x4b')]=router;
\ No newline at end of file
+var _0x755b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','join','root','format','%s-%s','now','originalname','single','file','diskStorage','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','destroy','removeDispositions','removeAnswers','delete','exports','multer','util','path','connect-timeout'];(function(_0x3deb1c,_0x14566d){var _0x4f9f4e=function(_0x39b8a2){while(--_0x39b8a2){_0x3deb1c['push'](_0x3deb1c['shift']());}};_0x4f9f4e(++_0x14566d);}(_0x755b,0x15f));var _0xb755=function(_0x998252,_0x464fbf){_0x998252=_0x998252-0x0;var _0x2c9073=_0x755b[_0x998252];return _0x2c9073;};'use strict';var multer=require(_0xb755('0x0'));var util=require(_0xb755('0x1'));var path=require(_0xb755('0x2'));var timeout=require(_0xb755('0x3'));var express=require('express');var router=express[_0xb755('0x4')]();var fs_extra=require(_0xb755('0x5'));var auth=require(_0xb755('0x6'));var interaction=require(_0xb755('0x7'));var config=require(_0xb755('0x8'));var controller=require(_0xb755('0x9'));router[_0xb755('0xa')]('/',auth[_0xb755('0xb')](),controller[_0xb755('0xc')]);router[_0xb755('0xa')](_0xb755('0xd'),auth[_0xb755('0xb')](),controller[_0xb755('0xe')]);router[_0xb755('0xa')]('/:id',auth[_0xb755('0xb')](),controller[_0xb755('0xf')]);router[_0xb755('0xa')](_0xb755('0x10'),auth[_0xb755('0xb')](),controller[_0xb755('0x11')]);router[_0xb755('0xa')]('/:id/canned_answers',auth[_0xb755('0xb')](),controller['getAnswers']);router['get'](_0xb755('0x12'),controller[_0xb755('0x13')]);router[_0xb755('0xa')](_0xb755('0x14'),controller[_0xb755('0x15')]);router[_0xb755('0xa')]('/:id/customer_avatar',controller[_0xb755('0x16')]);router[_0xb755('0xa')]('/:id/system_avatar',controller[_0xb755('0x17')]);router['get'](_0xb755('0x18'),auth[_0xb755('0xb')](),controller[_0xb755('0x19')]);router[_0xb755('0xa')](_0xb755('0x1a'),controller['getSnippet']);router['get'](_0xb755('0x1b'),auth['isAuthenticated'](),controller['getApplications']);router[_0xb755('0xa')](_0xb755('0x1c'),auth[_0xb755('0xb')](),controller[_0xb755('0x1d')]);router['get'](_0xb755('0x1e'),controller['getFields']);router[_0xb755('0xa')](_0xb755('0x1f'),auth[_0xb755('0xb')](),controller['getOfflineMessages']);router[_0xb755('0xa')](_0xb755('0x20'),auth[_0xb755('0xb')](),controller[_0xb755('0x21')]);router[_0xb755('0x22')]('/',auth[_0xb755('0xb')](),controller['create']);router[_0xb755('0x22')](_0xb755('0x10'),auth[_0xb755('0xb')](),controller['addDisposition']);router[_0xb755('0x22')](_0xb755('0x23'),auth['isAuthenticated'](),controller[_0xb755('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d8cb1,_0x326873,_0x354809){_0x354809(null,path[_0xb755('0x25')](config[_0xb755('0x26')],'server/files/images/logos/'));},'filename':function(_0x112d63,_0x5215c8,_0x4ff422){_0x4ff422(null,util[_0xb755('0x27')](_0xb755('0x28'),Date[_0xb755('0x29')](),_0x5215c8[_0xb755('0x2a')]));}})});router['post'](_0xb755('0x12'),upload[_0xb755('0x2b')](_0xb755('0x2c')),controller['addLogo']);var upload=multer({'storage':multer[_0xb755('0x2d')]({'destination':function(_0x148c50,_0x5e10ff,_0xa720e){_0xa720e(null,path[_0xb755('0x25')](config[_0xb755('0x26')],_0xb755('0x2e')));},'filename':function(_0x473826,_0x59c2e7,_0x50374d){_0x50374d(null,util['format'](_0xb755('0x28'),Date[_0xb755('0x29')](),_0x59c2e7[_0xb755('0x2a')]));}})});router['post'](_0xb755('0x14'),upload['single'](_0xb755('0x2c')),controller[_0xb755('0x2f')]);var upload=multer({'storage':multer[_0xb755('0x2d')]({'destination':function(_0xdfeb7,_0x2a1be9,_0xc77551){_0xc77551(null,path[_0xb755('0x25')](config[_0xb755('0x26')],_0xb755('0x2e')));},'filename':function(_0x5d0825,_0x553a29,_0x2e579a){_0x2e579a(null,util[_0xb755('0x27')](_0xb755('0x28'),Date[_0xb755('0x29')](),_0x553a29[_0xb755('0x2a')]));}})});router[_0xb755('0x22')](_0xb755('0x30'),upload[_0xb755('0x2b')](_0xb755('0x2c')),controller[_0xb755('0x31')]);var upload=multer({'storage':multer[_0xb755('0x2d')]({'destination':function(_0x5513b8,_0x183ee6,_0xb37772){_0xb37772(null,path[_0xb755('0x25')](config[_0xb755('0x26')],_0xb755('0x2e')));},'filename':function(_0x2dc8ec,_0x3c02db,_0x4e8aad){_0x4e8aad(null,util[_0xb755('0x27')](_0xb755('0x28'),Date[_0xb755('0x29')](),_0x3c02db[_0xb755('0x2a')]));}})});router['post'](_0xb755('0x32'),upload[_0xb755('0x2b')](_0xb755('0x2c')),controller[_0xb755('0x33')]);router[_0xb755('0x22')](_0xb755('0x34'),controller[_0xb755('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x56038d,_0x38bca6,_0x2f0acb){const _0x3f1e9e=path[_0xb755('0x25')](config['root'],_0xb755('0x36'),_0xb755('0x37'),'offline-chat');fs_extra[_0xb755('0x38')](_0x3f1e9e,function(){_0x2f0acb(null,_0x3f1e9e);});},'filename':function(_0x1fd7d2,_0x15d626,_0x54be25){const _0xc52509=_0x15d626[_0xb755('0x2a')][_0xb755('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2555fe=path[_0xb755('0x3a')](_0xc52509);const _0x4c679f=Date['now']()+'-'+_0xc52509[_0xb755('0x39')](_0x2555fe,'')+_0x2555fe;_0x54be25(null,_0x4c679f);}})});router['post'](_0xb755('0x3b'),offlineUploadMulter['any'](),controller['offline']);router[_0xb755('0x22')](_0xb755('0x18'),auth[_0xb755('0xb')](),controller[_0xb755('0x3c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xb755('0x22')](_0xb755('0x1c'),auth[_0xb755('0xb')](),controller[_0xb755('0x3d')]);router[_0xb755('0x22')]('/:id/users',auth[_0xb755('0xb')](),controller[_0xb755('0x3e')]);router[_0xb755('0x3f')](_0xb755('0x40'),auth[_0xb755('0xb')](),controller[_0xb755('0x41')]);router['delete'](_0xb755('0x40'),auth[_0xb755('0xb')](),controller[_0xb755('0x42')]);router['delete']('/:id/dispositions',auth[_0xb755('0xb')](),controller[_0xb755('0x43')]);router['delete'](_0xb755('0x23'),auth[_0xb755('0xb')](),controller[_0xb755('0x44')]);router[_0xb755('0x45')](_0xb755('0x20'),auth[_0xb755('0xb')](),controller['removeAgents']);module[_0xb755('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 3b560cc..09eca4c 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 _0xa498=['STRING','Google','exports'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xa498,0x1d6));var _0x8a49=function(_0x43f552,_0x42808c){_0x43f552=_0x43f552-0x0;var _0x17911b=_0xa498[_0x43f552];return _0x17911b;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'name':{'type':Sequelize[_0x8a49('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x8a49('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8a49('0x1')]},'data2':{'type':Sequelize[_0x8a49('0x1')]}};
\ No newline at end of file
+var _0xaa48=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x3b2737,_0xba806c){var _0x4120b7=function(_0x349ef3){while(--_0x349ef3){_0x3b2737['push'](_0x3b2737['shift']());}};_0x4120b7(++_0xba806c);}(_0xaa48,0x15a));var _0x8aa4=function(_0x5d5db4,_0x1a1cf2){_0x5d5db4=_0x5d5db4-0x0;var _0xa154ab=_0xaa48[_0x5d5db4];return _0xa154ab;};'use strict';var Sequelize=require(_0x8aa4('0x0'));module[_0x8aa4('0x1')]={'name':{'type':Sequelize[_0x8aa4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8aa4('0x3')](_0x8aa4('0x4'),_0x8aa4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8aa4('0x2')]},'data2':{'type':Sequelize[_0x8aa4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ea56782..9acca54 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 _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xadb5,0xad));var _0x5adb=function(_0x139a61,_0x5dff02){_0x139a61=_0x139a61-0x0;var _0x25489a=_0xadb5[_0x139a61];return _0x25489a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
+var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x565c63,_0x1c67d9){var _0x517759=function(_0x54256e){while(--_0x54256e){_0x565c63['push'](_0x565c63['shift']());}};_0x517759(++_0x1c67d9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f66[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 61ad5ef..0a24fd8 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 _0x13bb=['exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x13bb,0x19b));var _0xb13b=function(_0x22697e,_0x53f601){_0x22697e=_0x22697e-0x0;var _0xd20b6b=_0x13bb[_0x22697e];return _0xd20b6b;};'use strict';var _=require('lodash');var util=require(_0xb13b('0x0'));var logger=require(_0xb13b('0x1'))(_0xb13b('0x2'));var moment=require(_0xb13b('0x3'));var BPromise=require(_0xb13b('0x4'));var rp=require(_0xb13b('0x5'));var fs=require('fs');var path=require(_0xb13b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xb13b('0x7')]=function(_0x4e83d8,_0xb9881a){return _0x4e83d8[_0xb13b('0x8')](_0xb13b('0x9'),attributes,{'tableName':_0xb13b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c11=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0xa2778b,_0x3f70a0){var _0x2fe5d5=function(_0x10e9a3){while(--_0x10e9a3){_0xa2778b['push'](_0xa2778b['shift']());}};_0x2fe5d5(++_0x3f70a0);}(_0x5c11,0x8c));var _0x15c1=function(_0x3ace8,_0x4bf514){_0x3ace8=_0x3ace8-0x0;var _0x4968d3=_0x5c11[_0x3ace8];return _0x4968d3;};'use strict';var _=require(_0x15c1('0x0'));var util=require(_0x15c1('0x1'));var logger=require(_0x15c1('0x2'))(_0x15c1('0x3'));var moment=require(_0x15c1('0x4'));var BPromise=require(_0x15c1('0x5'));var rp=require(_0x15c1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15c1('0x7'));var config=require(_0x15c1('0x8'));var attributes=require(_0x15c1('0x9'));module['exports']=function(_0x3aea19,_0x41de72){return _0x3aea19[_0x15c1('0xa')](_0x15c1('0xb'),attributes,{'tableName':_0x15c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 88f5768..cba6e9d 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 _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd05a,0x143));var _0xad05=function(_0x5d7b78,_0x21ee2b){_0x5d7b78=_0x5d7b78-0x0;var _0x1ca2bc=_0xd05a[_0x5d7b78];return _0x1ca2bc;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});}
\ No newline at end of file
+var _0xb6a6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util'];(function(_0x5f50b5,_0xa8db83){var _0x54c383=function(_0x381334){while(--_0x381334){_0x5f50b5['push'](_0x5f50b5['shift']());}};_0x54c383(++_0xa8db83);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x24047a,_0x1dae10){_0x24047a=_0x24047a-0x0;var _0x5641b5=_0xb6a6[_0x24047a];return _0x5641b5;};'use strict';var _=require(_0x6b6a('0x0'));var util=require(_0x6b6a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b6a('0x2'));var fs=require('fs');var Redis=require(_0x6b6a('0x3'));var db=require(_0x6b6a('0x4'))['db'];var utils=require(_0x6b6a('0x5'));var logger=require(_0x6b6a('0x6'))('rpc');var config=require(_0x6b6a('0x7'));var jayson=require(_0x6b6a('0x8'));var client=jayson[_0x6b6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad201,_0x1895f7,_0x59e90c){return new BPromise(function(_0x43f878,_0x15ccc9){return client['request'](_0x3ad201,_0x59e90c)[_0x6b6a('0xa')](function(_0x58ff98){logger[_0x6b6a('0xb')](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1895f7,_0x6b6a('0xd'),JSON[_0x6b6a('0xe')](_0x58ff98));if(_0x58ff98['error']){if(_0x58ff98['error'][_0x6b6a('0xf')]===0x1f4){logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x15ccc9(_0x58ff98['error'][_0x6b6a('0x11')]);}logger[_0x6b6a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1895f7,_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);return _0x43f878(_0x58ff98[_0x6b6a('0x10')][_0x6b6a('0x11')]);}else{logger['info'](_0x6b6a('0xc'),_0x1895f7,_0x6b6a('0xd'));_0x43f878(_0x58ff98['result'][_0x6b6a('0x11')]);}})[_0x6b6a('0x12')](function(_0x126189){logger[_0x6b6a('0x10')](_0x6b6a('0xc'),_0x1895f7,_0x126189);_0x15ccc9(_0x126189);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 3c1dd51..f7693d3 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 _0x6d37=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer'];(function(_0x18f72d,_0x9e8fd8){var _0x90e84d=function(_0x467c0d){while(--_0x467c0d){_0x18f72d['push'](_0x18f72d['shift']());}};_0x90e84d(++_0x9e8fd8);}(_0x6d37,0x18e));var _0x76d3=function(_0x11967b,_0x5511c1){_0x11967b=_0x11967b-0x0;var _0x3fa585=_0x6d37[_0x11967b];return _0x3fa585;};'use strict';var multer=require(_0x76d3('0x0'));var util=require(_0x76d3('0x1'));var path=require(_0x76d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x76d3('0x3'));var router=express[_0x76d3('0x4')]();var fs_extra=require(_0x76d3('0x5'));var auth=require(_0x76d3('0x6'));var interaction=require(_0x76d3('0x7'));var config=require(_0x76d3('0x8'));var controller=require(_0x76d3('0x9'));router[_0x76d3('0xa')]('/',auth['isAuthenticated'](),controller[_0x76d3('0xb')]);router['get'](_0x76d3('0xc'),auth[_0x76d3('0xd')](),controller[_0x76d3('0xe')]);router[_0x76d3('0xf')]('/',auth[_0x76d3('0xd')](),controller[_0x76d3('0x10')]);router[_0x76d3('0x11')](_0x76d3('0xc'),auth[_0x76d3('0xd')](),controller['update']);router[_0x76d3('0x12')]('/:id',auth[_0x76d3('0xd')](),controller[_0x76d3('0x13')]);module[_0x76d3('0x14')]=router;
\ No newline at end of file
+var _0xe2ab=['post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','show'];(function(_0x1f4a04,_0xe94ea4){var _0x571e6c=function(_0x3dc438){while(--_0x3dc438){_0x1f4a04['push'](_0x1f4a04['shift']());}};_0x571e6c(++_0xe94ea4);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x487466,_0x5ef7ca){_0x487466=_0x487466-0x0;var _0x357288=_0xe2ab[_0x487466];return _0x357288;};'use strict';var multer=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var path=require(_0xbe2a('0x2'));var timeout=require(_0xbe2a('0x3'));var express=require(_0xbe2a('0x4'));var router=express[_0xbe2a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbe2a('0x6'));var interaction=require(_0xbe2a('0x7'));var config=require(_0xbe2a('0x8'));var controller=require(_0xbe2a('0x9'));router['get']('/',auth[_0xbe2a('0xa')](),controller['index']);router[_0xbe2a('0xb')]('/:id',auth[_0xbe2a('0xa')](),controller[_0xbe2a('0xc')]);router[_0xbe2a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbe2a('0xe')](_0xbe2a('0xf'),auth['isAuthenticated'](),controller[_0xbe2a('0x10')]);router[_0xbe2a('0x11')](_0xbe2a('0xf'),auth[_0xbe2a('0xa')](),controller[_0xbe2a('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 910f149..aa3e58a 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 _0x86d7=['exports','STRING','name','sequelize'];(function(_0x38fc43,_0x3f6da7){var _0x105d2b=function(_0xfdb936){while(--_0xfdb936){_0x38fc43['push'](_0x38fc43['shift']());}};_0x105d2b(++_0x3f6da7);}(_0x86d7,0x8b));var _0x786d=function(_0x220a5c,_0x28c337){_0x220a5c=_0x220a5c-0x0;var _0x17997e=_0x86d7[_0x220a5c];return _0x17997e;};'use strict';var Sequelize=require(_0x786d('0x0'));module[_0x786d('0x1')]={'name':{'type':Sequelize[_0x786d('0x2')],'unique':_0x786d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x786d('0x2')]},'companyId':{'type':Sequelize[_0x786d('0x2')]},'website':{'type':Sequelize[_0x786d('0x2')]},'phone':{'type':Sequelize[_0x786d('0x2')]},'fax':{'type':Sequelize[_0x786d('0x2')]},'type':{'type':Sequelize[_0x786d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x786d('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x786d('0x2')]},'email':{'type':Sequelize[_0x786d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x786d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x786d('0x2')]},'sCity':{'type':Sequelize[_0x786d('0x2')]},'sCountry':{'type':Sequelize[_0x786d('0x2')]},'description':{'type':Sequelize[_0x786d('0x2')]}};
\ No newline at end of file
+var _0xa5a4=['name','sequelize','exports','STRING'];(function(_0x1e606c,_0x4660d9){var _0x6e12b9=function(_0x3bae03){while(--_0x3bae03){_0x1e606c['push'](_0x1e606c['shift']());}};_0x6e12b9(++_0x4660d9);}(_0xa5a4,0x1c5));var _0x4a5a=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xa5a4[_0x1347f8];return _0x218368;};'use strict';var Sequelize=require(_0x4a5a('0x0'));module[_0x4a5a('0x1')]={'name':{'type':Sequelize[_0x4a5a('0x2')],'unique':_0x4a5a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4a5a('0x2')]},'website':{'type':Sequelize[_0x4a5a('0x2')]},'phone':{'type':Sequelize[_0x4a5a('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4a5a('0x2')]},'street':{'type':Sequelize[_0x4a5a('0x2')]},'postalCode':{'type':Sequelize[_0x4a5a('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4a5a('0x2')]},'email':{'type':Sequelize[_0x4a5a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4a5a('0x2')]},'sStreet':{'type':Sequelize[_0x4a5a('0x2')]},'sPostalCode':{'type':Sequelize[_0x4a5a('0x2')]},'sCity':{'type':Sequelize[_0x4a5a('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4a5a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 52542ca..9736f84 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 _0xf9dd=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','getContacts','findOne','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','options','includeAll','findAll','rows','catch','show','rawAttributes','include','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x338e1c,_0x55c25d){var _0x48d1fb=function(_0x5de705){while(--_0x5de705){_0x338e1c['push'](_0x338e1c['shift']());}};_0x48d1fb(++_0x55c25d);}(_0xf9dd,0x1af));var _0xdf9d=function(_0x3cf54a,_0x358eca){_0x3cf54a=_0x3cf54a-0x0;var _0xabe334=_0xf9dd[_0x3cf54a];return _0xabe334;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf9d('0x0'));var jsonpatch=require(_0xdf9d('0x1'));var rp=require(_0xdf9d('0x2'));var moment=require('moment');var BPromise=require(_0xdf9d('0x3'));var Mustache=require(_0xdf9d('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdf9d('0x5'));var ejs=require(_0xdf9d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdf9d('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xdf9d('0x8'));var toCsv=require(_0xdf9d('0x5'));var querystring=require(_0xdf9d('0x9'));var Papa=require(_0xdf9d('0xa'));var Redis=require(_0xdf9d('0xb'));var authService=require(_0xdf9d('0xc'));var qs=require(_0xdf9d('0xd'));var as=require(_0xdf9d('0xe'));var hardwareService=require(_0xdf9d('0xf'));var logger=require(_0xdf9d('0x10'))(_0xdf9d('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdf9d('0x12'));var db=require(_0xdf9d('0x13'))['db'];function respondWithStatusCode(_0x109f66,_0x45ab22){_0x45ab22=_0x45ab22||0xcc;return function(_0xed1821){if(_0xed1821){return _0x109f66[_0xdf9d('0x14')](_0x45ab22);}return _0x109f66[_0xdf9d('0x15')](_0x45ab22)[_0xdf9d('0x16')]();};}function respondWithResult(_0x3b91db,_0x5ca041){_0x5ca041=_0x5ca041||0xc8;return function(_0x523ea0){if(_0x523ea0){return _0x3b91db['status'](_0x5ca041)[_0xdf9d('0x17')](_0x523ea0);}};}function respondWithFilteredResult(_0xd115c0,_0x1de454){return function(_0x124b57){if(_0x124b57){var _0x219ca7=typeof _0x1de454[_0xdf9d('0x18')]===_0xdf9d('0x19')&&typeof _0x1de454['limit']===_0xdf9d('0x19');var _0x1c55d8=_0x124b57[_0xdf9d('0x1a')];var _0x388472=_0x219ca7?0x0:_0x1de454[_0xdf9d('0x18')];var _0x346ca8=_0x219ca7?_0x124b57[_0xdf9d('0x1a')]:_0x1de454[_0xdf9d('0x18')]+_0x1de454[_0xdf9d('0x1b')];var _0x2a27c0;if(_0x346ca8>=_0x1c55d8){_0x346ca8=_0x1c55d8;_0x2a27c0=0xc8;}else{_0x2a27c0=0xce;}_0xd115c0['status'](_0x2a27c0);return _0xd115c0[_0xdf9d('0x1c')]('Content-Range',_0x388472+'-'+_0x346ca8+'/'+_0x1c55d8)[_0xdf9d('0x17')](_0x124b57);}return null;};}function patchUpdates(_0x3b94b0){return function(_0x3cf72f){try{jsonpatch[_0xdf9d('0x1d')](_0x3cf72f,_0x3b94b0,!![]);}catch(_0x117832){return BPromise['reject'](_0x117832);}return _0x3cf72f[_0xdf9d('0x1e')]();};}function saveUpdates(_0x3b799e,_0x3e69d5){return function(_0x593e4f){if(_0x593e4f){return _0x593e4f[_0xdf9d('0x1f')](_0x3b799e)[_0xdf9d('0x20')](function(_0x16b319){return _0x16b319;});}return null;};}function removeEntity(_0x1bbd6b,_0x4da3b4){return function(_0x5c5017){if(_0x5c5017){return _0x5c5017[_0xdf9d('0x21')]()[_0xdf9d('0x20')](function(){var _0x2c9b47=_0x5c5017[_0xdf9d('0x22')]({'plain':!![]});var _0x300fd0=_0xdf9d('0x23');return db[_0xdf9d('0x24')]['destroy']({'where':{'type':_0x300fd0,'resourceId':_0x2c9b47['id']}})['then'](function(){return _0x5c5017;});})['then'](function(){_0x1bbd6b[_0xdf9d('0x15')](0xcc)[_0xdf9d('0x16')]();});}};}function handleEntityNotFound(_0x193dfd,_0x1c7537){return function(_0x388eb1){if(!_0x388eb1){_0x193dfd[_0xdf9d('0x14')](0x194);}return _0x388eb1;};}function handleError(_0x1662ab,_0x15ee2d){_0x15ee2d=_0x15ee2d||0x1f4;return function(_0x485f5f){logger[_0xdf9d('0x25')](_0x485f5f[_0xdf9d('0x26')]);if(_0x485f5f[_0xdf9d('0x27')]){delete _0x485f5f[_0xdf9d('0x27')];}_0x1662ab['status'](_0x15ee2d)['send'](_0x485f5f);};}exports[_0xdf9d('0x28')]=function(_0x52679e,_0x109142){var _0x2ebda9={},_0x5166c6={},_0x493e9c={'count':0x0,'rows':[]};return db[_0xdf9d('0x29')][_0xdf9d('0x2a')]()[_0xdf9d('0x20')](function(_0x560ed1){_0x5166c6[_0xdf9d('0x2b')]=_[_0xdf9d('0x2c')](_0x560ed1);_0x5166c6[_0xdf9d('0x2d')]=_[_0xdf9d('0x2c')](_0x52679e['query']);_0x5166c6[_0xdf9d('0x2e')]=_[_0xdf9d('0x2f')](_0x5166c6[_0xdf9d('0x2b')],_0x5166c6[_0xdf9d('0x2d')]);_0x2ebda9[_0xdf9d('0x30')]=_[_0xdf9d('0x2f')](_0x5166c6['model'],qs[_0xdf9d('0x31')](_0x52679e[_0xdf9d('0x2d')]['fields']));_0x2ebda9[_0xdf9d('0x30')]=_0x2ebda9['attributes'][_0xdf9d('0x32')]?_0x2ebda9[_0xdf9d('0x30')]:_0x5166c6['model'];if(!_0x52679e[_0xdf9d('0x2d')][_0xdf9d('0x33')](_0xdf9d('0x34'))){_0x2ebda9[_0xdf9d('0x1b')]=qs[_0xdf9d('0x1b')](_0x52679e[_0xdf9d('0x2d')][_0xdf9d('0x1b')]);_0x2ebda9[_0xdf9d('0x18')]=qs['offset'](_0x52679e[_0xdf9d('0x2d')]['offset']);}_0x2ebda9[_0xdf9d('0x35')]=qs[_0xdf9d('0x36')](_0x52679e[_0xdf9d('0x2d')]['sort']);_0x2ebda9[_0xdf9d('0x37')]=qs[_0xdf9d('0x2e')](_[_0xdf9d('0x38')](_0x52679e[_0xdf9d('0x2d')],_0x5166c6[_0xdf9d('0x2e')]),_0x560ed1);if(_0x52679e[_0xdf9d('0x2d')][_0xdf9d('0x39')]){_0x2ebda9[_0xdf9d('0x37')]=_['merge'](_0x2ebda9[_0xdf9d('0x37')],{'$or':_[_0xdf9d('0x3a')](_0x2ebda9[_0xdf9d('0x30')],function(_0x1f7a4c){var _0x372053={};_0x372053[_0x1f7a4c]={'$like':'%'+_0x52679e['query'][_0xdf9d('0x39')]+'%'};return _0x372053;})});}_0x2ebda9=_['merge']({},_0x2ebda9,_0x52679e[_0xdf9d('0x3b')]);var _0x554177={'where':_0x2ebda9['where']};return db['CmCompany'][_0xdf9d('0x1a')](_0x554177)[_0xdf9d('0x20')](function(_0x498704){_0x493e9c[_0xdf9d('0x1a')]=_0x498704;if(_0x52679e[_0xdf9d('0x2d')][_0xdf9d('0x3c')]){_0x2ebda9['include']=[{'all':!![]}];}return db[_0xdf9d('0x29')][_0xdf9d('0x3d')](_0x2ebda9);})[_0xdf9d('0x20')](function(_0xdded59){_0x493e9c[_0xdf9d('0x3e')]=_0xdded59;return _0x493e9c;})['then'](respondWithFilteredResult(_0x109142,_0x2ebda9))[_0xdf9d('0x3f')](handleError(_0x109142,null));})['catch'](handleError(_0x109142,null));};exports[_0xdf9d('0x40')]=function(_0xfa71f3,_0x9a288){var _0x4d3624={'raw':![],'where':{'id':_0xfa71f3['params']['id']}},_0x3b0e9b={};_0x3b0e9b[_0xdf9d('0x2b')]=_[_0xdf9d('0x2c')](db[_0xdf9d('0x29')][_0xdf9d('0x41')]);_0x3b0e9b[_0xdf9d('0x2d')]=_[_0xdf9d('0x2c')](_0xfa71f3[_0xdf9d('0x2d')]);_0x3b0e9b[_0xdf9d('0x2e')]=_[_0xdf9d('0x2f')](_0x3b0e9b[_0xdf9d('0x2b')],_0x3b0e9b[_0xdf9d('0x2d')]);_0x4d3624[_0xdf9d('0x30')]=_[_0xdf9d('0x2f')](_0x3b0e9b[_0xdf9d('0x2b')],qs['fields'](_0xfa71f3[_0xdf9d('0x2d')][_0xdf9d('0x31')]));_0x4d3624[_0xdf9d('0x30')]=_0x4d3624['attributes'][_0xdf9d('0x32')]?_0x4d3624[_0xdf9d('0x30')]:_0x3b0e9b[_0xdf9d('0x2b')];if(_0xfa71f3[_0xdf9d('0x2d')]['includeAll']){_0x4d3624[_0xdf9d('0x42')]=[{'all':!![]}];}_0x4d3624=_[_0xdf9d('0x43')]({},_0x4d3624,_0xfa71f3[_0xdf9d('0x3b')]);return db[_0xdf9d('0x29')][_0xdf9d('0x44')](_0x4d3624)['then'](handleEntityNotFound(_0x9a288,null))[_0xdf9d('0x20')](respondWithResult(_0x9a288,null))['catch'](handleError(_0x9a288,null));};exports['create']=function(_0x1b2518,_0x306f9f){return db[_0xdf9d('0x29')][_0xdf9d('0x45')](_0x1b2518['body'],{})[_0xdf9d('0x20')](function(_0x401dd1){var _0x9b028=_0x1b2518[_0xdf9d('0x46')][_0xdf9d('0x22')]({'plain':!![]});if(!_0x9b028)throw new Error(_0xdf9d('0x47'));if(_0x9b028[_0xdf9d('0x48')]===_0xdf9d('0x46')){var _0x1721d2=_0x401dd1['get']({'plain':!![]});var _0x26e1e5='Companies';return db[_0xdf9d('0x49')]['find']({'where':{'name':_0x26e1e5,'userProfileId':_0x9b028[_0xdf9d('0x4a')]},'raw':!![]})['then'](function(_0x10ebd4){if(_0x10ebd4&&_0x10ebd4[_0xdf9d('0x4b')]===0x0){return db[_0xdf9d('0x24')][_0xdf9d('0x45')]({'name':_0x1721d2[_0xdf9d('0x27')],'resourceId':_0x1721d2['id'],'type':_0x10ebd4['name'],'sectionId':_0x10ebd4['id']},{})['then'](function(){return _0x401dd1;});}else{return _0x401dd1;}})[_0xdf9d('0x3f')](function(_0x15d683){logger[_0xdf9d('0x25')](_0xdf9d('0x4c'),_0x15d683);throw _0x15d683;});}return _0x401dd1;})[_0xdf9d('0x20')](respondWithResult(_0x306f9f,0xc9))[_0xdf9d('0x3f')](handleError(_0x306f9f,null));};exports[_0xdf9d('0x1f')]=function(_0x24b456,_0xe5032b){if(_0x24b456['body']['id']){delete _0x24b456[_0xdf9d('0x4d')]['id'];}return db['CmCompany'][_0xdf9d('0x44')]({'where':{'id':_0x24b456[_0xdf9d('0x4e')]['id']}})[_0xdf9d('0x20')](handleEntityNotFound(_0xe5032b,null))[_0xdf9d('0x20')](saveUpdates(_0x24b456[_0xdf9d('0x4d')],null))[_0xdf9d('0x20')](respondWithResult(_0xe5032b,null))['catch'](handleError(_0xe5032b,null));};exports['destroy']=function(_0x11659c,_0x1d2344){return db[_0xdf9d('0x29')][_0xdf9d('0x44')]({'where':{'id':_0x11659c[_0xdf9d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1d2344,null))[_0xdf9d('0x20')](removeEntity(_0x1d2344,null))['catch'](handleError(_0x1d2344,null));};exports[_0xdf9d('0x2a')]=function(_0x552c33,_0x36d308){return db[_0xdf9d('0x29')][_0xdf9d('0x2a')]()[_0xdf9d('0x20')](respondWithResult(_0x36d308,null))[_0xdf9d('0x3f')](handleError(_0x36d308,null));};exports[_0xdf9d('0x4f')]=function(_0x4bc8e5,_0x384335,_0x3352d7){return db[_0xdf9d('0x50')][_0xdf9d('0x44')]({'where':{'id':_0x4bc8e5[_0xdf9d('0x4e')]['id']}})[_0xdf9d('0x20')](handleEntityNotFound(_0x384335,null))[_0xdf9d('0x20')](function(_0xd8881c){if(_0xd8881c){return _0xd8881c['addContacts'](_0x4bc8e5['body']['ids'],_[_0xdf9d('0x51')](_0x4bc8e5['body'],['ids','id'])||{});}})[_0xdf9d('0x20')](respondWithResult(_0x384335,null))[_0xdf9d('0x3f')](handleError(_0x384335,null));};exports[_0xdf9d('0x52')]=function(_0xf3dea,_0x5e1439,_0x279843){var _0x3bc1ef={};var _0xc5eb28={};var _0x5327d1;var _0x540e97;return db[_0xdf9d('0x29')][_0xdf9d('0x53')]({'where':{'id':_0xf3dea[_0xdf9d('0x4e')]['id']}})[_0xdf9d('0x20')](handleEntityNotFound(_0x5e1439,null))['then'](function(_0xd76621){if(_0xd76621){_0x5327d1=_0xd76621;_0xc5eb28[_0xdf9d('0x2b')]=_[_0xdf9d('0x2c')](db[_0xdf9d('0x50')][_0xdf9d('0x41')]);_0xc5eb28[_0xdf9d('0x2d')]=_[_0xdf9d('0x2c')](_0xf3dea[_0xdf9d('0x2d')]);_0xc5eb28[_0xdf9d('0x2e')]=_['intersection'](_0xc5eb28[_0xdf9d('0x2b')],_0xc5eb28[_0xdf9d('0x2d')]);_0x3bc1ef[_0xdf9d('0x30')]=_['intersection'](_0xc5eb28[_0xdf9d('0x2b')],qs[_0xdf9d('0x31')](_0xf3dea['query'][_0xdf9d('0x31')]));_0x3bc1ef[_0xdf9d('0x30')]=_0x3bc1ef[_0xdf9d('0x30')][_0xdf9d('0x32')]?_0x3bc1ef[_0xdf9d('0x30')]:_0xc5eb28['model'];_0x3bc1ef['order']=qs[_0xdf9d('0x36')](_0xf3dea[_0xdf9d('0x2d')][_0xdf9d('0x36')]);_0x3bc1ef['where']=qs[_0xdf9d('0x2e')](_[_0xdf9d('0x38')](_0xf3dea[_0xdf9d('0x2d')],_0xc5eb28[_0xdf9d('0x2e')]));if(_0xf3dea[_0xdf9d('0x2d')]['filter']){_0x3bc1ef[_0xdf9d('0x37')]=_[_0xdf9d('0x43')](_0x3bc1ef[_0xdf9d('0x37')],{'$or':_['map'](_0x3bc1ef[_0xdf9d('0x30')],function(_0x204db3){var _0x154aba={};_0x154aba[_0x204db3]={'$like':'%'+_0xf3dea[_0xdf9d('0x2d')][_0xdf9d('0x39')]+'%'};return _0x154aba;})});}_0x3bc1ef=_[_0xdf9d('0x43')]({},_0x3bc1ef,_0xf3dea['options']);return _0x5327d1['getContacts'](_0x3bc1ef);}})[_0xdf9d('0x20')](function(_0x3cfb2f){if(_0x3cfb2f){_0x540e97=_0x3cfb2f[_0xdf9d('0x32')];if(!_0xf3dea[_0xdf9d('0x2d')][_0xdf9d('0x33')]('nolimit')){_0x3bc1ef[_0xdf9d('0x1b')]=qs[_0xdf9d('0x1b')](_0xf3dea[_0xdf9d('0x2d')][_0xdf9d('0x1b')]);_0x3bc1ef['offset']=qs['offset'](_0xf3dea[_0xdf9d('0x2d')][_0xdf9d('0x18')]);}return _0x5327d1[_0xdf9d('0x52')](_0x3bc1ef);}})['then'](function(_0x42e52b){if(_0x42e52b){return _0x42e52b?{'count':_0x540e97,'rows':_0x42e52b}:null;}})['then'](respondWithResult(_0x5e1439,null))[_0xdf9d('0x3f')](handleError(_0x5e1439,null));};
\ No newline at end of file
+var _0x1030=['rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','addContacts','omit','ids','findOne','CmContact','filter','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','include','findAll','rows','catch','show','params'];(function(_0x19c5dd,_0x2a35f5){var _0x40218d=function(_0x1a07ad){while(--_0x1a07ad){_0x19c5dd['push'](_0x19c5dd['shift']());}};_0x40218d(++_0x2a35f5);}(_0x1030,0x172));var _0x0103=function(_0x3223db,_0x2088f9){_0x3223db=_0x3223db-0x0;var _0x22a13b=_0x1030[_0x3223db];return _0x22a13b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0103('0x0'));var zipdir=require(_0x0103('0x1'));var jsonpatch=require(_0x0103('0x2'));var rp=require('request-promise');var moment=require(_0x0103('0x3'));var BPromise=require(_0x0103('0x4'));var Mustache=require(_0x0103('0x5'));var util=require(_0x0103('0x6'));var path=require(_0x0103('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0103('0x8'));var _=require(_0x0103('0x9'));var squel=require('squel');var crypto=require(_0x0103('0xa'));var jsforce=require(_0x0103('0xb'));var deskjs=require(_0x0103('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0103('0xd'));var Papa=require(_0x0103('0xe'));var Redis=require(_0x0103('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0103('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0103('0x11'));var logger=require(_0x0103('0x12'))(_0x0103('0x13'));var utils=require(_0x0103('0x14'));var config=require(_0x0103('0x15'));var licenseUtil=require(_0x0103('0x16'));var db=require(_0x0103('0x17'))['db'];function respondWithStatusCode(_0x349fa4,_0x4244b7){_0x4244b7=_0x4244b7||0xcc;return function(_0xc63297){if(_0xc63297){return _0x349fa4['sendStatus'](_0x4244b7);}return _0x349fa4[_0x0103('0x18')](_0x4244b7)[_0x0103('0x19')]();};}function respondWithResult(_0x26524a,_0x2eb01d){_0x2eb01d=_0x2eb01d||0xc8;return function(_0x1dc6c0){if(_0x1dc6c0){return _0x26524a[_0x0103('0x18')](_0x2eb01d)[_0x0103('0x1a')](_0x1dc6c0);}};}function respondWithFilteredResult(_0xa54158,_0x4ebf53){return function(_0x1c7e46){if(_0x1c7e46){var _0x1a3689=typeof _0x4ebf53['offset']===_0x0103('0x1b')&&typeof _0x4ebf53[_0x0103('0x1c')]===_0x0103('0x1b');var _0x307752=_0x1c7e46['count'];var _0x4639af=_0x1a3689?0x0:_0x4ebf53[_0x0103('0x1d')];var _0x1dd112=_0x1a3689?_0x1c7e46[_0x0103('0x1e')]:_0x4ebf53[_0x0103('0x1d')]+_0x4ebf53['limit'];var _0x5dbadf;if(_0x1dd112>=_0x307752){_0x1dd112=_0x307752;_0x5dbadf=0xc8;}else{_0x5dbadf=0xce;}_0xa54158[_0x0103('0x18')](_0x5dbadf);return _0xa54158['set'](_0x0103('0x1f'),_0x4639af+'-'+_0x1dd112+'/'+_0x307752)['json'](_0x1c7e46);}return null;};}function patchUpdates(_0x2f5606){return function(_0x516c97){try{jsonpatch[_0x0103('0x20')](_0x516c97,_0x2f5606,!![]);}catch(_0x3d64bc){return BPromise[_0x0103('0x21')](_0x3d64bc);}return _0x516c97[_0x0103('0x22')]();};}function saveUpdates(_0x176be3,_0x2942bb){return function(_0x154989){if(_0x154989){return _0x154989[_0x0103('0x23')](_0x176be3)[_0x0103('0x24')](function(_0x38d979){return _0x38d979;});}return null;};}function removeEntity(_0x150673,_0x36fb75){return function(_0x330f1f){if(_0x330f1f){return _0x330f1f[_0x0103('0x25')]()['then'](function(){var _0x1c4a30=_0x330f1f['get']({'plain':!![]});var _0x2bc997=_0x0103('0x26');return db[_0x0103('0x27')][_0x0103('0x25')]({'where':{'type':_0x2bc997,'resourceId':_0x1c4a30['id']}})[_0x0103('0x24')](function(){return _0x330f1f;});})[_0x0103('0x24')](function(){_0x150673[_0x0103('0x18')](0xcc)[_0x0103('0x19')]();});}};}function handleEntityNotFound(_0x502b25,_0x456478){return function(_0x487eb4){if(!_0x487eb4){_0x502b25[_0x0103('0x28')](0x194);}return _0x487eb4;};}function handleError(_0x59c50b,_0x2e0223){_0x2e0223=_0x2e0223||0x1f4;return function(_0x531773){logger[_0x0103('0x29')](_0x531773[_0x0103('0x2a')]);if(_0x531773[_0x0103('0x2b')]){delete _0x531773[_0x0103('0x2b')];}_0x59c50b[_0x0103('0x18')](_0x2e0223)[_0x0103('0x2c')](_0x531773);};}exports[_0x0103('0x2d')]=function(_0x7f7ecf,_0x1ec31e){var _0x554382={},_0x3ccc96={},_0x1c61e9={'count':0x0,'rows':[]};return db[_0x0103('0x2e')][_0x0103('0x2f')]()[_0x0103('0x24')](function(_0x40eae3){_0x3ccc96[_0x0103('0x30')]=_[_0x0103('0x31')](_0x40eae3);_0x3ccc96[_0x0103('0x32')]=_[_0x0103('0x31')](_0x7f7ecf[_0x0103('0x32')]);_0x3ccc96[_0x0103('0x33')]=_[_0x0103('0x34')](_0x3ccc96[_0x0103('0x30')],_0x3ccc96[_0x0103('0x32')]);_0x554382[_0x0103('0x35')]=_['intersection'](_0x3ccc96[_0x0103('0x30')],qs[_0x0103('0x36')](_0x7f7ecf[_0x0103('0x32')]['fields']));_0x554382['attributes']=_0x554382['attributes'][_0x0103('0x37')]?_0x554382[_0x0103('0x35')]:_0x3ccc96['model'];if(!_0x7f7ecf['query'][_0x0103('0x38')](_0x0103('0x39'))){_0x554382[_0x0103('0x1c')]=qs[_0x0103('0x1c')](_0x7f7ecf[_0x0103('0x32')][_0x0103('0x1c')]);_0x554382[_0x0103('0x1d')]=qs[_0x0103('0x1d')](_0x7f7ecf[_0x0103('0x32')][_0x0103('0x1d')]);}_0x554382[_0x0103('0x3a')]=qs[_0x0103('0x3b')](_0x7f7ecf[_0x0103('0x32')][_0x0103('0x3b')]);_0x554382['where']=qs['filters'](_[_0x0103('0x3c')](_0x7f7ecf['query'],_0x3ccc96[_0x0103('0x33')]),_0x40eae3);if(_0x7f7ecf['query']['filter']){_0x554382[_0x0103('0x3d')]=_[_0x0103('0x3e')](_0x554382[_0x0103('0x3d')],{'$or':_[_0x0103('0x3f')](_0x554382[_0x0103('0x35')],function(_0x53afaa){var _0x41772f={};_0x41772f[_0x53afaa]={'$like':'%'+_0x7f7ecf[_0x0103('0x32')]['filter']+'%'};return _0x41772f;})});}_0x554382=_[_0x0103('0x3e')]({},_0x554382,_0x7f7ecf['options']);var _0x404fad={'where':_0x554382[_0x0103('0x3d')]};return db[_0x0103('0x2e')][_0x0103('0x1e')](_0x404fad)[_0x0103('0x24')](function(_0x1ee484){_0x1c61e9[_0x0103('0x1e')]=_0x1ee484;if(_0x7f7ecf[_0x0103('0x32')]['includeAll']){_0x554382[_0x0103('0x40')]=[{'all':!![]}];}return db[_0x0103('0x2e')][_0x0103('0x41')](_0x554382);})['then'](function(_0xf9ff09){_0x1c61e9[_0x0103('0x42')]=_0xf9ff09;return _0x1c61e9;})['then'](respondWithFilteredResult(_0x1ec31e,_0x554382))[_0x0103('0x43')](handleError(_0x1ec31e,null));})[_0x0103('0x43')](handleError(_0x1ec31e,null));};exports[_0x0103('0x44')]=function(_0x4b622d,_0xb4b019){var _0x5da0f5={'raw':![],'where':{'id':_0x4b622d[_0x0103('0x45')]['id']}},_0x8baa9a={};_0x8baa9a['model']=_[_0x0103('0x31')](db[_0x0103('0x2e')][_0x0103('0x46')]);_0x8baa9a[_0x0103('0x32')]=_['keys'](_0x4b622d[_0x0103('0x32')]);_0x8baa9a[_0x0103('0x33')]=_[_0x0103('0x34')](_0x8baa9a[_0x0103('0x30')],_0x8baa9a[_0x0103('0x32')]);_0x5da0f5[_0x0103('0x35')]=_[_0x0103('0x34')](_0x8baa9a[_0x0103('0x30')],qs[_0x0103('0x36')](_0x4b622d[_0x0103('0x32')][_0x0103('0x36')]));_0x5da0f5[_0x0103('0x35')]=_0x5da0f5[_0x0103('0x35')][_0x0103('0x37')]?_0x5da0f5[_0x0103('0x35')]:_0x8baa9a['model'];if(_0x4b622d[_0x0103('0x32')]['includeAll']){_0x5da0f5['include']=[{'all':!![]}];}_0x5da0f5=_['merge']({},_0x5da0f5,_0x4b622d['options']);return db[_0x0103('0x2e')][_0x0103('0x47')](_0x5da0f5)[_0x0103('0x24')](handleEntityNotFound(_0xb4b019,null))['then'](respondWithResult(_0xb4b019,null))['catch'](handleError(_0xb4b019,null));};exports[_0x0103('0x48')]=function(_0x3876e7,_0x4ae201){return db['CmCompany']['create'](_0x3876e7[_0x0103('0x49')],{})[_0x0103('0x24')](function(_0x1c964e){var _0x3cf65e=_0x3876e7[_0x0103('0x4a')][_0x0103('0x4b')]({'plain':!![]});if(!_0x3cf65e)throw new Error(_0x0103('0x4c'));if(_0x3cf65e[_0x0103('0x4d')]==='user'){var _0x5a118d=_0x1c964e[_0x0103('0x4b')]({'plain':!![]});var _0x34124f='Companies';return db[_0x0103('0x4e')]['find']({'where':{'name':_0x34124f,'userProfileId':_0x3cf65e[_0x0103('0x4f')]},'raw':!![]})[_0x0103('0x24')](function(_0x408b1f){if(_0x408b1f&&_0x408b1f[_0x0103('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a118d[_0x0103('0x2b')],'resourceId':_0x5a118d['id'],'type':_0x408b1f[_0x0103('0x2b')],'sectionId':_0x408b1f['id']},{})['then'](function(){return _0x1c964e;});}else{return _0x1c964e;}})[_0x0103('0x43')](function(_0x4d8eed){logger[_0x0103('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d8eed);throw _0x4d8eed;});}return _0x1c964e;})[_0x0103('0x24')](respondWithResult(_0x4ae201,0xc9))[_0x0103('0x43')](handleError(_0x4ae201,null));};exports[_0x0103('0x23')]=function(_0xccf3cb,_0x44fd83){if(_0xccf3cb['body']['id']){delete _0xccf3cb[_0x0103('0x49')]['id'];}return db[_0x0103('0x2e')]['find']({'where':{'id':_0xccf3cb[_0x0103('0x45')]['id']}})[_0x0103('0x24')](handleEntityNotFound(_0x44fd83,null))[_0x0103('0x24')](saveUpdates(_0xccf3cb[_0x0103('0x49')],null))['then'](respondWithResult(_0x44fd83,null))[_0x0103('0x43')](handleError(_0x44fd83,null));};exports[_0x0103('0x25')]=function(_0x1fe7bb,_0xa4fdb7){return db[_0x0103('0x2e')][_0x0103('0x47')]({'where':{'id':_0x1fe7bb[_0x0103('0x45')]['id']}})['then'](handleEntityNotFound(_0xa4fdb7,null))['then'](removeEntity(_0xa4fdb7,null))[_0x0103('0x43')](handleError(_0xa4fdb7,null));};exports[_0x0103('0x2f')]=function(_0xf4ced4,_0x547e27){return db['CmCompany']['describe']()[_0x0103('0x24')](respondWithResult(_0x547e27,null))['catch'](handleError(_0x547e27,null));};exports[_0x0103('0x51')]=function(_0x4440ad,_0x3df487,_0x2a2ad1){return db['CmContact']['find']({'where':{'id':_0x4440ad[_0x0103('0x45')]['id']}})[_0x0103('0x24')](handleEntityNotFound(_0x3df487,null))[_0x0103('0x24')](function(_0x2d8f98){if(_0x2d8f98){return _0x2d8f98['addContacts'](_0x4440ad[_0x0103('0x49')]['ids'],_[_0x0103('0x52')](_0x4440ad[_0x0103('0x49')],[_0x0103('0x53'),'id'])||{});}})[_0x0103('0x24')](respondWithResult(_0x3df487,null))[_0x0103('0x43')](handleError(_0x3df487,null));};exports['getContacts']=function(_0x23ecbb,_0x663d2b,_0x394e34){var _0xd2522b={};var _0x54e3e3={};var _0x8ac2cc;var _0x278b99;return db[_0x0103('0x2e')][_0x0103('0x54')]({'where':{'id':_0x23ecbb[_0x0103('0x45')]['id']}})[_0x0103('0x24')](handleEntityNotFound(_0x663d2b,null))[_0x0103('0x24')](function(_0xae7f0d){if(_0xae7f0d){_0x8ac2cc=_0xae7f0d;_0x54e3e3[_0x0103('0x30')]=_[_0x0103('0x31')](db[_0x0103('0x55')]['rawAttributes']);_0x54e3e3[_0x0103('0x32')]=_[_0x0103('0x31')](_0x23ecbb[_0x0103('0x32')]);_0x54e3e3[_0x0103('0x33')]=_[_0x0103('0x34')](_0x54e3e3[_0x0103('0x30')],_0x54e3e3['query']);_0xd2522b[_0x0103('0x35')]=_[_0x0103('0x34')](_0x54e3e3[_0x0103('0x30')],qs[_0x0103('0x36')](_0x23ecbb[_0x0103('0x32')][_0x0103('0x36')]));_0xd2522b[_0x0103('0x35')]=_0xd2522b[_0x0103('0x35')]['length']?_0xd2522b[_0x0103('0x35')]:_0x54e3e3[_0x0103('0x30')];_0xd2522b[_0x0103('0x3a')]=qs[_0x0103('0x3b')](_0x23ecbb[_0x0103('0x32')][_0x0103('0x3b')]);_0xd2522b[_0x0103('0x3d')]=qs[_0x0103('0x33')](_['pick'](_0x23ecbb[_0x0103('0x32')],_0x54e3e3[_0x0103('0x33')]));if(_0x23ecbb[_0x0103('0x32')]['filter']){_0xd2522b[_0x0103('0x3d')]=_[_0x0103('0x3e')](_0xd2522b[_0x0103('0x3d')],{'$or':_['map'](_0xd2522b[_0x0103('0x35')],function(_0x7af21d){var _0xb1a92={};_0xb1a92[_0x7af21d]={'$like':'%'+_0x23ecbb[_0x0103('0x32')][_0x0103('0x56')]+'%'};return _0xb1a92;})});}_0xd2522b=_[_0x0103('0x3e')]({},_0xd2522b,_0x23ecbb['options']);return _0x8ac2cc[_0x0103('0x57')](_0xd2522b);}})[_0x0103('0x24')](function(_0x3eda8e){if(_0x3eda8e){_0x278b99=_0x3eda8e['length'];if(!_0x23ecbb[_0x0103('0x32')][_0x0103('0x38')](_0x0103('0x39'))){_0xd2522b[_0x0103('0x1c')]=qs[_0x0103('0x1c')](_0x23ecbb[_0x0103('0x32')]['limit']);_0xd2522b[_0x0103('0x1d')]=qs['offset'](_0x23ecbb[_0x0103('0x32')][_0x0103('0x1d')]);}return _0x8ac2cc[_0x0103('0x57')](_0xd2522b);}})[_0x0103('0x24')](function(_0x152c6f){if(_0x152c6f){return _0x152c6f?{'count':_0x278b99,'rows':_0x152c6f}:null;}})[_0x0103('0x24')](respondWithResult(_0x663d2b,null))[_0x0103('0x43')](handleError(_0x663d2b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 6e953ff..7901c42 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 _0xc78f=['rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4246c1,_0x5be3a8){var _0x4b4de8=function(_0x51b71e){while(--_0x51b71e){_0x4246c1['push'](_0x4246c1['shift']());}};_0x4b4de8(++_0x5be3a8);}(_0xc78f,0xea));var _0xfc78=function(_0x400999,_0x432545){_0x400999=_0x400999-0x0;var _0x30b415=_0xc78f[_0x400999];return _0x30b415;};'use strict';var _=require(_0xfc78('0x0'));var util=require(_0xfc78('0x1'));var logger=require(_0xfc78('0x2'))('api');var moment=require(_0xfc78('0x3'));var BPromise=require(_0xfc78('0x4'));var rp=require(_0xfc78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc78('0x6'));var config=require(_0xfc78('0x7'));var attributes=require(_0xfc78('0x8'));module['exports']=function(_0x2a30a0,_0x2bd4e6){return _0x2a30a0[_0xfc78('0x9')](_0xfc78('0xa'),attributes,{'tableName':_0xfc78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c5d=['moment','bluebird','request-promise','./cmCompany.attributes','define','cm_companies','lodash','../../config/logger'];(function(_0x105c57,_0x2dbbb0){var _0x1a57f9=function(_0x273817){while(--_0x273817){_0x105c57['push'](_0x105c57['shift']());}};_0x1a57f9(++_0x2dbbb0);}(_0x3c5d,0xb6));var _0xd3c5=function(_0x5db7da,_0x27b7ad){_0x5db7da=_0x5db7da-0x0;var _0x1c5330=_0x3c5d[_0x5db7da];return _0x1c5330;};'use strict';var _=require(_0xd3c5('0x0'));var util=require('util');var logger=require(_0xd3c5('0x1'))('api');var moment=require(_0xd3c5('0x2'));var BPromise=require(_0xd3c5('0x3'));var rp=require(_0xd3c5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3c5('0x5'));module['exports']=function(_0x45cb52,_0x17f8a4){return _0x45cb52[_0xd3c5('0x6')]('CmCompany',attributes,{'tableName':_0xd3c5('0x7'),'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 23d3424..4f2b874 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 _0x8c17=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4de7f7,_0x929042){var _0x396583=function(_0x40e02e){while(--_0x40e02e){_0x4de7f7['push'](_0x4de7f7['shift']());}};_0x396583(++_0x929042);}(_0x8c17,0x15d));var _0x78c1=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x8c17[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x78c1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78c1('0x1'));var db=require(_0x78c1('0x2'))['db'];var utils=require(_0x78c1('0x3'));var logger=require(_0x78c1('0x4'))(_0x78c1('0x5'));var config=require(_0x78c1('0x6'));var jayson=require(_0x78c1('0x7'));var client=jayson[_0x78c1('0x8')][_0x78c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dcac7,_0x3af08c,_0x3d1b07){return new BPromise(function(_0x279449,_0x2c8c27){return client[_0x78c1('0xa')](_0x1dcac7,_0x3d1b07)['then'](function(_0x415a90){logger[_0x78c1('0xb')](_0x78c1('0xc'),_0x3af08c,_0x78c1('0xd'));logger[_0x78c1('0xe')](_0x78c1('0xf'),_0x3af08c,_0x78c1('0xd'),JSON[_0x78c1('0x10')](_0x415a90));if(_0x415a90[_0x78c1('0x11')]){if(_0x415a90[_0x78c1('0x11')][_0x78c1('0x12')]===0x1f4){logger['error'](_0x78c1('0xc'),_0x3af08c,_0x415a90[_0x78c1('0x11')][_0x78c1('0x13')]);return _0x2c8c27(_0x415a90[_0x78c1('0x11')]['message']);}logger[_0x78c1('0x11')](_0x78c1('0xc'),_0x3af08c,_0x415a90[_0x78c1('0x11')][_0x78c1('0x13')]);return _0x279449(_0x415a90[_0x78c1('0x11')][_0x78c1('0x13')]);}else{logger[_0x78c1('0xb')](_0x78c1('0xc'),_0x3af08c,_0x78c1('0xd'));_0x279449(_0x415a90['result']['message']);}})['catch'](function(_0x4b0b5e){logger[_0x78c1('0x11')](_0x78c1('0xc'),_0x3af08c,_0x4b0b5e);_0x2c8c27(_0x4b0b5e);});});}
\ No newline at end of file
+var _0xe5c2=['jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','CmCompany,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xe5c2,0x1c4));var _0x2e5c=function(_0x34b6c9,_0x243b9a){_0x34b6c9=_0x34b6c9-0x0;var _0x1b9834=_0xe5c2[_0x34b6c9];return _0x1b9834;};'use strict';var _=require(_0x2e5c('0x0'));var util=require(_0x2e5c('0x1'));var moment=require('moment');var BPromise=require(_0x2e5c('0x2'));var rs=require(_0x2e5c('0x3'));var fs=require('fs');var Redis=require(_0x2e5c('0x4'));var db=require(_0x2e5c('0x5'))['db'];var utils=require(_0x2e5c('0x6'));var logger=require(_0x2e5c('0x7'))(_0x2e5c('0x8'));var config=require(_0x2e5c('0x9'));var jayson=require(_0x2e5c('0xa'));var client=jayson['client'][_0x2e5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x154c03,_0xcca93d,_0x5040f5){return new BPromise(function(_0x2a5a94,_0xeccf9d){return client[_0x2e5c('0xc')](_0x154c03,_0x5040f5)['then'](function(_0x21aced){logger[_0x2e5c('0xd')]('CmCompany,\x20%s,\x20%s',_0xcca93d,_0x2e5c('0xe'));logger[_0x2e5c('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xcca93d,'request\x20sent',JSON[_0x2e5c('0x10')](_0x21aced));if(_0x21aced[_0x2e5c('0x11')]){if(_0x21aced[_0x2e5c('0x11')][_0x2e5c('0x12')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0xcca93d,_0x21aced[_0x2e5c('0x11')][_0x2e5c('0x13')]);return _0xeccf9d(_0x21aced[_0x2e5c('0x11')]['message']);}logger['error'](_0x2e5c('0x14'),_0xcca93d,_0x21aced['error'][_0x2e5c('0x13')]);return _0x2a5a94(_0x21aced[_0x2e5c('0x11')][_0x2e5c('0x13')]);}else{logger[_0x2e5c('0xd')](_0x2e5c('0x14'),_0xcca93d,'request\x20sent');_0x2a5a94(_0x21aced['result']['message']);}})[_0x2e5c('0x15')](function(_0x75c626){logger[_0x2e5c('0x11')]('CmCompany,\x20%s,\x20%s',_0xcca93d,_0x75c626);_0xeccf9d(_0x75c626);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 05195fd..d3580ac 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 _0x434f=['/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x434f,0x8d));var _0xf434=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x434f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf434('0x0'));var util=require(_0xf434('0x1'));var path=require(_0xf434('0x2'));var timeout=require(_0xf434('0x3'));var express=require(_0xf434('0x4'));var router=express[_0xf434('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf434('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf434('0x7'));var controller=require(_0xf434('0x8'));router[_0xf434('0x9')]('/',auth[_0xf434('0xa')](),controller[_0xf434('0xb')]);router[_0xf434('0x9')](_0xf434('0xc'),auth['isAuthenticated'](),controller[_0xf434('0xd')]);router[_0xf434('0x9')]('/:id',auth[_0xf434('0xa')](),controller[_0xf434('0xe')]);router[_0xf434('0x9')](_0xf434('0xf'),auth[_0xf434('0xa')](),controller[_0xf434('0x10')]);router[_0xf434('0x11')]('/',auth['isAuthenticated'](),controller[_0xf434('0x12')]);router['post'](_0xf434('0xf'),auth[_0xf434('0xa')](),controller[_0xf434('0x13')]);router[_0xf434('0x14')](_0xf434('0x15'),auth[_0xf434('0xa')](),controller[_0xf434('0x16')]);router[_0xf434('0x17')](_0xf434('0x15'),auth[_0xf434('0xa')](),controller[_0xf434('0x18')]);module[_0xf434('0x19')]=router;
\ No newline at end of file
+var _0x5845=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','./cmCompany.controller','index','get','/describe','isAuthenticated','/:id','/:id/contacts','post'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5845,0x173));var _0x5584=function(_0x394c35,_0x5a84b5){_0x394c35=_0x394c35-0x0;var _0xc0e7db=_0x5845[_0x394c35];return _0xc0e7db;};'use strict';var multer=require(_0x5584('0x0'));var util=require(_0x5584('0x1'));var path=require(_0x5584('0x2'));var timeout=require(_0x5584('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5584('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5584('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x5584('0x6')]);router[_0x5584('0x7')](_0x5584('0x8'),auth[_0x5584('0x9')](),controller['describe']);router[_0x5584('0x7')](_0x5584('0xa'),auth[_0x5584('0x9')](),controller['show']);router[_0x5584('0x7')](_0x5584('0xb'),auth[_0x5584('0x9')](),controller['getContacts']);router[_0x5584('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5584('0xc')](_0x5584('0xb'),auth['isAuthenticated'](),controller['addContacts']);router['put'](_0x5584('0xa'),auth[_0x5584('0x9')](),controller['update']);router[_0x5584('0xd')]('/:id',auth[_0x5584('0x9')](),controller[_0x5584('0xe')]);module[_0x5584('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 5986884..675cfcb 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 _0x9b04=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0xfbbd40,_0x2d9d63){var _0x535f46=function(_0x1e2e46){while(--_0x1e2e46){_0xfbbd40['push'](_0xfbbd40['shift']());}};_0x535f46(++_0x2d9d63);}(_0x9b04,0x120));var _0x49b0=function(_0x3f5210,_0x32f195){_0x3f5210=_0x3f5210-0x0;var _0x53c3ab=_0x9b04[_0x3f5210];return _0x53c3ab;};'use strict';var _=require(_0x49b0('0x0'));var Sequelize=require(_0x49b0('0x1'));module[_0x49b0('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x49b0('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x49b0('0x3')]},'country':{'type':Sequelize[_0x49b0('0x3')]},'dateOfBirth':{'type':Sequelize[_0x49b0('0x3')]},'description':{'type':Sequelize[_0x49b0('0x4')]},'phone':{'type':Sequelize[_0x49b0('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x49b0('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x49b0('0x3')]},'facebook':{'type':Sequelize[_0x49b0('0x3')]},'fb_data':{'type':Sequelize[_0x49b0('0x3')]},'twitter':{'type':Sequelize[_0x49b0('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x49b0('0x3')]},'viber':{'type':Sequelize[_0x49b0('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x49b0('0x3')]},'UserId':{'type':Sequelize[_0x49b0('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x49b0('0x6')],'defaultValue':Sequelize[_0x49b0('0x7')]}};
\ No newline at end of file
+var _0x0fd0=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x110dbf,_0x16a620){var _0x49e064=function(_0x7bc62e){while(--_0x7bc62e){_0x110dbf['push'](_0x110dbf['shift']());}};_0x49e064(++_0x16a620);}(_0x0fd0,0x159));var _0x00fd=function(_0x1ddbe1,_0x31d3a9){_0x1ddbe1=_0x1ddbe1-0x0;var _0x596bf4=_0x0fd0[_0x1ddbe1];return _0x596bf4;};'use strict';var _=require(_0x00fd('0x0'));var Sequelize=require(_0x00fd('0x1'));module[_0x00fd('0x2')]={'firstName':{'type':Sequelize[_0x00fd('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x00fd('0x3')]},'street':{'type':Sequelize[_0x00fd('0x3')]},'postalCode':{'type':Sequelize[_0x00fd('0x3')]},'city':{'type':Sequelize[_0x00fd('0x3')]},'country':{'type':Sequelize[_0x00fd('0x3')]},'dateOfBirth':{'type':Sequelize[_0x00fd('0x3')]},'description':{'type':Sequelize[_0x00fd('0x4')]},'phone':{'type':Sequelize[_0x00fd('0x3')]},'mobile':{'type':Sequelize[_0x00fd('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x00fd('0x3')]},'url':{'type':Sequelize[_0x00fd('0x3')]},'facebook':{'type':Sequelize[_0x00fd('0x3')]},'fb_data':{'type':Sequelize[_0x00fd('0x3')]},'twitter':{'type':Sequelize[_0x00fd('0x3')]},'skype':{'type':Sequelize[_0x00fd('0x3')]},'teams':{'type':Sequelize[_0x00fd('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x00fd('0x3')]},'wechat':{'type':Sequelize[_0x00fd('0x3')]},'telegram':{'type':Sequelize[_0x00fd('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x00fd('0x5')](0x2)[_0x00fd('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x00fd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 857071c..b636552 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 _0xba6e=['clone','DESC','isEmpty','having','t.id\x20IN\x20?','resolve','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.lastName','c.phone','c.fax','c.ListId','c.deletedAt','c.CompanyId','TagIds','Tags','find','params','catch','tags','columnName','displayName','findAll','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','ListId','findOrCreate','show','Tag','format','$and','omit','pickBy','cf_%d','id\x20=\x20?','toParam','values','phone','getTags','rawAttributes','options','hasOwnProperty','setTags','ids','getHoppers','ContactId','includeAll','rows','getHopperHistories','CmHopperHistory','include','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','whatsapp','voice','channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userThirdDisposition','UserId','fullname','alias','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','customerIp','deviceModel','osName','ratingType','ratingValue','referer','mail','subject','threadId','Interaction','findAndCountAll','Owner','flatten','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','offset','undefined','count','limit','status','set','json','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','fieldType','type','model','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','datetime','DATE','buildExpression','start','isNil','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT'];(function(_0x262f02,_0x142ce5){var _0x2760ff=function(_0x597906){while(--_0x597906){_0x262f02['push'](_0x262f02['shift']());}};_0x2760ff(++_0x142ce5);}(_0xba6e,0xb0));var _0xeba6=function(_0x46e824,_0x260243){_0x46e824=_0x46e824-0x0;var _0x5b6e78=_0xba6e[_0x46e824];return _0x5b6e78;};'use strict';var moment=require(_0xeba6('0x0'));var BPromise=require(_0xeba6('0x1'));var util=require(_0xeba6('0x2'));var path=require(_0xeba6('0x3'));var fs=require('fs');var _=require(_0xeba6('0x4'));var squel=require(_0xeba6('0x5'));var Papa=require(_0xeba6('0x6'));var Redis=require(_0xeba6('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0xeba6('0x8'));var logger=require(_0xeba6('0x9'))(_0xeba6('0xa'));var config=require(_0xeba6('0xb'));var db=require(_0xeba6('0xc'))['db'];config[_0xeba6('0xd')]=_[_0xeba6('0xe')](config[_0xeba6('0xd')],{'host':_0xeba6('0xf'),'port':0x18eb});var socket=require(_0xeba6('0x10'))(new Redis(config[_0xeba6('0xd')]));require(_0xeba6('0x11'))[_0xeba6('0x12')](socket);function respondWithResult(_0x122e89,_0x5b740b){_0x5b740b=_0x5b740b||0xc8;return function(_0x4c4cf8){if(_0x4c4cf8){return _0x122e89['status'](_0x5b740b)['json'](_0x4c4cf8);}};}function respondWithFilteredResult(_0x5b8624,_0x1190f4){return function(_0x4438b9){if(_0x4438b9){var _0x59c5a6=typeof _0x1190f4[_0xeba6('0x13')]===_0xeba6('0x14')&&typeof _0x1190f4['limit']===_0xeba6('0x14');var _0xc7add4=_0x4438b9[_0xeba6('0x15')];var _0x2169e1=_0x59c5a6?0x0:_0x1190f4[_0xeba6('0x13')];var _0x2bb2d2=_0x59c5a6?_0x4438b9[_0xeba6('0x15')]:_0x1190f4[_0xeba6('0x13')]+_0x1190f4[_0xeba6('0x16')];var _0x63dd4a;if(_0x2bb2d2>=_0xc7add4){_0x2bb2d2=_0xc7add4;_0x63dd4a=0xc8;}else{_0x63dd4a=0xce;}_0x5b8624[_0xeba6('0x17')](_0x63dd4a);return _0x5b8624[_0xeba6('0x18')]('Content-Range',_0x2169e1+'-'+_0x2bb2d2+'/'+_0xc7add4)[_0xeba6('0x19')](_0x4438b9);}return null;};}function saveUpdates(_0x56d281){return function(_0x4342a8){if(_0x4342a8){return _0x4342a8['update'](_0x56d281)[_0xeba6('0x1a')](function(_0x3a998f){return _0x3a998f;});}return null;};}function removeEntity(_0x57a93f){return function(_0x2aef9d){if(_0x2aef9d){return _0x2aef9d[_0xeba6('0x1b')]()['then'](function(){_0x57a93f['status'](0xcc)[_0xeba6('0x1c')]();});}};}function handleEntityNotFound(_0x482eec){return function(_0x248197){if(!_0x248197){_0x482eec[_0xeba6('0x1d')](0x194);}return _0x248197;};}function handleError(_0xb186ad,_0xc96129){_0xc96129=_0xc96129||0x1f4;return function(_0xcfb763){logger[_0xeba6('0x1e')](_0xcfb763[_0xeba6('0x1f')]);if(_0xcfb763[_0xeba6('0x20')]){delete _0xcfb763[_0xeba6('0x20')];}_0xb186ad[_0xeba6('0x17')](_0xc96129)[_0xeba6('0x21')](_0xcfb763);};}exports[_0xeba6('0x22')]=function(_0x195967,_0x1f7d7d){var _0x10454a={},_0xf056a0={},_0x5164ce={'count':0x0,'rows':[]};return db[_0xeba6('0x23')][_0xeba6('0x24')]()[_0xeba6('0x1a')](function(_0x530eb3){var _0x12af9c=[];for(var _0x1098fc=0x0;_0x1098fc
','Attachments','push','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','generate','html','test','replace'];(function(_0xc9926,_0x348a8c){var _0x57b380=function(_0x1afe75){while(--_0x1afe75){_0xc9926['push'](_0xc9926['shift']());}};_0x57b380(++_0x348a8c);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc7b3[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x3c7b('0x0'));var moment=require(_0x3c7b('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x3c7b('0x2'));var util=require(_0x3c7b('0x3'));var tnef=require(_0x3c7b('0x4'));var logger=require(_0x3c7b('0x5'))(_0x3c7b('0x6'));var config=require(_0x3c7b('0x7'));function getAddress(_0x48ad4b){var _0x12d9a9=_[_0x3c7b('0x8')](_0x48ad4b[_0x3c7b('0x9')]);return _0x12d9a9&&_0x12d9a9['address']?_0x12d9a9[_0x3c7b('0xa')]:_0x3c7b('0xb')+random['generate'](0x6)+_0x3c7b('0xc');}function getFirstName(_0x3990fe){var _0x5cf03b=_[_0x3c7b('0x8')](_0x3990fe[_0x3c7b('0x9')]);if(_0x5cf03b&&_0x5cf03b[_0x3c7b('0xd')]){if(_0x5cf03b['name']==_0x5cf03b[_0x3c7b('0xa')]){return _0x5cf03b['name'][_0x3c7b('0xe')](0x0,_0x5cf03b[_0x3c7b('0xd')]['indexOf']('@'));}var _0x6452a1=_0x5cf03b[_0x3c7b('0xd')][_0x3c7b('0xf')](/\s+/);return _0x6452a1[_0x3c7b('0x10')]>0x1?_0x6452a1[_0x3c7b('0x11')](0x0,-0x1)[_0x3c7b('0x12')]('\x20'):_0x5cf03b['name'];}return _0x3c7b('0x13');}function getLastName(_0x53e7e4){var _0x1c77a5=_[_0x3c7b('0x8')](_0x53e7e4[_0x3c7b('0x9')]);if(_0x1c77a5&&_0x1c77a5[_0x3c7b('0xd')]){var _0x1b5490=_0x1c77a5[_0x3c7b('0xd')][_0x3c7b('0xf')](/\s+/);return _0x1b5490[_0x3c7b('0x10')]>0x1?_0x1b5490[_0x3c7b('0x14')]():'';}return'';}function getMails(_0x38a02c,_0x1df4a7){var _0x220f9d='';for(var _0x4ce512=0x0;_0x4ce512<_0x1df4a7[_0x3c7b('0x9')][_0x3c7b('0x10')];_0x4ce512+=0x1){if(_0x1df4a7[_0x3c7b('0x9')][_0x4ce512][_0x3c7b('0xa')]!==_0x38a02c){if(!_[_0x3c7b('0x15')](_0x220f9d)){_0x220f9d+=',';}_0x220f9d+=_0x1df4a7[_0x3c7b('0x9')][_0x4ce512][_0x3c7b('0xd')]||_0x1df4a7[_0x3c7b('0x9')][_0x4ce512][_0x3c7b('0xa')]||'';_0x220f9d+='\x20<';_0x220f9d+=_0x1df4a7[_0x3c7b('0x9')][_0x4ce512][_0x3c7b('0xa')]?_0x1df4a7[_0x3c7b('0x9')][_0x4ce512][_0x3c7b('0xa')]:_0x3c7b('0xb')+random[_0x3c7b('0x16')](0x6)+_0x3c7b('0xc');_0x220f9d+='>';}}return _0x220f9d;}function parseEmail(_0x2b4598,_0xd05d3,_0x5572ab){if(_0xd05d3[_0x3c7b('0x17')]){var _0x2d93eb=/