From: support
Date: Wed, 16 Nov 2022 11:17:32 +0000 (+0000)
Subject: Built motion from commit 4de5e0c9.|2.6.22
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=1ce7e49a0ee32bd3342435863447a735978606f6;p=motion2.git
Built motion from commit 4de5e0c9.|2.6.22
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f22cd0e..6c80094 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.21",
+ "version": "2.6.22",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-15T15:36:35.915Z",
+ "time": "2022-11-16T11:08:45.001Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index fa44d27..985ba28 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.21",
+ "version": "2.6.22",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-15T15:36:35.915Z",
+ "time": "2022-11-16T11:08:45.001Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index efe6876..e40c91e 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.21",
+ "version": "2.6.22",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index 69f22db..2279703 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.21",
+ "version": "2.6.22",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 3c2a054..4687a33 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 _0xc98d=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc98d,0xbe));var _0xdc98=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0xc98d[_0x4f35f4];return _0x2e9a70;};'use strict';var Sequelize=require(_0xdc98('0x0'));module[_0xdc98('0x1')]={'name':{'type':Sequelize[_0xdc98('0x2')],'get':function(_0x4458b9){return this[_0xdc98('0x3')](_0xdc98('0x4'));}},'action':{'type':Sequelize[_0xdc98('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdc98('0x6'),_0xdc98('0x7'),_0xdc98('0x8'),_0xdc98('0x9'),_0xdc98('0xa'),'browser',_0xdc98('0xb'),_0xdc98('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xdc98('0xd')},'data1':{'type':Sequelize[_0xdc98('0x5')](0x1000),'comment':_0xdc98('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xdc98('0x5')](0x1000),'comment':_0xdc98('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xdc98('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xdc98('0x11')},'data6':{'type':Sequelize[_0xdc98('0x5')],'comments':_0xdc98('0x12')},'data7':{'type':Sequelize[_0xdc98('0x13')],'comments':_0xdc98('0x14')}};
\ No newline at end of file
+var _0x9af2=['integration','urlForward','bot','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x40fd66,_0x14e0f2){var _0x53e0c1=function(_0x10d1f4){while(--_0x10d1f4){_0x40fd66['push'](_0x40fd66['shift']());}};_0x53e0c1(++_0x14e0f2);}(_0x9af2,0x1c2));var _0x29af=function(_0x4b928b,_0x495842){_0x4b928b=_0x4b928b-0x0;var _0x207219=_0x9af2[_0x4b928b];return _0x207219;};'use strict';var Sequelize=require(_0x29af('0x0'));module[_0x29af('0x1')]={'name':{'type':Sequelize[_0x29af('0x2')],'get':function(_0x31f6fd){return this[_0x29af('0x3')](_0x29af('0x4'));}},'action':{'type':Sequelize[_0x29af('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x29af('0x6'),'motionbar','jscripty',_0x29af('0x7'),'browser',_0x29af('0x8'),'script']],'msg':_0x29af('0x9')}},'comment':_0x29af('0x9')},'data1':{'type':Sequelize[_0x29af('0x5')](0x1000),'comment':_0x29af('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x29af('0x5')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x29af('0x5')](0x1000),'comments':_0x29af('0xb')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x29af('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 8b74a77..58e6dcb 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 _0xefd0=['util','path','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','stack','name','send','update','body','Action','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0xefd0,0x1e9));var _0x0efd=function(_0xc91f7d,_0x334ff1){_0xc91f7d=_0xc91f7d-0x0;var _0x742f34=_0xefd0[_0xc91f7d];return _0x742f34;};'use strict';var emlformat=require(_0x0efd('0x0'));var rimraf=require(_0x0efd('0x1'));var zipdir=require(_0x0efd('0x2'));var jsonpatch=require(_0x0efd('0x3'));var rp=require(_0x0efd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0efd('0x5'));var util=require(_0x0efd('0x6'));var path=require(_0x0efd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0efd('0x8'));var fs=require('fs');var fs_extra=require(_0x0efd('0x9'));var _=require('lodash');var squel=require(_0x0efd('0xa'));var crypto=require(_0x0efd('0xb'));var jsforce=require(_0x0efd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0efd('0xd'));var Papa=require(_0x0efd('0xe'));var Redis=require(_0x0efd('0xf'));var authService=require(_0x0efd('0x10'));var qs=require(_0x0efd('0x11'));var as=require(_0x0efd('0x12'));var hardwareService=require(_0x0efd('0x13'));var logger=require('../../config/logger')(_0x0efd('0x14'));var utils=require('../../config/utils');var config=require(_0x0efd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0efd('0x16'))['db'];function respondWithStatusCode(_0x40d20d,_0x4e2284){_0x4e2284=_0x4e2284||0xcc;return function(_0x1cc0ea){if(_0x1cc0ea){return _0x40d20d[_0x0efd('0x17')](_0x4e2284);}return _0x40d20d[_0x0efd('0x18')](_0x4e2284)[_0x0efd('0x19')]();};}function respondWithResult(_0x191ef7,_0x2d8501){_0x2d8501=_0x2d8501||0xc8;return function(_0x59751){if(_0x59751){return _0x191ef7[_0x0efd('0x18')](_0x2d8501)[_0x0efd('0x1a')](_0x59751);}};}function respondWithFilteredResult(_0xea364d,_0xcb76d7){return function(_0x570917){if(_0x570917){var _0x117c0f=typeof _0xcb76d7[_0x0efd('0x1b')]===_0x0efd('0x1c')&&typeof _0xcb76d7[_0x0efd('0x1d')]==='undefined';var _0x1e301e=_0x570917[_0x0efd('0x1e')];var _0x2655fe=_0x117c0f?0x0:_0xcb76d7[_0x0efd('0x1b')];var _0x49a8cb=_0x117c0f?_0x570917[_0x0efd('0x1e')]:_0xcb76d7[_0x0efd('0x1b')]+_0xcb76d7[_0x0efd('0x1d')];var _0x1c88cf;if(_0x49a8cb>=_0x1e301e){_0x49a8cb=_0x1e301e;_0x1c88cf=0xc8;}else{_0x1c88cf=0xce;}_0xea364d[_0x0efd('0x18')](_0x1c88cf);return _0xea364d[_0x0efd('0x1f')](_0x0efd('0x20'),_0x2655fe+'-'+_0x49a8cb+'/'+_0x1e301e)[_0x0efd('0x1a')](_0x570917);}return null;};}function patchUpdates(_0x254c59){return function(_0x383312){try{jsonpatch[_0x0efd('0x21')](_0x383312,_0x254c59,!![]);}catch(_0x4b0f18){return BPromise['reject'](_0x4b0f18);}return _0x383312[_0x0efd('0x22')]();};}function saveUpdates(_0x3aefe7,_0x1220e5){return function(_0x439ced){if(_0x439ced){return _0x439ced['update'](_0x3aefe7)[_0x0efd('0x23')](function(_0x5cb9b4){return _0x5cb9b4;});}return null;};}function removeEntity(_0x117690,_0x1cca54){return function(_0x303f16){if(_0x303f16){return _0x303f16[_0x0efd('0x24')]()[_0x0efd('0x23')](function(){_0x117690['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a6de9,_0x3201ad){return function(_0x539c00){if(!_0x539c00){_0x4a6de9['sendStatus'](0x194);}return _0x539c00;};}function handleError(_0x48cd7e,_0x32114b){_0x32114b=_0x32114b||0x1f4;return function(_0x2b1dbc){logger['error'](_0x2b1dbc[_0x0efd('0x25')]);if(_0x2b1dbc[_0x0efd('0x26')]){delete _0x2b1dbc['name'];}_0x48cd7e[_0x0efd('0x18')](_0x32114b)[_0x0efd('0x27')](_0x2b1dbc);};}exports[_0x0efd('0x28')]=function(_0x1c5397,_0x2f6b24){if(_0x1c5397[_0x0efd('0x29')]['id']){delete _0x1c5397['body']['id'];}return db[_0x0efd('0x2a')][_0x0efd('0x2b')]({'where':{'id':_0x1c5397['params']['id']}})['then'](handleEntityNotFound(_0x2f6b24,null))[_0x0efd('0x23')](saveUpdates(_0x1c5397[_0x0efd('0x29')],null))[_0x0efd('0x23')](respondWithResult(_0x2f6b24,null))[_0x0efd('0x2c')](handleError(_0x2f6b24,null));};exports[_0x0efd('0x24')]=function(_0x2ff977,_0x2c11db){return db['Action'][_0x0efd('0x2b')]({'where':{'id':_0x2ff977['params']['id']}})[_0x0efd('0x23')](handleEntityNotFound(_0x2c11db,null))[_0x0efd('0x23')](removeEntity(_0x2c11db,null))[_0x0efd('0x2c')](handleError(_0x2c11db,null));};
\ No newline at end of file
+var _0x63da=['Action','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','body','find','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63da,0xba));var _0xa63d=function(_0x8b885,_0x31740b){_0x8b885=_0x8b885-0x0;var _0x122eb8=_0x63da[_0x8b885];return _0x122eb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa63d('0x0'));var zipdir=require(_0xa63d('0x1'));var jsonpatch=require(_0xa63d('0x2'));var rp=require('request-promise');var moment=require(_0xa63d('0x3'));var BPromise=require(_0xa63d('0x4'));var Mustache=require('mustache');var util=require(_0xa63d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa63d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa63d('0x7'));var squel=require(_0xa63d('0x8'));var crypto=require(_0xa63d('0x9'));var jsforce=require(_0xa63d('0xa'));var deskjs=require(_0xa63d('0xb'));var toCsv=require(_0xa63d('0x6'));var querystring=require(_0xa63d('0xc'));var Papa=require(_0xa63d('0xd'));var Redis=require(_0xa63d('0xe'));var authService=require(_0xa63d('0xf'));var qs=require(_0xa63d('0x10'));var as=require(_0xa63d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa63d('0x12'))(_0xa63d('0x13'));var utils=require(_0xa63d('0x14'));var config=require(_0xa63d('0x15'));var licenseUtil=require(_0xa63d('0x16'));var db=require(_0xa63d('0x17'))['db'];function respondWithStatusCode(_0x2a407a,_0x50309b){_0x50309b=_0x50309b||0xcc;return function(_0x5d02ae){if(_0x5d02ae){return _0x2a407a[_0xa63d('0x18')](_0x50309b);}return _0x2a407a[_0xa63d('0x19')](_0x50309b)[_0xa63d('0x1a')]();};}function respondWithResult(_0x698848,_0xa2f5d){_0xa2f5d=_0xa2f5d||0xc8;return function(_0x2289aa){if(_0x2289aa){return _0x698848[_0xa63d('0x19')](_0xa2f5d)[_0xa63d('0x1b')](_0x2289aa);}};}function respondWithFilteredResult(_0x38f8e4,_0x50fa44){return function(_0x3ac1fb){if(_0x3ac1fb){var _0xf24ce9=typeof _0x50fa44['offset']===_0xa63d('0x1c')&&typeof _0x50fa44[_0xa63d('0x1d')]===_0xa63d('0x1c');var _0x225c92=_0x3ac1fb[_0xa63d('0x1e')];var _0x2a40d0=_0xf24ce9?0x0:_0x50fa44['offset'];var _0x44f5a6=_0xf24ce9?_0x3ac1fb[_0xa63d('0x1e')]:_0x50fa44['offset']+_0x50fa44[_0xa63d('0x1d')];var _0x57dbc8;if(_0x44f5a6>=_0x225c92){_0x44f5a6=_0x225c92;_0x57dbc8=0xc8;}else{_0x57dbc8=0xce;}_0x38f8e4[_0xa63d('0x19')](_0x57dbc8);return _0x38f8e4[_0xa63d('0x1f')]('Content-Range',_0x2a40d0+'-'+_0x44f5a6+'/'+_0x225c92)[_0xa63d('0x1b')](_0x3ac1fb);}return null;};}function patchUpdates(_0x38c50b){return function(_0x383c66){try{jsonpatch['apply'](_0x383c66,_0x38c50b,!![]);}catch(_0x1e76dd){return BPromise[_0xa63d('0x20')](_0x1e76dd);}return _0x383c66[_0xa63d('0x21')]();};}function saveUpdates(_0x523c3d,_0x4781fa){return function(_0x2cc7ec){if(_0x2cc7ec){return _0x2cc7ec[_0xa63d('0x22')](_0x523c3d)[_0xa63d('0x23')](function(_0x39a977){return _0x39a977;});}return null;};}function removeEntity(_0x2f6809,_0x69f9e7){return function(_0x386ca8){if(_0x386ca8){return _0x386ca8[_0xa63d('0x24')]()[_0xa63d('0x23')](function(){_0x2f6809[_0xa63d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7ebc2f,_0x3f62d9){return function(_0x141906){if(!_0x141906){_0x7ebc2f['sendStatus'](0x194);}return _0x141906;};}function handleError(_0x3ca914,_0x28e092){_0x28e092=_0x28e092||0x1f4;return function(_0xdb4255){logger[_0xa63d('0x25')](_0xdb4255[_0xa63d('0x26')]);if(_0xdb4255[_0xa63d('0x27')]){delete _0xdb4255[_0xa63d('0x27')];}_0x3ca914[_0xa63d('0x19')](_0x28e092)[_0xa63d('0x28')](_0xdb4255);};}exports['update']=function(_0x5b22d9,_0x33cb2c){if(_0x5b22d9[_0xa63d('0x29')]['id']){delete _0x5b22d9[_0xa63d('0x29')]['id'];}return db['Action'][_0xa63d('0x2a')]({'where':{'id':_0x5b22d9['params']['id']}})[_0xa63d('0x23')](handleEntityNotFound(_0x33cb2c,null))[_0xa63d('0x23')](saveUpdates(_0x5b22d9[_0xa63d('0x29')],null))[_0xa63d('0x23')](respondWithResult(_0x33cb2c,null))[_0xa63d('0x2b')](handleError(_0x33cb2c,null));};exports[_0xa63d('0x24')]=function(_0x108e92,_0x1b4cbb){return db[_0xa63d('0x2c')][_0xa63d('0x2a')]({'where':{'id':_0x108e92[_0xa63d('0x2d')]['id']}})[_0xa63d('0x23')](handleEntityNotFound(_0x1b4cbb,null))[_0xa63d('0x23')](removeEntity(_0x1b4cbb,null))[_0xa63d('0x2b')](handleError(_0x1b4cbb,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 9943e7f..4b8ac6d 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 _0x28cc=['rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc2e269,_0x297324){var _0x427447=function(_0xca59dc){while(--_0xca59dc){_0xc2e269['push'](_0xc2e269['shift']());}};_0x427447(++_0x297324);}(_0x28cc,0x180));var _0xc28c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28cc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc28c('0x0'));var util=require(_0xc28c('0x1'));var logger=require(_0xc28c('0x2'))(_0xc28c('0x3'));var moment=require(_0xc28c('0x4'));var BPromise=require(_0xc28c('0x5'));var rp=require(_0xc28c('0x6'));var fs=require('fs');var path=require(_0xc28c('0x7'));var rimraf=require(_0xc28c('0x8'));var config=require(_0xc28c('0x9'));var attributes=require(_0xc28c('0xa'));module[_0xc28c('0xb')]=function(_0xba2032,_0x227a35){return _0xba2032['define'](_0xc28c('0xc'),attributes,{'tableName':_0xc28c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb368=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','lodash','util','../../config/logger','api'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xb368,0x68));var _0x8b36=function(_0xa1ffb0,_0x501e4a){_0xa1ffb0=_0xa1ffb0-0x0;var _0x3372e7=_0xb368[_0xa1ffb0];return _0x3372e7;};'use strict';var _=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var logger=require(_0x8b36('0x2'))(_0x8b36('0x3'));var moment=require(_0x8b36('0x4'));var BPromise=require(_0x8b36('0x5'));var rp=require(_0x8b36('0x6'));var fs=require('fs');var path=require(_0x8b36('0x7'));var rimraf=require(_0x8b36('0x8'));var config=require(_0x8b36('0x9'));var attributes=require('./action.attributes');module[_0x8b36('0xa')]=function(_0x2ce0fc,_0x48a8a4){return _0x2ce0fc['define'](_0x8b36('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index e3ae303..fe4e0e8 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2e28dd,_0x1a66e9){var _0x1aa4cc=function(_0x872dc6){while(--_0x872dc6){_0x2e28dd['push'](_0x2e28dd['shift']());}};_0x1aa4cc(++_0x1a66e9);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x340c09,_0xc08941){_0x340c09=_0x340c09-0x0;var _0x1cc1b6=_0x7fbe[_0x340c09];return _0x1cc1b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x12b253,_0x2153bc){var _0xd04dac=function(_0x20b8a8){while(--_0x20b8a8){_0x12b253['push'](_0x12b253['shift']());}};_0xd04dac(++_0x2153bc);}(_0x326f,0xd1));var _0xf326=function(_0x16cb6c,_0x5fb2cc){_0x16cb6c=_0x16cb6c-0x0;var _0x1f8a57=_0x326f[_0x16cb6c];return _0x1f8a57;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index bdcfcce..7356027 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 _0xfafa=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','util','path'];(function(_0x45082d,_0x15223d){var _0x706d81=function(_0x289274){while(--_0x289274){_0x45082d['push'](_0x45082d['shift']());}};_0x706d81(++_0x15223d);}(_0xfafa,0xde));var _0xafaf=function(_0x57b8d0,_0x33d4f5){_0x57b8d0=_0x57b8d0-0x0;var _0x138517=_0xfafa[_0x57b8d0];return _0x138517;};'use strict';var multer=require('multer');var util=require(_0xafaf('0x0'));var path=require(_0xafaf('0x1'));var timeout=require(_0xafaf('0x2'));var express=require(_0xafaf('0x3'));var router=express[_0xafaf('0x4')]();var fs_extra=require(_0xafaf('0x5'));var auth=require(_0xafaf('0x6'));var interaction=require(_0xafaf('0x7'));var config=require(_0xafaf('0x8'));var controller=require(_0xafaf('0x9'));router['put'](_0xafaf('0xa'),auth[_0xafaf('0xb')](),controller[_0xafaf('0xc')]);router[_0xafaf('0xd')]('/:id',auth[_0xafaf('0xb')](),controller[_0xafaf('0xe')]);module[_0xafaf('0xf')]=router;
\ No newline at end of file
+var _0xedc5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','destroy','multer','util','express','Router'];(function(_0x3035a5,_0x6a1b0b){var _0x396e01=function(_0x505f0d){while(--_0x505f0d){_0x3035a5['push'](_0x3035a5['shift']());}};_0x396e01(++_0x6a1b0b);}(_0xedc5,0x1dd));var _0x5edc=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0xedc5[_0xcdf809];return _0x4d4d70;};'use strict';var multer=require(_0x5edc('0x0'));var util=require(_0x5edc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5edc('0x2'));var router=express[_0x5edc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5edc('0x4'));var interaction=require(_0x5edc('0x5'));var config=require(_0x5edc('0x6'));var controller=require(_0x5edc('0x7'));router['put']('/:id',auth[_0x5edc('0x8')](),controller[_0x5edc('0x9')]);router[_0x5edc('0xa')](_0x5edc('0xb'),auth[_0x5edc('0x8')](),controller[_0x5edc('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index dc31d81..2c2ce2d 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 _0x2bd8=['TEXT','sequelize','STRING'];(function(_0x55e007,_0x19be52){var _0x3c7531=function(_0x367a69){while(--_0x367a69){_0x55e007['push'](_0x55e007['shift']());}};_0x3c7531(++_0x19be52);}(_0x2bd8,0x130));var _0x82bd=function(_0x542239,_0x4f5659){_0x542239=_0x542239-0x0;var _0x10849e=_0x2bd8[_0x542239];return _0x10849e;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x195c91,_0x26f6ba){var _0x30e2e0=function(_0x1b3017){while(--_0x1b3017){_0x195c91['push'](_0x195c91['shift']());}};_0x30e2e0(++_0x26f6ba);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 3a8be0e..03efcb7 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 _0xa491=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','type','VIRTUAL','merge','count','rows','catch','show','params','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','body','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','AVG(%s)','IS\x20NOT\x20NULL','operator','Sequelize','AnalyticMetric','keyBy','from','order','DESC','clone','output','web','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','COUNT(*)','run','runReport','DATE(%s)','eml-format','rimraf','zip-dir','moment','bluebird','util','ejs'];(function(_0x427fff,_0x20ea23){var _0x5ede74=function(_0x8c771){while(--_0x8c771){_0x427fff['push'](_0x427fff['shift']());}};_0x5ede74(++_0x20ea23);}(_0xa491,0x14d));var _0x1a49=function(_0x2901cf,_0xb570cc){_0x2901cf=_0x2901cf-0x0;var _0x47ee3f=_0xa491[_0x2901cf];return _0x47ee3f;};'use strict';var emlformat=require(_0x1a49('0x0'));var rimraf=require(_0x1a49('0x1'));var zipdir=require(_0x1a49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1a49('0x3'));var BPromise=require(_0x1a49('0x4'));var Mustache=require('mustache');var util=require(_0x1a49('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a49('0x6'));var fs=require('fs');var fs_extra=require(_0x1a49('0x7'));var _=require(_0x1a49('0x8'));var squel=require(_0x1a49('0x9'));var crypto=require(_0x1a49('0xa'));var jsforce=require(_0x1a49('0xb'));var deskjs=require(_0x1a49('0xc'));var toCsv=require(_0x1a49('0xd'));var querystring=require(_0x1a49('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a49('0xf'));var authService=require(_0x1a49('0x10'));var qs=require(_0x1a49('0x11'));var as=require(_0x1a49('0x12'));var hardwareService=require(_0x1a49('0x13'));var logger=require(_0x1a49('0x14'))(_0x1a49('0x15'));var utils=require('../../config/utils');var config=require(_0x1a49('0x16'));var licenseUtil=require(_0x1a49('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1a49('0x18'))[_0x1a49('0x19')];function respondWithStatusCode(_0x3c247d,_0x1464ee){_0x1464ee=_0x1464ee||0xcc;return function(_0x20d6e7){if(_0x20d6e7){return _0x3c247d[_0x1a49('0x1a')](_0x1464ee);}return _0x3c247d['status'](_0x1464ee)[_0x1a49('0x1b')]();};}function respondWithResult(_0x2370a1,_0x100ee3){_0x100ee3=_0x100ee3||0xc8;return function(_0x19b88a){if(_0x19b88a){return _0x2370a1['status'](_0x100ee3)[_0x1a49('0x1c')](_0x19b88a);}};}function respondWithFilteredResult(_0x4127e1,_0xa1dfe7){return function(_0x1473c1){if(_0x1473c1){var _0x16f579=typeof _0xa1dfe7[_0x1a49('0x1d')]===_0x1a49('0x1e')&&typeof _0xa1dfe7['limit']==='undefined';var _0x25e2c5=_0x1473c1['count'];var _0x9b91f3=_0x16f579?0x0:_0xa1dfe7[_0x1a49('0x1d')];var _0x1205e1=_0x16f579?_0x1473c1['count']:_0xa1dfe7[_0x1a49('0x1d')]+_0xa1dfe7[_0x1a49('0x1f')];var _0x3e2786;if(_0x1205e1>=_0x25e2c5){_0x1205e1=_0x25e2c5;_0x3e2786=0xc8;}else{_0x3e2786=0xce;}_0x4127e1[_0x1a49('0x20')](_0x3e2786);return _0x4127e1[_0x1a49('0x21')](_0x1a49('0x22'),_0x9b91f3+'-'+_0x1205e1+'/'+_0x25e2c5)[_0x1a49('0x1c')](_0x1473c1);}return null;};}function patchUpdates(_0x58ebe5){return function(_0x20a42e){try{jsonpatch[_0x1a49('0x23')](_0x20a42e,_0x58ebe5,!![]);}catch(_0x2d6e6b){return BPromise[_0x1a49('0x24')](_0x2d6e6b);}return _0x20a42e[_0x1a49('0x25')]();};}function saveUpdates(_0x475322,_0x491df2){return function(_0x4e242a){if(_0x4e242a){return _0x4e242a[_0x1a49('0x26')](_0x475322)['then'](function(_0x2d626b){return _0x2d626b;});}return null;};}function removeEntity(_0x114606,_0x10dd38){return function(_0x10d789){if(_0x10d789){return _0x10d789[_0x1a49('0x27')]()[_0x1a49('0x28')](function(){var _0x2225a5=_0x10d789[_0x1a49('0x29')]({'plain':!![]});var _0xaaa13d=_0x1a49('0x2a');return db[_0x1a49('0x2b')][_0x1a49('0x27')]({'where':{'type':_0xaaa13d,'resourceId':_0x2225a5['id']}})['then'](function(){return _0x10d789;});})[_0x1a49('0x28')](function(){_0x114606['status'](0xcc)[_0x1a49('0x1b')]();});}};}function handleEntityNotFound(_0x41751f,_0xefc8e2){return function(_0x518baa){if(!_0x518baa){_0x41751f[_0x1a49('0x1a')](0x194);}return _0x518baa;};}function handleError(_0x366b0c,_0x31acb3){_0x31acb3=_0x31acb3||0x1f4;return function(_0x520900){logger['error'](_0x520900[_0x1a49('0x2c')]);if(_0x520900[_0x1a49('0x2d')]){delete _0x520900[_0x1a49('0x2d')];}_0x366b0c[_0x1a49('0x20')](_0x31acb3)[_0x1a49('0x2e')](_0x520900);};}exports[_0x1a49('0x2f')]=function(_0xfdfde4,_0x3b4ab6){var _0x302c4f={},_0x37c328={},_0x54934e={'count':0x0,'rows':[]};var _0x877c9b=_['map'](db[_0x1a49('0x30')][_0x1a49('0x31')],function(_0x454906){return{'name':_0x454906[_0x1a49('0x32')],'type':_0x454906['type'][_0x1a49('0x33')]};});_0x37c328[_0x1a49('0x34')]=_['map'](_0x877c9b,_0x1a49('0x2d'));_0x37c328[_0x1a49('0x35')]=_[_0x1a49('0x36')](_0xfdfde4[_0x1a49('0x35')]);_0x37c328[_0x1a49('0x37')]=_[_0x1a49('0x38')](_0x37c328['model'],_0x37c328[_0x1a49('0x35')]);_0x302c4f[_0x1a49('0x39')]=_['intersection'](_0x37c328[_0x1a49('0x34')],qs[_0x1a49('0x3a')](_0xfdfde4['query'][_0x1a49('0x3a')]));_0x302c4f[_0x1a49('0x39')]=_0x302c4f[_0x1a49('0x39')][_0x1a49('0x3b')]?_0x302c4f[_0x1a49('0x39')]:_0x37c328[_0x1a49('0x34')];if(!_0xfdfde4[_0x1a49('0x35')][_0x1a49('0x3c')]('nolimit')){_0x302c4f[_0x1a49('0x1f')]=qs['limit'](_0xfdfde4[_0x1a49('0x35')][_0x1a49('0x1f')]);_0x302c4f['offset']=qs[_0x1a49('0x1d')](_0xfdfde4[_0x1a49('0x35')]['offset']);}_0x302c4f['order']=qs[_0x1a49('0x3d')](_0xfdfde4['query'][_0x1a49('0x3d')]);_0x302c4f[_0x1a49('0x3e')]=qs[_0x1a49('0x37')](_[_0x1a49('0x3f')](_0xfdfde4[_0x1a49('0x35')],_0x37c328[_0x1a49('0x37')]),_0x877c9b);if(_0xfdfde4[_0x1a49('0x35')][_0x1a49('0x40')]){_0x302c4f[_0x1a49('0x3e')]=_['merge'](_0x302c4f[_0x1a49('0x3e')],{'$or':_[_0x1a49('0x41')](_0x877c9b,function(_0x46c498){if(_0x46c498[_0x1a49('0x42')]!==_0x1a49('0x43')){var _0x507fb7={};_0x507fb7[_0x46c498[_0x1a49('0x2d')]]={'$like':'%'+_0xfdfde4[_0x1a49('0x35')]['filter']+'%'};return _0x507fb7;}})});}_0x302c4f=_[_0x1a49('0x44')]({},_0x302c4f,_0xfdfde4['options']);var _0x145ca9={'where':_0x302c4f[_0x1a49('0x3e')]};return db[_0x1a49('0x30')][_0x1a49('0x45')](_0x145ca9)[_0x1a49('0x28')](function(_0x5484fb){_0x54934e[_0x1a49('0x45')]=_0x5484fb;if(_0xfdfde4['query']['includeAll']){_0x302c4f['include']=[{'all':!![]}];}return db[_0x1a49('0x30')]['findAll'](_0x302c4f);})[_0x1a49('0x28')](function(_0x5f1115){_0x54934e[_0x1a49('0x46')]=_0x5f1115;return _0x54934e;})['then'](respondWithFilteredResult(_0x3b4ab6,_0x302c4f))[_0x1a49('0x47')](handleError(_0x3b4ab6,null));};exports[_0x1a49('0x48')]=function(_0x2e932c,_0x427e2c){var _0x93fdb1={'raw':![],'where':{'id':_0x2e932c[_0x1a49('0x49')]['id']}},_0x1c6f5b={};_0x1c6f5b['model']=_[_0x1a49('0x36')](db['AnalyticCustomReport'][_0x1a49('0x31')]);_0x1c6f5b[_0x1a49('0x35')]=_[_0x1a49('0x36')](_0x2e932c[_0x1a49('0x35')]);_0x1c6f5b[_0x1a49('0x37')]=_[_0x1a49('0x38')](_0x1c6f5b[_0x1a49('0x34')],_0x1c6f5b[_0x1a49('0x35')]);_0x93fdb1[_0x1a49('0x39')]=_[_0x1a49('0x38')](_0x1c6f5b[_0x1a49('0x34')],qs[_0x1a49('0x3a')](_0x2e932c[_0x1a49('0x35')][_0x1a49('0x3a')]));_0x93fdb1['attributes']=_0x93fdb1[_0x1a49('0x39')][_0x1a49('0x3b')]?_0x93fdb1[_0x1a49('0x39')]:_0x1c6f5b[_0x1a49('0x34')];if(_0x2e932c['query'][_0x1a49('0x4a')]){_0x93fdb1[_0x1a49('0x4b')]=[{'all':!![]}];}_0x93fdb1=_[_0x1a49('0x44')]({},_0x93fdb1,_0x2e932c[_0x1a49('0x4c')]);return db[_0x1a49('0x30')][_0x1a49('0x4d')](_0x93fdb1)[_0x1a49('0x28')](handleEntityNotFound(_0x427e2c,null))[_0x1a49('0x28')](respondWithResult(_0x427e2c,null))[_0x1a49('0x47')](handleError(_0x427e2c,null));};exports[_0x1a49('0x4e')]=function(_0x568159,_0x213ff0){return db['AnalyticCustomReport'][_0x1a49('0x4e')](_0x568159['body'],{})['then'](function(_0x51ea57){var _0xe7422a=_0x568159[_0x1a49('0x4f')][_0x1a49('0x29')]({'plain':!![]});if(!_0xe7422a)throw new Error(_0x1a49('0x50'));if(_0xe7422a[_0x1a49('0x51')]===_0x1a49('0x4f')){var _0x1fb43a=_0x51ea57[_0x1a49('0x29')]({'plain':!![]});var _0x3eddb3=_0x1a49('0x52');return db[_0x1a49('0x53')][_0x1a49('0x4d')]({'where':{'name':_0x3eddb3,'userProfileId':_0xe7422a[_0x1a49('0x54')]},'raw':!![]})[_0x1a49('0x28')](function(_0x3d8a47){if(_0x3d8a47&&_0x3d8a47[_0x1a49('0x55')]===0x0){return db[_0x1a49('0x2b')][_0x1a49('0x4e')]({'name':_0x1fb43a[_0x1a49('0x2d')],'resourceId':_0x1fb43a['id'],'type':_0x1a49('0x2a'),'sectionId':_0x3d8a47['id']},{})[_0x1a49('0x28')](function(){return _0x51ea57;});}else{return _0x51ea57;}})[_0x1a49('0x47')](function(_0x202f34){logger[_0x1a49('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x202f34);throw _0x202f34;});}return _0x51ea57;})[_0x1a49('0x28')](respondWithResult(_0x213ff0,0xc9))[_0x1a49('0x47')](handleError(_0x213ff0,null));};exports[_0x1a49('0x26')]=function(_0x1d06fa,_0x588ae6){if(_0x1d06fa['body']['id']){delete _0x1d06fa['body']['id'];}return db[_0x1a49('0x30')][_0x1a49('0x4d')]({'where':{'id':_0x1d06fa[_0x1a49('0x49')]['id']}})[_0x1a49('0x28')](handleEntityNotFound(_0x588ae6,null))[_0x1a49('0x28')](saveUpdates(_0x1d06fa[_0x1a49('0x57')],null))[_0x1a49('0x28')](respondWithResult(_0x588ae6,null))[_0x1a49('0x47')](handleError(_0x588ae6,null));};exports[_0x1a49('0x27')]=function(_0x45ccbc,_0x2b71c1){return db[_0x1a49('0x30')][_0x1a49('0x4d')]({'where':{'id':_0x45ccbc[_0x1a49('0x49')]['id']}})[_0x1a49('0x28')](handleEntityNotFound(_0x2b71c1,null))[_0x1a49('0x28')](removeEntity(_0x2b71c1,null))[_0x1a49('0x47')](handleError(_0x2b71c1,null));};exports['preview']=function(_0x13eca2,_0x3c3ad5){var _0x44ae7c=0xa;var _0x47c8e7=['join','left_join',_0x1a49('0x58'),_0x1a49('0x59')];var _0x4c9318={'SUM':_0x1a49('0x5a'),'COUNT':_0x1a49('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1a49('0x5c'),'MIN':_0x1a49('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1a49('0x5e'),'GROUP_CONCAT ASC':_0x1a49('0x5f'),'GROUP_CONCAT DESC':_0x1a49('0x60')};var _0x4bf43a={'SEC_TO_TIME':_0x1a49('0x61'),'DATE':'DATE(%s)','HOUR':_0x1a49('0x62'),'ROUND':_0x1a49('0x63'),'UNIX_TIMESTAMP':_0x1a49('0x64')};var _0x481d46=function(_0x2734ce){return!_[_0x1a49('0x65')]([_0x1a49('0x66'),'IS\x20NOT\x20NULL',_0x1a49('0x67'),_0x1a49('0x68')],_0x2734ce);};var _0x102c84=function(_0x425483){if(!_0x425483||!_0x425483['rules']['length']){return'';}for(var _0x58117e='(',_0x55795f=0x0;_0x55795f<_0x425483['rules'][_0x1a49('0x3b')];_0x55795f+=0x1){_0x55795f>0x0&&(_0x58117e+='\x20'+_0x425483['operator']+'\x20');_0x58117e+=_0x425483[_0x1a49('0x69')][_0x55795f]['group']?_0x102c84(_0x425483['rules'][_0x55795f]['group']):_0x425483[_0x1a49('0x69')][_0x55795f][_0x1a49('0x6a')]+'\x20'+_0x425483[_0x1a49('0x69')][_0x55795f]['condition']+(_0x481d46(_0x425483[_0x1a49('0x69')][_0x55795f][_0x1a49('0x6b')])?'\x20'+_0x425483[_0x1a49('0x69')][_0x55795f][_0x1a49('0x6c')]:'');}return _0x58117e+')';};var _0x29350d={'where':{'id':_0x13eca2[_0x1a49('0x49')]['id']}},_0x1ef031,_0x41cb0b,_0x45579b,_0x3574c3,_0x1f740d;_0x29350d=_['merge']({},_0x29350d,_0x13eca2[_0x1a49('0x4c')]);return db[_0x1a49('0x30')][_0x1a49('0x4d')](_0x29350d)[_0x1a49('0x28')](function(_0x4df4d1){if(_0x4df4d1){_0x1ef031=_0x4df4d1;return _0x4df4d1[_0x1a49('0x6d')]();}return null;})[_0x1a49('0x28')](function(_0x406af7){if(_0x406af7){if(!_0x406af7['length']){throw new db['Sequelize'][(_0x1a49('0x6e'))](_0x1a49('0x6f'),0x193);}_0x41cb0b=_0x406af7;return db['AnalyticMetric'][_0x1a49('0x70')]({'raw':!![]});}return null;})[_0x1a49('0x28')](function(_0x5b14e9){if(_0x5b14e9){_0x45579b=_['keyBy'](_0x5b14e9,'id');var _0x3c8af6;var _0x5dba5c=squel[_0x1a49('0x71')]();_0x5dba5c['from'](_0x1ef031[_0x1a49('0x72')]);for(var _0x328f78=0x0;_0x328f78<_0x41cb0b['length'];_0x328f78+=0x1){_0x3c8af6=_0x41cb0b[_0x328f78][_0x1a49('0x73')]?_0x45579b[_0x41cb0b[_0x328f78][_0x1a49('0x73')]][_0x1a49('0x74')]:_0x41cb0b[_0x328f78][_0x1a49('0x6a')];_0x3c8af6=_0x41cb0b[_0x328f78][_0x1a49('0x75')]?_[_0x1a49('0x76')](_0x4c9318[_0x41cb0b[_0x328f78][_0x1a49('0x75')]],'%s',_0x3c8af6):_0x3c8af6;_0x3c8af6=_0x41cb0b[_0x328f78][_0x1a49('0x77')]?_[_0x1a49('0x76')](_0x4bf43a[_0x41cb0b[_0x328f78]['format']],'%s',_0x3c8af6):_0x3c8af6;if(_0x41cb0b[_0x328f78][_0x1a49('0x78')]){_0x5dba5c['group'](_0x3c8af6);}_0x41cb0b[_0x328f78]['orderBy']&&_0x5dba5c['order'](_0x3c8af6,_0x41cb0b[_0x328f78][_0x1a49('0x79')]==='DESC'?![]:!![]);_0x5dba5c[_0x1a49('0x6a')](_0x3c8af6,_0x41cb0b[_0x328f78][_0x1a49('0x7a')]||_0x3c8af6);}if(_0x1ef031['joins']){_0x1ef031['joins']=JSON[_0x1a49('0x7b')](_0x1ef031[_0x1a49('0x7c')]);for(var _0x394423=0x0;_0x394423<_0x1ef031['joins'][_0x1a49('0x3b')];_0x394423+=0x1){if(_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x42')]&&_[_0x1a49('0x65')](_0x47c8e7,_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x42')])&&_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x7d')]&&_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x7e')]&&_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x7f')]){_0x5dba5c[_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x42')]](_0x1ef031['joins'][_0x394423][_0x1a49('0x7e')],null,util[_0x1a49('0x77')](_0x1a49('0x80'),_0x1ef031[_0x1a49('0x72')],_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x7d')],_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x7e')],_0x1ef031[_0x1a49('0x7c')][_0x394423][_0x1a49('0x7f')]));}}}if(_0x1ef031[_0x1a49('0x81')]){_0x1ef031['conditions']=JSON['parse'](_0x1ef031['conditions']);_0x5dba5c[_0x1a49('0x3e')](_0x102c84(_0x1ef031['conditions'][_0x1a49('0x82')]));}_0x1f740d=_0x5dba5c['clone']();_0x5dba5c[_0x1a49('0x1f')](_0x44ae7c);_0x5dba5c[_0x1a49('0x1d')](0x0);logger[_0x1a49('0x83')](_0x1a49('0x84'),_0x5dba5c['toString']());return dbH[_0x1a49('0x85')][_0x1a49('0x35')](_0x5dba5c[_0x1a49('0x86')](),{'type':dbH[_0x1a49('0x85')][_0x1a49('0x87')][_0x1a49('0x88')]});}})[_0x1a49('0x28')](respondWithResult(_0x3c3ad5,null))[_0x1a49('0x47')](handleError(_0x3c3ad5,null));};function runReport(_0x317b70,_0x3e716b,_0x46a4e1){var _0x37844d=_0x3e716b[_0x1a49('0x2d')];var _0x2204d5=0xa;var _0x5e80a4=[_0x1a49('0x89'),_0x1a49('0x8a'),'right_join',_0x1a49('0x59')];var _0x4667ef={'SUM':_0x1a49('0x5a'),'COUNT':_0x1a49('0x5b'),'COUNT DISTINCT':_0x1a49('0x8b'),'MAX':'MAX(%s)','MIN':_0x1a49('0x5d'),'AVG':_0x1a49('0x8c'),'GROUP_CONCAT':_0x1a49('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1a49('0x60')};var _0x349847={'SEC_TO_TIME':_0x1a49('0x61'),'DATE':'DATE(%s)','HOUR':_0x1a49('0x62'),'ROUND':_0x1a49('0x63'),'UNIX_TIMESTAMP':_0x1a49('0x64')};var _0x74b04c=function(_0x3f6be2){return!_[_0x1a49('0x65')]([_0x1a49('0x66'),_0x1a49('0x8d'),_0x1a49('0x67'),_0x1a49('0x68')],_0x3f6be2);};var _0x2c29c9=function(_0x41ae9e){if(!_0x41ae9e||!_0x41ae9e['rules'][_0x1a49('0x3b')]){return'';}for(var _0x4fd60c='(',_0x19c96a=0x0;_0x19c96a<_0x41ae9e[_0x1a49('0x69')][_0x1a49('0x3b')];_0x19c96a+=0x1){_0x19c96a>0x0&&(_0x4fd60c+='\x20'+_0x41ae9e[_0x1a49('0x8e')]+'\x20');_0x4fd60c+=_0x41ae9e['rules'][_0x19c96a]['group']?_0x2c29c9(_0x41ae9e[_0x1a49('0x69')][_0x19c96a][_0x1a49('0x82')]):_0x41ae9e['rules'][_0x19c96a][_0x1a49('0x6a')]+'\x20'+_0x41ae9e['rules'][_0x19c96a][_0x1a49('0x6b')]+(_0x74b04c(_0x41ae9e[_0x1a49('0x69')][_0x19c96a][_0x1a49('0x6b')])?'\x20'+_0x41ae9e[_0x1a49('0x69')][_0x19c96a][_0x1a49('0x6c')]:'');}return _0x4fd60c+')';};var _0x46fc78={'where':{'id':_0x317b70['id']}},_0x27d2e3,_0x5315ac,_0x2ee398,_0x320aee,_0x8ae0e9;_0x46fc78=_[_0x1a49('0x44')]({},_0x46fc78,_0x46a4e1);return db['AnalyticCustomReport'][_0x1a49('0x4d')](_0x46fc78)['then'](function(_0x5cd639){if(_0x5cd639){_0x27d2e3=_0x5cd639;return _0x5cd639[_0x1a49('0x6d')]();}return null;})['then'](function(_0x45e55f){if(_0x45e55f){if(!_0x45e55f['length']){throw new db[(_0x1a49('0x8f'))][(_0x1a49('0x6e'))](_0x1a49('0x6f'),0x193);}_0x5315ac=_0x45e55f;return db[_0x1a49('0x90')][_0x1a49('0x70')]({'raw':!![]});}return null;})[_0x1a49('0x28')](function(_0x15a3a2){if(_0x15a3a2){_0x2ee398=_[_0x1a49('0x91')](_0x15a3a2,'id');var _0x10dfa9;var _0x51bf47=squel[_0x1a49('0x71')]();_0x51bf47[_0x1a49('0x92')](_0x27d2e3[_0x1a49('0x72')]);for(var _0x30559b=0x0;_0x30559b<_0x5315ac[_0x1a49('0x3b')];_0x30559b+=0x1){_0x10dfa9=_0x5315ac[_0x30559b][_0x1a49('0x73')]?_0x2ee398[_0x5315ac[_0x30559b]['MetricId']][_0x1a49('0x74')]:_0x5315ac[_0x30559b]['field'];_0x10dfa9=_0x5315ac[_0x30559b]['function']?_[_0x1a49('0x76')](_0x4667ef[_0x5315ac[_0x30559b]['function']],'%s',_0x10dfa9):_0x10dfa9;_0x10dfa9=_0x5315ac[_0x30559b]['format']?_[_0x1a49('0x76')](_0x349847[_0x5315ac[_0x30559b][_0x1a49('0x77')]],'%s',_0x10dfa9):_0x10dfa9;if(_0x5315ac[_0x30559b][_0x1a49('0x78')]){_0x51bf47[_0x1a49('0x82')](_0x10dfa9);}_0x5315ac[_0x30559b][_0x1a49('0x79')]&&_0x51bf47[_0x1a49('0x93')](_0x10dfa9,_0x5315ac[_0x30559b]['orderBy']===_0x1a49('0x94')?![]:!![]);_0x51bf47['field'](_0x10dfa9,_0x5315ac[_0x30559b][_0x1a49('0x7a')]||_0x10dfa9);}if(_0x27d2e3[_0x1a49('0x7c')]){_0x27d2e3['joins']=JSON[_0x1a49('0x7b')](_0x27d2e3[_0x1a49('0x7c')]);for(var _0x13e06c=0x0;_0x13e06c<_0x27d2e3[_0x1a49('0x7c')]['length'];_0x13e06c+=0x1){if(_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x42')]&&_[_0x1a49('0x65')](_0x5e80a4,_0x27d2e3['joins'][_0x13e06c][_0x1a49('0x42')])&&_0x27d2e3['joins'][_0x13e06c]['parentKey']&&_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x7e')]&&_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x7f')]){_0x51bf47[_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x42')]](_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x7e')],null,util['format'](_0x1a49('0x80'),_0x27d2e3[_0x1a49('0x72')],_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x7d')],_0x27d2e3[_0x1a49('0x7c')][_0x13e06c]['foreignTable'],_0x27d2e3[_0x1a49('0x7c')][_0x13e06c][_0x1a49('0x7f')]));}}}if(_0x27d2e3[_0x1a49('0x81')]){_0x27d2e3['conditions']=JSON['parse'](_0x27d2e3['conditions']);_0x51bf47[_0x1a49('0x3e')](_0x2c29c9(_0x27d2e3['conditions']['group']));}_0x8ae0e9=_0x51bf47[_0x1a49('0x95')]();_0x51bf47['limit'](_0x2204d5);_0x51bf47['offset'](0x0);return;}})['then'](function(){if(_0x3e716b[_0x1a49('0x96')]===_0x1a49('0x97')){return null;}var _0x173d7d=_[_0x1a49('0x44')](_0x3e716b,{'name':_0x3e716b['fullPath']||_0x3e716b[_0x1a49('0x2d')]||_0x27d2e3[_0x1a49('0x2d')],'basename':_0x37844d,'savename':util[_0x1a49('0x77')](_0x1a49('0x98'),_0x3e716b['name']||_0x27d2e3['name'],require(_0x1a49('0x99'))['generate'](0x4),_0x3e716b['output']||_0x1a49('0x9a')),'reportId':_0x27d2e3['id'],'reportType':_0x1a49('0x9b')});return db['AnalyticExtractedReport']['create'](_0x173d7d,{'raw':!![]});})['then'](function(_0x1b0d3e){if(_0x27d2e3['table']===_0x1a49('0x9c')){_0x8ae0e9['where'](_0x27d2e3['table']+_0x1a49('0x9d'),_0x3e716b['startDate'],_0x3e716b['endDate']);}else{_0x8ae0e9[_0x1a49('0x3e')](_0x27d2e3['table']+_0x1a49('0x9e'),_0x3e716b[_0x1a49('0x9f')],_0x3e716b[_0x1a49('0xa0')]);}if(_0x1b0d3e){logger[_0x1a49('0xa1')](_0x1a49('0xa2'),_0x8ae0e9[_0x1a49('0x86')]());require(_0x1a49('0xa3'))['fork'](path[_0x1a49('0x89')](__dirname,'../../components/export/',_0x1b0d3e[_0x1a49('0x96')]),[_0x1b0d3e['id'],_0x8ae0e9['toString'](),path[_0x1a49('0x89')](__dirname,_0x1a49('0xa4'),_0x1b0d3e[_0x1a49('0xa5')]),_0x37844d]);return _0x1b0d3e;}else{var _0xc2e669=squel['select']();_0xc2e669[_0x1a49('0x92')]('('+_0x8ae0e9[_0x1a49('0x86')]()+')','countTable');_0xc2e669['field'](_0x1a49('0xa6'),'count');_0x8ae0e9[_0x1a49('0x1f')](_0x3e716b[_0x1a49('0x1f')]||_0x2204d5);_0x8ae0e9[_0x1a49('0x1d')](_0x3e716b['offset']||0x0);return dbH[_0x1a49('0x85')][_0x1a49('0x35')](_0xc2e669[_0x1a49('0x86')](),{'type':dbH[_0x1a49('0x85')][_0x1a49('0x87')][_0x1a49('0x88')]})['then'](function(_0x4ce09f){if(!_0x4ce09f['length']){_0x320aee=0x0;}else{_0x320aee=_0x4ce09f[0x0][_0x1a49('0x45')]||0x0;}return dbH[_0x1a49('0x85')][_0x1a49('0x35')](_0x8ae0e9[_0x1a49('0x86')](),{'type':dbH[_0x1a49('0x85')][_0x1a49('0x87')][_0x1a49('0x88')]});})['then'](function(_0xf0fc6a){return{'rows':_0xf0fc6a||[],'count':_0x320aee};});}});}exports[_0x1a49('0xa7')]=function(_0x5cf1e3,_0x429bfb){return runReport(_0x5cf1e3[_0x1a49('0x49')],_0x5cf1e3[_0x1a49('0x35')],_0x5cf1e3[_0x1a49('0x4c')])[_0x1a49('0x28')](respondWithResult(_0x429bfb,null))['catch'](handleError(_0x429bfb,null));};exports[_0x1a49('0xa8')]=runReport;exports[_0x1a49('0x35')]=function(_0x1c6ae0,_0x1e41be){var _0x3ca024=0xa;var _0x570d3e=[_0x1a49('0x89'),'left_join','right_join','cross_join'];var _0x12f9b6={'SUM':_0x1a49('0x5a'),'COUNT':_0x1a49('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x1a49('0x5d'),'AVG':_0x1a49('0x8c'),'GROUP_CONCAT':_0x1a49('0x5e'),'GROUP_CONCAT ASC':_0x1a49('0x5f'),'GROUP_CONCAT DESC':_0x1a49('0x60')};var _0x4300a7={'SEC_TO_TIME':_0x1a49('0x61'),'DATE':_0x1a49('0xa9'),'HOUR':'HOUR(%s)','ROUND':_0x1a49('0x63'),'UNIX_TIMESTAMP':_0x1a49('0x64')};var _0x304b03=function(_0x305fa1){return!_['includes']([_0x1a49('0x66'),_0x1a49('0x8d'),_0x1a49('0x67'),'IS\x20NOT\x20EMPTY'],_0x305fa1);};var _0x3ca0bd=function(_0x1c9a67){if(!_0x1c9a67||!_0x1c9a67[_0x1a49('0x69')][_0x1a49('0x3b')]){return'';}for(var _0x34948d='(',_0xa17168=0x0;_0xa17168<_0x1c9a67[_0x1a49('0x69')][_0x1a49('0x3b')];_0xa17168+=0x1){_0xa17168>0x0&&(_0x34948d+='\x20'+_0x1c9a67[_0x1a49('0x8e')]+'\x20');_0x34948d+=_0x1c9a67[_0x1a49('0x69')][_0xa17168][_0x1a49('0x82')]?_0x3ca0bd(_0x1c9a67[_0x1a49('0x69')][_0xa17168]['group']):_0x1c9a67[_0x1a49('0x69')][_0xa17168][_0x1a49('0x6a')]+'\x20'+_0x1c9a67[_0x1a49('0x69')][_0xa17168]['condition']+(_0x304b03(_0x1c9a67[_0x1a49('0x69')][_0xa17168][_0x1a49('0x6b')])?'\x20'+_0x1c9a67[_0x1a49('0x69')][_0xa17168][_0x1a49('0x6c')]:'');}return _0x34948d+')';};var _0x226bd4={'where':{'id':_0x1c6ae0[_0x1a49('0x49')]['id']}},_0x3e8cfb,_0x7fe985,_0x167397,_0x4aeda4,_0x3b5bde;_0x226bd4=_[_0x1a49('0x44')]({},_0x226bd4,_0x1c6ae0[_0x1a49('0x4c')]);return db['AnalyticCustomReport'][_0x1a49('0x4d')](_0x226bd4)['then'](function(_0x481de4){if(_0x481de4){_0x3e8cfb=_0x481de4;return _0x481de4[_0x1a49('0x6d')]();}return null;})[_0x1a49('0x28')](function(_0x1b6efb){if(_0x1b6efb){if(!_0x1b6efb[_0x1a49('0x3b')]){throw new db[(_0x1a49('0x8f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x7fe985=_0x1b6efb;return db['AnalyticMetric'][_0x1a49('0x70')]({'raw':!![]});}return null;})[_0x1a49('0x28')](function(_0x3c7fc1){if(_0x3c7fc1){_0x167397=_[_0x1a49('0x91')](_0x3c7fc1,'id');var _0x1a075c;var _0x53b425=squel['select']();_0x53b425[_0x1a49('0x92')](_0x3e8cfb['table']);for(var _0x3472e9=0x0;_0x3472e9<_0x7fe985[_0x1a49('0x3b')];_0x3472e9+=0x1){_0x1a075c=_0x7fe985[_0x3472e9][_0x1a49('0x73')]?_0x167397[_0x7fe985[_0x3472e9]['MetricId']][_0x1a49('0x74')]:_0x7fe985[_0x3472e9][_0x1a49('0x6a')];_0x1a075c=_0x7fe985[_0x3472e9]['function']?_[_0x1a49('0x76')](_0x12f9b6[_0x7fe985[_0x3472e9][_0x1a49('0x75')]],'%s',_0x1a075c):_0x1a075c;_0x1a075c=_0x7fe985[_0x3472e9][_0x1a49('0x77')]?_[_0x1a49('0x76')](_0x4300a7[_0x7fe985[_0x3472e9][_0x1a49('0x77')]],'%s',_0x1a075c):_0x1a075c;if(_0x7fe985[_0x3472e9][_0x1a49('0x78')]){_0x53b425[_0x1a49('0x82')](_0x1a075c);}_0x7fe985[_0x3472e9]['orderBy']&&_0x53b425[_0x1a49('0x93')](_0x1a075c,_0x7fe985[_0x3472e9]['orderBy']===_0x1a49('0x94')?![]:!![]);_0x53b425[_0x1a49('0x6a')](_0x1a075c,_0x7fe985[_0x3472e9][_0x1a49('0x7a')]||_0x1a075c);}if(_0x3e8cfb[_0x1a49('0x7c')]){_0x3e8cfb[_0x1a49('0x7c')]=JSON[_0x1a49('0x7b')](_0x3e8cfb[_0x1a49('0x7c')]);for(var _0x15895=0x0;_0x15895<_0x3e8cfb[_0x1a49('0x7c')][_0x1a49('0x3b')];_0x15895+=0x1){if(_0x3e8cfb['joins'][_0x15895][_0x1a49('0x42')]&&_['includes'](_0x570d3e,_0x3e8cfb[_0x1a49('0x7c')][_0x15895][_0x1a49('0x42')])&&_0x3e8cfb[_0x1a49('0x7c')][_0x15895]['parentKey']&&_0x3e8cfb[_0x1a49('0x7c')][_0x15895][_0x1a49('0x7e')]&&_0x3e8cfb['joins'][_0x15895][_0x1a49('0x7f')]){_0x53b425[_0x3e8cfb['joins'][_0x15895][_0x1a49('0x42')]](_0x3e8cfb['joins'][_0x15895][_0x1a49('0x7e')],null,util[_0x1a49('0x77')](_0x1a49('0x80'),_0x3e8cfb[_0x1a49('0x72')],_0x3e8cfb[_0x1a49('0x7c')][_0x15895][_0x1a49('0x7d')],_0x3e8cfb[_0x1a49('0x7c')][_0x15895][_0x1a49('0x7e')],_0x3e8cfb['joins'][_0x15895][_0x1a49('0x7f')]));}}}if(_0x3e8cfb[_0x1a49('0x81')]){_0x3e8cfb[_0x1a49('0x81')]=JSON[_0x1a49('0x7b')](_0x3e8cfb[_0x1a49('0x81')]);_0x53b425[_0x1a49('0x3e')](_0x3ca0bd(_0x3e8cfb[_0x1a49('0x81')][_0x1a49('0x82')]));}_0x3b5bde=_0x53b425[_0x1a49('0x95')]();_0x53b425['limit'](_0x3ca024);_0x53b425[_0x1a49('0x1d')](0x0);logger[_0x1a49('0x83')](_0x1a49('0x84'),_0x53b425[_0x1a49('0x86')]());return dbH[_0x1a49('0x85')][_0x1a49('0x35')](_0x53b425[_0x1a49('0x86')](),{'type':dbH[_0x1a49('0x85')]['QueryTypes'][_0x1a49('0x88')]});}})[_0x1a49('0x28')](function(){return{'sql':_0x3b5bde[_0x1a49('0x86')]()};})['then'](respondWithResult(_0x1e41be,null))[_0x1a49('0x47')](handleError(_0x1e41be,null));};
\ No newline at end of file
+var _0x8946=['dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','sequelize','toString','QueryTypes','SELECT','UNIX_TIMESTAMP(%s)','operator','value','Sequelize','ValidationErrorItem','function','clone','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','savename','run','right_join','AnalyticMetric','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x62f666,_0x2279b7){var _0x4827d8=function(_0x406a73){while(--_0x406a73){_0x62f666['push'](_0x62f666['shift']());}};_0x4827d8(++_0x2279b7);}(_0x8946,0x130));var _0x6894=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x8946[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0x6894('0x0'));var rimraf=require(_0x6894('0x1'));var zipdir=require(_0x6894('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6894('0x3'));var moment=require(_0x6894('0x4'));var BPromise=require(_0x6894('0x5'));var Mustache=require(_0x6894('0x6'));var util=require(_0x6894('0x7'));var path=require(_0x6894('0x8'));var sox=require(_0x6894('0x9'));var csv=require(_0x6894('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6894('0xa'));var querystring=require('querystring');var Papa=require(_0x6894('0xb'));var Redis=require(_0x6894('0xc'));var authService=require(_0x6894('0xd'));var qs=require(_0x6894('0xe'));var as=require(_0x6894('0xf'));var hardwareService=require(_0x6894('0x10'));var logger=require(_0x6894('0x11'))(_0x6894('0x12'));var utils=require(_0x6894('0x13'));var config=require(_0x6894('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6894('0x15'))['db'];var dbH=require(_0x6894('0x15'))[_0x6894('0x16')];function respondWithStatusCode(_0x486d81,_0x47eaff){_0x47eaff=_0x47eaff||0xcc;return function(_0x22b531){if(_0x22b531){return _0x486d81[_0x6894('0x17')](_0x47eaff);}return _0x486d81[_0x6894('0x18')](_0x47eaff)[_0x6894('0x19')]();};}function respondWithResult(_0x5be040,_0x1391a3){_0x1391a3=_0x1391a3||0xc8;return function(_0x1d78a9){if(_0x1d78a9){return _0x5be040[_0x6894('0x18')](_0x1391a3)[_0x6894('0x1a')](_0x1d78a9);}};}function respondWithFilteredResult(_0x3aec8f,_0x45b9b7){return function(_0xf8f5ee){if(_0xf8f5ee){var _0x482475=typeof _0x45b9b7[_0x6894('0x1b')]==='undefined'&&typeof _0x45b9b7[_0x6894('0x1c')]===_0x6894('0x1d');var _0x53e9f2=_0xf8f5ee['count'];var _0x1960e6=_0x482475?0x0:_0x45b9b7[_0x6894('0x1b')];var _0x3b1ecf=_0x482475?_0xf8f5ee[_0x6894('0x1e')]:_0x45b9b7[_0x6894('0x1b')]+_0x45b9b7[_0x6894('0x1c')];var _0x242448;if(_0x3b1ecf>=_0x53e9f2){_0x3b1ecf=_0x53e9f2;_0x242448=0xc8;}else{_0x242448=0xce;}_0x3aec8f[_0x6894('0x18')](_0x242448);return _0x3aec8f[_0x6894('0x1f')]('Content-Range',_0x1960e6+'-'+_0x3b1ecf+'/'+_0x53e9f2)[_0x6894('0x1a')](_0xf8f5ee);}return null;};}function patchUpdates(_0x167af9){return function(_0x6be790){try{jsonpatch[_0x6894('0x20')](_0x6be790,_0x167af9,!![]);}catch(_0x199b3f){return BPromise[_0x6894('0x21')](_0x199b3f);}return _0x6be790[_0x6894('0x22')]();};}function saveUpdates(_0x19fd58,_0x258597){return function(_0x4e79ed){if(_0x4e79ed){return _0x4e79ed[_0x6894('0x23')](_0x19fd58)[_0x6894('0x24')](function(_0x4fb52e){return _0x4fb52e;});}return null;};}function removeEntity(_0x1efa03,_0x29179c){return function(_0x38b746){if(_0x38b746){return _0x38b746[_0x6894('0x25')]()[_0x6894('0x24')](function(){var _0x57aa38=_0x38b746[_0x6894('0x26')]({'plain':!![]});var _0x241d46=_0x6894('0x27');return db[_0x6894('0x28')]['destroy']({'where':{'type':_0x241d46,'resourceId':_0x57aa38['id']}})['then'](function(){return _0x38b746;});})[_0x6894('0x24')](function(){_0x1efa03[_0x6894('0x18')](0xcc)[_0x6894('0x19')]();});}};}function handleEntityNotFound(_0x284dc5,_0x3e7acc){return function(_0x48cec2){if(!_0x48cec2){_0x284dc5[_0x6894('0x17')](0x194);}return _0x48cec2;};}function handleError(_0x46141e,_0x3b7716){_0x3b7716=_0x3b7716||0x1f4;return function(_0x4f56cd){logger[_0x6894('0x29')](_0x4f56cd[_0x6894('0x2a')]);if(_0x4f56cd[_0x6894('0x2b')]){delete _0x4f56cd[_0x6894('0x2b')];}_0x46141e[_0x6894('0x18')](_0x3b7716)[_0x6894('0x2c')](_0x4f56cd);};}exports[_0x6894('0x2d')]=function(_0x24c4ed,_0x504a7a){var _0x2ff7b7={},_0x1c8ef9={},_0x2e933d={'count':0x0,'rows':[]};var _0x479bda=_['map'](db['AnalyticCustomReport'][_0x6894('0x2e')],function(_0x26daba){return{'name':_0x26daba[_0x6894('0x2f')],'type':_0x26daba['type'][_0x6894('0x30')]};});_0x1c8ef9[_0x6894('0x31')]=_['map'](_0x479bda,_0x6894('0x2b'));_0x1c8ef9[_0x6894('0x32')]=_['keys'](_0x24c4ed[_0x6894('0x32')]);_0x1c8ef9[_0x6894('0x33')]=_[_0x6894('0x34')](_0x1c8ef9[_0x6894('0x31')],_0x1c8ef9[_0x6894('0x32')]);_0x2ff7b7[_0x6894('0x35')]=_[_0x6894('0x34')](_0x1c8ef9[_0x6894('0x31')],qs['fields'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x36')]));_0x2ff7b7[_0x6894('0x35')]=_0x2ff7b7[_0x6894('0x35')][_0x6894('0x37')]?_0x2ff7b7['attributes']:_0x1c8ef9['model'];if(!_0x24c4ed['query'][_0x6894('0x38')](_0x6894('0x39'))){_0x2ff7b7[_0x6894('0x1c')]=qs['limit'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x1c')]);_0x2ff7b7[_0x6894('0x1b')]=qs['offset'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x1b')]);}_0x2ff7b7['order']=qs['sort'](_0x24c4ed[_0x6894('0x32')][_0x6894('0x3a')]);_0x2ff7b7[_0x6894('0x3b')]=qs[_0x6894('0x33')](_[_0x6894('0x3c')](_0x24c4ed[_0x6894('0x32')],_0x1c8ef9[_0x6894('0x33')]),_0x479bda);if(_0x24c4ed[_0x6894('0x32')][_0x6894('0x3d')]){_0x2ff7b7['where']=_[_0x6894('0x3e')](_0x2ff7b7[_0x6894('0x3b')],{'$or':_['map'](_0x479bda,function(_0x16a68c){if(_0x16a68c[_0x6894('0x3f')]!=='VIRTUAL'){var _0x54b5d2={};_0x54b5d2[_0x16a68c[_0x6894('0x2b')]]={'$like':'%'+_0x24c4ed['query'][_0x6894('0x3d')]+'%'};return _0x54b5d2;}})});}_0x2ff7b7=_['merge']({},_0x2ff7b7,_0x24c4ed[_0x6894('0x40')]);var _0x20a9de={'where':_0x2ff7b7[_0x6894('0x3b')]};return db[_0x6894('0x41')][_0x6894('0x1e')](_0x20a9de)[_0x6894('0x24')](function(_0x57e99c){_0x2e933d[_0x6894('0x1e')]=_0x57e99c;if(_0x24c4ed[_0x6894('0x32')][_0x6894('0x42')]){_0x2ff7b7[_0x6894('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x6894('0x44')](_0x2ff7b7);})[_0x6894('0x24')](function(_0x45fda8){_0x2e933d[_0x6894('0x45')]=_0x45fda8;return _0x2e933d;})['then'](respondWithFilteredResult(_0x504a7a,_0x2ff7b7))[_0x6894('0x46')](handleError(_0x504a7a,null));};exports[_0x6894('0x47')]=function(_0x1b5102,_0x5ccf96){var _0x2e13d7={'raw':![],'where':{'id':_0x1b5102[_0x6894('0x48')]['id']}},_0x5a795a={};_0x5a795a[_0x6894('0x31')]=_[_0x6894('0x49')](db[_0x6894('0x41')]['rawAttributes']);_0x5a795a['query']=_['keys'](_0x1b5102[_0x6894('0x32')]);_0x5a795a['filters']=_['intersection'](_0x5a795a['model'],_0x5a795a[_0x6894('0x32')]);_0x2e13d7[_0x6894('0x35')]=_['intersection'](_0x5a795a['model'],qs[_0x6894('0x36')](_0x1b5102[_0x6894('0x32')][_0x6894('0x36')]));_0x2e13d7['attributes']=_0x2e13d7[_0x6894('0x35')][_0x6894('0x37')]?_0x2e13d7['attributes']:_0x5a795a['model'];if(_0x1b5102[_0x6894('0x32')]['includeAll']){_0x2e13d7[_0x6894('0x43')]=[{'all':!![]}];}_0x2e13d7=_[_0x6894('0x3e')]({},_0x2e13d7,_0x1b5102[_0x6894('0x40')]);return db['AnalyticCustomReport'][_0x6894('0x4a')](_0x2e13d7)[_0x6894('0x24')](handleEntityNotFound(_0x5ccf96,null))['then'](respondWithResult(_0x5ccf96,null))[_0x6894('0x46')](handleError(_0x5ccf96,null));};exports[_0x6894('0x4b')]=function(_0x3f010f,_0x5cb7d3){return db['AnalyticCustomReport'][_0x6894('0x4b')](_0x3f010f[_0x6894('0x4c')],{})[_0x6894('0x24')](function(_0xbb2f08){var _0x154f7f=_0x3f010f['user'][_0x6894('0x26')]({'plain':!![]});if(!_0x154f7f)throw new Error(_0x6894('0x4d'));if(_0x154f7f[_0x6894('0x4e')]==='user'){var _0x1c486e=_0xbb2f08[_0x6894('0x26')]({'plain':!![]});var _0x8abbee=_0x6894('0x4f');return db[_0x6894('0x50')]['find']({'where':{'name':_0x8abbee,'userProfileId':_0x154f7f[_0x6894('0x51')]},'raw':!![]})[_0x6894('0x24')](function(_0x584823){if(_0x584823&&_0x584823[_0x6894('0x52')]===0x0){return db[_0x6894('0x28')][_0x6894('0x4b')]({'name':_0x1c486e[_0x6894('0x2b')],'resourceId':_0x1c486e['id'],'type':_0x6894('0x27'),'sectionId':_0x584823['id']},{})[_0x6894('0x24')](function(){return _0xbb2f08;});}else{return _0xbb2f08;}})[_0x6894('0x46')](function(_0x355218){logger[_0x6894('0x29')](_0x6894('0x53'),_0x355218);throw _0x355218;});}return _0xbb2f08;})['then'](respondWithResult(_0x5cb7d3,0xc9))['catch'](handleError(_0x5cb7d3,null));};exports[_0x6894('0x23')]=function(_0x5c9e4c,_0x2bcc0f){if(_0x5c9e4c['body']['id']){delete _0x5c9e4c[_0x6894('0x4c')]['id'];}return db[_0x6894('0x41')]['find']({'where':{'id':_0x5c9e4c[_0x6894('0x48')]['id']}})[_0x6894('0x24')](handleEntityNotFound(_0x2bcc0f,null))['then'](saveUpdates(_0x5c9e4c[_0x6894('0x4c')],null))[_0x6894('0x24')](respondWithResult(_0x2bcc0f,null))[_0x6894('0x46')](handleError(_0x2bcc0f,null));};exports[_0x6894('0x25')]=function(_0x33e8d6,_0x39a2e5){return db['AnalyticCustomReport'][_0x6894('0x4a')]({'where':{'id':_0x33e8d6['params']['id']}})['then'](handleEntityNotFound(_0x39a2e5,null))['then'](removeEntity(_0x39a2e5,null))[_0x6894('0x46')](handleError(_0x39a2e5,null));};exports[_0x6894('0x54')]=function(_0x2e8c46,_0x207989){var _0x4f87e8=0xa;var _0x409f51=[_0x6894('0x55'),_0x6894('0x56'),'right_join',_0x6894('0x57')];var _0x1c2d9c={'SUM':_0x6894('0x58'),'COUNT':_0x6894('0x59'),'COUNT DISTINCT':_0x6894('0x5a'),'MAX':_0x6894('0x5b'),'MIN':_0x6894('0x5c'),'AVG':_0x6894('0x5d'),'GROUP_CONCAT':_0x6894('0x5e'),'GROUP_CONCAT ASC':_0x6894('0x5f'),'GROUP_CONCAT DESC':_0x6894('0x60')};var _0x493c8a={'SEC_TO_TIME':_0x6894('0x61'),'DATE':_0x6894('0x62'),'HOUR':_0x6894('0x63'),'ROUND':_0x6894('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32127b=function(_0x4e67fe){return!_[_0x6894('0x65')]([_0x6894('0x66'),_0x6894('0x67'),_0x6894('0x68'),_0x6894('0x69')],_0x4e67fe);};var _0x16aaee=function(_0x1c604c){if(!_0x1c604c||!_0x1c604c[_0x6894('0x6a')][_0x6894('0x37')]){return'';}for(var _0x5c4df6='(',_0x177c61=0x0;_0x177c61<_0x1c604c['rules'][_0x6894('0x37')];_0x177c61+=0x1){_0x177c61>0x0&&(_0x5c4df6+='\x20'+_0x1c604c['operator']+'\x20');_0x5c4df6+=_0x1c604c[_0x6894('0x6a')][_0x177c61][_0x6894('0x6b')]?_0x16aaee(_0x1c604c[_0x6894('0x6a')][_0x177c61][_0x6894('0x6b')]):_0x1c604c['rules'][_0x177c61][_0x6894('0x6c')]+'\x20'+_0x1c604c[_0x6894('0x6a')][_0x177c61]['condition']+(_0x32127b(_0x1c604c[_0x6894('0x6a')][_0x177c61][_0x6894('0x6d')])?'\x20'+_0x1c604c[_0x6894('0x6a')][_0x177c61]['value']:'');}return _0x5c4df6+')';};var _0x1ba7b9={'where':{'id':_0x2e8c46['params']['id']}},_0x3a9795,_0x2be92a,_0x408f8f,_0x5f32ea,_0x31ed10;_0x1ba7b9=_['merge']({},_0x1ba7b9,_0x2e8c46[_0x6894('0x40')]);return db[_0x6894('0x41')][_0x6894('0x4a')](_0x1ba7b9)[_0x6894('0x24')](function(_0x4683a5){if(_0x4683a5){_0x3a9795=_0x4683a5;return _0x4683a5[_0x6894('0x6e')]();}return null;})[_0x6894('0x24')](function(_0x12b1b5){if(_0x12b1b5){if(!_0x12b1b5[_0x6894('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0x6894('0x6f'),0x193);}_0x2be92a=_0x12b1b5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x6894('0x24')](function(_0x9cadb9){if(_0x9cadb9){_0x408f8f=_[_0x6894('0x70')](_0x9cadb9,'id');var _0x51c7e6;var _0x4c6385=squel[_0x6894('0x71')]();_0x4c6385[_0x6894('0x72')](_0x3a9795[_0x6894('0x73')]);for(var _0x2c978f=0x0;_0x2c978f<_0x2be92a[_0x6894('0x37')];_0x2c978f+=0x1){_0x51c7e6=_0x2be92a[_0x2c978f][_0x6894('0x74')]?_0x408f8f[_0x2be92a[_0x2c978f][_0x6894('0x74')]][_0x6894('0x75')]:_0x2be92a[_0x2c978f][_0x6894('0x6c')];_0x51c7e6=_0x2be92a[_0x2c978f]['function']?_[_0x6894('0x76')](_0x1c2d9c[_0x2be92a[_0x2c978f]['function']],'%s',_0x51c7e6):_0x51c7e6;_0x51c7e6=_0x2be92a[_0x2c978f][_0x6894('0x77')]?_['replace'](_0x493c8a[_0x2be92a[_0x2c978f][_0x6894('0x77')]],'%s',_0x51c7e6):_0x51c7e6;if(_0x2be92a[_0x2c978f][_0x6894('0x78')]){_0x4c6385[_0x6894('0x6b')](_0x51c7e6);}_0x2be92a[_0x2c978f][_0x6894('0x79')]&&_0x4c6385[_0x6894('0x7a')](_0x51c7e6,_0x2be92a[_0x2c978f][_0x6894('0x79')]===_0x6894('0x7b')?![]:!![]);_0x4c6385[_0x6894('0x6c')](_0x51c7e6,_0x2be92a[_0x2c978f][_0x6894('0x7c')]||_0x51c7e6);}if(_0x3a9795[_0x6894('0x7d')]){_0x3a9795[_0x6894('0x7d')]=JSON[_0x6894('0x7e')](_0x3a9795[_0x6894('0x7d')]);for(var _0xcb7ac0=0x0;_0xcb7ac0<_0x3a9795[_0x6894('0x7d')]['length'];_0xcb7ac0+=0x1){if(_0x3a9795[_0x6894('0x7d')][_0xcb7ac0]['type']&&_[_0x6894('0x65')](_0x409f51,_0x3a9795['joins'][_0xcb7ac0][_0x6894('0x3f')])&&_0x3a9795[_0x6894('0x7d')][_0xcb7ac0]['parentKey']&&_0x3a9795['joins'][_0xcb7ac0][_0x6894('0x7f')]&&_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x80')]){_0x4c6385[_0x3a9795[_0x6894('0x7d')][_0xcb7ac0]['type']](_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x7f')],null,util['format'](_0x6894('0x81'),_0x3a9795[_0x6894('0x73')],_0x3a9795['joins'][_0xcb7ac0][_0x6894('0x82')],_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x7f')],_0x3a9795[_0x6894('0x7d')][_0xcb7ac0][_0x6894('0x80')]));}}}if(_0x3a9795[_0x6894('0x83')]){_0x3a9795[_0x6894('0x83')]=JSON[_0x6894('0x7e')](_0x3a9795[_0x6894('0x83')]);_0x4c6385[_0x6894('0x3b')](_0x16aaee(_0x3a9795[_0x6894('0x83')][_0x6894('0x6b')]));}_0x31ed10=_0x4c6385['clone']();_0x4c6385['limit'](_0x4f87e8);_0x4c6385['offset'](0x0);logger[_0x6894('0x84')]('Limited\x20Query:',_0x4c6385['toString']());return dbH[_0x6894('0x85')]['query'](_0x4c6385[_0x6894('0x86')](),{'type':dbH[_0x6894('0x85')][_0x6894('0x87')][_0x6894('0x88')]});}})['then'](respondWithResult(_0x207989,null))[_0x6894('0x46')](handleError(_0x207989,null));};function runReport(_0x2f6da5,_0xef6f4c,_0x3ef4ca){var _0x218c26=_0xef6f4c[_0x6894('0x2b')];var _0xe62227=0xa;var _0x4cff1d=[_0x6894('0x55'),_0x6894('0x56'),'right_join',_0x6894('0x57')];var _0x1a4e9c={'SUM':_0x6894('0x58'),'COUNT':_0x6894('0x59'),'COUNT DISTINCT':_0x6894('0x5a'),'MAX':_0x6894('0x5b'),'MIN':'MIN(%s)','AVG':_0x6894('0x5d'),'GROUP_CONCAT':_0x6894('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6894('0x60')};var _0x2dad52={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6894('0x62'),'HOUR':_0x6894('0x63'),'ROUND':_0x6894('0x64'),'UNIX_TIMESTAMP':_0x6894('0x89')};var _0x1ad75b=function(_0x29ddc0){return!_[_0x6894('0x65')]([_0x6894('0x66'),_0x6894('0x67'),_0x6894('0x68'),_0x6894('0x69')],_0x29ddc0);};var _0x23be9d=function(_0x1a4abd){if(!_0x1a4abd||!_0x1a4abd[_0x6894('0x6a')]['length']){return'';}for(var _0x463f20='(',_0xc97bf7=0x0;_0xc97bf7<_0x1a4abd['rules'][_0x6894('0x37')];_0xc97bf7+=0x1){_0xc97bf7>0x0&&(_0x463f20+='\x20'+_0x1a4abd[_0x6894('0x8a')]+'\x20');_0x463f20+=_0x1a4abd[_0x6894('0x6a')][_0xc97bf7][_0x6894('0x6b')]?_0x23be9d(_0x1a4abd['rules'][_0xc97bf7][_0x6894('0x6b')]):_0x1a4abd[_0x6894('0x6a')][_0xc97bf7]['field']+'\x20'+_0x1a4abd[_0x6894('0x6a')][_0xc97bf7][_0x6894('0x6d')]+(_0x1ad75b(_0x1a4abd['rules'][_0xc97bf7][_0x6894('0x6d')])?'\x20'+_0x1a4abd[_0x6894('0x6a')][_0xc97bf7][_0x6894('0x8b')]:'');}return _0x463f20+')';};var _0x106845={'where':{'id':_0x2f6da5['id']}},_0x50fd06,_0x2771a7,_0x26e980,_0x7f45d0,_0x57d661;_0x106845=_[_0x6894('0x3e')]({},_0x106845,_0x3ef4ca);return db[_0x6894('0x41')]['find'](_0x106845)[_0x6894('0x24')](function(_0x4a39f6){if(_0x4a39f6){_0x50fd06=_0x4a39f6;return _0x4a39f6['getFields']();}return null;})['then'](function(_0x263658){if(_0x263658){if(!_0x263658[_0x6894('0x37')]){throw new db[(_0x6894('0x8c'))][(_0x6894('0x8d'))](_0x6894('0x6f'),0x193);}_0x2771a7=_0x263658;return db['AnalyticMetric'][_0x6894('0x44')]({'raw':!![]});}return null;})['then'](function(_0x3696cb){if(_0x3696cb){_0x26e980=_[_0x6894('0x70')](_0x3696cb,'id');var _0x192c15;var _0x402458=squel['select']();_0x402458[_0x6894('0x72')](_0x50fd06['table']);for(var _0x19e62a=0x0;_0x19e62a<_0x2771a7[_0x6894('0x37')];_0x19e62a+=0x1){_0x192c15=_0x2771a7[_0x19e62a][_0x6894('0x74')]?_0x26e980[_0x2771a7[_0x19e62a][_0x6894('0x74')]][_0x6894('0x75')]:_0x2771a7[_0x19e62a][_0x6894('0x6c')];_0x192c15=_0x2771a7[_0x19e62a][_0x6894('0x8e')]?_[_0x6894('0x76')](_0x1a4e9c[_0x2771a7[_0x19e62a][_0x6894('0x8e')]],'%s',_0x192c15):_0x192c15;_0x192c15=_0x2771a7[_0x19e62a]['format']?_[_0x6894('0x76')](_0x2dad52[_0x2771a7[_0x19e62a][_0x6894('0x77')]],'%s',_0x192c15):_0x192c15;if(_0x2771a7[_0x19e62a][_0x6894('0x78')]){_0x402458['group'](_0x192c15);}_0x2771a7[_0x19e62a][_0x6894('0x79')]&&_0x402458[_0x6894('0x7a')](_0x192c15,_0x2771a7[_0x19e62a]['orderBy']===_0x6894('0x7b')?![]:!![]);_0x402458[_0x6894('0x6c')](_0x192c15,_0x2771a7[_0x19e62a][_0x6894('0x7c')]||_0x192c15);}if(_0x50fd06[_0x6894('0x7d')]){_0x50fd06['joins']=JSON[_0x6894('0x7e')](_0x50fd06[_0x6894('0x7d')]);for(var _0x47cefc=0x0;_0x47cefc<_0x50fd06['joins']['length'];_0x47cefc+=0x1){if(_0x50fd06['joins'][_0x47cefc][_0x6894('0x3f')]&&_['includes'](_0x4cff1d,_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x3f')])&&_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x82')]&&_0x50fd06[_0x6894('0x7d')][_0x47cefc]['foreignTable']&&_0x50fd06['joins'][_0x47cefc][_0x6894('0x80')]){_0x402458[_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x3f')]](_0x50fd06['joins'][_0x47cefc][_0x6894('0x7f')],null,util[_0x6894('0x77')](_0x6894('0x81'),_0x50fd06[_0x6894('0x73')],_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x82')],_0x50fd06['joins'][_0x47cefc][_0x6894('0x7f')],_0x50fd06[_0x6894('0x7d')][_0x47cefc][_0x6894('0x80')]));}}}if(_0x50fd06['conditions']){_0x50fd06[_0x6894('0x83')]=JSON[_0x6894('0x7e')](_0x50fd06[_0x6894('0x83')]);_0x402458['where'](_0x23be9d(_0x50fd06[_0x6894('0x83')][_0x6894('0x6b')]));}_0x57d661=_0x402458[_0x6894('0x8f')]();_0x402458[_0x6894('0x1c')](_0xe62227);_0x402458[_0x6894('0x1b')](0x0);return;}})[_0x6894('0x24')](function(){if(_0xef6f4c[_0x6894('0x90')]===_0x6894('0x91')){return null;}var _0x40c506=_[_0x6894('0x3e')](_0xef6f4c,{'name':_0xef6f4c['fullPath']||_0xef6f4c['name']||_0x50fd06[_0x6894('0x2b')],'basename':_0x218c26,'savename':util[_0x6894('0x77')](_0x6894('0x92'),_0xef6f4c[_0x6894('0x2b')]||_0x50fd06[_0x6894('0x2b')],require(_0x6894('0x93'))[_0x6894('0x94')](0x4),_0xef6f4c['output']||_0x6894('0x95')),'reportId':_0x50fd06['id'],'reportType':_0x6894('0x96')});return db['AnalyticExtractedReport'][_0x6894('0x4b')](_0x40c506,{'raw':!![]});})[_0x6894('0x24')](function(_0x458498){if(_0x50fd06[_0x6894('0x73')]===_0x6894('0x97')){_0x57d661[_0x6894('0x3b')](_0x50fd06[_0x6894('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xef6f4c['startDate'],_0xef6f4c[_0x6894('0x98')]);}else{_0x57d661['where'](_0x50fd06[_0x6894('0x73')]+_0x6894('0x99'),_0xef6f4c[_0x6894('0x9a')],_0xef6f4c[_0x6894('0x98')]);}if(_0x458498){logger['info'](_0x6894('0x9b'),_0x57d661['toString']());require(_0x6894('0x9c'))[_0x6894('0x9d')](path[_0x6894('0x55')](__dirname,'../../components/export/',_0x458498[_0x6894('0x90')]),[_0x458498['id'],_0x57d661[_0x6894('0x86')](),path[_0x6894('0x55')](__dirname,'../../files/reports',_0x458498[_0x6894('0x9e')]),_0x218c26]);return _0x458498;}else{var _0x7c49db=squel[_0x6894('0x71')]();_0x7c49db[_0x6894('0x72')]('('+_0x57d661[_0x6894('0x86')]()+')','countTable');_0x7c49db['field']('COUNT(*)',_0x6894('0x1e'));_0x57d661[_0x6894('0x1c')](_0xef6f4c[_0x6894('0x1c')]||_0xe62227);_0x57d661[_0x6894('0x1b')](_0xef6f4c['offset']||0x0);return dbH[_0x6894('0x85')][_0x6894('0x32')](_0x7c49db[_0x6894('0x86')](),{'type':dbH['sequelize'][_0x6894('0x87')][_0x6894('0x88')]})[_0x6894('0x24')](function(_0x5f03f0){if(!_0x5f03f0[_0x6894('0x37')]){_0x7f45d0=0x0;}else{_0x7f45d0=_0x5f03f0[0x0][_0x6894('0x1e')]||0x0;}return dbH[_0x6894('0x85')][_0x6894('0x32')](_0x57d661[_0x6894('0x86')](),{'type':dbH['sequelize'][_0x6894('0x87')][_0x6894('0x88')]});})[_0x6894('0x24')](function(_0x41a083){return{'rows':_0x41a083||[],'count':_0x7f45d0};});}});}exports[_0x6894('0x9f')]=function(_0x32de82,_0x372643){return runReport(_0x32de82['params'],_0x32de82['query'],_0x32de82['options'])['then'](respondWithResult(_0x372643,null))['catch'](handleError(_0x372643,null));};exports['runReport']=runReport;exports['query']=function(_0xd41f27,_0x3eec29){var _0x318919=0xa;var _0x15bcbf=[_0x6894('0x55'),_0x6894('0x56'),_0x6894('0xa0'),_0x6894('0x57')];var _0x33adfb={'SUM':_0x6894('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6894('0x5a'),'MAX':_0x6894('0x5b'),'MIN':_0x6894('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6894('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6894('0x60')};var _0xc6c15f={'SEC_TO_TIME':_0x6894('0x61'),'DATE':_0x6894('0x62'),'HOUR':_0x6894('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24e7e5=function(_0x45ce41){return!_[_0x6894('0x65')]([_0x6894('0x66'),_0x6894('0x67'),'IS\x20EMPTY',_0x6894('0x69')],_0x45ce41);};var _0x182665=function(_0x4a8a81){if(!_0x4a8a81||!_0x4a8a81[_0x6894('0x6a')][_0x6894('0x37')]){return'';}for(var _0x1d44bc='(',_0x5066d2=0x0;_0x5066d2<_0x4a8a81['rules'][_0x6894('0x37')];_0x5066d2+=0x1){_0x5066d2>0x0&&(_0x1d44bc+='\x20'+_0x4a8a81[_0x6894('0x8a')]+'\x20');_0x1d44bc+=_0x4a8a81['rules'][_0x5066d2][_0x6894('0x6b')]?_0x182665(_0x4a8a81[_0x6894('0x6a')][_0x5066d2][_0x6894('0x6b')]):_0x4a8a81[_0x6894('0x6a')][_0x5066d2][_0x6894('0x6c')]+'\x20'+_0x4a8a81[_0x6894('0x6a')][_0x5066d2][_0x6894('0x6d')]+(_0x24e7e5(_0x4a8a81[_0x6894('0x6a')][_0x5066d2]['condition'])?'\x20'+_0x4a8a81['rules'][_0x5066d2][_0x6894('0x8b')]:'');}return _0x1d44bc+')';};var _0x24ce0a={'where':{'id':_0xd41f27[_0x6894('0x48')]['id']}},_0x240d8a,_0x4be470,_0x41d383,_0x422db9,_0x5b5cc5;_0x24ce0a=_[_0x6894('0x3e')]({},_0x24ce0a,_0xd41f27[_0x6894('0x40')]);return db[_0x6894('0x41')][_0x6894('0x4a')](_0x24ce0a)['then'](function(_0x412678){if(_0x412678){_0x240d8a=_0x412678;return _0x412678[_0x6894('0x6e')]();}return null;})[_0x6894('0x24')](function(_0x450af8){if(_0x450af8){if(!_0x450af8[_0x6894('0x37')]){throw new db[(_0x6894('0x8c'))]['ValidationErrorItem'](_0x6894('0x6f'),0x193);}_0x4be470=_0x450af8;return db[_0x6894('0xa1')][_0x6894('0x44')]({'raw':!![]});}return null;})[_0x6894('0x24')](function(_0x4c4f08){if(_0x4c4f08){_0x41d383=_[_0x6894('0x70')](_0x4c4f08,'id');var _0x1c9bb5;var _0x55104e=squel[_0x6894('0x71')]();_0x55104e['from'](_0x240d8a['table']);for(var _0x1e4ecd=0x0;_0x1e4ecd<_0x4be470[_0x6894('0x37')];_0x1e4ecd+=0x1){_0x1c9bb5=_0x4be470[_0x1e4ecd]['MetricId']?_0x41d383[_0x4be470[_0x1e4ecd][_0x6894('0x74')]][_0x6894('0x75')]:_0x4be470[_0x1e4ecd]['field'];_0x1c9bb5=_0x4be470[_0x1e4ecd][_0x6894('0x8e')]?_['replace'](_0x33adfb[_0x4be470[_0x1e4ecd][_0x6894('0x8e')]],'%s',_0x1c9bb5):_0x1c9bb5;_0x1c9bb5=_0x4be470[_0x1e4ecd][_0x6894('0x77')]?_['replace'](_0xc6c15f[_0x4be470[_0x1e4ecd][_0x6894('0x77')]],'%s',_0x1c9bb5):_0x1c9bb5;if(_0x4be470[_0x1e4ecd]['groupBy']){_0x55104e[_0x6894('0x6b')](_0x1c9bb5);}_0x4be470[_0x1e4ecd][_0x6894('0x79')]&&_0x55104e['order'](_0x1c9bb5,_0x4be470[_0x1e4ecd][_0x6894('0x79')]==='DESC'?![]:!![]);_0x55104e[_0x6894('0x6c')](_0x1c9bb5,_0x4be470[_0x1e4ecd][_0x6894('0x7c')]||_0x1c9bb5);}if(_0x240d8a['joins']){_0x240d8a['joins']=JSON[_0x6894('0x7e')](_0x240d8a[_0x6894('0x7d')]);for(var _0x24ce49=0x0;_0x24ce49<_0x240d8a[_0x6894('0x7d')][_0x6894('0x37')];_0x24ce49+=0x1){if(_0x240d8a['joins'][_0x24ce49][_0x6894('0x3f')]&&_['includes'](_0x15bcbf,_0x240d8a[_0x6894('0x7d')][_0x24ce49]['type'])&&_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x82')]&&_0x240d8a['joins'][_0x24ce49][_0x6894('0x7f')]&&_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x80')]){_0x55104e[_0x240d8a['joins'][_0x24ce49]['type']](_0x240d8a[_0x6894('0x7d')][_0x24ce49]['foreignTable'],null,util[_0x6894('0x77')](_0x6894('0x81'),_0x240d8a[_0x6894('0x73')],_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x82')],_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x7f')],_0x240d8a[_0x6894('0x7d')][_0x24ce49][_0x6894('0x80')]));}}}if(_0x240d8a[_0x6894('0x83')]){_0x240d8a[_0x6894('0x83')]=JSON[_0x6894('0x7e')](_0x240d8a[_0x6894('0x83')]);_0x55104e['where'](_0x182665(_0x240d8a[_0x6894('0x83')][_0x6894('0x6b')]));}_0x5b5cc5=_0x55104e['clone']();_0x55104e['limit'](_0x318919);_0x55104e[_0x6894('0x1b')](0x0);logger[_0x6894('0x84')](_0x6894('0xa2'),_0x55104e[_0x6894('0x86')]());return dbH[_0x6894('0x85')][_0x6894('0x32')](_0x55104e[_0x6894('0x86')](),{'type':dbH['sequelize'][_0x6894('0x87')][_0x6894('0x88')]});}})[_0x6894('0x24')](function(){return{'sql':_0x5b5cc5[_0x6894('0x86')]()};})[_0x6894('0x24')](respondWithResult(_0x3eec29,null))[_0x6894('0x46')](handleError(_0x3eec29,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index bf6587e..7af897b 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 _0x3c54=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','api'];(function(_0x1f0149,_0x4e5570){var _0x3bf819=function(_0x243be9){while(--_0x243be9){_0x1f0149['push'](_0x1f0149['shift']());}};_0x3bf819(++_0x4e5570);}(_0x3c54,0x1b5));var _0x43c5=function(_0x5af2a4,_0x26c908){_0x5af2a4=_0x5af2a4-0x0;var _0x300616=_0x3c54[_0x5af2a4];return _0x300616;};'use strict';var _=require(_0x43c5('0x0'));var util=require(_0x43c5('0x1'));var logger=require('../../config/logger')(_0x43c5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x43c5('0x3'));var fs=require('fs');var path=require(_0x43c5('0x4'));var rimraf=require(_0x43c5('0x5'));var config=require(_0x43c5('0x6'));var attributes=require(_0x43c5('0x7'));module[_0x43c5('0x8')]=function(_0x161c63,_0x339400){return _0x161c63['define']('AnalyticCustomReport',attributes,{'tableName':_0x43c5('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb4f=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a7b8f,_0x2a4c6a){var _0x467b8=function(_0x3c0cbc){while(--_0x3c0cbc){_0x2a7b8f['push'](_0x2a7b8f['shift']());}};_0x467b8(++_0x2a4c6a);}(_0xbb4f,0x10b));var _0xfbb4=function(_0x4e8210,_0x26f275){_0x4e8210=_0x4e8210-0x0;var _0x3edabc=_0xbb4f[_0x4e8210];return _0x3edabc;};'use strict';var _=require(_0xfbb4('0x0'));var util=require('util');var logger=require(_0xfbb4('0x1'))(_0xfbb4('0x2'));var moment=require(_0xfbb4('0x3'));var BPromise=require(_0xfbb4('0x4'));var rp=require(_0xfbb4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbb4('0x6'));var config=require(_0xfbb4('0x7'));var attributes=require(_0xfbb4('0x8'));module[_0xfbb4('0x9')]=function(_0x1a8604,_0x44cc45){return _0x1a8604[_0xfbb4('0xa')](_0xfbb4('0xb'),attributes,{'tableName':_0xfbb4('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 50f43e4..5937918 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 _0x0a2a=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a2a,0xf8));var _0xa0a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa0a2('0x0'));var util=require(_0xa0a2('0x1'));var moment=require('moment');var BPromise=require(_0xa0a2('0x2'));var rs=require(_0xa0a2('0x3'));var fs=require('fs');var Redis=require(_0xa0a2('0x4'));var db=require(_0xa0a2('0x5'))['db'];var utils=require(_0xa0a2('0x6'));var logger=require(_0xa0a2('0x7'))('rpc');var config=require(_0xa0a2('0x8'));var jayson=require(_0xa0a2('0x9'));var client=jayson['client'][_0xa0a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x182959,_0x602a74,_0x4547a2){return new BPromise(function(_0x560112,_0x45b97a){return client[_0xa0a2('0xb')](_0x182959,_0x4547a2)[_0xa0a2('0xc')](function(_0x41f01a){logger[_0xa0a2('0xd')](_0xa0a2('0xe'),_0x602a74,_0xa0a2('0xf'));logger[_0xa0a2('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x602a74,_0xa0a2('0xf'),JSON[_0xa0a2('0x11')](_0x41f01a));if(_0x41f01a[_0xa0a2('0x12')]){if(_0x41f01a[_0xa0a2('0x12')][_0xa0a2('0x13')]===0x1f4){logger['error'](_0xa0a2('0xe'),_0x602a74,_0x41f01a[_0xa0a2('0x12')][_0xa0a2('0x14')]);return _0x45b97a(_0x41f01a[_0xa0a2('0x12')][_0xa0a2('0x14')]);}logger[_0xa0a2('0x12')](_0xa0a2('0xe'),_0x602a74,_0x41f01a['error'][_0xa0a2('0x14')]);return _0x560112(_0x41f01a[_0xa0a2('0x12')][_0xa0a2('0x14')]);}else{logger[_0xa0a2('0xd')](_0xa0a2('0xe'),_0x602a74,'request\x20sent');_0x560112(_0x41f01a[_0xa0a2('0x15')][_0xa0a2('0x14')]);}})[_0xa0a2('0x16')](function(_0x97ec0f){logger['error'](_0xa0a2('0xe'),_0x602a74,_0x97ec0f);_0x45b97a(_0x97ec0f);});});}
\ No newline at end of file
+var _0x2fd9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x2fd9,0x114));var _0x92fd=function(_0x2bfd90,_0x102539){_0x2bfd90=_0x2bfd90-0x0;var _0x33e709=_0x2fd9[_0x2bfd90];return _0x33e709;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x92fd('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92fd('0x1'));var db=require(_0x92fd('0x2'))['db'];var utils=require(_0x92fd('0x3'));var logger=require(_0x92fd('0x4'))(_0x92fd('0x5'));var config=require(_0x92fd('0x6'));var jayson=require(_0x92fd('0x7'));var client=jayson[_0x92fd('0x8')][_0x92fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50533a,_0x52f35a,_0x2e4657){return new BPromise(function(_0x1c8271,_0x4a4b87){return client[_0x92fd('0xa')](_0x50533a,_0x2e4657)[_0x92fd('0xb')](function(_0x562957){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x52f35a,_0x92fd('0xc'));logger[_0x92fd('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x52f35a,_0x92fd('0xc'),JSON[_0x92fd('0xe')](_0x562957));if(_0x562957['error']){if(_0x562957[_0x92fd('0xf')][_0x92fd('0x10')]===0x1f4){logger[_0x92fd('0xf')](_0x92fd('0x11'),_0x52f35a,_0x562957[_0x92fd('0xf')][_0x92fd('0x12')]);return _0x4a4b87(_0x562957[_0x92fd('0xf')][_0x92fd('0x12')]);}logger[_0x92fd('0xf')](_0x92fd('0x11'),_0x52f35a,_0x562957[_0x92fd('0xf')]['message']);return _0x1c8271(_0x562957[_0x92fd('0xf')][_0x92fd('0x12')]);}else{logger['info'](_0x92fd('0x11'),_0x52f35a,'request\x20sent');_0x1c8271(_0x562957[_0x92fd('0x13')][_0x92fd('0x12')]);}})['catch'](function(_0x3fa5b9){logger[_0x92fd('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x52f35a,_0x3fa5b9);_0x4a4b87(_0x3fa5b9);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index a7a1c2d..11bed6c 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 _0x544d=['preview','/:id/run','run','/:id/query','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x544d,0x113));var _0xd544=function(_0x42cb52,_0x5dfb0a){_0x42cb52=_0x42cb52-0x0;var _0x18387b=_0x544d[_0x42cb52];return _0x18387b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd544('0x0'));var timeout=require(_0xd544('0x1'));var express=require(_0xd544('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd544('0x3'));var interaction=require(_0xd544('0x4'));var config=require(_0xd544('0x5'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xd544('0x6')](),controller['index']);router[_0xd544('0x7')](_0xd544('0x8'),auth[_0xd544('0x6')](),controller[_0xd544('0x9')]);router[_0xd544('0x7')]('/:id/preview',auth['isAuthenticated'](),controller[_0xd544('0xa')]);router[_0xd544('0x7')](_0xd544('0xb'),auth[_0xd544('0x6')](),controller[_0xd544('0xc')]);router['get'](_0xd544('0xd'),auth[_0xd544('0x6')](),controller['query']);router['post']('/',auth[_0xd544('0x6')](),controller['create']);router[_0xd544('0xe')](_0xd544('0x8'),auth[_0xd544('0x6')](),controller[_0xd544('0xf')]);router[_0xd544('0x10')](_0xd544('0x8'),auth[_0xd544('0x6')](),controller[_0xd544('0x11')]);module[_0xd544('0x12')]=router;
\ No newline at end of file
+var _0x8297=['show','get','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','/:id'];(function(_0x4bca31,_0x394def){var _0x49816d=function(_0xfe82d5){while(--_0xfe82d5){_0x4bca31['push'](_0x4bca31['shift']());}};_0x49816d(++_0x394def);}(_0x8297,0x18c));var _0x7829=function(_0x19b50b,_0x34d7ba){_0x19b50b=_0x19b50b-0x0;var _0x2ac4f3=_0x8297[_0x19b50b];return _0x2ac4f3;};'use strict';var multer=require(_0x7829('0x0'));var util=require(_0x7829('0x1'));var path=require(_0x7829('0x2'));var timeout=require(_0x7829('0x3'));var express=require('express');var router=express[_0x7829('0x4')]();var fs_extra=require(_0x7829('0x5'));var auth=require(_0x7829('0x6'));var interaction=require(_0x7829('0x7'));var config=require(_0x7829('0x8'));var controller=require(_0x7829('0x9'));router['get']('/',auth[_0x7829('0xa')](),controller['index']);router['get'](_0x7829('0xb'),auth[_0x7829('0xa')](),controller[_0x7829('0xc')]);router[_0x7829('0xd')](_0x7829('0xe'),auth[_0x7829('0xa')](),controller[_0x7829('0xf')]);router[_0x7829('0xd')](_0x7829('0x10'),auth[_0x7829('0xa')](),controller[_0x7829('0x11')]);router[_0x7829('0xd')](_0x7829('0x12'),auth[_0x7829('0xa')](),controller['query']);router['post']('/',auth[_0x7829('0xa')](),controller[_0x7829('0x13')]);router[_0x7829('0x14')](_0x7829('0xb'),auth['isAuthenticated'](),controller[_0x7829('0x15')]);router['delete'](_0x7829('0xb'),auth['isAuthenticated'](),controller[_0x7829('0x16')]);module[_0x7829('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index b5f4b07..926fd61 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 _0x7fbe=['STRING','TEXT'];(function(_0x3c083b,_0x549e68){var _0x1c4f50=function(_0x49f5aa){while(--_0x49f5aa){_0x3c083b['push'](_0x3c083b['shift']());}};_0x1c4f50(++_0x549e68);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16818e,_0x4c3656){_0x16818e=_0x16818e-0x0;var _0x6fadf9=_0x7fbe[_0x16818e];return _0x6fadf9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
+var _0x33c5=['STRING','TEXT','exports'];(function(_0x419876,_0x2905d6){var _0xd7f3d8=function(_0xa2e0ca){while(--_0xa2e0ca){_0x419876['push'](_0x419876['shift']());}};_0xd7f3d8(++_0x2905d6);}(_0x33c5,0xe6));var _0x533c=function(_0xd5160a,_0x572c4b){_0xd5160a=_0xd5160a-0x0;var _0x576cf9=_0x33c5[_0xd5160a];return _0x576cf9;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index dbc1921..dfe3d7a 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 _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x46cbe0,_0x382b2a){var _0x4b47ac=function(_0xe0e3f3){while(--_0xe0e3f3){_0x46cbe0['push'](_0x46cbe0['shift']());}};_0x4b47ac(++_0x382b2a);}(_0x0295,0x1f0));var _0x5029=function(_0x27a1a0,_0x410857){_0x27a1a0=_0x27a1a0-0x0;var _0x1321a0=_0x0295[_0x27a1a0];return _0x1321a0;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
+var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x2bd263,_0x56818c){var _0x9e64d0=function(_0x503583){while(--_0x503583){_0x2bd263['push'](_0x2bd263['shift']());}};_0x9e64d0(++_0x56818c);}(_0x5fab,0x177));var _0xb5fa=function(_0x37b07c,_0x5941a1){_0x37b07c=_0x37b07c-0x0;var _0x264672=_0x5fab[_0x37b07c];return _0x264672;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a3eff6a..72276af 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 _0xd2b2=['path','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','api'];(function(_0x17c4ce,_0x3d1b7b){var _0xaeb684=function(_0x316434){while(--_0x316434){_0x17c4ce['push'](_0x17c4ce['shift']());}};_0xaeb684(++_0x3d1b7b);}(_0xd2b2,0x180));var _0x2d2b=function(_0x202372,_0x5b4a58){_0x202372=_0x202372-0x0;var _0x25ac89=_0xd2b2[_0x202372];return _0x25ac89;};'use strict';var _=require(_0x2d2b('0x0'));var util=require(_0x2d2b('0x1'));var logger=require('../../config/logger')(_0x2d2b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d2b('0x3'));var rimraf=require('rimraf');var config=require(_0x2d2b('0x4'));var attributes=require(_0x2d2b('0x5'));module[_0x2d2b('0x6')]=function(_0x2a63ed,_0x47d9e7){return _0x2a63ed[_0x2d2b('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0x2d2b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a61=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x5b4915,_0x336b69){var _0x4eaaca=function(_0x5e9047){while(--_0x5e9047){_0x5b4915['push'](_0x5b4915['shift']());}};_0x4eaaca(++_0x336b69);}(_0x9a61,0x110));var _0x19a6=function(_0x2125d3,_0x599ffb){_0x2125d3=_0x2125d3-0x0;var _0x2f2cf5=_0x9a61[_0x2125d3];return _0x2f2cf5;};'use strict';var _=require(_0x19a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x19a6('0x1'));var moment=require(_0x19a6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x19a6('0x3'));var rimraf=require(_0x19a6('0x4'));var config=require('../../config/environment');var attributes=require(_0x19a6('0x5'));module[_0x19a6('0x6')]=function(_0x717482,_0x39951e){return _0x717482[_0x19a6('0x7')](_0x19a6('0x8'),attributes,{'tableName':_0x19a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index dd9eb84..0d04483 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 _0x07da=['code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x07da,0x1a3));var _0xa07d=function(_0x1772e6,_0x374858){_0x1772e6=_0x1772e6-0x0;var _0x5f28aa=_0x07da[_0x1772e6];return _0x5f28aa;};'use strict';var _=require(_0xa07d('0x0'));var util=require(_0xa07d('0x1'));var moment=require(_0xa07d('0x2'));var BPromise=require(_0xa07d('0x3'));var rs=require(_0xa07d('0x4'));var fs=require('fs');var Redis=require(_0xa07d('0x5'));var db=require(_0xa07d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa07d('0x7'))(_0xa07d('0x8'));var config=require(_0xa07d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa07d('0xa')][_0xa07d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19f6ab,_0x4eb0b2,_0x26daad){return new BPromise(function(_0x111c08,_0x62fa03){return client[_0xa07d('0xc')](_0x19f6ab,_0x26daad)['then'](function(_0x2f204c){logger['info'](_0xa07d('0xd'),_0x4eb0b2,'request\x20sent');logger[_0xa07d('0xe')](_0xa07d('0xf'),_0x4eb0b2,'request\x20sent',JSON[_0xa07d('0x10')](_0x2f204c));if(_0x2f204c[_0xa07d('0x11')]){if(_0x2f204c['error'][_0xa07d('0x12')]===0x1f4){logger[_0xa07d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4eb0b2,_0x2f204c[_0xa07d('0x11')][_0xa07d('0x13')]);return _0x62fa03(_0x2f204c[_0xa07d('0x11')]['message']);}logger[_0xa07d('0x11')](_0xa07d('0xd'),_0x4eb0b2,_0x2f204c[_0xa07d('0x11')][_0xa07d('0x13')]);return _0x111c08(_0x2f204c[_0xa07d('0x11')][_0xa07d('0x13')]);}else{logger[_0xa07d('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4eb0b2,_0xa07d('0x15'));_0x111c08(_0x2f204c['result'][_0xa07d('0x13')]);}})[_0xa07d('0x16')](function(_0x548c2c){logger[_0xa07d('0x11')](_0xa07d('0xd'),_0x4eb0b2,_0x548c2c);_0x62fa03(_0x548c2c);});});}
\ No newline at end of file
+var _0x3ff4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring'];(function(_0x27250c,_0x3e6637){var _0x7e3095=function(_0x1bbce7){while(--_0x1bbce7){_0x27250c['push'](_0x27250c['shift']());}};_0x7e3095(++_0x3e6637);}(_0x3ff4,0x1c5));var _0x43ff=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x3ff4[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x43ff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x43ff('0x1'));var rs=require(_0x43ff('0x2'));var fs=require('fs');var Redis=require(_0x43ff('0x3'));var db=require(_0x43ff('0x4'))['db'];var utils=require(_0x43ff('0x5'));var logger=require(_0x43ff('0x6'))(_0x43ff('0x7'));var config=require(_0x43ff('0x8'));var jayson=require(_0x43ff('0x9'));var client=jayson[_0x43ff('0xa')][_0x43ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4441ed,_0x3913e6,_0x250056){return new BPromise(function(_0x9f3b6a,_0xaaa72a){return client['request'](_0x4441ed,_0x250056)[_0x43ff('0xc')](function(_0x3d6c99){logger['info'](_0x43ff('0xd'),_0x3913e6,_0x43ff('0xe'));logger[_0x43ff('0xf')](_0x43ff('0x10'),_0x3913e6,_0x43ff('0xe'),JSON[_0x43ff('0x11')](_0x3d6c99));if(_0x3d6c99[_0x43ff('0x12')]){if(_0x3d6c99['error'][_0x43ff('0x13')]===0x1f4){logger[_0x43ff('0x12')](_0x43ff('0xd'),_0x3913e6,_0x3d6c99['error'][_0x43ff('0x14')]);return _0xaaa72a(_0x3d6c99['error']['message']);}logger[_0x43ff('0x12')](_0x43ff('0xd'),_0x3913e6,_0x3d6c99['error'][_0x43ff('0x14')]);return _0x9f3b6a(_0x3d6c99[_0x43ff('0x12')][_0x43ff('0x14')]);}else{logger[_0x43ff('0x15')](_0x43ff('0xd'),_0x3913e6,'request\x20sent');_0x9f3b6a(_0x3d6c99[_0x43ff('0x16')]['message']);}})[_0x43ff('0x17')](function(_0x591036){logger[_0x43ff('0x12')](_0x43ff('0xd'),_0x3913e6,_0x591036);_0xaaa72a(_0x591036);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 210c1b2..b15a900 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 _0x36fe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id','show','preview','/:id/run','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x312bd1,_0xaaa2cc){var _0x3e6494=function(_0x3e43a7){while(--_0x3e43a7){_0x312bd1['push'](_0x312bd1['shift']());}};_0x3e6494(++_0xaaa2cc);}(_0x36fe,0x127));var _0xe36f=function(_0x134bfc,_0x144d5f){_0x134bfc=_0x134bfc-0x0;var _0x2f4dcc=_0x36fe[_0x134bfc];return _0x2f4dcc;};'use strict';var multer=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var path=require(_0xe36f('0x2'));var timeout=require(_0xe36f('0x3'));var express=require(_0xe36f('0x4'));var router=express[_0xe36f('0x5')]();var fs_extra=require(_0xe36f('0x6'));var auth=require(_0xe36f('0x7'));var interaction=require(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var controller=require(_0xe36f('0xa'));router['get']('/',auth[_0xe36f('0xb')](),controller['index']);router[_0xe36f('0xc')](_0xe36f('0xd'),auth['isAuthenticated'](),controller[_0xe36f('0xe')]);router[_0xe36f('0xc')]('/:id/preview',auth[_0xe36f('0xb')](),controller[_0xe36f('0xf')]);router[_0xe36f('0xc')](_0xe36f('0x10'),auth[_0xe36f('0xb')](),controller['run']);router[_0xe36f('0xc')]('/:id/query',auth[_0xe36f('0xb')](),controller[_0xe36f('0x11')]);router[_0xe36f('0x12')]('/',auth['isAuthenticated'](),controller[_0xe36f('0x13')]);router[_0xe36f('0x14')]('/:id',auth[_0xe36f('0xb')](),controller[_0xe36f('0x15')]);router[_0xe36f('0x16')](_0xe36f('0xd'),auth['isAuthenticated'](),controller[_0xe36f('0x17')]);module[_0xe36f('0x18')]=router;
\ No newline at end of file
+var _0xe6ae=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','/:id','update','destroy'];(function(_0x44976e,_0x311385){var _0x4852b2=function(_0xd57529){while(--_0xd57529){_0x44976e['push'](_0x44976e['shift']());}};_0x4852b2(++_0x311385);}(_0xe6ae,0x1e3));var _0xee6a=function(_0x4ba880,_0x3eada2){_0x4ba880=_0x4ba880-0x0;var _0x8055ff=_0xe6ae[_0x4ba880];return _0x8055ff;};'use strict';var multer=require(_0xee6a('0x0'));var util=require(_0xee6a('0x1'));var path=require(_0xee6a('0x2'));var timeout=require(_0xee6a('0x3'));var express=require(_0xee6a('0x4'));var router=express[_0xee6a('0x5')]();var fs_extra=require(_0xee6a('0x6'));var auth=require(_0xee6a('0x7'));var interaction=require(_0xee6a('0x8'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xee6a('0x9')]('/',auth['isAuthenticated'](),controller[_0xee6a('0xa')]);router[_0xee6a('0x9')]('/:id',auth[_0xee6a('0xb')](),controller[_0xee6a('0xc')]);router[_0xee6a('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xee6a('0xd')]);router[_0xee6a('0x9')](_0xee6a('0xe'),auth['isAuthenticated'](),controller[_0xee6a('0xf')]);router['get'](_0xee6a('0x10'),auth['isAuthenticated'](),controller[_0xee6a('0x11')]);router[_0xee6a('0x12')]('/',auth[_0xee6a('0xb')](),controller[_0xee6a('0x13')]);router['put'](_0xee6a('0x14'),auth[_0xee6a('0xb')](),controller[_0xee6a('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee6a('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c16c677..6420dbe 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 _0x41b3=['UNSIGNED','moment','STRING','ENUM','csv','pdf','DATE','manual','scheduled','INTEGER'];(function(_0x1dac99,_0x12ea46){var _0xb9f1d7=function(_0x46518a){while(--_0x46518a){_0x1dac99['push'](_0x1dac99['shift']());}};_0xb9f1d7(++_0x12ea46);}(_0x41b3,0xbf));var _0x341b=function(_0x1ae74e,_0x21889d){_0x1ae74e=_0x1ae74e-0x0;var _0x4f5d22=_0x41b3[_0x1ae74e];return _0x4f5d22;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x341b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x341b('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x341b('0x2')](_0x341b('0x3'),_0x341b('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x341b('0x3')},'savename':{'type':Sequelize[_0x341b('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x341b('0x5')]},'endDate':{'type':Sequelize[_0x341b('0x5')]},'status':{'type':Sequelize[_0x341b('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x341b('0x6'),_0x341b('0x7')),'allowNull':![],'defaultValue':_0x341b('0x6')},'reportId':{'type':Sequelize[_0x341b('0x8')](0xb)[_0x341b('0x9')]},'reportType':{'type':Sequelize[_0x341b('0x1')]}};
\ No newline at end of file
+var _0xadf1=['csv','pdf','DATE','Loading','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM'];(function(_0x2d1343,_0x1e519d){var _0x2c17f4=function(_0x5d97f6){while(--_0x5d97f6){_0x2d1343['push'](_0x2d1343['shift']());}};_0x2c17f4(++_0x1e519d);}(_0xadf1,0xe3));var _0x1adf=function(_0x2b1255,_0x4869da){_0x2b1255=_0x2b1255-0x0;var _0x44442d=_0xadf1[_0x2b1255];return _0x44442d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1adf('0x0'));module[_0x1adf('0x1')]={'name':{'type':Sequelize[_0x1adf('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1adf('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1adf('0x3')](_0x1adf('0x4'),_0x1adf('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x1adf('0x4')},'savename':{'type':Sequelize[_0x1adf('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1adf('0x6')]},'endDate':{'type':Sequelize[_0x1adf('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x1adf('0x7')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0x1adf('0x8')},'reportId':{'type':Sequelize[_0x1adf('0x9')](0xb)[_0x1adf('0xa')]},'reportType':{'type':Sequelize[_0x1adf('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index d1c0267..96bb1aa 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 _0x7023=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','then','end','stack','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','user','ExtractedReports','UserProfileSection'];(function(_0x41285f,_0x242ecb){var _0x358377=function(_0xb4f14d){while(--_0xb4f14d){_0x41285f['push'](_0x41285f['shift']());}};_0x358377(++_0x242ecb);}(_0x7023,0x1e5));var _0x3702=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7023[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x3702('0x0'));var rimraf=require(_0x3702('0x1'));var zipdir=require(_0x3702('0x2'));var jsonpatch=require(_0x3702('0x3'));var rp=require(_0x3702('0x4'));var moment=require('moment');var BPromise=require(_0x3702('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3702('0x6'));var sox=require(_0x3702('0x7'));var csv=require(_0x3702('0x8'));var ejs=require(_0x3702('0x9'));var fs=require('fs');var fs_extra=require(_0x3702('0xa'));var _=require('lodash');var squel=require(_0x3702('0xb'));var crypto=require(_0x3702('0xc'));var jsforce=require(_0x3702('0xd'));var deskjs=require(_0x3702('0xe'));var toCsv=require(_0x3702('0x8'));var querystring=require(_0x3702('0xf'));var Papa=require(_0x3702('0x10'));var Redis=require(_0x3702('0x11'));var authService=require(_0x3702('0x12'));var qs=require(_0x3702('0x13'));var as=require(_0x3702('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3702('0x15'));var utils=require('../../config/utils');var config=require(_0x3702('0x16'));var licenseUtil=require(_0x3702('0x17'));var db=require(_0x3702('0x18'))['db'];function respondWithStatusCode(_0x155fbd,_0x2dd506){_0x2dd506=_0x2dd506||0xcc;return function(_0x2c5eb1){if(_0x2c5eb1){return _0x155fbd[_0x3702('0x19')](_0x2dd506);}return _0x155fbd[_0x3702('0x1a')](_0x2dd506)['end']();};}function respondWithResult(_0xecf37,_0x16cb37){_0x16cb37=_0x16cb37||0xc8;return function(_0x1ed66a){if(_0x1ed66a){return _0xecf37[_0x3702('0x1a')](_0x16cb37)[_0x3702('0x1b')](_0x1ed66a);}};}function respondWithFilteredResult(_0x235a25,_0x2d9c45){return function(_0x472a8a){if(_0x472a8a){var _0xcb9d5c=typeof _0x2d9c45[_0x3702('0x1c')]===_0x3702('0x1d')&&typeof _0x2d9c45[_0x3702('0x1e')]===_0x3702('0x1d');var _0x316af5=_0x472a8a[_0x3702('0x1f')];var _0xe450f8=_0xcb9d5c?0x0:_0x2d9c45['offset'];var _0xc2d3b1=_0xcb9d5c?_0x472a8a['count']:_0x2d9c45[_0x3702('0x1c')]+_0x2d9c45[_0x3702('0x1e')];var _0x56f846;if(_0xc2d3b1>=_0x316af5){_0xc2d3b1=_0x316af5;_0x56f846=0xc8;}else{_0x56f846=0xce;}_0x235a25[_0x3702('0x1a')](_0x56f846);return _0x235a25[_0x3702('0x20')](_0x3702('0x21'),_0xe450f8+'-'+_0xc2d3b1+'/'+_0x316af5)['json'](_0x472a8a);}return null;};}function patchUpdates(_0x3e3942){return function(_0x963b19){try{jsonpatch['apply'](_0x963b19,_0x3e3942,!![]);}catch(_0x3a2a24){return BPromise[_0x3702('0x22')](_0x3a2a24);}return _0x963b19[_0x3702('0x23')]();};}function saveUpdates(_0x26a6aa,_0x15cd71){return function(_0x5e6d9c){if(_0x5e6d9c){return _0x5e6d9c[_0x3702('0x24')](_0x26a6aa)['then'](function(_0x17a9d6){return _0x17a9d6;});}return null;};}function removeEntity(_0x56cccc,_0x592c29){return function(_0xc8f314){if(_0xc8f314){return _0xc8f314[_0x3702('0x25')]()['then'](function(){var _0x104204=_0xc8f314[_0x3702('0x26')]({'plain':!![]});var _0x5d3966='ExtractedReports';return db[_0x3702('0x27')]['destroy']({'where':{'type':_0x5d3966,'resourceId':_0x104204['id']}})[_0x3702('0x28')](function(){return _0xc8f314;});})[_0x3702('0x28')](function(){_0x56cccc[_0x3702('0x1a')](0xcc)[_0x3702('0x29')]();});}};}function handleEntityNotFound(_0x2f1a1f,_0x5e3043){return function(_0x36c38c){if(!_0x36c38c){_0x2f1a1f[_0x3702('0x19')](0x194);}return _0x36c38c;};}function handleError(_0x34adb7,_0x19b20b){_0x19b20b=_0x19b20b||0x1f4;return function(_0x3f528f){logger['error'](_0x3f528f[_0x3702('0x2a')]);if(_0x3f528f[_0x3702('0x2b')]){delete _0x3f528f[_0x3702('0x2b')];}_0x34adb7[_0x3702('0x1a')](_0x19b20b)[_0x3702('0x2c')](_0x3f528f);};}exports['index']=function(_0x4c533d,_0x54c4d6){var _0x35aa43={},_0x45eac5={},_0x185994={'count':0x0,'rows':[]};var _0x998916=_[_0x3702('0x2d')](db[_0x3702('0x2e')]['rawAttributes'],function(_0x4d5baa){return{'name':_0x4d5baa[_0x3702('0x2f')],'type':_0x4d5baa[_0x3702('0x30')][_0x3702('0x31')]};});_0x45eac5[_0x3702('0x32')]=_[_0x3702('0x2d')](_0x998916,'name');_0x45eac5[_0x3702('0x33')]=_[_0x3702('0x34')](_0x4c533d[_0x3702('0x33')]);_0x45eac5['filters']=_['intersection'](_0x45eac5[_0x3702('0x32')],_0x45eac5['query']);_0x35aa43[_0x3702('0x35')]=_[_0x3702('0x36')](_0x45eac5[_0x3702('0x32')],qs['fields'](_0x4c533d[_0x3702('0x33')][_0x3702('0x37')]));_0x35aa43[_0x3702('0x35')]=_0x35aa43[_0x3702('0x35')][_0x3702('0x38')]?_0x35aa43[_0x3702('0x35')]:_0x45eac5[_0x3702('0x32')];if(!_0x4c533d[_0x3702('0x33')][_0x3702('0x39')](_0x3702('0x3a'))){_0x35aa43['limit']=qs[_0x3702('0x1e')](_0x4c533d[_0x3702('0x33')]['limit']);_0x35aa43['offset']=qs[_0x3702('0x1c')](_0x4c533d[_0x3702('0x33')]['offset']);}_0x35aa43[_0x3702('0x3b')]=qs[_0x3702('0x3c')](_0x4c533d['query']['sort']);_0x35aa43[_0x3702('0x3d')]=qs['filters'](_[_0x3702('0x3e')](_0x4c533d[_0x3702('0x33')],_0x45eac5[_0x3702('0x3f')]),_0x998916);if(_0x4c533d[_0x3702('0x33')][_0x3702('0x40')]){_0x35aa43[_0x3702('0x3d')]=_[_0x3702('0x41')](_0x35aa43['where'],{'$or':_[_0x3702('0x2d')](_0x998916,function(_0x1ad63a){if(_0x1ad63a['type']!==_0x3702('0x42')){var _0x5eb0a8={};_0x5eb0a8[_0x1ad63a['name']]={'$like':'%'+_0x4c533d['query'][_0x3702('0x40')]+'%'};return _0x5eb0a8;}})});}_0x35aa43=_['merge']({},_0x35aa43,_0x4c533d[_0x3702('0x43')]);var _0x50415d={'where':_0x35aa43[_0x3702('0x3d')]};return db[_0x3702('0x2e')][_0x3702('0x1f')](_0x50415d)[_0x3702('0x28')](function(_0x1fc529){_0x185994[_0x3702('0x1f')]=_0x1fc529;if(_0x4c533d[_0x3702('0x33')][_0x3702('0x44')]){_0x35aa43['include']=[{'all':!![]}];}return db[_0x3702('0x2e')][_0x3702('0x45')](_0x35aa43);})[_0x3702('0x28')](function(_0x48d0db){_0x185994[_0x3702('0x46')]=_0x48d0db;return _0x185994;})[_0x3702('0x28')](respondWithFilteredResult(_0x54c4d6,_0x35aa43))[_0x3702('0x47')](handleError(_0x54c4d6,null));};exports['show']=function(_0xe65521,_0x1968a5){var _0x21f0f9={'raw':!![],'where':{'id':_0xe65521[_0x3702('0x48')]['id']}},_0x200724={};_0x200724['model']=_['keys'](db[_0x3702('0x2e')]['rawAttributes']);_0x200724[_0x3702('0x33')]=_[_0x3702('0x34')](_0xe65521['query']);_0x200724[_0x3702('0x3f')]=_[_0x3702('0x36')](_0x200724[_0x3702('0x32')],_0x200724[_0x3702('0x33')]);_0x21f0f9[_0x3702('0x35')]=_[_0x3702('0x36')](_0x200724['model'],qs['fields'](_0xe65521['query'][_0x3702('0x37')]));_0x21f0f9[_0x3702('0x35')]=_0x21f0f9[_0x3702('0x35')][_0x3702('0x38')]?_0x21f0f9[_0x3702('0x35')]:_0x200724['model'];if(_0xe65521[_0x3702('0x33')]['includeAll']){_0x21f0f9['include']=[{'all':!![]}];}_0x21f0f9=_[_0x3702('0x41')]({},_0x21f0f9,_0xe65521['options']);return db[_0x3702('0x2e')][_0x3702('0x49')](_0x21f0f9)[_0x3702('0x28')](handleEntityNotFound(_0x1968a5,null))[_0x3702('0x28')](respondWithResult(_0x1968a5,null))['catch'](handleError(_0x1968a5,null));};exports[_0x3702('0x4a')]=function(_0x8ade92,_0x29b2a2){return db[_0x3702('0x2e')][_0x3702('0x4a')](_0x8ade92[_0x3702('0x4b')],{})['then'](function(_0x222878){var _0x182dc6=_0x8ade92[_0x3702('0x4c')][_0x3702('0x26')]({'plain':!![]});if(!_0x182dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x182dc6['role']===_0x3702('0x4c')){var _0x5bbb63=_0x222878[_0x3702('0x26')]({'plain':!![]});var _0x2bf85e=_0x3702('0x4d');return db[_0x3702('0x4e')]['find']({'where':{'name':_0x2bf85e,'userProfileId':_0x182dc6[_0x3702('0x4f')]},'raw':!![]})[_0x3702('0x28')](function(_0x5a9afb){if(_0x5a9afb&&_0x5a9afb[_0x3702('0x50')]===0x0){return db[_0x3702('0x27')][_0x3702('0x4a')]({'name':_0x5bbb63[_0x3702('0x2b')],'resourceId':_0x5bbb63['id'],'type':_0x5a9afb[_0x3702('0x2b')],'sectionId':_0x5a9afb['id']},{})[_0x3702('0x28')](function(){return _0x222878;});}else{return _0x222878;}})[_0x3702('0x47')](function(_0x2d528e){logger[_0x3702('0x51')](_0x3702('0x52'),_0x2d528e);throw _0x2d528e;});}return _0x222878;})[_0x3702('0x28')](respondWithResult(_0x29b2a2,0xc9))['catch'](handleError(_0x29b2a2,null));};exports[_0x3702('0x24')]=function(_0x4e0569,_0x7083dd){if(_0x4e0569[_0x3702('0x4b')]['id']){delete _0x4e0569[_0x3702('0x4b')]['id'];}return db['AnalyticExtractedReport'][_0x3702('0x49')]({'where':{'id':_0x4e0569[_0x3702('0x48')]['id']}})[_0x3702('0x28')](handleEntityNotFound(_0x7083dd,null))[_0x3702('0x28')](saveUpdates(_0x4e0569[_0x3702('0x4b')],null))[_0x3702('0x28')](respondWithResult(_0x7083dd,null))[_0x3702('0x47')](handleError(_0x7083dd,null));};exports['destroy']=function(_0x3bfb1a,_0x1b05c3){return db[_0x3702('0x2e')][_0x3702('0x49')]({'where':{'id':_0x3bfb1a[_0x3702('0x48')]['id']}})[_0x3702('0x28')](handleEntityNotFound(_0x1b05c3,null))[_0x3702('0x28')](removeEntity(_0x1b05c3,null))['catch'](handleError(_0x1b05c3,null));};exports[_0x3702('0x53')]=function(_0x2e28b8,_0x53e6ec,_0x225aaa){return db[_0x3702('0x2e')][_0x3702('0x49')]({'where':{'id':_0x2e28b8[_0x3702('0x48')]['id']},'attributes':[_0x3702('0x2b'),'basename',_0x3702('0x54'),_0x3702('0x55')],'raw':!![]})[_0x3702('0x28')](handleEntityNotFound(_0x53e6ec,null))[_0x3702('0x28')](function(_0x190159){if(_0x190159){if(!fs[_0x3702('0x56')](path[_0x3702('0x57')](config[_0x3702('0x58')],_0x3702('0x59'),_0x190159[_0x3702('0x54')]))){throw new db[(_0x3702('0x5a'))][(_0x3702('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2e28b8['query'][_0x3702('0x5c')]){return _0x53e6ec[_0x3702('0x19')](0xc8);}return _0x53e6ec[_0x3702('0x53')](path[_0x3702('0x57')](config[_0x3702('0x58')],_0x3702('0x59'),_0x190159[_0x3702('0x54')]),util['format']('%s.%s',_0x190159['basename']||_0x190159[_0x3702('0x2b')],_0x190159[_0x3702('0x55')][_0x3702('0x5d')]()));}})[_0x3702('0x47')](handleError(_0x53e6ec,null));};
\ No newline at end of file
+var _0x6f71=['name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','include','findAll','rows','catch','params','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','error','download','savename','join','root','server/files/reports','Sequelize','ValidationError','exists','format','basename','output','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus'];(function(_0x1fc936,_0x22fcc3){var _0xf45083=function(_0x23368a){while(--_0x23368a){_0x1fc936['push'](_0x1fc936['shift']());}};_0xf45083(++_0x22fcc3);}(_0x6f71,0x1a4));var _0x16f7=function(_0x386b69,_0x396f3a){_0x386b69=_0x386b69-0x0;var _0x159277=_0x6f71[_0x386b69];return _0x159277;};'use strict';var emlformat=require(_0x16f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16f7('0x1'));var jsonpatch=require(_0x16f7('0x2'));var rp=require(_0x16f7('0x3'));var moment=require(_0x16f7('0x4'));var BPromise=require(_0x16f7('0x5'));var Mustache=require(_0x16f7('0x6'));var util=require(_0x16f7('0x7'));var path=require(_0x16f7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x16f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x16f7('0xa'));var jsforce=require(_0x16f7('0xb'));var deskjs=require(_0x16f7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16f7('0xd'));var Redis=require(_0x16f7('0xe'));var authService=require(_0x16f7('0xf'));var qs=require(_0x16f7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16f7('0x11'));var logger=require(_0x16f7('0x12'))(_0x16f7('0x13'));var utils=require(_0x16f7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x16f7('0x15'));var db=require(_0x16f7('0x16'))['db'];function respondWithStatusCode(_0x38e506,_0x267782){_0x267782=_0x267782||0xcc;return function(_0xf859af){if(_0xf859af){return _0x38e506['sendStatus'](_0x267782);}return _0x38e506[_0x16f7('0x17')](_0x267782)[_0x16f7('0x18')]();};}function respondWithResult(_0x5d85ea,_0x4e0bab){_0x4e0bab=_0x4e0bab||0xc8;return function(_0x6c7437){if(_0x6c7437){return _0x5d85ea['status'](_0x4e0bab)[_0x16f7('0x19')](_0x6c7437);}};}function respondWithFilteredResult(_0x384747,_0x69fb70){return function(_0xa7e713){if(_0xa7e713){var _0xc805e2=typeof _0x69fb70[_0x16f7('0x1a')]===_0x16f7('0x1b')&&typeof _0x69fb70[_0x16f7('0x1c')]==='undefined';var _0x43f05f=_0xa7e713[_0x16f7('0x1d')];var _0x5a88c8=_0xc805e2?0x0:_0x69fb70[_0x16f7('0x1a')];var _0x14f192=_0xc805e2?_0xa7e713[_0x16f7('0x1d')]:_0x69fb70[_0x16f7('0x1a')]+_0x69fb70[_0x16f7('0x1c')];var _0x3f5309;if(_0x14f192>=_0x43f05f){_0x14f192=_0x43f05f;_0x3f5309=0xc8;}else{_0x3f5309=0xce;}_0x384747[_0x16f7('0x17')](_0x3f5309);return _0x384747[_0x16f7('0x1e')](_0x16f7('0x1f'),_0x5a88c8+'-'+_0x14f192+'/'+_0x43f05f)[_0x16f7('0x19')](_0xa7e713);}return null;};}function patchUpdates(_0x5f329a){return function(_0x5e5c53){try{jsonpatch[_0x16f7('0x20')](_0x5e5c53,_0x5f329a,!![]);}catch(_0x537ec1){return BPromise[_0x16f7('0x21')](_0x537ec1);}return _0x5e5c53['save']();};}function saveUpdates(_0x150aff,_0x318983){return function(_0x12c84d){if(_0x12c84d){return _0x12c84d[_0x16f7('0x22')](_0x150aff)[_0x16f7('0x23')](function(_0xc6d313){return _0xc6d313;});}return null;};}function removeEntity(_0x2a28bd,_0x497b1c){return function(_0xca0191){if(_0xca0191){return _0xca0191[_0x16f7('0x24')]()['then'](function(){var _0x538ec7=_0xca0191[_0x16f7('0x25')]({'plain':!![]});var _0x4a8436='ExtractedReports';return db[_0x16f7('0x26')][_0x16f7('0x24')]({'where':{'type':_0x4a8436,'resourceId':_0x538ec7['id']}})[_0x16f7('0x23')](function(){return _0xca0191;});})[_0x16f7('0x23')](function(){_0x2a28bd[_0x16f7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f23a,_0x408978){return function(_0x556e62){if(!_0x556e62){_0x15f23a[_0x16f7('0x27')](0x194);}return _0x556e62;};}function handleError(_0x30bc3d,_0x262011){_0x262011=_0x262011||0x1f4;return function(_0x11072a){logger['error'](_0x11072a['stack']);if(_0x11072a[_0x16f7('0x28')]){delete _0x11072a['name'];}_0x30bc3d[_0x16f7('0x17')](_0x262011)[_0x16f7('0x29')](_0x11072a);};}exports[_0x16f7('0x2a')]=function(_0x6b6317,_0x371935){var _0x123173={},_0x2818ad={},_0x14782f={'count':0x0,'rows':[]};var _0x774e40=_[_0x16f7('0x2b')](db['AnalyticExtractedReport'][_0x16f7('0x2c')],function(_0x3135cb){return{'name':_0x3135cb[_0x16f7('0x2d')],'type':_0x3135cb['type'][_0x16f7('0x2e')]};});_0x2818ad[_0x16f7('0x2f')]=_[_0x16f7('0x2b')](_0x774e40,_0x16f7('0x28'));_0x2818ad[_0x16f7('0x30')]=_['keys'](_0x6b6317[_0x16f7('0x30')]);_0x2818ad[_0x16f7('0x31')]=_[_0x16f7('0x32')](_0x2818ad[_0x16f7('0x2f')],_0x2818ad['query']);_0x123173[_0x16f7('0x33')]=_['intersection'](_0x2818ad[_0x16f7('0x2f')],qs[_0x16f7('0x34')](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x34')]));_0x123173[_0x16f7('0x33')]=_0x123173[_0x16f7('0x33')][_0x16f7('0x35')]?_0x123173[_0x16f7('0x33')]:_0x2818ad[_0x16f7('0x2f')];if(!_0x6b6317[_0x16f7('0x30')][_0x16f7('0x36')](_0x16f7('0x37'))){_0x123173['limit']=qs[_0x16f7('0x1c')](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x1c')]);_0x123173['offset']=qs['offset'](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x1a')]);}_0x123173[_0x16f7('0x38')]=qs[_0x16f7('0x39')](_0x6b6317[_0x16f7('0x30')][_0x16f7('0x39')]);_0x123173[_0x16f7('0x3a')]=qs[_0x16f7('0x31')](_['pick'](_0x6b6317[_0x16f7('0x30')],_0x2818ad[_0x16f7('0x31')]),_0x774e40);if(_0x6b6317[_0x16f7('0x30')][_0x16f7('0x3b')]){_0x123173[_0x16f7('0x3a')]=_[_0x16f7('0x3c')](_0x123173[_0x16f7('0x3a')],{'$or':_[_0x16f7('0x2b')](_0x774e40,function(_0x4d5140){if(_0x4d5140['type']!==_0x16f7('0x3d')){var _0x2f3c33={};_0x2f3c33[_0x4d5140['name']]={'$like':'%'+_0x6b6317[_0x16f7('0x30')][_0x16f7('0x3b')]+'%'};return _0x2f3c33;}})});}_0x123173=_[_0x16f7('0x3c')]({},_0x123173,_0x6b6317[_0x16f7('0x3e')]);var _0x16830d={'where':_0x123173[_0x16f7('0x3a')]};return db[_0x16f7('0x3f')]['count'](_0x16830d)[_0x16f7('0x23')](function(_0x379f7a){_0x14782f[_0x16f7('0x1d')]=_0x379f7a;if(_0x6b6317[_0x16f7('0x30')]['includeAll']){_0x123173[_0x16f7('0x40')]=[{'all':!![]}];}return db[_0x16f7('0x3f')][_0x16f7('0x41')](_0x123173);})['then'](function(_0x1ae5be){_0x14782f[_0x16f7('0x42')]=_0x1ae5be;return _0x14782f;})['then'](respondWithFilteredResult(_0x371935,_0x123173))[_0x16f7('0x43')](handleError(_0x371935,null));};exports['show']=function(_0x54cfda,_0x3f9c71){var _0x4198f4={'raw':!![],'where':{'id':_0x54cfda[_0x16f7('0x44')]['id']}},_0x2b2dc4={};_0x2b2dc4[_0x16f7('0x2f')]=_[_0x16f7('0x45')](db[_0x16f7('0x3f')]['rawAttributes']);_0x2b2dc4['query']=_['keys'](_0x54cfda['query']);_0x2b2dc4[_0x16f7('0x31')]=_['intersection'](_0x2b2dc4[_0x16f7('0x2f')],_0x2b2dc4[_0x16f7('0x30')]);_0x4198f4[_0x16f7('0x33')]=_[_0x16f7('0x32')](_0x2b2dc4[_0x16f7('0x2f')],qs['fields'](_0x54cfda['query'][_0x16f7('0x34')]));_0x4198f4[_0x16f7('0x33')]=_0x4198f4[_0x16f7('0x33')][_0x16f7('0x35')]?_0x4198f4[_0x16f7('0x33')]:_0x2b2dc4[_0x16f7('0x2f')];if(_0x54cfda[_0x16f7('0x30')][_0x16f7('0x46')]){_0x4198f4[_0x16f7('0x40')]=[{'all':!![]}];}_0x4198f4=_[_0x16f7('0x3c')]({},_0x4198f4,_0x54cfda[_0x16f7('0x3e')]);return db[_0x16f7('0x3f')]['find'](_0x4198f4)[_0x16f7('0x23')](handleEntityNotFound(_0x3f9c71,null))['then'](respondWithResult(_0x3f9c71,null))[_0x16f7('0x43')](handleError(_0x3f9c71,null));};exports[_0x16f7('0x47')]=function(_0x22ecca,_0x5f462f){return db['AnalyticExtractedReport'][_0x16f7('0x47')](_0x22ecca[_0x16f7('0x48')],{})[_0x16f7('0x23')](function(_0x3448a4){var _0x2b9ac2=_0x22ecca['user'][_0x16f7('0x25')]({'plain':!![]});if(!_0x2b9ac2)throw new Error(_0x16f7('0x49'));if(_0x2b9ac2['role']===_0x16f7('0x4a')){var _0x161b87=_0x3448a4[_0x16f7('0x25')]({'plain':!![]});var _0x24b2a1=_0x16f7('0x4b');return db[_0x16f7('0x4c')][_0x16f7('0x4d')]({'where':{'name':_0x24b2a1,'userProfileId':_0x2b9ac2[_0x16f7('0x4e')]},'raw':!![]})[_0x16f7('0x23')](function(_0x3e95a0){if(_0x3e95a0&&_0x3e95a0[_0x16f7('0x4f')]===0x0){return db[_0x16f7('0x26')][_0x16f7('0x47')]({'name':_0x161b87['name'],'resourceId':_0x161b87['id'],'type':_0x3e95a0['name'],'sectionId':_0x3e95a0['id']},{})['then'](function(){return _0x3448a4;});}else{return _0x3448a4;}})[_0x16f7('0x43')](function(_0x140b88){logger[_0x16f7('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x140b88);throw _0x140b88;});}return _0x3448a4;})[_0x16f7('0x23')](respondWithResult(_0x5f462f,0xc9))[_0x16f7('0x43')](handleError(_0x5f462f,null));};exports[_0x16f7('0x22')]=function(_0x16446d,_0x25416d){if(_0x16446d[_0x16f7('0x48')]['id']){delete _0x16446d[_0x16f7('0x48')]['id'];}return db[_0x16f7('0x3f')]['find']({'where':{'id':_0x16446d[_0x16f7('0x44')]['id']}})[_0x16f7('0x23')](handleEntityNotFound(_0x25416d,null))['then'](saveUpdates(_0x16446d[_0x16f7('0x48')],null))['then'](respondWithResult(_0x25416d,null))[_0x16f7('0x43')](handleError(_0x25416d,null));};exports['destroy']=function(_0x565cf2,_0x4b6790){return db[_0x16f7('0x3f')][_0x16f7('0x4d')]({'where':{'id':_0x565cf2[_0x16f7('0x44')]['id']}})[_0x16f7('0x23')](handleEntityNotFound(_0x4b6790,null))[_0x16f7('0x23')](removeEntity(_0x4b6790,null))[_0x16f7('0x43')](handleError(_0x4b6790,null));};exports[_0x16f7('0x51')]=function(_0x1fae22,_0x3f9eca,_0x1b30f6){return db[_0x16f7('0x3f')][_0x16f7('0x4d')]({'where':{'id':_0x1fae22['params']['id']},'attributes':[_0x16f7('0x28'),'basename',_0x16f7('0x52'),'output'],'raw':!![]})[_0x16f7('0x23')](handleEntityNotFound(_0x3f9eca,null))[_0x16f7('0x23')](function(_0x27df65){if(_0x27df65){if(!fs['existsSync'](path[_0x16f7('0x53')](config[_0x16f7('0x54')],_0x16f7('0x55'),_0x27df65[_0x16f7('0x52')]))){throw new db[(_0x16f7('0x56'))][(_0x16f7('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1fae22[_0x16f7('0x30')][_0x16f7('0x58')]){return _0x3f9eca['sendStatus'](0xc8);}return _0x3f9eca[_0x16f7('0x51')](path[_0x16f7('0x53')](config[_0x16f7('0x54')],_0x16f7('0x55'),_0x27df65[_0x16f7('0x52')]),util[_0x16f7('0x59')]('%s.%s',_0x27df65[_0x16f7('0x5a')]||_0x27df65[_0x16f7('0x28')],_0x27df65[_0x16f7('0x5b')]['toLowerCase']()));}})[_0x16f7('0x43')](handleError(_0x3f9eca,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index df28efe..0a4fa6c 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 _0xb4af=['exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise'];(function(_0x43361e,_0x350f7f){var _0x1b3560=function(_0x1bebdd){while(--_0x1bebdd){_0x43361e['push'](_0x43361e['shift']());}};_0x1b3560(++_0x350f7f);}(_0xb4af,0x1c5));var _0xfb4a=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb4af[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0xfb4a('0x0'));var util=require(_0xfb4a('0x1'));var logger=require('../../config/logger')(_0xfb4a('0x2'));var moment=require(_0xfb4a('0x3'));var BPromise=require(_0xfb4a('0x4'));var rp=require(_0xfb4a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xfb4a('0x6')]=function(_0x1d5730,_0x482a3c){return _0x1d5730['define'](_0xfb4a('0x7'),attributes,{'tableName':_0xfb4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02b5=['analytics_extracted_reports','lodash','util','api','moment','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x282700,_0x270bc0){var _0x178681=function(_0x1f97c9){while(--_0x1f97c9){_0x282700['push'](_0x282700['shift']());}};_0x178681(++_0x270bc0);}(_0x02b5,0xb5));var _0x502b=function(_0xabfdd,_0x3b1589){_0xabfdd=_0xabfdd-0x0;var _0x25c06c=_0x02b5[_0xabfdd];return _0x25c06c;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var logger=require('../../config/logger')(_0x502b('0x2'));var moment=require(_0x502b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x502b('0x4'));var config=require('../../config/environment');var attributes=require(_0x502b('0x5'));module['exports']=function(_0xf6b476,_0x4aad80){return _0xf6b476[_0x502b('0x6')](_0x502b('0x7'),attributes,{'tableName':_0x502b('0x8'),'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 c70c149..8fcc022 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 _0x4c86=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5641d9,_0x1de53b){var _0x1b1f89=function(_0x27b5b3){while(--_0x27b5b3){_0x5641d9['push'](_0x5641d9['shift']());}};_0x1b1f89(++_0x1de53b);}(_0x4c86,0x8e));var _0x64c8=function(_0x4577e0,_0x34bffb){_0x4577e0=_0x4577e0-0x0;var _0x31f524=_0x4c86[_0x4577e0];return _0x31f524;};'use strict';var _=require(_0x64c8('0x0'));var util=require(_0x64c8('0x1'));var moment=require('moment');var BPromise=require(_0x64c8('0x2'));var rs=require(_0x64c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x64c8('0x4'));var logger=require(_0x64c8('0x5'))(_0x64c8('0x6'));var config=require(_0x64c8('0x7'));var jayson=require(_0x64c8('0x8'));var client=jayson[_0x64c8('0x9')][_0x64c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46171f,_0x3bf4b7,_0x334f07){return new BPromise(function(_0xa8ac03,_0x5b9c9f){return client[_0x64c8('0xb')](_0x46171f,_0x334f07)[_0x64c8('0xc')](function(_0x1470fa){logger[_0x64c8('0xd')](_0x64c8('0xe'),_0x3bf4b7,_0x64c8('0xf'));logger[_0x64c8('0x10')](_0x64c8('0x11'),_0x3bf4b7,_0x64c8('0xf'),JSON[_0x64c8('0x12')](_0x1470fa));if(_0x1470fa[_0x64c8('0x13')]){if(_0x1470fa[_0x64c8('0x13')][_0x64c8('0x14')]===0x1f4){logger[_0x64c8('0x13')](_0x64c8('0xe'),_0x3bf4b7,_0x1470fa['error']['message']);return _0x5b9c9f(_0x1470fa[_0x64c8('0x13')][_0x64c8('0x15')]);}logger[_0x64c8('0x13')](_0x64c8('0xe'),_0x3bf4b7,_0x1470fa[_0x64c8('0x13')][_0x64c8('0x15')]);return _0xa8ac03(_0x1470fa[_0x64c8('0x13')][_0x64c8('0x15')]);}else{logger['info'](_0x64c8('0xe'),_0x3bf4b7,_0x64c8('0xf'));_0xa8ac03(_0x1470fa[_0x64c8('0x16')][_0x64c8('0x15')]);}})[_0x64c8('0x17')](function(_0x28bbb0){logger[_0x64c8('0x13')](_0x64c8('0xe'),_0x3bf4b7,_0x28bbb0);_0x5b9c9f(_0x28bbb0);});});}
\ No newline at end of file
+var _0x3743=['code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','jayson/promise','client','then','info','request\x20sent','debug','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3743,0xd1));var _0x3374=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x3743[_0x46a671];return _0x526d75;};'use strict';var _=require(_0x3374('0x0'));var util=require('util');var moment=require(_0x3374('0x1'));var BPromise=require('bluebird');var rs=require(_0x3374('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3374('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3374('0x4'));var client=jayson[_0x3374('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x230a13,_0x58333f,_0xb537e6){return new BPromise(function(_0x2f6287,_0x12189f){return client['request'](_0x230a13,_0xb537e6)[_0x3374('0x6')](function(_0x5d3880){logger[_0x3374('0x7')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x58333f,_0x3374('0x8'));logger[_0x3374('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x58333f,_0x3374('0x8'),JSON[_0x3374('0xa')](_0x5d3880));if(_0x5d3880[_0x3374('0xb')]){if(_0x5d3880[_0x3374('0xb')][_0x3374('0xc')]===0x1f4){logger['error'](_0x3374('0xd'),_0x58333f,_0x5d3880[_0x3374('0xb')][_0x3374('0xe')]);return _0x12189f(_0x5d3880['error']['message']);}logger[_0x3374('0xb')](_0x3374('0xd'),_0x58333f,_0x5d3880['error'][_0x3374('0xe')]);return _0x2f6287(_0x5d3880[_0x3374('0xb')]['message']);}else{logger[_0x3374('0x7')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x58333f,_0x3374('0x8'));_0x2f6287(_0x5d3880[_0x3374('0xf')][_0x3374('0xe')]);}})[_0x3374('0x10')](function(_0x3ce639){logger['error'](_0x3374('0xd'),_0x58333f,_0x3ce639);_0x12189f(_0x3ce639);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 73136aa..ca83bd1 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 _0x9e4c=['../../config/environment','isAuthenticated','get','/:id/download','post','create','put','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x48531e,_0x402d8b){var _0x1a97a9=function(_0x8dd53b){while(--_0x8dd53b){_0x48531e['push'](_0x48531e['shift']());}};_0x1a97a9(++_0x402d8b);}(_0x9e4c,0xc9));var _0xc9e4=function(_0x33dda7,_0xf1a77b){_0x33dda7=_0x33dda7-0x0;var _0x24eb43=_0x9e4c[_0x33dda7];return _0x24eb43;};'use strict';var multer=require(_0xc9e4('0x0'));var util=require('util');var path=require(_0xc9e4('0x1'));var timeout=require(_0xc9e4('0x2'));var express=require(_0xc9e4('0x3'));var router=express[_0xc9e4('0x4')]();var fs_extra=require(_0xc9e4('0x5'));var auth=require(_0xc9e4('0x6'));var interaction=require(_0xc9e4('0x7'));var config=require(_0xc9e4('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xc9e4('0x9')](),controller['index']);router[_0xc9e4('0xa')]('/:id',auth[_0xc9e4('0x9')](),controller['show']);router['get'](_0xc9e4('0xb'),auth['isAuthenticated'](),controller['download']);router[_0xc9e4('0xc')]('/',auth[_0xc9e4('0x9')](),controller[_0xc9e4('0xd')]);router[_0xc9e4('0xe')]('/:id',auth[_0xc9e4('0x9')](),controller[_0xc9e4('0xf')]);router[_0xc9e4('0x10')](_0xc9e4('0x11'),auth[_0xc9e4('0x9')](),controller[_0xc9e4('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x55dc=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','exports'];(function(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0x55dc,0x10e));var _0xc55d=function(_0xdaa031,_0x1b6b9d){_0xdaa031=_0xdaa031-0x0;var _0x17b754=_0x55dc[_0xdaa031];return _0x17b754;};'use strict';var multer=require('multer');var util=require(_0xc55d('0x0'));var path=require(_0xc55d('0x1'));var timeout=require(_0xc55d('0x2'));var express=require(_0xc55d('0x3'));var router=express['Router']();var fs_extra=require(_0xc55d('0x4'));var auth=require(_0xc55d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc55d('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0xc55d('0x7')]('/',auth[_0xc55d('0x8')](),controller[_0xc55d('0x9')]);router[_0xc55d('0x7')](_0xc55d('0xa'),auth[_0xc55d('0x8')](),controller['show']);router[_0xc55d('0x7')](_0xc55d('0xb'),auth['isAuthenticated'](),controller[_0xc55d('0xc')]);router[_0xc55d('0xd')]('/',auth['isAuthenticated'](),controller[_0xc55d('0xe')]);router[_0xc55d('0xf')](_0xc55d('0xa'),auth['isAuthenticated'](),controller[_0xc55d('0x10')]);router['delete'](_0xc55d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xc55d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 2f7c5f3..dd4e090 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 _0x1bb2=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3aae83,_0x11d202){var _0x1a21ba=function(_0xf2b23e){while(--_0xf2b23e){_0x3aae83['push'](_0x3aae83['shift']());}};_0x1a21ba(++_0x11d202);}(_0x1bb2,0x8e));var _0x21bb=function(_0x25b064,_0x27f3fb){_0x25b064=_0x25b064-0x0;var _0x533a84=_0x1bb2[_0x25b064];return _0x533a84;};'use strict';var Sequelize=require(_0x21bb('0x0'));module[_0x21bb('0x1')]={'field':{'type':Sequelize[_0x21bb('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x21bb('0x3')]},'format':{'type':Sequelize[_0x21bb('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x21bb('0x3')]},'custom':{'type':Sequelize[_0x21bb('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x78ed=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x78ed,0xec));var _0xd78e=function(_0x21f75e,_0x3ccd22){_0x21f75e=_0x21f75e-0x0;var _0x5f2c0f=_0x78ed[_0x21f75e];return _0x5f2c0f;};'use strict';var Sequelize=require(_0xd78e('0x0'));module[_0xd78e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xd78e('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd78e('0x2')]},'groupBy':{'type':Sequelize[_0xd78e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 9b4beda..5f0beb1 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 _0xf0bf=['stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','length','find','catch','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','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','offset','undefined','limit','count','set','json','reject','update','then','error'];(function(_0x200b47,_0x23670f){var _0x577a7b=function(_0x4d1cad){while(--_0x4d1cad){_0x200b47['push'](_0x200b47['shift']());}};_0x577a7b(++_0x23670f);}(_0xf0bf,0xd8));var _0xff0b=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xf0bf[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0xff0b('0x0'));var rimraf=require(_0xff0b('0x1'));var zipdir=require(_0xff0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff0b('0x3'));var BPromise=require(_0xff0b('0x4'));var Mustache=require(_0xff0b('0x5'));var util=require(_0xff0b('0x6'));var path=require(_0xff0b('0x7'));var sox=require(_0xff0b('0x8'));var csv=require('to-csv');var ejs=require(_0xff0b('0x9'));var fs=require('fs');var fs_extra=require(_0xff0b('0xa'));var _=require(_0xff0b('0xb'));var squel=require('squel');var crypto=require(_0xff0b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff0b('0xd'));var querystring=require(_0xff0b('0xe'));var Papa=require(_0xff0b('0xf'));var Redis=require(_0xff0b('0x10'));var authService=require(_0xff0b('0x11'));var qs=require(_0xff0b('0x12'));var as=require(_0xff0b('0x13'));var hardwareService=require(_0xff0b('0x14'));var logger=require(_0xff0b('0x15'))('api');var utils=require(_0xff0b('0x16'));var config=require(_0xff0b('0x17'));var licenseUtil=require(_0xff0b('0x18'));var db=require(_0xff0b('0x19'))['db'];function respondWithStatusCode(_0x1967ef,_0x3f672d){_0x3f672d=_0x3f672d||0xcc;return function(_0x4e8d21){if(_0x4e8d21){return _0x1967ef[_0xff0b('0x1a')](_0x3f672d);}return _0x1967ef[_0xff0b('0x1b')](_0x3f672d)[_0xff0b('0x1c')]();};}function respondWithResult(_0x3516bc,_0x3bca7e){_0x3bca7e=_0x3bca7e||0xc8;return function(_0xd5520f){if(_0xd5520f){return _0x3516bc[_0xff0b('0x1b')](_0x3bca7e)['json'](_0xd5520f);}};}function respondWithFilteredResult(_0x7a0ca,_0x314179){return function(_0xe75e40){if(_0xe75e40){var _0x3ee714=typeof _0x314179[_0xff0b('0x1d')]===_0xff0b('0x1e')&&typeof _0x314179[_0xff0b('0x1f')]===_0xff0b('0x1e');var _0x5b39c7=_0xe75e40[_0xff0b('0x20')];var _0x2e62b8=_0x3ee714?0x0:_0x314179[_0xff0b('0x1d')];var _0x164930=_0x3ee714?_0xe75e40[_0xff0b('0x20')]:_0x314179[_0xff0b('0x1d')]+_0x314179['limit'];var _0x5aba06;if(_0x164930>=_0x5b39c7){_0x164930=_0x5b39c7;_0x5aba06=0xc8;}else{_0x5aba06=0xce;}_0x7a0ca[_0xff0b('0x1b')](_0x5aba06);return _0x7a0ca[_0xff0b('0x21')]('Content-Range',_0x2e62b8+'-'+_0x164930+'/'+_0x5b39c7)[_0xff0b('0x22')](_0xe75e40);}return null;};}function patchUpdates(_0x3a634a){return function(_0x3e0d22){try{jsonpatch['apply'](_0x3e0d22,_0x3a634a,!![]);}catch(_0x5205f2){return BPromise[_0xff0b('0x23')](_0x5205f2);}return _0x3e0d22['save']();};}function saveUpdates(_0x5596d1,_0x38fc9c){return function(_0x86758c){if(_0x86758c){return _0x86758c[_0xff0b('0x24')](_0x5596d1)['then'](function(_0x4caf54){return _0x4caf54;});}return null;};}function removeEntity(_0x1a392b,_0x1b92d4){return function(_0x4af4db){if(_0x4af4db){return _0x4af4db['destroy']()[_0xff0b('0x25')](function(){_0x1a392b[_0xff0b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18ef7b,_0x38b484){return function(_0x472d63){if(!_0x472d63){_0x18ef7b['sendStatus'](0x194);}return _0x472d63;};}function handleError(_0x4049ef,_0x2e3a98){_0x2e3a98=_0x2e3a98||0x1f4;return function(_0x24e58d){logger[_0xff0b('0x26')](_0x24e58d[_0xff0b('0x27')]);if(_0x24e58d[_0xff0b('0x28')]){delete _0x24e58d[_0xff0b('0x28')];}_0x4049ef[_0xff0b('0x1b')](_0x2e3a98)[_0xff0b('0x29')](_0x24e58d);};}exports[_0xff0b('0x2a')]=function(_0x4df610,_0x270661){var _0x42fa43={},_0x468351={},_0x1b61e0={'count':0x0,'rows':[]};var _0x5325d4=_[_0xff0b('0x2b')](db[_0xff0b('0x2c')][_0xff0b('0x2d')],function(_0x20cbae){return{'name':_0x20cbae[_0xff0b('0x2e')],'type':_0x20cbae[_0xff0b('0x2f')][_0xff0b('0x30')]};});_0x468351[_0xff0b('0x31')]=_[_0xff0b('0x2b')](_0x5325d4,_0xff0b('0x28'));_0x468351['query']=_[_0xff0b('0x32')](_0x4df610[_0xff0b('0x33')]);_0x468351[_0xff0b('0x34')]=_[_0xff0b('0x35')](_0x468351[_0xff0b('0x31')],_0x468351['query']);_0x42fa43[_0xff0b('0x36')]=_[_0xff0b('0x35')](_0x468351['model'],qs['fields'](_0x4df610[_0xff0b('0x33')]['fields']));_0x42fa43['attributes']=_0x42fa43[_0xff0b('0x36')]['length']?_0x42fa43[_0xff0b('0x36')]:_0x468351[_0xff0b('0x31')];if(!_0x4df610[_0xff0b('0x33')][_0xff0b('0x37')](_0xff0b('0x38'))){_0x42fa43[_0xff0b('0x1f')]=qs[_0xff0b('0x1f')](_0x4df610[_0xff0b('0x33')]['limit']);_0x42fa43[_0xff0b('0x1d')]=qs[_0xff0b('0x1d')](_0x4df610[_0xff0b('0x33')][_0xff0b('0x1d')]);}_0x42fa43[_0xff0b('0x39')]=qs[_0xff0b('0x3a')](_0x4df610[_0xff0b('0x33')][_0xff0b('0x3a')]);_0x42fa43['where']=qs[_0xff0b('0x34')](_['pick'](_0x4df610[_0xff0b('0x33')],_0x468351[_0xff0b('0x34')]),_0x5325d4);if(_0x4df610[_0xff0b('0x33')][_0xff0b('0x3b')]){_0x42fa43[_0xff0b('0x3c')]=_[_0xff0b('0x3d')](_0x42fa43['where'],{'$or':_[_0xff0b('0x2b')](_0x5325d4,function(_0x32ff93){if(_0x32ff93[_0xff0b('0x2f')]!==_0xff0b('0x3e')){var _0x465ec9={};_0x465ec9[_0x32ff93[_0xff0b('0x28')]]={'$like':'%'+_0x4df610[_0xff0b('0x33')][_0xff0b('0x3b')]+'%'};return _0x465ec9;}})});}_0x42fa43=_[_0xff0b('0x3d')]({},_0x42fa43,_0x4df610[_0xff0b('0x3f')]);var _0x2067cb={'where':_0x42fa43[_0xff0b('0x3c')]};return db[_0xff0b('0x2c')]['count'](_0x2067cb)[_0xff0b('0x25')](function(_0x2247c5){_0x1b61e0['count']=_0x2247c5;if(_0x4df610[_0xff0b('0x33')][_0xff0b('0x40')]){_0x42fa43[_0xff0b('0x41')]=[{'all':!![]}];}return db[_0xff0b('0x2c')][_0xff0b('0x42')](_0x42fa43);})[_0xff0b('0x25')](function(_0x2f8287){_0x1b61e0[_0xff0b('0x43')]=_0x2f8287;return _0x1b61e0;})[_0xff0b('0x25')](respondWithFilteredResult(_0x270661,_0x42fa43))['catch'](handleError(_0x270661,null));};exports[_0xff0b('0x44')]=function(_0x1b7b93,_0x348c13){var _0x12b055={'raw':![],'where':{'id':_0x1b7b93[_0xff0b('0x45')]['id']}},_0x52c807={};_0x52c807[_0xff0b('0x31')]=_['keys'](db['AnalyticFieldReport'][_0xff0b('0x2d')]);_0x52c807[_0xff0b('0x33')]=_[_0xff0b('0x32')](_0x1b7b93[_0xff0b('0x33')]);_0x52c807[_0xff0b('0x34')]=_[_0xff0b('0x35')](_0x52c807[_0xff0b('0x31')],_0x52c807[_0xff0b('0x33')]);_0x12b055[_0xff0b('0x36')]=_[_0xff0b('0x35')](_0x52c807[_0xff0b('0x31')],qs['fields'](_0x1b7b93[_0xff0b('0x33')][_0xff0b('0x46')]));_0x12b055[_0xff0b('0x36')]=_0x12b055[_0xff0b('0x36')][_0xff0b('0x47')]?_0x12b055[_0xff0b('0x36')]:_0x52c807['model'];if(_0x1b7b93[_0xff0b('0x33')][_0xff0b('0x40')]){_0x12b055[_0xff0b('0x41')]=[{'all':!![]}];}_0x12b055=_['merge']({},_0x12b055,_0x1b7b93[_0xff0b('0x3f')]);return db[_0xff0b('0x2c')][_0xff0b('0x48')](_0x12b055)[_0xff0b('0x25')](handleEntityNotFound(_0x348c13,null))[_0xff0b('0x25')](respondWithResult(_0x348c13,null))[_0xff0b('0x49')](handleError(_0x348c13,null));};exports[_0xff0b('0x4a')]=function(_0x4405b8,_0x454b52){return db['AnalyticFieldReport'][_0xff0b('0x4a')](_0x4405b8[_0xff0b('0x4b')],{})[_0xff0b('0x25')](respondWithResult(_0x454b52,0xc9))[_0xff0b('0x49')](handleError(_0x454b52,null));};exports['bulkCreate']=function(_0xdce8ec,_0x2edb5d){return db['AnalyticFieldReport'][_0xff0b('0x4c')](_0xdce8ec[_0xff0b('0x4b')],{'raw':![],'individualHooks':!![]})[_0xff0b('0x25')](respondWithResult(_0x2edb5d,0xc9))[_0xff0b('0x49')](handleError(_0x2edb5d,null));};exports[_0xff0b('0x24')]=function(_0x5174ba,_0x2c03ce){if(_0x5174ba[_0xff0b('0x4b')]['id']){delete _0x5174ba['body']['id'];}return db[_0xff0b('0x2c')]['find']({'where':{'id':_0x5174ba[_0xff0b('0x45')]['id']}})[_0xff0b('0x25')](handleEntityNotFound(_0x2c03ce,null))[_0xff0b('0x25')](saveUpdates(_0x5174ba[_0xff0b('0x4b')],null))['then'](respondWithResult(_0x2c03ce,null))[_0xff0b('0x49')](handleError(_0x2c03ce,null));};exports[_0xff0b('0x4d')]=function(_0x716764,_0x1b7433){return db[_0xff0b('0x2c')][_0xff0b('0x48')]({'where':{'id':_0x716764['params']['id']}})[_0xff0b('0x25')](handleEntityNotFound(_0x1b7433,null))[_0xff0b('0x25')](removeEntity(_0x1b7433,null))[_0xff0b('0x49')](handleError(_0x1b7433,null));};exports[_0xff0b('0x4e')]=function(_0x167bfc,_0x1513a7){return db['AnalyticFieldReport'][_0xff0b('0x4d')]({'where':{'id':_0x167bfc['query'][_0xff0b('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0xff0b('0x25')](respondWithResult(_0x1513a7,0xcc))[_0xff0b('0x49')](handleError(_0x1513a7,null));};exports[_0xff0b('0x50')]=function(_0x2e1d30,_0x22a81d,_0x512237){return db[_0xff0b('0x51')][_0xff0b('0x52')]({'where':{'id':_0x2e1d30[_0xff0b('0x45')]['id']}})[_0xff0b('0x25')](handleEntityNotFound(_0x22a81d,null))['then'](function(_0x317f70){if(_0x317f70){return db['sequelize'][_0xff0b('0x53')](function(_0x8a5a96){return db[_0xff0b('0x2c')][_0xff0b('0x4d')]({'where':{'CustomReportId':_0x2e1d30['params']['id']},'transaction':_0x8a5a96})[_0xff0b('0x25')](function(_0x21d116){var _0x5287d5=_['map'](_0x2e1d30[_0xff0b('0x4b')],function(_0x278b99){delete _0x278b99['id'];_0x278b99[_0xff0b('0x54')]=_0x2e1d30[_0xff0b('0x45')]['id'];return _0x278b99;});return db[_0xff0b('0x2c')]['bulkCreate'](_0x5287d5,{'transaction':_0x8a5a96});});})[_0xff0b('0x25')](function(){return db[_0xff0b('0x2c')]['findAll']({'where':{'CustomReportId':_0x2e1d30[_0xff0b('0x45')]['id']}});});}})['then'](respondWithResult(_0x22a81d,null))[_0xff0b('0x49')](handleError(_0x22a81d,null));};
\ No newline at end of file
+var _0x613e=['body','params','bulkDestroy','ids','addFields','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','create','bulkCreate'];(function(_0x391eb4,_0x5a855a){var _0x40079c=function(_0x125d66){while(--_0x125d66){_0x391eb4['push'](_0x391eb4['shift']());}};_0x40079c(++_0x5a855a);}(_0x613e,0xa7));var _0xe613=function(_0x15b552,_0x27f26b){_0x15b552=_0x15b552-0x0;var _0x3a9523=_0x613e[_0x15b552];return _0x3a9523;};'use strict';var emlformat=require(_0xe613('0x0'));var rimraf=require(_0xe613('0x1'));var zipdir=require(_0xe613('0x2'));var jsonpatch=require(_0xe613('0x3'));var rp=require(_0xe613('0x4'));var moment=require(_0xe613('0x5'));var BPromise=require(_0xe613('0x6'));var Mustache=require('mustache');var util=require(_0xe613('0x7'));var path=require(_0xe613('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe613('0x9'));var _=require(_0xe613('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe613('0xb'));var deskjs=require(_0xe613('0xc'));var toCsv=require(_0xe613('0xd'));var querystring=require(_0xe613('0xe'));var Papa=require(_0xe613('0xf'));var Redis=require(_0xe613('0x10'));var authService=require(_0xe613('0x11'));var qs=require(_0xe613('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe613('0x13'));var logger=require(_0xe613('0x14'))('api');var utils=require(_0xe613('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe613('0x16'))['db'];function respondWithStatusCode(_0x1c5188,_0x5b7af0){_0x5b7af0=_0x5b7af0||0xcc;return function(_0x477225){if(_0x477225){return _0x1c5188['sendStatus'](_0x5b7af0);}return _0x1c5188[_0xe613('0x17')](_0x5b7af0)[_0xe613('0x18')]();};}function respondWithResult(_0x373f28,_0x395502){_0x395502=_0x395502||0xc8;return function(_0x5c8f29){if(_0x5c8f29){return _0x373f28[_0xe613('0x17')](_0x395502)['json'](_0x5c8f29);}};}function respondWithFilteredResult(_0x100fc1,_0x4e024d){return function(_0x511cf8){if(_0x511cf8){var _0xc4ff83=typeof _0x4e024d['offset']===_0xe613('0x19')&&typeof _0x4e024d[_0xe613('0x1a')]==='undefined';var _0x5d7608=_0x511cf8[_0xe613('0x1b')];var _0x4dd212=_0xc4ff83?0x0:_0x4e024d[_0xe613('0x1c')];var _0x767989=_0xc4ff83?_0x511cf8['count']:_0x4e024d[_0xe613('0x1c')]+_0x4e024d[_0xe613('0x1a')];var _0x27842e;if(_0x767989>=_0x5d7608){_0x767989=_0x5d7608;_0x27842e=0xc8;}else{_0x27842e=0xce;}_0x100fc1['status'](_0x27842e);return _0x100fc1['set'](_0xe613('0x1d'),_0x4dd212+'-'+_0x767989+'/'+_0x5d7608)[_0xe613('0x1e')](_0x511cf8);}return null;};}function patchUpdates(_0x1ae539){return function(_0x283128){try{jsonpatch[_0xe613('0x1f')](_0x283128,_0x1ae539,!![]);}catch(_0x1fc67c){return BPromise[_0xe613('0x20')](_0x1fc67c);}return _0x283128[_0xe613('0x21')]();};}function saveUpdates(_0x744e7e,_0x56d677){return function(_0x46fe1d){if(_0x46fe1d){return _0x46fe1d[_0xe613('0x22')](_0x744e7e)[_0xe613('0x23')](function(_0x18ae16){return _0x18ae16;});}return null;};}function removeEntity(_0x56bc4d,_0x39b30e){return function(_0x3d7b1b){if(_0x3d7b1b){return _0x3d7b1b[_0xe613('0x24')]()[_0xe613('0x23')](function(){_0x56bc4d[_0xe613('0x17')](0xcc)[_0xe613('0x18')]();});}};}function handleEntityNotFound(_0x8735b1,_0x5da3d6){return function(_0x3fbc62){if(!_0x3fbc62){_0x8735b1[_0xe613('0x25')](0x194);}return _0x3fbc62;};}function handleError(_0x1af053,_0x2be5ca){_0x2be5ca=_0x2be5ca||0x1f4;return function(_0x1404fb){logger[_0xe613('0x26')](_0x1404fb[_0xe613('0x27')]);if(_0x1404fb[_0xe613('0x28')]){delete _0x1404fb[_0xe613('0x28')];}_0x1af053[_0xe613('0x17')](_0x2be5ca)['send'](_0x1404fb);};}exports['index']=function(_0x1edc4a,_0x410372){var _0x2798af={},_0x41b0eb={},_0x5a7281={'count':0x0,'rows':[]};var _0x19ad60=_['map'](db[_0xe613('0x29')][_0xe613('0x2a')],function(_0x3ffaf5){return{'name':_0x3ffaf5[_0xe613('0x2b')],'type':_0x3ffaf5[_0xe613('0x2c')]['key']};});_0x41b0eb[_0xe613('0x2d')]=_[_0xe613('0x2e')](_0x19ad60,_0xe613('0x28'));_0x41b0eb['query']=_['keys'](_0x1edc4a[_0xe613('0x2f')]);_0x41b0eb[_0xe613('0x30')]=_[_0xe613('0x31')](_0x41b0eb[_0xe613('0x2d')],_0x41b0eb['query']);_0x2798af[_0xe613('0x32')]=_['intersection'](_0x41b0eb[_0xe613('0x2d')],qs[_0xe613('0x33')](_0x1edc4a[_0xe613('0x2f')]['fields']));_0x2798af['attributes']=_0x2798af[_0xe613('0x32')][_0xe613('0x34')]?_0x2798af['attributes']:_0x41b0eb[_0xe613('0x2d')];if(!_0x1edc4a['query'][_0xe613('0x35')](_0xe613('0x36'))){_0x2798af[_0xe613('0x1a')]=qs[_0xe613('0x1a')](_0x1edc4a[_0xe613('0x2f')][_0xe613('0x1a')]);_0x2798af[_0xe613('0x1c')]=qs[_0xe613('0x1c')](_0x1edc4a['query'][_0xe613('0x1c')]);}_0x2798af[_0xe613('0x37')]=qs[_0xe613('0x38')](_0x1edc4a['query']['sort']);_0x2798af['where']=qs[_0xe613('0x30')](_[_0xe613('0x39')](_0x1edc4a[_0xe613('0x2f')],_0x41b0eb[_0xe613('0x30')]),_0x19ad60);if(_0x1edc4a[_0xe613('0x2f')]['filter']){_0x2798af[_0xe613('0x3a')]=_['merge'](_0x2798af[_0xe613('0x3a')],{'$or':_[_0xe613('0x2e')](_0x19ad60,function(_0x1e4a2b){if(_0x1e4a2b[_0xe613('0x2c')]!==_0xe613('0x3b')){var _0x14cb53={};_0x14cb53[_0x1e4a2b[_0xe613('0x28')]]={'$like':'%'+_0x1edc4a[_0xe613('0x2f')][_0xe613('0x3c')]+'%'};return _0x14cb53;}})});}_0x2798af=_[_0xe613('0x3d')]({},_0x2798af,_0x1edc4a[_0xe613('0x3e')]);var _0x1151f5={'where':_0x2798af[_0xe613('0x3a')]};return db[_0xe613('0x29')][_0xe613('0x1b')](_0x1151f5)[_0xe613('0x23')](function(_0x3c844){_0x5a7281['count']=_0x3c844;if(_0x1edc4a[_0xe613('0x2f')][_0xe613('0x3f')]){_0x2798af['include']=[{'all':!![]}];}return db[_0xe613('0x29')][_0xe613('0x40')](_0x2798af);})[_0xe613('0x23')](function(_0xa0634){_0x5a7281[_0xe613('0x41')]=_0xa0634;return _0x5a7281;})[_0xe613('0x23')](respondWithFilteredResult(_0x410372,_0x2798af))[_0xe613('0x42')](handleError(_0x410372,null));};exports[_0xe613('0x43')]=function(_0x5c2e56,_0x5542c4){var _0x5eda54={'raw':![],'where':{'id':_0x5c2e56['params']['id']}},_0x2266e8={};_0x2266e8[_0xe613('0x2d')]=_['keys'](db[_0xe613('0x29')][_0xe613('0x2a')]);_0x2266e8['query']=_[_0xe613('0x44')](_0x5c2e56[_0xe613('0x2f')]);_0x2266e8[_0xe613('0x30')]=_[_0xe613('0x31')](_0x2266e8[_0xe613('0x2d')],_0x2266e8['query']);_0x5eda54[_0xe613('0x32')]=_[_0xe613('0x31')](_0x2266e8[_0xe613('0x2d')],qs['fields'](_0x5c2e56[_0xe613('0x2f')][_0xe613('0x33')]));_0x5eda54[_0xe613('0x32')]=_0x5eda54['attributes']['length']?_0x5eda54['attributes']:_0x2266e8[_0xe613('0x2d')];if(_0x5c2e56['query'][_0xe613('0x3f')]){_0x5eda54[_0xe613('0x45')]=[{'all':!![]}];}_0x5eda54=_[_0xe613('0x3d')]({},_0x5eda54,_0x5c2e56[_0xe613('0x3e')]);return db['AnalyticFieldReport'][_0xe613('0x46')](_0x5eda54)[_0xe613('0x23')](handleEntityNotFound(_0x5542c4,null))[_0xe613('0x23')](respondWithResult(_0x5542c4,null))[_0xe613('0x42')](handleError(_0x5542c4,null));};exports[_0xe613('0x47')]=function(_0xd12708,_0x3affb1){return db[_0xe613('0x29')]['create'](_0xd12708['body'],{})[_0xe613('0x23')](respondWithResult(_0x3affb1,0xc9))['catch'](handleError(_0x3affb1,null));};exports[_0xe613('0x48')]=function(_0x5f4415,_0x53e86f){return db[_0xe613('0x29')][_0xe613('0x48')](_0x5f4415[_0xe613('0x49')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x53e86f,0xc9))[_0xe613('0x42')](handleError(_0x53e86f,null));};exports['update']=function(_0x17ae16,_0x37839d){if(_0x17ae16[_0xe613('0x49')]['id']){delete _0x17ae16[_0xe613('0x49')]['id'];}return db[_0xe613('0x29')][_0xe613('0x46')]({'where':{'id':_0x17ae16['params']['id']}})[_0xe613('0x23')](handleEntityNotFound(_0x37839d,null))['then'](saveUpdates(_0x17ae16[_0xe613('0x49')],null))[_0xe613('0x23')](respondWithResult(_0x37839d,null))[_0xe613('0x42')](handleError(_0x37839d,null));};exports[_0xe613('0x24')]=function(_0x283bb2,_0x424ca6){return db['AnalyticFieldReport'][_0xe613('0x46')]({'where':{'id':_0x283bb2[_0xe613('0x4a')]['id']}})[_0xe613('0x23')](handleEntityNotFound(_0x424ca6,null))[_0xe613('0x23')](removeEntity(_0x424ca6,null))[_0xe613('0x42')](handleError(_0x424ca6,null));};exports[_0xe613('0x4b')]=function(_0x2f9e75,_0x27d62e){return db[_0xe613('0x29')][_0xe613('0x24')]({'where':{'id':_0x2f9e75[_0xe613('0x2f')][_0xe613('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27d62e,0xcc))[_0xe613('0x42')](handleError(_0x27d62e,null));};exports[_0xe613('0x4d')]=function(_0x923701,_0x2f9436,_0x261a3e){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x923701['params']['id']}})['then'](handleEntityNotFound(_0x2f9436,null))[_0xe613('0x23')](function(_0x4e9618){if(_0x4e9618){return db['sequelize'][_0xe613('0x4e')](function(_0x323864){return db[_0xe613('0x29')][_0xe613('0x24')]({'where':{'CustomReportId':_0x923701[_0xe613('0x4a')]['id']},'transaction':_0x323864})[_0xe613('0x23')](function(_0x2c0a0a){var _0x4d5ee1=_[_0xe613('0x2e')](_0x923701[_0xe613('0x49')],function(_0x4c29cb){delete _0x4c29cb['id'];_0x4c29cb[_0xe613('0x4f')]=_0x923701[_0xe613('0x4a')]['id'];return _0x4c29cb;});return db['AnalyticFieldReport']['bulkCreate'](_0x4d5ee1,{'transaction':_0x323864});});})[_0xe613('0x23')](function(){return db[_0xe613('0x29')][_0xe613('0x40')]({'where':{'CustomReportId':_0x923701['params']['id']}});});}})[_0xe613('0x23')](respondWithResult(_0x2f9436,null))['catch'](handleError(_0x2f9436,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index efb25aa..551a45c 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 _0xb3d2=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields','util'];(function(_0x1ea4e6,_0x491504){var _0x3e33e4=function(_0x5bacd7){while(--_0x5bacd7){_0x1ea4e6['push'](_0x1ea4e6['shift']());}};_0x3e33e4(++_0x491504);}(_0xb3d2,0x1c1));var _0x2b3d=function(_0x3e22df,_0x37cb90){_0x3e22df=_0x3e22df-0x0;var _0x574e52=_0xb3d2[_0x3e22df];return _0x574e52;};'use strict';var _=require('lodash');var util=require(_0x2b3d('0x0'));var logger=require('../../config/logger')(_0x2b3d('0x1'));var moment=require('moment');var BPromise=require(_0x2b3d('0x2'));var rp=require(_0x2b3d('0x3'));var fs=require('fs');var path=require(_0x2b3d('0x4'));var rimraf=require(_0x2b3d('0x5'));var config=require(_0x2b3d('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x2b3d('0x7')]=function(_0x2f6381,_0x4fba23){return _0x2f6381['define'](_0x2b3d('0x8'),attributes,{'tableName':_0x2b3d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd83d=['api','bluebird','request-promise','path','./analyticFieldReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xd83d,0x7f));var _0xdd83=function(_0x4b0a6d,_0x3d4e91){_0x4b0a6d=_0x4b0a6d-0x0;var _0x2a60e2=_0xd83d[_0x4b0a6d];return _0x2a60e2;};'use strict';var _=require(_0xdd83('0x0'));var util=require(_0xdd83('0x1'));var logger=require(_0xdd83('0x2'))(_0xdd83('0x3'));var moment=require('moment');var BPromise=require(_0xdd83('0x4'));var rp=require(_0xdd83('0x5'));var fs=require('fs');var path=require(_0xdd83('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd83('0x7'));module[_0xdd83('0x8')]=function(_0x945361,_0x14b77e){return _0x945361[_0xdd83('0x9')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 76873c2..ab38537 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 _0x614f=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x99c82b,_0x57e0dd){var _0x311b7f=function(_0x1292f0){while(--_0x1292f0){_0x99c82b['push'](_0x99c82b['shift']());}};_0x311b7f(++_0x57e0dd);}(_0x614f,0x6c));var _0xf614=function(_0x3ccf38,_0x5403e3){_0x3ccf38=_0x3ccf38-0x0;var _0x40ab8a=_0x614f[_0x3ccf38];return _0x40ab8a;};'use strict';var _=require('lodash');var util=require(_0xf614('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf614('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf614('0x2'));var logger=require(_0xf614('0x3'))(_0xf614('0x4'));var config=require('../../config/environment');var jayson=require(_0xf614('0x5'));var client=jayson[_0xf614('0x6')][_0xf614('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x332eb7,_0x4f6122,_0x49c00c){return new BPromise(function(_0x2a3cf2,_0x48084f){return client['request'](_0x332eb7,_0x49c00c)[_0xf614('0x8')](function(_0x3a0007){logger[_0xf614('0x9')](_0xf614('0xa'),_0x4f6122,_0xf614('0xb'));logger[_0xf614('0xc')](_0xf614('0xd'),_0x4f6122,'request\x20sent',JSON[_0xf614('0xe')](_0x3a0007));if(_0x3a0007['error']){if(_0x3a0007[_0xf614('0xf')][_0xf614('0x10')]===0x1f4){logger[_0xf614('0xf')](_0xf614('0xa'),_0x4f6122,_0x3a0007[_0xf614('0xf')][_0xf614('0x11')]);return _0x48084f(_0x3a0007[_0xf614('0xf')][_0xf614('0x11')]);}logger[_0xf614('0xf')](_0xf614('0xa'),_0x4f6122,_0x3a0007['error'][_0xf614('0x11')]);return _0x2a3cf2(_0x3a0007['error'][_0xf614('0x11')]);}else{logger[_0xf614('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4f6122,_0xf614('0xb'));_0x2a3cf2(_0x3a0007[_0xf614('0x12')][_0xf614('0x11')]);}})[_0xf614('0x13')](function(_0x32acae){logger['error'](_0xf614('0xa'),_0x4f6122,_0x32acae);_0x48084f(_0x32acae);});});}
\ No newline at end of file
+var _0x864f=['../../config/environment','client','http','then','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x864f,0x174));var _0xf864=function(_0x72dd8,_0x27ea2c){_0x72dd8=_0x72dd8-0x0;var _0x486f5c=_0x864f[_0x72dd8];return _0x486f5c;};'use strict';var _=require(_0xf864('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf864('0x1'));var rs=require(_0xf864('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf864('0x3'))['db'];var utils=require(_0xf864('0x4'));var logger=require(_0xf864('0x5'))('rpc');var config=require(_0xf864('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf864('0x7')][_0xf864('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x72cfcc,_0x1a356e,_0x4001af){return new BPromise(function(_0x3e69ca,_0x13da42){return client['request'](_0x72cfcc,_0x4001af)[_0xf864('0x9')](function(_0x477c80){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x1a356e,'request\x20sent');logger[_0xf864('0xa')](_0xf864('0xb'),_0x1a356e,'request\x20sent',JSON[_0xf864('0xc')](_0x477c80));if(_0x477c80[_0xf864('0xd')]){if(_0x477c80[_0xf864('0xd')][_0xf864('0xe')]===0x1f4){logger[_0xf864('0xd')](_0xf864('0xf'),_0x1a356e,_0x477c80['error'][_0xf864('0x10')]);return _0x13da42(_0x477c80[_0xf864('0xd')][_0xf864('0x10')]);}logger['error'](_0xf864('0xf'),_0x1a356e,_0x477c80[_0xf864('0xd')][_0xf864('0x10')]);return _0x3e69ca(_0x477c80['error'][_0xf864('0x10')]);}else{logger[_0xf864('0x11')](_0xf864('0xf'),_0x1a356e,_0xf864('0x12'));_0x3e69ca(_0x477c80[_0xf864('0x13')][_0xf864('0x10')]);}})[_0xf864('0x14')](function(_0x3abc96){logger[_0xf864('0xd')](_0xf864('0xf'),_0x1a356e,_0x3abc96);_0x13da42(_0x3abc96);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index df6dc6b..91488bd 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(_0x81b075,_0x57322d){var _0x5703d8=function(_0x2a8d56){while(--_0x2a8d56){_0x81b075['push'](_0x81b075['shift']());}};_0x5703d8(++_0x57322d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x2d3487,_0xa20979){var _0x27041d=function(_0x7133a7){while(--_0x7133a7){_0x2d3487['push'](_0x2d3487['shift']());}};_0x27041d(++_0xa20979);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 80e405d..8f054ce 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 _0x112a=['name','TEXT','sequelize','exports','STRING'];(function(_0xd16b08,_0x4f18ef){var _0x279475=function(_0x5dcfa2){while(--_0x5dcfa2){_0xd16b08['push'](_0xd16b08['shift']());}};_0x279475(++_0x4f18ef);}(_0x112a,0x115));var _0xa112=function(_0x4224fa,_0x399c8a){_0x4224fa=_0x4224fa-0x0;var _0x19aca4=_0x112a[_0x4224fa];return _0x19aca4;};'use strict';var Sequelize=require(_0xa112('0x0'));module[_0xa112('0x1')]={'name':{'type':Sequelize[_0xa112('0x2')],'allowNull':![],'unique':_0xa112('0x3')},'table':{'type':Sequelize[_0xa112('0x2')]},'metric':{'type':Sequelize[_0xa112('0x4')]},'description':{'type':Sequelize[_0xa112('0x2')]}};
\ No newline at end of file
+var _0xffe1=['exports','name','TEXT','sequelize'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0xffe1,0x187));var _0x1ffe=function(_0x2050d9,_0xf739fe){_0x2050d9=_0x2050d9-0x0;var _0x3d368a=_0xffe1[_0x2050d9];return _0x3d368a;};'use strict';var Sequelize=require(_0x1ffe('0x0'));module[_0x1ffe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1ffe('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1ffe('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index af8d6ac..cddaf9e 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 _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x26f08f,_0x4fec4a){var _0x1e49a5=function(_0xeb935d){while(--_0xeb935d){_0x26f08f['push'](_0x26f08f['shift']());}};_0x1e49a5(++_0x4fec4a);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));};
\ No newline at end of file
+var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xcc0a4d,_0xf9b91){var _0x510611=function(_0x3c0166){while(--_0x3c0166){_0xcc0a4d['push'](_0xcc0a4d['shift']());}};_0x510611(++_0xf9b91);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xf0517d,_0x250d56){_0xf0517d=_0xf0517d-0x0;var _0x518dbf=_0xdbf5[_0xf0517d];return _0x518dbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e54b32f..f79ef63 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 _0x0967=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment'];(function(_0x31deea,_0x32618c){var _0x1c7524=function(_0x24341f){while(--_0x24341f){_0x31deea['push'](_0x31deea['shift']());}};_0x1c7524(++_0x32618c);}(_0x0967,0x100));var _0x7096=function(_0x432d01,_0x95906d){_0x432d01=_0x432d01-0x0;var _0x1f3a5c=_0x0967[_0x432d01];return _0x1f3a5c;};'use strict';var _=require(_0x7096('0x0'));var util=require('util');var logger=require(_0x7096('0x1'))(_0x7096('0x2'));var moment=require(_0x7096('0x3'));var BPromise=require(_0x7096('0x4'));var rp=require(_0x7096('0x5'));var fs=require('fs');var path=require(_0x7096('0x6'));var rimraf=require(_0x7096('0x7'));var config=require(_0x7096('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x7096('0x9')]=function(_0x10181c,_0xadd502){return _0x10181c[_0x7096('0xa')](_0x7096('0xb'),attributes,{'tableName':_0x7096('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1fc=['exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3d32df,_0x284b12){var _0xed3f9b=function(_0x3ddf87){while(--_0x3ddf87){_0x3d32df['push'](_0x3d32df['shift']());}};_0xed3f9b(++_0x284b12);}(_0xc1fc,0x93));var _0xcc1f=function(_0x76d683,_0xabab61){_0x76d683=_0x76d683-0x0;var _0x4b9df8=_0xc1fc[_0x76d683];return _0x4b9df8;};'use strict';var _=require('lodash');var util=require(_0xcc1f('0x0'));var logger=require(_0xcc1f('0x1'))('api');var moment=require(_0xcc1f('0x2'));var BPromise=require(_0xcc1f('0x3'));var rp=require(_0xcc1f('0x4'));var fs=require('fs');var path=require(_0xcc1f('0x5'));var rimraf=require(_0xcc1f('0x6'));var config=require(_0xcc1f('0x7'));var attributes=require(_0xcc1f('0x8'));module[_0xcc1f('0x9')]=function(_0x493a97,_0x5f448b){return _0x493a97[_0xcc1f('0xa')](_0xcc1f('0xb'),attributes,{'tableName':_0xcc1f('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 cafc4e7..427d14a 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 _0x66c0=['stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x5a8e67,_0x22e19d){var _0x3c1602=function(_0x5408ef){while(--_0x5408ef){_0x5a8e67['push'](_0x5a8e67['shift']());}};_0x3c1602(++_0x22e19d);}(_0x66c0,0x123));var _0x066c=function(_0x2e8e03,_0xc256f8){_0x2e8e03=_0x2e8e03-0x0;var _0x531fad=_0x66c0[_0x2e8e03];return _0x531fad;};'use strict';var _=require(_0x066c('0x0'));var util=require('util');var moment=require(_0x066c('0x1'));var BPromise=require(_0x066c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x066c('0x3'));var db=require(_0x066c('0x4'))['db'];var utils=require(_0x066c('0x5'));var logger=require(_0x066c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x066c('0x7'));var client=jayson[_0x066c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x326863,_0x306807,_0x2d1053){return new BPromise(function(_0x9e422a,_0x2a354f){return client['request'](_0x326863,_0x2d1053)['then'](function(_0x22ed38){logger[_0x066c('0x9')](_0x066c('0xa'),_0x306807,_0x066c('0xb'));logger['debug'](_0x066c('0xc'),_0x306807,_0x066c('0xb'),JSON[_0x066c('0xd')](_0x22ed38));if(_0x22ed38[_0x066c('0xe')]){if(_0x22ed38[_0x066c('0xe')][_0x066c('0xf')]===0x1f4){logger[_0x066c('0xe')](_0x066c('0xa'),_0x306807,_0x22ed38[_0x066c('0xe')]['message']);return _0x2a354f(_0x22ed38[_0x066c('0xe')][_0x066c('0x10')]);}logger[_0x066c('0xe')](_0x066c('0xa'),_0x306807,_0x22ed38[_0x066c('0xe')][_0x066c('0x10')]);return _0x9e422a(_0x22ed38['error'][_0x066c('0x10')]);}else{logger[_0x066c('0x9')](_0x066c('0xa'),_0x306807,_0x066c('0xb'));_0x9e422a(_0x22ed38[_0x066c('0x11')][_0x066c('0x10')]);}})[_0x066c('0x12')](function(_0x215c30){logger[_0x066c('0xe')](_0x066c('0xa'),_0x306807,_0x215c30);_0x2a354f(_0x215c30);});});}
\ No newline at end of file
+var _0x25f0=['http','request','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x2f8ed8,_0x37599b){var _0x5be602=function(_0x189b5f){while(--_0x189b5f){_0x2f8ed8['push'](_0x2f8ed8['shift']());}};_0x5be602(++_0x37599b);}(_0x25f0,0xc7));var _0x025f=function(_0x1b75d0,_0x514923){_0x1b75d0=_0x1b75d0-0x0;var _0x12f0c8=_0x25f0[_0x1b75d0];return _0x12f0c8;};'use strict';var _=require('lodash');var util=require(_0x025f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x025f('0x1'));var fs=require('fs');var Redis=require(_0x025f('0x2'));var db=require(_0x025f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x025f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x025f('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5f5a6f,_0x3acf3c,_0x3c4496){return new BPromise(function(_0x31ad36,_0x33fcfb){return client[_0x025f('0x6')](_0x5f5a6f,_0x3c4496)['then'](function(_0x5534d3){logger[_0x025f('0x7')](_0x025f('0x8'),_0x3acf3c,'request\x20sent');logger[_0x025f('0x9')](_0x025f('0xa'),_0x3acf3c,_0x025f('0xb'),JSON[_0x025f('0xc')](_0x5534d3));if(_0x5534d3[_0x025f('0xd')]){if(_0x5534d3[_0x025f('0xd')]['code']===0x1f4){logger['error'](_0x025f('0x8'),_0x3acf3c,_0x5534d3[_0x025f('0xd')][_0x025f('0xe')]);return _0x33fcfb(_0x5534d3[_0x025f('0xd')]['message']);}logger[_0x025f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3acf3c,_0x5534d3[_0x025f('0xd')][_0x025f('0xe')]);return _0x31ad36(_0x5534d3[_0x025f('0xd')][_0x025f('0xe')]);}else{logger[_0x025f('0x7')](_0x025f('0x8'),_0x3acf3c,'request\x20sent');_0x31ad36(_0x5534d3[_0x025f('0xf')][_0x025f('0xe')]);}})[_0x025f('0x10')](function(_0xa1ed27){logger[_0x025f('0xd')](_0x025f('0x8'),_0x3acf3c,_0xa1ed27);_0x33fcfb(_0xa1ed27);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 486ed0b..07ced1a 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 _0xa7e6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xa7e6,0x74));var _0x6a7e=function(_0x3a9637,_0x51f973){_0x3a9637=_0x3a9637-0x0;var _0xf32cc9=_0xa7e6[_0x3a9637];return _0xf32cc9;};'use strict';var multer=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var path=require(_0x6a7e('0x2'));var timeout=require(_0x6a7e('0x3'));var express=require(_0x6a7e('0x4'));var router=express[_0x6a7e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6a7e('0x6'));var interaction=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var controller=require(_0x6a7e('0x9'));router[_0x6a7e('0xa')]('/',auth['isAuthenticated'](),controller[_0x6a7e('0xb')]);router[_0x6a7e('0xa')](_0x6a7e('0xc'),auth[_0x6a7e('0xd')](),controller[_0x6a7e('0xe')]);router[_0x6a7e('0xf')]('/',auth[_0x6a7e('0xd')](),controller[_0x6a7e('0x10')]);router[_0x6a7e('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x6a7e('0xc'),auth[_0x6a7e('0xd')](),controller[_0x6a7e('0x12')]);module[_0x6a7e('0x13')]=router;
\ No newline at end of file
+var _0x3663=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0x3663,0x1cf));var _0x3366=function(_0x58f911,_0x28ecb4){_0x58f911=_0x58f911-0x0;var _0x12b4ee=_0x3663[_0x58f911];return _0x12b4ee;};'use strict';var multer=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var path=require(_0x3366('0x2'));var timeout=require('connect-timeout');var express=require(_0x3366('0x3'));var router=express[_0x3366('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3366('0x5'));var interaction=require(_0x3366('0x6'));var config=require(_0x3366('0x7'));var controller=require(_0x3366('0x8'));router[_0x3366('0x9')]('/',auth['isAuthenticated'](),controller[_0x3366('0xa')]);router[_0x3366('0x9')]('/:id',auth[_0x3366('0xb')](),controller[_0x3366('0xc')]);router[_0x3366('0xd')]('/',auth['isAuthenticated'](),controller[_0x3366('0xe')]);router[_0x3366('0xf')](_0x3366('0x10'),auth['isAuthenticated'](),controller[_0x3366('0x11')]);router[_0x3366('0x12')](_0x3366('0x10'),auth[_0x3366('0xb')](),controller[_0x3366('0x13')]);module[_0x3366('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 1d741a6..57ee5ff 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 _0x411c=['sequelize','TEXT'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x411c,0x1ca));var _0xc411=function(_0x655ef8,_0x23568c){_0x655ef8=_0x655ef8-0x0;var _0x5349ce=_0x411c[_0x655ef8];return _0x5349ce;};'use strict';var Sequelize=require(_0xc411('0x0'));module['exports']={'tree':{'type':Sequelize[_0xc411('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x477d=['exports','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x477d,0x146));var _0xd477=function(_0x3169cd,_0x448d94){_0x3169cd=_0x3169cd-0x0;var _0xd24ac=_0x477d[_0x3169cd];return _0xd24ac;};'use strict';var Sequelize=require(_0xd477('0x0'));module[_0xd477('0x1')]={'tree':{'type':Sequelize[_0xd477('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 0fa9057..f044216 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 _0x41e7=['save','update','then','destroy','sendStatus','error','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','show','params','length','includeAll','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0x41e7,0xf1));var _0x741e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x41e7[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x741e('0x0'));var rimraf=require(_0x741e('0x1'));var zipdir=require(_0x741e('0x2'));var jsonpatch=require(_0x741e('0x3'));var rp=require(_0x741e('0x4'));var moment=require('moment');var BPromise=require(_0x741e('0x5'));var Mustache=require('mustache');var util=require(_0x741e('0x6'));var path=require(_0x741e('0x7'));var sox=require(_0x741e('0x8'));var csv=require(_0x741e('0x9'));var ejs=require(_0x741e('0xa'));var fs=require('fs');var fs_extra=require(_0x741e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x741e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x741e('0x9'));var querystring=require(_0x741e('0xd'));var Papa=require('papaparse');var Redis=require(_0x741e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x741e('0xf'));var logger=require(_0x741e('0x10'))('api');var utils=require(_0x741e('0x11'));var config=require(_0x741e('0x12'));var licenseUtil=require(_0x741e('0x13'));var db=require(_0x741e('0x14'))['db'];function respondWithStatusCode(_0x3dada6,_0xd2f8dd){_0xd2f8dd=_0xd2f8dd||0xcc;return function(_0x11bdf7){if(_0x11bdf7){return _0x3dada6['sendStatus'](_0xd2f8dd);}return _0x3dada6[_0x741e('0x15')](_0xd2f8dd)[_0x741e('0x16')]();};}function respondWithResult(_0x1f2094,_0x1046a4){_0x1046a4=_0x1046a4||0xc8;return function(_0x4f8961){if(_0x4f8961){return _0x1f2094[_0x741e('0x15')](_0x1046a4)[_0x741e('0x17')](_0x4f8961);}};}function respondWithFilteredResult(_0x12e169,_0x492694){return function(_0x385497){if(_0x385497){var _0x4e1dd5=typeof _0x492694[_0x741e('0x18')]===_0x741e('0x19')&&typeof _0x492694[_0x741e('0x1a')]==='undefined';var _0x32a91a=_0x385497['count'];var _0x5817f0=_0x4e1dd5?0x0:_0x492694[_0x741e('0x18')];var _0x33e086=_0x4e1dd5?_0x385497[_0x741e('0x1b')]:_0x492694['offset']+_0x492694[_0x741e('0x1a')];var _0x129b4c;if(_0x33e086>=_0x32a91a){_0x33e086=_0x32a91a;_0x129b4c=0xc8;}else{_0x129b4c=0xce;}_0x12e169[_0x741e('0x15')](_0x129b4c);return _0x12e169['set'](_0x741e('0x1c'),_0x5817f0+'-'+_0x33e086+'/'+_0x32a91a)[_0x741e('0x17')](_0x385497);}return null;};}function patchUpdates(_0xcdf3ac){return function(_0xa7c93e){try{jsonpatch[_0x741e('0x1d')](_0xa7c93e,_0xcdf3ac,!![]);}catch(_0x796df){return BPromise[_0x741e('0x1e')](_0x796df);}return _0xa7c93e[_0x741e('0x1f')]();};}function saveUpdates(_0x3bd2d8,_0x32ee48){return function(_0x57acc3){if(_0x57acc3){return _0x57acc3[_0x741e('0x20')](_0x3bd2d8)[_0x741e('0x21')](function(_0x480a56){return _0x480a56;});}return null;};}function removeEntity(_0x3c4f0f,_0x4b57de){return function(_0x9f9e40){if(_0x9f9e40){return _0x9f9e40[_0x741e('0x22')]()[_0x741e('0x21')](function(){_0x3c4f0f[_0x741e('0x15')](0xcc)[_0x741e('0x16')]();});}};}function handleEntityNotFound(_0xebe1a5,_0x13fa04){return function(_0x2f92ca){if(!_0x2f92ca){_0xebe1a5[_0x741e('0x23')](0x194);}return _0x2f92ca;};}function handleError(_0x5ccb23,_0x376276){_0x376276=_0x376276||0x1f4;return function(_0x2c7a8c){logger[_0x741e('0x24')](_0x2c7a8c['stack']);if(_0x2c7a8c[_0x741e('0x25')]){delete _0x2c7a8c[_0x741e('0x25')];}_0x5ccb23[_0x741e('0x15')](_0x376276)['send'](_0x2c7a8c);};}exports['index']=function(_0x158915,_0x37cd1f){var _0x2eb48f={},_0x32ad44={},_0x2883d4={'count':0x0,'rows':[]};var _0x40ff51=_[_0x741e('0x26')](db[_0x741e('0x27')][_0x741e('0x28')],function(_0x3d68ce){return{'name':_0x3d68ce[_0x741e('0x29')],'type':_0x3d68ce[_0x741e('0x2a')]['key']};});_0x32ad44[_0x741e('0x2b')]=_[_0x741e('0x26')](_0x40ff51,'name');_0x32ad44[_0x741e('0x2c')]=_[_0x741e('0x2d')](_0x158915[_0x741e('0x2c')]);_0x32ad44[_0x741e('0x2e')]=_[_0x741e('0x2f')](_0x32ad44['model'],_0x32ad44[_0x741e('0x2c')]);_0x2eb48f[_0x741e('0x30')]=_[_0x741e('0x2f')](_0x32ad44[_0x741e('0x2b')],qs[_0x741e('0x31')](_0x158915[_0x741e('0x2c')][_0x741e('0x31')]));_0x2eb48f['attributes']=_0x2eb48f['attributes']['length']?_0x2eb48f['attributes']:_0x32ad44[_0x741e('0x2b')];if(!_0x158915[_0x741e('0x2c')][_0x741e('0x32')](_0x741e('0x33'))){_0x2eb48f[_0x741e('0x1a')]=qs[_0x741e('0x1a')](_0x158915[_0x741e('0x2c')][_0x741e('0x1a')]);_0x2eb48f['offset']=qs[_0x741e('0x18')](_0x158915['query'][_0x741e('0x18')]);}_0x2eb48f[_0x741e('0x34')]=qs[_0x741e('0x35')](_0x158915[_0x741e('0x2c')][_0x741e('0x35')]);_0x2eb48f[_0x741e('0x36')]=qs['filters'](_['pick'](_0x158915[_0x741e('0x2c')],_0x32ad44['filters']),_0x40ff51);if(_0x158915[_0x741e('0x2c')][_0x741e('0x37')]){_0x2eb48f[_0x741e('0x36')]=_['merge'](_0x2eb48f[_0x741e('0x36')],{'$or':_[_0x741e('0x26')](_0x40ff51,function(_0x2eb4e5){if(_0x2eb4e5['type']!==_0x741e('0x38')){var _0x44c56e={};_0x44c56e[_0x2eb4e5[_0x741e('0x25')]]={'$like':'%'+_0x158915[_0x741e('0x2c')][_0x741e('0x37')]+'%'};return _0x44c56e;}})});}_0x2eb48f=_[_0x741e('0x39')]({},_0x2eb48f,_0x158915[_0x741e('0x3a')]);var _0x304be4={'where':_0x2eb48f[_0x741e('0x36')]};return db[_0x741e('0x27')][_0x741e('0x1b')](_0x304be4)['then'](function(_0x250e9d){_0x2883d4[_0x741e('0x1b')]=_0x250e9d;if(_0x158915['query']['includeAll']){_0x2eb48f[_0x741e('0x3b')]=[{'all':!![]}];}return db[_0x741e('0x27')]['findAll'](_0x2eb48f);})['then'](function(_0x1276cb){_0x2883d4[_0x741e('0x3c')]=_0x1276cb;return _0x2883d4;})[_0x741e('0x21')](respondWithFilteredResult(_0x37cd1f,_0x2eb48f))[_0x741e('0x3d')](handleError(_0x37cd1f,null));};exports[_0x741e('0x3e')]=function(_0x4c35f9,_0x14c161){var _0x14065f={'raw':!![],'where':{'id':_0x4c35f9[_0x741e('0x3f')]['id']}},_0x38115e={};_0x38115e[_0x741e('0x2b')]=_[_0x741e('0x2d')](db[_0x741e('0x27')]['rawAttributes']);_0x38115e[_0x741e('0x2c')]=_[_0x741e('0x2d')](_0x4c35f9['query']);_0x38115e[_0x741e('0x2e')]=_['intersection'](_0x38115e[_0x741e('0x2b')],_0x38115e[_0x741e('0x2c')]);_0x14065f['attributes']=_[_0x741e('0x2f')](_0x38115e['model'],qs[_0x741e('0x31')](_0x4c35f9['query'][_0x741e('0x31')]));_0x14065f[_0x741e('0x30')]=_0x14065f[_0x741e('0x30')][_0x741e('0x40')]?_0x14065f[_0x741e('0x30')]:_0x38115e[_0x741e('0x2b')];if(_0x4c35f9[_0x741e('0x2c')][_0x741e('0x41')]){_0x14065f[_0x741e('0x3b')]=[{'all':!![]}];}_0x14065f=_[_0x741e('0x39')]({},_0x14065f,_0x4c35f9[_0x741e('0x3a')]);return db[_0x741e('0x27')]['find'](_0x14065f)['then'](handleEntityNotFound(_0x14c161,null))['then'](respondWithResult(_0x14c161,null))[_0x741e('0x3d')](handleError(_0x14c161,null));};exports[_0x741e('0x42')]=function(_0x2944fa,_0x40443e){return db[_0x741e('0x27')][_0x741e('0x42')](_0x2944fa[_0x741e('0x43')],{})[_0x741e('0x21')](respondWithResult(_0x40443e,0xc9))[_0x741e('0x3d')](handleError(_0x40443e,null));};exports[_0x741e('0x20')]=function(_0x49da77,_0x35336b){if(_0x49da77[_0x741e('0x43')]['id']){delete _0x49da77[_0x741e('0x43')]['id'];}return db[_0x741e('0x27')]['find']({'where':{'id':_0x49da77[_0x741e('0x3f')]['id']}})[_0x741e('0x21')](handleEntityNotFound(_0x35336b,null))[_0x741e('0x21')](saveUpdates(_0x49da77[_0x741e('0x43')],null))[_0x741e('0x21')](respondWithResult(_0x35336b,null))[_0x741e('0x3d')](handleError(_0x35336b,null));};exports[_0x741e('0x22')]=function(_0x18df82,_0x3df653){return db[_0x741e('0x27')]['find']({'where':{'id':_0x18df82[_0x741e('0x3f')]['id']}})[_0x741e('0x21')](handleEntityNotFound(_0x3df653,null))['then'](removeEntity(_0x3df653,null))[_0x741e('0x3d')](handleError(_0x3df653,null));};
\ No newline at end of file
+var _0x83f9=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto'];(function(_0xfce77c,_0x523d35){var _0x13345a=function(_0x53adcf){while(--_0x53adcf){_0xfce77c['push'](_0xfce77c['shift']());}};_0x13345a(++_0x523d35);}(_0x83f9,0x1c7));var _0x983f=function(_0x2430a6,_0x3303e9){_0x2430a6=_0x2430a6-0x0;var _0x4de8b3=_0x83f9[_0x2430a6];return _0x4de8b3;};'use strict';var emlformat=require(_0x983f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x983f('0x1'));var jsonpatch=require(_0x983f('0x2'));var rp=require(_0x983f('0x3'));var moment=require(_0x983f('0x4'));var BPromise=require(_0x983f('0x5'));var Mustache=require(_0x983f('0x6'));var util=require(_0x983f('0x7'));var path=require(_0x983f('0x8'));var sox=require('sox');var csv=require(_0x983f('0x9'));var ejs=require(_0x983f('0xa'));var fs=require('fs');var fs_extra=require(_0x983f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x983f('0xc'));var jsforce=require(_0x983f('0xd'));var deskjs=require(_0x983f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x983f('0xf'));var Papa=require(_0x983f('0x10'));var Redis=require(_0x983f('0x11'));var authService=require(_0x983f('0x12'));var qs=require(_0x983f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x983f('0x14'));var logger=require(_0x983f('0x15'))('api');var utils=require(_0x983f('0x16'));var config=require(_0x983f('0x17'));var licenseUtil=require(_0x983f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b1f90,_0x348d7b){_0x348d7b=_0x348d7b||0xcc;return function(_0x11c986){if(_0x11c986){return _0x1b1f90[_0x983f('0x19')](_0x348d7b);}return _0x1b1f90[_0x983f('0x1a')](_0x348d7b)['end']();};}function respondWithResult(_0xa6e84a,_0x4406e5){_0x4406e5=_0x4406e5||0xc8;return function(_0x45fd6e){if(_0x45fd6e){return _0xa6e84a[_0x983f('0x1a')](_0x4406e5)[_0x983f('0x1b')](_0x45fd6e);}};}function respondWithFilteredResult(_0x3a50dc,_0x270821){return function(_0x1104e3){if(_0x1104e3){var _0x5a691a=typeof _0x270821[_0x983f('0x1c')]===_0x983f('0x1d')&&typeof _0x270821[_0x983f('0x1e')]===_0x983f('0x1d');var _0x413aed=_0x1104e3['count'];var _0x2d1b6b=_0x5a691a?0x0:_0x270821[_0x983f('0x1c')];var _0x4f0dcb=_0x5a691a?_0x1104e3[_0x983f('0x1f')]:_0x270821['offset']+_0x270821[_0x983f('0x1e')];var _0x41c41c;if(_0x4f0dcb>=_0x413aed){_0x4f0dcb=_0x413aed;_0x41c41c=0xc8;}else{_0x41c41c=0xce;}_0x3a50dc['status'](_0x41c41c);return _0x3a50dc[_0x983f('0x20')](_0x983f('0x21'),_0x2d1b6b+'-'+_0x4f0dcb+'/'+_0x413aed)[_0x983f('0x1b')](_0x1104e3);}return null;};}function patchUpdates(_0xcf9da9){return function(_0x18ef76){try{jsonpatch[_0x983f('0x22')](_0x18ef76,_0xcf9da9,!![]);}catch(_0xed423c){return BPromise[_0x983f('0x23')](_0xed423c);}return _0x18ef76[_0x983f('0x24')]();};}function saveUpdates(_0x4d763e,_0x526cbb){return function(_0x44c419){if(_0x44c419){return _0x44c419[_0x983f('0x25')](_0x4d763e)['then'](function(_0x4c91b3){return _0x4c91b3;});}return null;};}function removeEntity(_0x4bd279,_0x35f45f){return function(_0x380a86){if(_0x380a86){return _0x380a86[_0x983f('0x26')]()[_0x983f('0x27')](function(){_0x4bd279[_0x983f('0x1a')](0xcc)[_0x983f('0x28')]();});}};}function handleEntityNotFound(_0x43cfe3,_0x5217d2){return function(_0x23efea){if(!_0x23efea){_0x43cfe3[_0x983f('0x19')](0x194);}return _0x23efea;};}function handleError(_0x43c964,_0x495f73){_0x495f73=_0x495f73||0x1f4;return function(_0x262dab){logger[_0x983f('0x29')](_0x262dab[_0x983f('0x2a')]);if(_0x262dab[_0x983f('0x2b')]){delete _0x262dab[_0x983f('0x2b')];}_0x43c964[_0x983f('0x1a')](_0x495f73)[_0x983f('0x2c')](_0x262dab);};}exports[_0x983f('0x2d')]=function(_0x4ccb95,_0x404960){var _0x4b8004={},_0x18acdb={},_0x444161={'count':0x0,'rows':[]};var _0x1215ea=_[_0x983f('0x2e')](db[_0x983f('0x2f')][_0x983f('0x30')],function(_0x578078){return{'name':_0x578078[_0x983f('0x31')],'type':_0x578078[_0x983f('0x32')]['key']};});_0x18acdb[_0x983f('0x33')]=_['map'](_0x1215ea,_0x983f('0x2b'));_0x18acdb['query']=_[_0x983f('0x34')](_0x4ccb95['query']);_0x18acdb[_0x983f('0x35')]=_[_0x983f('0x36')](_0x18acdb[_0x983f('0x33')],_0x18acdb[_0x983f('0x37')]);_0x4b8004[_0x983f('0x38')]=_[_0x983f('0x36')](_0x18acdb[_0x983f('0x33')],qs[_0x983f('0x39')](_0x4ccb95[_0x983f('0x37')][_0x983f('0x39')]));_0x4b8004[_0x983f('0x38')]=_0x4b8004[_0x983f('0x38')][_0x983f('0x3a')]?_0x4b8004[_0x983f('0x38')]:_0x18acdb[_0x983f('0x33')];if(!_0x4ccb95[_0x983f('0x37')][_0x983f('0x3b')](_0x983f('0x3c'))){_0x4b8004[_0x983f('0x1e')]=qs[_0x983f('0x1e')](_0x4ccb95['query'][_0x983f('0x1e')]);_0x4b8004[_0x983f('0x1c')]=qs['offset'](_0x4ccb95['query'][_0x983f('0x1c')]);}_0x4b8004[_0x983f('0x3d')]=qs[_0x983f('0x3e')](_0x4ccb95[_0x983f('0x37')][_0x983f('0x3e')]);_0x4b8004[_0x983f('0x3f')]=qs[_0x983f('0x35')](_[_0x983f('0x40')](_0x4ccb95[_0x983f('0x37')],_0x18acdb[_0x983f('0x35')]),_0x1215ea);if(_0x4ccb95[_0x983f('0x37')][_0x983f('0x41')]){_0x4b8004[_0x983f('0x3f')]=_[_0x983f('0x42')](_0x4b8004[_0x983f('0x3f')],{'$or':_[_0x983f('0x2e')](_0x1215ea,function(_0x435918){if(_0x435918[_0x983f('0x32')]!==_0x983f('0x43')){var _0xef2b6e={};_0xef2b6e[_0x435918[_0x983f('0x2b')]]={'$like':'%'+_0x4ccb95[_0x983f('0x37')]['filter']+'%'};return _0xef2b6e;}})});}_0x4b8004=_[_0x983f('0x42')]({},_0x4b8004,_0x4ccb95[_0x983f('0x44')]);var _0x5624ed={'where':_0x4b8004[_0x983f('0x3f')]};return db['AnalyticTreeReport']['count'](_0x5624ed)['then'](function(_0x3a2ccb){_0x444161['count']=_0x3a2ccb;if(_0x4ccb95['query'][_0x983f('0x45')]){_0x4b8004[_0x983f('0x46')]=[{'all':!![]}];}return db[_0x983f('0x2f')]['findAll'](_0x4b8004);})['then'](function(_0x165bd7){_0x444161[_0x983f('0x47')]=_0x165bd7;return _0x444161;})['then'](respondWithFilteredResult(_0x404960,_0x4b8004))[_0x983f('0x48')](handleError(_0x404960,null));};exports[_0x983f('0x49')]=function(_0x14859e,_0x5585b9){var _0x2fe8db={'raw':!![],'where':{'id':_0x14859e[_0x983f('0x4a')]['id']}},_0x461e23={};_0x461e23[_0x983f('0x33')]=_[_0x983f('0x34')](db[_0x983f('0x2f')][_0x983f('0x30')]);_0x461e23['query']=_[_0x983f('0x34')](_0x14859e[_0x983f('0x37')]);_0x461e23[_0x983f('0x35')]=_[_0x983f('0x36')](_0x461e23[_0x983f('0x33')],_0x461e23[_0x983f('0x37')]);_0x2fe8db[_0x983f('0x38')]=_[_0x983f('0x36')](_0x461e23[_0x983f('0x33')],qs[_0x983f('0x39')](_0x14859e[_0x983f('0x37')]['fields']));_0x2fe8db['attributes']=_0x2fe8db[_0x983f('0x38')][_0x983f('0x3a')]?_0x2fe8db['attributes']:_0x461e23[_0x983f('0x33')];if(_0x14859e[_0x983f('0x37')]['includeAll']){_0x2fe8db[_0x983f('0x46')]=[{'all':!![]}];}_0x2fe8db=_[_0x983f('0x42')]({},_0x2fe8db,_0x14859e[_0x983f('0x44')]);return db[_0x983f('0x2f')][_0x983f('0x4b')](_0x2fe8db)[_0x983f('0x27')](handleEntityNotFound(_0x5585b9,null))[_0x983f('0x27')](respondWithResult(_0x5585b9,null))['catch'](handleError(_0x5585b9,null));};exports[_0x983f('0x4c')]=function(_0x5f11ab,_0x4012b9){return db[_0x983f('0x2f')][_0x983f('0x4c')](_0x5f11ab[_0x983f('0x4d')],{})[_0x983f('0x27')](respondWithResult(_0x4012b9,0xc9))[_0x983f('0x48')](handleError(_0x4012b9,null));};exports[_0x983f('0x25')]=function(_0x359c7a,_0x5ac2a5){if(_0x359c7a[_0x983f('0x4d')]['id']){delete _0x359c7a[_0x983f('0x4d')]['id'];}return db[_0x983f('0x2f')][_0x983f('0x4b')]({'where':{'id':_0x359c7a['params']['id']}})['then'](handleEntityNotFound(_0x5ac2a5,null))[_0x983f('0x27')](saveUpdates(_0x359c7a['body'],null))[_0x983f('0x27')](respondWithResult(_0x5ac2a5,null))[_0x983f('0x48')](handleError(_0x5ac2a5,null));};exports[_0x983f('0x26')]=function(_0x4614c4,_0x47ffcc){return db['AnalyticTreeReport'][_0x983f('0x4b')]({'where':{'id':_0x4614c4[_0x983f('0x4a')]['id']}})[_0x983f('0x27')](handleEntityNotFound(_0x47ffcc,null))[_0x983f('0x27')](removeEntity(_0x47ffcc,null))[_0x983f('0x48')](handleError(_0x47ffcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 04261ed..376fe6a 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 _0x4ab4=['analytics_report_trees','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x164129,_0x5135b6){var _0x2a3ee0=function(_0x593c23){while(--_0x593c23){_0x164129['push'](_0x164129['shift']());}};_0x2a3ee0(++_0x5135b6);}(_0x4ab4,0xeb));var _0x44ab=function(_0x58ad04,_0x3347b9){_0x58ad04=_0x58ad04-0x0;var _0x196484=_0x4ab4[_0x58ad04];return _0x196484;};'use strict';var _=require(_0x44ab('0x0'));var util=require('util');var logger=require(_0x44ab('0x1'))('api');var moment=require(_0x44ab('0x2'));var BPromise=require(_0x44ab('0x3'));var rp=require(_0x44ab('0x4'));var fs=require('fs');var path=require(_0x44ab('0x5'));var rimraf=require(_0x44ab('0x6'));var config=require(_0x44ab('0x7'));var attributes=require(_0x44ab('0x8'));module[_0x44ab('0x9')]=function(_0x158b8a,_0xec4652){return _0x158b8a[_0x44ab('0xa')](_0x44ab('0xb'),attributes,{'tableName':_0x44ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06d2=['api','moment','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x58462a,_0x1ce850){var _0x2931ef=function(_0x4a3185){while(--_0x4a3185){_0x58462a['push'](_0x58462a['shift']());}};_0x2931ef(++_0x1ce850);}(_0x06d2,0xb4));var _0x206d=function(_0x289673,_0x57183a){_0x289673=_0x289673-0x0;var _0x21274e=_0x06d2[_0x289673];return _0x21274e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x206d('0x0'));var moment=require(_0x206d('0x1'));var BPromise=require('bluebird');var rp=require(_0x206d('0x2'));var fs=require('fs');var path=require(_0x206d('0x3'));var rimraf=require('rimraf');var config=require(_0x206d('0x4'));var attributes=require(_0x206d('0x5'));module[_0x206d('0x6')]=function(_0x20288e,_0x48e658){return _0x20288e[_0x206d('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x206d('0x8'),'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 7192bbc..ce80f73 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x4f0fb9,_0x1ff1e0){var _0x545a71=function(_0x56ca60){while(--_0x56ca60){_0x4f0fb9['push'](_0x4f0fb9['shift']());}};_0x545a71(++_0x1ff1e0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+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(_0x4b4290,_0x1726d9){var _0xbde1e0=function(_0x29ef39){while(--_0x29ef39){_0x4b4290['push'](_0x4b4290['shift']());}};_0xbde1e0(++_0x1726d9);}(_0x1261,0x144));var _0x1126=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0x1261[_0x42d1f8];return _0x40d234;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 0b25f4d..edb493d 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 _0x5958=['../../components/auth/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0x5958,0xc0));var _0x8595=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x5958[_0x1646fa];return _0x5a47a5;};'use strict';var multer=require('multer');var util=require(_0x8595('0x0'));var path=require(_0x8595('0x1'));var timeout=require(_0x8595('0x2'));var express=require(_0x8595('0x3'));var router=express[_0x8595('0x4')]();var fs_extra=require(_0x8595('0x5'));var auth=require(_0x8595('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8595('0x7'));router[_0x8595('0x8')]('/',auth[_0x8595('0x9')](),controller[_0x8595('0xa')]);router[_0x8595('0x8')](_0x8595('0xb'),auth[_0x8595('0x9')](),controller[_0x8595('0xc')]);router[_0x8595('0xd')]('/',auth['isAuthenticated'](),controller[_0x8595('0xe')]);router['put'](_0x8595('0xb'),auth['isAuthenticated'](),controller[_0x8595('0xf')]);router[_0x8595('0x10')]('/:id',auth[_0x8595('0x9')](),controller[_0x8595('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x1e41=['index','/:id','post','create','put','delete','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2c8a0a,_0x5456a5){var _0x48a7d9=function(_0x2f360b){while(--_0x2f360b){_0x2c8a0a['push'](_0x2c8a0a['shift']());}};_0x48a7d9(++_0x5456a5);}(_0x1e41,0x151));var _0x11e4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1e41[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x11e4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x11e4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x11e4('0x2'));var auth=require(_0x11e4('0x3'));var interaction=require(_0x11e4('0x4'));var config=require(_0x11e4('0x5'));var controller=require('./analyticTreeReport.controller');router[_0x11e4('0x6')]('/',auth[_0x11e4('0x7')](),controller[_0x11e4('0x8')]);router[_0x11e4('0x6')](_0x11e4('0x9'),auth[_0x11e4('0x7')](),controller['show']);router[_0x11e4('0xa')]('/',auth[_0x11e4('0x7')](),controller[_0x11e4('0xb')]);router[_0x11e4('0xc')](_0x11e4('0x9'),auth[_0x11e4('0x7')](),controller['update']);router[_0x11e4('0xd')](_0x11e4('0x9'),auth[_0x11e4('0x7')](),controller[_0x11e4('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 4311e12..729eed7 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 _0xbed7=['STRING','sequelize','exports'];(function(_0x20b36e,_0x1e02c8){var _0x4fc42e=function(_0x59634c){while(--_0x59634c){_0x20b36e['push'](_0x20b36e['shift']());}};_0x4fc42e(++_0x1e02c8);}(_0xbed7,0x14b));var _0x7bed=function(_0xb7b18b,_0x205d9a){_0xb7b18b=_0xb7b18b-0x0;var _0x7c2dfc=_0xbed7[_0xb7b18b];return _0x7c2dfc;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')]},'basename':{'type':Sequelize[_0x7bed('0x2')]},'type':{'type':Sequelize[_0x7bed('0x2')]}};
\ No newline at end of file
+var _0x818f=['sequelize','exports','STRING'];(function(_0x134ac5,_0x302c22){var _0x54893c=function(_0x30dc06){while(--_0x30dc06){_0x134ac5['push'](_0x134ac5['shift']());}};_0x54893c(++_0x302c22);}(_0x818f,0x1da));var _0xf818=function(_0x38a4a7,_0x40fb67){_0x38a4a7=_0x38a4a7-0x0;var _0x31e4a3=_0x818f[_0x38a4a7];return _0x31e4a3;};'use strict';var Sequelize=require(_0xf818('0x0'));module[_0xf818('0x1')]={'name':{'type':Sequelize[_0xf818('0x2')]},'basename':{'type':Sequelize[_0xf818('0x2')]},'type':{'type':Sequelize[_0xf818('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9eec3b7..c5def51 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 _0xc983=['save','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','include','findAll','rows','catch','show','params','includeAll','find','clone','length','createdAt','updatedAt','omit','create','body','originalname','file','filename','mimetype','findOne','ChatOfflineMessageId','root','offline-chat/','basename','download','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject'];(function(_0x155fda,_0x3ff987){var _0x1d9222=function(_0x2d734c){while(--_0x2d734c){_0x155fda['push'](_0x155fda['shift']());}};_0x1d9222(++_0x3ff987);}(_0xc983,0x148));var _0x3c98=function(_0x318bab,_0x2c421d){_0x318bab=_0x318bab-0x0;var _0x2534e2=_0xc983[_0x318bab];return _0x2534e2;};'use strict';var emlformat=require(_0x3c98('0x0'));var rimraf=require(_0x3c98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3c98('0x2'));var moment=require(_0x3c98('0x3'));var BPromise=require(_0x3c98('0x4'));var Mustache=require(_0x3c98('0x5'));var util=require(_0x3c98('0x6'));var path=require(_0x3c98('0x7'));var sox=require(_0x3c98('0x8'));var csv=require(_0x3c98('0x9'));var ejs=require(_0x3c98('0xa'));var fs=require('fs');var fs_extra=require(_0x3c98('0xb'));var _=require(_0x3c98('0xc'));var squel=require(_0x3c98('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3c98('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c98('0xf'));var Papa=require(_0x3c98('0x10'));var Redis=require(_0x3c98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3c98('0x12'));var as=require(_0x3c98('0x13'));var hardwareService=require(_0x3c98('0x14'));var logger=require(_0x3c98('0x15'))(_0x3c98('0x16'));var utils=require('../../config/utils');var config=require(_0x3c98('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c98('0x18'))['db'];function respondWithStatusCode(_0x4ad82d,_0x4e3faa){_0x4e3faa=_0x4e3faa||0xcc;return function(_0x1f9998){if(_0x1f9998){return _0x4ad82d[_0x3c98('0x19')](_0x4e3faa);}return _0x4ad82d['status'](_0x4e3faa)[_0x3c98('0x1a')]();};}function respondWithResult(_0x351bc1,_0x5e8167){_0x5e8167=_0x5e8167||0xc8;return function(_0x229cac){if(_0x229cac){return _0x351bc1[_0x3c98('0x1b')](_0x5e8167)[_0x3c98('0x1c')](_0x229cac);}};}function respondWithFilteredResult(_0x12c86c,_0x105ae4){return function(_0x4ef2d9){if(_0x4ef2d9){var _0x4fd43b=typeof _0x105ae4[_0x3c98('0x1d')]===_0x3c98('0x1e')&&typeof _0x105ae4[_0x3c98('0x1f')]===_0x3c98('0x1e');var _0x1bf82f=_0x4ef2d9['count'];var _0x1d0fa4=_0x4fd43b?0x0:_0x105ae4[_0x3c98('0x1d')];var _0x35083e=_0x4fd43b?_0x4ef2d9[_0x3c98('0x20')]:_0x105ae4[_0x3c98('0x1d')]+_0x105ae4['limit'];var _0x4f56b2;if(_0x35083e>=_0x1bf82f){_0x35083e=_0x1bf82f;_0x4f56b2=0xc8;}else{_0x4f56b2=0xce;}_0x12c86c[_0x3c98('0x1b')](_0x4f56b2);return _0x12c86c[_0x3c98('0x21')]('Content-Range',_0x1d0fa4+'-'+_0x35083e+'/'+_0x1bf82f)[_0x3c98('0x1c')](_0x4ef2d9);}return null;};}function patchUpdates(_0x1fa1f8){return function(_0x1d2535){try{jsonpatch[_0x3c98('0x22')](_0x1d2535,_0x1fa1f8,!![]);}catch(_0x3d0363){return BPromise[_0x3c98('0x23')](_0x3d0363);}return _0x1d2535[_0x3c98('0x24')]();};}function saveUpdates(_0x4d22b4,_0x328486){return function(_0x30ab75){if(_0x30ab75){return _0x30ab75['update'](_0x4d22b4)[_0x3c98('0x25')](function(_0x5912ed){return _0x5912ed;});}return null;};}function removeEntity(_0xba650b,_0x3efb13){return function(_0x2fe345){if(_0x2fe345){return _0x2fe345[_0x3c98('0x26')]()[_0x3c98('0x25')](function(){_0xba650b[_0x3c98('0x1b')](0xcc)[_0x3c98('0x1a')]();});}};}function handleEntityNotFound(_0x55171a,_0x18cba8){return function(_0x1bc0d5){if(!_0x1bc0d5){_0x55171a[_0x3c98('0x19')](0x194);}return _0x1bc0d5;};}function handleError(_0x496da0,_0x293bad){_0x293bad=_0x293bad||0x1f4;return function(_0x127458){logger[_0x3c98('0x27')](_0x127458[_0x3c98('0x28')]);if(_0x127458['name']){delete _0x127458[_0x3c98('0x29')];}_0x496da0['status'](_0x293bad)[_0x3c98('0x2a')](_0x127458);};}exports[_0x3c98('0x2b')]=function(_0x5ef815,_0x387a28){var _0x30b5d9={},_0x5f8aab={},_0x3d0c29={'count':0x0,'rows':[]};var _0x5e2a5d=_[_0x3c98('0x2c')](db[_0x3c98('0x2d')][_0x3c98('0x2e')],function(_0xfcd8de){return{'name':_0xfcd8de['fieldName'],'type':_0xfcd8de[_0x3c98('0x2f')][_0x3c98('0x30')]};});_0x5f8aab[_0x3c98('0x31')]=_[_0x3c98('0x2c')](_0x5e2a5d,_0x3c98('0x29'));_0x5f8aab[_0x3c98('0x32')]=_[_0x3c98('0x33')](_0x5ef815[_0x3c98('0x32')]);_0x5f8aab[_0x3c98('0x34')]=_[_0x3c98('0x35')](_0x5f8aab[_0x3c98('0x31')],_0x5f8aab[_0x3c98('0x32')]);_0x30b5d9['attributes']=_[_0x3c98('0x35')](_0x5f8aab[_0x3c98('0x31')],qs['fields'](_0x5ef815[_0x3c98('0x32')][_0x3c98('0x36')]));_0x30b5d9['attributes']=_0x30b5d9['attributes']['length']?_0x30b5d9[_0x3c98('0x37')]:_0x5f8aab['model'];if(!_0x5ef815[_0x3c98('0x32')][_0x3c98('0x38')](_0x3c98('0x39'))){_0x30b5d9[_0x3c98('0x1f')]=qs[_0x3c98('0x1f')](_0x5ef815[_0x3c98('0x32')][_0x3c98('0x1f')]);_0x30b5d9[_0x3c98('0x1d')]=qs[_0x3c98('0x1d')](_0x5ef815['query']['offset']);}_0x30b5d9[_0x3c98('0x3a')]=qs[_0x3c98('0x3b')](_0x5ef815[_0x3c98('0x32')][_0x3c98('0x3b')]);_0x30b5d9['where']=qs[_0x3c98('0x34')](_[_0x3c98('0x3c')](_0x5ef815[_0x3c98('0x32')],_0x5f8aab[_0x3c98('0x34')]),_0x5e2a5d);if(_0x5ef815[_0x3c98('0x32')][_0x3c98('0x3d')]){_0x30b5d9['where']=_[_0x3c98('0x3e')](_0x30b5d9['where'],{'$or':_[_0x3c98('0x2c')](_0x5e2a5d,function(_0x2ef903){if(_0x2ef903[_0x3c98('0x2f')]!==_0x3c98('0x3f')){var _0x3b3054={};_0x3b3054[_0x2ef903[_0x3c98('0x29')]]={'$like':'%'+_0x5ef815['query'][_0x3c98('0x3d')]+'%'};return _0x3b3054;}})});}_0x30b5d9=_[_0x3c98('0x3e')]({},_0x30b5d9,_0x5ef815[_0x3c98('0x40')]);var _0x23297a={'where':_0x30b5d9[_0x3c98('0x41')]};return db[_0x3c98('0x2d')][_0x3c98('0x20')](_0x23297a)[_0x3c98('0x25')](function(_0x440e05){_0x3d0c29[_0x3c98('0x20')]=_0x440e05;if(_0x5ef815[_0x3c98('0x32')]['includeAll']){_0x30b5d9[_0x3c98('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x3c98('0x43')](_0x30b5d9);})[_0x3c98('0x25')](function(_0x4f885d){_0x3d0c29[_0x3c98('0x44')]=_0x4f885d;return _0x3d0c29;})[_0x3c98('0x25')](respondWithFilteredResult(_0x387a28,_0x30b5d9))[_0x3c98('0x45')](handleError(_0x387a28,null));};exports[_0x3c98('0x46')]=function(_0x1ba464,_0x4bcb9a){var _0x22e3ba={'raw':!![],'where':{'id':_0x1ba464[_0x3c98('0x47')]['id']}},_0xfbed={};_0xfbed['model']=_[_0x3c98('0x33')](db[_0x3c98('0x2d')]['rawAttributes']);_0xfbed['query']=_[_0x3c98('0x33')](_0x1ba464['query']);_0xfbed[_0x3c98('0x34')]=_[_0x3c98('0x35')](_0xfbed[_0x3c98('0x31')],_0xfbed['query']);_0x22e3ba[_0x3c98('0x37')]=_['intersection'](_0xfbed[_0x3c98('0x31')],qs[_0x3c98('0x36')](_0x1ba464[_0x3c98('0x32')][_0x3c98('0x36')]));_0x22e3ba[_0x3c98('0x37')]=_0x22e3ba[_0x3c98('0x37')]['length']?_0x22e3ba[_0x3c98('0x37')]:_0xfbed[_0x3c98('0x31')];if(_0x1ba464[_0x3c98('0x32')][_0x3c98('0x48')]){_0x22e3ba[_0x3c98('0x42')]=[{'all':!![]}];}_0x22e3ba=_[_0x3c98('0x3e')]({},_0x22e3ba,_0x1ba464[_0x3c98('0x40')]);return db[_0x3c98('0x2d')][_0x3c98('0x49')](_0x22e3ba)[_0x3c98('0x25')](handleEntityNotFound(_0x4bcb9a,null))[_0x3c98('0x25')](respondWithResult(_0x4bcb9a,null))[_0x3c98('0x45')](handleError(_0x4bcb9a,null));};exports[_0x3c98('0x4a')]=function(_0x23a9e9,_0x430b6b){var _0x23f83d={'where':{'id':_0x23a9e9[_0x3c98('0x47')]['id']}},_0x1d1a5b={};_0x1d1a5b[_0x3c98('0x31')]=_[_0x3c98('0x33')](db[_0x3c98('0x2d')][_0x3c98('0x2e')]);_0x23f83d[_0x3c98('0x37')]=_[_0x3c98('0x35')](_0x1d1a5b[_0x3c98('0x31')],qs[_0x3c98('0x36')](_0x23a9e9['query'][_0x3c98('0x36')]));_0x23f83d[_0x3c98('0x37')]=_0x23f83d[_0x3c98('0x37')][_0x3c98('0x4b')]?_0x23f83d[_0x3c98('0x37')]:_0x1d1a5b['model'];if(_0x23a9e9[_0x3c98('0x32')][_0x3c98('0x48')]){_0x23f83d[_0x3c98('0x42')]=[{'all':!![]}];}_0x23f83d=_[_0x3c98('0x3e')]({},_0x23f83d,_0x23a9e9[_0x3c98('0x40')]);return db[_0x3c98('0x2d')][_0x3c98('0x49')](_0x23f83d)['then'](handleEntityNotFound(_0x430b6b,null))['then'](function(_0x450fc1){if(_0x450fc1){var _0x1a5d17=_0x450fc1['get']({'plain':!![]});_0x1a5d17=qs['omit'](_0x1a5d17,['id',_0x3c98('0x4c'),_0x3c98('0x4d')]);_0x23a9e9['body']=_[_0x3c98('0x4e')](_0x23a9e9['body'],['id','createdAt','updatedAt']);return db['Attachment'][_0x3c98('0x4f')](_[_0x3c98('0x3e')](_0x1a5d17,_0x23a9e9['body']),{'include':_0x23a9e9[_0x3c98('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x430b6b,0xc9))[_0x3c98('0x45')](handleError(_0x430b6b,null));};exports['update']=function(_0x5f4ba9,_0x5212bd){if(_0x5f4ba9[_0x3c98('0x50')]['id']){delete _0x5f4ba9[_0x3c98('0x50')]['id'];}return db[_0x3c98('0x2d')]['find']({'where':{'id':_0x5f4ba9[_0x3c98('0x47')]['id']}})[_0x3c98('0x25')](handleEntityNotFound(_0x5212bd,null))[_0x3c98('0x25')](saveUpdates(_0x5f4ba9[_0x3c98('0x50')],null))[_0x3c98('0x25')](respondWithResult(_0x5212bd,null))[_0x3c98('0x45')](handleError(_0x5212bd,null));};exports['destroy']=function(_0x38d339,_0x474c4a){return db[_0x3c98('0x2d')][_0x3c98('0x49')]({'where':{'id':_0x38d339[_0x3c98('0x47')]['id']}})[_0x3c98('0x25')](handleEntityNotFound(_0x474c4a,null))[_0x3c98('0x25')](removeEntity(_0x474c4a,null))['catch'](handleError(_0x474c4a,null));};exports[_0x3c98('0x4f')]=function(_0x16e569,_0x27c07f,_0xf03a3a){_0x16e569[_0x3c98('0x50')]['name']=_0x16e569['file'][_0x3c98('0x51')];_0x16e569[_0x3c98('0x50')]['basename']=_0x16e569[_0x3c98('0x52')][_0x3c98('0x53')];_0x16e569[_0x3c98('0x50')]['type']=_0x16e569[_0x3c98('0x52')][_0x3c98('0x54')];return db['Attachment'][_0x3c98('0x4f')](_0x16e569['body'])[_0x3c98('0x25')](respondWithResult(_0x27c07f,0xc9))[_0x3c98('0x45')](handleError(_0x27c07f,null));};exports['download']=function(_0x16e0ec,_0x281427,_0x2691b7){return db[_0x3c98('0x2d')][_0x3c98('0x55')]({'where':{'id':_0x16e0ec['params']['id']},'raw':!![]})[_0x3c98('0x25')](handleEntityNotFound(_0x281427,null))['then'](function(_0x327fbb){if(_0x327fbb){var _0x14c7b7=_0x327fbb[_0x3c98('0x56')]!==null;var _0x2ba80d=path['join'](config[_0x3c98('0x57')],'server/files/attachments/');if(_0x14c7b7){_0x2ba80d=path['join'](_0x2ba80d,_0x3c98('0x58'));}var _0x59e175=path['join'](_0x2ba80d,_0x327fbb[_0x3c98('0x59')]);return _0x281427[_0x3c98('0x5a')](_0x59e175);}})[_0x3c98('0x45')](handleError(_0x281427,null));};
\ No newline at end of file
+var _0x7069=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','name','index','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','Attachment','includeAll','include','findAll','rows','show','params','length','options','find','catch','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x2279ad,_0x467d8d){var _0x5b51d9=function(_0x26e830){while(--_0x26e830){_0x2279ad['push'](_0x2279ad['shift']());}};_0x5b51d9(++_0x467d8d);}(_0x7069,0x9b));var _0x9706=function(_0x1d074e,_0x1a4cd3){_0x1d074e=_0x1d074e-0x0;var _0x2ff036=_0x7069[_0x1d074e];return _0x2ff036;};'use strict';var emlformat=require(_0x9706('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9706('0x1'));var jsonpatch=require(_0x9706('0x2'));var rp=require(_0x9706('0x3'));var moment=require(_0x9706('0x4'));var BPromise=require(_0x9706('0x5'));var Mustache=require(_0x9706('0x6'));var util=require('util');var path=require(_0x9706('0x7'));var sox=require(_0x9706('0x8'));var csv=require(_0x9706('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9706('0xa'));var _=require(_0x9706('0xb'));var squel=require(_0x9706('0xc'));var crypto=require(_0x9706('0xd'));var jsforce=require(_0x9706('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9706('0x9'));var querystring=require(_0x9706('0xf'));var Papa=require(_0x9706('0x10'));var Redis=require(_0x9706('0x11'));var authService=require(_0x9706('0x12'));var qs=require(_0x9706('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9706('0x14'));var logger=require('../../config/logger')(_0x9706('0x15'));var utils=require(_0x9706('0x16'));var config=require(_0x9706('0x17'));var licenseUtil=require(_0x9706('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x373aa1,_0x2e652f){_0x2e652f=_0x2e652f||0xcc;return function(_0x14be07){if(_0x14be07){return _0x373aa1[_0x9706('0x19')](_0x2e652f);}return _0x373aa1[_0x9706('0x1a')](_0x2e652f)[_0x9706('0x1b')]();};}function respondWithResult(_0x5a63d1,_0x3bcb88){_0x3bcb88=_0x3bcb88||0xc8;return function(_0x3ed864){if(_0x3ed864){return _0x5a63d1[_0x9706('0x1a')](_0x3bcb88)[_0x9706('0x1c')](_0x3ed864);}};}function respondWithFilteredResult(_0xa5d4a3,_0x1e8110){return function(_0x13e0ba){if(_0x13e0ba){var _0x4152a9=typeof _0x1e8110['offset']===_0x9706('0x1d')&&typeof _0x1e8110[_0x9706('0x1e')]==='undefined';var _0x162a69=_0x13e0ba[_0x9706('0x1f')];var _0x462e2a=_0x4152a9?0x0:_0x1e8110[_0x9706('0x20')];var _0x3b252e=_0x4152a9?_0x13e0ba[_0x9706('0x1f')]:_0x1e8110['offset']+_0x1e8110[_0x9706('0x1e')];var _0x32ec98;if(_0x3b252e>=_0x162a69){_0x3b252e=_0x162a69;_0x32ec98=0xc8;}else{_0x32ec98=0xce;}_0xa5d4a3[_0x9706('0x1a')](_0x32ec98);return _0xa5d4a3['set'](_0x9706('0x21'),_0x462e2a+'-'+_0x3b252e+'/'+_0x162a69)['json'](_0x13e0ba);}return null;};}function patchUpdates(_0x488090){return function(_0x69271a){try{jsonpatch[_0x9706('0x22')](_0x69271a,_0x488090,!![]);}catch(_0x3ff053){return BPromise['reject'](_0x3ff053);}return _0x69271a[_0x9706('0x23')]();};}function saveUpdates(_0x31ef84,_0x191dbf){return function(_0x1839f8){if(_0x1839f8){return _0x1839f8[_0x9706('0x24')](_0x31ef84)[_0x9706('0x25')](function(_0x26be91){return _0x26be91;});}return null;};}function removeEntity(_0x34e111,_0x14a14a){return function(_0x3167be){if(_0x3167be){return _0x3167be[_0x9706('0x26')]()[_0x9706('0x25')](function(){_0x34e111['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2123c4,_0x1679c6){return function(_0x57b211){if(!_0x57b211){_0x2123c4[_0x9706('0x19')](0x194);}return _0x57b211;};}function handleError(_0x28b3e0,_0x8670f5){_0x8670f5=_0x8670f5||0x1f4;return function(_0x2f0c8a){logger[_0x9706('0x27')](_0x2f0c8a['stack']);if(_0x2f0c8a[_0x9706('0x28')]){delete _0x2f0c8a[_0x9706('0x28')];}_0x28b3e0[_0x9706('0x1a')](_0x8670f5)['send'](_0x2f0c8a);};}exports[_0x9706('0x29')]=function(_0x19dbe7,_0x6b7717){var _0x3ffaf2={},_0x57fe64={},_0x1f220e={'count':0x0,'rows':[]};var _0xd2f1f6=_[_0x9706('0x2a')](db['Attachment'][_0x9706('0x2b')],function(_0x3325b9){return{'name':_0x3325b9['fieldName'],'type':_0x3325b9['type'][_0x9706('0x2c')]};});_0x57fe64['model']=_[_0x9706('0x2a')](_0xd2f1f6,'name');_0x57fe64[_0x9706('0x2d')]=_[_0x9706('0x2e')](_0x19dbe7[_0x9706('0x2d')]);_0x57fe64['filters']=_[_0x9706('0x2f')](_0x57fe64[_0x9706('0x30')],_0x57fe64[_0x9706('0x2d')]);_0x3ffaf2[_0x9706('0x31')]=_[_0x9706('0x2f')](_0x57fe64['model'],qs[_0x9706('0x32')](_0x19dbe7['query']['fields']));_0x3ffaf2[_0x9706('0x31')]=_0x3ffaf2[_0x9706('0x31')]['length']?_0x3ffaf2['attributes']:_0x57fe64['model'];if(!_0x19dbe7[_0x9706('0x2d')][_0x9706('0x33')](_0x9706('0x34'))){_0x3ffaf2[_0x9706('0x1e')]=qs['limit'](_0x19dbe7['query'][_0x9706('0x1e')]);_0x3ffaf2['offset']=qs[_0x9706('0x20')](_0x19dbe7[_0x9706('0x2d')][_0x9706('0x20')]);}_0x3ffaf2[_0x9706('0x35')]=qs[_0x9706('0x36')](_0x19dbe7['query'][_0x9706('0x36')]);_0x3ffaf2[_0x9706('0x37')]=qs[_0x9706('0x38')](_[_0x9706('0x39')](_0x19dbe7[_0x9706('0x2d')],_0x57fe64[_0x9706('0x38')]),_0xd2f1f6);if(_0x19dbe7[_0x9706('0x2d')]['filter']){_0x3ffaf2[_0x9706('0x37')]=_[_0x9706('0x3a')](_0x3ffaf2[_0x9706('0x37')],{'$or':_[_0x9706('0x2a')](_0xd2f1f6,function(_0x21892e){if(_0x21892e[_0x9706('0x3b')]!=='VIRTUAL'){var _0x309675={};_0x309675[_0x21892e[_0x9706('0x28')]]={'$like':'%'+_0x19dbe7[_0x9706('0x2d')][_0x9706('0x3c')]+'%'};return _0x309675;}})});}_0x3ffaf2=_[_0x9706('0x3a')]({},_0x3ffaf2,_0x19dbe7['options']);var _0x149289={'where':_0x3ffaf2[_0x9706('0x37')]};return db[_0x9706('0x3d')][_0x9706('0x1f')](_0x149289)[_0x9706('0x25')](function(_0x4ac47e){_0x1f220e[_0x9706('0x1f')]=_0x4ac47e;if(_0x19dbe7[_0x9706('0x2d')][_0x9706('0x3e')]){_0x3ffaf2[_0x9706('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x9706('0x40')](_0x3ffaf2);})[_0x9706('0x25')](function(_0x504dc7){_0x1f220e[_0x9706('0x41')]=_0x504dc7;return _0x1f220e;})['then'](respondWithFilteredResult(_0x6b7717,_0x3ffaf2))['catch'](handleError(_0x6b7717,null));};exports[_0x9706('0x42')]=function(_0x1c66ab,_0x56406c){var _0x1274d6={'raw':!![],'where':{'id':_0x1c66ab[_0x9706('0x43')]['id']}},_0x3d9d5e={};_0x3d9d5e[_0x9706('0x30')]=_[_0x9706('0x2e')](db['Attachment']['rawAttributes']);_0x3d9d5e[_0x9706('0x2d')]=_[_0x9706('0x2e')](_0x1c66ab['query']);_0x3d9d5e[_0x9706('0x38')]=_[_0x9706('0x2f')](_0x3d9d5e[_0x9706('0x30')],_0x3d9d5e[_0x9706('0x2d')]);_0x1274d6[_0x9706('0x31')]=_['intersection'](_0x3d9d5e['model'],qs[_0x9706('0x32')](_0x1c66ab[_0x9706('0x2d')]['fields']));_0x1274d6[_0x9706('0x31')]=_0x1274d6[_0x9706('0x31')][_0x9706('0x44')]?_0x1274d6['attributes']:_0x3d9d5e[_0x9706('0x30')];if(_0x1c66ab['query']['includeAll']){_0x1274d6[_0x9706('0x3f')]=[{'all':!![]}];}_0x1274d6=_['merge']({},_0x1274d6,_0x1c66ab[_0x9706('0x45')]);return db['Attachment'][_0x9706('0x46')](_0x1274d6)['then'](handleEntityNotFound(_0x56406c,null))[_0x9706('0x25')](respondWithResult(_0x56406c,null))[_0x9706('0x47')](handleError(_0x56406c,null));};exports['clone']=function(_0x336d3b,_0x36c265){var _0x5b6488={'where':{'id':_0x336d3b[_0x9706('0x43')]['id']}},_0xc489a5={};_0xc489a5[_0x9706('0x30')]=_[_0x9706('0x2e')](db[_0x9706('0x3d')][_0x9706('0x2b')]);_0x5b6488[_0x9706('0x31')]=_['intersection'](_0xc489a5['model'],qs['fields'](_0x336d3b['query'][_0x9706('0x32')]));_0x5b6488['attributes']=_0x5b6488[_0x9706('0x31')][_0x9706('0x44')]?_0x5b6488[_0x9706('0x31')]:_0xc489a5[_0x9706('0x30')];if(_0x336d3b[_0x9706('0x2d')][_0x9706('0x3e')]){_0x5b6488[_0x9706('0x3f')]=[{'all':!![]}];}_0x5b6488=_['merge']({},_0x5b6488,_0x336d3b['options']);return db[_0x9706('0x3d')][_0x9706('0x46')](_0x5b6488)[_0x9706('0x25')](handleEntityNotFound(_0x36c265,null))[_0x9706('0x25')](function(_0x32c4d9){if(_0x32c4d9){var _0x42dccb=_0x32c4d9[_0x9706('0x48')]({'plain':!![]});_0x42dccb=qs[_0x9706('0x49')](_0x42dccb,['id',_0x9706('0x4a'),_0x9706('0x4b')]);_0x336d3b['body']=_['omit'](_0x336d3b[_0x9706('0x4c')],['id',_0x9706('0x4a'),'updatedAt']);return db['Attachment'][_0x9706('0x4d')](_[_0x9706('0x3a')](_0x42dccb,_0x336d3b[_0x9706('0x4c')]),{'include':_0x336d3b[_0x9706('0x2d')][_0x9706('0x3e')]?[{'all':!![]}]:undefined});}})[_0x9706('0x25')](respondWithResult(_0x36c265,0xc9))[_0x9706('0x47')](handleError(_0x36c265,null));};exports[_0x9706('0x24')]=function(_0x246435,_0x53c879){if(_0x246435[_0x9706('0x4c')]['id']){delete _0x246435[_0x9706('0x4c')]['id'];}return db[_0x9706('0x3d')][_0x9706('0x46')]({'where':{'id':_0x246435[_0x9706('0x43')]['id']}})[_0x9706('0x25')](handleEntityNotFound(_0x53c879,null))['then'](saveUpdates(_0x246435['body'],null))[_0x9706('0x25')](respondWithResult(_0x53c879,null))[_0x9706('0x47')](handleError(_0x53c879,null));};exports[_0x9706('0x26')]=function(_0x557428,_0x2fd10d){return db['Attachment'][_0x9706('0x46')]({'where':{'id':_0x557428[_0x9706('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fd10d,null))[_0x9706('0x25')](removeEntity(_0x2fd10d,null))['catch'](handleError(_0x2fd10d,null));};exports[_0x9706('0x4d')]=function(_0x29b613,_0x5c5657,_0x1b8000){_0x29b613['body'][_0x9706('0x28')]=_0x29b613[_0x9706('0x4e')][_0x9706('0x4f')];_0x29b613['body'][_0x9706('0x50')]=_0x29b613[_0x9706('0x4e')][_0x9706('0x51')];_0x29b613[_0x9706('0x4c')]['type']=_0x29b613[_0x9706('0x4e')][_0x9706('0x52')];return db[_0x9706('0x3d')][_0x9706('0x4d')](_0x29b613[_0x9706('0x4c')])[_0x9706('0x25')](respondWithResult(_0x5c5657,0xc9))[_0x9706('0x47')](handleError(_0x5c5657,null));};exports['download']=function(_0x302924,_0x1d4255,_0x4713c3){return db['Attachment'][_0x9706('0x53')]({'where':{'id':_0x302924[_0x9706('0x43')]['id']},'raw':!![]})[_0x9706('0x25')](handleEntityNotFound(_0x1d4255,null))[_0x9706('0x25')](function(_0x2d2528){if(_0x2d2528){var _0x49b6cf=_0x2d2528[_0x9706('0x54')]!==null;var _0x2afc50=path['join'](config['root'],_0x9706('0x55'));if(_0x49b6cf){_0x2afc50=path['join'](_0x2afc50,_0x9706('0x56'));}var _0xbfc5f1=path[_0x9706('0x57')](_0x2afc50,_0x2d2528[_0x9706('0x50')]);return _0x1d4255['download'](_0xbfc5f1);}})['catch'](handleError(_0x1d4255,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 09cb26b..8925214 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 _0x0d23=['exports','Attachment','util','../../config/logger','api','moment','path','rimraf'];(function(_0x4ce2d9,_0x5644fb){var _0x24eafc=function(_0x3471c7){while(--_0x3471c7){_0x4ce2d9['push'](_0x4ce2d9['shift']());}};_0x24eafc(++_0x5644fb);}(_0x0d23,0x72));var _0x30d2=function(_0x108284,_0x57930b){_0x108284=_0x108284-0x0;var _0xff58d=_0x0d23[_0x108284];return _0xff58d;};'use strict';var _=require('lodash');var util=require(_0x30d2('0x0'));var logger=require(_0x30d2('0x1'))(_0x30d2('0x2'));var moment=require(_0x30d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x30d2('0x4'));var rimraf=require(_0x30d2('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x30d2('0x6')]=function(_0x4c9add,_0x13fac6){return _0x4c9add['define'](_0x30d2('0x7'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c46=['../../config/environment','./attachment.attributes','Attachment','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x149145,_0x352f93){var _0x9db71b=function(_0x5df39f){while(--_0x5df39f){_0x149145['push'](_0x149145['shift']());}};_0x9db71b(++_0x352f93);}(_0x7c46,0x100));var _0x67c4=function(_0x31c70c,_0x145807){_0x31c70c=_0x31c70c-0x0;var _0x3fc86b=_0x7c46[_0x31c70c];return _0x3fc86b;};'use strict';var _=require(_0x67c4('0x0'));var util=require(_0x67c4('0x1'));var logger=require('../../config/logger')(_0x67c4('0x2'));var moment=require(_0x67c4('0x3'));var BPromise=require(_0x67c4('0x4'));var rp=require(_0x67c4('0x5'));var fs=require('fs');var path=require(_0x67c4('0x6'));var rimraf=require(_0x67c4('0x7'));var config=require(_0x67c4('0x8'));var attributes=require(_0x67c4('0x9'));module['exports']=function(_0x2647e4,_0x3500f9){return _0x2647e4['define'](_0x67c4('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index cfc71ae..6b67f00 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 _0x202c=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x11bc40,_0x537bbc){var _0x2b7a99=function(_0x50135b){while(--_0x50135b){_0x11bc40['push'](_0x11bc40['shift']());}};_0x2b7a99(++_0x537bbc);}(_0x202c,0x178));var _0xc202=function(_0x3582de,_0x4cd6d1){_0x3582de=_0x3582de-0x0;var _0x202b18=_0x202c[_0x3582de];return _0x202b18;};'use strict';var _=require(_0xc202('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc202('0x1'));var rs=require(_0xc202('0x2'));var fs=require('fs');var Redis=require(_0xc202('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc202('0x4'));var logger=require(_0xc202('0x5'))(_0xc202('0x6'));var config=require(_0xc202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc202('0x8')][_0xc202('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59563a,_0xc2b3eb,_0x574549){return new BPromise(function(_0x872c1a,_0x5978fe){return client[_0xc202('0xa')](_0x59563a,_0x574549)[_0xc202('0xb')](function(_0x36fcb7){logger[_0xc202('0xc')](_0xc202('0xd'),_0xc2b3eb,_0xc202('0xe'));logger[_0xc202('0xf')](_0xc202('0x10'),_0xc2b3eb,_0xc202('0xe'),JSON[_0xc202('0x11')](_0x36fcb7));if(_0x36fcb7[_0xc202('0x12')]){if(_0x36fcb7['error'][_0xc202('0x13')]===0x1f4){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);return _0x5978fe(_0x36fcb7[_0xc202('0x12')][_0xc202('0x14')]);}logger['error'](_0xc202('0xd'),_0xc2b3eb,_0x36fcb7[_0xc202('0x12')]['message']);return _0x872c1a(_0x36fcb7['error']['message']);}else{logger[_0xc202('0xc')]('Attachment,\x20%s,\x20%s',_0xc2b3eb,_0xc202('0xe'));_0x872c1a(_0x36fcb7['result'][_0xc202('0x14')]);}})[_0xc202('0x15')](function(_0x3018c8){logger[_0xc202('0x12')](_0xc202('0xd'),_0xc2b3eb,_0x3018c8);_0x5978fe(_0x3018c8);});});}exports[_0xc202('0x16')]=function(_0x9620a0){var _0x591ecc=this;return new Promise(function(_0x16ec7c,_0x2c5557){return db[_0xc202('0x17')]['create'](_0x9620a0['body'],{'raw':_0x9620a0[_0xc202('0x18')]?_0x9620a0[_0xc202('0x18')][_0xc202('0x19')]===undefined?!![]:![]:!![]})[_0xc202('0xb')](function(_0x2ae3c1){logger['info']('CreateAttachment',_0x9620a0);logger[_0xc202('0xf')]('CreateAttachment',_0x9620a0,JSON[_0xc202('0x11')](_0x2ae3c1));_0x16ec7c(_0x2ae3c1);})[_0xc202('0x15')](function(_0x56e979){logger['error'](_0xc202('0x16'),_0x56e979['message'],_0x9620a0);_0x2c5557(_0x591ecc[_0xc202('0x12')](0x1f4,_0x56e979[_0xc202('0x14')]));});});};
\ No newline at end of file
+var _0xd49c=['body','options','raw','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateAttachment','create'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xd49c,0x1d8));var _0xcd49=function(_0x1766b6,_0x8052b0){_0x1766b6=_0x1766b6-0x0;var _0x11dc3d=_0xd49c[_0x1766b6];return _0x11dc3d;};'use strict';var _=require('lodash');var util=require(_0xcd49('0x0'));var moment=require('moment');var BPromise=require(_0xcd49('0x1'));var rs=require(_0xcd49('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd49('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd49('0x4'))('rpc');var config=require(_0xcd49('0x5'));var jayson=require(_0xcd49('0x6'));var client=jayson[_0xcd49('0x7')][_0xcd49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x704584,_0x22f64b,_0x321013){return new BPromise(function(_0x17f26f,_0x3742e1){return client[_0xcd49('0x9')](_0x704584,_0x321013)[_0xcd49('0xa')](function(_0x4b7316){logger[_0xcd49('0xb')](_0xcd49('0xc'),_0x22f64b,_0xcd49('0xd'));logger[_0xcd49('0xe')](_0xcd49('0xf'),_0x22f64b,_0xcd49('0xd'),JSON[_0xcd49('0x10')](_0x4b7316));if(_0x4b7316[_0xcd49('0x11')]){if(_0x4b7316[_0xcd49('0x11')][_0xcd49('0x12')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x22f64b,_0x4b7316[_0xcd49('0x11')][_0xcd49('0x13')]);return _0x3742e1(_0x4b7316[_0xcd49('0x11')]['message']);}logger[_0xcd49('0x11')](_0xcd49('0xc'),_0x22f64b,_0x4b7316['error'][_0xcd49('0x13')]);return _0x17f26f(_0x4b7316[_0xcd49('0x11')][_0xcd49('0x13')]);}else{logger[_0xcd49('0xb')](_0xcd49('0xc'),_0x22f64b,_0xcd49('0xd'));_0x17f26f(_0x4b7316['result']['message']);}})['catch'](function(_0x4dabea){logger[_0xcd49('0x11')](_0xcd49('0xc'),_0x22f64b,_0x4dabea);_0x3742e1(_0x4dabea);});});}exports[_0xcd49('0x14')]=function(_0x484900){var _0x3074a4=this;return new Promise(function(_0x5f2ecb,_0x9c7262){return db['Attachment'][_0xcd49('0x15')](_0x484900[_0xcd49('0x16')],{'raw':_0x484900[_0xcd49('0x17')]?_0x484900[_0xcd49('0x17')][_0xcd49('0x18')]===undefined?!![]:![]:!![]})[_0xcd49('0xa')](function(_0x1c40a6){logger[_0xcd49('0xb')](_0xcd49('0x14'),_0x484900);logger['debug'](_0xcd49('0x14'),_0x484900,JSON[_0xcd49('0x10')](_0x1c40a6));_0x5f2ecb(_0x1c40a6);})[_0xcd49('0x19')](function(_0x5829d1){logger['error']('CreateAttachment',_0x5829d1[_0xcd49('0x13')],_0x484900);_0x9c7262(_0x3074a4[_0xcd49('0x11')](0x1f4,_0x5829d1['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 34f8496..eb45a93 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x4a7de1,_0x389df7){var _0x5817bd=function(_0x446225){while(--_0x446225){_0x4a7de1['push'](_0x4a7de1['shift']());}};_0x5817bd(++_0x389df7);}(_0x757a,0xde));var _0xa757=function(_0x5a5a95,_0x3ad80f){_0x5a5a95=_0x5a5a95-0x0;var _0x2d7358=_0x757a[_0x5a5a95];return _0x2d7358;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=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(_0x7d0afd,_0x220310){var _0x112426=function(_0x2e85cb){while(--_0x2e85cb){_0x7d0afd['push'](_0x7d0afd['shift']());}};_0x112426(++_0x220310);}(_0xadb5,0xad));var _0x5adb=function(_0x1d81cd,_0x854c20){_0x1d81cd=_0x1d81cd-0x0;var _0xab87b5=_0xadb5[_0x1d81cd];return _0xab87b5;};'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/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index abf692e..9d6ee7b 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5467=['disabled','blocked','online','admin','agent','then','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','password','User','passport-local','Strategy','moment','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role'];(function(_0x5d977f,_0x1f96a1){var _0x4b4b53=function(_0x16ea7f){while(--_0x16ea7f){_0x5d977f['push'](_0x5d977f['shift']());}};_0x4b4b53(++_0x1f96a1);}(_0x5467,0x1ab));var _0x7546=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x5467[_0xbb091];return _0x467a04;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x7546('0x0'))[_0x7546('0x1')];var moment=require(_0x7546('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x7546('0x3'));var util=require('util');var db=require(_0x7546('0x4'))['db'];var authService=require(_0x7546('0x5'));var utils=require(_0x7546('0x6'));var config=require(_0x7546('0x7'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x17b1e7){var _0x817e31=![];if(typeof _0x17b1e7['activedirectory']!=='undefined'){_0x817e31=_0x17b1e7['activedirectory']['baseDN']&&_0x17b1e7[_0x7546('0x8')]['url']&&_0x17b1e7[_0x7546('0x8')][_0x7546('0x9')];}return _0x817e31;}function adAuthenticate(_0x4ca4a2,_0x546f46,_0x1378b6){return new BPromise(function(_0x76e149,_0x401417){try{var _0x29c176=new ActiveDirectory(_0x4ca4a2);_0x29c176[_0x7546('0xa')](_0x546f46,_0x1378b6,function(_0x36b53d,_0x2afc83){if(_0x36b53d){logger[_0x7546('0xb')](_0x7546('0xc'),_0x546f46,util[_0x7546('0xd')](_0x36b53d,{'showHidden':![],'depth':null}));_0x401417(_0x7546('0xe'));}else if(!_0x2afc83){logger[_0x7546('0xb')](_0x7546('0xf'),_0x546f46);_0x401417(_0x7546('0xe'));}else{_0x76e149(_0x2afc83);}});}catch(_0x4a72df){_0x401417(_0x4a72df);}});}function ActiveDirectoryAuthenticate(_0x2702ec,_0x3c41ef,_0x13a645,_0x51bbbe){var _0x484b78,_0x2af3aa;if(!isActiveDirectoryConfigured(config)){logger[_0x7546('0xb')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x3c41ef);return _0x51bbbe(null,![],{'message':_0x7546('0xe')});}return db['Setting'][_0x7546('0x10')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x7546('0x11')],'raw':!![]})['then'](function(_0x23e2fa){_0x484b78=_0x23e2fa;if(!_0x484b78[_0x7546('0x12')]){logger[_0x7546('0xb')](_0x7546('0x13'),_0x3c41ef);throw new Error(_0x7546('0xe'));}return _0x2702ec[_0x7546('0x10')]({'attributes':['id',_0x7546('0x14'),'password',_0x7546('0x15'),_0x7546('0x16'),_0x7546('0x17'),_0x7546('0x18'),'blockedAt',_0x7546('0x19')],'where':{'name':_0x3c41ef,'role':{'$or':[_0x7546('0x1a'),'user',_0x7546('0x1b')]},'adSsoEnabled':!![]}});})['then'](function(_0x140809){if(!_0x140809||_0x140809&&_0x140809[_0x7546('0x14')]!==_0x3c41ef){throw new Error(_0x7546('0xe'));}_0x2af3aa=_0x140809;var _0x2b1154=_0x2af3aa[_0x7546('0x14')]+'@'+config[_0x7546('0x8')][_0x7546('0x9')];return adAuthenticate(config[_0x7546('0x8')],_0x2b1154,_0x13a645);})[_0x7546('0x1c')](function(_0x2c674c){if(_0x2af3aa[_0x7546('0x17')]){throw new Error(_0x7546('0xe'));}if(_0x484b78['blockDuration']>0x0){if(_0x2af3aa['blocked']){if(moment(_0x2af3aa[_0x7546('0x1d')])[_0x7546('0x1e')](_0x484b78['blockDuration'],_0x7546('0x1f'))>moment()){throw new Error(_0x7546('0xe'));}return utils[_0x7546('0x20')](_0x2af3aa,0x0,![],null)[_0x7546('0x1c')](function(){return utils[_0x7546('0x21')](_0x2af3aa);})[_0x7546('0x1c')](function(){return _0x51bbbe(null,_0x2af3aa);});}else{return utils[_0x7546('0x21')](_0x2af3aa)[_0x7546('0x1c')](function(){return _0x51bbbe(null,_0x2af3aa);});}}else{return utils[_0x7546('0x21')](_0x2af3aa)[_0x7546('0x1c')](function(){return _0x51bbbe(null,_0x2af3aa);});}})[_0x7546('0x22')](function(_0x2c752e){return _0x51bbbe(null,![],_0x2c752e);});}function handleError(_0x365321,_0x286b12,_0x1b657a){return _0x365321['status'](_0x286b12||0x1f4)[_0x7546('0x23')]({'message':_0x1b657a?_0x1b657a[_0x7546('0x24')]||_0x1b657a:''});}exports[_0x7546('0x25')]=function(_0x51caea,_0x1ab151,_0x3f952a){passport[_0x7546('0xa')]('ad-login',function(_0x4055e0,_0x5f4f78,_0x2bcfad){var _0x3a364d=_0x4055e0||_0x2bcfad;if(_0x3a364d){return handleError(_0x1ab151,0x191,_0x3a364d);}if(!_0x5f4f78){return handleError(_0x1ab151,0x194,{'message':_0x7546('0x26')});}else{var _0x50af9e={'payload':{'id':_0x5f4f78['id'],'role':_0x5f4f78[_0x7546('0x16')]},'options':{'expiresIn':0x15180}};return authService[_0x7546('0x27')](_0x50af9e)[_0x7546('0x1c')](function(_0x2bdf7e){_0x1ab151[_0x7546('0x28')]({'id':_0x5f4f78['id'],'token':_0x2bdf7e,'statusCall':'','isAlreadyLogged':_0x5f4f78[_0x7546('0x19')]});});}})(_0x51caea,_0x1ab151,_0x3f952a);};passport[_0x7546('0x29')](_0x7546('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x7546('0x2b')},function(_0x1f567e,_0x499bd3,_0x591378){return ActiveDirectoryAuthenticate(db[_0x7546('0x2c')],_0x1f567e,_0x499bd3,_0x591378);}));
\ No newline at end of file
+var _0x7649=['inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','admin','user','agent','disabled','blockedAt','add','minutes','getLicense','catch','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','User','passport','passport-local','Strategy','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s'];(function(_0x5d2840,_0x3233e3){var _0x5f3555=function(_0x5550d0){while(--_0x5550d0){_0x5d2840['push'](_0x5d2840['shift']());}};_0x5f3555(++_0x3233e3);}(_0x7649,0x11f));var _0x9764=function(_0x274989,_0x34a495){_0x274989=_0x274989-0x0;var _0x334ac5=_0x7649[_0x274989];return _0x334ac5;};'use strict';var passport=require(_0x9764('0x0'));var LocalStrategy=require(_0x9764('0x1'))[_0x9764('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x9764('0x3'));var BPromise=require('bluebird');var util=require(_0x9764('0x4'));var db=require(_0x9764('0x5'))['db'];var authService=require(_0x9764('0x6'));var utils=require(_0x9764('0x7'));var config=require(_0x9764('0x8'));var logger=require(_0x9764('0x9'))(_0x9764('0xa'));function isActiveDirectoryConfigured(_0x41e071){var _0x4a1e07=![];if(typeof _0x41e071[_0x9764('0xb')]!==_0x9764('0xc')){_0x4a1e07=_0x41e071[_0x9764('0xb')][_0x9764('0xd')]&&_0x41e071[_0x9764('0xb')][_0x9764('0xe')]&&_0x41e071[_0x9764('0xb')][_0x9764('0xf')];}return _0x4a1e07;}function adAuthenticate(_0x3addca,_0x1b957c,_0x221d33){return new BPromise(function(_0xafef82,_0x343186){try{var _0x1a858f=new ActiveDirectory(_0x3addca);_0x1a858f[_0x9764('0x10')](_0x1b957c,_0x221d33,function(_0x208675,_0x5e7c01){if(_0x208675){logger[_0x9764('0x11')](_0x9764('0x12'),_0x1b957c,util[_0x9764('0x13')](_0x208675,{'showHidden':![],'depth':null}));_0x343186(_0x9764('0x14'));}else if(!_0x5e7c01){logger[_0x9764('0x11')](_0x9764('0x15'),_0x1b957c);_0x343186('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xafef82(_0x5e7c01);}});}catch(_0x4f0ab9){_0x343186(_0x4f0ab9);}});}function ActiveDirectoryAuthenticate(_0x7a19d7,_0x110ff1,_0x5abb2d,_0x301c37){var _0x276fa8,_0x258705;if(!isActiveDirectoryConfigured(config)){logger[_0x9764('0x11')](_0x9764('0x16'),_0x110ff1);return _0x301c37(null,![],{'message':_0x9764('0x14')});}return db[_0x9764('0x17')][_0x9764('0x18')]({'where':{'id':0x1},'attributes':[_0x9764('0x19'),_0x9764('0x1a')],'raw':!![]})[_0x9764('0x1b')](function(_0x46bbd8){_0x276fa8=_0x46bbd8;if(!_0x276fa8['adSsoEnabled']){logger[_0x9764('0x11')](_0x9764('0x1c'),_0x110ff1);throw new Error(_0x9764('0x14'));}return _0x7a19d7[_0x9764('0x18')]({'attributes':['id',_0x9764('0x1d'),_0x9764('0x1e'),_0x9764('0x1f'),_0x9764('0x20'),'disabled',_0x9764('0x21'),'blockedAt','online'],'where':{'name':_0x110ff1,'role':{'$or':[_0x9764('0x22'),_0x9764('0x23'),_0x9764('0x24')]},'adSsoEnabled':!![]}});})['then'](function(_0x155d35){if(!_0x155d35||_0x155d35&&_0x155d35['name']!==_0x110ff1){throw new Error(_0x9764('0x14'));}_0x258705=_0x155d35;var _0x33a3c2=_0x258705[_0x9764('0x1d')]+'@'+config[_0x9764('0xb')]['domain'];return adAuthenticate(config[_0x9764('0xb')],_0x33a3c2,_0x5abb2d);})[_0x9764('0x1b')](function(_0x3223b3){if(_0x258705[_0x9764('0x25')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x276fa8[_0x9764('0x1a')]>0x0){if(_0x258705[_0x9764('0x21')]){if(moment(_0x258705[_0x9764('0x26')])[_0x9764('0x27')](_0x276fa8[_0x9764('0x1a')],_0x9764('0x28'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x258705,0x0,![],null)[_0x9764('0x1b')](function(){return utils['getLicense'](_0x258705);})[_0x9764('0x1b')](function(){return _0x301c37(null,_0x258705);});}else{return utils[_0x9764('0x29')](_0x258705)['then'](function(){return _0x301c37(null,_0x258705);});}}else{return utils['getLicense'](_0x258705)[_0x9764('0x1b')](function(){return _0x301c37(null,_0x258705);});}})[_0x9764('0x2a')](function(_0x695359){return _0x301c37(null,![],_0x695359);});}function handleError(_0x363afb,_0x4ead44,_0x5ef3cd){return _0x363afb[_0x9764('0x2b')](_0x4ead44||0x1f4)[_0x9764('0x2c')]({'message':_0x5ef3cd?_0x5ef3cd[_0x9764('0x2d')]||_0x5ef3cd:''});}exports['login']=function(_0x100baf,_0x252e3b,_0x5ba766){passport['authenticate']('ad-login',function(_0x427050,_0x5956d3,_0x3b5596){var _0x48fb7a=_0x427050||_0x3b5596;if(_0x48fb7a){return handleError(_0x252e3b,0x191,_0x48fb7a);}if(!_0x5956d3){return handleError(_0x252e3b,0x194,{'message':_0x9764('0x2e')});}else{var _0x562611={'payload':{'id':_0x5956d3['id'],'role':_0x5956d3[_0x9764('0x20')]},'options':{'expiresIn':0x15180}};return authService[_0x9764('0x2f')](_0x562611)[_0x9764('0x1b')](function(_0x175da3){_0x252e3b['json']({'id':_0x5956d3['id'],'token':_0x175da3,'statusCall':'','isAlreadyLogged':_0x5956d3[_0x9764('0x30')]});});}})(_0x100baf,_0x252e3b,_0x5ba766);};passport[_0x9764('0x31')]('ad-login',new LocalStrategy({'usernameField':_0x9764('0x1d'),'passwordField':_0x9764('0x1e')},function(_0x304d23,_0x54a9f3,_0x34ec33){return ActiveDirectoryAuthenticate(db[_0x9764('0x32')],_0x304d23,_0x54a9f3,_0x34ec33);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index a71b791..11c60ec 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e7a=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x12e6ff,_0x81cde2){var _0x40ea1c=function(_0x2faaef){while(--_0x2faaef){_0x12e6ff['push'](_0x12e6ff['shift']());}};_0x40ea1c(++_0x81cde2);}(_0x7e7a,0x1a8));var _0xa7e7=function(_0x20c361,_0x22697c){_0x20c361=_0x20c361-0x0;var _0x2ad721=_0x7e7a[_0x20c361];return _0x2ad721;};'use strict';var express=require(_0xa7e7('0x0'));var router=express[_0xa7e7('0x1')]();var controller=require(_0xa7e7('0x2'));router[_0xa7e7('0x3')]('/',controller[_0xa7e7('0x4')]);module[_0xa7e7('0x5')]=router;
\ No newline at end of file
+var _0x9c45=['post','login','Router','./authActiveDirectory.controller'];(function(_0x2b1a98,_0x4c9c43){var _0x457556=function(_0x4e2c1c){while(--_0x4e2c1c){_0x2b1a98['push'](_0x2b1a98['shift']());}};_0x457556(++_0x4c9c43);}(_0x9c45,0x12a));var _0x59c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c45[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0x59c4('0x0')]();var controller=require(_0x59c4('0x1'));router[_0x59c4('0x2')]('/',controller[_0x59c4('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e92d0c3..ead9bb6 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x55380a,_0x536668){var _0x333037=function(_0x1ab290){while(--_0x1ab290){_0x55380a['push'](_0x55380a['shift']());}};_0x333037(++_0x536668);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x24fb83,_0x18caba){var _0x445a66=function(_0x3e4a23){while(--_0x3e4a23){_0x24fb83['push'](_0x24fb83['shift']());}};_0x445a66(++_0x18caba);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index bddc58f..037c734 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 _0xc7b9=['/callback','callback','isMiddleware','setTokenCookie','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xc7b9,0x1da));var _0x9c7b=function(_0x4ecd43,_0x4e2e28){_0x4ecd43=_0x4ecd43-0x0;var _0xf3bc9c=_0xc7b9[_0x4ecd43];return _0xf3bc9c;};'use strict';var express=require(_0x9c7b('0x0'));var passport=require(_0x9c7b('0x1'));var router=express['Router']();var controller=require(_0x9c7b('0x2'));var userController=require(_0x9c7b('0x3'));var authService=require(_0x9c7b('0x4'));router['get']('/',controller[_0x9c7b('0x5')]);router['get'](_0x9c7b('0x6'),controller[_0x9c7b('0x7')],authService[_0x9c7b('0x8')],userController['login'],authService[_0x9c7b('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0xf5be=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','setTokenCookie','express'];(function(_0x48475b,_0x4d3077){var _0x3b241a=function(_0x5c4a49){while(--_0x5c4a49){_0x48475b['push'](_0x48475b['shift']());}};_0x3b241a(++_0x4d3077);}(_0xf5be,0x107));var _0xef5b=function(_0x20e255,_0x1cf24a){_0x20e255=_0x20e255-0x0;var _0x4c9db6=_0xf5be[_0x20e255];return _0x4c9db6;};'use strict';var express=require(_0xef5b('0x0'));var passport=require(_0xef5b('0x1'));var router=express[_0xef5b('0x2')]();var controller=require(_0xef5b('0x3'));var userController=require(_0xef5b('0x4'));var authService=require(_0xef5b('0x5'));router['get']('/',controller[_0xef5b('0x6')]);router[_0xef5b('0x7')](_0xef5b('0x8'),controller[_0xef5b('0x9')],authService[_0xef5b('0xa')],userController[_0xef5b('0x6')],authService[_0xef5b('0xb')]);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 44e334e..9d28ac1 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 _0x5a1a=['util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','find','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','local-login'];(function(_0x39933f,_0x569b3f){var _0x326e4b=function(_0x2f37fc){while(--_0x2f37fc){_0x39933f['push'](_0x39933f['shift']());}};_0x326e4b(++_0x569b3f);}(_0x5a1a,0xff));var _0xa5a1=function(_0x27efcf,_0x320952){_0x27efcf=_0x27efcf-0x0;var _0xdb0237=_0x5a1a[_0x27efcf];return _0xdb0237;};'use strict';var util=require(_0xa5a1('0x0'));var passport=require(_0xa5a1('0x1'));var LocalStrategy=require(_0xa5a1('0x2'))[_0xa5a1('0x3')];var jayson=require(_0xa5a1('0x4'));var _=require(_0xa5a1('0x5'));var rs=require(_0xa5a1('0x6'));var moment=require(_0xa5a1('0x7'));var db=require(_0xa5a1('0x8'))['db'];var authService=require(_0xa5a1('0x9'));var utils=require(_0xa5a1('0xa'));var client=jayson['client'][_0xa5a1('0xb')]({'port':0x232b});function localAuthenticate(_0x3ba8ca,_0x508776,_0x3431a1,_0x217815){var _0x3f0102,_0x34fe2c;return db[_0xa5a1('0xc')][_0xa5a1('0xd')]({'where':{'id':0x1},'attributes':[_0xa5a1('0xe'),_0xa5a1('0xf')],'raw':!![]})[_0xa5a1('0x10')](function(_0x1559b0){_0x3f0102=_0x1559b0;return _0x3ba8ca['findOne']({'attributes':['id',_0xa5a1('0x11'),_0xa5a1('0x12'),_0xa5a1('0x13'),_0xa5a1('0x14'),_0xa5a1('0x15'),_0xa5a1('0x16'),_0xa5a1('0x17'),'loginAttempts'],'where':{'name':_0x508776,'role':{'$or':[_0xa5a1('0x18'),_0xa5a1('0x19'),_0xa5a1('0x1a')]}}});})[_0xa5a1('0x10')](function(_0x223453){if(!_0x223453||_0x223453&&_0x223453[_0xa5a1('0x11')]!==_0x508776){throw new Error(_0xa5a1('0x1b'));}else{_0x34fe2c=_0x223453;return _0x34fe2c;}})[_0xa5a1('0x10')](function(){_0x34fe2c[_0xa5a1('0x1c')](_0x3431a1,function(_0x177c58,_0x665e19){var _0x4f2b94=_0x34fe2c[_0xa5a1('0x1d')]+0x1;if(_0x177c58){return _0x217815(_0x177c58);}else if(!_0x665e19){if(_0x34fe2c['disabled']){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}else if(_0x3f0102[_0xa5a1('0xe')]>0x0){if(_0x34fe2c[_0xa5a1('0x16')]){if(_0x3f0102[_0xa5a1('0xf')]>0x0){if(moment(_0x34fe2c['blockedAt'])[_0xa5a1('0x1e')](_0x3f0102[_0xa5a1('0xf')],'minutes')>moment()){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}else{return utils['clearBlockUser'](_0x34fe2c,_0x4f2b94,![],null)[_0xa5a1('0x10')](function(){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});});}}else{return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}}else{if(_0x4f2b94>=_0x3f0102[_0xa5a1('0xe')]){return utils[_0xa5a1('0x1f')](_0x34fe2c,0x0,!![],moment())['then'](function(){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});});}else{return utils[_0xa5a1('0x1f')](_0x34fe2c,_0x4f2b94,![],null)[_0xa5a1('0x10')](function(){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});});}}}else{return _0x217815(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x34fe2c[_0xa5a1('0x15')]){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}else if(_0x3f0102[_0xa5a1('0xe')]>0x0){if(_0x34fe2c[_0xa5a1('0x16')]){if(_0x3f0102[_0xa5a1('0xf')]>0x0){if(moment(_0x34fe2c[_0xa5a1('0x17')])['add'](_0x3f0102[_0xa5a1('0xf')],_0xa5a1('0x20'))>moment()){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}else{return utils[_0xa5a1('0x1f')](_0x34fe2c,0x0,![],null)[_0xa5a1('0x10')](function(){return utils[_0xa5a1('0x21')](_0x34fe2c);})['then'](function(){return _0x217815(null,_0x34fe2c);});}}else{return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}}else{return utils[_0xa5a1('0x1f')](_0x34fe2c,0x0,![],null)['then'](function(){return utils[_0xa5a1('0x21')](_0x34fe2c);})['then'](function(){return _0x217815(null,_0x34fe2c);})[_0xa5a1('0x22')](function(_0x343c3d){return _0x217815(null,![],_0x343c3d);});}}else{if(_0x34fe2c['blocked']){return _0x217815(null,![],{'message':_0xa5a1('0x1b')});}else{return utils[_0xa5a1('0x21')](_0x34fe2c)[_0xa5a1('0x10')](function(){return _0x217815(null,_0x34fe2c);});}}}});})[_0xa5a1('0x22')](function(_0x2e4da8){return _0x217815(null,![],_0x2e4da8);});}function sendServiceMail(_0x26ce2d){return db[_0xa5a1('0x23')]['find']({'where':{'service':!![]},'attributes':['id',_0xa5a1('0x11'),_0xa5a1('0x24')],'include':[{'model':db['MailServerOut'],'as':_0xa5a1('0x25'),'include':[{'model':db['CloudProvider'],'as':_0xa5a1('0x26')}]}]})[_0xa5a1('0x10')](function(_0x2fca7c){if(!_0x2fca7c){throw new Error(_0xa5a1('0x27'));}var _0x54d5b2=_0x2fca7c[_0xa5a1('0x28')]();var _0xa38359={'account':_0x54d5b2,'message':_[_0xa5a1('0x29')]({'from':util[_0xa5a1('0x2a')](_0xa5a1('0x2b'),_0x2fca7c[_0xa5a1('0x11')],_0x2fca7c[_0xa5a1('0x24')]||_0x2fca7c[_0xa5a1('0x25')][_0xa5a1('0x19')])},_0x26ce2d)};return client[_0xa5a1('0x2c')](_0xa5a1('0x2d'),_0xa38359);})['then'](function(_0x43309a){if(_0x43309a[_0xa5a1('0x2e')]){throw new Error(util[_0xa5a1('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x43309a['error'][_0xa5a1('0x2f')]||JSON[_0xa5a1('0x30')](_0x43309a[_0xa5a1('0x2e')])));}return!![];});}function handleError(_0x7abeae,_0x30fd2d,_0x2279b3){return _0x7abeae['status'](_0x30fd2d||0x1f4)[_0xa5a1('0x31')]({'message':_0x2279b3?_0x2279b3[_0xa5a1('0x2f')]||_0x2279b3:''});}exports['login']=function(_0x3bdb03,_0x53a074,_0x4c4158){passport[_0xa5a1('0x1c')]('local-login',function(_0x1770d7,_0x2e49ea,_0x5d1eb9){var _0xe6ddf2=_0x1770d7||_0x5d1eb9;if(_0xe6ddf2){return handleError(_0x53a074,0x191,_0xe6ddf2);}if(!_0x2e49ea){return handleError(_0x53a074,0x194,{'message':_0xa5a1('0x32')});}else{var _0x171ca2={'payload':{'id':_0x2e49ea['id'],'role':_0x2e49ea[_0xa5a1('0x14')]},'options':{'expiresIn':0x15180}};return authService[_0xa5a1('0x33')](_0x171ca2)['then'](function(_0x99b982){_0x53a074['json']({'id':_0x2e49ea['id'],'token':_0x99b982,'statusCall':'','isAlreadyLogged':_0x2e49ea['online']});});}})(_0x3bdb03,_0x53a074,_0x4c4158);};exports[_0xa5a1('0x34')]=function(_0x949f88,_0x152114){if(!_0x949f88[_0xa5a1('0x35')][_0xa5a1('0x24')]){return handleError(_0x152114,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1b9caa=rs[_0xa5a1('0x36')]();_0x949f88[_0xa5a1('0x35')][_0xa5a1('0x24')]=_0x949f88[_0xa5a1('0x35')][_0xa5a1('0x24')][_0xa5a1('0x37')]()[_0xa5a1('0x38')]();var _0x87092c;return db[_0xa5a1('0xc')][_0xa5a1('0xd')]({'where':{'id':0x1},'attributes':[_0xa5a1('0xe'),_0xa5a1('0xf')],'raw':!![]})[_0xa5a1('0x10')](function(_0x39ef02){_0x87092c=_0x39ef02;return db[_0xa5a1('0x39')]['find']({'where':{'email':_0x949f88[_0xa5a1('0x35')][_0xa5a1('0x24')]}});})[_0xa5a1('0x10')](function(_0x3ab7c7){if(!_0x3ab7c7){throw new Error(_0xa5a1('0x3a'));}if(_0x3ab7c7['disabled']){throw new Error(_0xa5a1('0x3b'));}if(_0x3ab7c7[_0xa5a1('0x16')]){if(moment(_0x3ab7c7[_0xa5a1('0x17')])[_0xa5a1('0x1e')](_0x87092c[_0xa5a1('0xf')],'minutes')>moment()){throw new Error(_0xa5a1('0x3c'));}else{_0x3ab7c7['blocked']=![];_0x3ab7c7[_0xa5a1('0x17')]=null;}}_0x3ab7c7['resetPasswordToken']=_0x1b9caa;_0x3ab7c7[_0xa5a1('0x3d')]=Date['now']()+0x36ee80;return _0x3ab7c7[_0xa5a1('0x3e')]();})[_0xa5a1('0x10')](function(){return sendServiceMail({'to':_0x949f88[_0xa5a1('0x35')]['email'],'subject':_0xa5a1('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xa5a1('0x40')+_0xa5a1('0x41')+_0x949f88[_0xa5a1('0x42')][_0xa5a1('0x43')]+_0xa5a1('0x44')+_0x1b9caa+'\x0a\x0a'+_0xa5a1('0x45')});})['then'](function(){_0x152114[_0xa5a1('0x46')](0xc8)[_0xa5a1('0x31')]({'message':_0xa5a1('0x47')});})[_0xa5a1('0x22')](function(_0x9a0bee){return handleError(_0x152114,0x1f4,_0x9a0bee);});};exports['reset']=function(_0x13284b,_0x14ea73){return db[_0xa5a1('0x39')][_0xa5a1('0x48')]({'where':{'resetPasswordToken':_0x13284b[_0xa5a1('0x49')][_0xa5a1('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xa5a1('0x10')](function(_0x4805cc){if(!_0x4805cc){throw new Error(_0xa5a1('0x4b'));}return db[_0xa5a1('0xc')][_0xa5a1('0xd')]({'attributes':['id',_0xa5a1('0x4c'),_0xa5a1('0x4d'),_0xa5a1('0x4e')]})[_0xa5a1('0x10')](function(_0xcb4843){if(_0xcb4843[_0xa5a1('0x4c')])authService[_0xa5a1('0x4f')](_0x13284b[_0xa5a1('0x35')][_0xa5a1('0x12')]);if(!_0xcb4843['enforcePasswordHistory']||!_0x4805cc[_0xa5a1('0x50')])return _0x4805cc;authService[_0xa5a1('0x51')](_0x13284b['body'][_0xa5a1('0x12')],_0x4805cc[_0xa5a1('0x50')],_0xcb4843[_0xa5a1('0x4e')]);return _0x4805cc;})[_0xa5a1('0x10')](function(){_0x4805cc[_0xa5a1('0x12')]=_0x13284b[_0xa5a1('0x35')]['password'];_0x4805cc['resetPasswordToken']=null;_0x4805cc[_0xa5a1('0x3d')]=null;return _0x4805cc['save']();});})[_0xa5a1('0x10')](function(){_0x14ea73[_0xa5a1('0x46')](0xc8)['send']({'message':_0xa5a1('0x52')});})[_0xa5a1('0x22')](function(_0x1dd910){return handleError(_0x14ea73,0x1f4,_0x1dd910);});};passport[_0xa5a1('0x53')](_0xa5a1('0x54'),new LocalStrategy({'usernameField':_0xa5a1('0x11'),'passwordField':_0xa5a1('0x12')},function(_0x22c4d1,_0x5db419,_0x5ee097){return localAuthenticate(db[_0xa5a1('0x39')],_0x22c4d1,_0x5db419,_0x5ee097);}));
\ No newline at end of file
+var _0x1b38=['find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','body','generate','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','blockDuration','add','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','MailAccount'];(function(_0x30e55c,_0x407005){var _0x1683c7=function(_0x4a1d46){while(--_0x4a1d46){_0x30e55c['push'](_0x30e55c['shift']());}};_0x1683c7(++_0x407005);}(_0x1b38,0x12d));var _0x81b3=function(_0x322c2f,_0x254da0){_0x322c2f=_0x322c2f-0x0;var _0x33994f=_0x1b38[_0x322c2f];return _0x33994f;};'use strict';var util=require(_0x81b3('0x0'));var passport=require(_0x81b3('0x1'));var LocalStrategy=require(_0x81b3('0x2'))[_0x81b3('0x3')];var jayson=require('jayson/promise');var _=require(_0x81b3('0x4'));var rs=require(_0x81b3('0x5'));var moment=require(_0x81b3('0x6'));var db=require(_0x81b3('0x7'))['db'];var authService=require(_0x81b3('0x8'));var utils=require('../../config/utils');var client=jayson[_0x81b3('0x9')][_0x81b3('0xa')]({'port':0x232b});function localAuthenticate(_0x4ce1f3,_0x47542d,_0x2d8eff,_0x1cdb80){var _0x5ee89c,_0x494f69;return db[_0x81b3('0xb')][_0x81b3('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x81b3('0xd')](function(_0x3749d7){_0x5ee89c=_0x3749d7;return _0x4ce1f3['findOne']({'attributes':['id',_0x81b3('0xe'),_0x81b3('0xf'),_0x81b3('0x10'),_0x81b3('0x11'),'disabled','blocked',_0x81b3('0x12'),_0x81b3('0x13')],'where':{'name':_0x47542d,'role':{'$or':[_0x81b3('0x14'),_0x81b3('0x15'),_0x81b3('0x16')]}}});})[_0x81b3('0xd')](function(_0x45a6f4){if(!_0x45a6f4||_0x45a6f4&&_0x45a6f4[_0x81b3('0xe')]!==_0x47542d){throw new Error(_0x81b3('0x17'));}else{_0x494f69=_0x45a6f4;return _0x494f69;}})[_0x81b3('0xd')](function(){_0x494f69[_0x81b3('0x18')](_0x2d8eff,function(_0x2a9d79,_0x520f29){var _0x1555f9=_0x494f69[_0x81b3('0x13')]+0x1;if(_0x2a9d79){return _0x1cdb80(_0x2a9d79);}else if(!_0x520f29){if(_0x494f69[_0x81b3('0x19')]){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5ee89c['allowedLoginAttempts']>0x0){if(_0x494f69[_0x81b3('0x1a')]){if(_0x5ee89c[_0x81b3('0x1b')]>0x0){if(moment(_0x494f69[_0x81b3('0x12')])[_0x81b3('0x1c')](_0x5ee89c[_0x81b3('0x1b')],'minutes')>moment()){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x81b3('0x1d')](_0x494f69,_0x1555f9,![],null)[_0x81b3('0xd')](function(){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});});}}else{return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}}else{if(_0x1555f9>=_0x5ee89c[_0x81b3('0x1e')]){return utils[_0x81b3('0x1d')](_0x494f69,0x0,!![],moment())[_0x81b3('0xd')](function(){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});});}else{return utils[_0x81b3('0x1d')](_0x494f69,_0x1555f9,![],null)[_0x81b3('0xd')](function(){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x494f69[_0x81b3('0x19')]){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}else if(_0x5ee89c[_0x81b3('0x1e')]>0x0){if(_0x494f69[_0x81b3('0x1a')]){if(_0x5ee89c[_0x81b3('0x1b')]>0x0){if(moment(_0x494f69[_0x81b3('0x12')])[_0x81b3('0x1c')](_0x5ee89c[_0x81b3('0x1b')],_0x81b3('0x1f'))>moment()){return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}else{return utils[_0x81b3('0x1d')](_0x494f69,0x0,![],null)[_0x81b3('0xd')](function(){return utils[_0x81b3('0x20')](_0x494f69);})[_0x81b3('0xd')](function(){return _0x1cdb80(null,_0x494f69);});}}else{return _0x1cdb80(null,![],{'message':_0x81b3('0x17')});}}else{return utils[_0x81b3('0x1d')](_0x494f69,0x0,![],null)['then'](function(){return utils[_0x81b3('0x20')](_0x494f69);})[_0x81b3('0xd')](function(){return _0x1cdb80(null,_0x494f69);})[_0x81b3('0x21')](function(_0x1b26ad){return _0x1cdb80(null,![],_0x1b26ad);});}}else{if(_0x494f69['blocked']){return _0x1cdb80(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x81b3('0x20')](_0x494f69)[_0x81b3('0xd')](function(){return _0x1cdb80(null,_0x494f69);});}}}});})[_0x81b3('0x21')](function(_0x1f49f7){return _0x1cdb80(null,![],_0x1f49f7);});}function sendServiceMail(_0x1da86a){return db[_0x81b3('0x22')][_0x81b3('0x23')]({'where':{'service':!![]},'attributes':['id',_0x81b3('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x81b3('0x24'),'include':[{'model':db['CloudProvider'],'as':_0x81b3('0x25')}]}]})[_0x81b3('0xd')](function(_0x190bcc){if(!_0x190bcc){throw new Error(_0x81b3('0x26'));}var _0x9dd9be=_0x190bcc[_0x81b3('0x27')]();var _0x1f5e88={'account':_0x9dd9be,'message':_[_0x81b3('0x28')]({'from':util['format'](_0x81b3('0x29'),_0x190bcc[_0x81b3('0xe')],_0x190bcc[_0x81b3('0x2a')]||_0x190bcc['Smtp'][_0x81b3('0x15')])},_0x1da86a)};return client[_0x81b3('0x2b')]('SendMail',_0x1f5e88);})[_0x81b3('0xd')](function(_0x26ca99){if(_0x26ca99[_0x81b3('0x2c')]){throw new Error(util[_0x81b3('0x2d')](_0x81b3('0x2e'),_0x26ca99[_0x81b3('0x2c')][_0x81b3('0x2f')]||JSON[_0x81b3('0x30')](_0x26ca99[_0x81b3('0x2c')])));}return!![];});}function handleError(_0x3d809e,_0x23ea2b,_0x384264){return _0x3d809e[_0x81b3('0x31')](_0x23ea2b||0x1f4)[_0x81b3('0x32')]({'message':_0x384264?_0x384264[_0x81b3('0x2f')]||_0x384264:''});}exports[_0x81b3('0x33')]=function(_0x1ec3d7,_0x1c4464,_0x5205af){passport[_0x81b3('0x18')](_0x81b3('0x34'),function(_0x217e2f,_0x5c6698,_0x5ccd05){var _0xe719e0=_0x217e2f||_0x5ccd05;if(_0xe719e0){return handleError(_0x1c4464,0x191,_0xe719e0);}if(!_0x5c6698){return handleError(_0x1c4464,0x194,{'message':_0x81b3('0x35')});}else{var _0x5469a2={'payload':{'id':_0x5c6698['id'],'role':_0x5c6698['role']},'options':{'expiresIn':0x15180}};return authService[_0x81b3('0x36')](_0x5469a2)[_0x81b3('0xd')](function(_0x4565d9){_0x1c4464['json']({'id':_0x5c6698['id'],'token':_0x4565d9,'statusCall':'','isAlreadyLogged':_0x5c6698[_0x81b3('0x37')]});});}})(_0x1ec3d7,_0x1c4464,_0x5205af);};exports['forgot']=function(_0x6a0891,_0x2cd792){if(!_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')]){return handleError(_0x2cd792,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3ad444=rs[_0x81b3('0x39')]();_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')]=_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')][_0x81b3('0x3a')]()['toLowerCase']();var _0x5279c4;return db[_0x81b3('0xb')][_0x81b3('0xc')]({'where':{'id':0x1},'attributes':[_0x81b3('0x1e'),_0x81b3('0x1b')],'raw':!![]})[_0x81b3('0xd')](function(_0x43b13f){_0x5279c4=_0x43b13f;return db['User'][_0x81b3('0x23')]({'where':{'email':_0x6a0891[_0x81b3('0x38')][_0x81b3('0x2a')]}});})['then'](function(_0x3a9693){if(!_0x3a9693){throw new Error(_0x81b3('0x3b'));}if(_0x3a9693[_0x81b3('0x19')]){throw new Error(_0x81b3('0x3c'));}if(_0x3a9693[_0x81b3('0x1a')]){if(moment(_0x3a9693[_0x81b3('0x12')])[_0x81b3('0x1c')](_0x5279c4[_0x81b3('0x1b')],_0x81b3('0x1f'))>moment()){throw new Error(_0x81b3('0x3d'));}else{_0x3a9693[_0x81b3('0x1a')]=![];_0x3a9693[_0x81b3('0x12')]=null;}}_0x3a9693[_0x81b3('0x3e')]=_0x3ad444;_0x3a9693['resetPasswordExpires']=Date[_0x81b3('0x3f')]()+0x36ee80;return _0x3a9693[_0x81b3('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x6a0891[_0x81b3('0x38')]['email'],'subject':_0x81b3('0x41'),'text':_0x81b3('0x42')+_0x81b3('0x43')+_0x81b3('0x44')+_0x6a0891['headers']['host']+_0x81b3('0x45')+_0x3ad444+'\x0a\x0a'+_0x81b3('0x46')});})['then'](function(){_0x2cd792[_0x81b3('0x31')](0xc8)[_0x81b3('0x32')]({'message':_0x81b3('0x47')});})['catch'](function(_0x5b2cda){return handleError(_0x2cd792,0x1f4,_0x5b2cda);});};exports[_0x81b3('0x48')]=function(_0x10a26d,_0x2a537b){return db[_0x81b3('0x49')]['find']({'where':{'resetPasswordToken':_0x10a26d[_0x81b3('0x4a')][_0x81b3('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x81b3('0x3f')]()}}})[_0x81b3('0xd')](function(_0x26bfce){if(!_0x26bfce){throw new Error(_0x81b3('0x4c'));}return db[_0x81b3('0xb')][_0x81b3('0xc')]({'attributes':['id',_0x81b3('0x4d'),_0x81b3('0x4e'),_0x81b3('0x4f')]})[_0x81b3('0xd')](function(_0x5d2de4){if(_0x5d2de4[_0x81b3('0x4d')])authService['validatePasswordPattern'](_0x10a26d[_0x81b3('0x38')][_0x81b3('0xf')]);if(!_0x5d2de4[_0x81b3('0x4e')]||!_0x26bfce['previousPasswords'])return _0x26bfce;authService[_0x81b3('0x50')](_0x10a26d['body']['password'],_0x26bfce[_0x81b3('0x51')],_0x5d2de4['passwordHistoryLimit']);return _0x26bfce;})[_0x81b3('0xd')](function(){_0x26bfce[_0x81b3('0xf')]=_0x10a26d[_0x81b3('0x38')][_0x81b3('0xf')];_0x26bfce[_0x81b3('0x3e')]=null;_0x26bfce['resetPasswordExpires']=null;return _0x26bfce[_0x81b3('0x40')]();});})[_0x81b3('0xd')](function(){_0x2a537b[_0x81b3('0x31')](0xc8)[_0x81b3('0x32')]({'message':_0x81b3('0x52')});})['catch'](function(_0x175e15){return handleError(_0x2a537b,0x1f4,_0x175e15);});};passport[_0x81b3('0x53')](_0x81b3('0x34'),new LocalStrategy({'usernameField':_0x81b3('0xe'),'passwordField':_0x81b3('0xf')},function(_0x4cc439,_0x647e3d,_0x4547ff){return localAuthenticate(db['User'],_0x4cc439,_0x647e3d,_0x4547ff);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 76a1af9..8a1db0d 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 _0xc499=['login','/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post'];(function(_0x101be8,_0x1ea713){var _0x32fb9c=function(_0x375ad3){while(--_0x375ad3){_0x101be8['push'](_0x101be8['shift']());}};_0x32fb9c(++_0x1ea713);}(_0xc499,0x1e3));var _0x9c49=function(_0xed9c99,_0x2217b1){_0xed9c99=_0xed9c99-0x0;var _0x5443a1=_0xc499[_0xed9c99];return _0x5443a1;};'use strict';var express=require('express');var router=express[_0x9c49('0x0')]();var controller=require(_0x9c49('0x1'));router[_0x9c49('0x2')]('/',controller[_0x9c49('0x3')]);router[_0x9c49('0x2')](_0x9c49('0x4'),controller[_0x9c49('0x5')]);router[_0x9c49('0x2')](_0x9c49('0x6'),controller[_0x9c49('0x7')]);module[_0x9c49('0x8')]=router;
\ No newline at end of file
+var _0x4a08=['./authLocal.controller','post','/forgot','/reset/:token','reset','Router'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x4a08,0xb3));var _0x84a0=function(_0x461d6e,_0x4e622c){_0x461d6e=_0x461d6e-0x0;var _0x4f2620=_0x4a08[_0x461d6e];return _0x4f2620;};'use strict';var express=require('express');var router=express[_0x84a0('0x0')]();var controller=require(_0x84a0('0x1'));router[_0x84a0('0x2')]('/',controller['login']);router[_0x84a0('0x2')](_0x84a0('0x3'),controller['forgot']);router[_0x84a0('0x2')](_0x84a0('0x4'),controller[_0x84a0('0x5')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 941f5cd..a40dcbd 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 _0xe585=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2afd47,_0x59ccbb){var _0x5d95bd=function(_0x27d1d5){while(--_0x27d1d5){_0x2afd47['push'](_0x2afd47['shift']());}};_0x5d95bd(++_0x59ccbb);}(_0xe585,0x13f));var _0x5e58=function(_0x558207,_0x1a5222){_0x558207=_0x558207-0x0;var _0x4c8d28=_0xe585[_0x558207];return _0x4c8d28;};'use strict';var Sequelize=require(_0x5e58('0x0'));module[_0x5e58('0x1')]={'name':{'type':Sequelize[_0x5e58('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5e58('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5e58('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5e58('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x7c93=['INTEGER','exports','STRING','BOOLEAN'];(function(_0xe0aa5d,_0x3ff8b7){var _0x5c27aa=function(_0x454deb){while(--_0x454deb){_0xe0aa5d['push'](_0xe0aa5d['shift']());}};_0x5c27aa(++_0x3ff8b7);}(_0x7c93,0xf5));var _0x37c9=function(_0x18e49a,_0x5bf163){_0x18e49a=_0x18e49a-0x0;var _0x1397b5=_0x7c93[_0x18e49a];return _0x1397b5;};'use strict';var Sequelize=require('sequelize');module[_0x37c9('0x0')]={'name':{'type':Sequelize[_0x37c9('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x37c9('0x1')]},'description':{'type':Sequelize[_0x37c9('0x1')]},'status':{'type':Sequelize[_0x37c9('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x37c9('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 0c95be2..e7bc4fb 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 _0x9840=['jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','Automation','then','include','findAll','rows','catch','show','params','create','body','find','addConditions','ids','getConditions','findOne','Condition','filter','hasOwnProperty','addActions','Action','omit','getActions','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto'];(function(_0x149673,_0x282583){var _0x11e986=function(_0x5374bf){while(--_0x5374bf){_0x149673['push'](_0x149673['shift']());}};_0x11e986(++_0x282583);}(_0x9840,0x13d));var _0x0984=function(_0x10017e,_0x1615c4){_0x10017e=_0x10017e-0x0;var _0x5640d8=_0x9840[_0x10017e];return _0x5640d8;};'use strict';var emlformat=require(_0x0984('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0984('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0984('0x2'));var moment=require(_0x0984('0x3'));var BPromise=require(_0x0984('0x4'));var Mustache=require('mustache');var util=require(_0x0984('0x5'));var path=require(_0x0984('0x6'));var sox=require(_0x0984('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0984('0x8'));var _=require('lodash');var squel=require(_0x0984('0x9'));var crypto=require(_0x0984('0xa'));var jsforce=require(_0x0984('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0984('0xc'));var querystring=require(_0x0984('0xd'));var Papa=require('papaparse');var Redis=require(_0x0984('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0984('0xf'));var as=require(_0x0984('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0984('0x11'))(_0x0984('0x12'));var utils=require(_0x0984('0x13'));var config=require(_0x0984('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x241259,_0x4ce7d3){_0x4ce7d3=_0x4ce7d3||0xcc;return function(_0x402090){if(_0x402090){return _0x241259[_0x0984('0x15')](_0x4ce7d3);}return _0x241259[_0x0984('0x16')](_0x4ce7d3)['end']();};}function respondWithResult(_0xf9cef0,_0x45552a){_0x45552a=_0x45552a||0xc8;return function(_0x448e93){if(_0x448e93){return _0xf9cef0[_0x0984('0x16')](_0x45552a)[_0x0984('0x17')](_0x448e93);}};}function respondWithFilteredResult(_0x3ebb49,_0x5dc6b1){return function(_0x1333ba){if(_0x1333ba){var _0x5a48bb=typeof _0x5dc6b1[_0x0984('0x18')]===_0x0984('0x19')&&typeof _0x5dc6b1['limit']===_0x0984('0x19');var _0x2502fe=_0x1333ba[_0x0984('0x1a')];var _0x5b72ff=_0x5a48bb?0x0:_0x5dc6b1[_0x0984('0x18')];var _0x106867=_0x5a48bb?_0x1333ba[_0x0984('0x1a')]:_0x5dc6b1[_0x0984('0x18')]+_0x5dc6b1[_0x0984('0x1b')];var _0x14d8e8;if(_0x106867>=_0x2502fe){_0x106867=_0x2502fe;_0x14d8e8=0xc8;}else{_0x14d8e8=0xce;}_0x3ebb49['status'](_0x14d8e8);return _0x3ebb49[_0x0984('0x1c')](_0x0984('0x1d'),_0x5b72ff+'-'+_0x106867+'/'+_0x2502fe)[_0x0984('0x17')](_0x1333ba);}return null;};}function patchUpdates(_0x3e00bf){return function(_0x5879c2){try{jsonpatch[_0x0984('0x1e')](_0x5879c2,_0x3e00bf,!![]);}catch(_0xd36ffb){return BPromise[_0x0984('0x1f')](_0xd36ffb);}return _0x5879c2[_0x0984('0x20')]();};}function saveUpdates(_0x3f85d5,_0x2ff037){return function(_0x55fe36){if(_0x55fe36){return _0x55fe36[_0x0984('0x21')](_0x3f85d5)['then'](function(_0x4592f7){return _0x4592f7;});}return null;};}function removeEntity(_0x57f1e1,_0x57c311){return function(_0x29f4ac){if(_0x29f4ac){return _0x29f4ac[_0x0984('0x22')]()['then'](function(){_0x57f1e1['status'](0xcc)[_0x0984('0x23')]();});}};}function handleEntityNotFound(_0x22b751,_0x6f26f5){return function(_0x182d57){if(!_0x182d57){_0x22b751[_0x0984('0x15')](0x194);}return _0x182d57;};}function handleError(_0x4a1020,_0x2ccdc5){_0x2ccdc5=_0x2ccdc5||0x1f4;return function(_0x41f75c){logger[_0x0984('0x24')](_0x41f75c[_0x0984('0x25')]);if(_0x41f75c[_0x0984('0x26')]){delete _0x41f75c['name'];}_0x4a1020[_0x0984('0x16')](_0x2ccdc5)[_0x0984('0x27')](_0x41f75c);};}exports[_0x0984('0x28')]=function(_0x3bc235,_0xd0ae1a){var _0x5167d4={},_0x4f897c={},_0x2d9b76={'count':0x0,'rows':[]};var _0x5bcd60=_['map'](db['Automation'][_0x0984('0x29')],function(_0x1373d4){return{'name':_0x1373d4['fieldName'],'type':_0x1373d4[_0x0984('0x2a')]['key']};});_0x4f897c[_0x0984('0x2b')]=_[_0x0984('0x2c')](_0x5bcd60,_0x0984('0x26'));_0x4f897c['query']=_[_0x0984('0x2d')](_0x3bc235[_0x0984('0x2e')]);_0x4f897c[_0x0984('0x2f')]=_['intersection'](_0x4f897c[_0x0984('0x2b')],_0x4f897c[_0x0984('0x2e')]);_0x5167d4['attributes']=_[_0x0984('0x30')](_0x4f897c[_0x0984('0x2b')],qs[_0x0984('0x31')](_0x3bc235[_0x0984('0x2e')][_0x0984('0x31')]));_0x5167d4[_0x0984('0x32')]=_0x5167d4[_0x0984('0x32')][_0x0984('0x33')]?_0x5167d4[_0x0984('0x32')]:_0x4f897c[_0x0984('0x2b')];if(!_0x3bc235['query']['hasOwnProperty'](_0x0984('0x34'))){_0x5167d4[_0x0984('0x1b')]=qs[_0x0984('0x1b')](_0x3bc235['query'][_0x0984('0x1b')]);_0x5167d4[_0x0984('0x18')]=qs[_0x0984('0x18')](_0x3bc235[_0x0984('0x2e')]['offset']);}_0x5167d4[_0x0984('0x35')]=qs[_0x0984('0x36')](_0x3bc235[_0x0984('0x2e')][_0x0984('0x36')]);_0x5167d4[_0x0984('0x37')]=qs[_0x0984('0x2f')](_[_0x0984('0x38')](_0x3bc235['query'],_0x4f897c[_0x0984('0x2f')]),_0x5bcd60);if(_0x3bc235[_0x0984('0x2e')]['filter']){_0x5167d4[_0x0984('0x37')]=_[_0x0984('0x39')](_0x5167d4[_0x0984('0x37')],{'$or':_[_0x0984('0x2c')](_0x5bcd60,function(_0x343fc0){if(_0x343fc0[_0x0984('0x2a')]!==_0x0984('0x3a')){var _0x1fa46f={};_0x1fa46f[_0x343fc0['name']]={'$like':'%'+_0x3bc235[_0x0984('0x2e')]['filter']+'%'};return _0x1fa46f;}})});}_0x5167d4=_[_0x0984('0x39')]({},_0x5167d4,_0x3bc235[_0x0984('0x3b')]);var _0x536d1c={'where':_0x5167d4[_0x0984('0x37')]};return db[_0x0984('0x3c')][_0x0984('0x1a')](_0x536d1c)[_0x0984('0x3d')](function(_0x4e22c4){_0x2d9b76['count']=_0x4e22c4;if(_0x3bc235['query']['includeAll']){_0x5167d4[_0x0984('0x3e')]=[{'all':!![]}];}return db[_0x0984('0x3c')][_0x0984('0x3f')](_0x5167d4);})['then'](function(_0x2f2d7a){_0x2d9b76[_0x0984('0x40')]=_0x2f2d7a;return _0x2d9b76;})[_0x0984('0x3d')](respondWithFilteredResult(_0xd0ae1a,_0x5167d4))[_0x0984('0x41')](handleError(_0xd0ae1a,null));};exports[_0x0984('0x42')]=function(_0x35e6a2,_0x4d8c26){var _0x982021={'raw':![],'where':{'id':_0x35e6a2[_0x0984('0x43')]['id']}},_0x14808d={};_0x14808d[_0x0984('0x2b')]=_[_0x0984('0x2d')](db[_0x0984('0x3c')][_0x0984('0x29')]);_0x14808d[_0x0984('0x2e')]=_[_0x0984('0x2d')](_0x35e6a2['query']);_0x14808d[_0x0984('0x2f')]=_['intersection'](_0x14808d['model'],_0x14808d[_0x0984('0x2e')]);_0x982021[_0x0984('0x32')]=_[_0x0984('0x30')](_0x14808d[_0x0984('0x2b')],qs[_0x0984('0x31')](_0x35e6a2[_0x0984('0x2e')][_0x0984('0x31')]));_0x982021['attributes']=_0x982021[_0x0984('0x32')][_0x0984('0x33')]?_0x982021[_0x0984('0x32')]:_0x14808d[_0x0984('0x2b')];if(_0x35e6a2[_0x0984('0x2e')]['includeAll']){_0x982021[_0x0984('0x3e')]=[{'all':!![]}];}_0x982021=_[_0x0984('0x39')]({},_0x982021,_0x35e6a2[_0x0984('0x3b')]);return db[_0x0984('0x3c')]['find'](_0x982021)['then'](handleEntityNotFound(_0x4d8c26,null))[_0x0984('0x3d')](respondWithResult(_0x4d8c26,null))['catch'](handleError(_0x4d8c26,null));};exports[_0x0984('0x44')]=function(_0x51b2bd,_0xcfb155){return db[_0x0984('0x3c')][_0x0984('0x44')](_0x51b2bd[_0x0984('0x45')],{})['then'](respondWithResult(_0xcfb155,0xc9))[_0x0984('0x41')](handleError(_0xcfb155,null));};exports['update']=function(_0x5292bc,_0x1108c0){if(_0x5292bc['body']['id']){delete _0x5292bc[_0x0984('0x45')]['id'];}return db[_0x0984('0x3c')][_0x0984('0x46')]({'where':{'id':_0x5292bc[_0x0984('0x43')]['id']}})[_0x0984('0x3d')](handleEntityNotFound(_0x1108c0,null))[_0x0984('0x3d')](saveUpdates(_0x5292bc['body'],null))['then'](respondWithResult(_0x1108c0,null))[_0x0984('0x41')](handleError(_0x1108c0,null));};exports['destroy']=function(_0x2d659f,_0x2e71ba){return db[_0x0984('0x3c')][_0x0984('0x46')]({'where':{'id':_0x2d659f[_0x0984('0x43')]['id']}})[_0x0984('0x3d')](handleEntityNotFound(_0x2e71ba,null))[_0x0984('0x3d')](removeEntity(_0x2e71ba,null))['catch'](handleError(_0x2e71ba,null));};exports[_0x0984('0x47')]=function(_0x7bf39e,_0x56ec43,_0x1c5b16){return db['Condition'][_0x0984('0x46')]({'where':{'id':_0x7bf39e[_0x0984('0x43')]['id']}})[_0x0984('0x3d')](handleEntityNotFound(_0x56ec43,null))[_0x0984('0x3d')](function(_0x2f3563){if(_0x2f3563){return _0x2f3563['addConditions'](_0x7bf39e['body'][_0x0984('0x48')],_['omit'](_0x7bf39e[_0x0984('0x45')],[_0x0984('0x48'),'id'])||{});}})['then'](respondWithResult(_0x56ec43,null))[_0x0984('0x41')](handleError(_0x56ec43,null));};exports[_0x0984('0x49')]=function(_0x1b5381,_0x279bbe,_0x1b09a4){var _0x4f57ce={};var _0x19e3cb={};var _0x3a569f;var _0x50d37a;return db[_0x0984('0x3c')][_0x0984('0x4a')]({'where':{'id':_0x1b5381[_0x0984('0x43')]['id']}})['then'](handleEntityNotFound(_0x279bbe,null))[_0x0984('0x3d')](function(_0x4dad26){if(_0x4dad26){_0x3a569f=_0x4dad26;_0x19e3cb[_0x0984('0x2b')]=_['keys'](db[_0x0984('0x4b')][_0x0984('0x29')]);_0x19e3cb[_0x0984('0x2e')]=_[_0x0984('0x2d')](_0x1b5381[_0x0984('0x2e')]);_0x19e3cb[_0x0984('0x2f')]=_[_0x0984('0x30')](_0x19e3cb[_0x0984('0x2b')],_0x19e3cb[_0x0984('0x2e')]);_0x4f57ce[_0x0984('0x32')]=_[_0x0984('0x30')](_0x19e3cb[_0x0984('0x2b')],qs[_0x0984('0x31')](_0x1b5381[_0x0984('0x2e')][_0x0984('0x31')]));_0x4f57ce[_0x0984('0x32')]=_0x4f57ce[_0x0984('0x32')][_0x0984('0x33')]?_0x4f57ce[_0x0984('0x32')]:_0x19e3cb[_0x0984('0x2b')];_0x4f57ce[_0x0984('0x35')]=qs[_0x0984('0x36')](_0x1b5381[_0x0984('0x2e')][_0x0984('0x36')]);_0x4f57ce[_0x0984('0x37')]=qs[_0x0984('0x2f')](_[_0x0984('0x38')](_0x1b5381[_0x0984('0x2e')],_0x19e3cb[_0x0984('0x2f')]));if(_0x1b5381['query']['filter']){_0x4f57ce[_0x0984('0x37')]=_[_0x0984('0x39')](_0x4f57ce['where'],{'$or':_[_0x0984('0x2c')](_0x4f57ce[_0x0984('0x32')],function(_0x44ebbc){var _0x2c8511={};_0x2c8511[_0x44ebbc]={'$like':'%'+_0x1b5381[_0x0984('0x2e')][_0x0984('0x4c')]+'%'};return _0x2c8511;})});}_0x4f57ce=_['merge']({},_0x4f57ce,_0x1b5381[_0x0984('0x3b')]);return _0x3a569f[_0x0984('0x49')](_0x4f57ce);}})[_0x0984('0x3d')](function(_0x300a08){if(_0x300a08){_0x50d37a=_0x300a08[_0x0984('0x33')];if(!_0x1b5381[_0x0984('0x2e')][_0x0984('0x4d')](_0x0984('0x34'))){_0x4f57ce[_0x0984('0x1b')]=qs['limit'](_0x1b5381[_0x0984('0x2e')][_0x0984('0x1b')]);_0x4f57ce[_0x0984('0x18')]=qs[_0x0984('0x18')](_0x1b5381['query'][_0x0984('0x18')]);}return _0x3a569f[_0x0984('0x49')](_0x4f57ce);}})['then'](function(_0x59d33c){if(_0x59d33c){return _0x59d33c?{'count':_0x50d37a,'rows':_0x59d33c}:null;}})[_0x0984('0x3d')](respondWithResult(_0x279bbe,null))[_0x0984('0x41')](handleError(_0x279bbe,null));};exports[_0x0984('0x4e')]=function(_0x358d45,_0x3846fd,_0x267824){return db[_0x0984('0x4f')][_0x0984('0x46')]({'where':{'id':_0x358d45[_0x0984('0x43')]['id']}})['then'](handleEntityNotFound(_0x3846fd,null))['then'](function(_0x712a7a){if(_0x712a7a){return _0x712a7a[_0x0984('0x4e')](_0x358d45['body'][_0x0984('0x48')],_[_0x0984('0x50')](_0x358d45[_0x0984('0x45')],[_0x0984('0x48'),'id'])||{});}})[_0x0984('0x3d')](respondWithResult(_0x3846fd,null))['catch'](handleError(_0x3846fd,null));};exports[_0x0984('0x51')]=function(_0x48ad01,_0x43b7e1,_0x5be423){var _0x1e247b={};var _0x5dfc93={};var _0x585dd1;var _0x47a2a9;return db['Automation']['findOne']({'where':{'id':_0x48ad01[_0x0984('0x43')]['id']}})['then'](handleEntityNotFound(_0x43b7e1,null))[_0x0984('0x3d')](function(_0xbc834){if(_0xbc834){_0x585dd1=_0xbc834;_0x5dfc93[_0x0984('0x2b')]=_[_0x0984('0x2d')](db[_0x0984('0x4f')]['rawAttributes']);_0x5dfc93['query']=_[_0x0984('0x2d')](_0x48ad01['query']);_0x5dfc93[_0x0984('0x2f')]=_[_0x0984('0x30')](_0x5dfc93[_0x0984('0x2b')],_0x5dfc93[_0x0984('0x2e')]);_0x1e247b[_0x0984('0x32')]=_[_0x0984('0x30')](_0x5dfc93[_0x0984('0x2b')],qs[_0x0984('0x31')](_0x48ad01['query'][_0x0984('0x31')]));_0x1e247b[_0x0984('0x32')]=_0x1e247b['attributes'][_0x0984('0x33')]?_0x1e247b[_0x0984('0x32')]:_0x5dfc93[_0x0984('0x2b')];_0x1e247b[_0x0984('0x35')]=qs['sort'](_0x48ad01[_0x0984('0x2e')][_0x0984('0x36')]);_0x1e247b[_0x0984('0x37')]=qs[_0x0984('0x2f')](_[_0x0984('0x38')](_0x48ad01[_0x0984('0x2e')],_0x5dfc93[_0x0984('0x2f')]));if(_0x48ad01[_0x0984('0x2e')]['filter']){_0x1e247b['where']=_['merge'](_0x1e247b[_0x0984('0x37')],{'$or':_['map'](_0x1e247b[_0x0984('0x32')],function(_0x50e3cc){var _0x108bd3={};_0x108bd3[_0x50e3cc]={'$like':'%'+_0x48ad01[_0x0984('0x2e')][_0x0984('0x4c')]+'%'};return _0x108bd3;})});}_0x1e247b=_['merge']({},_0x1e247b,_0x48ad01[_0x0984('0x3b')]);return _0x585dd1[_0x0984('0x51')](_0x1e247b);}})['then'](function(_0x82be4a){if(_0x82be4a){_0x47a2a9=_0x82be4a['length'];if(!_0x48ad01[_0x0984('0x2e')]['hasOwnProperty'](_0x0984('0x34'))){_0x1e247b[_0x0984('0x1b')]=qs[_0x0984('0x1b')](_0x48ad01['query'][_0x0984('0x1b')]);_0x1e247b['offset']=qs[_0x0984('0x18')](_0x48ad01[_0x0984('0x2e')][_0x0984('0x18')]);}return _0x585dd1[_0x0984('0x51')](_0x1e247b);}})[_0x0984('0x3d')](function(_0x359d66){if(_0x359d66){return _0x359d66?{'count':_0x47a2a9,'rows':_0x359d66}:null;}})[_0x0984('0x3d')](respondWithResult(_0x43b7e1,null))[_0x0984('0x41')](handleError(_0x43b7e1,null));};
\ No newline at end of file
+var _0xc4cd=['merge','options','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','send','index','map','Automation','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','length','nolimit','offset','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','fields'];(function(_0x47848c,_0x1c52f3){var _0x520324=function(_0x202798){while(--_0x202798){_0x47848c['push'](_0x47848c['shift']());}};_0x520324(++_0x1c52f3);}(_0xc4cd,0x106));var _0xdc4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4cd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc4c('0x0'));var zipdir=require(_0xdc4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc4c('0x2'));var BPromise=require(_0xdc4c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdc4c('0x4'));var ejs=require(_0xdc4c('0x5'));var fs=require('fs');var fs_extra=require(_0xdc4c('0x6'));var _=require(_0xdc4c('0x7'));var squel=require(_0xdc4c('0x8'));var crypto=require(_0xdc4c('0x9'));var jsforce=require(_0xdc4c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdc4c('0x4'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdc4c('0xb'));var authService=require(_0xdc4c('0xc'));var qs=require(_0xdc4c('0xd'));var as=require(_0xdc4c('0xe'));var hardwareService=require(_0xdc4c('0xf'));var logger=require(_0xdc4c('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xdc4c('0x11'));var licenseUtil=require(_0xdc4c('0x12'));var db=require(_0xdc4c('0x13'))['db'];function respondWithStatusCode(_0x4b4e2c,_0x925ba2){_0x925ba2=_0x925ba2||0xcc;return function(_0x1f6530){if(_0x1f6530){return _0x4b4e2c[_0xdc4c('0x14')](_0x925ba2);}return _0x4b4e2c['status'](_0x925ba2)['end']();};}function respondWithResult(_0x2d4ce5,_0x44d75b){_0x44d75b=_0x44d75b||0xc8;return function(_0x4bdb0b){if(_0x4bdb0b){return _0x2d4ce5[_0xdc4c('0x15')](_0x44d75b)[_0xdc4c('0x16')](_0x4bdb0b);}};}function respondWithFilteredResult(_0x506777,_0x3ee2aa){return function(_0x56d6b4){if(_0x56d6b4){var _0xcca126=typeof _0x3ee2aa['offset']===_0xdc4c('0x17')&&typeof _0x3ee2aa[_0xdc4c('0x18')]===_0xdc4c('0x17');var _0x1c3910=_0x56d6b4[_0xdc4c('0x19')];var _0x2f22cf=_0xcca126?0x0:_0x3ee2aa['offset'];var _0x228c54=_0xcca126?_0x56d6b4[_0xdc4c('0x19')]:_0x3ee2aa['offset']+_0x3ee2aa[_0xdc4c('0x18')];var _0x457e77;if(_0x228c54>=_0x1c3910){_0x228c54=_0x1c3910;_0x457e77=0xc8;}else{_0x457e77=0xce;}_0x506777[_0xdc4c('0x15')](_0x457e77);return _0x506777[_0xdc4c('0x1a')](_0xdc4c('0x1b'),_0x2f22cf+'-'+_0x228c54+'/'+_0x1c3910)[_0xdc4c('0x16')](_0x56d6b4);}return null;};}function patchUpdates(_0x73df32){return function(_0x585286){try{jsonpatch[_0xdc4c('0x1c')](_0x585286,_0x73df32,!![]);}catch(_0x5afb1d){return BPromise[_0xdc4c('0x1d')](_0x5afb1d);}return _0x585286[_0xdc4c('0x1e')]();};}function saveUpdates(_0x42d926,_0x395909){return function(_0x36bf02){if(_0x36bf02){return _0x36bf02[_0xdc4c('0x1f')](_0x42d926)[_0xdc4c('0x20')](function(_0x40d28e){return _0x40d28e;});}return null;};}function removeEntity(_0x41aa06,_0x51472f){return function(_0x267568){if(_0x267568){return _0x267568['destroy']()['then'](function(){_0x41aa06['status'](0xcc)[_0xdc4c('0x21')]();});}};}function handleEntityNotFound(_0x1ab266,_0x75f27a){return function(_0x4d4905){if(!_0x4d4905){_0x1ab266[_0xdc4c('0x14')](0x194);}return _0x4d4905;};}function handleError(_0x52b0c0,_0x3d6910){_0x3d6910=_0x3d6910||0x1f4;return function(_0x43a114){logger['error'](_0x43a114[_0xdc4c('0x22')]);if(_0x43a114['name']){delete _0x43a114['name'];}_0x52b0c0[_0xdc4c('0x15')](_0x3d6910)[_0xdc4c('0x23')](_0x43a114);};}exports[_0xdc4c('0x24')]=function(_0x11b331,_0x3f1b87){var _0x2f9fa7={},_0x3949c7={},_0x18d7a4={'count':0x0,'rows':[]};var _0x4237f0=_[_0xdc4c('0x25')](db[_0xdc4c('0x26')][_0xdc4c('0x27')],function(_0x5c7720){return{'name':_0x5c7720[_0xdc4c('0x28')],'type':_0x5c7720[_0xdc4c('0x29')][_0xdc4c('0x2a')]};});_0x3949c7[_0xdc4c('0x2b')]=_[_0xdc4c('0x25')](_0x4237f0,_0xdc4c('0x2c'));_0x3949c7['query']=_[_0xdc4c('0x2d')](_0x11b331[_0xdc4c('0x2e')]);_0x3949c7[_0xdc4c('0x2f')]=_[_0xdc4c('0x30')](_0x3949c7[_0xdc4c('0x2b')],_0x3949c7[_0xdc4c('0x2e')]);_0x2f9fa7[_0xdc4c('0x31')]=_[_0xdc4c('0x30')](_0x3949c7[_0xdc4c('0x2b')],qs['fields'](_0x11b331[_0xdc4c('0x2e')]['fields']));_0x2f9fa7['attributes']=_0x2f9fa7[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x2f9fa7[_0xdc4c('0x31')]:_0x3949c7[_0xdc4c('0x2b')];if(!_0x11b331[_0xdc4c('0x2e')]['hasOwnProperty'](_0xdc4c('0x33'))){_0x2f9fa7[_0xdc4c('0x18')]=qs['limit'](_0x11b331[_0xdc4c('0x2e')]['limit']);_0x2f9fa7['offset']=qs[_0xdc4c('0x34')](_0x11b331[_0xdc4c('0x2e')][_0xdc4c('0x34')]);}_0x2f9fa7[_0xdc4c('0x35')]=qs[_0xdc4c('0x36')](_0x11b331['query']['sort']);_0x2f9fa7[_0xdc4c('0x37')]=qs['filters'](_[_0xdc4c('0x38')](_0x11b331[_0xdc4c('0x2e')],_0x3949c7['filters']),_0x4237f0);if(_0x11b331['query']['filter']){_0x2f9fa7[_0xdc4c('0x37')]=_['merge'](_0x2f9fa7['where'],{'$or':_[_0xdc4c('0x25')](_0x4237f0,function(_0x45f0a7){if(_0x45f0a7['type']!=='VIRTUAL'){var _0x3a753c={};_0x3a753c[_0x45f0a7[_0xdc4c('0x2c')]]={'$like':'%'+_0x11b331['query'][_0xdc4c('0x39')]+'%'};return _0x3a753c;}})});}_0x2f9fa7=_['merge']({},_0x2f9fa7,_0x11b331['options']);var _0x1d41b3={'where':_0x2f9fa7[_0xdc4c('0x37')]};return db[_0xdc4c('0x26')]['count'](_0x1d41b3)[_0xdc4c('0x20')](function(_0x167f8d){_0x18d7a4['count']=_0x167f8d;if(_0x11b331[_0xdc4c('0x2e')][_0xdc4c('0x3a')]){_0x2f9fa7[_0xdc4c('0x3b')]=[{'all':!![]}];}return db['Automation'][_0xdc4c('0x3c')](_0x2f9fa7);})[_0xdc4c('0x20')](function(_0x2c7f70){_0x18d7a4[_0xdc4c('0x3d')]=_0x2c7f70;return _0x18d7a4;})['then'](respondWithFilteredResult(_0x3f1b87,_0x2f9fa7))[_0xdc4c('0x3e')](handleError(_0x3f1b87,null));};exports[_0xdc4c('0x3f')]=function(_0x208b0c,_0x41afdc){var _0x362265={'raw':![],'where':{'id':_0x208b0c[_0xdc4c('0x40')]['id']}},_0x3b625e={};_0x3b625e['model']=_[_0xdc4c('0x2d')](db[_0xdc4c('0x26')][_0xdc4c('0x27')]);_0x3b625e[_0xdc4c('0x2e')]=_['keys'](_0x208b0c[_0xdc4c('0x2e')]);_0x3b625e[_0xdc4c('0x2f')]=_[_0xdc4c('0x30')](_0x3b625e[_0xdc4c('0x2b')],_0x3b625e[_0xdc4c('0x2e')]);_0x362265[_0xdc4c('0x31')]=_['intersection'](_0x3b625e[_0xdc4c('0x2b')],qs[_0xdc4c('0x41')](_0x208b0c['query'][_0xdc4c('0x41')]));_0x362265[_0xdc4c('0x31')]=_0x362265[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x362265['attributes']:_0x3b625e[_0xdc4c('0x2b')];if(_0x208b0c[_0xdc4c('0x2e')][_0xdc4c('0x3a')]){_0x362265[_0xdc4c('0x3b')]=[{'all':!![]}];}_0x362265=_[_0xdc4c('0x42')]({},_0x362265,_0x208b0c[_0xdc4c('0x43')]);return db['Automation'][_0xdc4c('0x44')](_0x362265)[_0xdc4c('0x20')](handleEntityNotFound(_0x41afdc,null))[_0xdc4c('0x20')](respondWithResult(_0x41afdc,null))[_0xdc4c('0x3e')](handleError(_0x41afdc,null));};exports[_0xdc4c('0x45')]=function(_0x25adc4,_0x4331e3){return db['Automation']['create'](_0x25adc4[_0xdc4c('0x46')],{})[_0xdc4c('0x20')](respondWithResult(_0x4331e3,0xc9))[_0xdc4c('0x3e')](handleError(_0x4331e3,null));};exports[_0xdc4c('0x1f')]=function(_0x39beea,_0x5db30a){if(_0x39beea['body']['id']){delete _0x39beea[_0xdc4c('0x46')]['id'];}return db[_0xdc4c('0x26')][_0xdc4c('0x44')]({'where':{'id':_0x39beea[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x5db30a,null))[_0xdc4c('0x20')](saveUpdates(_0x39beea[_0xdc4c('0x46')],null))[_0xdc4c('0x20')](respondWithResult(_0x5db30a,null))[_0xdc4c('0x3e')](handleError(_0x5db30a,null));};exports[_0xdc4c('0x47')]=function(_0x4a81a5,_0x135f01){return db[_0xdc4c('0x26')][_0xdc4c('0x44')]({'where':{'id':_0x4a81a5[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x135f01,null))['then'](removeEntity(_0x135f01,null))['catch'](handleError(_0x135f01,null));};exports[_0xdc4c('0x48')]=function(_0x591e75,_0x51a828,_0x54a225){return db[_0xdc4c('0x49')]['find']({'where':{'id':_0x591e75[_0xdc4c('0x40')]['id']}})['then'](handleEntityNotFound(_0x51a828,null))[_0xdc4c('0x20')](function(_0x2ad58f){if(_0x2ad58f){return _0x2ad58f[_0xdc4c('0x48')](_0x591e75['body'][_0xdc4c('0x4a')],_[_0xdc4c('0x4b')](_0x591e75[_0xdc4c('0x46')],['ids','id'])||{});}})[_0xdc4c('0x20')](respondWithResult(_0x51a828,null))[_0xdc4c('0x3e')](handleError(_0x51a828,null));};exports[_0xdc4c('0x4c')]=function(_0x4d888d,_0x54916e,_0x2bf0ee){var _0x2620ab={};var _0x385004={};var _0x1263fa;var _0x29ec6e;return db[_0xdc4c('0x26')][_0xdc4c('0x4d')]({'where':{'id':_0x4d888d[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x54916e,null))['then'](function(_0x328da0){if(_0x328da0){_0x1263fa=_0x328da0;_0x385004[_0xdc4c('0x2b')]=_[_0xdc4c('0x2d')](db['Condition']['rawAttributes']);_0x385004['query']=_[_0xdc4c('0x2d')](_0x4d888d[_0xdc4c('0x2e')]);_0x385004[_0xdc4c('0x2f')]=_[_0xdc4c('0x30')](_0x385004['model'],_0x385004['query']);_0x2620ab['attributes']=_[_0xdc4c('0x30')](_0x385004[_0xdc4c('0x2b')],qs[_0xdc4c('0x41')](_0x4d888d['query'][_0xdc4c('0x41')]));_0x2620ab[_0xdc4c('0x31')]=_0x2620ab[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x2620ab[_0xdc4c('0x31')]:_0x385004[_0xdc4c('0x2b')];_0x2620ab[_0xdc4c('0x35')]=qs[_0xdc4c('0x36')](_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x36')]);_0x2620ab['where']=qs[_0xdc4c('0x2f')](_[_0xdc4c('0x38')](_0x4d888d[_0xdc4c('0x2e')],_0x385004['filters']));if(_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x39')]){_0x2620ab[_0xdc4c('0x37')]=_['merge'](_0x2620ab[_0xdc4c('0x37')],{'$or':_[_0xdc4c('0x25')](_0x2620ab[_0xdc4c('0x31')],function(_0x23da26){var _0x5e302e={};_0x5e302e[_0x23da26]={'$like':'%'+_0x4d888d[_0xdc4c('0x2e')]['filter']+'%'};return _0x5e302e;})});}_0x2620ab=_[_0xdc4c('0x42')]({},_0x2620ab,_0x4d888d['options']);return _0x1263fa['getConditions'](_0x2620ab);}})[_0xdc4c('0x20')](function(_0x6779a7){if(_0x6779a7){_0x29ec6e=_0x6779a7[_0xdc4c('0x32')];if(!_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x4e')](_0xdc4c('0x33'))){_0x2620ab[_0xdc4c('0x18')]=qs[_0xdc4c('0x18')](_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x18')]);_0x2620ab[_0xdc4c('0x34')]=qs['offset'](_0x4d888d[_0xdc4c('0x2e')][_0xdc4c('0x34')]);}return _0x1263fa[_0xdc4c('0x4c')](_0x2620ab);}})[_0xdc4c('0x20')](function(_0x2f0dca){if(_0x2f0dca){return _0x2f0dca?{'count':_0x29ec6e,'rows':_0x2f0dca}:null;}})['then'](respondWithResult(_0x54916e,null))[_0xdc4c('0x3e')](handleError(_0x54916e,null));};exports[_0xdc4c('0x4f')]=function(_0x2e3f05,_0x332462,_0x5c8f3f){return db[_0xdc4c('0x50')][_0xdc4c('0x44')]({'where':{'id':_0x2e3f05['params']['id']}})['then'](handleEntityNotFound(_0x332462,null))[_0xdc4c('0x20')](function(_0x33a50e){if(_0x33a50e){return _0x33a50e[_0xdc4c('0x4f')](_0x2e3f05[_0xdc4c('0x46')]['ids'],_[_0xdc4c('0x4b')](_0x2e3f05['body'],[_0xdc4c('0x4a'),'id'])||{});}})[_0xdc4c('0x20')](respondWithResult(_0x332462,null))[_0xdc4c('0x3e')](handleError(_0x332462,null));};exports['getActions']=function(_0x436b92,_0x5163ce,_0x1ed7a2){var _0x540781={};var _0x2411d3={};var _0x302899;var _0x59336c;return db[_0xdc4c('0x26')][_0xdc4c('0x4d')]({'where':{'id':_0x436b92[_0xdc4c('0x40')]['id']}})[_0xdc4c('0x20')](handleEntityNotFound(_0x5163ce,null))[_0xdc4c('0x20')](function(_0x530fde){if(_0x530fde){_0x302899=_0x530fde;_0x2411d3[_0xdc4c('0x2b')]=_[_0xdc4c('0x2d')](db[_0xdc4c('0x50')][_0xdc4c('0x27')]);_0x2411d3[_0xdc4c('0x2e')]=_[_0xdc4c('0x2d')](_0x436b92[_0xdc4c('0x2e')]);_0x2411d3['filters']=_[_0xdc4c('0x30')](_0x2411d3[_0xdc4c('0x2b')],_0x2411d3[_0xdc4c('0x2e')]);_0x540781[_0xdc4c('0x31')]=_[_0xdc4c('0x30')](_0x2411d3[_0xdc4c('0x2b')],qs[_0xdc4c('0x41')](_0x436b92[_0xdc4c('0x2e')]['fields']));_0x540781[_0xdc4c('0x31')]=_0x540781[_0xdc4c('0x31')][_0xdc4c('0x32')]?_0x540781[_0xdc4c('0x31')]:_0x2411d3[_0xdc4c('0x2b')];_0x540781[_0xdc4c('0x35')]=qs[_0xdc4c('0x36')](_0x436b92[_0xdc4c('0x2e')][_0xdc4c('0x36')]);_0x540781[_0xdc4c('0x37')]=qs['filters'](_['pick'](_0x436b92[_0xdc4c('0x2e')],_0x2411d3['filters']));if(_0x436b92['query'][_0xdc4c('0x39')]){_0x540781[_0xdc4c('0x37')]=_[_0xdc4c('0x42')](_0x540781[_0xdc4c('0x37')],{'$or':_[_0xdc4c('0x25')](_0x540781['attributes'],function(_0x661ce8){var _0x236194={};_0x236194[_0x661ce8]={'$like':'%'+_0x436b92[_0xdc4c('0x2e')][_0xdc4c('0x39')]+'%'};return _0x236194;})});}_0x540781=_['merge']({},_0x540781,_0x436b92[_0xdc4c('0x43')]);return _0x302899[_0xdc4c('0x51')](_0x540781);}})[_0xdc4c('0x20')](function(_0x24c336){if(_0x24c336){_0x59336c=_0x24c336[_0xdc4c('0x32')];if(!_0x436b92[_0xdc4c('0x2e')]['hasOwnProperty'](_0xdc4c('0x33'))){_0x540781['limit']=qs[_0xdc4c('0x18')](_0x436b92['query'][_0xdc4c('0x18')]);_0x540781['offset']=qs[_0xdc4c('0x34')](_0x436b92['query'][_0xdc4c('0x34')]);}return _0x302899[_0xdc4c('0x51')](_0x540781);}})[_0xdc4c('0x20')](function(_0x10021f){if(_0x10021f){return _0x10021f?{'count':_0x59336c,'rows':_0x10021f}:null;}})['then'](respondWithResult(_0x5163ce,null))[_0xdc4c('0x3e')](handleError(_0x5163ce,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 18c65b9..6d7765c 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 _0xba2b=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','bluebird','request-promise','path'];(function(_0x24fdd,_0x38a268){var _0x3eee0d=function(_0x37addb){while(--_0x37addb){_0x24fdd['push'](_0x24fdd['shift']());}};_0x3eee0d(++_0x38a268);}(_0xba2b,0xcd));var _0xbba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba2b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xbba2('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbba2('0x1'));var rp=require(_0xbba2('0x2'));var fs=require('fs');var path=require(_0xbba2('0x3'));var rimraf=require(_0xbba2('0x4'));var config=require(_0xbba2('0x5'));var attributes=require(_0xbba2('0x6'));module[_0xbba2('0x7')]=function(_0x3efdf2,_0x38629f){return _0x3efdf2[_0xbba2('0x8')](_0xbba2('0x9'),attributes,{'tableName':_0xbba2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1d3=['bluebird','request-promise','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0xb1d3,0x81));var _0x3b1d=function(_0xc724e5,_0x11fcdc){_0xc724e5=_0xc724e5-0x0;var _0x363065=_0xb1d3[_0xc724e5];return _0x363065;};'use strict';var _=require('lodash');var util=require(_0x3b1d('0x0'));var logger=require(_0x3b1d('0x1'))(_0x3b1d('0x2'));var moment=require('moment');var BPromise=require(_0x3b1d('0x3'));var rp=require(_0x3b1d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3b1d('0x5'));var attributes=require(_0x3b1d('0x6'));module[_0x3b1d('0x7')]=function(_0x308a19,_0xb65a78){return _0x308a19[_0x3b1d('0x8')](_0x3b1d('0x9'),attributes,{'tableName':_0x3b1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 7bc0ded..e146ede 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 _0x2977=['client','request','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2977,0xa5));var _0x7297=function(_0x28dc07,_0x5f4d9a){_0x28dc07=_0x28dc07-0x0;var _0x5bcc6a=_0x2977[_0x28dc07];return _0x5bcc6a;};'use strict';var _=require(_0x7297('0x0'));var util=require('util');var moment=require(_0x7297('0x1'));var BPromise=require(_0x7297('0x2'));var rs=require(_0x7297('0x3'));var fs=require('fs');var Redis=require(_0x7297('0x4'));var db=require(_0x7297('0x5'))['db'];var utils=require(_0x7297('0x6'));var logger=require(_0x7297('0x7'))(_0x7297('0x8'));var config=require(_0x7297('0x9'));var jayson=require(_0x7297('0xa'));var client=jayson[_0x7297('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc9e570,_0x581d60,_0x2be768){return new BPromise(function(_0x4fc888,_0x4c5832){return client[_0x7297('0xc')](_0xc9e570,_0x2be768)['then'](function(_0x909a14){logger[_0x7297('0xd')](_0x7297('0xe'),_0x581d60,'request\x20sent');logger['debug'](_0x7297('0xf'),_0x581d60,_0x7297('0x10'),JSON[_0x7297('0x11')](_0x909a14));if(_0x909a14[_0x7297('0x12')]){if(_0x909a14['error'][_0x7297('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x581d60,_0x909a14[_0x7297('0x12')]['message']);return _0x4c5832(_0x909a14[_0x7297('0x12')]['message']);}logger[_0x7297('0x12')]('Automation,\x20%s,\x20%s',_0x581d60,_0x909a14['error'][_0x7297('0x14')]);return _0x4fc888(_0x909a14[_0x7297('0x12')][_0x7297('0x14')]);}else{logger[_0x7297('0xd')](_0x7297('0xe'),_0x581d60,_0x7297('0x10'));_0x4fc888(_0x909a14[_0x7297('0x15')][_0x7297('0x14')]);}})['catch'](function(_0x558f04){logger[_0x7297('0x12')](_0x7297('0xe'),_0x581d60,_0x558f04);_0x4c5832(_0x558f04);});});}
\ No newline at end of file
+var _0x3264=['jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0x48f860,_0x495541){var _0x550734=function(_0x30f5e4){while(--_0x30f5e4){_0x48f860['push'](_0x48f860['shift']());}};_0x550734(++_0x495541);}(_0x3264,0x7f));var _0x4326=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x3264[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require(_0x4326('0x0'));var moment=require(_0x4326('0x1'));var BPromise=require(_0x4326('0x2'));var rs=require(_0x4326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4326('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4326('0x5'));var jayson=require(_0x4326('0x6'));var client=jayson[_0x4326('0x7')][_0x4326('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56bcce,_0x3a7544,_0x2993a1){return new BPromise(function(_0x22071c,_0x129365){return client[_0x4326('0x9')](_0x56bcce,_0x2993a1)[_0x4326('0xa')](function(_0x1609f){logger['info']('Automation,\x20%s,\x20%s',_0x3a7544,_0x4326('0xb'));logger[_0x4326('0xc')](_0x4326('0xd'),_0x3a7544,_0x4326('0xb'),JSON['stringify'](_0x1609f));if(_0x1609f['error']){if(_0x1609f[_0x4326('0xe')]['code']===0x1f4){logger[_0x4326('0xe')](_0x4326('0xf'),_0x3a7544,_0x1609f[_0x4326('0xe')]['message']);return _0x129365(_0x1609f['error'][_0x4326('0x10')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3a7544,_0x1609f[_0x4326('0xe')][_0x4326('0x10')]);return _0x22071c(_0x1609f[_0x4326('0xe')][_0x4326('0x10')]);}else{logger['info'](_0x4326('0xf'),_0x3a7544,_0x4326('0xb'));_0x22071c(_0x1609f[_0x4326('0x11')]['message']);}})[_0x4326('0x12')](function(_0x40c169){logger[_0x4326('0xe')](_0x4326('0xf'),_0x3a7544,_0x40c169);_0x129365(_0x40c169);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index e352843..c0e0aad 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 _0x6873=['/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','show'];(function(_0x14e934,_0x18b80a){var _0x3c0754=function(_0x1db643){while(--_0x1db643){_0x14e934['push'](_0x14e934['shift']());}};_0x3c0754(++_0x18b80a);}(_0x6873,0xac));var _0x3687=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x6873[_0x845505];return _0x2513b9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3687('0x0'));var timeout=require(_0x3687('0x1'));var express=require(_0x3687('0x2'));var router=express[_0x3687('0x3')]();var fs_extra=require(_0x3687('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3687('0x5'));var config=require('../../config/environment');var controller=require(_0x3687('0x6'));router[_0x3687('0x7')]('/',auth['isAuthenticated'](),controller[_0x3687('0x8')]);router[_0x3687('0x7')](_0x3687('0x9'),auth[_0x3687('0xa')](),controller[_0x3687('0xb')]);router[_0x3687('0x7')](_0x3687('0xc'),auth[_0x3687('0xa')](),controller[_0x3687('0xd')]);router['get'](_0x3687('0xe'),auth[_0x3687('0xa')](),controller['getActions']);router[_0x3687('0xf')]('/',auth[_0x3687('0xa')](),controller[_0x3687('0x10')]);router[_0x3687('0xf')](_0x3687('0xc'),auth['isAuthenticated'](),controller[_0x3687('0x11')]);router[_0x3687('0xf')]('/:id/actions',auth[_0x3687('0xa')](),controller[_0x3687('0x12')]);router[_0x3687('0x13')](_0x3687('0x9'),auth[_0x3687('0xa')](),controller[_0x3687('0x14')]);router[_0x3687('0x15')](_0x3687('0x9'),auth[_0x3687('0xa')](),controller['destroy']);module[_0x3687('0x16')]=router;
\ No newline at end of file
+var _0x899a=['/:id/conditions','getConditions','/:id/actions','getActions','addConditions','post','addActions','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x899a,0x1b6));var _0xa899=function(_0x582a71,_0x3594fa){_0x582a71=_0x582a71-0x0;var _0x1c0b81=_0x899a[_0x582a71];return _0x1c0b81;};'use strict';var multer=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var path=require('path');var timeout=require(_0xa899('0x2'));var express=require(_0xa899('0x3'));var router=express['Router']();var fs_extra=require(_0xa899('0x4'));var auth=require(_0xa899('0x5'));var interaction=require(_0xa899('0x6'));var config=require(_0xa899('0x7'));var controller=require('./automation.controller');router[_0xa899('0x8')]('/',auth[_0xa899('0x9')](),controller[_0xa899('0xa')]);router[_0xa899('0x8')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0xb')]);router[_0xa899('0x8')](_0xa899('0xc'),auth[_0xa899('0x9')](),controller[_0xa899('0xd')]);router[_0xa899('0x8')](_0xa899('0xe'),auth[_0xa899('0x9')](),controller[_0xa899('0xf')]);router['post']('/',auth[_0xa899('0x9')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xa899('0x10')]);router[_0xa899('0x11')](_0xa899('0xe'),auth['isAuthenticated'](),controller[_0xa899('0x12')]);router[_0xa899('0x13')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0x14')]);router[_0xa899('0x15')](_0xa899('0x16'),auth['isAuthenticated'](),controller[_0xa899('0x17')]);module[_0xa899('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 7ef1509..6441ad6 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 _0x4111=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xbad179,_0x35579f){var _0x54e6ca=function(_0x517a61){while(--_0x517a61){_0xbad179['push'](_0xbad179['shift']());}};_0x54e6ca(++_0x35579f);}(_0x4111,0x188));var _0x1411=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4111[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1411('0x0'));module[_0x1411('0x1')]={'name':{'type':Sequelize[_0x1411('0x2')],'unique':_0x1411('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1411('0x4')),'allowNull':![],'defaultValue':_0x1411('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1411('0x5')],'defaultValue':0x0,'comment':_0x1411('0x6')},'limitCalls':{'type':Sequelize[_0x1411('0x7')](0x4)[_0x1411('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1411('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1411('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1411('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1411('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1411('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'defaultValue':0x3,'comment':_0x1411('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1411('0x7')](0x5)[_0x1411('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1411('0x10')},'dialTimezone':{'type':Sequelize[_0x1411('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1411('0x2')],'defaultValue':_0x1411('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x1411('0x12')](_0x1411('0x13'),_0x1411('0x14'),'onlyIfOpen'),'defaultValue':_0x1411('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1411('0x15')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1411('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1411('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x1411('0x7')](0x9)[_0x1411('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1411('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1411('0x7')](0x9)[_0x1411('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1411('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1411('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1411('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x1411('0x7')](0x9)[_0x1411('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1411('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1411('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1411('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1411('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1411('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1411('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1411('0x7')](0x9)[_0x1411('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1411('0x1e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1411('0x12')](_0x1411('0x1f'),_0x1411('0x20')),'defaultValue':_0x1411('0x1f')},'dialPrefix':{'type':Sequelize[_0x1411('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1411('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1411('0x21')},'dialCutDigit':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1411('0x7')](0x5)[_0x1411('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0x24')},'dialDropRetryFrequency':{'type':Sequelize[_0x1411('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1411('0x7')](0x5)[_0x1411('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0x26')},'dialMachineMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0x27')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1411('0x7')](0x5)[_0x1411('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1411('0x7')](0x3)[_0x1411('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1411('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1411('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1411('0x2a')}};
\ No newline at end of file
+var _0x6d11=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x6d11,0xbf));var _0x16d1=function(_0xb381b2,_0x1d209f){_0xb381b2=_0xb381b2-0x0;var _0x3e24fd=_0x6d11[_0xb381b2];return _0x3e24fd;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x16d1('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x16d1('0x4')},'description':{'type':Sequelize[_0x16d1('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x16d1('0x5')](0x4)[_0x16d1('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x16d1('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x16d1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x16d1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'comment':_0x16d1('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x16d1('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x16d1('0x2')],'defaultValue':_0x16d1('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x10'),_0x16d1('0x11'),_0x16d1('0x12')),'defaultValue':_0x16d1('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x16d1('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x16d1('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x16d1('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x16d1('0x5')](0x9)[_0x16d1('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x16d1('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x16d1('0x5')](0x9)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x16d1('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x16d1('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x16d1('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x16d1('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x16d1('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x19'),_0x16d1('0x1a')),'defaultValue':_0x16d1('0x19')},'dialPrefix':{'type':Sequelize[_0x16d1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16d1('0x1b')},'dialCutDigit':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x16d1('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x16d1('0x5')](0x3)[_0x16d1('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x16d1('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x16d1('0x5')](0x5)[_0x16d1('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x16d1('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index f15490f..1d69b59 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 _0xefe3=['nolimit','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','show','params','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','updatedAt','omit','body','createdAt','update','getHoppers','findOne','order','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','fromQuery','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','map','rawAttributes','fieldName','key','query','attributes','model','fields','length','hasOwnProperty'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0xefe3,0xf5));var _0x3efe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xefe3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3efe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3efe('0x1'));var moment=require(_0x3efe('0x2'));var BPromise=require(_0x3efe('0x3'));var Mustache=require(_0x3efe('0x4'));var util=require('util');var path=require(_0x3efe('0x5'));var sox=require('sox');var csv=require(_0x3efe('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3efe('0x7'));var _=require(_0x3efe('0x8'));var squel=require(_0x3efe('0x9'));var crypto=require(_0x3efe('0xa'));var jsforce=require(_0x3efe('0xb'));var deskjs=require(_0x3efe('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3efe('0xd'));var Papa=require('papaparse');var Redis=require(_0x3efe('0xe'));var authService=require(_0x3efe('0xf'));var qs=require(_0x3efe('0x10'));var as=require(_0x3efe('0x11'));var hardwareService=require(_0x3efe('0x12'));var logger=require(_0x3efe('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3efe('0x14'));var licenseUtil=require(_0x3efe('0x15'));var db=require(_0x3efe('0x16'))['db'];function respondWithStatusCode(_0x3ad584,_0x11b9b4){_0x11b9b4=_0x11b9b4||0xcc;return function(_0x3778ec){if(_0x3778ec){return _0x3ad584[_0x3efe('0x17')](_0x11b9b4);}return _0x3ad584[_0x3efe('0x18')](_0x11b9b4)[_0x3efe('0x19')]();};}function respondWithResult(_0x44bdbf,_0x2dd99f){_0x2dd99f=_0x2dd99f||0xc8;return function(_0x49f4ff){if(_0x49f4ff){return _0x44bdbf[_0x3efe('0x18')](_0x2dd99f)[_0x3efe('0x1a')](_0x49f4ff);}};}function respondWithFilteredResult(_0x1e1ce9,_0x230785){return function(_0x4a3d0d){if(_0x4a3d0d){var _0x219ecf=typeof _0x230785[_0x3efe('0x1b')]===_0x3efe('0x1c')&&typeof _0x230785['limit']==='undefined';var _0x3adf52=_0x4a3d0d[_0x3efe('0x1d')];var _0x26a8c4=_0x219ecf?0x0:_0x230785[_0x3efe('0x1b')];var _0x433c53=_0x219ecf?_0x4a3d0d[_0x3efe('0x1d')]:_0x230785['offset']+_0x230785[_0x3efe('0x1e')];var _0x30b3fb;if(_0x433c53>=_0x3adf52){_0x433c53=_0x3adf52;_0x30b3fb=0xc8;}else{_0x30b3fb=0xce;}_0x1e1ce9[_0x3efe('0x18')](_0x30b3fb);return _0x1e1ce9[_0x3efe('0x1f')](_0x3efe('0x20'),_0x26a8c4+'-'+_0x433c53+'/'+_0x3adf52)[_0x3efe('0x1a')](_0x4a3d0d);}return null;};}function patchUpdates(_0x41cfcd){return function(_0x2b2c09){try{jsonpatch[_0x3efe('0x21')](_0x2b2c09,_0x41cfcd,!![]);}catch(_0x49392e){return BPromise[_0x3efe('0x22')](_0x49392e);}return _0x2b2c09[_0x3efe('0x23')]();};}function saveUpdates(_0x3403ce,_0x3b6464){return function(_0x4a3fdb){if(_0x4a3fdb){return _0x4a3fdb['update'](_0x3403ce)[_0x3efe('0x24')](function(_0x2891b1){return _0x2891b1;});}return null;};}function removeEntity(_0x5d9601,_0x5c8b1d){return function(_0x2aec5c){if(_0x2aec5c){return _0x2aec5c[_0x3efe('0x25')]()[_0x3efe('0x24')](function(){var _0x252c27=_0x2aec5c[_0x3efe('0x26')]({'plain':!![]});var _0x39fc88=_0x3efe('0x27');return db[_0x3efe('0x28')][_0x3efe('0x25')]({'where':{'type':_0x39fc88,'resourceId':_0x252c27['id']}})['then'](function(){return _0x2aec5c;});})[_0x3efe('0x24')](function(){_0x5d9601['status'](0xcc)[_0x3efe('0x19')]();});}};}function handleEntityNotFound(_0x21c15d,_0x5cbe1a){return function(_0x25bf85){if(!_0x25bf85){_0x21c15d[_0x3efe('0x17')](0x194);}return _0x25bf85;};}function handleError(_0x331a83,_0x4cedac){_0x4cedac=_0x4cedac||0x1f4;return function(_0xdedd1c){logger[_0x3efe('0x29')](_0xdedd1c['stack']);if(_0xdedd1c[_0x3efe('0x2a')]){delete _0xdedd1c[_0x3efe('0x2a')];}_0x331a83[_0x3efe('0x18')](_0x4cedac)['send'](_0xdedd1c);};}exports['index']=function(_0x2e2d68,_0x34229c){var _0x423056={},_0x1f08e2={},_0x45d873={'count':0x0,'rows':[]};var _0x1f271b=_[_0x3efe('0x2b')](db['Campaign'][_0x3efe('0x2c')],function(_0x574d53){return{'name':_0x574d53[_0x3efe('0x2d')],'type':_0x574d53['type'][_0x3efe('0x2e')]};});_0x1f08e2['model']=_[_0x3efe('0x2b')](_0x1f271b,'name');_0x1f08e2['query']=_['keys'](_0x2e2d68[_0x3efe('0x2f')]);_0x1f08e2['filters']=_['intersection'](_0x1f08e2['model'],_0x1f08e2[_0x3efe('0x2f')]);_0x423056[_0x3efe('0x30')]=_['intersection'](_0x1f08e2[_0x3efe('0x31')],qs[_0x3efe('0x32')](_0x2e2d68[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x423056[_0x3efe('0x30')]=_0x423056[_0x3efe('0x30')][_0x3efe('0x33')]?_0x423056[_0x3efe('0x30')]:_0x1f08e2[_0x3efe('0x31')];if(!_0x2e2d68[_0x3efe('0x2f')][_0x3efe('0x34')](_0x3efe('0x35'))){_0x423056[_0x3efe('0x1e')]=qs[_0x3efe('0x1e')](_0x2e2d68[_0x3efe('0x2f')][_0x3efe('0x1e')]);_0x423056[_0x3efe('0x1b')]=qs[_0x3efe('0x1b')](_0x2e2d68[_0x3efe('0x2f')][_0x3efe('0x1b')]);}_0x423056['order']=qs[_0x3efe('0x36')](_0x2e2d68[_0x3efe('0x2f')]['sort']);_0x423056[_0x3efe('0x37')]=qs['filters'](_[_0x3efe('0x38')](_0x2e2d68[_0x3efe('0x2f')],_0x1f08e2[_0x3efe('0x39')]),_0x1f271b);if(_0x2e2d68[_0x3efe('0x2f')]['filter']){_0x423056['where']=_[_0x3efe('0x3a')](_0x423056['where'],{'$or':_[_0x3efe('0x2b')](_0x1f271b,function(_0x398cf2){if(_0x398cf2[_0x3efe('0x3b')]!==_0x3efe('0x3c')){var _0x1448ce={};_0x1448ce[_0x398cf2[_0x3efe('0x2a')]]={'$like':'%'+_0x2e2d68['query'][_0x3efe('0x3d')]+'%'};return _0x1448ce;}})});}_0x423056=_[_0x3efe('0x3a')]({},_0x423056,_0x2e2d68[_0x3efe('0x3e')]);var _0xd26138={'where':_0x423056[_0x3efe('0x37')]};return db[_0x3efe('0x3f')]['count'](_0xd26138)[_0x3efe('0x24')](function(_0xf2622c){_0x45d873[_0x3efe('0x1d')]=_0xf2622c;if(_0x2e2d68['query'][_0x3efe('0x40')]){_0x423056[_0x3efe('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x423056);})['then'](function(_0x4640db){_0x45d873[_0x3efe('0x42')]=_0x4640db;return _0x45d873;})['then'](respondWithFilteredResult(_0x34229c,_0x423056))[_0x3efe('0x43')](handleError(_0x34229c,null));};exports[_0x3efe('0x44')]=function(_0x4de5f8,_0x838267){var _0x5b79f4={'raw':![],'where':{'id':_0x4de5f8[_0x3efe('0x45')]['id']}},_0x2718dc={};_0x2718dc[_0x3efe('0x31')]=_['keys'](db[_0x3efe('0x3f')][_0x3efe('0x2c')]);_0x2718dc[_0x3efe('0x2f')]=_['keys'](_0x4de5f8[_0x3efe('0x2f')]);_0x2718dc[_0x3efe('0x39')]=_['intersection'](_0x2718dc[_0x3efe('0x31')],_0x2718dc[_0x3efe('0x2f')]);_0x5b79f4[_0x3efe('0x30')]=_[_0x3efe('0x46')](_0x2718dc[_0x3efe('0x31')],qs[_0x3efe('0x32')](_0x4de5f8[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x5b79f4[_0x3efe('0x30')]=_0x5b79f4[_0x3efe('0x30')][_0x3efe('0x33')]?_0x5b79f4['attributes']:_0x2718dc['model'];if(_0x4de5f8[_0x3efe('0x2f')][_0x3efe('0x40')]){_0x5b79f4[_0x3efe('0x41')]=[{'all':!![]}];}_0x5b79f4=_[_0x3efe('0x3a')]({},_0x5b79f4,_0x4de5f8['options']);return db[_0x3efe('0x3f')][_0x3efe('0x47')](_0x5b79f4)['then'](handleEntityNotFound(_0x838267,null))[_0x3efe('0x24')](respondWithResult(_0x838267,null))[_0x3efe('0x43')](handleError(_0x838267,null));};exports[_0x3efe('0x48')]=function(_0x2abf19,_0x4da22d){return db[_0x3efe('0x3f')][_0x3efe('0x48')](_0x2abf19['body'],{})[_0x3efe('0x24')](function(_0x608c6){var _0xaa87c0=_0x2abf19[_0x3efe('0x49')][_0x3efe('0x26')]({'plain':!![]});if(!_0xaa87c0)throw new Error(_0x3efe('0x4a'));if(_0xaa87c0[_0x3efe('0x4b')]===_0x3efe('0x49')){var _0x2e8c07=_0x608c6[_0x3efe('0x26')]({'plain':!![]});var _0x4dbe67='IvrCampaigns';return db[_0x3efe('0x4c')]['find']({'where':{'name':_0x4dbe67,'userProfileId':_0xaa87c0[_0x3efe('0x4d')]},'raw':!![]})[_0x3efe('0x24')](function(_0x596418){if(_0x596418&&_0x596418[_0x3efe('0x4e')]===0x0){return db[_0x3efe('0x28')][_0x3efe('0x48')]({'name':_0x2e8c07[_0x3efe('0x2a')],'resourceId':_0x2e8c07['id'],'type':_0x596418[_0x3efe('0x2a')],'sectionId':_0x596418['id']},{})['then'](function(){return _0x608c6;});}else{return _0x608c6;}})[_0x3efe('0x43')](function(_0x52db49){logger[_0x3efe('0x29')](_0x3efe('0x4f'),_0x52db49);throw _0x52db49;});}return _0x608c6;})[_0x3efe('0x24')](respondWithResult(_0x4da22d,0xc9))[_0x3efe('0x43')](handleError(_0x4da22d,null));};exports[_0x3efe('0x50')]=function(_0x9ab635,_0x306b42){var _0x40c1f3={'where':{'id':_0x9ab635[_0x3efe('0x45')]['id']}},_0xb74ca={};_0xb74ca['model']=_[_0x3efe('0x51')](db['Campaign'][_0x3efe('0x2c')]);_0x40c1f3[_0x3efe('0x30')]=_[_0x3efe('0x46')](_0xb74ca[_0x3efe('0x31')],qs[_0x3efe('0x32')](_0x9ab635[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x40c1f3[_0x3efe('0x30')]=_0x40c1f3[_0x3efe('0x30')]['length']?_0x40c1f3[_0x3efe('0x30')]:_0xb74ca[_0x3efe('0x31')];if(_0x9ab635[_0x3efe('0x2f')][_0x3efe('0x40')]){_0x40c1f3[_0x3efe('0x41')]=[{'all':!![]}];}_0x40c1f3=_[_0x3efe('0x3a')]({},_0x40c1f3,_0x9ab635['options']);return db[_0x3efe('0x3f')][_0x3efe('0x47')](_0x40c1f3)['then'](handleEntityNotFound(_0x306b42,null))[_0x3efe('0x24')](function(_0x31ccd4){if(_0x31ccd4){var _0x1e314b=_0x31ccd4['get']({'plain':!![]});_0x1e314b=qs['omit'](_0x1e314b,['id','createdAt',_0x3efe('0x52')]);_0x9ab635['body']=_[_0x3efe('0x53')](_0x9ab635[_0x3efe('0x54')],['id',_0x3efe('0x55'),_0x3efe('0x52')]);return db[_0x3efe('0x3f')]['create'](_[_0x3efe('0x3a')](_0x1e314b,_0x9ab635[_0x3efe('0x54')]),{'include':_0x9ab635[_0x3efe('0x2f')][_0x3efe('0x40')]?[{'all':!![]}]:undefined})[_0x3efe('0x24')](function(_0x59dba9){var _0x481870=_0x9ab635[_0x3efe('0x49')][_0x3efe('0x26')]({'plain':!![]});if(!_0x481870)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x481870[_0x3efe('0x4b')]==='user'){var _0x5be3d7=_0x59dba9[_0x3efe('0x26')]({'plain':!![]});var _0x3eee6e='IvrCampaigns';return db['UserProfileSection'][_0x3efe('0x47')]({'where':{'name':_0x3eee6e,'userProfileId':_0x481870['userProfileId']},'raw':!![]})[_0x3efe('0x24')](function(_0x4a909c){if(_0x4a909c&&_0x4a909c[_0x3efe('0x4e')]===0x0){return db[_0x3efe('0x28')][_0x3efe('0x48')]({'name':_0x5be3d7['name'],'resourceId':_0x5be3d7['id'],'type':_0x4a909c[_0x3efe('0x2a')],'sectionId':_0x4a909c['id']},{})['then'](function(){return _0x59dba9;});}else{return _0x59dba9;}})['catch'](function(_0x4ce223){logger[_0x3efe('0x29')](_0x3efe('0x4f'),_0x4ce223);throw _0x4ce223;});}return _0x59dba9;});}})[_0x3efe('0x24')](respondWithResult(_0x306b42,0xc9))[_0x3efe('0x43')](handleError(_0x306b42,null));};exports[_0x3efe('0x56')]=function(_0x554854,_0x5ebd01){if(_0x554854['body']['id']){delete _0x554854['body']['id'];}return db[_0x3efe('0x3f')][_0x3efe('0x47')]({'where':{'id':_0x554854['params']['id']}})['then'](handleEntityNotFound(_0x5ebd01,null))['then'](saveUpdates(_0x554854[_0x3efe('0x54')],null))[_0x3efe('0x24')](respondWithResult(_0x5ebd01,null))[_0x3efe('0x43')](handleError(_0x5ebd01,null));};exports['destroy']=function(_0x575580,_0x3dc3c7){return db[_0x3efe('0x3f')][_0x3efe('0x47')]({'where':{'id':_0x575580[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x3dc3c7,null))[_0x3efe('0x24')](removeEntity(_0x3dc3c7,null))[_0x3efe('0x43')](handleError(_0x3dc3c7,null));};exports[_0x3efe('0x57')]=function(_0x1daa11,_0x54fd9f,_0x185da1){var _0x4cb191={'raw':!![],'where':{}};var _0x4586ae={};var _0x45235d={'count':0x0,'rows':[]};return db[_0x3efe('0x3f')][_0x3efe('0x58')]({'where':{'id':_0x1daa11[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x54fd9f,null))[_0x3efe('0x24')](function(_0x4ee844){if(_0x4ee844){_0x4586ae[_0x3efe('0x31')]=_['keys'](db['CmHopper']['rawAttributes']);_0x4586ae[_0x3efe('0x2f')]=_['keys'](_0x1daa11[_0x3efe('0x2f')]);_0x4586ae[_0x3efe('0x39')]=_[_0x3efe('0x46')](_0x4586ae[_0x3efe('0x31')],_0x4586ae['query']);_0x4cb191['attributes']=_['intersection'](_0x4586ae[_0x3efe('0x31')],qs['fields'](_0x1daa11['query'][_0x3efe('0x32')]));_0x4cb191[_0x3efe('0x30')]=_0x4cb191[_0x3efe('0x30')][_0x3efe('0x33')]?_0x4cb191['attributes']:_0x4586ae[_0x3efe('0x31')];if(!_0x1daa11[_0x3efe('0x2f')]['hasOwnProperty']('nolimit')){_0x4cb191[_0x3efe('0x1e')]=qs[_0x3efe('0x1e')](_0x1daa11[_0x3efe('0x2f')][_0x3efe('0x1e')]);_0x4cb191[_0x3efe('0x1b')]=qs[_0x3efe('0x1b')](_0x1daa11['query'][_0x3efe('0x1b')]);}_0x4cb191[_0x3efe('0x59')]=qs[_0x3efe('0x36')](_0x1daa11[_0x3efe('0x2f')][_0x3efe('0x36')]);_0x4cb191[_0x3efe('0x37')]=qs[_0x3efe('0x39')](_[_0x3efe('0x38')](_0x1daa11['query'],_0x4586ae[_0x3efe('0x39')]));_0x4cb191[_0x3efe('0x37')][_0x3efe('0x5a')]=_0x4ee844['id'];if(_0x1daa11[_0x3efe('0x2f')]['filter']){_0x4cb191[_0x3efe('0x37')]=_[_0x3efe('0x3a')](_0x4cb191['where'],{'$or':_[_0x3efe('0x2b')](_0x4cb191[_0x3efe('0x30')],function(_0xe5653){var _0x3f7412={};_0x3f7412[_0xe5653]={'$like':'%'+_0x1daa11[_0x3efe('0x2f')]['filter']+'%'};return _0x3f7412;})});}_0x4cb191=_[_0x3efe('0x3a')]({},_0x4cb191,_0x1daa11[_0x3efe('0x3e')]);return db[_0x3efe('0x5b')][_0x3efe('0x1d')]({'where':_0x4cb191[_0x3efe('0x37')]})['then'](function(_0x371354){_0x45235d[_0x3efe('0x1d')]=_0x371354;if(_0x1daa11[_0x3efe('0x2f')][_0x3efe('0x40')]){_0x4cb191['include']=[{'all':!![]}];}return db[_0x3efe('0x5b')][_0x3efe('0x5c')](_0x4cb191);})[_0x3efe('0x24')](function(_0x4fdf8a){_0x45235d['rows']=_0x4fdf8a;return _0x45235d;});}})['then'](respondWithFilteredResult(_0x54fd9f,_0x4cb191))[_0x3efe('0x43')](handleError(_0x54fd9f,null));};exports[_0x3efe('0x5d')]=function(_0xb94458,_0x3b823d,_0x4f9a8e){var _0x599b6b={'raw':!![],'where':{}};var _0x113995={};var _0x31c47d={'count':0x0,'rows':[]};return db[_0x3efe('0x3f')][_0x3efe('0x58')]({'where':{'id':_0xb94458['params']['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x3b823d,null))[_0x3efe('0x24')](function(_0x56dc49){if(_0x56dc49){_0x113995[_0x3efe('0x31')]=_[_0x3efe('0x51')](db[_0x3efe('0x5e')][_0x3efe('0x2c')]);_0x113995[_0x3efe('0x2f')]=_['keys'](_0xb94458[_0x3efe('0x2f')]);_0x113995['filters']=_['intersection'](_0x113995[_0x3efe('0x31')],_0x113995['query']);_0x599b6b[_0x3efe('0x30')]=_[_0x3efe('0x46')](_0x113995['model'],qs[_0x3efe('0x32')](_0xb94458[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x599b6b['attributes']=_0x599b6b[_0x3efe('0x30')][_0x3efe('0x33')]?_0x599b6b[_0x3efe('0x30')]:_0x113995[_0x3efe('0x31')];if(!_0xb94458[_0x3efe('0x2f')]['hasOwnProperty'](_0x3efe('0x35'))){_0x599b6b[_0x3efe('0x1e')]=qs[_0x3efe('0x1e')](_0xb94458[_0x3efe('0x2f')][_0x3efe('0x1e')]);_0x599b6b[_0x3efe('0x1b')]=qs[_0x3efe('0x1b')](_0xb94458[_0x3efe('0x2f')][_0x3efe('0x1b')]);}_0x599b6b[_0x3efe('0x59')]=qs[_0x3efe('0x36')](_0xb94458[_0x3efe('0x2f')][_0x3efe('0x36')]);_0x599b6b['where']=qs[_0x3efe('0x39')](_[_0x3efe('0x38')](_0xb94458[_0x3efe('0x2f')],_0x113995[_0x3efe('0x39')]));_0x599b6b['where']['CampaignId']=_0x56dc49['id'];if(_0xb94458[_0x3efe('0x2f')]['filter']){_0x599b6b[_0x3efe('0x37')]=_[_0x3efe('0x3a')](_0x599b6b[_0x3efe('0x37')],{'$or':_['map'](_0x599b6b['attributes'],function(_0x330b95){var _0x325de1={};_0x325de1[_0x330b95]={'$like':'%'+_0xb94458[_0x3efe('0x2f')][_0x3efe('0x3d')]+'%'};return _0x325de1;})});}_0x599b6b=_[_0x3efe('0x3a')]({},_0x599b6b,_0xb94458[_0x3efe('0x3e')]);return db[_0x3efe('0x5e')][_0x3efe('0x1d')]({'where':_0x599b6b[_0x3efe('0x37')]})[_0x3efe('0x24')](function(_0x2014b8){_0x31c47d[_0x3efe('0x1d')]=_0x2014b8;if(_0xb94458[_0x3efe('0x2f')][_0x3efe('0x40')]){_0x599b6b[_0x3efe('0x41')]=[{'all':!![]}];}return db[_0x3efe('0x5e')]['findAll'](_0x599b6b);})['then'](function(_0x55dad0){_0x31c47d[_0x3efe('0x42')]=_0x55dad0;return _0x31c47d;});}})[_0x3efe('0x24')](respondWithFilteredResult(_0x3b823d,_0x599b6b))[_0x3efe('0x43')](handleError(_0x3b823d,null));};exports[_0x3efe('0x5f')]=function(_0x1cedfb,_0x3ce91e,_0x5b3fce){var _0x123f07={'raw':!![],'where':{}};var _0x2d588e={};var _0x2b06b4={'count':0x0,'rows':[]};return db[_0x3efe('0x3f')]['findOne']({'where':{'id':_0x1cedfb[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x3ce91e,null))[_0x3efe('0x24')](function(_0x16a4f1){if(_0x16a4f1){_0x2d588e[_0x3efe('0x31')]=_[_0x3efe('0x51')](db[_0x3efe('0x60')][_0x3efe('0x2c')]);_0x2d588e[_0x3efe('0x2f')]=_['keys'](_0x1cedfb[_0x3efe('0x2f')]);_0x2d588e['filters']=_[_0x3efe('0x46')](_0x2d588e[_0x3efe('0x31')],_0x2d588e[_0x3efe('0x2f')]);_0x123f07[_0x3efe('0x30')]=_[_0x3efe('0x46')](_0x2d588e['model'],qs['fields'](_0x1cedfb[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x123f07['attributes']=_0x123f07['attributes']['length']?_0x123f07['attributes']:_0x2d588e[_0x3efe('0x31')];if(!_0x1cedfb[_0x3efe('0x2f')]['hasOwnProperty'](_0x3efe('0x35'))){_0x123f07[_0x3efe('0x1e')]=qs['limit'](_0x1cedfb[_0x3efe('0x2f')][_0x3efe('0x1e')]);_0x123f07['offset']=qs[_0x3efe('0x1b')](_0x1cedfb['query'][_0x3efe('0x1b')]);}_0x123f07[_0x3efe('0x59')]=qs[_0x3efe('0x36')](_0x1cedfb[_0x3efe('0x2f')][_0x3efe('0x36')]);_0x123f07[_0x3efe('0x37')]=qs[_0x3efe('0x39')](_[_0x3efe('0x38')](_0x1cedfb[_0x3efe('0x2f')],_0x2d588e[_0x3efe('0x39')]));_0x123f07[_0x3efe('0x37')][_0x3efe('0x5a')]=_0x16a4f1['id'];if(_0x1cedfb[_0x3efe('0x2f')]['filter']){_0x123f07['where']=_['merge'](_0x123f07[_0x3efe('0x37')],{'$or':_[_0x3efe('0x2b')](_0x123f07[_0x3efe('0x30')],function(_0x3c9a09){var _0x384dec={};_0x384dec[_0x3c9a09]={'$like':'%'+_0x1cedfb[_0x3efe('0x2f')]['filter']+'%'};return _0x384dec;})});}_0x123f07=_[_0x3efe('0x3a')]({},_0x123f07,_0x1cedfb['options']);return db['CmHopperFinal'][_0x3efe('0x1d')]({'where':_0x123f07['where']})[_0x3efe('0x24')](function(_0x2ba3a0){_0x2b06b4[_0x3efe('0x1d')]=_0x2ba3a0;if(_0x1cedfb[_0x3efe('0x2f')][_0x3efe('0x40')]){_0x123f07[_0x3efe('0x41')]=[{'all':!![]}];}return db[_0x3efe('0x60')][_0x3efe('0x5c')](_0x123f07);})['then'](function(_0x35002b){_0x2b06b4[_0x3efe('0x42')]=_0x35002b;return _0x2b06b4;});}})[_0x3efe('0x24')](respondWithFilteredResult(_0x3ce91e,_0x123f07))[_0x3efe('0x43')](handleError(_0x3ce91e,null));};exports[_0x3efe('0x61')]=function(_0x13e4bb,_0x13ea5e,_0x1f7e1b){var _0x50a6ff={'raw':!![],'where':{}};var _0x44ec74={};var _0x3b9b45={'count':0x0,'rows':[]};return db[_0x3efe('0x3f')][_0x3efe('0x58')]({'where':{'id':_0x13e4bb['params']['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x13ea5e,null))[_0x3efe('0x24')](function(_0x5e3187){if(_0x5e3187){_0x44ec74[_0x3efe('0x31')]=_[_0x3efe('0x51')](db[_0x3efe('0x62')][_0x3efe('0x2c')]);_0x44ec74[_0x3efe('0x2f')]=_[_0x3efe('0x51')](_0x13e4bb['query']);_0x44ec74['filters']=_[_0x3efe('0x46')](_0x44ec74[_0x3efe('0x31')],_0x44ec74['query']);_0x50a6ff[_0x3efe('0x30')]=_[_0x3efe('0x46')](_0x44ec74[_0x3efe('0x31')],qs[_0x3efe('0x32')](_0x13e4bb[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x50a6ff['attributes']=_0x50a6ff[_0x3efe('0x30')]['length']?_0x50a6ff[_0x3efe('0x30')]:_0x44ec74[_0x3efe('0x31')];if(!_0x13e4bb[_0x3efe('0x2f')][_0x3efe('0x34')](_0x3efe('0x35'))){_0x50a6ff[_0x3efe('0x1e')]=qs[_0x3efe('0x1e')](_0x13e4bb[_0x3efe('0x2f')][_0x3efe('0x1e')]);_0x50a6ff[_0x3efe('0x1b')]=qs[_0x3efe('0x1b')](_0x13e4bb[_0x3efe('0x2f')]['offset']);}_0x50a6ff[_0x3efe('0x59')]=qs[_0x3efe('0x36')](_0x13e4bb[_0x3efe('0x2f')][_0x3efe('0x36')]);_0x50a6ff['where']=qs[_0x3efe('0x39')](_['pick'](_0x13e4bb['query'],_0x44ec74[_0x3efe('0x39')]));_0x50a6ff[_0x3efe('0x37')][_0x3efe('0x5a')]=_0x5e3187['id'];if(_0x13e4bb[_0x3efe('0x2f')][_0x3efe('0x3d')]){_0x50a6ff['where']=_[_0x3efe('0x3a')](_0x50a6ff[_0x3efe('0x37')],{'$or':_[_0x3efe('0x2b')](_0x50a6ff[_0x3efe('0x30')],function(_0x4d7061){var _0x4e7bc0={};_0x4e7bc0[_0x4d7061]={'$like':'%'+_0x13e4bb[_0x3efe('0x2f')][_0x3efe('0x3d')]+'%'};return _0x4e7bc0;})});}_0x50a6ff=_[_0x3efe('0x3a')]({},_0x50a6ff,_0x13e4bb[_0x3efe('0x3e')]);return db[_0x3efe('0x62')][_0x3efe('0x1d')]({'where':_0x50a6ff['where']})[_0x3efe('0x24')](function(_0x3aa22b){_0x3b9b45[_0x3efe('0x1d')]=_0x3aa22b;if(_0x13e4bb['query'][_0x3efe('0x40')]){_0x50a6ff[_0x3efe('0x41')]=[{'all':!![]}];}return db[_0x3efe('0x62')][_0x3efe('0x5c')](_0x50a6ff);})[_0x3efe('0x24')](function(_0x9e3b70){_0x3b9b45[_0x3efe('0x42')]=_0x9e3b70;return _0x3b9b45;});}})[_0x3efe('0x24')](respondWithFilteredResult(_0x13ea5e,_0x50a6ff))[_0x3efe('0x43')](handleError(_0x13ea5e,null));};exports['getLists']=function(_0x390e0c,_0x44ed1b,_0x457f76){var _0x30eabd={};var _0x15db83={};var _0x3b42e3;var _0x5d396e;return db[_0x3efe('0x3f')][_0x3efe('0x58')]({'where':{'id':_0x390e0c[_0x3efe('0x45')]['id']}})['then'](handleEntityNotFound(_0x44ed1b,null))['then'](function(_0x5910e1){if(_0x5910e1){_0x3b42e3=_0x5910e1;_0x15db83['model']=_[_0x3efe('0x51')](db[_0x3efe('0x63')][_0x3efe('0x2c')]);_0x15db83[_0x3efe('0x2f')]=_[_0x3efe('0x51')](_0x390e0c[_0x3efe('0x2f')]);_0x15db83[_0x3efe('0x39')]=_['intersection'](_0x15db83['model'],_0x15db83[_0x3efe('0x2f')]);_0x30eabd[_0x3efe('0x30')]=_['intersection'](_0x15db83[_0x3efe('0x31')],qs[_0x3efe('0x32')](_0x390e0c[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x30eabd[_0x3efe('0x30')]=_0x30eabd[_0x3efe('0x30')][_0x3efe('0x33')]?_0x30eabd[_0x3efe('0x30')]:_0x15db83[_0x3efe('0x31')];_0x30eabd['order']=qs[_0x3efe('0x36')](_0x390e0c[_0x3efe('0x2f')][_0x3efe('0x36')]);_0x30eabd['where']=qs[_0x3efe('0x39')](_[_0x3efe('0x38')](_0x390e0c['query'],_0x15db83[_0x3efe('0x39')]));if(_0x390e0c[_0x3efe('0x2f')]['filter']){_0x30eabd[_0x3efe('0x37')]=_[_0x3efe('0x3a')](_0x30eabd[_0x3efe('0x37')],{'$or':_[_0x3efe('0x2b')](_0x30eabd[_0x3efe('0x30')],function(_0xced445){var _0x2a94cd={};_0x2a94cd[_0xced445]={'$like':'%'+_0x390e0c[_0x3efe('0x2f')][_0x3efe('0x3d')]+'%'};return _0x2a94cd;})});}_0x30eabd=_['merge']({},_0x30eabd,_0x390e0c[_0x3efe('0x3e')]);return _0x3b42e3['getLists'](_0x30eabd);}})[_0x3efe('0x24')](function(_0x4d850a){if(_0x4d850a){_0x5d396e=_0x4d850a[_0x3efe('0x33')];if(!_0x390e0c[_0x3efe('0x2f')]['hasOwnProperty']('nolimit')){_0x30eabd[_0x3efe('0x1e')]=qs[_0x3efe('0x1e')](_0x390e0c['query']['limit']);_0x30eabd[_0x3efe('0x1b')]=qs[_0x3efe('0x1b')](_0x390e0c[_0x3efe('0x2f')][_0x3efe('0x1b')]);}return _0x3b42e3[_0x3efe('0x64')](_0x30eabd);}})[_0x3efe('0x24')](function(_0x483042){if(_0x483042){return _0x483042?{'count':_0x5d396e,'rows':_0x483042}:null;}})['then'](respondWithResult(_0x44ed1b,null))['catch'](handleError(_0x44ed1b,null));};exports['addLists']=function(_0x234232,_0x27e3e5,_0x220459){var _0x39126d,_0x199dca;var _0x47e34d=[];var _0x3d4ffd=moment()[_0x3efe('0x65')](_0x3efe('0x66'));return db[_0x3efe('0x3f')][_0x3efe('0x47')]({'where':{'id':_0x234232['params']['id']}})['then'](handleEntityNotFound(_0x27e3e5,null))[_0x3efe('0x24')](function(_0x159155){if(_0x159155){_0x199dca=_0x159155;return _0x159155[_0x3efe('0x67')](_0x234232[_0x3efe('0x54')][_0x3efe('0x68')],_[_0x3efe('0x53')](_0x234232[_0x3efe('0x54')],[_0x3efe('0x68'),'id'])||{});}return null;})[_0x3efe('0x69')](function(_0x1981d4){var _0x41b218;var _0x2908ba;_0x39126d=_0x1981d4||[];var _0x1c3674=[];if(_0x1981d4){for(var _0x2a536e=0x0;_0x2a536e<_0x1981d4[_0x3efe('0x33')];_0x2a536e+=0x1){var _0x6fcb32=_0x1981d4[_0x2a536e][_0x3efe('0x26')]({'plain':!![]});_0x199dca[_0x3efe('0x6a')]=_0x234232[_0x3efe('0x54')][_0x3efe('0x6a')]?_0x234232[_0x3efe('0x54')]['dialCheckDuplicateType']:_0x199dca['dialCheckDuplicateType'];switch(_0x199dca[_0x3efe('0x6a')]){case _0x3efe('0x6b'):_0x41b218=squel['insert']()[_0x3efe('0x6c')](_0x3efe('0x6d'))['fromQuery']([_0x3efe('0x6e'),_0x3efe('0x6f'),_0x3efe('0x70'),_0x3efe('0x71'),_0x3efe('0x5a'),'createdAt',_0x3efe('0x52')],squel['select']()[_0x3efe('0x72')](_0x3efe('0x6e'),'phone')[_0x3efe('0x72')](_0x3efe('0x73'),_0x3efe('0x6f'))[_0x3efe('0x72')]('id',_0x3efe('0x70'))[_0x3efe('0x72')](_0x6fcb32['CmListId'][_0x3efe('0x74')](),_0x3efe('0x71'))[_0x3efe('0x72')](_0x234232[_0x3efe('0x45')]['id'][_0x3efe('0x74')](),'CampaignId')[_0x3efe('0x72')]('\x27'+_0x3d4ffd+'\x27',_0x3efe('0x55'))[_0x3efe('0x72')]('\x27'+_0x3d4ffd+'\x27','updatedAt')[_0x3efe('0x75')](_0x3efe('0x76'))[_0x3efe('0x37')](_0x3efe('0x77'))[_0x3efe('0x37')](_0x3efe('0x78'),_0x6fcb32[_0x3efe('0x79')][_0x3efe('0x74')]())[_0x3efe('0x37')](_0x3efe('0x7a'))[_0x3efe('0x37')](_0x3efe('0x7b'),squel[_0x3efe('0x7c')]()['field'](_0x3efe('0x7d'))[_0x3efe('0x75')](_0x3efe('0x7e'))[_0x3efe('0x37')](_0x3efe('0x7f'),_0x234232[_0x3efe('0x45')]['id'][_0x3efe('0x74')]()))[_0x3efe('0x37')](_0x3efe('0x7b'),squel[_0x3efe('0x7c')]()[_0x3efe('0x72')](_0x3efe('0x80'))[_0x3efe('0x75')]('cm_hopper')[_0x3efe('0x37')](_0x3efe('0x7f'),_0x234232[_0x3efe('0x45')]['id'][_0x3efe('0x74')]())))['toString']();break;case'onlyIfOpen':_0x41b218=squel[_0x3efe('0x81')]()['into'](_0x3efe('0x6d'))[_0x3efe('0x82')]([_0x3efe('0x6e'),_0x3efe('0x6f'),_0x3efe('0x70'),_0x3efe('0x71'),_0x3efe('0x5a'),_0x3efe('0x55'),_0x3efe('0x52')],squel[_0x3efe('0x7c')]()['field'](_0x3efe('0x6e'),_0x3efe('0x6e'))[_0x3efe('0x72')](_0x3efe('0x73'),'scheduledAt')[_0x3efe('0x72')]('id',_0x3efe('0x70'))['field'](_0x6fcb32[_0x3efe('0x79')][_0x3efe('0x74')](),_0x3efe('0x71'))['field'](_0x234232[_0x3efe('0x45')]['id'][_0x3efe('0x74')](),_0x3efe('0x5a'))[_0x3efe('0x72')]('\x27'+_0x3d4ffd+'\x27',_0x3efe('0x55'))[_0x3efe('0x72')]('\x27'+_0x3d4ffd+'\x27','updatedAt')['from'](_0x3efe('0x76'))[_0x3efe('0x37')]('deletedAt\x20IS\x20NULL')[_0x3efe('0x37')]('ListId\x20=\x20?',_0x6fcb32[_0x3efe('0x79')][_0x3efe('0x74')]())[_0x3efe('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0x3efe('0x37')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3efe('0x72')](_0x3efe('0x80'))['from'](_0x3efe('0x6d'))[_0x3efe('0x37')](_0x3efe('0x7f'),_0x234232[_0x3efe('0x45')]['id'][_0x3efe('0x74')]())))[_0x3efe('0x74')]();break;default:_0x41b218=squel[_0x3efe('0x81')]()['into']('cm_hopper')[_0x3efe('0x82')]([_0x3efe('0x6e'),_0x3efe('0x6f'),_0x3efe('0x70'),_0x3efe('0x71'),_0x3efe('0x5a'),_0x3efe('0x55'),_0x3efe('0x52')],squel[_0x3efe('0x7c')]()[_0x3efe('0x72')](_0x3efe('0x6e'),_0x3efe('0x6e'))['field'](_0x3efe('0x73'),_0x3efe('0x6f'))['field']('id',_0x3efe('0x70'))[_0x3efe('0x72')](_0x6fcb32['CmListId'][_0x3efe('0x74')](),_0x3efe('0x71'))[_0x3efe('0x72')](_0x234232[_0x3efe('0x45')]['id'][_0x3efe('0x74')](),_0x3efe('0x5a'))['field']('\x27'+_0x3d4ffd+'\x27',_0x3efe('0x55'))[_0x3efe('0x72')]('\x27'+_0x3d4ffd+'\x27',_0x3efe('0x52'))[_0x3efe('0x75')](_0x3efe('0x76'))[_0x3efe('0x37')](_0x3efe('0x77'))['where'](_0x3efe('0x78'),_0x6fcb32[_0x3efe('0x79')][_0x3efe('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x3efe('0x74')]();}_0x2908ba=squel[_0x3efe('0x81')]()[_0x3efe('0x6c')](_0x3efe('0x83'))[_0x3efe('0x82')]([_0x3efe('0x84'),_0x3efe('0x6f'),_0x3efe('0x6e'),_0x3efe('0x85'),'createdAt',_0x3efe('0x52')],squel[_0x3efe('0x7c')]()[_0x3efe('0x72')]('h.id','id')[_0x3efe('0x72')](_0x3efe('0x73'),'scheduledAt')['field'](_0x3efe('0x86'),_0x3efe('0x6e'))['field'](_0x3efe('0x87'),_0x3efe('0x85'))['field']('\x27'+_0x3d4ffd+'\x27',_0x3efe('0x55'))[_0x3efe('0x72')]('\x27'+_0x3d4ffd+'\x27',_0x3efe('0x52'))['from'](_0x3efe('0x88'),'ci')[_0x3efe('0x89')](_0x3efe('0x6d'),'h',_0x3efe('0x8a'))['where'](_0x3efe('0x8b'),_0x6fcb32[_0x3efe('0x79')]['toString']())[_0x3efe('0x37')](_0x3efe('0x8c'),_0x234232['params']['id'][_0x3efe('0x74')]())['where']('h.createdAt\x20=\x20?',_0x3d4ffd))[_0x3efe('0x74')]();_0x1c3674[_0x3efe('0x8d')](db[_0x3efe('0x8e')][_0x3efe('0x2f')](_0x41b218));_0x47e34d['push'](db[_0x3efe('0x8e')]['query'](_0x2908ba));}return BPromise['all'](_0x1c3674);}})[_0x3efe('0x24')](function(){return BPromise[_0x3efe('0x8f')](_0x47e34d);})[_0x3efe('0x24')](function(){return _0x39126d;})[_0x3efe('0x24')](respondWithResult(_0x27e3e5,null))[_0x3efe('0x43')](handleError(_0x27e3e5,null));};exports[_0x3efe('0x90')]=function(_0x412b03,_0x5177bd,_0x317fd3){return db[_0x3efe('0x3f')][_0x3efe('0x47')]({'where':{'id':_0x412b03['params']['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x5177bd,null))[_0x3efe('0x24')](function(_0x1b75ea){if(_0x1b75ea){return _0x1b75ea['removeLists'](_0x412b03[_0x3efe('0x2f')][_0x3efe('0x68')]);}})[_0x3efe('0x24')](function(_0x5eb913){if(_0x5eb913){return db[_0x3efe('0x5b')][_0x3efe('0x25')]({'where':{'ListId':_0x412b03['query'][_0x3efe('0x68')],'CampaignId':_0x412b03[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](function(){return _0x5eb913;});}})[_0x3efe('0x24')](respondWithStatusCode(_0x5177bd,null))[_0x3efe('0x43')](handleError(_0x5177bd,null));};exports['getBlackLists']=function(_0x5cf763,_0x54b22a,_0x532546){var _0x566d83={};var _0x2ba952={};var _0x27d4cc;var _0x34572f;return db['Campaign']['findOne']({'where':{'id':_0x5cf763[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x54b22a,null))[_0x3efe('0x24')](function(_0x335469){if(_0x335469){_0x27d4cc=_0x335469;_0x2ba952['model']=_[_0x3efe('0x51')](db[_0x3efe('0x63')][_0x3efe('0x2c')]);_0x2ba952[_0x3efe('0x2f')]=_[_0x3efe('0x51')](_0x5cf763[_0x3efe('0x2f')]);_0x2ba952[_0x3efe('0x39')]=_[_0x3efe('0x46')](_0x2ba952[_0x3efe('0x31')],_0x2ba952['query']);_0x566d83[_0x3efe('0x30')]=_[_0x3efe('0x46')](_0x2ba952[_0x3efe('0x31')],qs['fields'](_0x5cf763[_0x3efe('0x2f')][_0x3efe('0x32')]));_0x566d83['attributes']=_0x566d83[_0x3efe('0x30')][_0x3efe('0x33')]?_0x566d83['attributes']:_0x2ba952[_0x3efe('0x31')];_0x566d83[_0x3efe('0x59')]=qs['sort'](_0x5cf763[_0x3efe('0x2f')][_0x3efe('0x36')]);_0x566d83['where']=qs[_0x3efe('0x39')](_[_0x3efe('0x38')](_0x5cf763[_0x3efe('0x2f')],_0x2ba952[_0x3efe('0x39')]));if(_0x5cf763['query']['filter']){_0x566d83[_0x3efe('0x37')]=_[_0x3efe('0x3a')](_0x566d83[_0x3efe('0x37')],{'$or':_[_0x3efe('0x2b')](_0x566d83[_0x3efe('0x30')],function(_0x5c0962){var _0x99559f={};_0x99559f[_0x5c0962]={'$like':'%'+_0x5cf763[_0x3efe('0x2f')][_0x3efe('0x3d')]+'%'};return _0x99559f;})});}_0x566d83=_[_0x3efe('0x3a')]({},_0x566d83,_0x5cf763[_0x3efe('0x3e')]);return _0x27d4cc[_0x3efe('0x91')](_0x566d83);}})[_0x3efe('0x24')](function(_0x19ef0c){if(_0x19ef0c){_0x34572f=_0x19ef0c[_0x3efe('0x33')];if(!_0x5cf763[_0x3efe('0x2f')][_0x3efe('0x34')]('nolimit')){_0x566d83['limit']=qs['limit'](_0x5cf763['query']['limit']);_0x566d83['offset']=qs[_0x3efe('0x1b')](_0x5cf763[_0x3efe('0x2f')][_0x3efe('0x1b')]);}return _0x27d4cc[_0x3efe('0x91')](_0x566d83);}})[_0x3efe('0x24')](function(_0x4d3308){if(_0x4d3308){return _0x4d3308?{'count':_0x34572f,'rows':_0x4d3308}:null;}})[_0x3efe('0x24')](respondWithResult(_0x54b22a,null))[_0x3efe('0x43')](handleError(_0x54b22a,null));};exports[_0x3efe('0x92')]=function(_0x37c132,_0xf3c356,_0x55759f){var _0x3bf7a9,_0x23197f;var _0x4527f5=[];var _0x5b9060=moment()[_0x3efe('0x65')](_0x3efe('0x66'));return db[_0x3efe('0x3f')][_0x3efe('0x47')]({'where':{'id':_0x37c132['params']['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0xf3c356,null))['then'](function(_0x415dfd){if(_0x415dfd){_0x23197f=_0x415dfd;return _0x415dfd[_0x3efe('0x92')](_0x37c132['body']['ids'],_[_0x3efe('0x53')](_0x37c132[_0x3efe('0x54')],['ids','id'])||{});}return null;})[_0x3efe('0x69')](function(_0x35d3f5){var _0xcdd6f7;var _0x4003f7;_0x3bf7a9=_0x35d3f5||[];var _0x3d7b1c=[];if(_0x35d3f5){for(var _0x50b43b=0x0;_0x50b43b<_0x35d3f5[_0x3efe('0x33')];_0x50b43b+=0x1){var _0x5ecb38=_0x35d3f5[_0x50b43b][_0x3efe('0x26')]({'plain':!![]});_0xcdd6f7=squel[_0x3efe('0x81')]()[_0x3efe('0x6c')](_0x3efe('0x93'))[_0x3efe('0x82')]([_0x3efe('0x6e'),_0x3efe('0x70'),_0x3efe('0x71'),_0x3efe('0x5a'),_0x3efe('0x55'),'updatedAt'],squel['select']()[_0x3efe('0x72')](_0x3efe('0x6e'),'phone')['field']('id','ContactId')[_0x3efe('0x72')](_0x5ecb38[_0x3efe('0x79')]['toString'](),'ListId')[_0x3efe('0x72')](_0x37c132['params']['id'][_0x3efe('0x74')](),_0x3efe('0x5a'))['field'](_0x3efe('0x73'),'createdAt')['field'](_0x3efe('0x73'),_0x3efe('0x52'))['from']('cm_contacts')[_0x3efe('0x37')](_0x3efe('0x77'))['where'](_0x3efe('0x78'),_0x5ecb38[_0x3efe('0x79')]['toString']())[_0x3efe('0x37')](_0x3efe('0x7a')))['toString']();_0x3d7b1c[_0x3efe('0x8d')](db[_0x3efe('0x8e')][_0x3efe('0x2f')](_0xcdd6f7));}return BPromise[_0x3efe('0x8f')](_0x3d7b1c);}})[_0x3efe('0x24')](function(){return _0x3bf7a9;})[_0x3efe('0x24')](respondWithResult(_0xf3c356,null))[_0x3efe('0x43')](handleError(_0xf3c356,null));};exports[_0x3efe('0x94')]=function(_0x2ef142,_0x391bb9,_0x348fb3){return db[_0x3efe('0x3f')][_0x3efe('0x47')]({'where':{'id':_0x2ef142[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](handleEntityNotFound(_0x391bb9,null))[_0x3efe('0x24')](function(_0x5453e0){if(_0x5453e0){return _0x5453e0['removeBlackLists'](_0x2ef142[_0x3efe('0x2f')][_0x3efe('0x68')]);}})[_0x3efe('0x24')](function(_0x4f2d0f){if(_0x4f2d0f){return db['CmHopperBlack'][_0x3efe('0x25')]({'where':{'ListId':_0x2ef142[_0x3efe('0x2f')][_0x3efe('0x68')],'CampaignId':_0x2ef142[_0x3efe('0x45')]['id']}})[_0x3efe('0x24')](function(){return _0x4f2d0f;});}})[_0x3efe('0x24')](respondWithStatusCode(_0x391bb9,null))[_0x3efe('0x43')](handleError(_0x391bb9,null));};
\ No newline at end of file
+var _0x1c8a=['cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','select','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','ContactId','NOW()','CmListId','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','Campaign','include','findAll','catch','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','findOne','CmHopper','pick','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ListId','field','scheduledAt','toString','from'];(function(_0x16eb3d,_0x157803){var _0x31612a=function(_0xedbb00){while(--_0xedbb00){_0x16eb3d['push'](_0x16eb3d['shift']());}};_0x31612a(++_0x157803);}(_0x1c8a,0x140));var _0xa1c8=function(_0x47dd29,_0x5a47a8){_0x47dd29=_0x47dd29-0x0;var _0x5c1eab=_0x1c8a[_0x47dd29];return _0x5c1eab;};'use strict';var emlformat=require(_0xa1c8('0x0'));var rimraf=require(_0xa1c8('0x1'));var zipdir=require(_0xa1c8('0x2'));var jsonpatch=require(_0xa1c8('0x3'));var rp=require(_0xa1c8('0x4'));var moment=require('moment');var BPromise=require(_0xa1c8('0x5'));var Mustache=require('mustache');var util=require(_0xa1c8('0x6'));var path=require(_0xa1c8('0x7'));var sox=require(_0xa1c8('0x8'));var csv=require('to-csv');var ejs=require(_0xa1c8('0x9'));var fs=require('fs');var fs_extra=require(_0xa1c8('0xa'));var _=require(_0xa1c8('0xb'));var squel=require('squel');var crypto=require(_0xa1c8('0xc'));var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c8('0xf'));var Papa=require(_0xa1c8('0x10'));var Redis=require(_0xa1c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1c8('0x14'));var db=require(_0xa1c8('0x15'))['db'];function respondWithStatusCode(_0x2647fa,_0x707249){_0x707249=_0x707249||0xcc;return function(_0x644e9c){if(_0x644e9c){return _0x2647fa[_0xa1c8('0x16')](_0x707249);}return _0x2647fa['status'](_0x707249)[_0xa1c8('0x17')]();};}function respondWithResult(_0x282525,_0xcccc7b){_0xcccc7b=_0xcccc7b||0xc8;return function(_0x3797fe){if(_0x3797fe){return _0x282525[_0xa1c8('0x18')](_0xcccc7b)[_0xa1c8('0x19')](_0x3797fe);}};}function respondWithFilteredResult(_0x517130,_0x7f1128){return function(_0x51b1c3){if(_0x51b1c3){var _0x17d4d2=typeof _0x7f1128[_0xa1c8('0x1a')]===_0xa1c8('0x1b')&&typeof _0x7f1128['limit']===_0xa1c8('0x1b');var _0x59284a=_0x51b1c3['count'];var _0x1fe87f=_0x17d4d2?0x0:_0x7f1128[_0xa1c8('0x1a')];var _0x57fe23=_0x17d4d2?_0x51b1c3[_0xa1c8('0x1c')]:_0x7f1128[_0xa1c8('0x1a')]+_0x7f1128[_0xa1c8('0x1d')];var _0x4e967e;if(_0x57fe23>=_0x59284a){_0x57fe23=_0x59284a;_0x4e967e=0xc8;}else{_0x4e967e=0xce;}_0x517130[_0xa1c8('0x18')](_0x4e967e);return _0x517130[_0xa1c8('0x1e')](_0xa1c8('0x1f'),_0x1fe87f+'-'+_0x57fe23+'/'+_0x59284a)['json'](_0x51b1c3);}return null;};}function patchUpdates(_0x2eabb2){return function(_0x874b1f){try{jsonpatch['apply'](_0x874b1f,_0x2eabb2,!![]);}catch(_0x38008a){return BPromise[_0xa1c8('0x20')](_0x38008a);}return _0x874b1f[_0xa1c8('0x21')]();};}function saveUpdates(_0x2a7fa5,_0x19fe5a){return function(_0x23ff11){if(_0x23ff11){return _0x23ff11[_0xa1c8('0x22')](_0x2a7fa5)[_0xa1c8('0x23')](function(_0x40bb1d){return _0x40bb1d;});}return null;};}function removeEntity(_0x193077,_0x28473c){return function(_0x125047){if(_0x125047){return _0x125047[_0xa1c8('0x24')]()[_0xa1c8('0x23')](function(){var _0x3f929f=_0x125047[_0xa1c8('0x25')]({'plain':!![]});var _0x572362=_0xa1c8('0x26');return db['UserProfileResource'][_0xa1c8('0x24')]({'where':{'type':_0x572362,'resourceId':_0x3f929f['id']}})['then'](function(){return _0x125047;});})[_0xa1c8('0x23')](function(){_0x193077[_0xa1c8('0x18')](0xcc)[_0xa1c8('0x17')]();});}};}function handleEntityNotFound(_0x4eb627,_0x305148){return function(_0x914018){if(!_0x914018){_0x4eb627[_0xa1c8('0x16')](0x194);}return _0x914018;};}function handleError(_0xa067ae,_0x5d756d){_0x5d756d=_0x5d756d||0x1f4;return function(_0x23131b){logger[_0xa1c8('0x27')](_0x23131b[_0xa1c8('0x28')]);if(_0x23131b['name']){delete _0x23131b['name'];}_0xa067ae[_0xa1c8('0x18')](_0x5d756d)[_0xa1c8('0x29')](_0x23131b);};}exports['index']=function(_0x348356,_0x42326b){var _0xeadfdd={},_0x560b55={},_0x4bd7cf={'count':0x0,'rows':[]};var _0x5c78eb=_[_0xa1c8('0x2a')](db['Campaign'][_0xa1c8('0x2b')],function(_0x2cee8b){return{'name':_0x2cee8b[_0xa1c8('0x2c')],'type':_0x2cee8b[_0xa1c8('0x2d')][_0xa1c8('0x2e')]};});_0x560b55[_0xa1c8('0x2f')]=_['map'](_0x5c78eb,_0xa1c8('0x30'));_0x560b55[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x348356[_0xa1c8('0x31')]);_0x560b55['filters']=_['intersection'](_0x560b55[_0xa1c8('0x2f')],_0x560b55['query']);_0xeadfdd[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x560b55[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x348356[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0xeadfdd[_0xa1c8('0x33')]=_0xeadfdd[_0xa1c8('0x33')]['length']?_0xeadfdd[_0xa1c8('0x33')]:_0x560b55[_0xa1c8('0x2f')];if(!_0x348356[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0xeadfdd[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x348356[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0xeadfdd[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x348356[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0xeadfdd[_0xa1c8('0x38')]=qs['sort'](_0x348356['query'][_0xa1c8('0x39')]);_0xeadfdd[_0xa1c8('0x3a')]=qs[_0xa1c8('0x3b')](_['pick'](_0x348356['query'],_0x560b55['filters']),_0x5c78eb);if(_0x348356[_0xa1c8('0x31')]['filter']){_0xeadfdd['where']=_[_0xa1c8('0x3c')](_0xeadfdd[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x5c78eb,function(_0x4d3899){if(_0x4d3899[_0xa1c8('0x2d')]!==_0xa1c8('0x3d')){var _0x585ba2={};_0x585ba2[_0x4d3899[_0xa1c8('0x30')]]={'$like':'%'+_0x348356[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x585ba2;}})});}_0xeadfdd=_['merge']({},_0xeadfdd,_0x348356[_0xa1c8('0x3f')]);var _0x947616={'where':_0xeadfdd[_0xa1c8('0x3a')]};return db[_0xa1c8('0x40')][_0xa1c8('0x1c')](_0x947616)['then'](function(_0x52aea5){_0x4bd7cf['count']=_0x52aea5;if(_0x348356['query']['includeAll']){_0xeadfdd[_0xa1c8('0x41')]=[{'all':!![]}];}return db[_0xa1c8('0x40')][_0xa1c8('0x42')](_0xeadfdd);})[_0xa1c8('0x23')](function(_0x3a5cd4){_0x4bd7cf['rows']=_0x3a5cd4;return _0x4bd7cf;})['then'](respondWithFilteredResult(_0x42326b,_0xeadfdd))[_0xa1c8('0x43')](handleError(_0x42326b,null));};exports[_0xa1c8('0x44')]=function(_0x1b0fad,_0x4d6e10){var _0x55d0e0={'raw':![],'where':{'id':_0x1b0fad[_0xa1c8('0x45')]['id']}},_0x45a913={};_0x45a913[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db[_0xa1c8('0x40')][_0xa1c8('0x2b')]);_0x45a913[_0xa1c8('0x31')]=_['keys'](_0x1b0fad[_0xa1c8('0x31')]);_0x45a913['filters']=_[_0xa1c8('0x34')](_0x45a913[_0xa1c8('0x2f')],_0x45a913[_0xa1c8('0x31')]);_0x55d0e0['attributes']=_[_0xa1c8('0x34')](_0x45a913['model'],qs[_0xa1c8('0x35')](_0x1b0fad[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x55d0e0['attributes']=_0x55d0e0[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x55d0e0['attributes']:_0x45a913[_0xa1c8('0x2f')];if(_0x1b0fad[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x55d0e0[_0xa1c8('0x41')]=[{'all':!![]}];}_0x55d0e0=_[_0xa1c8('0x3c')]({},_0x55d0e0,_0x1b0fad[_0xa1c8('0x3f')]);return db[_0xa1c8('0x40')][_0xa1c8('0x48')](_0x55d0e0)[_0xa1c8('0x23')](handleEntityNotFound(_0x4d6e10,null))['then'](respondWithResult(_0x4d6e10,null))[_0xa1c8('0x43')](handleError(_0x4d6e10,null));};exports[_0xa1c8('0x49')]=function(_0x470479,_0xf29fc){return db['Campaign'][_0xa1c8('0x49')](_0x470479[_0xa1c8('0x4a')],{})[_0xa1c8('0x23')](function(_0x44580d){var _0x364b57=_0x470479['user'][_0xa1c8('0x25')]({'plain':!![]});if(!_0x364b57)throw new Error(_0xa1c8('0x4b'));if(_0x364b57[_0xa1c8('0x4c')]===_0xa1c8('0x4d')){var _0x14ce13=_0x44580d['get']({'plain':!![]});var _0x5bbef3=_0xa1c8('0x26');return db[_0xa1c8('0x4e')][_0xa1c8('0x48')]({'where':{'name':_0x5bbef3,'userProfileId':_0x364b57['userProfileId']},'raw':!![]})[_0xa1c8('0x23')](function(_0x475590){if(_0x475590&&_0x475590[_0xa1c8('0x4f')]===0x0){return db[_0xa1c8('0x50')][_0xa1c8('0x49')]({'name':_0x14ce13[_0xa1c8('0x30')],'resourceId':_0x14ce13['id'],'type':_0x475590[_0xa1c8('0x30')],'sectionId':_0x475590['id']},{})[_0xa1c8('0x23')](function(){return _0x44580d;});}else{return _0x44580d;}})[_0xa1c8('0x43')](function(_0xf13fa3){logger[_0xa1c8('0x27')](_0xa1c8('0x51'),_0xf13fa3);throw _0xf13fa3;});}return _0x44580d;})[_0xa1c8('0x23')](respondWithResult(_0xf29fc,0xc9))['catch'](handleError(_0xf29fc,null));};exports[_0xa1c8('0x52')]=function(_0x1a117a,_0x3fb365){var _0x3d35b4={'where':{'id':_0x1a117a[_0xa1c8('0x45')]['id']}},_0x56a38d={};_0x56a38d[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db['Campaign'][_0xa1c8('0x2b')]);_0x3d35b4[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x56a38d[_0xa1c8('0x2f')],qs['fields'](_0x1a117a['query'][_0xa1c8('0x35')]));_0x3d35b4['attributes']=_0x3d35b4[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x3d35b4[_0xa1c8('0x33')]:_0x56a38d[_0xa1c8('0x2f')];if(_0x1a117a[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x3d35b4['include']=[{'all':!![]}];}_0x3d35b4=_[_0xa1c8('0x3c')]({},_0x3d35b4,_0x1a117a['options']);return db[_0xa1c8('0x40')]['find'](_0x3d35b4)[_0xa1c8('0x23')](handleEntityNotFound(_0x3fb365,null))[_0xa1c8('0x23')](function(_0x437ca8){if(_0x437ca8){var _0x1ccdd9=_0x437ca8['get']({'plain':!![]});_0x1ccdd9=qs[_0xa1c8('0x53')](_0x1ccdd9,['id',_0xa1c8('0x54'),_0xa1c8('0x55')]);_0x1a117a[_0xa1c8('0x4a')]=_[_0xa1c8('0x53')](_0x1a117a['body'],['id','createdAt',_0xa1c8('0x55')]);return db[_0xa1c8('0x40')]['create'](_[_0xa1c8('0x3c')](_0x1ccdd9,_0x1a117a['body']),{'include':_0x1a117a['query']['includeAll']?[{'all':!![]}]:undefined})[_0xa1c8('0x23')](function(_0x4df225){var _0x529182=_0x1a117a[_0xa1c8('0x4d')]['get']({'plain':!![]});if(!_0x529182)throw new Error(_0xa1c8('0x4b'));if(_0x529182['role']==='user'){var _0x419bbe=_0x4df225[_0xa1c8('0x25')]({'plain':!![]});var _0x2722a7='IvrCampaigns';return db[_0xa1c8('0x4e')][_0xa1c8('0x48')]({'where':{'name':_0x2722a7,'userProfileId':_0x529182[_0xa1c8('0x56')]},'raw':!![]})['then'](function(_0x458579){if(_0x458579&&_0x458579[_0xa1c8('0x4f')]===0x0){return db['UserProfileResource'][_0xa1c8('0x49')]({'name':_0x419bbe[_0xa1c8('0x30')],'resourceId':_0x419bbe['id'],'type':_0x458579[_0xa1c8('0x30')],'sectionId':_0x458579['id']},{})['then'](function(){return _0x4df225;});}else{return _0x4df225;}})[_0xa1c8('0x43')](function(_0x98355b){logger['error'](_0xa1c8('0x51'),_0x98355b);throw _0x98355b;});}return _0x4df225;});}})['then'](respondWithResult(_0x3fb365,0xc9))[_0xa1c8('0x43')](handleError(_0x3fb365,null));};exports['update']=function(_0x125cfb,_0x2938ed){if(_0x125cfb[_0xa1c8('0x4a')]['id']){delete _0x125cfb[_0xa1c8('0x4a')]['id'];}return db[_0xa1c8('0x40')][_0xa1c8('0x48')]({'where':{'id':_0x125cfb[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x2938ed,null))['then'](saveUpdates(_0x125cfb[_0xa1c8('0x4a')],null))[_0xa1c8('0x23')](respondWithResult(_0x2938ed,null))[_0xa1c8('0x43')](handleError(_0x2938ed,null));};exports[_0xa1c8('0x24')]=function(_0xbe6d30,_0x809ee3){return db[_0xa1c8('0x40')][_0xa1c8('0x48')]({'where':{'id':_0xbe6d30[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x809ee3,null))[_0xa1c8('0x23')](removeEntity(_0x809ee3,null))[_0xa1c8('0x43')](handleError(_0x809ee3,null));};exports[_0xa1c8('0x57')]=function(_0x42e30c,_0x2c62b2,_0x15321d){var _0x3dee79={'raw':!![],'where':{}};var _0x1630bc={};var _0x376f19={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x42e30c[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x2c62b2,null))[_0xa1c8('0x23')](function(_0x7bce81){if(_0x7bce81){_0x1630bc['model']=_[_0xa1c8('0x32')](db[_0xa1c8('0x59')][_0xa1c8('0x2b')]);_0x1630bc[_0xa1c8('0x31')]=_['keys'](_0x42e30c[_0xa1c8('0x31')]);_0x1630bc['filters']=_[_0xa1c8('0x34')](_0x1630bc[_0xa1c8('0x2f')],_0x1630bc[_0xa1c8('0x31')]);_0x3dee79[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x1630bc[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x42e30c[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x3dee79[_0xa1c8('0x33')]=_0x3dee79['attributes'][_0xa1c8('0x46')]?_0x3dee79[_0xa1c8('0x33')]:_0x1630bc[_0xa1c8('0x2f')];if(!_0x42e30c[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x3dee79[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x42e30c[_0xa1c8('0x31')]['limit']);_0x3dee79['offset']=qs[_0xa1c8('0x1a')](_0x42e30c[_0xa1c8('0x31')]['offset']);}_0x3dee79[_0xa1c8('0x38')]=qs['sort'](_0x42e30c['query'][_0xa1c8('0x39')]);_0x3dee79['where']=qs[_0xa1c8('0x3b')](_[_0xa1c8('0x5a')](_0x42e30c['query'],_0x1630bc['filters']));_0x3dee79[_0xa1c8('0x3a')][_0xa1c8('0x5b')]=_0x7bce81['id'];if(_0x42e30c['query']['filter']){_0x3dee79[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x3dee79[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x3dee79[_0xa1c8('0x33')],function(_0xaecf67){var _0x2c0a57={};_0x2c0a57[_0xaecf67]={'$like':'%'+_0x42e30c['query'][_0xa1c8('0x3e')]+'%'};return _0x2c0a57;})});}_0x3dee79=_[_0xa1c8('0x3c')]({},_0x3dee79,_0x42e30c[_0xa1c8('0x3f')]);return db[_0xa1c8('0x59')][_0xa1c8('0x1c')]({'where':_0x3dee79[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x15c664){_0x376f19[_0xa1c8('0x1c')]=_0x15c664;if(_0x42e30c[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x3dee79['include']=[{'all':!![]}];}return db['CmHopper'][_0xa1c8('0x42')](_0x3dee79);})[_0xa1c8('0x23')](function(_0x557dc3){_0x376f19[_0xa1c8('0x5c')]=_0x557dc3;return _0x376f19;});}})['then'](respondWithFilteredResult(_0x2c62b2,_0x3dee79))[_0xa1c8('0x43')](handleError(_0x2c62b2,null));};exports[_0xa1c8('0x5d')]=function(_0x54f3b9,_0x31c23f,_0x9397e7){var _0x467372={'raw':!![],'where':{}};var _0x36d508={};var _0x3bb064={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x54f3b9['params']['id']}})['then'](handleEntityNotFound(_0x31c23f,null))[_0xa1c8('0x23')](function(_0x4b829f){if(_0x4b829f){_0x36d508[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db[_0xa1c8('0x5e')][_0xa1c8('0x2b')]);_0x36d508['query']=_['keys'](_0x54f3b9['query']);_0x36d508[_0xa1c8('0x3b')]=_[_0xa1c8('0x34')](_0x36d508[_0xa1c8('0x2f')],_0x36d508[_0xa1c8('0x31')]);_0x467372[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x36d508['model'],qs[_0xa1c8('0x35')](_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x467372[_0xa1c8('0x33')]=_0x467372['attributes']['length']?_0x467372[_0xa1c8('0x33')]:_0x36d508[_0xa1c8('0x2f')];if(!_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x467372[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x467372[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0x467372[_0xa1c8('0x38')]=qs[_0xa1c8('0x39')](_0x54f3b9[_0xa1c8('0x31')]['sort']);_0x467372['where']=qs['filters'](_[_0xa1c8('0x5a')](_0x54f3b9[_0xa1c8('0x31')],_0x36d508[_0xa1c8('0x3b')]));_0x467372['where'][_0xa1c8('0x5b')]=_0x4b829f['id'];if(_0x54f3b9[_0xa1c8('0x31')][_0xa1c8('0x3e')]){_0x467372[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x467372['where'],{'$or':_[_0xa1c8('0x2a')](_0x467372[_0xa1c8('0x33')],function(_0x3d71fc){var _0x17ebe8={};_0x17ebe8[_0x3d71fc]={'$like':'%'+_0x54f3b9[_0xa1c8('0x31')]['filter']+'%'};return _0x17ebe8;})});}_0x467372=_[_0xa1c8('0x3c')]({},_0x467372,_0x54f3b9[_0xa1c8('0x3f')]);return db[_0xa1c8('0x5e')]['count']({'where':_0x467372[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x4797b3){_0x3bb064[_0xa1c8('0x1c')]=_0x4797b3;if(_0x54f3b9[_0xa1c8('0x31')]['includeAll']){_0x467372[_0xa1c8('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa1c8('0x42')](_0x467372);})['then'](function(_0x1e1128){_0x3bb064[_0xa1c8('0x5c')]=_0x1e1128;return _0x3bb064;});}})[_0xa1c8('0x23')](respondWithFilteredResult(_0x31c23f,_0x467372))[_0xa1c8('0x43')](handleError(_0x31c23f,null));};exports[_0xa1c8('0x5f')]=function(_0x5ee23c,_0x514d1f,_0x432c54){var _0x1eb4ac={'raw':!![],'where':{}};var _0x30c9e9={};var _0x369590={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x5ee23c[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x514d1f,null))[_0xa1c8('0x23')](function(_0x5709cb){if(_0x5709cb){_0x30c9e9[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db['CmHopperFinal'][_0xa1c8('0x2b')]);_0x30c9e9[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x5ee23c[_0xa1c8('0x31')]);_0x30c9e9[_0xa1c8('0x3b')]=_[_0xa1c8('0x34')](_0x30c9e9['model'],_0x30c9e9[_0xa1c8('0x31')]);_0x1eb4ac[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x30c9e9[_0xa1c8('0x2f')],qs['fields'](_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x1eb4ac['attributes']=_0x1eb4ac[_0xa1c8('0x33')]['length']?_0x1eb4ac[_0xa1c8('0x33')]:_0x30c9e9['model'];if(!_0x5ee23c['query'][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x1eb4ac['limit']=qs[_0xa1c8('0x1d')](_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x1eb4ac[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0x1eb4ac[_0xa1c8('0x38')]=qs['sort'](_0x5ee23c[_0xa1c8('0x31')]['sort']);_0x1eb4ac['where']=qs[_0xa1c8('0x3b')](_[_0xa1c8('0x5a')](_0x5ee23c[_0xa1c8('0x31')],_0x30c9e9[_0xa1c8('0x3b')]));_0x1eb4ac[_0xa1c8('0x3a')][_0xa1c8('0x5b')]=_0x5709cb['id'];if(_0x5ee23c[_0xa1c8('0x31')]['filter']){_0x1eb4ac[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x1eb4ac[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x1eb4ac['attributes'],function(_0x50a1b6){var _0x470ef9={};_0x470ef9[_0x50a1b6]={'$like':'%'+_0x5ee23c[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x470ef9;})});}_0x1eb4ac=_[_0xa1c8('0x3c')]({},_0x1eb4ac,_0x5ee23c['options']);return db[_0xa1c8('0x60')][_0xa1c8('0x1c')]({'where':_0x1eb4ac[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x5dee1e){_0x369590[_0xa1c8('0x1c')]=_0x5dee1e;if(_0x5ee23c[_0xa1c8('0x31')]['includeAll']){_0x1eb4ac[_0xa1c8('0x41')]=[{'all':!![]}];}return db[_0xa1c8('0x60')]['findAll'](_0x1eb4ac);})['then'](function(_0x51e6da){_0x369590[_0xa1c8('0x5c')]=_0x51e6da;return _0x369590;});}})[_0xa1c8('0x23')](respondWithFilteredResult(_0x514d1f,_0x1eb4ac))['catch'](handleError(_0x514d1f,null));};exports[_0xa1c8('0x61')]=function(_0x179894,_0x24d2e6,_0xa08588){var _0x5819e0={'raw':!![],'where':{}};var _0x517145={};var _0x4c1297={'count':0x0,'rows':[]};return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x179894[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x24d2e6,null))[_0xa1c8('0x23')](function(_0x5ecd81){if(_0x5ecd81){_0x517145[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db['CmHopperBlack']['rawAttributes']);_0x517145[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x179894[_0xa1c8('0x31')]);_0x517145[_0xa1c8('0x3b')]=_[_0xa1c8('0x34')](_0x517145[_0xa1c8('0x2f')],_0x517145[_0xa1c8('0x31')]);_0x5819e0[_0xa1c8('0x33')]=_['intersection'](_0x517145[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x179894[_0xa1c8('0x31')]['fields']));_0x5819e0[_0xa1c8('0x33')]=_0x5819e0[_0xa1c8('0x33')]['length']?_0x5819e0[_0xa1c8('0x33')]:_0x517145[_0xa1c8('0x2f')];if(!_0x179894[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x5819e0['limit']=qs[_0xa1c8('0x1d')](_0x179894[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x5819e0[_0xa1c8('0x1a')]=qs['offset'](_0x179894[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}_0x5819e0[_0xa1c8('0x38')]=qs['sort'](_0x179894[_0xa1c8('0x31')]['sort']);_0x5819e0['where']=qs[_0xa1c8('0x3b')](_['pick'](_0x179894[_0xa1c8('0x31')],_0x517145[_0xa1c8('0x3b')]));_0x5819e0['where'][_0xa1c8('0x5b')]=_0x5ecd81['id'];if(_0x179894[_0xa1c8('0x31')][_0xa1c8('0x3e')]){_0x5819e0[_0xa1c8('0x3a')]=_['merge'](_0x5819e0[_0xa1c8('0x3a')],{'$or':_['map'](_0x5819e0[_0xa1c8('0x33')],function(_0x43144d){var _0x384094={};_0x384094[_0x43144d]={'$like':'%'+_0x179894[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x384094;})});}_0x5819e0=_['merge']({},_0x5819e0,_0x179894[_0xa1c8('0x3f')]);return db[_0xa1c8('0x62')]['count']({'where':_0x5819e0[_0xa1c8('0x3a')]})[_0xa1c8('0x23')](function(_0x691df5){_0x4c1297[_0xa1c8('0x1c')]=_0x691df5;if(_0x179894[_0xa1c8('0x31')][_0xa1c8('0x47')]){_0x5819e0['include']=[{'all':!![]}];}return db[_0xa1c8('0x62')]['findAll'](_0x5819e0);})[_0xa1c8('0x23')](function(_0x4fc625){_0x4c1297['rows']=_0x4fc625;return _0x4c1297;});}})[_0xa1c8('0x23')](respondWithFilteredResult(_0x24d2e6,_0x5819e0))['catch'](handleError(_0x24d2e6,null));};exports[_0xa1c8('0x63')]=function(_0x263bb9,_0x1c5286,_0x502b29){var _0x241af7={};var _0x5e52cd={};var _0x58e7fb;var _0x500ba9;return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x263bb9['params']['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x1c5286,null))[_0xa1c8('0x23')](function(_0x8b3dc6){if(_0x8b3dc6){_0x58e7fb=_0x8b3dc6;_0x5e52cd['model']=_[_0xa1c8('0x32')](db[_0xa1c8('0x64')][_0xa1c8('0x2b')]);_0x5e52cd[_0xa1c8('0x31')]=_[_0xa1c8('0x32')](_0x263bb9[_0xa1c8('0x31')]);_0x5e52cd[_0xa1c8('0x3b')]=_['intersection'](_0x5e52cd[_0xa1c8('0x2f')],_0x5e52cd[_0xa1c8('0x31')]);_0x241af7[_0xa1c8('0x33')]=_['intersection'](_0x5e52cd[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x35')]));_0x241af7[_0xa1c8('0x33')]=_0x241af7[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x241af7['attributes']:_0x5e52cd[_0xa1c8('0x2f')];_0x241af7[_0xa1c8('0x38')]=qs['sort'](_0x263bb9['query'][_0xa1c8('0x39')]);_0x241af7[_0xa1c8('0x3a')]=qs[_0xa1c8('0x3b')](_[_0xa1c8('0x5a')](_0x263bb9[_0xa1c8('0x31')],_0x5e52cd['filters']));if(_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x3e')]){_0x241af7[_0xa1c8('0x3a')]=_['merge'](_0x241af7['where'],{'$or':_[_0xa1c8('0x2a')](_0x241af7[_0xa1c8('0x33')],function(_0x40cbdb){var _0x39a2e5={};_0x39a2e5[_0x40cbdb]={'$like':'%'+_0x263bb9['query'][_0xa1c8('0x3e')]+'%'};return _0x39a2e5;})});}_0x241af7=_[_0xa1c8('0x3c')]({},_0x241af7,_0x263bb9['options']);return _0x58e7fb[_0xa1c8('0x63')](_0x241af7);}})['then'](function(_0x1b09a5){if(_0x1b09a5){_0x500ba9=_0x1b09a5[_0xa1c8('0x46')];if(!_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x36')](_0xa1c8('0x37'))){_0x241af7[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x241af7[_0xa1c8('0x1a')]=qs[_0xa1c8('0x1a')](_0x263bb9[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}return _0x58e7fb['getLists'](_0x241af7);}})[_0xa1c8('0x23')](function(_0x4f5a4e){if(_0x4f5a4e){return _0x4f5a4e?{'count':_0x500ba9,'rows':_0x4f5a4e}:null;}})[_0xa1c8('0x23')](respondWithResult(_0x1c5286,null))['catch'](handleError(_0x1c5286,null));};exports[_0xa1c8('0x65')]=function(_0x4f3382,_0x1b19ce,_0x3df5ee){var _0x5f3dd8,_0x253b86;var _0x5cd3c8=[];var _0x456956=moment()[_0xa1c8('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0xa1c8('0x48')]({'where':{'id':_0x4f3382[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x1b19ce,null))['then'](function(_0x26e7df){if(_0x26e7df){_0x253b86=_0x26e7df;return _0x26e7df['addLists'](_0x4f3382[_0xa1c8('0x4a')][_0xa1c8('0x67')],_[_0xa1c8('0x53')](_0x4f3382[_0xa1c8('0x4a')],[_0xa1c8('0x67'),'id'])||{});}return null;})['spread'](function(_0x52200a){var _0x18b6fd;var _0x615b5b;_0x5f3dd8=_0x52200a||[];var _0x3a19af=[];if(_0x52200a){for(var _0x3c8715=0x0;_0x3c8715<_0x52200a[_0xa1c8('0x46')];_0x3c8715+=0x1){var _0x135214=_0x52200a[_0x3c8715]['get']({'plain':!![]});_0x253b86['dialCheckDuplicateType']=_0x4f3382[_0xa1c8('0x4a')][_0xa1c8('0x68')]?_0x4f3382[_0xa1c8('0x4a')][_0xa1c8('0x68')]:_0x253b86[_0xa1c8('0x68')];switch(_0x253b86[_0xa1c8('0x68')]){case _0xa1c8('0x69'):_0x18b6fd=squel[_0xa1c8('0x6a')]()[_0xa1c8('0x6b')](_0xa1c8('0x6c'))['fromQuery']([_0xa1c8('0x6d'),'scheduledAt','ContactId',_0xa1c8('0x6e'),_0xa1c8('0x5b'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel['select']()[_0xa1c8('0x6f')](_0xa1c8('0x6d'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')]('NOW()',_0xa1c8('0x70'))['field']('id','ContactId')[_0xa1c8('0x6f')](_0x135214['CmListId'][_0xa1c8('0x71')](),_0xa1c8('0x6e'))[_0xa1c8('0x6f')](_0x4f3382['params']['id'][_0xa1c8('0x71')](),_0xa1c8('0x5b'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x54'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x55'))[_0xa1c8('0x72')](_0xa1c8('0x73'))[_0xa1c8('0x3a')](_0xa1c8('0x74'))[_0xa1c8('0x3a')](_0xa1c8('0x75'),_0x135214['CmListId']['toString']())['where'](_0xa1c8('0x76'))[_0xa1c8('0x3a')](_0xa1c8('0x77'),squel['select']()['field'](_0xa1c8('0x78'))[_0xa1c8('0x72')]('cm_hopper_final')[_0xa1c8('0x3a')]('CampaignId\x20=\x20?',_0x4f3382['params']['id'][_0xa1c8('0x71')]()))[_0xa1c8('0x3a')](_0xa1c8('0x77'),squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x7a'))[_0xa1c8('0x72')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x4f3382['params']['id']['toString']())))[_0xa1c8('0x71')]();break;case _0xa1c8('0x7b'):_0x18b6fd=squel[_0xa1c8('0x6a')]()[_0xa1c8('0x6b')](_0xa1c8('0x6c'))[_0xa1c8('0x7c')]([_0xa1c8('0x6d'),_0xa1c8('0x70'),_0xa1c8('0x7d'),'ListId','CampaignId',_0xa1c8('0x54'),_0xa1c8('0x55')],squel['select']()[_0xa1c8('0x6f')](_0xa1c8('0x6d'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')](_0xa1c8('0x7e'),'scheduledAt')[_0xa1c8('0x6f')]('id','ContactId')['field'](_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')](),_0xa1c8('0x6e'))[_0xa1c8('0x6f')](_0x4f3382['params']['id']['toString'](),_0xa1c8('0x5b'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x54'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x55'))[_0xa1c8('0x72')](_0xa1c8('0x73'))['where'](_0xa1c8('0x74'))[_0xa1c8('0x3a')]('ListId\x20=\x20?',_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')]())['where'](_0xa1c8('0x76'))['where'](_0xa1c8('0x77'),squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x7a'))[_0xa1c8('0x72')]('cm_hopper')[_0xa1c8('0x3a')]('CampaignId\x20=\x20?',_0x4f3382[_0xa1c8('0x45')]['id']['toString']())))[_0xa1c8('0x71')]();break;default:_0x18b6fd=squel['insert']()['into']('cm_hopper')[_0xa1c8('0x7c')](['phone',_0xa1c8('0x70'),_0xa1c8('0x7d'),'ListId',_0xa1c8('0x5b'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel['select']()['field']('phone','phone')[_0xa1c8('0x6f')](_0xa1c8('0x7e'),_0xa1c8('0x70'))[_0xa1c8('0x6f')]('id',_0xa1c8('0x7d'))[_0xa1c8('0x6f')](_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')](),_0xa1c8('0x6e'))[_0xa1c8('0x6f')](_0x4f3382[_0xa1c8('0x45')]['id'][_0xa1c8('0x71')](),_0xa1c8('0x5b'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27','createdAt')[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27','updatedAt')['from']('cm_contacts')[_0xa1c8('0x3a')](_0xa1c8('0x74'))['where'](_0xa1c8('0x75'),_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')]())[_0xa1c8('0x3a')](_0xa1c8('0x76')))['toString']();}_0x615b5b=squel['insert']()[_0xa1c8('0x6b')](_0xa1c8('0x80'))[_0xa1c8('0x7c')]([_0xa1c8('0x81'),_0xa1c8('0x70'),'phone',_0xa1c8('0x82'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x83'),'id')[_0xa1c8('0x6f')](_0xa1c8('0x7e'),'scheduledAt')['field'](_0xa1c8('0x84'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')](_0xa1c8('0x85'),'OrderBy')[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x54'))[_0xa1c8('0x6f')]('\x27'+_0x456956+'\x27',_0xa1c8('0x55'))['from']('cm_contact_has_items','ci')['join'](_0xa1c8('0x6c'),'h',_0xa1c8('0x86'))['where']('h.ListId\x20=\x20?',_0x135214[_0xa1c8('0x7f')][_0xa1c8('0x71')]())[_0xa1c8('0x3a')]('h.CampaignId=?',_0x4f3382[_0xa1c8('0x45')]['id'][_0xa1c8('0x71')]())[_0xa1c8('0x3a')](_0xa1c8('0x87'),_0x456956))[_0xa1c8('0x71')]();_0x3a19af['push'](db[_0xa1c8('0x88')][_0xa1c8('0x31')](_0x18b6fd));_0x5cd3c8[_0xa1c8('0x89')](db[_0xa1c8('0x88')]['query'](_0x615b5b));}return BPromise[_0xa1c8('0x8a')](_0x3a19af);}})[_0xa1c8('0x23')](function(){return BPromise[_0xa1c8('0x8a')](_0x5cd3c8);})['then'](function(){return _0x5f3dd8;})[_0xa1c8('0x23')](respondWithResult(_0x1b19ce,null))[_0xa1c8('0x43')](handleError(_0x1b19ce,null));};exports['removeLists']=function(_0x19f9b1,_0x3375da,_0x52468d){return db[_0xa1c8('0x40')][_0xa1c8('0x48')]({'where':{'id':_0x19f9b1[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x3375da,null))[_0xa1c8('0x23')](function(_0x1292e7){if(_0x1292e7){return _0x1292e7[_0xa1c8('0x8b')](_0x19f9b1['query']['ids']);}})[_0xa1c8('0x23')](function(_0x1f2ff3){if(_0x1f2ff3){return db[_0xa1c8('0x59')][_0xa1c8('0x24')]({'where':{'ListId':_0x19f9b1[_0xa1c8('0x31')][_0xa1c8('0x67')],'CampaignId':_0x19f9b1['params']['id']}})[_0xa1c8('0x23')](function(){return _0x1f2ff3;});}})[_0xa1c8('0x23')](respondWithStatusCode(_0x3375da,null))[_0xa1c8('0x43')](handleError(_0x3375da,null));};exports[_0xa1c8('0x8c')]=function(_0x4e188b,_0x39bd90,_0x51c8ac){var _0x522608={};var _0x399ddc={};var _0x147fce;var _0x1909bb;return db[_0xa1c8('0x40')][_0xa1c8('0x58')]({'where':{'id':_0x4e188b[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x39bd90,null))[_0xa1c8('0x23')](function(_0x1f60e3){if(_0x1f60e3){_0x147fce=_0x1f60e3;_0x399ddc[_0xa1c8('0x2f')]=_[_0xa1c8('0x32')](db[_0xa1c8('0x64')][_0xa1c8('0x2b')]);_0x399ddc['query']=_[_0xa1c8('0x32')](_0x4e188b[_0xa1c8('0x31')]);_0x399ddc['filters']=_['intersection'](_0x399ddc[_0xa1c8('0x2f')],_0x399ddc[_0xa1c8('0x31')]);_0x522608[_0xa1c8('0x33')]=_[_0xa1c8('0x34')](_0x399ddc[_0xa1c8('0x2f')],qs[_0xa1c8('0x35')](_0x4e188b[_0xa1c8('0x31')]['fields']));_0x522608['attributes']=_0x522608[_0xa1c8('0x33')][_0xa1c8('0x46')]?_0x522608[_0xa1c8('0x33')]:_0x399ddc[_0xa1c8('0x2f')];_0x522608['order']=qs[_0xa1c8('0x39')](_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x39')]);_0x522608['where']=qs['filters'](_[_0xa1c8('0x5a')](_0x4e188b[_0xa1c8('0x31')],_0x399ddc[_0xa1c8('0x3b')]));if(_0x4e188b['query'][_0xa1c8('0x3e')]){_0x522608[_0xa1c8('0x3a')]=_[_0xa1c8('0x3c')](_0x522608[_0xa1c8('0x3a')],{'$or':_[_0xa1c8('0x2a')](_0x522608[_0xa1c8('0x33')],function(_0x1ec82f){var _0x1e63a6={};_0x1e63a6[_0x1ec82f]={'$like':'%'+_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x3e')]+'%'};return _0x1e63a6;})});}_0x522608=_[_0xa1c8('0x3c')]({},_0x522608,_0x4e188b[_0xa1c8('0x3f')]);return _0x147fce[_0xa1c8('0x8c')](_0x522608);}})['then'](function(_0x498a84){if(_0x498a84){_0x1909bb=_0x498a84['length'];if(!_0x4e188b[_0xa1c8('0x31')]['hasOwnProperty'](_0xa1c8('0x37'))){_0x522608[_0xa1c8('0x1d')]=qs[_0xa1c8('0x1d')](_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x1d')]);_0x522608[_0xa1c8('0x1a')]=qs['offset'](_0x4e188b[_0xa1c8('0x31')][_0xa1c8('0x1a')]);}return _0x147fce[_0xa1c8('0x8c')](_0x522608);}})['then'](function(_0x595f0a){if(_0x595f0a){return _0x595f0a?{'count':_0x1909bb,'rows':_0x595f0a}:null;}})[_0xa1c8('0x23')](respondWithResult(_0x39bd90,null))[_0xa1c8('0x43')](handleError(_0x39bd90,null));};exports[_0xa1c8('0x8d')]=function(_0x196c41,_0xca5f56,_0x3f495d){var _0x591183,_0x5b7e15;var _0x58ad36=[];var _0xab9b23=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0xa1c8('0x48')]({'where':{'id':_0x196c41[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0xca5f56,null))[_0xa1c8('0x23')](function(_0x10bec3){if(_0x10bec3){_0x5b7e15=_0x10bec3;return _0x10bec3['addBlackLists'](_0x196c41[_0xa1c8('0x4a')][_0xa1c8('0x67')],_[_0xa1c8('0x53')](_0x196c41[_0xa1c8('0x4a')],[_0xa1c8('0x67'),'id'])||{});}return null;})[_0xa1c8('0x8e')](function(_0x420b49){var _0x1cc0ef;var _0x15c987;_0x591183=_0x420b49||[];var _0x32ab13=[];if(_0x420b49){for(var _0xc891a1=0x0;_0xc891a1<_0x420b49[_0xa1c8('0x46')];_0xc891a1+=0x1){var _0x57ca6f=_0x420b49[_0xc891a1][_0xa1c8('0x25')]({'plain':!![]});_0x1cc0ef=squel['insert']()[_0xa1c8('0x6b')](_0xa1c8('0x8f'))[_0xa1c8('0x7c')](['phone','ContactId','ListId',_0xa1c8('0x5b'),_0xa1c8('0x54'),_0xa1c8('0x55')],squel[_0xa1c8('0x79')]()[_0xa1c8('0x6f')](_0xa1c8('0x6d'),_0xa1c8('0x6d'))[_0xa1c8('0x6f')]('id',_0xa1c8('0x7d'))[_0xa1c8('0x6f')](_0x57ca6f[_0xa1c8('0x7f')]['toString'](),_0xa1c8('0x6e'))['field'](_0x196c41[_0xa1c8('0x45')]['id'][_0xa1c8('0x71')](),_0xa1c8('0x5b'))['field'](_0xa1c8('0x7e'),_0xa1c8('0x54'))['field']('NOW()',_0xa1c8('0x55'))[_0xa1c8('0x72')](_0xa1c8('0x73'))[_0xa1c8('0x3a')](_0xa1c8('0x74'))[_0xa1c8('0x3a')]('ListId\x20=\x20?',_0x57ca6f[_0xa1c8('0x7f')][_0xa1c8('0x71')]())['where'](_0xa1c8('0x76')))['toString']();_0x32ab13[_0xa1c8('0x89')](db[_0xa1c8('0x88')][_0xa1c8('0x31')](_0x1cc0ef));}return BPromise['all'](_0x32ab13);}})[_0xa1c8('0x23')](function(){return _0x591183;})[_0xa1c8('0x23')](respondWithResult(_0xca5f56,null))['catch'](handleError(_0xca5f56,null));};exports[_0xa1c8('0x90')]=function(_0x28ad90,_0x42eb01,_0x276439){return db['Campaign'][_0xa1c8('0x48')]({'where':{'id':_0x28ad90[_0xa1c8('0x45')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x42eb01,null))[_0xa1c8('0x23')](function(_0x432ccd){if(_0x432ccd){return _0x432ccd[_0xa1c8('0x90')](_0x28ad90['query'][_0xa1c8('0x67')]);}})['then'](function(_0x4f1eb7){if(_0x4f1eb7){return db[_0xa1c8('0x62')][_0xa1c8('0x24')]({'where':{'ListId':_0x28ad90[_0xa1c8('0x31')][_0xa1c8('0x67')],'CampaignId':_0x28ad90[_0xa1c8('0x45')]['id']}})['then'](function(){return _0x4f1eb7;});}})['then'](respondWithStatusCode(_0x42eb01,null))[_0xa1c8('0x43')](handleError(_0x42eb01,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7a14db0..e4e3a97 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3ef4ce,_0x5b4e3e){var _0x414d9d=function(_0x28e388){while(--_0x28e388){_0x3ef4ce['push'](_0x3ef4ce['shift']());}};_0x414d9d(++_0x5b4e3e);}(_0x7a54,0x106));var _0x47a5=function(_0x54b5c6,_0x53fd66){_0x54b5c6=_0x54b5c6-0x0;var _0x428829=_0x7a54[_0x54b5c6];return _0x428829;};'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 6b33369..1b03fbd 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 _0xfc03=['limit','include','map','model','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes'];(function(_0x3d95c1,_0x264b94){var _0x25147f=function(_0x24e562){while(--_0x24e562){_0x3d95c1['push'](_0x3d95c1['shift']());}};_0x25147f(++_0x264b94);}(_0xfc03,0x16f));var _0x3fc0=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfc03[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x3fc0('0x0'));var util=require('util');var moment=require(_0x3fc0('0x1'));var BPromise=require(_0x3fc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fc0('0x4'));var logger=require(_0x3fc0('0x5'))(_0x3fc0('0x6'));var config=require(_0x3fc0('0x7'));var jayson=require(_0x3fc0('0x8'));var client=jayson[_0x3fc0('0x9')][_0x3fc0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeeb912,_0x55eac5,_0x2fb1a6){return new BPromise(function(_0x5f52b5,_0x1369ac){return client[_0x3fc0('0xb')](_0xeeb912,_0x2fb1a6)[_0x3fc0('0xc')](function(_0x392999){logger['info'](_0x3fc0('0xd'),_0x55eac5,_0x3fc0('0xe'));logger[_0x3fc0('0xf')](_0x3fc0('0x10'),_0x55eac5,_0x3fc0('0xe'),JSON['stringify'](_0x392999));if(_0x392999[_0x3fc0('0x11')]){if(_0x392999[_0x3fc0('0x11')][_0x3fc0('0x12')]===0x1f4){logger['error'](_0x3fc0('0xd'),_0x55eac5,_0x392999['error'][_0x3fc0('0x13')]);return _0x1369ac(_0x392999[_0x3fc0('0x11')]['message']);}logger[_0x3fc0('0x11')](_0x3fc0('0xd'),_0x55eac5,_0x392999[_0x3fc0('0x11')]['message']);return _0x5f52b5(_0x392999[_0x3fc0('0x11')][_0x3fc0('0x13')]);}else{logger[_0x3fc0('0x14')](_0x3fc0('0xd'),_0x55eac5,'request\x20sent');_0x5f52b5(_0x392999[_0x3fc0('0x15')][_0x3fc0('0x13')]);}})[_0x3fc0('0x16')](function(_0x5b59f1){logger[_0x3fc0('0x11')]('Campaign,\x20%s,\x20%s',_0x55eac5,_0x5b59f1);_0x1369ac(_0x5b59f1);});});}exports[_0x3fc0('0x17')]=function(_0x3c5026){var _0x4b947c=this;return new Promise(function(_0x3bb388,_0x33ffbc){return db[_0x3fc0('0x18')][_0x3fc0('0x19')]({'raw':_0x3c5026[_0x3fc0('0x1a')]?_0x3c5026[_0x3fc0('0x1a')][_0x3fc0('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c5026[_0x3fc0('0x1a')]?_0x3c5026[_0x3fc0('0x1a')]['where']||null:null,'attributes':_0x3c5026[_0x3fc0('0x1a')]?_0x3c5026[_0x3fc0('0x1a')][_0x3fc0('0x1c')]||null:null,'limit':_0x3c5026[_0x3fc0('0x1a')]?_0x3c5026[_0x3fc0('0x1a')][_0x3fc0('0x1d')]||null:null,'include':_0x3c5026['options']?_0x3c5026[_0x3fc0('0x1a')][_0x3fc0('0x1e')]?_[_0x3fc0('0x1f')](_0x3c5026[_0x3fc0('0x1a')][_0x3fc0('0x1e')],function(_0x303dd2){return{'model':db[_0x303dd2[_0x3fc0('0x20')]],'as':_0x303dd2['as'],'attributes':_0x303dd2[_0x3fc0('0x1c')],'include':_0x303dd2[_0x3fc0('0x1e')]?_[_0x3fc0('0x1f')](_0x303dd2[_0x3fc0('0x1e')],function(_0x1abe10){return{'model':db[_0x1abe10[_0x3fc0('0x20')]],'as':_0x1abe10['as'],'attributes':_0x1abe10[_0x3fc0('0x1c')],'include':_0x1abe10[_0x3fc0('0x1e')]?_[_0x3fc0('0x1f')](_0x1abe10['include'],function(_0x365c8e){return{'model':db[_0x365c8e[_0x3fc0('0x20')]],'as':_0x365c8e['as'],'attributes':_0x365c8e[_0x3fc0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3fc0('0xc')](function(_0x5a9179){logger[_0x3fc0('0x14')](_0x3fc0('0x17'),_0x3c5026);logger[_0x3fc0('0xf')](_0x3fc0('0x17'),_0x3c5026,JSON['stringify'](_0x5a9179));_0x3bb388(_0x5a9179);})[_0x3fc0('0x16')](function(_0x1a2261){logger[_0x3fc0('0x11')](_0x3fc0('0x17'),_0x1a2261[_0x3fc0('0x13')],_0x3c5026);_0x33ffbc(_0x4b947c[_0x3fc0('0x11')](0x1f4,_0x1a2261['message']));});});};
\ No newline at end of file
+var _0xbc17=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','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','attributes','limit','include','map','model','then','debug','lodash','util'];(function(_0x5acaba,_0x383a16){var _0x1bf657=function(_0x390901){while(--_0x390901){_0x5acaba['push'](_0x5acaba['shift']());}};_0x1bf657(++_0x383a16);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x354b70,_0x2ee366){_0x354b70=_0x354b70-0x0;var _0x56a7e8=_0xbc17[_0x354b70];return _0x56a7e8;};'use strict';var _=require(_0x7bc1('0x0'));var util=require(_0x7bc1('0x1'));var moment=require('moment');var BPromise=require(_0x7bc1('0x2'));var rs=require(_0x7bc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7bc1('0x4'));var logger=require(_0x7bc1('0x5'))('rpc');var config=require(_0x7bc1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7bc1('0x7')][_0x7bc1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b720f,_0x3aed05,_0x3fdce7){return new BPromise(function(_0x351340,_0x3c08dc){return client[_0x7bc1('0x9')](_0x1b720f,_0x3fdce7)['then'](function(_0x48454c){logger[_0x7bc1('0xa')](_0x7bc1('0xb'),_0x3aed05,_0x7bc1('0xc'));logger['debug'](_0x7bc1('0xd'),_0x3aed05,_0x7bc1('0xc'),JSON[_0x7bc1('0xe')](_0x48454c));if(_0x48454c[_0x7bc1('0xf')]){if(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x10')]===0x1f4){logger[_0x7bc1('0xf')](_0x7bc1('0xb'),_0x3aed05,_0x48454c[_0x7bc1('0xf')]['message']);return _0x3c08dc(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x11')]);}logger['error'](_0x7bc1('0xb'),_0x3aed05,_0x48454c[_0x7bc1('0xf')]['message']);return _0x351340(_0x48454c[_0x7bc1('0xf')][_0x7bc1('0x11')]);}else{logger['info'](_0x7bc1('0xb'),_0x3aed05,_0x7bc1('0xc'));_0x351340(_0x48454c[_0x7bc1('0x12')][_0x7bc1('0x11')]);}})[_0x7bc1('0x13')](function(_0x5a5a59){logger[_0x7bc1('0xf')]('Campaign,\x20%s,\x20%s',_0x3aed05,_0x5a5a59);_0x3c08dc(_0x5a5a59);});});}exports[_0x7bc1('0x14')]=function(_0x901465){var _0xdf994=this;return new Promise(function(_0x22e6fd,_0x20ce32){return db[_0x7bc1('0x15')][_0x7bc1('0x16')]({'raw':_0x901465[_0x7bc1('0x17')]?_0x901465['options'][_0x7bc1('0x18')]===undefined?!![]:![]:!![],'where':_0x901465[_0x7bc1('0x17')]?_0x901465[_0x7bc1('0x17')][_0x7bc1('0x19')]||null:null,'attributes':_0x901465[_0x7bc1('0x17')]?_0x901465['options'][_0x7bc1('0x1a')]||null:null,'limit':_0x901465['options']?_0x901465[_0x7bc1('0x17')][_0x7bc1('0x1b')]||null:null,'include':_0x901465[_0x7bc1('0x17')]?_0x901465[_0x7bc1('0x17')][_0x7bc1('0x1c')]?_['map'](_0x901465['options'][_0x7bc1('0x1c')],function(_0x306db7){return{'model':db[_0x306db7['model']],'as':_0x306db7['as'],'attributes':_0x306db7['attributes'],'include':_0x306db7[_0x7bc1('0x1c')]?_[_0x7bc1('0x1d')](_0x306db7['include'],function(_0x1e9b8a){return{'model':db[_0x1e9b8a[_0x7bc1('0x1e')]],'as':_0x1e9b8a['as'],'attributes':_0x1e9b8a[_0x7bc1('0x1a')],'include':_0x1e9b8a[_0x7bc1('0x1c')]?_[_0x7bc1('0x1d')](_0x1e9b8a[_0x7bc1('0x1c')],function(_0x25d3a9){return{'model':db[_0x25d3a9[_0x7bc1('0x1e')]],'as':_0x25d3a9['as'],'attributes':_0x25d3a9[_0x7bc1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7bc1('0x1f')](function(_0x3eb13b){logger[_0x7bc1('0xa')](_0x7bc1('0x14'),_0x901465);logger[_0x7bc1('0x20')]('GetCampaign',_0x901465,JSON[_0x7bc1('0xe')](_0x3eb13b));_0x22e6fd(_0x3eb13b);})[_0x7bc1('0x13')](function(_0x26bf05){logger[_0x7bc1('0xf')](_0x7bc1('0x14'),_0x26bf05[_0x7bc1('0x11')],_0x901465);_0x20ce32(_0xdf994[_0x7bc1('0xf')](0x1f4,_0x26bf05[_0x7bc1('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9505b32..f52a2bb 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 _0x2a23=['removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2a23,0x65));var _0x32a2=function(_0x27aa73,_0x17b3e5){_0x27aa73=_0x27aa73-0x0;var _0x13f650=_0x2a23[_0x27aa73];return _0x13f650;};'use strict';var multer=require(_0x32a2('0x0'));var util=require(_0x32a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x32a2('0x2'));var router=express[_0x32a2('0x3')]();var fs_extra=require(_0x32a2('0x4'));var auth=require(_0x32a2('0x5'));var interaction=require(_0x32a2('0x6'));var config=require(_0x32a2('0x7'));var controller=require(_0x32a2('0x8'));router['get']('/',auth[_0x32a2('0x9')](),controller[_0x32a2('0xa')]);router[_0x32a2('0xb')](_0x32a2('0xc'),auth[_0x32a2('0x9')](),controller[_0x32a2('0xd')]);router[_0x32a2('0xb')]('/:id/hoppers',auth[_0x32a2('0x9')](),controller[_0x32a2('0xe')]);router['get']('/:id/hopper_histories',auth[_0x32a2('0x9')](),controller[_0x32a2('0xf')]);router['get'](_0x32a2('0x10'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x11')]);router[_0x32a2('0xb')]('/:id/hopper_black',auth[_0x32a2('0x9')](),controller[_0x32a2('0x12')]);router[_0x32a2('0xb')](_0x32a2('0x13'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x14')]);router[_0x32a2('0xb')](_0x32a2('0x15'),auth[_0x32a2('0x9')](),controller['getBlackLists']);router[_0x32a2('0x16')]('/',auth[_0x32a2('0x9')](),controller[_0x32a2('0x17')]);router[_0x32a2('0x16')](_0x32a2('0x18'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x19')]);router[_0x32a2('0x16')](_0x32a2('0x13'),auth['isAuthenticated'](),controller[_0x32a2('0x1a')]);router['post']('/:id/blacklists',auth[_0x32a2('0x9')](),controller[_0x32a2('0x1b')]);router[_0x32a2('0x1c')](_0x32a2('0xc'),auth[_0x32a2('0x9')](),controller[_0x32a2('0x1d')]);router[_0x32a2('0x1e')](_0x32a2('0xc'),auth[_0x32a2('0x9')](),controller['destroy']);router[_0x32a2('0x1e')](_0x32a2('0x13'),auth[_0x32a2('0x9')](),controller['removeLists']);router[_0x32a2('0x1e')]('/:id/blacklists',auth[_0x32a2('0x9')](),controller[_0x32a2('0x1f')]);module[_0x32a2('0x20')]=router;
\ No newline at end of file
+var _0x0834=['get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','/:id/blacklists','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./campaign.controller'];(function(_0x54aaf1,_0x21b5ba){var _0x1a9abe=function(_0x1ea09b){while(--_0x1ea09b){_0x54aaf1['push'](_0x54aaf1['shift']());}};_0x1a9abe(++_0x21b5ba);}(_0x0834,0x18e));var _0x4083=function(_0x21d97e,_0x3eb1de){_0x21d97e=_0x21d97e-0x0;var _0x2623eb=_0x0834[_0x21d97e];return _0x2623eb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4083('0x0'));var timeout=require(_0x4083('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4083('0x2'));var interaction=require(_0x4083('0x3'));var config=require('../../config/environment');var controller=require(_0x4083('0x4'));router[_0x4083('0x5')]('/',auth['isAuthenticated'](),controller[_0x4083('0x6')]);router['get'](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0x9')]);router[_0x4083('0x5')](_0x4083('0xa'),auth[_0x4083('0x8')](),controller[_0x4083('0xb')]);router[_0x4083('0x5')](_0x4083('0xc'),auth[_0x4083('0x8')](),controller[_0x4083('0xd')]);router[_0x4083('0x5')](_0x4083('0xe'),auth[_0x4083('0x8')](),controller[_0x4083('0xf')]);router['get']('/:id/hopper_black',auth[_0x4083('0x8')](),controller[_0x4083('0x10')]);router['get'](_0x4083('0x11'),auth[_0x4083('0x8')](),controller[_0x4083('0x12')]);router['get']('/:id/blacklists',auth[_0x4083('0x8')](),controller[_0x4083('0x13')]);router['post']('/',auth[_0x4083('0x8')](),controller[_0x4083('0x14')]);router[_0x4083('0x15')](_0x4083('0x16'),auth[_0x4083('0x8')](),controller['clone']);router[_0x4083('0x15')](_0x4083('0x11'),auth[_0x4083('0x8')](),controller[_0x4083('0x17')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x4083('0x18')]);router[_0x4083('0x19')]('/:id',auth[_0x4083('0x8')](),controller['update']);router[_0x4083('0x1a')](_0x4083('0x7'),auth[_0x4083('0x8')](),controller[_0x4083('0x1b')]);router['delete'](_0x4083('0x11'),auth['isAuthenticated'](),controller[_0x4083('0x1c')]);router[_0x4083('0x1a')](_0x4083('0x1d'),auth[_0x4083('0x8')](),controller['removeBlackLists']);module[_0x4083('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 162ebb3..2541c36 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 _0xc6d7=['STRING','TEXT','medium','getDataValue','key','sequelize','exports'];(function(_0x4303cc,_0x4a75fc){var _0x6d9fd2=function(_0x578ad8){while(--_0x578ad8){_0x4303cc['push'](_0x4303cc['shift']());}};_0x6d9fd2(++_0x4a75fc);}(_0xc6d7,0x163));var _0x7c6d=function(_0x29ced9,_0x449939){_0x29ced9=_0x29ced9-0x0;var _0x407e0a=_0xc6d7[_0x29ced9];return _0x407e0a;};'use strict';var Sequelize=require(_0x7c6d('0x0'));module[_0x7c6d('0x1')]={'key':{'type':Sequelize[_0x7c6d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7c6d('0x3')],'length':_0x7c6d('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x7c6d('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7c6d('0x5')](_0x7c6d('0x6'));}}};
\ No newline at end of file
+var _0xd1a2=['sequelize','exports','STRING','medium','VIRTUAL','getDataValue'];(function(_0x1876c7,_0x379202){var _0x2b9572=function(_0x9bf2ff){while(--_0x9bf2ff){_0x1876c7['push'](_0x1876c7['shift']());}};_0x2b9572(++_0x379202);}(_0xd1a2,0x12c));var _0x2d1a=function(_0x1f7290,_0x3d4325){_0x1f7290=_0x1f7290-0x0;var _0x129d16=_0xd1a2[_0x1f7290];return _0x129d16;};'use strict';var Sequelize=require(_0x2d1a('0x0'));module[_0x2d1a('0x1')]={'key':{'type':Sequelize[_0x2d1a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x2d1a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2d1a('0x2')]},'name':{'type':Sequelize[_0x2d1a('0x4')],'get':function(){return this[_0x2d1a('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 708b63d..466991d 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 _0x92f0=['attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','length','find','catch','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','user','UserProfileResource','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','update','then','destroy','get','CannedAnswers','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','intersection','fields'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0x92f0,0x166));var _0x092f=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0x92f0[_0x529059];return _0x156bc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x092f('0x0'));var zipdir=require(_0x092f('0x1'));var jsonpatch=require(_0x092f('0x2'));var rp=require('request-promise');var moment=require(_0x092f('0x3'));var BPromise=require(_0x092f('0x4'));var Mustache=require(_0x092f('0x5'));var util=require('util');var path=require(_0x092f('0x6'));var sox=require(_0x092f('0x7'));var csv=require(_0x092f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x092f('0x9'));var _=require(_0x092f('0xa'));var squel=require(_0x092f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x092f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x092f('0xd'));var Papa=require('papaparse');var Redis=require(_0x092f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x092f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x092f('0x10'))(_0x092f('0x11'));var utils=require(_0x092f('0x12'));var config=require(_0x092f('0x13'));var licenseUtil=require(_0x092f('0x14'));var db=require(_0x092f('0x15'))['db'];function respondWithStatusCode(_0x17e01b,_0x22bb62){_0x22bb62=_0x22bb62||0xcc;return function(_0x12d7d2){if(_0x12d7d2){return _0x17e01b[_0x092f('0x16')](_0x22bb62);}return _0x17e01b[_0x092f('0x17')](_0x22bb62)[_0x092f('0x18')]();};}function respondWithResult(_0x3c0127,_0x11886e){_0x11886e=_0x11886e||0xc8;return function(_0x47f90f){if(_0x47f90f){return _0x3c0127[_0x092f('0x17')](_0x11886e)['json'](_0x47f90f);}};}function respondWithFilteredResult(_0x13ce74,_0x5b8f25){return function(_0x5f33d9){if(_0x5f33d9){var _0x140d64=typeof _0x5b8f25[_0x092f('0x19')]===_0x092f('0x1a')&&typeof _0x5b8f25[_0x092f('0x1b')]==='undefined';var _0x50f17=_0x5f33d9[_0x092f('0x1c')];var _0x56e52b=_0x140d64?0x0:_0x5b8f25[_0x092f('0x19')];var _0xc76e29=_0x140d64?_0x5f33d9[_0x092f('0x1c')]:_0x5b8f25['offset']+_0x5b8f25[_0x092f('0x1b')];var _0x32d49d;if(_0xc76e29>=_0x50f17){_0xc76e29=_0x50f17;_0x32d49d=0xc8;}else{_0x32d49d=0xce;}_0x13ce74['status'](_0x32d49d);return _0x13ce74[_0x092f('0x1d')]('Content-Range',_0x56e52b+'-'+_0xc76e29+'/'+_0x50f17)['json'](_0x5f33d9);}return null;};}function patchUpdates(_0x3669d9){return function(_0x13c1ce){try{jsonpatch['apply'](_0x13c1ce,_0x3669d9,!![]);}catch(_0x393452){return BPromise['reject'](_0x393452);}return _0x13c1ce['save']();};}function saveUpdates(_0x1ad88c,_0x272933){return function(_0x7b8daa){if(_0x7b8daa){return _0x7b8daa[_0x092f('0x1e')](_0x1ad88c)[_0x092f('0x1f')](function(_0x1bee3d){return _0x1bee3d;});}return null;};}function removeEntity(_0x4537da,_0x2bb280){return function(_0x2f4029){if(_0x2f4029){return _0x2f4029[_0x092f('0x20')]()[_0x092f('0x1f')](function(){var _0x134948=_0x2f4029[_0x092f('0x21')]({'plain':!![]});var _0x3c779a=_0x092f('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c779a,'resourceId':_0x134948['id']}})['then'](function(){return _0x2f4029;});})[_0x092f('0x1f')](function(){_0x4537da[_0x092f('0x17')](0xcc)[_0x092f('0x18')]();});}};}function handleEntityNotFound(_0x4e74ab,_0x2e1285){return function(_0x4aa9f3){if(!_0x4aa9f3){_0x4e74ab[_0x092f('0x16')](0x194);}return _0x4aa9f3;};}function handleError(_0x3aaec7,_0x16f074){_0x16f074=_0x16f074||0x1f4;return function(_0x2e9e84){logger[_0x092f('0x23')](_0x2e9e84[_0x092f('0x24')]);if(_0x2e9e84[_0x092f('0x25')]){delete _0x2e9e84[_0x092f('0x25')];}_0x3aaec7[_0x092f('0x17')](_0x16f074)['send'](_0x2e9e84);};}exports[_0x092f('0x26')]=function(_0x27fcb7,_0x37d9f1){var _0x13caf3={},_0x4f38e9={},_0x55d13d={'count':0x0,'rows':[]};var _0x44e1b2=_[_0x092f('0x27')](db['CannedAnswer'][_0x092f('0x28')],function(_0x9e8046){return{'name':_0x9e8046[_0x092f('0x29')],'type':_0x9e8046['type']['key']};});_0x4f38e9[_0x092f('0x2a')]=_[_0x092f('0x27')](_0x44e1b2,_0x092f('0x25'));_0x4f38e9[_0x092f('0x2b')]=_[_0x092f('0x2c')](_0x27fcb7[_0x092f('0x2b')]);_0x4f38e9['filters']=_[_0x092f('0x2d')](_0x4f38e9['model'],_0x4f38e9[_0x092f('0x2b')]);_0x13caf3['attributes']=_[_0x092f('0x2d')](_0x4f38e9[_0x092f('0x2a')],qs[_0x092f('0x2e')](_0x27fcb7[_0x092f('0x2b')][_0x092f('0x2e')]));_0x13caf3[_0x092f('0x2f')]=_0x13caf3[_0x092f('0x2f')]['length']?_0x13caf3[_0x092f('0x2f')]:_0x4f38e9['model'];if(!_0x27fcb7[_0x092f('0x2b')][_0x092f('0x30')](_0x092f('0x31'))){_0x13caf3[_0x092f('0x1b')]=qs['limit'](_0x27fcb7['query']['limit']);_0x13caf3[_0x092f('0x19')]=qs[_0x092f('0x19')](_0x27fcb7[_0x092f('0x2b')][_0x092f('0x19')]);}_0x13caf3[_0x092f('0x32')]=qs['sort'](_0x27fcb7[_0x092f('0x2b')][_0x092f('0x33')]);_0x13caf3[_0x092f('0x34')]=qs[_0x092f('0x35')](_[_0x092f('0x36')](_0x27fcb7[_0x092f('0x2b')],_0x4f38e9[_0x092f('0x35')]),_0x44e1b2);if(_0x27fcb7['query'][_0x092f('0x37')]){_0x13caf3[_0x092f('0x34')]=_[_0x092f('0x38')](_0x13caf3[_0x092f('0x34')],{'$or':[{'key':{'$like':'%'+_0x27fcb7[_0x092f('0x2b')][_0x092f('0x37')]+'%'}},{'value':{'$like':'%'+_0x27fcb7['query'][_0x092f('0x37')]+'%'}}]});}_0x13caf3=_['merge']({},_0x13caf3,_0x27fcb7[_0x092f('0x39')]);var _0x2108ff={'where':_0x13caf3['where']};return db[_0x092f('0x3a')][_0x092f('0x1c')](_0x2108ff)[_0x092f('0x1f')](function(_0x34af2e){_0x55d13d[_0x092f('0x1c')]=_0x34af2e;if(_0x27fcb7[_0x092f('0x2b')][_0x092f('0x3b')]){_0x13caf3[_0x092f('0x3c')]=[{'all':!![]}];}return db[_0x092f('0x3a')][_0x092f('0x3d')](_0x13caf3);})[_0x092f('0x1f')](function(_0x5534af){_0x55d13d[_0x092f('0x3e')]=_0x5534af;return _0x55d13d;})[_0x092f('0x1f')](respondWithFilteredResult(_0x37d9f1,_0x13caf3))['catch'](handleError(_0x37d9f1,null));};exports[_0x092f('0x3f')]=function(_0x8092ee,_0x7a6ed2){var _0xa48d9c={'raw':!![],'where':{'id':_0x8092ee[_0x092f('0x40')]['id']}},_0x5880c2={};_0x5880c2['model']=_[_0x092f('0x2c')](db[_0x092f('0x3a')]['rawAttributes']);_0x5880c2[_0x092f('0x2b')]=_['keys'](_0x8092ee[_0x092f('0x2b')]);_0x5880c2[_0x092f('0x35')]=_['intersection'](_0x5880c2[_0x092f('0x2a')],_0x5880c2['query']);_0xa48d9c['attributes']=_['intersection'](_0x5880c2[_0x092f('0x2a')],qs['fields'](_0x8092ee['query'][_0x092f('0x2e')]));_0xa48d9c[_0x092f('0x2f')]=_0xa48d9c[_0x092f('0x2f')][_0x092f('0x41')]?_0xa48d9c[_0x092f('0x2f')]:_0x5880c2['model'];if(_0x8092ee[_0x092f('0x2b')][_0x092f('0x3b')]){_0xa48d9c[_0x092f('0x3c')]=[{'all':!![]}];}_0xa48d9c=_[_0x092f('0x38')]({},_0xa48d9c,_0x8092ee[_0x092f('0x39')]);return db[_0x092f('0x3a')][_0x092f('0x42')](_0xa48d9c)[_0x092f('0x1f')](handleEntityNotFound(_0x7a6ed2,null))[_0x092f('0x1f')](respondWithResult(_0x7a6ed2,null))[_0x092f('0x43')](handleError(_0x7a6ed2,null));};exports[_0x092f('0x1e')]=function(_0x2e348e,_0x6ee1d0){if(_0x2e348e[_0x092f('0x44')]['id']){delete _0x2e348e[_0x092f('0x44')]['id'];}return db[_0x092f('0x3a')]['find']({'where':{'id':_0x2e348e[_0x092f('0x40')]['id']}})[_0x092f('0x1f')](handleEntityNotFound(_0x6ee1d0,null))[_0x092f('0x1f')](saveUpdates(_0x2e348e[_0x092f('0x44')],null))[_0x092f('0x1f')](respondWithResult(_0x6ee1d0,null))[_0x092f('0x43')](handleError(_0x6ee1d0,null));};exports[_0x092f('0x20')]=function(_0x38a300,_0x14c523){return db[_0x092f('0x3a')][_0x092f('0x42')]({'where':{'id':_0x38a300['params']['id']}})[_0x092f('0x1f')](handleEntityNotFound(_0x14c523,null))[_0x092f('0x1f')](removeEntity(_0x14c523,null))['catch'](handleError(_0x14c523,null));};exports[_0x092f('0x45')]=function(_0x1399db,_0x3a03e7){var _0x1a5247={'key':_0x1399db[_0x092f('0x44')][_0x092f('0x46')]};if(_0x1399db[_0x092f('0x44')][_0x092f('0x47')]){_0x1a5247[_0x092f('0x47')]=_0x1399db['body'][_0x092f('0x47')];}else if(_0x1399db[_0x092f('0x44')]['SmsAccountId']){_0x1a5247[_0x092f('0x48')]=_0x1399db[_0x092f('0x44')]['SmsAccountId'];}else if(_0x1399db[_0x092f('0x44')][_0x092f('0x49')]){_0x1a5247[_0x092f('0x49')]=_0x1399db[_0x092f('0x44')][_0x092f('0x49')];}else if(_0x1399db[_0x092f('0x44')][_0x092f('0x4a')]){_0x1a5247[_0x092f('0x4a')]=_0x1399db[_0x092f('0x44')][_0x092f('0x4a')];}return db[_0x092f('0x3a')]['find']({'where':_0x1a5247})['then'](function(_0x5268e9){if(_0x5268e9){throw new db[(_0x092f('0x4b'))][(_0x092f('0x4c'))](_0x092f('0x4d'));}return db[_0x092f('0x3a')]['create'](_0x1399db[_0x092f('0x44')]);})[_0x092f('0x1f')](function(_0x2e8923){var _0x983623=_0x1399db['user'][_0x092f('0x21')]({'plain':!![]});if(!_0x983623)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x983623[_0x092f('0x4e')]===_0x092f('0x4f')){var _0x11be75=_0x2e8923[_0x092f('0x21')]({'plain':!![]});return db['UserProfileSection'][_0x092f('0x42')]({'where':{'name':_0x092f('0x22'),'userProfileId':_0x983623['userProfileId']},'raw':!![]})['then'](function(_0x20fa71){if(_0x20fa71&&_0x20fa71['autoAssociation']===0x0){return db[_0x092f('0x50')]['create']({'name':_0x11be75['name'],'resourceId':_0x11be75['id'],'type':_0x20fa71[_0x092f('0x25')],'sectionId':_0x20fa71['id']},{})[_0x092f('0x1f')](function(){return _0x2e8923;});}else{return _0x2e8923;}})[_0x092f('0x43')](function(_0x4bb668){logger[_0x092f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bb668);throw _0x4bb668;});}return _0x2e8923;})['then'](respondWithResult(_0x3a03e7,0xc9))[_0x092f('0x43')](handleError(_0x3a03e7,null));};
\ No newline at end of file
+var _0x244b=['count','set','Content-Range','apply','reject','then','destroy','get','CannedAnswers','UserProfileResource','error','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','params','length','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit'];(function(_0x25b12d,_0x1551e9){var _0x5c38bb=function(_0x4867e1){while(--_0x4867e1){_0x25b12d['push'](_0x25b12d['shift']());}};_0x5c38bb(++_0x1551e9);}(_0x244b,0x12d));var _0xb244=function(_0x3c7605,_0x16de37){_0x3c7605=_0x3c7605-0x0;var _0x2a12ba=_0x244b[_0x3c7605];return _0x2a12ba;};'use strict';var emlformat=require(_0xb244('0x0'));var rimraf=require(_0xb244('0x1'));var zipdir=require(_0xb244('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb244('0x3'));var moment=require('moment');var BPromise=require(_0xb244('0x4'));var Mustache=require(_0xb244('0x5'));var util=require('util');var path=require(_0xb244('0x6'));var sox=require(_0xb244('0x7'));var csv=require('to-csv');var ejs=require(_0xb244('0x8'));var fs=require('fs');var fs_extra=require(_0xb244('0x9'));var _=require(_0xb244('0xa'));var squel=require(_0xb244('0xb'));var crypto=require('crypto');var jsforce=require(_0xb244('0xc'));var deskjs=require(_0xb244('0xd'));var toCsv=require(_0xb244('0xe'));var querystring=require(_0xb244('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb244('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb244('0x11'));var hardwareService=require(_0xb244('0x12'));var logger=require('../../config/logger')(_0xb244('0x13'));var utils=require(_0xb244('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb244('0x15'));var db=require(_0xb244('0x16'))['db'];function respondWithStatusCode(_0x283050,_0x600fce){_0x600fce=_0x600fce||0xcc;return function(_0x2e13a7){if(_0x2e13a7){return _0x283050['sendStatus'](_0x600fce);}return _0x283050[_0xb244('0x17')](_0x600fce)[_0xb244('0x18')]();};}function respondWithResult(_0x534e15,_0x333d44){_0x333d44=_0x333d44||0xc8;return function(_0x1e0f43){if(_0x1e0f43){return _0x534e15[_0xb244('0x17')](_0x333d44)['json'](_0x1e0f43);}};}function respondWithFilteredResult(_0x4d052b,_0x2ae6e4){return function(_0x558c83){if(_0x558c83){var _0x1622cb=typeof _0x2ae6e4[_0xb244('0x19')]==='undefined'&&typeof _0x2ae6e4[_0xb244('0x1a')]==='undefined';var _0x43b910=_0x558c83['count'];var _0x2b5799=_0x1622cb?0x0:_0x2ae6e4[_0xb244('0x19')];var _0x5b23c5=_0x1622cb?_0x558c83[_0xb244('0x1b')]:_0x2ae6e4['offset']+_0x2ae6e4[_0xb244('0x1a')];var _0x5c6fce;if(_0x5b23c5>=_0x43b910){_0x5b23c5=_0x43b910;_0x5c6fce=0xc8;}else{_0x5c6fce=0xce;}_0x4d052b[_0xb244('0x17')](_0x5c6fce);return _0x4d052b[_0xb244('0x1c')](_0xb244('0x1d'),_0x2b5799+'-'+_0x5b23c5+'/'+_0x43b910)['json'](_0x558c83);}return null;};}function patchUpdates(_0x3ce98a){return function(_0x647fd7){try{jsonpatch[_0xb244('0x1e')](_0x647fd7,_0x3ce98a,!![]);}catch(_0x46ede3){return BPromise[_0xb244('0x1f')](_0x46ede3);}return _0x647fd7['save']();};}function saveUpdates(_0x3c1a44,_0x4a9fd9){return function(_0x885ec2){if(_0x885ec2){return _0x885ec2['update'](_0x3c1a44)[_0xb244('0x20')](function(_0x18283b){return _0x18283b;});}return null;};}function removeEntity(_0x369c50,_0x1542ab){return function(_0x3fdbb0){if(_0x3fdbb0){return _0x3fdbb0[_0xb244('0x21')]()[_0xb244('0x20')](function(){var _0x718873=_0x3fdbb0[_0xb244('0x22')]({'plain':!![]});var _0xa77a34=_0xb244('0x23');return db[_0xb244('0x24')]['destroy']({'where':{'type':_0xa77a34,'resourceId':_0x718873['id']}})[_0xb244('0x20')](function(){return _0x3fdbb0;});})[_0xb244('0x20')](function(){_0x369c50[_0xb244('0x17')](0xcc)[_0xb244('0x18')]();});}};}function handleEntityNotFound(_0x2db535,_0x3f63a0){return function(_0x539611){if(!_0x539611){_0x2db535['sendStatus'](0x194);}return _0x539611;};}function handleError(_0x5f4676,_0x20308b){_0x20308b=_0x20308b||0x1f4;return function(_0x2f900e){logger[_0xb244('0x25')](_0x2f900e['stack']);if(_0x2f900e[_0xb244('0x26')]){delete _0x2f900e['name'];}_0x5f4676['status'](_0x20308b)['send'](_0x2f900e);};}exports[_0xb244('0x27')]=function(_0x50eb37,_0x3f7bad){var _0x5d3d48={},_0x4b300a={},_0x1ae98d={'count':0x0,'rows':[]};var _0xd4e901=_[_0xb244('0x28')](db[_0xb244('0x29')][_0xb244('0x2a')],function(_0x2f82d0){return{'name':_0x2f82d0[_0xb244('0x2b')],'type':_0x2f82d0[_0xb244('0x2c')][_0xb244('0x2d')]};});_0x4b300a[_0xb244('0x2e')]=_[_0xb244('0x28')](_0xd4e901,_0xb244('0x26'));_0x4b300a[_0xb244('0x2f')]=_[_0xb244('0x30')](_0x50eb37[_0xb244('0x2f')]);_0x4b300a[_0xb244('0x31')]=_[_0xb244('0x32')](_0x4b300a[_0xb244('0x2e')],_0x4b300a[_0xb244('0x2f')]);_0x5d3d48['attributes']=_[_0xb244('0x32')](_0x4b300a[_0xb244('0x2e')],qs[_0xb244('0x33')](_0x50eb37[_0xb244('0x2f')]['fields']));_0x5d3d48[_0xb244('0x34')]=_0x5d3d48['attributes']['length']?_0x5d3d48[_0xb244('0x34')]:_0x4b300a['model'];if(!_0x50eb37[_0xb244('0x2f')][_0xb244('0x35')](_0xb244('0x36'))){_0x5d3d48[_0xb244('0x1a')]=qs[_0xb244('0x1a')](_0x50eb37[_0xb244('0x2f')][_0xb244('0x1a')]);_0x5d3d48[_0xb244('0x19')]=qs[_0xb244('0x19')](_0x50eb37[_0xb244('0x2f')]['offset']);}_0x5d3d48[_0xb244('0x37')]=qs[_0xb244('0x38')](_0x50eb37[_0xb244('0x2f')][_0xb244('0x38')]);_0x5d3d48[_0xb244('0x39')]=qs[_0xb244('0x31')](_['pick'](_0x50eb37[_0xb244('0x2f')],_0x4b300a[_0xb244('0x31')]),_0xd4e901);if(_0x50eb37['query'][_0xb244('0x3a')]){_0x5d3d48[_0xb244('0x39')]=_[_0xb244('0x3b')](_0x5d3d48['where'],{'$or':[{'key':{'$like':'%'+_0x50eb37[_0xb244('0x2f')][_0xb244('0x3a')]+'%'}},{'value':{'$like':'%'+_0x50eb37[_0xb244('0x2f')][_0xb244('0x3a')]+'%'}}]});}_0x5d3d48=_[_0xb244('0x3b')]({},_0x5d3d48,_0x50eb37[_0xb244('0x3c')]);var _0x155416={'where':_0x5d3d48[_0xb244('0x39')]};return db[_0xb244('0x29')][_0xb244('0x1b')](_0x155416)['then'](function(_0x4a11d1){_0x1ae98d[_0xb244('0x1b')]=_0x4a11d1;if(_0x50eb37[_0xb244('0x2f')][_0xb244('0x3d')]){_0x5d3d48[_0xb244('0x3e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5d3d48);})[_0xb244('0x20')](function(_0x2e56d8){_0x1ae98d[_0xb244('0x3f')]=_0x2e56d8;return _0x1ae98d;})['then'](respondWithFilteredResult(_0x3f7bad,_0x5d3d48))[_0xb244('0x40')](handleError(_0x3f7bad,null));};exports['show']=function(_0x5acac2,_0x5a195d){var _0x4141c6={'raw':!![],'where':{'id':_0x5acac2[_0xb244('0x41')]['id']}},_0x3d406a={};_0x3d406a[_0xb244('0x2e')]=_[_0xb244('0x30')](db['CannedAnswer'][_0xb244('0x2a')]);_0x3d406a['query']=_[_0xb244('0x30')](_0x5acac2[_0xb244('0x2f')]);_0x3d406a[_0xb244('0x31')]=_[_0xb244('0x32')](_0x3d406a['model'],_0x3d406a[_0xb244('0x2f')]);_0x4141c6[_0xb244('0x34')]=_[_0xb244('0x32')](_0x3d406a['model'],qs[_0xb244('0x33')](_0x5acac2[_0xb244('0x2f')][_0xb244('0x33')]));_0x4141c6[_0xb244('0x34')]=_0x4141c6[_0xb244('0x34')][_0xb244('0x42')]?_0x4141c6['attributes']:_0x3d406a[_0xb244('0x2e')];if(_0x5acac2[_0xb244('0x2f')][_0xb244('0x3d')]){_0x4141c6[_0xb244('0x3e')]=[{'all':!![]}];}_0x4141c6=_['merge']({},_0x4141c6,_0x5acac2[_0xb244('0x3c')]);return db[_0xb244('0x29')][_0xb244('0x43')](_0x4141c6)[_0xb244('0x20')](handleEntityNotFound(_0x5a195d,null))['then'](respondWithResult(_0x5a195d,null))[_0xb244('0x40')](handleError(_0x5a195d,null));};exports[_0xb244('0x44')]=function(_0x18d9f6,_0x203678){if(_0x18d9f6[_0xb244('0x45')]['id']){delete _0x18d9f6[_0xb244('0x45')]['id'];}return db['CannedAnswer'][_0xb244('0x43')]({'where':{'id':_0x18d9f6[_0xb244('0x41')]['id']}})['then'](handleEntityNotFound(_0x203678,null))['then'](saveUpdates(_0x18d9f6[_0xb244('0x45')],null))[_0xb244('0x20')](respondWithResult(_0x203678,null))[_0xb244('0x40')](handleError(_0x203678,null));};exports[_0xb244('0x21')]=function(_0x5562cf,_0x18e538){return db['CannedAnswer'][_0xb244('0x43')]({'where':{'id':_0x5562cf['params']['id']}})['then'](handleEntityNotFound(_0x18e538,null))[_0xb244('0x20')](removeEntity(_0x18e538,null))[_0xb244('0x40')](handleError(_0x18e538,null));};exports[_0xb244('0x46')]=function(_0x109ccf,_0x528bf2){var _0xde6fb8={'key':_0x109ccf[_0xb244('0x45')][_0xb244('0x2d')]};if(_0x109ccf[_0xb244('0x45')][_0xb244('0x47')]){_0xde6fb8[_0xb244('0x47')]=_0x109ccf[_0xb244('0x45')][_0xb244('0x47')];}else if(_0x109ccf[_0xb244('0x45')][_0xb244('0x48')]){_0xde6fb8['SmsAccountId']=_0x109ccf[_0xb244('0x45')]['SmsAccountId'];}else if(_0x109ccf[_0xb244('0x45')][_0xb244('0x49')]){_0xde6fb8[_0xb244('0x49')]=_0x109ccf[_0xb244('0x45')]['OpenchannelAccountId'];}else if(_0x109ccf[_0xb244('0x45')][_0xb244('0x4a')]){_0xde6fb8[_0xb244('0x4a')]=_0x109ccf['body'][_0xb244('0x4a')];}return db[_0xb244('0x29')][_0xb244('0x43')]({'where':_0xde6fb8})[_0xb244('0x20')](function(_0x23ad14){if(_0x23ad14){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xb244('0x46')](_0x109ccf[_0xb244('0x45')]);})[_0xb244('0x20')](function(_0x245e54){var _0x4fc916=_0x109ccf['user'][_0xb244('0x22')]({'plain':!![]});if(!_0x4fc916)throw new Error(_0xb244('0x4b'));if(_0x4fc916[_0xb244('0x4c')]===_0xb244('0x4d')){var _0x1b0f56=_0x245e54[_0xb244('0x22')]({'plain':!![]});return db[_0xb244('0x4e')][_0xb244('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x4fc916[_0xb244('0x4f')]},'raw':!![]})[_0xb244('0x20')](function(_0x37190){if(_0x37190&&_0x37190[_0xb244('0x50')]===0x0){return db[_0xb244('0x24')][_0xb244('0x46')]({'name':_0x1b0f56[_0xb244('0x26')],'resourceId':_0x1b0f56['id'],'type':_0x37190[_0xb244('0x26')],'sectionId':_0x37190['id']},{})[_0xb244('0x20')](function(){return _0x245e54;});}else{return _0x245e54;}})[_0xb244('0x40')](function(_0x5dc07e){logger['error'](_0xb244('0x51'),_0x5dc07e);throw _0x5dc07e;});}return _0x245e54;})['then'](respondWithResult(_0x528bf2,0xc9))[_0xb244('0x40')](handleError(_0x528bf2,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 09bce9c..efa8d62 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 _0x1410=['moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','api'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x1410,0x19e));var _0x0141=function(_0x4483bb,_0x4cae9e){_0x4483bb=_0x4483bb-0x0;var _0xd930aa=_0x1410[_0x4483bb];return _0xd930aa;};'use strict';var _=require(_0x0141('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rp=require(_0x0141('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0141('0x5'));var config=require(_0x0141('0x6'));var attributes=require(_0x0141('0x7'));module[_0x0141('0x8')]=function(_0x440fdb,_0x22db1d){return _0x440fdb[_0x0141('0x9')](_0x0141('0xa'),attributes,{'tableName':_0x0141('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0141('0xc')});};
\ No newline at end of file
+var _0x5228=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x5228,0xcc));var _0x8522=function(_0x23427e,_0x3309f3){_0x23427e=_0x23427e-0x0;var _0x414ba3=_0x5228[_0x23427e];return _0x414ba3;};'use strict';var _=require(_0x8522('0x0'));var util=require(_0x8522('0x1'));var logger=require(_0x8522('0x2'))(_0x8522('0x3'));var moment=require(_0x8522('0x4'));var BPromise=require(_0x8522('0x5'));var rp=require(_0x8522('0x6'));var fs=require('fs');var path=require(_0x8522('0x7'));var rimraf=require('rimraf');var config=require(_0x8522('0x8'));var attributes=require(_0x8522('0x9'));module[_0x8522('0xa')]=function(_0x11d5fe,_0x53d658){return _0x11d5fe[_0x8522('0xb')](_0x8522('0xc'),attributes,{'tableName':_0x8522('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8522('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index db9456c..ca6a166 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(_0x2bcc97,_0x32f0b3){var _0x19075f=function(_0x1e7a86){while(--_0x1e7a86){_0x2bcc97['push'](_0x2bcc97['shift']());}};_0x19075f(++_0x32f0b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0xc25d,_0x9ec289){var _0x3aa213=function(_0x404f5f){while(--_0x404f5f){_0xc25d['push'](_0xc25d['shift']());}};_0x3aa213(++_0x9ec289);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 5c9d97d..ad5c776 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 _0x380c=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x36e508,_0x5002e7){var _0x191e46=function(_0xf8d2a2){while(--_0xf8d2a2){_0x36e508['push'](_0x36e508['shift']());}};_0x191e46(++_0x5002e7);}(_0x380c,0xc3));var _0xc380=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x380c[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xc380('0x0'));var util=require(_0xc380('0x1'));var path=require(_0xc380('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc380('0x3'));var auth=require(_0xc380('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc380('0x5'));var controller=require('./cannedAnswer.controller');router[_0xc380('0x6')]('/',auth[_0xc380('0x7')](),controller[_0xc380('0x8')]);router[_0xc380('0x6')](_0xc380('0x9'),auth[_0xc380('0x7')](),controller[_0xc380('0xa')]);router[_0xc380('0xb')]('/',auth[_0xc380('0x7')](),controller['create']);router[_0xc380('0xc')](_0xc380('0x9'),auth[_0xc380('0x7')](),controller[_0xc380('0xd')]);router[_0xc380('0xe')](_0xc380('0x9'),auth['isAuthenticated'](),controller[_0xc380('0xf')]);module[_0xc380('0x10')]=router;
\ No newline at end of file
+var _0x5574=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','create','put','/:id'];(function(_0x2894e1,_0x46e6a0){var _0x5df491=function(_0x1eb4c2){while(--_0x1eb4c2){_0x2894e1['push'](_0x2894e1['shift']());}};_0x5df491(++_0x46e6a0);}(_0x5574,0xaa));var _0x4557=function(_0x439c35,_0x552da7){_0x439c35=_0x439c35-0x0;var _0xd68b45=_0x5574[_0x439c35];return _0xd68b45;};'use strict';var multer=require('multer');var util=require(_0x4557('0x0'));var path=require('path');var timeout=require(_0x4557('0x1'));var express=require(_0x4557('0x2'));var router=express[_0x4557('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4557('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4557('0x5'));var controller=require(_0x4557('0x6'));router['get']('/',auth[_0x4557('0x7')](),controller['index']);router[_0x4557('0x8')]('/:id',auth[_0x4557('0x7')](),controller['show']);router['post']('/',auth[_0x4557('0x7')](),controller[_0x4557('0x9')]);router[_0x4557('0xa')](_0x4557('0xb'),auth[_0x4557('0x7')](),controller['update']);router[_0x4557('0xc')](_0x4557('0xb'),auth[_0x4557('0x7')](),controller[_0x4557('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4315e35..ea61d5b 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 _0x1ba2=['sequelize','DATE','STRING','INTEGER'];(function(_0x11fa58,_0x9cdf4c){var _0x5c23c1=function(_0x24ec43){while(--_0x24ec43){_0x11fa58['push'](_0x11fa58['shift']());}};_0x5c23c1(++_0x9cdf4c);}(_0x1ba2,0xb4));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x21ba('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x21ba('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x21ba('0x2')]},'src':{'type':Sequelize[_0x21ba('0x2')]},'dst':{'type':Sequelize[_0x21ba('0x2')]},'dcontext':{'type':Sequelize[_0x21ba('0x2')]},'channel':{'type':Sequelize[_0x21ba('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x21ba('0x2')]},'lastdata':{'type':Sequelize[_0x21ba('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x21ba('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x21ba('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x21ba('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x21ba('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x21ba('0x2')]},'peeraccount':{'type':Sequelize[_0x21ba('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x21ba('0x2')]}};
\ No newline at end of file
+var _0xb584=['STRING','INTEGER','DATE'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb584,0x1c1));var _0x4b58=function(_0x3c7c71,_0x9c0c2){_0x3c7c71=_0x3c7c71-0x0;var _0x516df7=_0xb584[_0x3c7c71];return _0x516df7;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x4b58('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x4b58('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4b58('0x1')]},'dcontext':{'type':Sequelize[_0x4b58('0x1')]},'channel':{'type':Sequelize[_0x4b58('0x1')]},'dstchannel':{'type':Sequelize[_0x4b58('0x1')]},'lastapp':{'type':Sequelize[_0x4b58('0x1')]},'lastdata':{'type':Sequelize[_0x4b58('0x1')]},'duration':{'type':Sequelize[_0x4b58('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4b58('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4b58('0x1')]},'userfield':{'type':Sequelize[_0x4b58('0x1')]},'uniqueid':{'type':Sequelize[_0x4b58('0x1')]},'linkedid':{'type':Sequelize[_0x4b58('0x1')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x4b58('0x1')]},'type':{'type':Sequelize[_0x4b58('0x1')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 25ef2e8..312c16c 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 _0xfc17=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x3c38a9,_0x571fe7){var _0x36f44b=function(_0x1c5278){while(--_0x1c5278){_0x3c38a9['push'](_0x3c38a9['shift']());}};_0x36f44b(++_0x571fe7);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x47c885,_0x59e51d){_0x47c885=_0x47c885-0x0;var _0x321443=_0xfc17[_0x47c885];return _0x321443;};'use strict';var emlformat=require(_0x7fc1('0x0'));var rimraf=require(_0x7fc1('0x1'));var zipdir=require(_0x7fc1('0x2'));var jsonpatch=require(_0x7fc1('0x3'));var rp=require('request-promise');var moment=require(_0x7fc1('0x4'));var BPromise=require(_0x7fc1('0x5'));var Mustache=require(_0x7fc1('0x6'));var util=require(_0x7fc1('0x7'));var path=require(_0x7fc1('0x8'));var sox=require(_0x7fc1('0x9'));var csv=require('to-csv');var ejs=require(_0x7fc1('0xa'));var fs=require('fs');var fs_extra=require(_0x7fc1('0xb'));var _=require(_0x7fc1('0xc'));var squel=require(_0x7fc1('0xd'));var crypto=require(_0x7fc1('0xe'));var jsforce=require(_0x7fc1('0xf'));var deskjs=require(_0x7fc1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7fc1('0x11'));var Papa=require(_0x7fc1('0x12'));var Redis=require(_0x7fc1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7fc1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fc1('0x15'))(_0x7fc1('0x16'));var utils=require(_0x7fc1('0x17'));var config=require(_0x7fc1('0x18'));var licenseUtil=require(_0x7fc1('0x19'));var db=require(_0x7fc1('0x1a'))['db'];function respondWithStatusCode(_0x53277f,_0x3a7c8e){_0x3a7c8e=_0x3a7c8e||0xcc;return function(_0x902325){if(_0x902325){return _0x53277f[_0x7fc1('0x1b')](_0x3a7c8e);}return _0x53277f[_0x7fc1('0x1c')](_0x3a7c8e)[_0x7fc1('0x1d')]();};}function respondWithResult(_0x5651f2,_0x54a204){_0x54a204=_0x54a204||0xc8;return function(_0x881462){if(_0x881462){return _0x5651f2[_0x7fc1('0x1c')](_0x54a204)[_0x7fc1('0x1e')](_0x881462);}};}function respondWithFilteredResult(_0x391de7,_0x432825){return function(_0x3c4671){if(_0x3c4671){var _0x3d8e82=typeof _0x432825[_0x7fc1('0x1f')]===_0x7fc1('0x20')&&typeof _0x432825[_0x7fc1('0x21')]==='undefined';var _0x419170=_0x3c4671['count'];var _0x30fc04=_0x3d8e82?0x0:_0x432825[_0x7fc1('0x1f')];var _0x535ae1=_0x3d8e82?_0x3c4671[_0x7fc1('0x22')]:_0x432825[_0x7fc1('0x1f')]+_0x432825['limit'];var _0x25d384;if(_0x535ae1>=_0x419170){_0x535ae1=_0x419170;_0x25d384=0xc8;}else{_0x25d384=0xce;}_0x391de7[_0x7fc1('0x1c')](_0x25d384);return _0x391de7[_0x7fc1('0x23')](_0x7fc1('0x24'),_0x30fc04+'-'+_0x535ae1+'/'+_0x419170)[_0x7fc1('0x1e')](_0x3c4671);}return null;};}function patchUpdates(_0x1c249d){return function(_0x3e7c92){try{jsonpatch[_0x7fc1('0x25')](_0x3e7c92,_0x1c249d,!![]);}catch(_0x327569){return BPromise[_0x7fc1('0x26')](_0x327569);}return _0x3e7c92['save']();};}function saveUpdates(_0x49a44f,_0x2390b8){return function(_0x5e10cd){if(_0x5e10cd){return _0x5e10cd[_0x7fc1('0x27')](_0x49a44f)[_0x7fc1('0x28')](function(_0x253ae9){return _0x253ae9;});}return null;};}function removeEntity(_0x3683f4,_0x56c5d6){return function(_0x38b5b5){if(_0x38b5b5){return _0x38b5b5[_0x7fc1('0x29')]()[_0x7fc1('0x28')](function(){_0x3683f4['status'](0xcc)[_0x7fc1('0x1d')]();});}};}function handleEntityNotFound(_0x252b18,_0x5ddc11){return function(_0x4b24d6){if(!_0x4b24d6){_0x252b18[_0x7fc1('0x1b')](0x194);}return _0x4b24d6;};}function handleError(_0x293a2a,_0x1f58ca){_0x1f58ca=_0x1f58ca||0x1f4;return function(_0x2ae7db){logger['error'](_0x2ae7db[_0x7fc1('0x2a')]);if(_0x2ae7db[_0x7fc1('0x2b')]){delete _0x2ae7db[_0x7fc1('0x2b')];}_0x293a2a[_0x7fc1('0x1c')](_0x1f58ca)['send'](_0x2ae7db);};}exports[_0x7fc1('0x2c')]=function(_0x583e60,_0x1f7fce){var _0x22a3c1={},_0x34ec70={},_0x231913={'count':0x0,'rows':[]};var _0x2317f5=_['map'](db[_0x7fc1('0x2d')]['rawAttributes'],function(_0x55b4f1){return{'name':_0x55b4f1[_0x7fc1('0x2e')],'type':_0x55b4f1[_0x7fc1('0x2f')][_0x7fc1('0x30')]};});_0x34ec70[_0x7fc1('0x31')]=_[_0x7fc1('0x32')](_0x2317f5,_0x7fc1('0x2b'));_0x34ec70[_0x7fc1('0x33')]=_[_0x7fc1('0x34')](_0x583e60[_0x7fc1('0x33')]);_0x34ec70[_0x7fc1('0x35')]=_[_0x7fc1('0x36')](_0x34ec70[_0x7fc1('0x31')],_0x34ec70[_0x7fc1('0x33')]);_0x22a3c1[_0x7fc1('0x37')]=_[_0x7fc1('0x36')](_0x34ec70[_0x7fc1('0x31')],qs['fields'](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x38')]));_0x22a3c1[_0x7fc1('0x37')]=_0x22a3c1[_0x7fc1('0x37')][_0x7fc1('0x39')]?_0x22a3c1[_0x7fc1('0x37')]:_0x34ec70['model'];if(!_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x3a')]('nolimit')){_0x22a3c1[_0x7fc1('0x21')]=qs[_0x7fc1('0x21')](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x21')]);_0x22a3c1[_0x7fc1('0x1f')]=qs['offset'](_0x583e60['query'][_0x7fc1('0x1f')]);}_0x22a3c1[_0x7fc1('0x3b')]=qs[_0x7fc1('0x3c')](_0x583e60[_0x7fc1('0x33')][_0x7fc1('0x3c')]);_0x22a3c1[_0x7fc1('0x3d')]=qs[_0x7fc1('0x35')](_[_0x7fc1('0x3e')](_0x583e60['query'],_0x34ec70[_0x7fc1('0x35')]),_0x2317f5);if(_0x583e60[_0x7fc1('0x33')]['filter']){_0x22a3c1[_0x7fc1('0x3d')]=_[_0x7fc1('0x3f')](_0x22a3c1[_0x7fc1('0x3d')],{'$or':_['map'](_0x2317f5,function(_0x57ef4c){if(_0x57ef4c[_0x7fc1('0x2f')]!==_0x7fc1('0x40')){var _0xafc8b0={};_0xafc8b0[_0x57ef4c['name']]={'$like':'%'+_0x583e60['query']['filter']+'%'};return _0xafc8b0;}})});}_0x22a3c1=_[_0x7fc1('0x3f')]({},_0x22a3c1,_0x583e60[_0x7fc1('0x41')]);var _0x32607c={'where':_0x22a3c1[_0x7fc1('0x3d')]};return db['Cdr']['count'](_0x32607c)[_0x7fc1('0x28')](function(_0xf26d98){_0x231913[_0x7fc1('0x22')]=_0xf26d98;if(_0x583e60['query']['includeAll']){_0x22a3c1['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x22a3c1);})[_0x7fc1('0x28')](function(_0x54749f){_0x231913[_0x7fc1('0x42')]=_0x54749f;return _0x231913;})[_0x7fc1('0x28')](respondWithFilteredResult(_0x1f7fce,_0x22a3c1))['catch'](handleError(_0x1f7fce,null));};exports[_0x7fc1('0x43')]=function(_0x16ad03,_0x111d51){var _0x3282dd={'raw':!![],'where':{'id':_0x16ad03[_0x7fc1('0x44')]['id']}},_0x56b853={};_0x56b853['model']=_[_0x7fc1('0x34')](db[_0x7fc1('0x2d')][_0x7fc1('0x45')]);_0x56b853[_0x7fc1('0x33')]=_['keys'](_0x16ad03[_0x7fc1('0x33')]);_0x56b853[_0x7fc1('0x35')]=_['intersection'](_0x56b853[_0x7fc1('0x31')],_0x56b853[_0x7fc1('0x33')]);_0x3282dd['attributes']=_[_0x7fc1('0x36')](_0x56b853[_0x7fc1('0x31')],qs['fields'](_0x16ad03[_0x7fc1('0x33')][_0x7fc1('0x38')]));_0x3282dd[_0x7fc1('0x37')]=_0x3282dd['attributes'][_0x7fc1('0x39')]?_0x3282dd[_0x7fc1('0x37')]:_0x56b853[_0x7fc1('0x31')];if(_0x16ad03[_0x7fc1('0x33')]['includeAll']){_0x3282dd['include']=[{'all':!![]}];}_0x3282dd=_[_0x7fc1('0x3f')]({},_0x3282dd,_0x16ad03[_0x7fc1('0x41')]);return db[_0x7fc1('0x2d')][_0x7fc1('0x46')](_0x3282dd)[_0x7fc1('0x28')](handleEntityNotFound(_0x111d51,null))[_0x7fc1('0x28')](respondWithResult(_0x111d51,null))[_0x7fc1('0x47')](handleError(_0x111d51,null));};exports[_0x7fc1('0x48')]=function(_0x419ea1,_0x4c4606){return db['Cdr']['create'](_0x419ea1[_0x7fc1('0x49')],{})[_0x7fc1('0x28')](respondWithResult(_0x4c4606,0xc9))[_0x7fc1('0x47')](handleError(_0x4c4606,null));};exports[_0x7fc1('0x27')]=function(_0x4bcd63,_0xafd821){if(_0x4bcd63[_0x7fc1('0x49')]['id']){delete _0x4bcd63[_0x7fc1('0x49')]['id'];}return db[_0x7fc1('0x2d')]['find']({'where':{'id':_0x4bcd63[_0x7fc1('0x44')]['id']}})[_0x7fc1('0x28')](handleEntityNotFound(_0xafd821,null))[_0x7fc1('0x28')](saveUpdates(_0x4bcd63[_0x7fc1('0x49')],null))[_0x7fc1('0x28')](respondWithResult(_0xafd821,null))[_0x7fc1('0x47')](handleError(_0xafd821,null));};exports[_0x7fc1('0x29')]=function(_0x4d27db,_0x3d5f40){return db['Cdr'][_0x7fc1('0x46')]({'where':{'id':_0x4d27db['params']['id']}})[_0x7fc1('0x28')](handleEntityNotFound(_0x3d5f40,null))[_0x7fc1('0x28')](removeEntity(_0x3d5f40,null))['catch'](handleError(_0x3d5f40,null));};exports[_0x7fc1('0x4a')]=function(_0x3b492a,_0x509959){return db[_0x7fc1('0x2d')][_0x7fc1('0x4a')]()[_0x7fc1('0x28')](respondWithResult(_0x509959,null))[_0x7fc1('0x47')](handleError(_0x509959,null));};
\ No newline at end of file
+var _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x21ee0e,_0x317447){var _0x3c180c=function(_0x1b3698){while(--_0x1b3698){_0x21ee0e['push'](_0x21ee0e['shift']());}};_0x3c180c(++_0x317447);}(_0x24ca,0x8c));var _0xa24c=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x24ca[_0x4bb145];return _0x4db596;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f064312..279a350 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xee55be,_0x1150ab){var _0x4301d4=function(_0x312bdb){while(--_0x312bdb){_0xee55be['push'](_0xee55be['shift']());}};_0x4301d4(++_0x1150ab);}(_0x7a54,0x106));var _0x47a5=function(_0xa0e90b,_0x5d996d){_0xa0e90b=_0xa0e90b-0x0;var _0x146706=_0x7a54[_0xa0e90b];return _0x146706;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1f0821,_0x3c6eff){var _0x382a17=function(_0x42911c){while(--_0x42911c){_0x1f0821['push'](_0x1f0821['shift']());}};_0x382a17(++_0x3c6eff);}(_0x7a54,0x106));var _0x47a5=function(_0x1145b1,_0x4041bf){_0x1145b1=_0x1145b1-0x0;var _0x733832=_0x7a54[_0x1145b1];return _0x733832;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 4143d44..c90288e 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 _0x30cb=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','stringify','error','Cdr,\x20%s,\x20%s','message','request\x20sent'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x30cb,0xaa));var _0xb30c=function(_0x384495,_0x209c96){_0x384495=_0x384495-0x0;var _0x9c88e5=_0x30cb[_0x384495];return _0x9c88e5;};'use strict';var _=require(_0xb30c('0x0'));var util=require(_0xb30c('0x1'));var moment=require(_0xb30c('0x2'));var BPromise=require(_0xb30c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb30c('0x4'));var db=require(_0xb30c('0x5'))['db'];var utils=require(_0xb30c('0x6'));var logger=require('../../config/logger')(_0xb30c('0x7'));var config=require(_0xb30c('0x8'));var jayson=require(_0xb30c('0x9'));var client=jayson[_0xb30c('0xa')][_0xb30c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ad1ea,_0x1d7b0b,_0x1e8037){return new BPromise(function(_0x42fac2,_0x49106f){return client['request'](_0x3ad1ea,_0x1e8037)[_0xb30c('0xc')](function(_0x597b97){logger[_0xb30c('0xd')]('Cdr,\x20%s,\x20%s',_0x1d7b0b,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x1d7b0b,'request\x20sent',JSON[_0xb30c('0xe')](_0x597b97));if(_0x597b97[_0xb30c('0xf')]){if(_0x597b97['error']['code']===0x1f4){logger[_0xb30c('0xf')](_0xb30c('0x10'),_0x1d7b0b,_0x597b97[_0xb30c('0xf')][_0xb30c('0x11')]);return _0x49106f(_0x597b97[_0xb30c('0xf')]['message']);}logger[_0xb30c('0xf')]('Cdr,\x20%s,\x20%s',_0x1d7b0b,_0x597b97[_0xb30c('0xf')]['message']);return _0x42fac2(_0x597b97[_0xb30c('0xf')][_0xb30c('0x11')]);}else{logger[_0xb30c('0xd')](_0xb30c('0x10'),_0x1d7b0b,_0xb30c('0x12'));_0x42fac2(_0x597b97[_0xb30c('0x13')][_0xb30c('0x11')]);}})[_0xb30c('0x14')](function(_0x4a3234){logger[_0xb30c('0xf')](_0xb30c('0x10'),_0x1d7b0b,_0x4a3234);_0x49106f(_0x4a3234);});});}
\ No newline at end of file
+var _0xfa35=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4e0f30,_0x296fc5){var _0x3cb81d=function(_0x245df7){while(--_0x245df7){_0x4e0f30['push'](_0x4e0f30['shift']());}};_0x3cb81d(++_0x296fc5);}(_0xfa35,0x172));var _0x5fa3=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0xfa35[_0x2c2a8e];return _0x3b9e38;};'use strict';var _=require(_0x5fa3('0x0'));var util=require(_0x5fa3('0x1'));var moment=require('moment');var BPromise=require(_0x5fa3('0x2'));var rs=require(_0x5fa3('0x3'));var fs=require('fs');var Redis=require(_0x5fa3('0x4'));var db=require(_0x5fa3('0x5'))['db'];var utils=require(_0x5fa3('0x6'));var logger=require(_0x5fa3('0x7'))(_0x5fa3('0x8'));var config=require(_0x5fa3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5fa3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5334e0,_0x57ffd2,_0x5a272e){return new BPromise(function(_0x8ec117,_0x335f5f){return client[_0x5fa3('0xb')](_0x5334e0,_0x5a272e)[_0x5fa3('0xc')](function(_0x39dd8d){logger[_0x5fa3('0xd')](_0x5fa3('0xe'),_0x57ffd2,'request\x20sent');logger[_0x5fa3('0xf')](_0x5fa3('0x10'),_0x57ffd2,_0x5fa3('0x11'),JSON[_0x5fa3('0x12')](_0x39dd8d));if(_0x39dd8d[_0x5fa3('0x13')]){if(_0x39dd8d[_0x5fa3('0x13')][_0x5fa3('0x14')]===0x1f4){logger['error'](_0x5fa3('0xe'),_0x57ffd2,_0x39dd8d[_0x5fa3('0x13')]['message']);return _0x335f5f(_0x39dd8d[_0x5fa3('0x13')]['message']);}logger[_0x5fa3('0x13')](_0x5fa3('0xe'),_0x57ffd2,_0x39dd8d[_0x5fa3('0x13')][_0x5fa3('0x15')]);return _0x8ec117(_0x39dd8d[_0x5fa3('0x13')][_0x5fa3('0x15')]);}else{logger[_0x5fa3('0xd')]('Cdr,\x20%s,\x20%s',_0x57ffd2,_0x5fa3('0x11'));_0x8ec117(_0x39dd8d['result']['message']);}})[_0x5fa3('0x16')](function(_0x3bc77f){logger[_0x5fa3('0x13')]('Cdr,\x20%s,\x20%s',_0x57ffd2,_0x3bc77f);_0x335f5f(_0x3bc77f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index b45f22e..fdbcf7b 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 52296be..e6c06a9 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 _0x6ff1=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x66f589,_0x3a2588){var _0xb321ae=function(_0x208c6b){while(--_0x208c6b){_0x66f589['push'](_0x66f589['shift']());}};_0xb321ae(++_0x3a2588);}(_0x6ff1,0x74));var _0x16ff=function(_0x194a86,_0x5cf904){_0x194a86=_0x194a86-0x0;var _0x38a2f7=_0x6ff1[_0x194a86];return _0x38a2f7;};'use strict';var Sequelize=require(_0x16ff('0x0'));module['exports']={'priority':{'type':Sequelize[_0x16ff('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x16ff('0x2')],'allowNull':![],'defaultValue':_0x16ff('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x16ff('0x2')]},'interval':{'type':Sequelize[_0x16ff('0x2')],'defaultValue':_0x16ff('0x4')}};
\ No newline at end of file
+var _0x8055=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x4dc4d7,_0x39d190){var _0x1dc843=function(_0xf20cbc){while(--_0xf20cbc){_0x4dc4d7['push'](_0x4dc4d7['shift']());}};_0x1dc843(++_0x39d190);}(_0x8055,0x1aa));var _0x5805=function(_0x257b8b,_0x417c05){_0x257b8b=_0x257b8b-0x0;var _0x42097a=_0x8055[_0x257b8b];return _0x42097a;};'use strict';var Sequelize=require('sequelize');module[_0x5805('0x0')]={'priority':{'type':Sequelize[_0x5805('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5805('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5805('0x3')]()},'description':{'type':Sequelize[_0x5805('0x2')]},'interval':{'type':Sequelize[_0x5805('0x2')],'defaultValue':_0x5805('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index c4d5cad..17c7158 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 _0xcd60=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','then','body','find','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2fd686,_0x204b08){var _0x20fe03=function(_0x22b7e4){while(--_0x22b7e4){_0x2fd686['push'](_0x2fd686['shift']());}};_0x20fe03(++_0x204b08);}(_0xcd60,0xf0));var _0x0cd6=function(_0x156279,_0x340beb){_0x156279=_0x156279-0x0;var _0x3d9d66=_0xcd60[_0x156279];return _0x3d9d66;};'use strict';var emlformat=require(_0x0cd6('0x0'));var rimraf=require(_0x0cd6('0x1'));var zipdir=require(_0x0cd6('0x2'));var jsonpatch=require(_0x0cd6('0x3'));var rp=require(_0x0cd6('0x4'));var moment=require(_0x0cd6('0x5'));var BPromise=require(_0x0cd6('0x6'));var Mustache=require('mustache');var util=require(_0x0cd6('0x7'));var path=require(_0x0cd6('0x8'));var sox=require(_0x0cd6('0x9'));var csv=require(_0x0cd6('0xa'));var ejs=require(_0x0cd6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cd6('0xc'));var squel=require(_0x0cd6('0xd'));var crypto=require('crypto');var jsforce=require(_0x0cd6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0cd6('0xa'));var querystring=require(_0x0cd6('0xf'));var Papa=require(_0x0cd6('0x10'));var Redis=require(_0x0cd6('0x11'));var authService=require(_0x0cd6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0cd6('0x13'));var hardwareService=require(_0x0cd6('0x14'));var logger=require(_0x0cd6('0x15'))(_0x0cd6('0x16'));var utils=require(_0x0cd6('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0cd6('0x18'))['db'];function respondWithStatusCode(_0x327d41,_0x2750c9){_0x2750c9=_0x2750c9||0xcc;return function(_0x54c660){if(_0x54c660){return _0x327d41[_0x0cd6('0x19')](_0x2750c9);}return _0x327d41['status'](_0x2750c9)[_0x0cd6('0x1a')]();};}function respondWithResult(_0x259190,_0x134b64){_0x134b64=_0x134b64||0xc8;return function(_0x443290){if(_0x443290){return _0x259190[_0x0cd6('0x1b')](_0x134b64)[_0x0cd6('0x1c')](_0x443290);}};}function respondWithFilteredResult(_0xf6fdb3,_0x1efb4a){return function(_0x1727e5){if(_0x1727e5){var _0x364880=typeof _0x1efb4a[_0x0cd6('0x1d')]===_0x0cd6('0x1e')&&typeof _0x1efb4a[_0x0cd6('0x1f')]===_0x0cd6('0x1e');var _0x596a46=_0x1727e5[_0x0cd6('0x20')];var _0x202d73=_0x364880?0x0:_0x1efb4a['offset'];var _0x5c37ee=_0x364880?_0x1727e5['count']:_0x1efb4a[_0x0cd6('0x1d')]+_0x1efb4a['limit'];var _0x5bdd3f;if(_0x5c37ee>=_0x596a46){_0x5c37ee=_0x596a46;_0x5bdd3f=0xc8;}else{_0x5bdd3f=0xce;}_0xf6fdb3[_0x0cd6('0x1b')](_0x5bdd3f);return _0xf6fdb3['set'](_0x0cd6('0x21'),_0x202d73+'-'+_0x5c37ee+'/'+_0x596a46)[_0x0cd6('0x1c')](_0x1727e5);}return null;};}function patchUpdates(_0x1b29b1){return function(_0x1bb2d6){try{jsonpatch[_0x0cd6('0x22')](_0x1bb2d6,_0x1b29b1,!![]);}catch(_0x33b228){return BPromise[_0x0cd6('0x23')](_0x33b228);}return _0x1bb2d6[_0x0cd6('0x24')]();};}function saveUpdates(_0x5734a5,_0x643aa0){return function(_0x1488bf){if(_0x1488bf){return _0x1488bf[_0x0cd6('0x25')](_0x5734a5)['then'](function(_0x55f68f){return _0x55f68f;});}return null;};}function removeEntity(_0x5cacd5,_0x6689ab){return function(_0x5c8b8b){if(_0x5c8b8b){return _0x5c8b8b['destroy']()['then'](function(){_0x5cacd5['status'](0xcc)[_0x0cd6('0x1a')]();});}};}function handleEntityNotFound(_0x37ff86,_0x2a883a){return function(_0x304a09){if(!_0x304a09){_0x37ff86['sendStatus'](0x194);}return _0x304a09;};}function handleError(_0x55def9,_0x147d7e){_0x147d7e=_0x147d7e||0x1f4;return function(_0x47cd69){logger[_0x0cd6('0x26')](_0x47cd69[_0x0cd6('0x27')]);if(_0x47cd69[_0x0cd6('0x28')]){delete _0x47cd69[_0x0cd6('0x28')];}_0x55def9[_0x0cd6('0x1b')](_0x147d7e)[_0x0cd6('0x29')](_0x47cd69);};}exports[_0x0cd6('0x2a')]=function(_0x341cee,_0x90fa6d){var _0x72c358={'raw':!![],'where':{'id':_0x341cee[_0x0cd6('0x2b')]['id']}},_0x1cb053={};_0x1cb053[_0x0cd6('0x2c')]=_[_0x0cd6('0x2d')](db[_0x0cd6('0x2e')][_0x0cd6('0x2f')]);_0x1cb053['query']=_[_0x0cd6('0x2d')](_0x341cee[_0x0cd6('0x30')]);_0x1cb053[_0x0cd6('0x31')]=_[_0x0cd6('0x32')](_0x1cb053['model'],_0x1cb053[_0x0cd6('0x30')]);_0x72c358[_0x0cd6('0x33')]=_[_0x0cd6('0x32')](_0x1cb053[_0x0cd6('0x2c')],qs[_0x0cd6('0x34')](_0x341cee['query'][_0x0cd6('0x34')]));_0x72c358[_0x0cd6('0x33')]=_0x72c358[_0x0cd6('0x33')][_0x0cd6('0x35')]?_0x72c358[_0x0cd6('0x33')]:_0x1cb053['model'];if(_0x341cee[_0x0cd6('0x30')][_0x0cd6('0x36')]){_0x72c358['include']=[{'all':!![]}];}_0x72c358=_[_0x0cd6('0x37')]({},_0x72c358,_0x341cee[_0x0cd6('0x38')]);return db[_0x0cd6('0x2e')]['find'](_0x72c358)[_0x0cd6('0x39')](handleEntityNotFound(_0x90fa6d,null))[_0x0cd6('0x39')](respondWithResult(_0x90fa6d,null))['catch'](handleError(_0x90fa6d,null));};exports[_0x0cd6('0x25')]=function(_0x12bdb4,_0xf8ec39){if(_0x12bdb4['body']['id']){delete _0x12bdb4[_0x0cd6('0x3a')]['id'];}return db[_0x0cd6('0x2e')][_0x0cd6('0x3b')]({'where':{'id':_0x12bdb4['params']['id']}})[_0x0cd6('0x39')](handleEntityNotFound(_0xf8ec39,null))['then'](saveUpdates(_0x12bdb4[_0x0cd6('0x3a')],null))[_0x0cd6('0x39')](respondWithResult(_0xf8ec39,null))[_0x0cd6('0x3c')](handleError(_0xf8ec39,null));};exports['destroy']=function(_0x2ac6ab,_0x2ab84d){return db[_0x0cd6('0x2e')][_0x0cd6('0x3b')]({'where':{'id':_0x2ac6ab[_0x0cd6('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2ab84d,null))['then'](removeEntity(_0x2ab84d,null))[_0x0cd6('0x3c')](handleError(_0x2ab84d,null));};
\ No newline at end of file
+var _0xd139=['include','find','catch','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','filters','intersection','query','attributes','length','includeAll'];(function(_0x3ddd29,_0x26f096){var _0x34cb20=function(_0x6bbb15){while(--_0x6bbb15){_0x3ddd29['push'](_0x3ddd29['shift']());}};_0x34cb20(++_0x26f096);}(_0xd139,0x14e));var _0x9d13=function(_0x2fde33,_0x1e0652){_0x2fde33=_0x2fde33-0x0;var _0x4d2075=_0xd139[_0x2fde33];return _0x4d2075;};'use strict';var emlformat=require(_0x9d13('0x0'));var rimraf=require(_0x9d13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d13('0x2'));var moment=require(_0x9d13('0x3'));var BPromise=require(_0x9d13('0x4'));var Mustache=require(_0x9d13('0x5'));var util=require(_0x9d13('0x6'));var path=require(_0x9d13('0x7'));var sox=require(_0x9d13('0x8'));var csv=require('to-csv');var ejs=require(_0x9d13('0x9'));var fs=require('fs');var fs_extra=require(_0x9d13('0xa'));var _=require('lodash');var squel=require(_0x9d13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d13('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d13('0xd'));var Redis=require(_0x9d13('0xe'));var authService=require(_0x9d13('0xf'));var qs=require(_0x9d13('0x10'));var as=require(_0x9d13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d13('0x12'))(_0x9d13('0x13'));var utils=require(_0x9d13('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d13('0x15'))['db'];function respondWithStatusCode(_0x3933d1,_0x39020){_0x39020=_0x39020||0xcc;return function(_0x331fea){if(_0x331fea){return _0x3933d1[_0x9d13('0x16')](_0x39020);}return _0x3933d1['status'](_0x39020)['end']();};}function respondWithResult(_0x37607a,_0x43bf27){_0x43bf27=_0x43bf27||0xc8;return function(_0x2f5442){if(_0x2f5442){return _0x37607a[_0x9d13('0x17')](_0x43bf27)[_0x9d13('0x18')](_0x2f5442);}};}function respondWithFilteredResult(_0x1a2b65,_0x38f368){return function(_0x47bcd3){if(_0x47bcd3){var _0x3acfc1=typeof _0x38f368[_0x9d13('0x19')]===_0x9d13('0x1a')&&typeof _0x38f368[_0x9d13('0x1b')]===_0x9d13('0x1a');var _0x42d5a5=_0x47bcd3[_0x9d13('0x1c')];var _0x10aa89=_0x3acfc1?0x0:_0x38f368[_0x9d13('0x19')];var _0x2acb0b=_0x3acfc1?_0x47bcd3[_0x9d13('0x1c')]:_0x38f368[_0x9d13('0x19')]+_0x38f368[_0x9d13('0x1b')];var _0x4d6b9d;if(_0x2acb0b>=_0x42d5a5){_0x2acb0b=_0x42d5a5;_0x4d6b9d=0xc8;}else{_0x4d6b9d=0xce;}_0x1a2b65[_0x9d13('0x17')](_0x4d6b9d);return _0x1a2b65[_0x9d13('0x1d')](_0x9d13('0x1e'),_0x10aa89+'-'+_0x2acb0b+'/'+_0x42d5a5)[_0x9d13('0x18')](_0x47bcd3);}return null;};}function patchUpdates(_0x4e1425){return function(_0x48ce3d){try{jsonpatch['apply'](_0x48ce3d,_0x4e1425,!![]);}catch(_0x223ea5){return BPromise[_0x9d13('0x1f')](_0x223ea5);}return _0x48ce3d[_0x9d13('0x20')]();};}function saveUpdates(_0x1fefe4,_0x3971e0){return function(_0x3040e7){if(_0x3040e7){return _0x3040e7[_0x9d13('0x21')](_0x1fefe4)[_0x9d13('0x22')](function(_0x5d14c8){return _0x5d14c8;});}return null;};}function removeEntity(_0xb34817,_0xd5a981){return function(_0x22963f){if(_0x22963f){return _0x22963f[_0x9d13('0x23')]()['then'](function(){_0xb34817[_0x9d13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c673,_0xfaf587){return function(_0xe0c57){if(!_0xe0c57){_0x40c673[_0x9d13('0x16')](0x194);}return _0xe0c57;};}function handleError(_0x453536,_0x45a299){_0x45a299=_0x45a299||0x1f4;return function(_0x1c36e5){logger[_0x9d13('0x24')](_0x1c36e5['stack']);if(_0x1c36e5[_0x9d13('0x25')]){delete _0x1c36e5['name'];}_0x453536[_0x9d13('0x17')](_0x45a299)[_0x9d13('0x26')](_0x1c36e5);};}exports[_0x9d13('0x27')]=function(_0x1d9f56,_0x5ebfaf){var _0x23c91f={'raw':!![],'where':{'id':_0x1d9f56[_0x9d13('0x28')]['id']}},_0x441118={};_0x441118[_0x9d13('0x29')]=_[_0x9d13('0x2a')](db[_0x9d13('0x2b')][_0x9d13('0x2c')]);_0x441118['query']=_[_0x9d13('0x2a')](_0x1d9f56['query']);_0x441118[_0x9d13('0x2d')]=_[_0x9d13('0x2e')](_0x441118['model'],_0x441118[_0x9d13('0x2f')]);_0x23c91f[_0x9d13('0x30')]=_['intersection'](_0x441118['model'],qs['fields'](_0x1d9f56[_0x9d13('0x2f')]['fields']));_0x23c91f[_0x9d13('0x30')]=_0x23c91f[_0x9d13('0x30')][_0x9d13('0x31')]?_0x23c91f['attributes']:_0x441118[_0x9d13('0x29')];if(_0x1d9f56[_0x9d13('0x2f')][_0x9d13('0x32')]){_0x23c91f[_0x9d13('0x33')]=[{'all':!![]}];}_0x23c91f=_['merge']({},_0x23c91f,_0x1d9f56['options']);return db[_0x9d13('0x2b')][_0x9d13('0x34')](_0x23c91f)['then'](handleEntityNotFound(_0x5ebfaf,null))[_0x9d13('0x22')](respondWithResult(_0x5ebfaf,null))[_0x9d13('0x35')](handleError(_0x5ebfaf,null));};exports[_0x9d13('0x21')]=function(_0x96da64,_0x7f7a0f){if(_0x96da64[_0x9d13('0x36')]['id']){delete _0x96da64[_0x9d13('0x36')]['id'];}return db['ChatApplication'][_0x9d13('0x34')]({'where':{'id':_0x96da64['params']['id']}})['then'](handleEntityNotFound(_0x7f7a0f,null))['then'](saveUpdates(_0x96da64[_0x9d13('0x36')],null))[_0x9d13('0x22')](respondWithResult(_0x7f7a0f,null))[_0x9d13('0x35')](handleError(_0x7f7a0f,null));};exports[_0x9d13('0x23')]=function(_0x3467eb,_0x4b32d8){return db[_0x9d13('0x2b')][_0x9d13('0x34')]({'where':{'id':_0x3467eb[_0x9d13('0x28')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x4b32d8,null))[_0x9d13('0x22')](removeEntity(_0x4b32d8,null))[_0x9d13('0x35')](handleError(_0x4b32d8,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7f4f829..3e62332 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 _0x3512=['rimraf','../../config/environment','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x594ece,_0x2a1f27){var _0x471bc4=function(_0x31941c){while(--_0x31941c){_0x594ece['push'](_0x594ece['shift']());}};_0x471bc4(++_0x2a1f27);}(_0x3512,0x13b));var _0x2351=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3512[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x2351('0x0'));var logger=require(_0x2351('0x1'))(_0x2351('0x2'));var moment=require(_0x2351('0x3'));var BPromise=require(_0x2351('0x4'));var rp=require(_0x2351('0x5'));var fs=require('fs');var path=require(_0x2351('0x6'));var rimraf=require(_0x2351('0x7'));var config=require(_0x2351('0x8'));var attributes=require(_0x2351('0x9'));module['exports']=function(_0x23eaa0,_0x24ef90){return _0x23eaa0['define'](_0x2351('0xa'),attributes,{'tableName':_0x2351('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2351('0xc'),'collate':_0x2351('0xd')});};
\ No newline at end of file
+var _0x8cec=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1cd577,_0x180f2a){var _0x790837=function(_0x2cace5){while(--_0x2cace5){_0x1cd577['push'](_0x1cd577['shift']());}};_0x790837(++_0x180f2a);}(_0x8cec,0x104));var _0xc8ce=function(_0x44249e,_0x5a0e0c){_0x44249e=_0x44249e-0x0;var _0x333e30=_0x8cec[_0x44249e];return _0x333e30;};'use strict';var _=require(_0xc8ce('0x0'));var util=require('util');var logger=require(_0xc8ce('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc8ce('0x2'));var rp=require(_0xc8ce('0x3'));var fs=require('fs');var path=require(_0xc8ce('0x4'));var rimraf=require(_0xc8ce('0x5'));var config=require(_0xc8ce('0x6'));var attributes=require(_0xc8ce('0x7'));module[_0xc8ce('0x8')]=function(_0x8f677c,_0x4662bb){return _0x8f677c[_0xc8ce('0x9')](_0xc8ce('0xa'),attributes,{'tableName':_0xc8ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8ce('0xc'),'collate':_0xc8ce('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 804667b..c045186 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 _0xc8c4=['catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1aaef9,_0x25790e){var _0x2ce77f=function(_0x4910b6){while(--_0x4910b6){_0x1aaef9['push'](_0x1aaef9['shift']());}};_0x2ce77f(++_0x25790e);}(_0xc8c4,0x1b9));var _0x4c8c=function(_0x46ea77,_0x2fdae1){_0x46ea77=_0x46ea77-0x0;var _0x294b2b=_0xc8c4[_0x46ea77];return _0x294b2b;};'use strict';var _=require(_0x4c8c('0x0'));var util=require(_0x4c8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c8c('0x2'));var fs=require('fs');var Redis=require(_0x4c8c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c8c('0x4'));var logger=require(_0x4c8c('0x5'))(_0x4c8c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4c8c('0x7')][_0x4c8c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23cb9e,_0x13953c,_0x358a7c){return new BPromise(function(_0x303aaf,_0x135d05){return client[_0x4c8c('0x9')](_0x23cb9e,_0x358a7c)[_0x4c8c('0xa')](function(_0x51c58e){logger[_0x4c8c('0xb')](_0x4c8c('0xc'),_0x13953c,_0x4c8c('0xd'));logger[_0x4c8c('0xe')](_0x4c8c('0xf'),_0x13953c,_0x4c8c('0xd'),JSON['stringify'](_0x51c58e));if(_0x51c58e[_0x4c8c('0x10')]){if(_0x51c58e[_0x4c8c('0x10')][_0x4c8c('0x11')]===0x1f4){logger[_0x4c8c('0x10')](_0x4c8c('0xc'),_0x13953c,_0x51c58e[_0x4c8c('0x10')][_0x4c8c('0x12')]);return _0x135d05(_0x51c58e[_0x4c8c('0x10')][_0x4c8c('0x12')]);}logger[_0x4c8c('0x10')](_0x4c8c('0xc'),_0x13953c,_0x51c58e[_0x4c8c('0x10')][_0x4c8c('0x12')]);return _0x303aaf(_0x51c58e[_0x4c8c('0x10')][_0x4c8c('0x12')]);}else{logger['info'](_0x4c8c('0xc'),_0x13953c,_0x4c8c('0xd'));_0x303aaf(_0x51c58e['result']['message']);}})[_0x4c8c('0x13')](function(_0x45c006){logger[_0x4c8c('0x10')](_0x4c8c('0xc'),_0x13953c,_0x45c006);_0x135d05(_0x45c006);});});}
\ No newline at end of file
+var _0xbbe0=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x730dc0,_0x2ce9cc){var _0x96a727=function(_0x42bc3b){while(--_0x42bc3b){_0x730dc0['push'](_0x730dc0['shift']());}};_0x96a727(++_0x2ce9cc);}(_0xbbe0,0xc3));var _0x0bbe=function(_0x2dde57,_0x54ef96){_0x2dde57=_0x2dde57-0x0;var _0x2c74f2=_0xbbe0[_0x2dde57];return _0x2c74f2;};'use strict';var _=require(_0x0bbe('0x0'));var util=require('util');var moment=require(_0x0bbe('0x1'));var BPromise=require(_0x0bbe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bbe('0x3'));var db=require(_0x0bbe('0x4'))['db'];var utils=require(_0x0bbe('0x5'));var logger=require(_0x0bbe('0x6'))(_0x0bbe('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bbe('0x8')][_0x0bbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c48fb,_0x495008,_0x20ea37){return new BPromise(function(_0x4e344b,_0x13e967){return client[_0x0bbe('0xa')](_0x1c48fb,_0x20ea37)[_0x0bbe('0xb')](function(_0x42b625){logger[_0x0bbe('0xc')](_0x0bbe('0xd'),_0x495008,_0x0bbe('0xe'));logger[_0x0bbe('0xf')](_0x0bbe('0x10'),_0x495008,_0x0bbe('0xe'),JSON[_0x0bbe('0x11')](_0x42b625));if(_0x42b625[_0x0bbe('0x12')]){if(_0x42b625[_0x0bbe('0x12')][_0x0bbe('0x13')]===0x1f4){logger['error'](_0x0bbe('0xd'),_0x495008,_0x42b625[_0x0bbe('0x12')]['message']);return _0x13e967(_0x42b625[_0x0bbe('0x12')][_0x0bbe('0x14')]);}logger[_0x0bbe('0x12')](_0x0bbe('0xd'),_0x495008,_0x42b625['error']['message']);return _0x4e344b(_0x42b625[_0x0bbe('0x12')][_0x0bbe('0x14')]);}else{logger['info'](_0x0bbe('0xd'),_0x495008,_0x0bbe('0xe'));_0x4e344b(_0x42b625[_0x0bbe('0x15')][_0x0bbe('0x14')]);}})[_0x0bbe('0x16')](function(_0x38c835){logger[_0x0bbe('0x12')]('ChatApplication,\x20%s,\x20%s',_0x495008,_0x38c835);_0x13e967(_0x38c835);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 8095ea3..4029d8b 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 _0x0b2b=['show','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x0b2b,0xa8));var _0xb0b2=function(_0x3fdaec,_0x21b8d8){_0x3fdaec=_0x3fdaec-0x0;var _0x1d2dc8=_0x0b2b[_0x3fdaec];return _0x1d2dc8;};'use strict';var multer=require(_0xb0b2('0x0'));var util=require(_0xb0b2('0x1'));var path=require(_0xb0b2('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b2('0x3'));var router=express[_0xb0b2('0x4')]();var fs_extra=require(_0xb0b2('0x5'));var auth=require(_0xb0b2('0x6'));var interaction=require(_0xb0b2('0x7'));var config=require(_0xb0b2('0x8'));var controller=require(_0xb0b2('0x9'));router['get'](_0xb0b2('0xa'),auth[_0xb0b2('0xb')](),controller[_0xb0b2('0xc')]);router[_0xb0b2('0xd')](_0xb0b2('0xa'),auth['isAuthenticated'](),controller[_0xb0b2('0xe')]);router[_0xb0b2('0xf')](_0xb0b2('0xa'),auth[_0xb0b2('0xb')](),controller[_0xb0b2('0x10')]);module[_0xb0b2('0x11')]=router;
\ No newline at end of file
+var _0xd2ab=['./chatApplication.controller','/:id','show','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0xd2ab,0x78));var _0xbd2a=function(_0x308a44,_0x479628){_0x308a44=_0x308a44-0x0;var _0x567c52=_0xd2ab[_0x308a44];return _0x567c52;};'use strict';var multer=require(_0xbd2a('0x0'));var util=require(_0xbd2a('0x1'));var path=require(_0xbd2a('0x2'));var timeout=require(_0xbd2a('0x3'));var express=require(_0xbd2a('0x4'));var router=express[_0xbd2a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd2a('0x6'));var interaction=require(_0xbd2a('0x7'));var config=require('../../config/environment');var controller=require(_0xbd2a('0x8'));router['get'](_0xbd2a('0x9'),auth['isAuthenticated'](),controller[_0xbd2a('0xa')]);router[_0xbd2a('0xb')](_0xbd2a('0x9'),auth[_0xbd2a('0xc')](),controller[_0xbd2a('0xd')]);router['delete'](_0xbd2a('0x9'),auth[_0xbd2a('0xc')](),controller[_0xbd2a('0xe')]);module[_0xbd2a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index e0de98a..84aa386 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 _0xa151=['BOOLEAN','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa151,0x13d));var _0x1a15=function(_0x31d72e,_0x30b720){_0x31d72e=_0x31d72e-0x0;var _0x3b6795=_0xa151[_0x31d72e];return _0x3b6795;};'use strict';var Sequelize=require(_0x1a15('0x0'));module[_0x1a15('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1a15('0x2')]},'write':{'type':Sequelize[_0x1a15('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x02b6=['STRING','BOOLEAN','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x02b6,0xfe));var _0x602b=function(_0x4475b3,_0xf90028){_0x4475b3=_0x4475b3-0x0;var _0x1f06c7=_0x02b6[_0x4475b3];return _0x1f06c7;};'use strict';var Sequelize=require(_0x602b('0x0'));module['exports']={'name':{'type':Sequelize[_0x602b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x602b('0x1')]},'write':{'type':Sequelize[_0x602b('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 0c0e63f..88fbf0d 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 _0xd0f4=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','show','params','include','find','create','body','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','moment','util','path'];(function(_0x4e1a81,_0x4c3697){var _0x52ea72=function(_0x4cda82){while(--_0x4cda82){_0x4e1a81['push'](_0x4e1a81['shift']());}};_0x52ea72(++_0x4c3697);}(_0xd0f4,0x1b7));var _0x4d0f=function(_0x563a6c,_0x3220c2){_0x563a6c=_0x563a6c-0x0;var _0x58bafd=_0xd0f4[_0x563a6c];return _0x58bafd;};'use strict';var emlformat=require(_0x4d0f('0x0'));var rimraf=require(_0x4d0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d0f('0x2'));var moment=require(_0x4d0f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d0f('0x4'));var path=require(_0x4d0f('0x5'));var sox=require('sox');var csv=require(_0x4d0f('0x6'));var ejs=require(_0x4d0f('0x7'));var fs=require('fs');var fs_extra=require(_0x4d0f('0x8'));var _=require(_0x4d0f('0x9'));var squel=require(_0x4d0f('0xa'));var crypto=require('crypto');var jsforce=require(_0x4d0f('0xb'));var deskjs=require(_0x4d0f('0xc'));var toCsv=require(_0x4d0f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4d0f('0xd'));var as=require(_0x4d0f('0xe'));var hardwareService=require(_0x4d0f('0xf'));var logger=require(_0x4d0f('0x10'))(_0x4d0f('0x11'));var utils=require('../../config/utils');var config=require(_0x4d0f('0x12'));var licenseUtil=require(_0x4d0f('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4d0f('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4d0f('0x15'))(new Redis(config['redis']));require(_0x4d0f('0x16'))[_0x4d0f('0x17')](socket);function respondWithStatusCode(_0x100216,_0x4af127){_0x4af127=_0x4af127||0xcc;return function(_0x8954d9){if(_0x8954d9){return _0x100216['sendStatus'](_0x4af127);}return _0x100216[_0x4d0f('0x18')](_0x4af127)[_0x4d0f('0x19')]();};}function respondWithResult(_0x3c070d,_0x555da6){_0x555da6=_0x555da6||0xc8;return function(_0x2928e2){if(_0x2928e2){return _0x3c070d[_0x4d0f('0x18')](_0x555da6)[_0x4d0f('0x1a')](_0x2928e2);}};}function respondWithFilteredResult(_0x498454,_0x41efc6){return function(_0xe831d4){if(_0xe831d4){var _0x321d73=typeof _0x41efc6[_0x4d0f('0x1b')]===_0x4d0f('0x1c')&&typeof _0x41efc6[_0x4d0f('0x1d')]===_0x4d0f('0x1c');var _0x94150d=_0xe831d4[_0x4d0f('0x1e')];var _0x4cb1c6=_0x321d73?0x0:_0x41efc6['offset'];var _0xbd14bc=_0x321d73?_0xe831d4[_0x4d0f('0x1e')]:_0x41efc6[_0x4d0f('0x1b')]+_0x41efc6[_0x4d0f('0x1d')];var _0x36d0e3;if(_0xbd14bc>=_0x94150d){_0xbd14bc=_0x94150d;_0x36d0e3=0xc8;}else{_0x36d0e3=0xce;}_0x498454['status'](_0x36d0e3);return _0x498454[_0x4d0f('0x1f')](_0x4d0f('0x20'),_0x4cb1c6+'-'+_0xbd14bc+'/'+_0x94150d)[_0x4d0f('0x1a')](_0xe831d4);}return null;};}function patchUpdates(_0x498ecb){return function(_0x14259c){try{jsonpatch[_0x4d0f('0x21')](_0x14259c,_0x498ecb,!![]);}catch(_0x4bb2fd){return BPromise[_0x4d0f('0x22')](_0x4bb2fd);}return _0x14259c['save']();};}function saveUpdates(_0x5a57cd,_0x5562a4){return function(_0x5d7cde){if(_0x5d7cde){return _0x5d7cde[_0x4d0f('0x23')](_0x5a57cd)[_0x4d0f('0x24')](function(_0x560749){return _0x560749;});}return null;};}function removeEntity(_0x4aa291,_0x1c5eb2){return function(_0x389ba6){if(_0x389ba6){return _0x389ba6[_0x4d0f('0x25')]()[_0x4d0f('0x24')](function(){_0x4aa291[_0x4d0f('0x18')](0xcc)[_0x4d0f('0x19')]();});}};}function handleEntityNotFound(_0x379092,_0x4231c1){return function(_0x3f4348){if(!_0x3f4348){_0x379092[_0x4d0f('0x26')](0x194);}return _0x3f4348;};}function handleError(_0x3f3e71,_0x194823){_0x194823=_0x194823||0x1f4;return function(_0x4ad04e){logger[_0x4d0f('0x27')](_0x4ad04e[_0x4d0f('0x28')]);if(_0x4ad04e[_0x4d0f('0x29')]){delete _0x4ad04e['name'];}_0x3f3e71[_0x4d0f('0x18')](_0x194823)[_0x4d0f('0x2a')](_0x4ad04e);};}exports[_0x4d0f('0x2b')]=function(_0x216691,_0x4993fc){var _0x4ab5a7={},_0x55a712={},_0x4cefd8={'count':0x0,'rows':[]};var _0x4bedd8=_[_0x4d0f('0x2c')](db[_0x4d0f('0x2d')][_0x4d0f('0x2e')],function(_0x3fedec){return{'name':_0x3fedec['fieldName'],'type':_0x3fedec[_0x4d0f('0x2f')][_0x4d0f('0x30')]};});_0x55a712[_0x4d0f('0x31')]=_['map'](_0x4bedd8,_0x4d0f('0x29'));_0x55a712[_0x4d0f('0x32')]=_[_0x4d0f('0x33')](_0x216691[_0x4d0f('0x32')]);_0x55a712[_0x4d0f('0x34')]=_[_0x4d0f('0x35')](_0x55a712[_0x4d0f('0x31')],_0x55a712[_0x4d0f('0x32')]);_0x4ab5a7[_0x4d0f('0x36')]=_[_0x4d0f('0x35')](_0x55a712[_0x4d0f('0x31')],qs[_0x4d0f('0x37')](_0x216691[_0x4d0f('0x32')][_0x4d0f('0x37')]));_0x4ab5a7[_0x4d0f('0x36')]=_0x4ab5a7[_0x4d0f('0x36')][_0x4d0f('0x38')]?_0x4ab5a7[_0x4d0f('0x36')]:_0x55a712['model'];if(!_0x216691[_0x4d0f('0x32')]['hasOwnProperty'](_0x4d0f('0x39'))){_0x4ab5a7[_0x4d0f('0x1d')]=qs['limit'](_0x216691['query']['limit']);_0x4ab5a7['offset']=qs[_0x4d0f('0x1b')](_0x216691['query'][_0x4d0f('0x1b')]);}_0x4ab5a7[_0x4d0f('0x3a')]=qs[_0x4d0f('0x3b')](_0x216691['query']['sort']);_0x4ab5a7[_0x4d0f('0x3c')]=qs['filters'](_[_0x4d0f('0x3d')](_0x216691['query'],_0x55a712[_0x4d0f('0x34')]),_0x4bedd8);if(_0x216691[_0x4d0f('0x32')][_0x4d0f('0x3e')]){_0x4ab5a7['where']=_[_0x4d0f('0x3f')](_0x4ab5a7[_0x4d0f('0x3c')],{'$or':_[_0x4d0f('0x2c')](_0x4bedd8,function(_0x471029){if(_0x471029[_0x4d0f('0x2f')]!=='VIRTUAL'){var _0x349470={};_0x349470[_0x471029[_0x4d0f('0x29')]]={'$like':'%'+_0x216691[_0x4d0f('0x32')][_0x4d0f('0x3e')]+'%'};return _0x349470;}})});}_0x4ab5a7=_[_0x4d0f('0x3f')]({},_0x4ab5a7,_0x216691[_0x4d0f('0x40')]);var _0x3f34e9={'where':_0x4ab5a7[_0x4d0f('0x3c')]};return db[_0x4d0f('0x2d')][_0x4d0f('0x1e')](_0x3f34e9)[_0x4d0f('0x24')](function(_0x1c0359){_0x4cefd8['count']=_0x1c0359;if(_0x216691[_0x4d0f('0x32')][_0x4d0f('0x41')]){_0x4ab5a7['include']=[{'all':!![]}];}return db[_0x4d0f('0x2d')]['findAll'](_0x4ab5a7);})[_0x4d0f('0x24')](function(_0xce71cb){_0x4cefd8['rows']=_0xce71cb;return _0x4cefd8;})[_0x4d0f('0x24')](respondWithFilteredResult(_0x4993fc,_0x4ab5a7))[_0x4d0f('0x42')](handleError(_0x4993fc,null));};exports[_0x4d0f('0x43')]=function(_0x4c7c49,_0x95ea85){var _0x4d579c={'raw':!![],'where':{'id':_0x4c7c49[_0x4d0f('0x44')]['id']}},_0x49862a={};_0x49862a['model']=_[_0x4d0f('0x33')](db[_0x4d0f('0x2d')][_0x4d0f('0x2e')]);_0x49862a[_0x4d0f('0x32')]=_[_0x4d0f('0x33')](_0x4c7c49[_0x4d0f('0x32')]);_0x49862a[_0x4d0f('0x34')]=_['intersection'](_0x49862a[_0x4d0f('0x31')],_0x49862a[_0x4d0f('0x32')]);_0x4d579c[_0x4d0f('0x36')]=_[_0x4d0f('0x35')](_0x49862a[_0x4d0f('0x31')],qs['fields'](_0x4c7c49['query'][_0x4d0f('0x37')]));_0x4d579c[_0x4d0f('0x36')]=_0x4d579c[_0x4d0f('0x36')][_0x4d0f('0x38')]?_0x4d579c[_0x4d0f('0x36')]:_0x49862a['model'];if(_0x4c7c49['query'][_0x4d0f('0x41')]){_0x4d579c[_0x4d0f('0x45')]=[{'all':!![]}];}_0x4d579c=_[_0x4d0f('0x3f')]({},_0x4d579c,_0x4c7c49['options']);return db[_0x4d0f('0x2d')][_0x4d0f('0x46')](_0x4d579c)[_0x4d0f('0x24')](handleEntityNotFound(_0x95ea85,null))[_0x4d0f('0x24')](respondWithResult(_0x95ea85,null))[_0x4d0f('0x42')](handleError(_0x95ea85,null));};exports[_0x4d0f('0x47')]=function(_0x2fcf8e,_0x1bde92){return db[_0x4d0f('0x2d')]['create'](_0x2fcf8e[_0x4d0f('0x48')],{})[_0x4d0f('0x24')](respondWithResult(_0x1bde92,0xc9))[_0x4d0f('0x42')](handleError(_0x1bde92,null));};exports[_0x4d0f('0x23')]=function(_0x3a163f,_0x3923d7){if(_0x3a163f[_0x4d0f('0x48')]['id']){delete _0x3a163f[_0x4d0f('0x48')]['id'];}return db[_0x4d0f('0x2d')][_0x4d0f('0x46')]({'where':{'id':_0x3a163f[_0x4d0f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3923d7,null))['then'](saveUpdates(_0x3a163f['body'],null))['then'](respondWithResult(_0x3923d7,null))[_0x4d0f('0x42')](handleError(_0x3923d7,null));};exports[_0x4d0f('0x25')]=function(_0x2f8d70,_0x143630){return db[_0x4d0f('0x2d')][_0x4d0f('0x46')]({'where':{'id':_0x2f8d70[_0x4d0f('0x44')]['id']}})['then'](handleEntityNotFound(_0x143630,null))[_0x4d0f('0x24')](removeEntity(_0x143630,null))[_0x4d0f('0x42')](handleError(_0x143630,null));};exports[_0x4d0f('0x49')]=function(_0x491bd5,_0x58106c){return db[_0x4d0f('0x2d')][_0x4d0f('0x49')]()['then'](respondWithResult(_0x58106c,null))[_0x4d0f('0x42')](handleError(_0x58106c,null));};exports['getUnread']=function(_0x17680e,_0x5eceea,_0x5c3586){return db['ChatInternalMessage'][_0x4d0f('0x1e')]({'where':{'ChatGroupId':_0x17680e[_0x4d0f('0x44')]['id'],'ToId':_0x17680e[_0x4d0f('0x4a')]['id'],'read':![]}})[_0x4d0f('0x24')](function(_0x47eaaa){return{'id':_[_0x4d0f('0x4b')](_0x17680e[_0x4d0f('0x44')]['id']),'count':_0x47eaaa};})[_0x4d0f('0x24')](respondWithResult(_0x5eceea,null))['catch'](handleError(_0x5eceea,null));};exports[_0x4d0f('0x4c')]=function(_0x487b4d,_0x3e983f,_0xea2ba7){return db[_0x4d0f('0x2d')]['find']({'where':{'id':_0x487b4d['params']['id']}})['then'](handleEntityNotFound(_0x3e983f,null))[_0x4d0f('0x24')](function(_0x5ee124){if(_0x5ee124){return _0x5ee124['addMembers'](_0x487b4d[_0x4d0f('0x48')][_0x4d0f('0x4d')],_[_0x4d0f('0x4e')](_0x487b4d[_0x4d0f('0x48')],['ids','id'])||{});}})[_0x4d0f('0x24')](respondWithResult(_0x3e983f,null))[_0x4d0f('0x42')](handleError(_0x3e983f,null));};exports[_0x4d0f('0x4f')]=function(_0x49c76f,_0x173c64,_0x385ba6){var _0x22ed56={};var _0x4e7a93={};var _0x54e63e;var _0x417ac3;return db[_0x4d0f('0x2d')][_0x4d0f('0x50')]({'where':{'id':_0x49c76f[_0x4d0f('0x44')]['id']}})[_0x4d0f('0x24')](handleEntityNotFound(_0x173c64,null))[_0x4d0f('0x24')](function(_0x51f2f8){if(_0x51f2f8){_0x54e63e=_0x51f2f8;_0x4e7a93['model']=_[_0x4d0f('0x33')](db[_0x4d0f('0x51')][_0x4d0f('0x2e')]);_0x4e7a93[_0x4d0f('0x32')]=_[_0x4d0f('0x33')](_0x49c76f['query']);_0x4e7a93[_0x4d0f('0x34')]=_[_0x4d0f('0x35')](_0x4e7a93[_0x4d0f('0x31')],_0x4e7a93[_0x4d0f('0x32')]);_0x22ed56[_0x4d0f('0x36')]=_[_0x4d0f('0x35')](_0x4e7a93[_0x4d0f('0x31')],qs['fields'](_0x49c76f[_0x4d0f('0x32')][_0x4d0f('0x37')]));_0x22ed56['attributes']=_0x22ed56[_0x4d0f('0x36')][_0x4d0f('0x38')]?_0x22ed56['attributes']:_0x4e7a93[_0x4d0f('0x31')];_0x22ed56['order']=qs['sort'](_0x49c76f[_0x4d0f('0x32')][_0x4d0f('0x3b')]);_0x22ed56[_0x4d0f('0x3c')]=qs[_0x4d0f('0x34')](_[_0x4d0f('0x3d')](_0x49c76f[_0x4d0f('0x32')],_0x4e7a93[_0x4d0f('0x34')]));if(_0x49c76f['query'][_0x4d0f('0x3e')]){_0x22ed56[_0x4d0f('0x3c')]=_[_0x4d0f('0x3f')](_0x22ed56[_0x4d0f('0x3c')],{'$or':_['map'](_0x22ed56[_0x4d0f('0x36')],function(_0xb751da){var _0x1e5b0d={};_0x1e5b0d[_0xb751da]={'$like':'%'+_0x49c76f[_0x4d0f('0x32')][_0x4d0f('0x3e')]+'%'};return _0x1e5b0d;})});}_0x22ed56=_[_0x4d0f('0x3f')]({},_0x22ed56,_0x49c76f[_0x4d0f('0x40')]);return _0x54e63e[_0x4d0f('0x4f')](_0x22ed56);}})[_0x4d0f('0x24')](function(_0x3aa99b){if(_0x3aa99b){_0x417ac3=_0x3aa99b[_0x4d0f('0x38')];if(!_0x49c76f[_0x4d0f('0x32')][_0x4d0f('0x52')](_0x4d0f('0x39'))){_0x22ed56[_0x4d0f('0x1d')]=qs[_0x4d0f('0x1d')](_0x49c76f[_0x4d0f('0x32')][_0x4d0f('0x1d')]);_0x22ed56[_0x4d0f('0x1b')]=qs[_0x4d0f('0x1b')](_0x49c76f['query']['offset']);}return _0x54e63e['getMembers'](_0x22ed56);}})[_0x4d0f('0x24')](function(_0x4f83d1){if(_0x4f83d1){return _0x4f83d1?{'count':_0x417ac3,'rows':_0x4f83d1}:null;}})['then'](respondWithResult(_0x173c64,null))[_0x4d0f('0x42')](handleError(_0x173c64,null));};exports[_0x4d0f('0x53')]=function(_0x26370c,_0x1e69bd,_0x22cfdf){return db['ChatGroup']['find']({'where':{'id':_0x26370c[_0x4d0f('0x44')]['id']}})[_0x4d0f('0x24')](handleEntityNotFound(_0x1e69bd,null))[_0x4d0f('0x24')](function(_0x38c803){if(_0x38c803){return _0x38c803[_0x4d0f('0x53')](_0x26370c['query'][_0x4d0f('0x4d')]);}})[_0x4d0f('0x24')](respondWithStatusCode(_0x1e69bd,null))[_0x4d0f('0x42')](handleError(_0x1e69bd,null));};exports['addMessage']=function(_0x3464f1,_0x2cf148,_0x5cbfb8){if(_0x3464f1[_0x4d0f('0x48')]['id']){delete _0x3464f1[_0x4d0f('0x48')]['id'];}return db[_0x4d0f('0x2d')]['find']({'where':{'id':_0x3464f1[_0x4d0f('0x44')]['id']}})[_0x4d0f('0x24')](handleEntityNotFound(_0x2cf148,null))['then'](function(_0x537ad7){if(_0x537ad7){_0x3464f1[_0x4d0f('0x48')]['ChatGroupId']=_0x537ad7['id'];return db[_0x4d0f('0x54')][_0x4d0f('0x47')](_0x3464f1[_0x4d0f('0x48')]);}})[_0x4d0f('0x24')](respondWithResult(_0x2cf148,null))['catch'](handleError(_0x2cf148,null));};exports[_0x4d0f('0x55')]=function(_0x4bdf10,_0x37b700,_0x2eaebb){var _0x516a28={};var _0x19de27={};var _0x19ce39;var _0x2531e0;return db[_0x4d0f('0x2d')]['findOne']({'where':{'id':_0x4bdf10['params']['id']}})[_0x4d0f('0x24')](handleEntityNotFound(_0x37b700,null))['then'](function(_0x11765b){if(_0x11765b){_0x19ce39=_0x11765b;_0x19de27[_0x4d0f('0x31')]=_[_0x4d0f('0x33')](db[_0x4d0f('0x54')][_0x4d0f('0x2e')]);_0x19de27[_0x4d0f('0x32')]=_[_0x4d0f('0x33')](_0x4bdf10['query']);_0x19de27[_0x4d0f('0x34')]=_[_0x4d0f('0x35')](_0x19de27[_0x4d0f('0x31')],_0x19de27[_0x4d0f('0x32')]);_0x516a28[_0x4d0f('0x36')]=_[_0x4d0f('0x35')](_0x19de27[_0x4d0f('0x31')],qs[_0x4d0f('0x37')](_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x37')]));_0x516a28['attributes']=_0x516a28[_0x4d0f('0x36')][_0x4d0f('0x38')]?_0x516a28[_0x4d0f('0x36')]:_0x19de27[_0x4d0f('0x31')];_0x516a28[_0x4d0f('0x3a')]=qs[_0x4d0f('0x3b')](_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x3b')]);_0x516a28[_0x4d0f('0x3c')]=qs['filters'](_['pick'](_0x4bdf10[_0x4d0f('0x32')],_0x19de27['filters']));if(_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x3e')]){_0x516a28[_0x4d0f('0x3c')]=_[_0x4d0f('0x3f')](_0x516a28[_0x4d0f('0x3c')],{'$or':_[_0x4d0f('0x2c')](_0x516a28[_0x4d0f('0x36')],function(_0x5cda81){var _0x5ab47b={};_0x5ab47b[_0x5cda81]={'$like':'%'+_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x3e')]+'%'};return _0x5ab47b;})});}if(_0x4bdf10[_0x4d0f('0x32')]['$gte']){var _0x21e315=_0x4bdf10['query'][_0x4d0f('0x56')][_0x4d0f('0x57')](',');var _0x479210={};_0x479210[_0x21e315[0x0]]={'$gte':moment(_0x21e315[0x1])['format'](_0x4d0f('0x58'))};_0x516a28[_0x4d0f('0x3c')]=_[_0x4d0f('0x3f')](_0x516a28[_0x4d0f('0x3c')],_0x479210);}_0x516a28=_[_0x4d0f('0x3f')]({},_0x516a28,_0x4bdf10['options']);return _0x19ce39[_0x4d0f('0x55')](_0x516a28);}})[_0x4d0f('0x24')](function(_0x1de09b){if(_0x1de09b){_0x2531e0=_0x1de09b[_0x4d0f('0x38')];if(!_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x52')]('nolimit')){_0x516a28[_0x4d0f('0x1d')]=qs['limit'](_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x1d')]);_0x516a28['offset']=qs[_0x4d0f('0x1b')](_0x4bdf10[_0x4d0f('0x32')][_0x4d0f('0x1b')]);}return _0x19ce39[_0x4d0f('0x55')](_0x516a28);}})['then'](function(_0x5440c4){if(_0x5440c4){return _0x5440c4?{'count':_0x2531e0,'rows':_0x5440c4}:null;}})[_0x4d0f('0x24')](respondWithResult(_0x37b700,null))['catch'](handleError(_0x37b700,null));};
\ No newline at end of file
+var _0x12dd=['include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','length','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','error','send','index','map','fieldName','type','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','name','options','ChatGroup','includeAll'];(function(_0x231146,_0x561e18){var _0x562350=function(_0x21d5ed){while(--_0x21d5ed){_0x231146['push'](_0x231146['shift']());}};_0x562350(++_0x561e18);}(_0x12dd,0x14b));var _0xd12d=function(_0x446414,_0x166ce3){_0x446414=_0x446414-0x0;var _0x3bbeac=_0x12dd[_0x446414];return _0x3bbeac;};'use strict';var emlformat=require(_0xd12d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd12d('0x1'));var jsonpatch=require(_0xd12d('0x2'));var rp=require(_0xd12d('0x3'));var moment=require(_0xd12d('0x4'));var BPromise=require(_0xd12d('0x5'));var Mustache=require(_0xd12d('0x6'));var util=require('util');var path=require(_0xd12d('0x7'));var sox=require(_0xd12d('0x8'));var csv=require('to-csv');var ejs=require(_0xd12d('0x9'));var fs=require('fs');var fs_extra=require(_0xd12d('0xa'));var _=require(_0xd12d('0xb'));var squel=require(_0xd12d('0xc'));var crypto=require(_0xd12d('0xd'));var jsforce=require(_0xd12d('0xe'));var deskjs=require(_0xd12d('0xf'));var toCsv=require(_0xd12d('0x10'));var querystring=require('querystring');var Papa=require(_0xd12d('0x11'));var Redis=require(_0xd12d('0x12'));var authService=require(_0xd12d('0x13'));var qs=require(_0xd12d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd12d('0x15'));var logger=require(_0xd12d('0x16'))(_0xd12d('0x17'));var utils=require(_0xd12d('0x18'));var config=require(_0xd12d('0x19'));var licenseUtil=require(_0xd12d('0x1a'));var db=require(_0xd12d('0x1b'))['db'];config[_0xd12d('0x1c')]=_['defaults'](config[_0xd12d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xd12d('0x1d'))(new Redis(config[_0xd12d('0x1c')]));require(_0xd12d('0x1e'))[_0xd12d('0x1f')](socket);function respondWithStatusCode(_0x20cd55,_0x52b175){_0x52b175=_0x52b175||0xcc;return function(_0xc34984){if(_0xc34984){return _0x20cd55[_0xd12d('0x20')](_0x52b175);}return _0x20cd55[_0xd12d('0x21')](_0x52b175)[_0xd12d('0x22')]();};}function respondWithResult(_0x543be4,_0x535561){_0x535561=_0x535561||0xc8;return function(_0x191e05){if(_0x191e05){return _0x543be4[_0xd12d('0x21')](_0x535561)[_0xd12d('0x23')](_0x191e05);}};}function respondWithFilteredResult(_0x3ed8da,_0x2f3c0e){return function(_0x19f0f6){if(_0x19f0f6){var _0x546c37=typeof _0x2f3c0e[_0xd12d('0x24')]===_0xd12d('0x25')&&typeof _0x2f3c0e['limit']===_0xd12d('0x25');var _0x5ea3af=_0x19f0f6[_0xd12d('0x26')];var _0x301c84=_0x546c37?0x0:_0x2f3c0e[_0xd12d('0x24')];var _0x58ec9b=_0x546c37?_0x19f0f6[_0xd12d('0x26')]:_0x2f3c0e[_0xd12d('0x24')]+_0x2f3c0e[_0xd12d('0x27')];var _0xc6262;if(_0x58ec9b>=_0x5ea3af){_0x58ec9b=_0x5ea3af;_0xc6262=0xc8;}else{_0xc6262=0xce;}_0x3ed8da['status'](_0xc6262);return _0x3ed8da[_0xd12d('0x28')](_0xd12d('0x29'),_0x301c84+'-'+_0x58ec9b+'/'+_0x5ea3af)['json'](_0x19f0f6);}return null;};}function patchUpdates(_0x44aa31){return function(_0x31a39b){try{jsonpatch['apply'](_0x31a39b,_0x44aa31,!![]);}catch(_0x33d0b4){return BPromise[_0xd12d('0x2a')](_0x33d0b4);}return _0x31a39b[_0xd12d('0x2b')]();};}function saveUpdates(_0x4c70ef,_0x3ab3c3){return function(_0x289fce){if(_0x289fce){return _0x289fce['update'](_0x4c70ef)[_0xd12d('0x2c')](function(_0xd2fd2e){return _0xd2fd2e;});}return null;};}function removeEntity(_0x375358,_0x13a5df){return function(_0x132015){if(_0x132015){return _0x132015[_0xd12d('0x2d')]()['then'](function(){_0x375358[_0xd12d('0x21')](0xcc)[_0xd12d('0x22')]();});}};}function handleEntityNotFound(_0x34377d,_0x881470){return function(_0x7e9a4a){if(!_0x7e9a4a){_0x34377d['sendStatus'](0x194);}return _0x7e9a4a;};}function handleError(_0x22e811,_0x36f462){_0x36f462=_0x36f462||0x1f4;return function(_0x90cfdc){logger[_0xd12d('0x2e')](_0x90cfdc['stack']);if(_0x90cfdc['name']){delete _0x90cfdc['name'];}_0x22e811[_0xd12d('0x21')](_0x36f462)[_0xd12d('0x2f')](_0x90cfdc);};}exports[_0xd12d('0x30')]=function(_0x3a8e45,_0x33fa64){var _0x16b154={},_0x5a98cc={},_0x563add={'count':0x0,'rows':[]};var _0x2df34e=_[_0xd12d('0x31')](db['ChatGroup']['rawAttributes'],function(_0x4b5275){return{'name':_0x4b5275[_0xd12d('0x32')],'type':_0x4b5275[_0xd12d('0x33')]['key']};});_0x5a98cc[_0xd12d('0x34')]=_[_0xd12d('0x31')](_0x2df34e,'name');_0x5a98cc['query']=_[_0xd12d('0x35')](_0x3a8e45[_0xd12d('0x36')]);_0x5a98cc['filters']=_[_0xd12d('0x37')](_0x5a98cc[_0xd12d('0x34')],_0x5a98cc[_0xd12d('0x36')]);_0x16b154[_0xd12d('0x38')]=_[_0xd12d('0x37')](_0x5a98cc[_0xd12d('0x34')],qs[_0xd12d('0x39')](_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x39')]));_0x16b154[_0xd12d('0x38')]=_0x16b154[_0xd12d('0x38')]['length']?_0x16b154[_0xd12d('0x38')]:_0x5a98cc[_0xd12d('0x34')];if(!_0x3a8e45[_0xd12d('0x36')]['hasOwnProperty'](_0xd12d('0x3a'))){_0x16b154[_0xd12d('0x27')]=qs[_0xd12d('0x27')](_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x27')]);_0x16b154['offset']=qs[_0xd12d('0x24')](_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x24')]);}_0x16b154[_0xd12d('0x3b')]=qs[_0xd12d('0x3c')](_0x3a8e45[_0xd12d('0x36')]['sort']);_0x16b154[_0xd12d('0x3d')]=qs[_0xd12d('0x3e')](_['pick'](_0x3a8e45[_0xd12d('0x36')],_0x5a98cc[_0xd12d('0x3e')]),_0x2df34e);if(_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x3f')]){_0x16b154['where']=_[_0xd12d('0x40')](_0x16b154[_0xd12d('0x3d')],{'$or':_['map'](_0x2df34e,function(_0x1f1e6c){if(_0x1f1e6c[_0xd12d('0x33')]!=='VIRTUAL'){var _0x356bf7={};_0x356bf7[_0x1f1e6c[_0xd12d('0x41')]]={'$like':'%'+_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x3f')]+'%'};return _0x356bf7;}})});}_0x16b154=_[_0xd12d('0x40')]({},_0x16b154,_0x3a8e45[_0xd12d('0x42')]);var _0xf4ecca={'where':_0x16b154['where']};return db[_0xd12d('0x43')][_0xd12d('0x26')](_0xf4ecca)['then'](function(_0x109e55){_0x563add[_0xd12d('0x26')]=_0x109e55;if(_0x3a8e45[_0xd12d('0x36')][_0xd12d('0x44')]){_0x16b154[_0xd12d('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0xd12d('0x46')](_0x16b154);})[_0xd12d('0x2c')](function(_0x272984){_0x563add[_0xd12d('0x47')]=_0x272984;return _0x563add;})[_0xd12d('0x2c')](respondWithFilteredResult(_0x33fa64,_0x16b154))[_0xd12d('0x48')](handleError(_0x33fa64,null));};exports[_0xd12d('0x49')]=function(_0x1b24e0,_0x2c0f0c){var _0x1cabec={'raw':!![],'where':{'id':_0x1b24e0['params']['id']}},_0x1967ad={};_0x1967ad[_0xd12d('0x34')]=_[_0xd12d('0x35')](db['ChatGroup'][_0xd12d('0x4a')]);_0x1967ad['query']=_[_0xd12d('0x35')](_0x1b24e0[_0xd12d('0x36')]);_0x1967ad[_0xd12d('0x3e')]=_['intersection'](_0x1967ad['model'],_0x1967ad[_0xd12d('0x36')]);_0x1cabec['attributes']=_['intersection'](_0x1967ad[_0xd12d('0x34')],qs['fields'](_0x1b24e0[_0xd12d('0x36')][_0xd12d('0x39')]));_0x1cabec[_0xd12d('0x38')]=_0x1cabec['attributes']['length']?_0x1cabec['attributes']:_0x1967ad[_0xd12d('0x34')];if(_0x1b24e0['query'][_0xd12d('0x44')]){_0x1cabec['include']=[{'all':!![]}];}_0x1cabec=_[_0xd12d('0x40')]({},_0x1cabec,_0x1b24e0['options']);return db[_0xd12d('0x43')][_0xd12d('0x4b')](_0x1cabec)[_0xd12d('0x2c')](handleEntityNotFound(_0x2c0f0c,null))[_0xd12d('0x2c')](respondWithResult(_0x2c0f0c,null))[_0xd12d('0x48')](handleError(_0x2c0f0c,null));};exports['create']=function(_0x2e9f86,_0x33fb0d){return db['ChatGroup'][_0xd12d('0x4c')](_0x2e9f86['body'],{})[_0xd12d('0x2c')](respondWithResult(_0x33fb0d,0xc9))[_0xd12d('0x48')](handleError(_0x33fb0d,null));};exports[_0xd12d('0x4d')]=function(_0x6246a7,_0x527ee4){if(_0x6246a7[_0xd12d('0x4e')]['id']){delete _0x6246a7['body']['id'];}return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x6246a7['params']['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x527ee4,null))[_0xd12d('0x2c')](saveUpdates(_0x6246a7[_0xd12d('0x4e')],null))['then'](respondWithResult(_0x527ee4,null))[_0xd12d('0x48')](handleError(_0x527ee4,null));};exports[_0xd12d('0x2d')]=function(_0x2bf44e,_0x1f7de2){return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x2bf44e[_0xd12d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1f7de2,null))['then'](removeEntity(_0x1f7de2,null))[_0xd12d('0x48')](handleError(_0x1f7de2,null));};exports[_0xd12d('0x50')]=function(_0xdf029,_0x47e46d){return db[_0xd12d('0x43')]['describe']()[_0xd12d('0x2c')](respondWithResult(_0x47e46d,null))[_0xd12d('0x48')](handleError(_0x47e46d,null));};exports['getUnread']=function(_0xf1663f,_0x5cae69,_0x7aff96){return db[_0xd12d('0x51')][_0xd12d('0x26')]({'where':{'ChatGroupId':_0xf1663f[_0xd12d('0x4f')]['id'],'ToId':_0xf1663f[_0xd12d('0x52')]['id'],'read':![]}})[_0xd12d('0x2c')](function(_0x3c5baa){return{'id':_[_0xd12d('0x53')](_0xf1663f[_0xd12d('0x4f')]['id']),'count':_0x3c5baa};})[_0xd12d('0x2c')](respondWithResult(_0x5cae69,null))['catch'](handleError(_0x5cae69,null));};exports[_0xd12d('0x54')]=function(_0x34f8c4,_0x484781,_0x38d671){return db['ChatGroup'][_0xd12d('0x4b')]({'where':{'id':_0x34f8c4[_0xd12d('0x4f')]['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x484781,null))['then'](function(_0x5c8ad4){if(_0x5c8ad4){return _0x5c8ad4[_0xd12d('0x54')](_0x34f8c4[_0xd12d('0x4e')][_0xd12d('0x55')],_[_0xd12d('0x56')](_0x34f8c4[_0xd12d('0x4e')],['ids','id'])||{});}})[_0xd12d('0x2c')](respondWithResult(_0x484781,null))['catch'](handleError(_0x484781,null));};exports['getMembers']=function(_0x122fae,_0x5b6e09,_0x3b9e8d){var _0x1d1648={};var _0xd11b81={};var _0x4cc63d;var _0x34b1e5;return db[_0xd12d('0x43')][_0xd12d('0x57')]({'where':{'id':_0x122fae['params']['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x5b6e09,null))[_0xd12d('0x2c')](function(_0x57fed0){if(_0x57fed0){_0x4cc63d=_0x57fed0;_0xd11b81['model']=_['keys'](db[_0xd12d('0x58')][_0xd12d('0x4a')]);_0xd11b81[_0xd12d('0x36')]=_[_0xd12d('0x35')](_0x122fae[_0xd12d('0x36')]);_0xd11b81[_0xd12d('0x3e')]=_[_0xd12d('0x37')](_0xd11b81[_0xd12d('0x34')],_0xd11b81[_0xd12d('0x36')]);_0x1d1648[_0xd12d('0x38')]=_[_0xd12d('0x37')](_0xd11b81[_0xd12d('0x34')],qs[_0xd12d('0x39')](_0x122fae[_0xd12d('0x36')][_0xd12d('0x39')]));_0x1d1648[_0xd12d('0x38')]=_0x1d1648[_0xd12d('0x38')]['length']?_0x1d1648[_0xd12d('0x38')]:_0xd11b81[_0xd12d('0x34')];_0x1d1648[_0xd12d('0x3b')]=qs['sort'](_0x122fae['query'][_0xd12d('0x3c')]);_0x1d1648[_0xd12d('0x3d')]=qs[_0xd12d('0x3e')](_[_0xd12d('0x59')](_0x122fae[_0xd12d('0x36')],_0xd11b81[_0xd12d('0x3e')]));if(_0x122fae[_0xd12d('0x36')]['filter']){_0x1d1648[_0xd12d('0x3d')]=_[_0xd12d('0x40')](_0x1d1648[_0xd12d('0x3d')],{'$or':_[_0xd12d('0x31')](_0x1d1648[_0xd12d('0x38')],function(_0x792ff){var _0x124074={};_0x124074[_0x792ff]={'$like':'%'+_0x122fae[_0xd12d('0x36')][_0xd12d('0x3f')]+'%'};return _0x124074;})});}_0x1d1648=_[_0xd12d('0x40')]({},_0x1d1648,_0x122fae[_0xd12d('0x42')]);return _0x4cc63d[_0xd12d('0x5a')](_0x1d1648);}})[_0xd12d('0x2c')](function(_0x6b954e){if(_0x6b954e){_0x34b1e5=_0x6b954e[_0xd12d('0x5b')];if(!_0x122fae[_0xd12d('0x36')][_0xd12d('0x5c')](_0xd12d('0x3a'))){_0x1d1648[_0xd12d('0x27')]=qs['limit'](_0x122fae[_0xd12d('0x36')][_0xd12d('0x27')]);_0x1d1648[_0xd12d('0x24')]=qs[_0xd12d('0x24')](_0x122fae['query'][_0xd12d('0x24')]);}return _0x4cc63d[_0xd12d('0x5a')](_0x1d1648);}})[_0xd12d('0x2c')](function(_0x4a4843){if(_0x4a4843){return _0x4a4843?{'count':_0x34b1e5,'rows':_0x4a4843}:null;}})[_0xd12d('0x2c')](respondWithResult(_0x5b6e09,null))[_0xd12d('0x48')](handleError(_0x5b6e09,null));};exports['removeMembers']=function(_0x49abf4,_0x487ecc,_0x342b4d){return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x49abf4['params']['id']}})['then'](handleEntityNotFound(_0x487ecc,null))[_0xd12d('0x2c')](function(_0x1694f9){if(_0x1694f9){return _0x1694f9[_0xd12d('0x5d')](_0x49abf4[_0xd12d('0x36')][_0xd12d('0x55')]);}})[_0xd12d('0x2c')](respondWithStatusCode(_0x487ecc,null))[_0xd12d('0x48')](handleError(_0x487ecc,null));};exports[_0xd12d('0x5e')]=function(_0x34135e,_0xd4d85c,_0x25c86c){if(_0x34135e[_0xd12d('0x4e')]['id']){delete _0x34135e[_0xd12d('0x4e')]['id'];}return db[_0xd12d('0x43')][_0xd12d('0x4b')]({'where':{'id':_0x34135e['params']['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0xd4d85c,null))[_0xd12d('0x2c')](function(_0x210541){if(_0x210541){_0x34135e[_0xd12d('0x4e')][_0xd12d('0x5f')]=_0x210541['id'];return db[_0xd12d('0x51')][_0xd12d('0x4c')](_0x34135e[_0xd12d('0x4e')]);}})[_0xd12d('0x2c')](respondWithResult(_0xd4d85c,null))['catch'](handleError(_0xd4d85c,null));};exports[_0xd12d('0x60')]=function(_0x1e22b7,_0x3527b2,_0x53b7f0){var _0x5f034a={};var _0x38be77={};var _0x4f46bc;var _0x43802e;return db[_0xd12d('0x43')]['findOne']({'where':{'id':_0x1e22b7[_0xd12d('0x4f')]['id']}})[_0xd12d('0x2c')](handleEntityNotFound(_0x3527b2,null))[_0xd12d('0x2c')](function(_0x56a7b6){if(_0x56a7b6){_0x4f46bc=_0x56a7b6;_0x38be77['model']=_[_0xd12d('0x35')](db['ChatInternalMessage'][_0xd12d('0x4a')]);_0x38be77[_0xd12d('0x36')]=_[_0xd12d('0x35')](_0x1e22b7['query']);_0x38be77[_0xd12d('0x3e')]=_[_0xd12d('0x37')](_0x38be77['model'],_0x38be77['query']);_0x5f034a[_0xd12d('0x38')]=_['intersection'](_0x38be77[_0xd12d('0x34')],qs[_0xd12d('0x39')](_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x39')]));_0x5f034a[_0xd12d('0x38')]=_0x5f034a[_0xd12d('0x38')][_0xd12d('0x5b')]?_0x5f034a[_0xd12d('0x38')]:_0x38be77['model'];_0x5f034a['order']=qs['sort'](_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x3c')]);_0x5f034a[_0xd12d('0x3d')]=qs['filters'](_['pick'](_0x1e22b7[_0xd12d('0x36')],_0x38be77[_0xd12d('0x3e')]));if(_0x1e22b7['query']['filter']){_0x5f034a[_0xd12d('0x3d')]=_[_0xd12d('0x40')](_0x5f034a[_0xd12d('0x3d')],{'$or':_[_0xd12d('0x31')](_0x5f034a[_0xd12d('0x38')],function(_0x4600f7){var _0x4e6f7b={};_0x4e6f7b[_0x4600f7]={'$like':'%'+_0x1e22b7['query'][_0xd12d('0x3f')]+'%'};return _0x4e6f7b;})});}if(_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x61')]){var _0xea625d=_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x61')]['split'](',');var _0x455748={};_0x455748[_0xea625d[0x0]]={'$gte':moment(_0xea625d[0x1])[_0xd12d('0x62')](_0xd12d('0x63'))};_0x5f034a[_0xd12d('0x3d')]=_['merge'](_0x5f034a[_0xd12d('0x3d')],_0x455748);}_0x5f034a=_[_0xd12d('0x40')]({},_0x5f034a,_0x1e22b7[_0xd12d('0x42')]);return _0x4f46bc[_0xd12d('0x60')](_0x5f034a);}})['then'](function(_0x52a426){if(_0x52a426){_0x43802e=_0x52a426[_0xd12d('0x5b')];if(!_0x1e22b7[_0xd12d('0x36')][_0xd12d('0x5c')](_0xd12d('0x3a'))){_0x5f034a[_0xd12d('0x27')]=qs['limit'](_0x1e22b7[_0xd12d('0x36')]['limit']);_0x5f034a[_0xd12d('0x24')]=qs[_0xd12d('0x24')](_0x1e22b7[_0xd12d('0x36')]['offset']);}return _0x4f46bc[_0xd12d('0x60')](_0x5f034a);}})[_0xd12d('0x2c')](function(_0x3c5c28){if(_0x3c5c28){return _0x3c5c28?{'count':_0x43802e,'rows':_0x3c5c28}:null;}})[_0xd12d('0x2c')](respondWithResult(_0x3527b2,null))[_0xd12d('0x48')](handleError(_0x3527b2,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 5de20b8..7802af4 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 _0xd739=['../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x516035,_0xd61e86){var _0x3e5c18=function(_0x46ccac){while(--_0x46ccac){_0x516035['push'](_0x516035['shift']());}};_0x3e5c18(++_0xd61e86);}(_0xd739,0x135));var _0x9d73=function(_0x35f44a,_0x2603b9){_0x35f44a=_0x35f44a-0x0;var _0x26d8c5=_0xd739[_0x35f44a];return _0x26d8c5;};'use strict';var EventEmitter=require(_0x9d73('0x0'));var ChatGroup=require(_0x9d73('0x1'))['db'][_0x9d73('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9d73('0x3')](0x0);var events={'afterCreate':_0x9d73('0x4'),'afterUpdate':'update','afterDestroy':_0x9d73('0x5')};function emitEvent(_0x40263b){return function(_0x29696b,_0x4ff94d,_0x516f96){ChatGroupEvents[_0x9d73('0x6')](_0x40263b+':'+_0x29696b['id'],_0x29696b);ChatGroupEvents[_0x9d73('0x6')](_0x40263b,_0x29696b);_0x516f96(null);};}for(var e in events){if(events[_0x9d73('0x7')](e)){var event=events[e];ChatGroup[_0x9d73('0x8')](e,emitEvent(event));}}module[_0x9d73('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x7e74=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5930ba,_0x325f6f){var _0x4899a9=function(_0x125131){while(--_0x125131){_0x5930ba['push'](_0x5930ba['shift']());}};_0x4899a9(++_0x325f6f);}(_0x7e74,0xbd));var _0x47e7=function(_0x5a74d2,_0x23fe51){_0x5a74d2=_0x5a74d2-0x0;var _0x17d102=_0x7e74[_0x5a74d2];return _0x17d102;};'use strict';var EventEmitter=require(_0x47e7('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x47e7('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x47e7('0x2')](0x0);var events={'afterCreate':_0x47e7('0x3'),'afterUpdate':_0x47e7('0x4'),'afterDestroy':_0x47e7('0x5')};function emitEvent(_0x548d8b){return function(_0x2f084c,_0x75f99d,_0xb4dd0){ChatGroupEvents[_0x47e7('0x6')](_0x548d8b+':'+_0x2f084c['id'],_0x2f084c);ChatGroupEvents[_0x47e7('0x6')](_0x548d8b,_0x2f084c);_0xb4dd0(null);};}for(var e in events){if(events[_0x47e7('0x7')](e)){var event=events[e];ChatGroup[_0x47e7('0x8')](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 45f5255..bf3ed81 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 _0x4e9d=['api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','define','ChatGroup','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e9d,0x1a1));var _0xd4e9=function(_0x5d10c2,_0x4b0a49){_0x5d10c2=_0x5d10c2-0x0;var _0x57c7c4=_0x4e9d[_0x5d10c2];return _0x57c7c4;};'use strict';var _=require(_0xd4e9('0x0'));var util=require(_0xd4e9('0x1'));var logger=require(_0xd4e9('0x2'))(_0xd4e9('0x3'));var moment=require(_0xd4e9('0x4'));var BPromise=require(_0xd4e9('0x5'));var rp=require(_0xd4e9('0x6'));var fs=require('fs');var path=require(_0xd4e9('0x7'));var rimraf=require('rimraf');var config=require(_0xd4e9('0x8'));var attributes=require(_0xd4e9('0x9'));module['exports']=function(_0x4700b8,_0x17305e){return _0x4700b8[_0xd4e9('0xa')](_0xd4e9('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4637=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x6d76e8,_0x3a5b96){var _0x10a933=function(_0xcca43b){while(--_0xcca43b){_0x6d76e8['push'](_0x6d76e8['shift']());}};_0x10a933(++_0x3a5b96);}(_0x4637,0x114));var _0x7463=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4637[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7463('0x0'));var util=require('util');var logger=require(_0x7463('0x1'))('api');var moment=require(_0x7463('0x2'));var BPromise=require(_0x7463('0x3'));var rp=require(_0x7463('0x4'));var fs=require('fs');var path=require(_0x7463('0x5'));var rimraf=require(_0x7463('0x6'));var config=require(_0x7463('0x7'));var attributes=require(_0x7463('0x8'));module[_0x7463('0x9')]=function(_0x3d5a76,_0x4ec237){return _0x3d5a76[_0x7463('0xa')](_0x7463('0xb'),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 25b3784..456a2bc 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 _0x01e7=['lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch'];(function(_0x796a02,_0x19c78d){var _0x1ef784=function(_0x32f2b8){while(--_0x32f2b8){_0x796a02['push'](_0x796a02['shift']());}};_0x1ef784(++_0x19c78d);}(_0x01e7,0x134));var _0x701e=function(_0x7ae17,_0x4e3207){_0x7ae17=_0x7ae17-0x0;var _0x286bb8=_0x01e7[_0x7ae17];return _0x286bb8;};'use strict';var _=require(_0x701e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x701e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x701e('0x2'))['db'];var utils=require(_0x701e('0x3'));var logger=require(_0x701e('0x4'))('rpc');var config=require(_0x701e('0x5'));var jayson=require(_0x701e('0x6'));var client=jayson[_0x701e('0x7')][_0x701e('0x8')]({'port':0x232a});config['redis']=_[_0x701e('0x9')](config[_0x701e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x701e('0xb'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x701e('0xc')](socket);function respondWithRpcPromise(_0x595771,_0x111b7e,_0x529fa7){return new BPromise(function(_0x2236d5,_0x2ef2b1){return client['request'](_0x595771,_0x529fa7)[_0x701e('0xd')](function(_0x5e3f62){logger['info'](_0x701e('0xe'),_0x111b7e,_0x701e('0xf'));logger[_0x701e('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x111b7e,_0x701e('0xf'),JSON[_0x701e('0x11')](_0x5e3f62));if(_0x5e3f62[_0x701e('0x12')]){if(_0x5e3f62[_0x701e('0x12')]['code']===0x1f4){logger[_0x701e('0x12')](_0x701e('0xe'),_0x111b7e,_0x5e3f62[_0x701e('0x12')][_0x701e('0x13')]);return _0x2ef2b1(_0x5e3f62[_0x701e('0x12')][_0x701e('0x13')]);}logger[_0x701e('0x12')](_0x701e('0xe'),_0x111b7e,_0x5e3f62[_0x701e('0x12')][_0x701e('0x13')]);return _0x2236d5(_0x5e3f62[_0x701e('0x12')][_0x701e('0x13')]);}else{logger[_0x701e('0x14')](_0x701e('0xe'),_0x111b7e,_0x701e('0xf'));_0x2236d5(_0x5e3f62['result'][_0x701e('0x13')]);}})[_0x701e('0x15')](function(_0x150a70){logger[_0x701e('0x12')]('ChatGroup,\x20%s,\x20%s',_0x111b7e,_0x150a70);_0x2ef2b1(_0x150a70);});});}
\ No newline at end of file
+var _0x536e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x536e,0x155));var _0xe536=function(_0x5b7696,_0x3ebd92){_0x5b7696=_0x5b7696-0x0;var _0x42d7b9=_0x536e[_0x5b7696];return _0x42d7b9;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var moment=require(_0xe536('0x2'));var BPromise=require(_0xe536('0x3'));var rs=require(_0xe536('0x4'));var fs=require('fs');var Redis=require(_0xe536('0x5'));var db=require(_0xe536('0x6'))['db'];var utils=require(_0xe536('0x7'));var logger=require(_0xe536('0x8'))(_0xe536('0x9'));var config=require(_0xe536('0xa'));var jayson=require(_0xe536('0xb'));var client=jayson[_0xe536('0xc')][_0xe536('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe536('0xe')],{'host':_0xe536('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe536('0xe')]));require(_0xe536('0x10'))[_0xe536('0x11')](socket);function respondWithRpcPromise(_0x1d9dcd,_0x2581df,_0x1df409){return new BPromise(function(_0xe08ef0,_0x507dad){return client['request'](_0x1d9dcd,_0x1df409)[_0xe536('0x12')](function(_0xbec6ca){logger['info'](_0xe536('0x13'),_0x2581df,_0xe536('0x14'));logger[_0xe536('0x15')](_0xe536('0x16'),_0x2581df,_0xe536('0x14'),JSON[_0xe536('0x17')](_0xbec6ca));if(_0xbec6ca['error']){if(_0xbec6ca[_0xe536('0x18')][_0xe536('0x19')]===0x1f4){logger[_0xe536('0x18')](_0xe536('0x13'),_0x2581df,_0xbec6ca[_0xe536('0x18')]['message']);return _0x507dad(_0xbec6ca[_0xe536('0x18')][_0xe536('0x1a')]);}logger[_0xe536('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2581df,_0xbec6ca[_0xe536('0x18')][_0xe536('0x1a')]);return _0xe08ef0(_0xbec6ca[_0xe536('0x18')][_0xe536('0x1a')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x2581df,_0xe536('0x14'));_0xe08ef0(_0xbec6ca[_0xe536('0x1b')][_0xe536('0x1a')]);}})[_0xe536('0x1c')](function(_0x4f6eb2){logger['error'](_0xe536('0x13'),_0x2581df,_0x4f6eb2);_0x507dad(_0x4f6eb2);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 65c2b2a..538d146 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 _0x34c5=['remove','update','emit','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x100398,_0x2e8080){var _0x51fef4=function(_0x5b567b){while(--_0x5b567b){_0x100398['push'](_0x100398['shift']());}};_0x51fef4(++_0x2e8080);}(_0x34c5,0x76));var _0x534c=function(_0x37d72f,_0x10116f){_0x37d72f=_0x37d72f-0x0;var _0x22bb4c=_0x34c5[_0x37d72f];return _0x22bb4c;};'use strict';var ChatGroupEvents=require(_0x534c('0x0'));var events=[_0x534c('0x1'),_0x534c('0x2'),_0x534c('0x3')];function createListener(_0x402d4a,_0x9cc313){return function(_0x3e591f){_0x9cc313[_0x534c('0x4')](_0x402d4a,_0x3e591f);};}function removeListener(_0x414bc0,_0x37081b){return function(){ChatGroupEvents[_0x534c('0x5')](_0x414bc0,_0x37081b);};}exports['register']=function(_0x53afda){for(var _0x17db65=0x0,_0x8d5d84=events[_0x534c('0x6')];_0x17db65<_0x8d5d84;_0x17db65++){var _0x57ce6b=events[_0x17db65];var _0x243b87=createListener(_0x534c('0x7')+_0x57ce6b,_0x53afda);ChatGroupEvents['on'](_0x57ce6b,_0x243b87);}};
\ No newline at end of file
+var _0x57a9=['update','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x5ace25,_0x536239){var _0x4ba17a=function(_0x1ee54e){while(--_0x1ee54e){_0x5ace25['push'](_0x5ace25['shift']());}};_0x4ba17a(++_0x536239);}(_0x57a9,0x1d5));var _0x957a=function(_0x4e8659,_0x8d6bc6){_0x4e8659=_0x4e8659-0x0;var _0x44d415=_0x57a9[_0x4e8659];return _0x44d415;};'use strict';var ChatGroupEvents=require(_0x957a('0x0'));var events=[_0x957a('0x1'),_0x957a('0x2'),_0x957a('0x3')];function createListener(_0x6d6b35,_0x4ac365){return function(_0x533099){_0x4ac365['emit'](_0x6d6b35,_0x533099);};}function removeListener(_0xc92e85,_0x46b7a7){return function(){ChatGroupEvents[_0x957a('0x4')](_0xc92e85,_0x46b7a7);};}exports[_0x957a('0x5')]=function(_0x34e441){for(var _0x491a34=0x0,_0x9766f=events[_0x957a('0x6')];_0x491a34<_0x9766f;_0x491a34++){var _0x281f42=events[_0x491a34];var _0x55d88f=createListener(_0x957a('0x7')+_0x281f42,_0x34e441);ChatGroupEvents['on'](_0x281f42,_0x55d88f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index b923d9c..8af2921 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 _0x9b2a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b2a,0x1ee));var _0xa9b2=function(_0x4d3df5,_0x5992c1){_0x4d3df5=_0x4d3df5-0x0;var _0x48f386=_0x9b2a[_0x4d3df5];return _0x48f386;};'use strict';var multer=require(_0xa9b2('0x0'));var util=require(_0xa9b2('0x1'));var path=require(_0xa9b2('0x2'));var timeout=require(_0xa9b2('0x3'));var express=require(_0xa9b2('0x4'));var router=express[_0xa9b2('0x5')]();var fs_extra=require(_0xa9b2('0x6'));var auth=require(_0xa9b2('0x7'));var interaction=require(_0xa9b2('0x8'));var config=require(_0xa9b2('0x9'));var controller=require(_0xa9b2('0xa'));router[_0xa9b2('0xb')]('/',auth[_0xa9b2('0xc')](),controller['index']);router['get'](_0xa9b2('0xd'),auth[_0xa9b2('0xc')](),controller[_0xa9b2('0xe')]);router[_0xa9b2('0xb')](_0xa9b2('0xf'),auth[_0xa9b2('0xc')](),controller['show']);router[_0xa9b2('0xb')](_0xa9b2('0x10'),auth[_0xa9b2('0xc')](),controller[_0xa9b2('0x11')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0xa9b2('0x12')]);router[_0xa9b2('0xb')](_0xa9b2('0x13'),auth['isAuthenticated'](),controller[_0xa9b2('0x14')]);router[_0xa9b2('0x15')]('/',auth[_0xa9b2('0xc')](),controller[_0xa9b2('0x16')]);router[_0xa9b2('0x15')]('/:id/members',auth['isAuthenticated'](),controller[_0xa9b2('0x17')]);router['post'](_0xa9b2('0x13'),auth[_0xa9b2('0xc')](),controller['addMessage']);router[_0xa9b2('0x18')](_0xa9b2('0xf'),auth[_0xa9b2('0xc')](),controller[_0xa9b2('0x19')]);router[_0xa9b2('0x1a')](_0xa9b2('0xf'),auth[_0xa9b2('0xc')](),controller[_0xa9b2('0x1b')]);router['delete']('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module[_0xa9b2('0x1c')]=router;
\ No newline at end of file
+var _0x4059=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','put'];(function(_0x43da28,_0x223efe){var _0x2c26a5=function(_0x4724b7){while(--_0x4724b7){_0x43da28['push'](_0x43da28['shift']());}};_0x2c26a5(++_0x223efe);}(_0x4059,0x1be));var _0x9405=function(_0x4a8ab9,_0x5615d3){_0x4a8ab9=_0x4a8ab9-0x0;var _0x22ce40=_0x4059[_0x4a8ab9];return _0x22ce40;};'use strict';var multer=require(_0x9405('0x0'));var util=require(_0x9405('0x1'));var path=require(_0x9405('0x2'));var timeout=require(_0x9405('0x3'));var express=require(_0x9405('0x4'));var router=express['Router']();var fs_extra=require(_0x9405('0x5'));var auth=require(_0x9405('0x6'));var interaction=require(_0x9405('0x7'));var config=require(_0x9405('0x8'));var controller=require('./chatGroup.controller');router[_0x9405('0x9')]('/',auth[_0x9405('0xa')](),controller[_0x9405('0xb')]);router[_0x9405('0x9')](_0x9405('0xc'),auth[_0x9405('0xa')](),controller['describe']);router[_0x9405('0x9')](_0x9405('0xd'),auth[_0x9405('0xa')](),controller[_0x9405('0xe')]);router[_0x9405('0x9')](_0x9405('0xf'),auth[_0x9405('0xa')](),controller[_0x9405('0x10')]);router[_0x9405('0x9')](_0x9405('0x11'),auth[_0x9405('0xa')](),controller[_0x9405('0x12')]);router[_0x9405('0x9')](_0x9405('0x13'),auth[_0x9405('0xa')](),controller['getMessages']);router[_0x9405('0x14')]('/',auth[_0x9405('0xa')](),controller['create']);router['post'](_0x9405('0x11'),auth['isAuthenticated'](),controller['addMembers']);router[_0x9405('0x14')]('/:id/messages',auth[_0x9405('0xa')](),controller['addMessage']);router[_0x9405('0x15')](_0x9405('0xd'),auth[_0x9405('0xa')](),controller[_0x9405('0x16')]);router[_0x9405('0x17')]('/:id',auth[_0x9405('0xa')](),controller[_0x9405('0x18')]);router[_0x9405('0x17')](_0x9405('0x11'),auth[_0x9405('0xa')](),controller['removeMembers']);module[_0x9405('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index d6641f8..854c3d8 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 _0x8c90=['INTEGER','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN'];(function(_0x51b8eb,_0x45e664){var _0x219949=function(_0x21d965){while(--_0x21d965){_0x51b8eb['push'](_0x51b8eb['shift']());}};_0x219949(++_0x45e664);}(_0x8c90,0x6a));var _0x08c9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8c90[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x08c9('0x0'));module['exports']={'closed':{'type':Sequelize[_0x08c9('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x08c9('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x08c9('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x08c9('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x08c9('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x08c9('0x6')]},'disposition':{'type':Sequelize[_0x08c9('0x5')]},'secondDisposition':{'type':Sequelize[_0x08c9('0x5')]},'thirdDisposition':{'type':Sequelize[_0x08c9('0x5')]},'note':{'type':Sequelize[_0x08c9('0x5')]},'browserName':{'type':Sequelize[_0x08c9('0x5')]},'browserVersion':{'type':Sequelize[_0x08c9('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x08c9('0x5')]},'deviceModel':{'type':Sequelize[_0x08c9('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x08c9('0x5')]},'referer':{'type':Sequelize[_0x08c9('0x4')]},'customerIp':{'type':Sequelize[_0x08c9('0x5')]},'formData':{'type':Sequelize[_0x08c9('0x4')](_0x08c9('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x08c9('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x08c9('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x08c9('0x5')]},'customerPort':{'type':Sequelize[_0x08c9('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x08c9('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x08c9('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x08c9('0x2')]}};
\ No newline at end of file
+var _0x2805=['DATE','long','out','INTEGER','exports','BOOLEAN','star','thumb','TEXT','STRING'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2805,0x13a));var _0x5280=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x2805[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require('sequelize');module[_0x5280('0x0')]={'closed':{'type':Sequelize[_0x5280('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x5280('0x2'),_0x5280('0x3')),'defaultValue':_0x5280('0x2')},'ratingMessage':{'type':Sequelize[_0x5280('0x4')]},'pathTranscript':{'type':Sequelize[_0x5280('0x4')]},'mailTranscript':{'type':Sequelize[_0x5280('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5280('0x6')]},'disposition':{'type':Sequelize[_0x5280('0x5')]},'secondDisposition':{'type':Sequelize[_0x5280('0x5')]},'thirdDisposition':{'type':Sequelize[_0x5280('0x5')]},'note':{'type':Sequelize[_0x5280('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x5280('0x5')]},'osName':{'type':Sequelize[_0x5280('0x5')]},'osVersion':{'type':Sequelize[_0x5280('0x5')]},'deviceModel':{'type':Sequelize[_0x5280('0x5')]},'deviceVendor':{'type':Sequelize[_0x5280('0x5')]},'deviceType':{'type':Sequelize[_0x5280('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5280('0x5')]},'formData':{'type':Sequelize[_0x5280('0x4')](_0x5280('0x7'))},'read1stAt':{'type':Sequelize[_0x5280('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5280('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x5280('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x5280('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x5280('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5280('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 5020c2c..226ea18 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 _0xbed9=['YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','hasOwnProperty','filter','secret','includeAgent','push','alias','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','unix','toString','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Attachment','read','Account','Owner','get','mkdirSync','N.A.','closedAt','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','value','renderFile','views','transcript-','Chat','createPdfFromHTML','err','unlinkSync','zip-dir','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','params','model','keys','filters','attributes','intersection','fields','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','originalname','basename','file','filename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','now','pathTranscript','CmContact','ContactId','Messages','length','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','nolimit','sort','where','pick','ChatInteractionId','$gte'];(function(_0x51bef8,_0x101d36){var _0x4574a9=function(_0x4029a6){while(--_0x4029a6){_0x51bef8['push'](_0x51bef8['shift']());}};_0x4574a9(++_0x101d36);}(_0xbed9,0x100));var _0x9bed=function(_0xe17f3d,_0x363e1a){_0xe17f3d=_0xe17f3d-0x0;var _0x4e716d=_0xbed9[_0xe17f3d];return _0x4e716d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x9bed('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9bed('0x1'));var Mustache=require(_0x9bed('0x2'));var util=require(_0x9bed('0x3'));var path=require(_0x9bed('0x4'));var ejs=require(_0x9bed('0x5'));var fs=require('fs');var _=require(_0x9bed('0x6'));var Redis=require(_0x9bed('0x7'));var interaction=require(_0x9bed('0x8'));var qs=require(_0x9bed('0x9'));var pdf=require(_0x9bed('0xa'));var logger=require('../../config/logger')('api');var config=require(_0x9bed('0xb'));var db=require(_0x9bed('0xc'))['db'];config[_0x9bed('0xd')]=_[_0x9bed('0xe')](config[_0x9bed('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bed('0xf'))(new Redis(config['redis']));require(_0x9bed('0x10'))[_0x9bed('0x11')](socket);var jayson=require(_0x9bed('0x12'));var client=jayson[_0x9bed('0x13')][_0x9bed('0x14')]({'port':0x232b});var client9004=jayson['client'][_0x9bed('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x503610,_0x22a00a,_0xda127f,_0x3a4501){return new BPromise(function(_0x34c01f,_0x12adae){var _0x3c52d4=_0x3a4501||client;return _0x3c52d4[_0x9bed('0x15')](_0x503610,_0xda127f)[_0x9bed('0x16')](function(_0x266d3e){logger[_0x9bed('0x17')](_0x9bed('0x18'),_0x22a00a,_0x9bed('0x19'));logger[_0x9bed('0x1a')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x22a00a,'request\x20sent',JSON['stringify'](_0x266d3e));if(_0x266d3e[_0x9bed('0x1b')]){if(_0x266d3e[_0x9bed('0x1b')]['code']===0x1f4){logger['error'](_0x9bed('0x18'),_0x22a00a,_0x266d3e[_0x9bed('0x1b')][_0x9bed('0x1c')]);return _0x12adae(_0x266d3e[_0x9bed('0x1b')]['message']);}logger[_0x9bed('0x1b')](_0x9bed('0x18'),_0x22a00a,_0x266d3e[_0x9bed('0x1b')]['message']);return _0x34c01f(_0x266d3e[_0x9bed('0x1b')][_0x9bed('0x1c')]);}else{logger[_0x9bed('0x17')](_0x9bed('0x18'),_0x22a00a,_0x9bed('0x19'));_0x34c01f(_0x266d3e[_0x9bed('0x1d')][_0x9bed('0x1c')]);}})[_0x9bed('0x1e')](function(_0x3753c7){logger[_0x9bed('0x1b')](_0x9bed('0x18'),_0x22a00a,_0x3753c7);_0x12adae(_0x3753c7);});});}function respondWithStatusCode(_0x384f31,_0x5c61c4){_0x5c61c4=_0x5c61c4||0xcc;return function(_0x44f62e){if(_0x44f62e){return _0x384f31[_0x9bed('0x1f')](_0x5c61c4);}return _0x384f31['status'](_0x5c61c4)[_0x9bed('0x20')]();};}function respondWithResult(_0x99994,_0x4ffe51){_0x4ffe51=_0x4ffe51||0xc8;return function(_0x92b2a8){if(_0x92b2a8){return _0x99994[_0x9bed('0x21')](_0x4ffe51)[_0x9bed('0x22')](_0x92b2a8);}};}function respondWithFilteredResult(_0x326062,_0x50390b){return function(_0x3e0d2b){if(_0x3e0d2b){var _0x4c96f0=typeof _0x50390b[_0x9bed('0x23')]===_0x9bed('0x24')&&typeof _0x50390b['limit']===_0x9bed('0x24');var _0x4b0ddd=_0x3e0d2b[_0x9bed('0x25')];var _0x5bf833=_0x4c96f0?0x0:_0x50390b['offset'];var _0x37acf8=_0x4c96f0?_0x3e0d2b[_0x9bed('0x25')]:_0x50390b['offset']+_0x50390b[_0x9bed('0x26')];var _0x232ce0;if(_0x37acf8>=_0x4b0ddd){_0x37acf8=_0x4b0ddd;_0x232ce0=0xc8;}else{_0x232ce0=0xce;}_0x326062['status'](_0x232ce0);return _0x326062[_0x9bed('0x27')](_0x9bed('0x28'),_0x5bf833+'-'+_0x37acf8+'/'+_0x4b0ddd)['json'](_0x3e0d2b);}return null;};}function saveUpdates(_0x5df86a){return function(_0x3dd486){if(_0x3dd486){return _0x3dd486[_0x9bed('0x29')](_0x5df86a)[_0x9bed('0x16')](function(_0x2f63c8){return _0x2f63c8;});}return null;};}function removeEntity(_0x28eb1e){return function(_0x39c2b8){if(_0x39c2b8){return _0x39c2b8[_0x9bed('0x2a')]()[_0x9bed('0x16')](function(){_0x28eb1e[_0x9bed('0x21')](0xcc)[_0x9bed('0x20')]();});}};}function handleEntityNotFound(_0x171dcc){return function(_0x2648c3){if(!_0x2648c3){_0x171dcc[_0x9bed('0x1f')](0x194);}return _0x2648c3;};}function handleError(_0x2c3927,_0x3d274f){_0x3d274f=_0x3d274f||0x1f4;return function(_0x1a9574){logger[_0x9bed('0x1b')](_0x1a9574[_0x9bed('0x2b')]);if(_0x1a9574['name']){delete _0x1a9574[_0x9bed('0x2c')];}_0x2c3927['status'](_0x3d274f)['send'](_0x1a9574);};}function getMustacheRender(_0x1c02d0,_0x11e13b){return Mustache[_0x9bed('0x2d')](_0x1c02d0,_[_0x9bed('0x2e')](_0x11e13b[_0x9bed('0x2f')],{'contact':_0x11e13b[_0x9bed('0x30')],'message':_0x11e13b[_0x9bed('0x1c')],'agent':_0x11e13b[_0x9bed('0x31')],'interaction':_0x11e13b[_0x9bed('0x32')],'account':_0x11e13b[_0x9bed('0x33')]}))||'';}exports[_0x9bed('0x34')]=function(_0x28c060,_0x2f978b){var _0x33be7a={};var _0x34ce26=_[_0x9bed('0x35')](db[_0x9bed('0x36')][_0x9bed('0x37')],function(_0x5975c6){return{'name':_0x5975c6[_0x9bed('0x38')],'type':_0x5975c6[_0x9bed('0x39')][_0x9bed('0x3a')]};});_0x33be7a=qs[_0x9bed('0x3b')](_0x34ce26,_0x28c060);return interaction[_0x9bed('0x3c')](_0x9bed('0x3d'),_0x28c060[_0x9bed('0x3e')],_0x28c060['user'],_0x33be7a,_0x34ce26)['then'](respondWithFilteredResult(_0x2f978b,_0x33be7a))[_0x9bed('0x1e')](handleError(_0x2f978b,null));};exports['show']=function(_0x208368,_0xe4edd){var _0x317c27={'raw':![],'where':{'id':_0x208368[_0x9bed('0x3f')]['id']}},_0x6e3aef={};_0x6e3aef[_0x9bed('0x40')]=_[_0x9bed('0x41')](db[_0x9bed('0x36')]['rawAttributes']);_0x6e3aef[_0x9bed('0x3e')]=_[_0x9bed('0x41')](_0x208368[_0x9bed('0x3e')]);_0x6e3aef[_0x9bed('0x42')]=_['intersection'](_0x6e3aef[_0x9bed('0x40')],_0x6e3aef['query']);_0x317c27[_0x9bed('0x43')]=_[_0x9bed('0x44')](_0x6e3aef[_0x9bed('0x40')],qs[_0x9bed('0x45')](_0x208368['query'][_0x9bed('0x45')]));_0x317c27[_0x9bed('0x43')]=_0x317c27[_0x9bed('0x43')]['length']?_0x317c27[_0x9bed('0x43')]:_0x6e3aef['model'];if(_0x208368[_0x9bed('0x3e')][_0x9bed('0x46')]){_0x317c27[_0x9bed('0x47')]=[{'all':!![]}];}_0x317c27=_[_0x9bed('0x2e')]({},_0x317c27,_0x208368[_0x9bed('0x48')]);return db[_0x9bed('0x36')][_0x9bed('0x49')](_0x317c27)[_0x9bed('0x16')](handleEntityNotFound(_0xe4edd,null))[_0x9bed('0x16')](respondWithResult(_0xe4edd,null))[_0x9bed('0x1e')](handleError(_0xe4edd,null));};exports[_0x9bed('0x4a')]=function(_0x16365d,_0x4a9fd3){return db[_0x9bed('0x36')][_0x9bed('0x4a')](_0x16365d[_0x9bed('0x2f')],{})[_0x9bed('0x16')](respondWithResult(_0x4a9fd3,0xc9))[_0x9bed('0x1e')](handleError(_0x4a9fd3,null));};exports['update']=function(_0x5bbfd1,_0x482279){if(_0x5bbfd1[_0x9bed('0x2f')]['id']){delete _0x5bbfd1[_0x9bed('0x2f')]['id'];}return db['ChatInteraction'][_0x9bed('0x49')]({'where':{'id':_0x5bbfd1[_0x9bed('0x3f')]['id']}})[_0x9bed('0x16')](handleEntityNotFound(_0x482279,null))[_0x9bed('0x16')](saveUpdates(_0x5bbfd1[_0x9bed('0x2f')],null))[_0x9bed('0x16')](respondWithResult(_0x482279,null))[_0x9bed('0x1e')](handleError(_0x482279,null));};exports[_0x9bed('0x2a')]=function(_0x316e65,_0x37fec6){return db['ChatInteraction'][_0x9bed('0x49')]({'where':{'id':_0x316e65[_0x9bed('0x3f')]['id']}})[_0x9bed('0x16')](handleEntityNotFound(_0x37fec6,null))[_0x9bed('0x16')](removeEntity(_0x37fec6,null))[_0x9bed('0x1e')](handleError(_0x37fec6,null));};exports[_0x9bed('0x4b')]=function(_0x353728,_0x5be160){return db[_0x9bed('0x36')]['describe']()[_0x9bed('0x16')](respondWithResult(_0x5be160,null))[_0x9bed('0x1e')](handleError(_0x5be160,null));};exports[_0x9bed('0x4c')]=function(_0x4cfec7,_0x4ebc3c){var _0x475b7b=_0x4cfec7[_0x9bed('0x3f')]['id'];var _0x58b937;var _0x48fd71;var _0x54dbb3;return db[_0x9bed('0x36')][_0x9bed('0x4d')]({'where':{'id':_0x475b7b}})['then'](function(_0x3eb937){_0x58b937=_0x3eb937;return db[_0x9bed('0x4e')]['findOne']({'where':{'id':_0x3eb937[_0x9bed('0x4f')]},'attributes':['id','vidaooApiKey',_0x9bed('0x50'),_0x9bed('0x51'),_0x9bed('0x52'),'vidaooMetadata'],'raw':!![]});})[_0x9bed('0x16')](function(_0x2abf19){if(_0x2abf19&&_0x2abf19[_0x9bed('0x53')]&&_0x2abf19[_0x9bed('0x50')]){_0x48fd71=_0x2abf19;var _0x15ee12={'interaction':{'id':_0x475b7b},'agent':{'id':_0x4cfec7[_0x9bed('0x54')]['id'],'name':_0x4cfec7[_0x9bed('0x54')][_0x9bed('0x2c')],'fullname':_0x4cfec7[_0x9bed('0x54')][_0x9bed('0x55')],'email':_0x4cfec7[_0x9bed('0x54')][_0x9bed('0x56')]},'contact':_0x4cfec7[_0x9bed('0x2f')]['contact'],'account':_0x4cfec7['body'][_0x9bed('0x33')]};var _0x29dbb1={'rejectUnauthorized':![],'method':'POST','url':_0x9bed('0x57'),'headers':{'X-APIKEY':_0x2abf19[_0x9bed('0x53')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4cfec7[_0x9bed('0x54')][_0x9bed('0x56')]],'buttons':null,'topic':_0x48fd71[_0x9bed('0x51')],'note':_[_0x9bed('0x58')](_0x48fd71[_0x9bed('0x52')])?null:getMustacheRender(_0x48fd71['vidaooNote'],_0x15ee12),'metadata':null},'redirect':_0x9bed('0x59'),'json':!![]};try{if(!_[_0x9bed('0x58')](_0x48fd71[_0x9bed('0x5a')])){var _0x5f2657=getMustacheRender(_0x48fd71['vidaooMetadata'],_0x15ee12);var _0x5b19ad=JSON['parse'](_0x5f2657);_0x29dbb1[_0x9bed('0x2f')][_0x9bed('0x5b')]=_0x5b19ad;}}catch(_0x9e0332){throw new db['Sequelize'][(_0x9bed('0x5c'))](_0x9bed('0x5d'));}return rp(_0x29dbb1);}else{throw new db[(_0x9bed('0x5e'))][(_0x9bed('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9bed('0x16')](function(_0xc7409c){_0x54dbb3=_0xc7409c;if(_0x54dbb3['id']){var _0x26ced0={'body':_0x54dbb3[_0x9bed('0x5f')],'ChatWebsiteId':_0x48fd71['id'],'ChatInteractionId':_0x58b937['id'],'direction':_0x9bed('0x60'),'UserId':_0x4cfec7[_0x9bed('0x54')]['id']};return db[_0x9bed('0x61')][_0x9bed('0x4a')](_0x26ced0,{});}else{throw new db[(_0x9bed('0x5e'))][(_0x9bed('0x5c'))](_0x9bed('0x62'));}})[_0x9bed('0x16')](function(){return _0x58b937[_0x9bed('0x63')]({'vidaooSessionId':_0x54dbb3['id']});})['then'](respondWithResult(_0x4ebc3c,null))[_0x9bed('0x1e')](handleError(_0x4ebc3c,null));};exports[_0x9bed('0x64')]=function(_0x2d819c,_0xe614ef){if(_0x2d819c['body']['id']){delete _0x2d819c[_0x9bed('0x2f')]['id'];}return db[_0x9bed('0x36')]['find']({'where':{'id':_0x2d819c[_0x9bed('0x3f')]['id']},'include':[{'model':db['CmContact'],'as':_0x9bed('0x65')}]})[_0x9bed('0x16')](handleEntityNotFound(_0xe614ef,null))[_0x9bed('0x16')](saveUpdates(_0x2d819c[_0x9bed('0x2f')],null))[_0x9bed('0x16')](respondWithResult(_0xe614ef,null))[_0x9bed('0x1e')](handleError(_0xe614ef,null));};exports['abandon']=function(_0x12cdc2,_0x2f2f82){if(_0x12cdc2[_0x9bed('0x2f')]['id']){delete _0x12cdc2[_0x9bed('0x2f')]['id'];}return db[_0x9bed('0x36')]['find']({'where':{'id':_0x12cdc2[_0x9bed('0x3f')]['id']}})[_0x9bed('0x16')](function(_0x3ff794){if(!_0x3ff794){logger['error'](_0x9bed('0x66'),_0x9bed('0x67'),0x194,_0x9bed('0x68'));_0x2f2f82['sendStatus'](0x194);}else{if(_0x3ff794[_0x9bed('0x69')]){throw new db[(_0x9bed('0x5e'))][(_0x9bed('0x5c'))](_0x9bed('0x6a'));}}return _0x3ff794;})[_0x9bed('0x16')](function(_0x4598b3){if(_0x4598b3){return _0x4598b3['update']({'closed':_0x12cdc2[_0x9bed('0x2f')][_0x9bed('0x6b')],'disposition':_0x12cdc2['body'][_0x9bed('0x6c')]})[_0x9bed('0x16')](function(_0x563eb1){return _0x563eb1;});}})[_0x9bed('0x16')](function(){return respondWithRpcPromise(_0x9bed('0x6d'),_0x9bed('0x67'),_0x12cdc2[_0x9bed('0x2f')],client9004);})[_0x9bed('0x16')](respondWithResult(_0x2f2f82,null))[_0x9bed('0x1e')](handleError(_0x2f2f82,null));};exports['attachmentUpload']=function(_0x4e5a3a,_0x51f5b9){_0x4e5a3a[_0x9bed('0x2f')][_0x9bed('0x2c')]=_0x4e5a3a['file'][_0x9bed('0x6e')];_0x4e5a3a['body'][_0x9bed('0x6f')]=_0x4e5a3a[_0x9bed('0x70')][_0x9bed('0x71')];_0x4e5a3a['body'][_0x9bed('0x39')]=_0x4e5a3a[_0x9bed('0x70')][_0x9bed('0x72')];return db['Attachment'][_0x9bed('0x4a')](_0x4e5a3a[_0x9bed('0x2f')])[_0x9bed('0x16')](respondWithResult(_0x51f5b9,0xc9))[_0x9bed('0x1e')](handleError(_0x51f5b9,null));};exports[_0x9bed('0x73')]=function(_0x2c58bd,_0x4ed6d6){return db['ChatInteraction']['findOne']({'where':{'id':_0x2c58bd[_0x9bed('0x3f')]['id']},'raw':!![]})[_0x9bed('0x16')](handleEntityNotFound(_0x4ed6d6,null))['then'](function(_0x58bb83){if(_0x58bb83){if(_0x58bb83['closed']){return _0x4ed6d6[_0x9bed('0x21')](0x193)[_0x9bed('0x22')]({'status':0x193,'message':_0x9bed('0x74')});}return db['Attachment']['findOne']({'where':{'id':_0x2c58bd[_0x9bed('0x3e')][_0x9bed('0x75')]},'raw':!![]})[_0x9bed('0x16')](handleEntityNotFound(_0x4ed6d6,null));}})[_0x9bed('0x16')](function(_0x145124){if(_0x145124){var _0x51505c=_0x145124[_0x9bed('0x76')]!==null;var _0xc8c87e=path[_0x9bed('0x77')](config[_0x9bed('0x78')],_0x9bed('0x79'));if(_0x51505c){_0xc8c87e=path[_0x9bed('0x77')](_0xc8c87e,_0x9bed('0x7a'));}var _0x20739c=path[_0x9bed('0x77')](_0xc8c87e,_0x145124[_0x9bed('0x6f')]);return _0x4ed6d6[_0x9bed('0x7b')](_0x20739c);}})[_0x9bed('0x1e')](handleError(_0x4ed6d6,null));};exports[_0x9bed('0x7c')]=function(_0x29a2cc,_0x8de8d5){var _0x2efd42=null;var _0x342dc9=null;var _0x246150=null;if(_0x29a2cc[_0x9bed('0x2f')]['id']){delete _0x29a2cc[_0x9bed('0x2f')]['id'];}if(_0x29a2cc['body'][_0x9bed('0x7d')]){_0x246150=path['join'](config[_0x9bed('0x78')],'server/files/chat/upload/',util[_0x9bed('0x7e')]('transcript-%s.txt',Date[_0x9bed('0x7f')]()));_0x29a2cc[_0x9bed('0x2f')][_0x9bed('0x80')]=_0x246150;}return db['ChatInteraction'][_0x9bed('0x49')]({'where':{'id':_0x29a2cc['params']['id']},'include':[{'model':db[_0x9bed('0x61')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x9bed('0x16')](handleEntityNotFound(_0x8de8d5,null))[_0x9bed('0x16')](saveUpdates(_0x29a2cc['body'],null))[_0x9bed('0x16')](function(_0x55eb07){if(_0x55eb07){_0x2efd42=_0x55eb07;return db[_0x9bed('0x4e')]['find']({'where':{'id':_0x2efd42[_0x9bed('0x4f')]}});}})[_0x9bed('0x16')](function(_0x122acd){if(_0x122acd){_0x342dc9=_0x122acd;return db[_0x9bed('0x81')]['find']({'where':{'id':_0x2efd42[_0x9bed('0x82')]}});}})[_0x9bed('0x16')](function(_0x8a4c86){if(_0x8a4c86){if(_0x246150){var _0x2fdcd4=null;for(var _0x5f2afb=0x1;_0x5f2afb<_0x2efd42[_0x9bed('0x83')][_0x9bed('0x84')];++_0x5f2afb){_0x2fdcd4=_0x2efd42[_0x9bed('0x83')][_0x5f2afb];var _0x384248=_0x2fdcd4[_0x9bed('0x69')]?util[_0x9bed('0x7e')](_0x9bed('0x85'),_0x342dc9[_0x9bed('0x86')],_0x2fdcd4[_0x9bed('0x69')]):_0x9bed('0x87');var _0xcf5a4a=_0x29a2cc[_0x9bed('0x2f')][_0x9bed('0x88')]||util[_0x9bed('0x7e')]('%s%d',_0x9bed('0x89'),_0x2fdcd4[_0x9bed('0x82')]);switch(_0x342dc9[_0x9bed('0x8a')]){case _0x9bed('0x8b'):_0x384248=_0x2fdcd4[_0x9bed('0x69')]?util[_0x9bed('0x7e')]('%s%d',_0x342dc9[_0x9bed('0x86')],_0x2fdcd4[_0x9bed('0x69')]):_0x9bed('0x87');break;case'agent_alias':_0x384248=_0x2fdcd4[_0x9bed('0x69')]?_0x2fdcd4[_0x9bed('0x8c')]['alias']||_0x2fdcd4[_0x9bed('0x8c')]['fullname']:'System';break;case _0x9bed('0x8d'):_0x384248=_0x2fdcd4['UserId']?_0x2fdcd4[_0x9bed('0x8c')][_0x9bed('0x55')]:_0x9bed('0x87');break;default:_0x384248=_0x2fdcd4[_0x9bed('0x69')]?util[_0x9bed('0x7e')](_0x9bed('0x85'),_0x342dc9[_0x9bed('0x86')],_0x2fdcd4[_0x9bed('0x69')]):_0x9bed('0x87');}var _0x33d5a1=util['format'](_0x9bed('0x8e'),moment(_0x2fdcd4[_0x9bed('0x8f')])[_0x9bed('0x7e')](_0x9bed('0x90')),_0x2fdcd4[_0x9bed('0x91')]==='in'?_0xcf5a4a:_0x384248,_0x2fdcd4[_0x9bed('0x2f')]);if(!_0x2fdcd4['secret']){fs[_0x9bed('0x92')](_0x246150,_0x33d5a1);}}return db[_0x9bed('0x93')][_0x9bed('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0x9bed('0x94')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9bed('0x95')],'as':_0x9bed('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x4de6e8){if(!_0x4de6e8||!_0x4de6e8[_0x9bed('0x96')]||!_0x29a2cc[_0x9bed('0x2f')])return _0x2efd42;var _0x573b48=_0x4de6e8['getSmtpOptions']();return respondWithRpcPromise(_0x9bed('0x97'),'sendMail',{'account':_0x573b48,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4de6e8['name'],_0x4de6e8[_0x9bed('0x56')]||_0x4de6e8[_0x9bed('0x96')][_0x9bed('0x54')]),'to':_0x29a2cc['body'][_0x9bed('0x7d')],'subject':_0x9bed('0x98'),'text':util[_0x9bed('0x7e')](_0x9bed('0x99'),_0x29a2cc[_0x9bed('0x2f')][_0x9bed('0x7d')]),'attachments':[{'path':_0x246150}]}})['then'](function(){return _0x2efd42;})[_0x9bed('0x1e')](function(_0x51ca2b){logger[_0x9bed('0x1b')](_0x51ca2b);});})[_0x9bed('0x16')](respondWithStatusCode(_0x8de8d5,0xc8))['catch'](handleError(_0x8de8d5,null));};exports[_0x9bed('0x9a')]=function(_0x4e02ec,_0x5e4a7d){return db['ChatMessage'][_0x9bed('0x49')]({'where':{'id':_0x4e02ec[_0x9bed('0x3f')]['id']}})[_0x9bed('0x16')](handleEntityNotFound(_0x5e4a7d,null))[_0x9bed('0x16')](function(_0x3834b9){if(_0x3834b9){return _0x3834b9[_0x9bed('0x9a')](_0x4e02ec['body']['ids'],_['omit'](_0x4e02ec['body'],[_0x9bed('0x9b'),'id'])||{});}})[_0x9bed('0x16')](respondWithResult(_0x5e4a7d,null))[_0x9bed('0x1e')](handleError(_0x5e4a7d,null));};exports['getMessages']=function(_0x2f6012,_0x71eeef){var _0xf06e2={'raw':![],'where':{}};var _0x2fe415={};var _0x55b086={'count':0x0,'rows':[]};return db[_0x9bed('0x36')]['findOne']({'where':{'id':_0x2f6012[_0x9bed('0x3f')]['id']}})['then'](handleEntityNotFound(_0x71eeef,null))[_0x9bed('0x16')](function(_0x5206d6){if(_0x5206d6){_0x2fe415[_0x9bed('0x40')]=_[_0x9bed('0x41')](db[_0x9bed('0x61')]['rawAttributes']);_0x2fe415[_0x9bed('0x3e')]=_[_0x9bed('0x41')](_0x2f6012[_0x9bed('0x3e')]);_0x2fe415[_0x9bed('0x42')]=_['intersection'](_0x2fe415[_0x9bed('0x40')],_0x2fe415[_0x9bed('0x3e')]);_0xf06e2[_0x9bed('0x43')]=_[_0x9bed('0x44')](_0x2fe415[_0x9bed('0x40')],qs['fields'](_0x2f6012[_0x9bed('0x3e')][_0x9bed('0x45')]));_0xf06e2[_0x9bed('0x43')]=_0xf06e2[_0x9bed('0x43')]['length']?_0xf06e2['attributes']:_0x2fe415[_0x9bed('0x40')];if(!_0x2f6012[_0x9bed('0x3e')]['hasOwnProperty'](_0x9bed('0x9c'))){_0xf06e2['limit']=qs[_0x9bed('0x26')](_0x2f6012['query'][_0x9bed('0x26')]);_0xf06e2[_0x9bed('0x23')]=qs[_0x9bed('0x23')](_0x2f6012['query'][_0x9bed('0x23')]);}_0xf06e2['order']=qs['sort'](_0x2f6012['query'][_0x9bed('0x9d')]);_0xf06e2[_0x9bed('0x9e')]=qs[_0x9bed('0x42')](_[_0x9bed('0x9f')](_0x2f6012[_0x9bed('0x3e')],_0x2fe415[_0x9bed('0x42')]));_0xf06e2[_0x9bed('0x9e')][_0x9bed('0xa0')]=_0x5206d6['id'];if(_0x2f6012[_0x9bed('0x3e')]['filter']){_0xf06e2[_0x9bed('0x9e')]=_[_0x9bed('0x2e')](_0xf06e2[_0x9bed('0x9e')],{'$or':_[_0x9bed('0x35')](_0xf06e2[_0x9bed('0x43')],function(_0x251b77){var _0x3d0b29={};_0x3d0b29[_0x251b77]={'$like':'%'+_0x2f6012[_0x9bed('0x3e')]['filter']+'%'};return _0x3d0b29;})});}if(_0x2f6012['query'][_0x9bed('0xa1')]){var _0x24ae34=_0x2f6012[_0x9bed('0x3e')]['$gte']['split'](',');var _0xc99fb={};_0xc99fb[_0x24ae34[0x0]]={'$gte':moment(_0x24ae34[0x1])[_0x9bed('0x7e')](_0x9bed('0xa2'))};_0xf06e2[_0x9bed('0x9e')]=_[_0x9bed('0x2e')](_0xf06e2['where'],_0xc99fb);}_0xf06e2=_[_0x9bed('0x2e')]({},_0xf06e2,_0x2f6012[_0x9bed('0x48')]);return db['ChatMessage'][_0x9bed('0x25')]({'where':_0xf06e2[_0x9bed('0x9e')]})[_0x9bed('0x16')](function(_0x202f54){_0x55b086[_0x9bed('0x25')]=_0x202f54;if(_0x2f6012[_0x9bed('0x3e')]['includeAll']){_0xf06e2[_0x9bed('0x47')]=[{'all':!![]}];}return db[_0x9bed('0x61')][_0x9bed('0x3c')](_0xf06e2);})[_0x9bed('0x16')](function(_0x2aa10f){_0x55b086[_0x9bed('0xa3')]=_0x2aa10f;return _0x55b086;});}})['then'](respondWithFilteredResult(_0x71eeef,_0xf06e2))[_0x9bed('0x1e')](handleError(_0x71eeef,null));};exports[_0x9bed('0xa4')]=function(_0x4108f2,_0x98d979){var _0x290060={'where':{}},_0x4a1767={},_0x2fa186={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9bed('0x4d')]({'where':{'id':_0x4108f2['params']['id']}})[_0x9bed('0x16')](handleEntityNotFound(_0x98d979,null))[_0x9bed('0x16')](function(_0x516aa8){if(_0x516aa8){_0x4a1767[_0x9bed('0x40')]=_[_0x9bed('0x41')](db[_0x9bed('0x61')][_0x9bed('0x37')]);_0x4a1767['query']=_['keys'](_0x4108f2[_0x9bed('0x3e')]);_0x4a1767[_0x9bed('0x42')]=_[_0x9bed('0x44')](_0x4a1767[_0x9bed('0x40')],_0x4a1767[_0x9bed('0x3e')]);_0x290060[_0x9bed('0x43')]=_[_0x9bed('0x44')](_0x4a1767['model'],qs[_0x9bed('0x45')](_0x4108f2['query'][_0x9bed('0x45')]));_0x290060[_0x9bed('0x43')]=_0x290060['attributes']['length']?_0x290060['attributes']:_0x4a1767[_0x9bed('0x40')];if(!_0x4108f2[_0x9bed('0x3e')][_0x9bed('0xa5')]('nolimit')){_0x290060[_0x9bed('0x26')]=qs['limit'](_0x4108f2[_0x9bed('0x3e')][_0x9bed('0x26')]);_0x290060['offset']=qs[_0x9bed('0x23')](_0x4108f2[_0x9bed('0x3e')][_0x9bed('0x23')]);}_0x290060['order']=qs['sort'](_0x4108f2[_0x9bed('0x3e')][_0x9bed('0x9d')]);_0x290060['where']=qs[_0x9bed('0x42')](_[_0x9bed('0x9f')](_0x4108f2[_0x9bed('0x3e')],_0x4a1767['filters']));_0x290060[_0x9bed('0x9e')][_0x9bed('0xa0')]=_0x516aa8['id'];if(_0x4108f2[_0x9bed('0x3e')][_0x9bed('0xa6')]){_0x290060[_0x9bed('0x9e')]=_[_0x9bed('0x2e')](_0x290060[_0x9bed('0x9e')],{'$or':_[_0x9bed('0x35')](_0x290060['attributes'],function(_0x3bc85a){var _0x1b351b={};_0x1b351b[_0x3bc85a]={'$like':'%'+_0x4108f2['query'][_0x9bed('0xa6')]+'%'};return _0x1b351b;})});}_0x290060[_0x9bed('0x9e')][_0x9bed('0xa7')]=![];if(_0x4108f2['query']['id']){_0x290060[_0x9bed('0x9e')]['id']={'$gt':_0x4108f2['query']['id']};}_0x290060=_[_0x9bed('0x2e')]({},_0x290060,_0x4108f2[_0x9bed('0x48')]);return db[_0x9bed('0x61')][_0x9bed('0x25')]({'where':_0x290060[_0x9bed('0x9e')]})[_0x9bed('0x16')](function(_0x1f2880){_0x2fa186['count']=_0x1f2880;_0x290060[_0x9bed('0x47')]=[];if(_0x4108f2['query'][_0x9bed('0xa8')]){_0x290060[_0x9bed('0x47')][_0x9bed('0xa9')]({'model':db[_0x9bed('0x8c')],'as':_0x9bed('0x8c'),'attributes':['id',_0x9bed('0x55'),_0x9bed('0xaa')]});}if(_0x4108f2[_0x9bed('0x3e')]['includeAll']){_0x290060[_0x9bed('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x9bed('0x3c')](_0x290060);})[_0x9bed('0x16')](function(_0x10bdb2){_0x2fa186[_0x9bed('0xa3')]=_0x10bdb2;return _0x2fa186;});}})[_0x9bed('0x16')](respondWithFilteredResult(_0x98d979,_0x290060))[_0x9bed('0x1e')](handleError(_0x98d979,null));};exports[_0x9bed('0xab')]=function(_0x2bd930,_0x1972eb){return db[_0x9bed('0x36')][_0x9bed('0x49')]({'where':{'id':_0x2bd930['params']['id']}})['then'](handleEntityNotFound(_0x1972eb,null))[_0x9bed('0x16')](function(_0x4aad37){if(_0x4aad37){return _0x4aad37[_0x9bed('0xac')](_0x2bd930[_0x9bed('0x2f')][_0x9bed('0x9b')],_['omit'](_0x2bd930[_0x9bed('0x2f')],['ids','id'])||{})[_0x9bed('0xad')](function(){return db[_0x9bed('0xae')][_0x9bed('0x3c')]({'attributes':['id',_0x9bed('0x2c'),_0x9bed('0xaf')],'where':{'id':_0x2bd930[_0x9bed('0x2f')][_0x9bed('0x9b')]}});})[_0x9bed('0x16')](function(_0x2a8dd0){socket['emit'](_0x9bed('0xb0'),{'id':Number(_0x2bd930[_0x9bed('0x3f')]['id']),'tags':_0x2a8dd0||[]});return{'id':Number(_0x2bd930['params']['id']),'tags':_0x2a8dd0||[]};});}})[_0x9bed('0x16')](respondWithResult(_0x1972eb,null))[_0x9bed('0x1e')](handleError(_0x1972eb,null));};exports['removeTags']=function(_0x3deb14,_0x4ee306){return db[_0x9bed('0x36')]['find']({'where':{'id':_0x3deb14['params']['id']}})[_0x9bed('0x16')](handleEntityNotFound(_0x4ee306,null))[_0x9bed('0x16')](function(_0x5ca86b){if(_0x5ca86b){return _0x5ca86b[_0x9bed('0xb1')](_0x3deb14[_0x9bed('0x3e')][_0x9bed('0x9b')]);}})['then'](respondWithStatusCode(_0x4ee306,null))[_0x9bed('0x1e')](handleError(_0x4ee306,null));};exports['download']=function(_0x341ccf,_0x3ff7c4){var _0x1c4a0c=moment()[_0x9bed('0xb2')]()[_0x9bed('0xb3')]();var _0x271ad3=path[_0x9bed('0x77')](config[_0x9bed('0x78')],_0x9bed('0xb4'),'files','tmp');var _0x4c81df=path[_0x9bed('0x77')](config['root'],_0x9bed('0xb4'),_0x9bed('0xb5'),'attachments');var _0x2c59d8=path[_0x9bed('0x77')](_0x271ad3,_0x1c4a0c);var _0x14f533=util['format'](_0x9bed('0xb6'),_0x341ccf[_0x9bed('0x3f')]['id'],_0x1c4a0c);var _0x21073e=path[_0x9bed('0x77')](_0x271ad3,_0x14f533);var _0x4ff1d6=[];_0x4ff1d6[_0x9bed('0xa9')]({'model':db[_0x9bed('0x8c')],'as':_0x9bed('0x8c'),'attributes':['id',_0x9bed('0x55')],'raw':!![]});_0x4ff1d6['push']({'model':db[_0x9bed('0x81')],'as':_0x9bed('0x65'),'attributes':['id',_0x9bed('0xb7'),_0x9bed('0xb8')],'raw':!![]});if(_0x341ccf[_0x9bed('0x3e')][_0x9bed('0xb9')]){_0x4ff1d6[_0x9bed('0xa9')]({'model':db[_0x9bed('0xba')],'as':_0x9bed('0xba'),'raw':!![]});}var _0x57339f=[{'model':db[_0x9bed('0x61')],'as':'Messages','attributes':['id',_0x9bed('0x2f'),_0x9bed('0x8f'),_0x9bed('0x91'),'secret',_0x9bed('0xbb')],'include':_0x4ff1d6}];_0x57339f[_0x9bed('0xa9')]({'model':db['ChatWebsite'],'as':_0x9bed('0xbc'),'attributes':['id',_0x9bed('0x2c')]});_0x57339f[_0x9bed('0xa9')]({'model':db['User'],'as':_0x9bed('0xbd'),'attributes':['id',_0x9bed('0x55')]});return db[_0x9bed('0x36')][_0x9bed('0x49')]({'where':{'id':_0x341ccf['params']['id']},'include':_0x57339f})[_0x9bed('0x16')](handleEntityNotFound(_0x3ff7c4,null))[_0x9bed('0x16')](function(_0x439c71){if(_0x439c71){var _0x436d99=_0x439c71[_0x9bed('0xbe')]({'plain':!![]});fs[_0x9bed('0xbf')](_0x2c59d8);var _0x4beeb7={'channel':'Chat','account':_0x436d99[_0x9bed('0xbc')][_0x9bed('0x2c')],'agent':_0x436d99['Owner']?_0x436d99['Owner'][_0x9bed('0x55')]:_0x9bed('0xc0'),'createdAt':moment(_0x436d99[_0x9bed('0x8f')])[_0x9bed('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x436d99['closed']?moment(_0x436d99[_0x9bed('0xc1')])[_0x9bed('0x7e')](_0x9bed('0xa2'))[_0x9bed('0xb3')]():'','disposition':_0x436d99['disposition'],'chatInfo':{'browser':_0x436d99['browserName'],'os':_0x436d99['osName'],'referer':_0x436d99[_0x9bed('0xc2')],'customerIp':_0x436d99[_0x9bed('0xc3')],'customerPort':_0x436d99['customerPort']?_0x436d99[_0x9bed('0xc4')]:'N.A.'},'messages':_(_0x436d99['Messages'])[_0x9bed('0xc5')]()[_0x9bed('0xa6')]({'secret':![]})[_0x9bed('0x35')](function(_0x32fac0){if(_0x32fac0[_0x9bed('0xba')]){var _0x22a374=path['join'](_0x4c81df,_0x32fac0[_0x9bed('0xba')]['basename']);if(fs['existsSync'](_0x22a374)){fs[_0x9bed('0xc6')](_0x22a374)[_0x9bed('0xc7')](fs[_0x9bed('0xc8')](path['join'](_0x2c59d8,_0x32fac0['Attachment']['basename'])));}}return{'date':moment(_0x32fac0['createdAt'])[_0x9bed('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9bed('0xb3')](),'sender':_0x32fac0[_0x9bed('0x91')]==='out'?_0x32fac0['User']?_0x32fac0[_0x9bed('0x8c')][_0x9bed('0x55')]:_0x9bed('0x87'):_0x32fac0['Contact'][_0x9bed('0xb7')]+(_0x32fac0[_0x9bed('0x65')][_0x9bed('0xb8')]?'\x20'+_0x32fac0['Contact'][_0x9bed('0xb8')]:''),'body':_0x32fac0[_0x9bed('0xba')]?_0x32fac0['Attachment'][_0x9bed('0x6f')]:_0x32fac0[_0x9bed('0x2f')],'direction':_0x32fac0[_0x9bed('0x91')]===_0x9bed('0x60')?'A':'C','secret':_0x32fac0[_0x9bed('0xa7')],'read':_0x32fac0[_0x9bed('0xbb')],'attachment':_0x32fac0[_0x9bed('0xba')]};})[_0x9bed('0xc9')]()};return ejs[_0x9bed('0xca')](path[_0x9bed('0x77')](config[_0x9bed('0x78')],_0x9bed('0xb4'),_0x9bed('0xcb'),'downloadInteraction.ejs'),{'interaction':_0x4beeb7})['then'](function(_0x132c93){var _0x421ede=path[_0x9bed('0x77')](_0x2c59d8,_0x9bed('0xcc')+_0x436d99['id']+'-'+_0x1c4a0c+'.pdf');var _0x27569c={'path':_0x421ede,'channel':_0x9bed('0xcd'),'interactionId':_0x436d99['id']};return pdf[_0x9bed('0xce')](_0x132c93,_0x27569c);})['then'](function(){return new Promise(function(_0x1fe146,_0x309fad){zipdir(_0x2c59d8,{'saveTo':_0x21073e},function(_0x12ff36,_0x4490fa){if(_0x12ff36)return _0x309fad(_0x12ff36);return _0x1fe146(_0x4490fa);});})[_0x9bed('0x16')](function(){return new BPromise(function(_0x5305dd,_0x4c346b){rimraf(_0x2c59d8,function(_0x10d4ba){if(_0x10d4ba)_0x4c346b(_0x10d4ba);return _0x5305dd();});});})[_0x9bed('0x16')](function(){return _0x3ff7c4[_0x9bed('0x7b')](_0x21073e,_0x14f533,function(_0x32dd8d){if(_0x32dd8d){logger[_0x9bed('0x1b')](_0x9bed('0xcf'),_0x32dd8d);}else{fs[_0x9bed('0xd0')](_0x21073e);}});});});}else{return _0x3ff7c4[_0x9bed('0x1f')](0xc8);}})[_0x9bed('0x1e')](handleError(_0x3ff7c4,null));};
\ No newline at end of file
+var _0x03fa=['../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','update','destroy','stack','name','send','render','body','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','parse','metadata','Sequelize','ValidationError','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','User','ChatWebsite','ContactId','Messages','format','%s%d','agentAlias','System','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','includeAgent','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Owner','get','mkdirSync','Chat','Account','toString','closedAt','browserName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','value','renderFile','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','ioredis','../../components/interaction/service','../../config/logger','api'];(function(_0x302c75,_0x3701e7){var _0x473a4d=function(_0x117dbb){while(--_0x117dbb){_0x302c75['push'](_0x302c75['shift']());}};_0x473a4d(++_0x3701e7);}(_0x03fa,0x199));var _0xa03f=function(_0x346097,_0xf7c47b){_0x346097=_0x346097-0x0;var _0x52065e=_0x03fa[_0x346097];return _0x52065e;};'use strict';var rimraf=require(_0xa03f('0x0'));var zipdir=require(_0xa03f('0x1'));var rp=require('request-promise');var moment=require(_0xa03f('0x2'));var BPromise=require(_0xa03f('0x3'));var Mustache=require(_0xa03f('0x4'));var util=require(_0xa03f('0x5'));var path=require('path');var ejs=require(_0xa03f('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa03f('0x7'));var interaction=require(_0xa03f('0x8'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xa03f('0x9'))(_0xa03f('0xa'));var config=require('../../config/environment');var db=require(_0xa03f('0xb'))['db'];config['redis']=_[_0xa03f('0xc')](config['redis'],{'host':_0xa03f('0xd'),'port':0x18eb});var socket=require(_0xa03f('0xe'))(new Redis(config[_0xa03f('0xf')]));require(_0xa03f('0x10'))[_0xa03f('0x11')](socket);var jayson=require(_0xa03f('0x12'));var client=jayson[_0xa03f('0x13')][_0xa03f('0x14')]({'port':0x232b});var client9004=jayson[_0xa03f('0x13')][_0xa03f('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x1c7d2e,_0x31878b,_0x4fb1c2,_0x4ef29a){return new BPromise(function(_0x5ca89e,_0x4cf73f){var _0x365403=_0x4ef29a||client;return _0x365403[_0xa03f('0x15')](_0x1c7d2e,_0x4fb1c2)[_0xa03f('0x16')](function(_0x53785a){logger[_0xa03f('0x17')](_0xa03f('0x18'),_0x31878b,_0xa03f('0x19'));logger['debug'](_0xa03f('0x1a'),_0x31878b,_0xa03f('0x19'),JSON[_0xa03f('0x1b')](_0x53785a));if(_0x53785a[_0xa03f('0x1c')]){if(_0x53785a['error']['code']===0x1f4){logger[_0xa03f('0x1c')](_0xa03f('0x18'),_0x31878b,_0x53785a[_0xa03f('0x1c')][_0xa03f('0x1d')]);return _0x4cf73f(_0x53785a['error'][_0xa03f('0x1d')]);}logger[_0xa03f('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x31878b,_0x53785a[_0xa03f('0x1c')][_0xa03f('0x1d')]);return _0x5ca89e(_0x53785a['error'][_0xa03f('0x1d')]);}else{logger[_0xa03f('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x31878b,_0xa03f('0x19'));_0x5ca89e(_0x53785a[_0xa03f('0x1e')][_0xa03f('0x1d')]);}})[_0xa03f('0x1f')](function(_0x43ac65){logger[_0xa03f('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x31878b,_0x43ac65);_0x4cf73f(_0x43ac65);});});}function respondWithStatusCode(_0xbbd263,_0x2b03f6){_0x2b03f6=_0x2b03f6||0xcc;return function(_0x22472c){if(_0x22472c){return _0xbbd263[_0xa03f('0x20')](_0x2b03f6);}return _0xbbd263['status'](_0x2b03f6)[_0xa03f('0x21')]();};}function respondWithResult(_0x5b0313,_0x3ee6eb){_0x3ee6eb=_0x3ee6eb||0xc8;return function(_0x4c9287){if(_0x4c9287){return _0x5b0313[_0xa03f('0x22')](_0x3ee6eb)[_0xa03f('0x23')](_0x4c9287);}};}function respondWithFilteredResult(_0x4e4d44,_0x6ed85e){return function(_0x36c817){if(_0x36c817){var _0xc158cf=typeof _0x6ed85e['offset']===_0xa03f('0x24')&&typeof _0x6ed85e['limit']===_0xa03f('0x24');var _0x589c5a=_0x36c817[_0xa03f('0x25')];var _0x84769c=_0xc158cf?0x0:_0x6ed85e[_0xa03f('0x26')];var _0x25a272=_0xc158cf?_0x36c817[_0xa03f('0x25')]:_0x6ed85e[_0xa03f('0x26')]+_0x6ed85e[_0xa03f('0x27')];var _0xa114b1;if(_0x25a272>=_0x589c5a){_0x25a272=_0x589c5a;_0xa114b1=0xc8;}else{_0xa114b1=0xce;}_0x4e4d44[_0xa03f('0x22')](_0xa114b1);return _0x4e4d44[_0xa03f('0x28')](_0xa03f('0x29'),_0x84769c+'-'+_0x25a272+'/'+_0x589c5a)[_0xa03f('0x23')](_0x36c817);}return null;};}function saveUpdates(_0x2ac4ec){return function(_0xe502ac){if(_0xe502ac){return _0xe502ac[_0xa03f('0x2a')](_0x2ac4ec)[_0xa03f('0x16')](function(_0x5f3207){return _0x5f3207;});}return null;};}function removeEntity(_0x11298d){return function(_0x6a57cd){if(_0x6a57cd){return _0x6a57cd[_0xa03f('0x2b')]()[_0xa03f('0x16')](function(){_0x11298d[_0xa03f('0x22')](0xcc)[_0xa03f('0x21')]();});}};}function handleEntityNotFound(_0x4f7fce){return function(_0x36eff6){if(!_0x36eff6){_0x4f7fce[_0xa03f('0x20')](0x194);}return _0x36eff6;};}function handleError(_0x22d5b3,_0x1c1b5e){_0x1c1b5e=_0x1c1b5e||0x1f4;return function(_0x10336d){logger[_0xa03f('0x1c')](_0x10336d[_0xa03f('0x2c')]);if(_0x10336d[_0xa03f('0x2d')]){delete _0x10336d[_0xa03f('0x2d')];}_0x22d5b3['status'](_0x1c1b5e)[_0xa03f('0x2e')](_0x10336d);};}function getMustacheRender(_0x1da92c,_0x53214a){return Mustache[_0xa03f('0x2f')](_0x1da92c,_['merge'](_0x53214a[_0xa03f('0x30')],{'contact':_0x53214a['contact'],'message':_0x53214a[_0xa03f('0x1d')],'agent':_0x53214a[_0xa03f('0x31')],'interaction':_0x53214a[_0xa03f('0x32')],'account':_0x53214a[_0xa03f('0x33')]}))||'';}exports[_0xa03f('0x34')]=function(_0xdb9cff,_0x22b56f){var _0x2083a3={};var _0x30a050=_[_0xa03f('0x35')](db[_0xa03f('0x36')]['rawAttributes'],function(_0x25114b){return{'name':_0x25114b[_0xa03f('0x37')],'type':_0x25114b[_0xa03f('0x38')][_0xa03f('0x39')]};});_0x2083a3=qs['getOptions'](_0x30a050,_0xdb9cff);return interaction[_0xa03f('0x3a')](_0xa03f('0x3b'),_0xdb9cff[_0xa03f('0x3c')],_0xdb9cff[_0xa03f('0x3d')],_0x2083a3,_0x30a050)[_0xa03f('0x16')](respondWithFilteredResult(_0x22b56f,_0x2083a3))['catch'](handleError(_0x22b56f,null));};exports[_0xa03f('0x3e')]=function(_0x552ba0,_0x297fca){var _0x12740a={'raw':![],'where':{'id':_0x552ba0[_0xa03f('0x3f')]['id']}},_0x10f354={};_0x10f354[_0xa03f('0x40')]=_[_0xa03f('0x41')](db[_0xa03f('0x36')][_0xa03f('0x42')]);_0x10f354[_0xa03f('0x3c')]=_['keys'](_0x552ba0['query']);_0x10f354[_0xa03f('0x43')]=_[_0xa03f('0x44')](_0x10f354[_0xa03f('0x40')],_0x10f354[_0xa03f('0x3c')]);_0x12740a[_0xa03f('0x45')]=_[_0xa03f('0x44')](_0x10f354[_0xa03f('0x40')],qs[_0xa03f('0x46')](_0x552ba0['query'][_0xa03f('0x46')]));_0x12740a[_0xa03f('0x45')]=_0x12740a['attributes'][_0xa03f('0x47')]?_0x12740a['attributes']:_0x10f354['model'];if(_0x552ba0[_0xa03f('0x3c')][_0xa03f('0x48')]){_0x12740a['include']=[{'all':!![]}];}_0x12740a=_[_0xa03f('0x49')]({},_0x12740a,_0x552ba0[_0xa03f('0x4a')]);return db[_0xa03f('0x36')][_0xa03f('0x4b')](_0x12740a)[_0xa03f('0x16')](handleEntityNotFound(_0x297fca,null))[_0xa03f('0x16')](respondWithResult(_0x297fca,null))[_0xa03f('0x1f')](handleError(_0x297fca,null));};exports[_0xa03f('0x4c')]=function(_0x51cf58,_0x1e1961){return db['ChatInteraction'][_0xa03f('0x4c')](_0x51cf58[_0xa03f('0x30')],{})[_0xa03f('0x16')](respondWithResult(_0x1e1961,0xc9))[_0xa03f('0x1f')](handleError(_0x1e1961,null));};exports['update']=function(_0x583449,_0x1211cc){if(_0x583449['body']['id']){delete _0x583449[_0xa03f('0x30')]['id'];}return db[_0xa03f('0x36')][_0xa03f('0x4b')]({'where':{'id':_0x583449[_0xa03f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1211cc,null))[_0xa03f('0x16')](saveUpdates(_0x583449[_0xa03f('0x30')],null))[_0xa03f('0x16')](respondWithResult(_0x1211cc,null))[_0xa03f('0x1f')](handleError(_0x1211cc,null));};exports['destroy']=function(_0x31145f,_0x8e4b13){return db[_0xa03f('0x36')]['find']({'where':{'id':_0x31145f[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x8e4b13,null))['then'](removeEntity(_0x8e4b13,null))[_0xa03f('0x1f')](handleError(_0x8e4b13,null));};exports[_0xa03f('0x4d')]=function(_0xfb610,_0x4272c2){return db[_0xa03f('0x36')][_0xa03f('0x4d')]()['then'](respondWithResult(_0x4272c2,null))['catch'](handleError(_0x4272c2,null));};exports[_0xa03f('0x4e')]=function(_0x3bec9e,_0x4ec390){var _0x173df4=_0x3bec9e[_0xa03f('0x3f')]['id'];var _0x3f8a2a;var _0x1b35b6;var _0xcd3ff1;return db['ChatInteraction'][_0xa03f('0x4f')]({'where':{'id':_0x173df4}})[_0xa03f('0x16')](function(_0x3bd8f6){_0x3f8a2a=_0x3bd8f6;return db['ChatWebsite'][_0xa03f('0x4f')]({'where':{'id':_0x3bd8f6[_0xa03f('0x50')]},'attributes':['id','vidaooApiKey',_0xa03f('0x51'),_0xa03f('0x52'),_0xa03f('0x53'),_0xa03f('0x54')],'raw':!![]});})[_0xa03f('0x16')](function(_0x37c6f4){if(_0x37c6f4&&_0x37c6f4['vidaooApiKey']&&_0x37c6f4[_0xa03f('0x51')]){_0x1b35b6=_0x37c6f4;var _0x5dd430={'interaction':{'id':_0x173df4},'agent':{'id':_0x3bec9e[_0xa03f('0x3d')]['id'],'name':_0x3bec9e[_0xa03f('0x3d')][_0xa03f('0x2d')],'fullname':_0x3bec9e[_0xa03f('0x3d')]['fullname'],'email':_0x3bec9e[_0xa03f('0x3d')][_0xa03f('0x55')]},'contact':_0x3bec9e[_0xa03f('0x30')][_0xa03f('0x56')],'account':_0x3bec9e[_0xa03f('0x30')]['account']};var _0x547d1f={'rejectUnauthorized':![],'method':_0xa03f('0x57'),'url':_0xa03f('0x58'),'headers':{'X-APIKEY':_0x37c6f4[_0xa03f('0x59')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3bec9e['user'][_0xa03f('0x55')]],'buttons':null,'topic':_0x1b35b6['vidaooTopic'],'note':_[_0xa03f('0x5a')](_0x1b35b6[_0xa03f('0x53')])?null:getMustacheRender(_0x1b35b6['vidaooNote'],_0x5dd430),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xa03f('0x5a')](_0x1b35b6[_0xa03f('0x54')])){var _0x230a94=getMustacheRender(_0x1b35b6['vidaooMetadata'],_0x5dd430);var _0x30e95c=JSON[_0xa03f('0x5b')](_0x230a94);_0x547d1f[_0xa03f('0x30')][_0xa03f('0x5c')]=_0x30e95c;}}catch(_0x426ef7){throw new db[(_0xa03f('0x5d'))][(_0xa03f('0x5e'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x547d1f);}else{throw new db[(_0xa03f('0x5d'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x17967b){_0xcd3ff1=_0x17967b;if(_0xcd3ff1['id']){var _0x35986e={'body':_0xcd3ff1[_0xa03f('0x5f')],'ChatWebsiteId':_0x1b35b6['id'],'ChatInteractionId':_0x3f8a2a['id'],'direction':_0xa03f('0x60'),'UserId':_0x3bec9e['user']['id']};return db[_0xa03f('0x61')][_0xa03f('0x4c')](_0x35986e,{});}else{throw new db[(_0xa03f('0x5d'))][(_0xa03f('0x5e'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x3f8a2a[_0xa03f('0x62')]({'vidaooSessionId':_0xcd3ff1['id']});})[_0xa03f('0x16')](respondWithResult(_0x4ec390,null))['catch'](handleError(_0x4ec390,null));};exports[_0xa03f('0x63')]=function(_0x16ce62,_0x25a831){if(_0x16ce62[_0xa03f('0x30')]['id']){delete _0x16ce62['body']['id'];}return db[_0xa03f('0x36')]['find']({'where':{'id':_0x16ce62['params']['id']},'include':[{'model':db[_0xa03f('0x64')],'as':_0xa03f('0x65')}]})[_0xa03f('0x16')](handleEntityNotFound(_0x25a831,null))[_0xa03f('0x16')](saveUpdates(_0x16ce62['body'],null))[_0xa03f('0x16')](respondWithResult(_0x25a831,null))[_0xa03f('0x1f')](handleError(_0x25a831,null));};exports[_0xa03f('0x66')]=function(_0x2e234c,_0x588b0a){if(_0x2e234c[_0xa03f('0x30')]['id']){delete _0x2e234c[_0xa03f('0x30')]['id'];}return db[_0xa03f('0x36')]['find']({'where':{'id':_0x2e234c[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](function(_0x2b3cc5){if(!_0x2b3cc5){logger[_0xa03f('0x1c')](_0xa03f('0x67'),'abandon',0x194,'entity\x20not\x20found');_0x588b0a[_0xa03f('0x20')](0x194);}else{if(_0x2b3cc5[_0xa03f('0x68')]){throw new db[(_0xa03f('0x5d'))][(_0xa03f('0x5e'))](_0xa03f('0x69'));}}return _0x2b3cc5;})[_0xa03f('0x16')](function(_0x189044){if(_0x189044){return _0x189044[_0xa03f('0x2a')]({'closed':_0x2e234c[_0xa03f('0x30')][_0xa03f('0x6a')],'disposition':_0x2e234c['body'][_0xa03f('0x6b')]})[_0xa03f('0x16')](function(_0x2159b8){return _0x2159b8;});}})[_0xa03f('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0xa03f('0x66'),_0x2e234c[_0xa03f('0x30')],client9004);})[_0xa03f('0x16')](respondWithResult(_0x588b0a,null))['catch'](handleError(_0x588b0a,null));};exports[_0xa03f('0x6c')]=function(_0x49e6fc,_0x35d137){_0x49e6fc[_0xa03f('0x30')][_0xa03f('0x2d')]=_0x49e6fc[_0xa03f('0x6d')]['originalname'];_0x49e6fc['body'][_0xa03f('0x6e')]=_0x49e6fc[_0xa03f('0x6d')][_0xa03f('0x6f')];_0x49e6fc[_0xa03f('0x30')]['type']=_0x49e6fc['file'][_0xa03f('0x70')];return db[_0xa03f('0x71')][_0xa03f('0x4c')](_0x49e6fc[_0xa03f('0x30')])[_0xa03f('0x16')](respondWithResult(_0x35d137,0xc9))[_0xa03f('0x1f')](handleError(_0x35d137,null));};exports[_0xa03f('0x72')]=function(_0x2007aa,_0x47e512){return db[_0xa03f('0x36')][_0xa03f('0x4f')]({'where':{'id':_0x2007aa[_0xa03f('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x47e512,null))['then'](function(_0x4708a4){if(_0x4708a4){if(_0x4708a4['closed']){return _0x47e512['status'](0x193)[_0xa03f('0x23')]({'status':0x193,'message':_0xa03f('0x73')});}return db['Attachment'][_0xa03f('0x4f')]({'where':{'id':_0x2007aa[_0xa03f('0x3c')]['attachId']},'raw':!![]})[_0xa03f('0x16')](handleEntityNotFound(_0x47e512,null));}})[_0xa03f('0x16')](function(_0x556f7a){if(_0x556f7a){var _0x1a5bf6=_0x556f7a['ChatOfflineMessageId']!==null;var _0x1b83f0=path[_0xa03f('0x74')](config[_0xa03f('0x75')],_0xa03f('0x76'));if(_0x1a5bf6){_0x1b83f0=path[_0xa03f('0x74')](_0x1b83f0,'offline-chat/');}var _0x4b783d=path[_0xa03f('0x74')](_0x1b83f0,_0x556f7a['basename']);return _0x47e512[_0xa03f('0x77')](_0x4b783d);}})[_0xa03f('0x1f')](handleError(_0x47e512,null));};exports[_0xa03f('0x78')]=function(_0x4dfb95,_0x4bed41){var _0x3afed5=null;var _0x5b22d9=null;var _0x449764=null;if(_0x4dfb95[_0xa03f('0x30')]['id']){delete _0x4dfb95[_0xa03f('0x30')]['id'];}if(_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x79')]){_0x449764=path[_0xa03f('0x74')](config['root'],_0xa03f('0x7a'),util['format']('transcript-%s.txt',Date[_0xa03f('0x7b')]()));_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x7c')]=_0x449764;}return db[_0xa03f('0x36')]['find']({'where':{'id':_0x4dfb95[_0xa03f('0x3f')]['id']},'include':[{'model':db[_0xa03f('0x61')],'as':'Messages','include':[{'model':db[_0xa03f('0x7d')],'as':_0xa03f('0x7d')}]}]})[_0xa03f('0x16')](handleEntityNotFound(_0x4bed41,null))[_0xa03f('0x16')](saveUpdates(_0x4dfb95['body'],null))[_0xa03f('0x16')](function(_0x2c1d4f){if(_0x2c1d4f){_0x3afed5=_0x2c1d4f;return db[_0xa03f('0x7e')][_0xa03f('0x4b')]({'where':{'id':_0x3afed5[_0xa03f('0x50')]}});}})[_0xa03f('0x16')](function(_0x217aae){if(_0x217aae){_0x5b22d9=_0x217aae;return db['CmContact'][_0xa03f('0x4b')]({'where':{'id':_0x3afed5[_0xa03f('0x7f')]}});}})[_0xa03f('0x16')](function(_0x166d99){if(_0x166d99){if(_0x449764){var _0x31cad5=null;for(var _0x5ee519=0x1;_0x5ee519<_0x3afed5[_0xa03f('0x80')]['length'];++_0x5ee519){_0x31cad5=_0x3afed5[_0xa03f('0x80')][_0x5ee519];var _0x4e3fa2=_0x31cad5[_0xa03f('0x68')]?util[_0xa03f('0x81')](_0xa03f('0x82'),_0x5b22d9[_0xa03f('0x83')],_0x31cad5[_0xa03f('0x68')]):_0xa03f('0x84');var _0x4ff0e9=_0x4dfb95['body']['customer']||util[_0xa03f('0x81')](_0xa03f('0x82'),'Visitor',_0x31cad5[_0xa03f('0x7f')]);switch(_0x5b22d9[_0xa03f('0x85')]){case _0xa03f('0x86'):_0x4e3fa2=_0x31cad5[_0xa03f('0x68')]?util['format'](_0xa03f('0x82'),_0x5b22d9[_0xa03f('0x83')],_0x31cad5['UserId']):'System';break;case _0xa03f('0x87'):_0x4e3fa2=_0x31cad5['UserId']?_0x31cad5[_0xa03f('0x7d')][_0xa03f('0x88')]||_0x31cad5[_0xa03f('0x7d')][_0xa03f('0x89')]:_0xa03f('0x84');break;case _0xa03f('0x8a'):_0x4e3fa2=_0x31cad5['UserId']?_0x31cad5['User'][_0xa03f('0x89')]:_0xa03f('0x84');break;default:_0x4e3fa2=_0x31cad5['UserId']?util[_0xa03f('0x81')]('%s%d',_0x5b22d9[_0xa03f('0x83')],_0x31cad5[_0xa03f('0x68')]):_0xa03f('0x84');}var _0x5b36f5=util[_0xa03f('0x81')](_0xa03f('0x8b'),moment(_0x31cad5[_0xa03f('0x8c')])[_0xa03f('0x81')](_0xa03f('0x8d')),_0x31cad5[_0xa03f('0x8e')]==='in'?_0x4ff0e9:_0x4e3fa2,_0x31cad5['body']);if(!_0x31cad5['secret']){fs['appendFileSync'](_0x449764,_0x5b36f5);}}return db[_0xa03f('0x8f')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa03f('0x90')],'as':_0xa03f('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa03f('0x92'),'raw':!![]}]}]});}}})[_0xa03f('0x16')](function(_0x40af97){if(!_0x40af97||!_0x40af97[_0xa03f('0x91')]||!_0x4dfb95['body'])return _0x3afed5;var _0x331816=_0x40af97[_0xa03f('0x93')]();return respondWithRpcPromise(_0xa03f('0x94'),_0xa03f('0x95'),{'account':_0x331816,'message':{'from':util[_0xa03f('0x81')](_0xa03f('0x96'),_0x40af97['name'],_0x40af97[_0xa03f('0x55')]||_0x40af97[_0xa03f('0x91')][_0xa03f('0x3d')]),'to':_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x79')],'subject':_0xa03f('0x97'),'text':util[_0xa03f('0x81')](_0xa03f('0x98'),_0x4dfb95[_0xa03f('0x30')][_0xa03f('0x79')]),'attachments':[{'path':_0x449764}]}})[_0xa03f('0x16')](function(){return _0x3afed5;})['catch'](function(_0x2d0c46){logger[_0xa03f('0x1c')](_0x2d0c46);});})[_0xa03f('0x16')](respondWithStatusCode(_0x4bed41,0xc8))[_0xa03f('0x1f')](handleError(_0x4bed41,null));};exports[_0xa03f('0x99')]=function(_0x378bbc,_0x437572){return db['ChatMessage'][_0xa03f('0x4b')]({'where':{'id':_0x378bbc[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x437572,null))['then'](function(_0x160ac7){if(_0x160ac7){return _0x160ac7['addMessage'](_0x378bbc['body'][_0xa03f('0x9a')],_[_0xa03f('0x9b')](_0x378bbc['body'],[_0xa03f('0x9a'),'id'])||{});}})[_0xa03f('0x16')](respondWithResult(_0x437572,null))['catch'](handleError(_0x437572,null));};exports[_0xa03f('0x9c')]=function(_0x10bd39,_0x4b1fdb){var _0x47124a={'raw':![],'where':{}};var _0x23f603={};var _0x4c8ca1={'count':0x0,'rows':[]};return db[_0xa03f('0x36')]['findOne']({'where':{'id':_0x10bd39[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x4b1fdb,null))['then'](function(_0x436e3e){if(_0x436e3e){_0x23f603[_0xa03f('0x40')]=_[_0xa03f('0x41')](db[_0xa03f('0x61')][_0xa03f('0x42')]);_0x23f603[_0xa03f('0x3c')]=_['keys'](_0x10bd39[_0xa03f('0x3c')]);_0x23f603[_0xa03f('0x43')]=_[_0xa03f('0x44')](_0x23f603['model'],_0x23f603[_0xa03f('0x3c')]);_0x47124a[_0xa03f('0x45')]=_[_0xa03f('0x44')](_0x23f603[_0xa03f('0x40')],qs['fields'](_0x10bd39[_0xa03f('0x3c')][_0xa03f('0x46')]));_0x47124a[_0xa03f('0x45')]=_0x47124a[_0xa03f('0x45')][_0xa03f('0x47')]?_0x47124a[_0xa03f('0x45')]:_0x23f603['model'];if(!_0x10bd39['query'][_0xa03f('0x9d')](_0xa03f('0x9e'))){_0x47124a['limit']=qs[_0xa03f('0x27')](_0x10bd39[_0xa03f('0x3c')]['limit']);_0x47124a[_0xa03f('0x26')]=qs['offset'](_0x10bd39[_0xa03f('0x3c')][_0xa03f('0x26')]);}_0x47124a[_0xa03f('0x9f')]=qs[_0xa03f('0xa0')](_0x10bd39[_0xa03f('0x3c')][_0xa03f('0xa0')]);_0x47124a[_0xa03f('0xa1')]=qs[_0xa03f('0x43')](_[_0xa03f('0xa2')](_0x10bd39[_0xa03f('0x3c')],_0x23f603[_0xa03f('0x43')]));_0x47124a[_0xa03f('0xa1')][_0xa03f('0xa3')]=_0x436e3e['id'];if(_0x10bd39[_0xa03f('0x3c')][_0xa03f('0xa4')]){_0x47124a['where']=_[_0xa03f('0x49')](_0x47124a['where'],{'$or':_[_0xa03f('0x35')](_0x47124a[_0xa03f('0x45')],function(_0x221517){var _0x1ec65b={};_0x1ec65b[_0x221517]={'$like':'%'+_0x10bd39['query']['filter']+'%'};return _0x1ec65b;})});}if(_0x10bd39['query'][_0xa03f('0xa5')]){var _0x1cb361=_0x10bd39[_0xa03f('0x3c')][_0xa03f('0xa5')][_0xa03f('0xa6')](',');var _0xb20b91={};_0xb20b91[_0x1cb361[0x0]]={'$gte':moment(_0x1cb361[0x1])[_0xa03f('0x81')](_0xa03f('0xa7'))};_0x47124a[_0xa03f('0xa1')]=_[_0xa03f('0x49')](_0x47124a[_0xa03f('0xa1')],_0xb20b91);}_0x47124a=_[_0xa03f('0x49')]({},_0x47124a,_0x10bd39[_0xa03f('0x4a')]);return db[_0xa03f('0x61')][_0xa03f('0x25')]({'where':_0x47124a['where']})[_0xa03f('0x16')](function(_0x19913e){_0x4c8ca1['count']=_0x19913e;if(_0x10bd39['query'][_0xa03f('0x48')]){_0x47124a[_0xa03f('0xa8')]=[{'all':!![]}];}return db[_0xa03f('0x61')][_0xa03f('0x3a')](_0x47124a);})['then'](function(_0x22dc6d){_0x4c8ca1[_0xa03f('0xa9')]=_0x22dc6d;return _0x4c8ca1;});}})['then'](respondWithFilteredResult(_0x4b1fdb,_0x47124a))[_0xa03f('0x1f')](handleError(_0x4b1fdb,null));};exports[_0xa03f('0xaa')]=function(_0x37d3cb,_0x4f392a){var _0x3da1fb={'where':{}},_0x102103={},_0x53efb8={'count':0x0,'rows':[]};return db[_0xa03f('0x36')]['findOne']({'where':{'id':_0x37d3cb['params']['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x4f392a,null))['then'](function(_0x53fbac){if(_0x53fbac){_0x102103[_0xa03f('0x40')]=_[_0xa03f('0x41')](db[_0xa03f('0x61')][_0xa03f('0x42')]);_0x102103[_0xa03f('0x3c')]=_['keys'](_0x37d3cb[_0xa03f('0x3c')]);_0x102103['filters']=_[_0xa03f('0x44')](_0x102103['model'],_0x102103[_0xa03f('0x3c')]);_0x3da1fb[_0xa03f('0x45')]=_[_0xa03f('0x44')](_0x102103[_0xa03f('0x40')],qs[_0xa03f('0x46')](_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x46')]));_0x3da1fb[_0xa03f('0x45')]=_0x3da1fb[_0xa03f('0x45')]['length']?_0x3da1fb[_0xa03f('0x45')]:_0x102103[_0xa03f('0x40')];if(!_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x9d')](_0xa03f('0x9e'))){_0x3da1fb['limit']=qs[_0xa03f('0x27')](_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x27')]);_0x3da1fb[_0xa03f('0x26')]=qs[_0xa03f('0x26')](_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x26')]);}_0x3da1fb[_0xa03f('0x9f')]=qs[_0xa03f('0xa0')](_0x37d3cb[_0xa03f('0x3c')]['sort']);_0x3da1fb[_0xa03f('0xa1')]=qs[_0xa03f('0x43')](_[_0xa03f('0xa2')](_0x37d3cb[_0xa03f('0x3c')],_0x102103[_0xa03f('0x43')]));_0x3da1fb['where'][_0xa03f('0xa3')]=_0x53fbac['id'];if(_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0xa4')]){_0x3da1fb[_0xa03f('0xa1')]=_[_0xa03f('0x49')](_0x3da1fb[_0xa03f('0xa1')],{'$or':_['map'](_0x3da1fb[_0xa03f('0x45')],function(_0xeaa31e){var _0x36f6af={};_0x36f6af[_0xeaa31e]={'$like':'%'+_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0xa4')]+'%'};return _0x36f6af;})});}_0x3da1fb[_0xa03f('0xa1')]['secret']=![];if(_0x37d3cb[_0xa03f('0x3c')]['id']){_0x3da1fb[_0xa03f('0xa1')]['id']={'$gt':_0x37d3cb['query']['id']};}_0x3da1fb=_[_0xa03f('0x49')]({},_0x3da1fb,_0x37d3cb[_0xa03f('0x4a')]);return db[_0xa03f('0x61')][_0xa03f('0x25')]({'where':_0x3da1fb[_0xa03f('0xa1')]})['then'](function(_0x80e591){_0x53efb8['count']=_0x80e591;_0x3da1fb[_0xa03f('0xa8')]=[];if(_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0xab')]){_0x3da1fb[_0xa03f('0xa8')]['push']({'model':db[_0xa03f('0x7d')],'as':_0xa03f('0x7d'),'attributes':['id',_0xa03f('0x89'),'alias']});}if(_0x37d3cb[_0xa03f('0x3c')][_0xa03f('0x48')]){_0x3da1fb[_0xa03f('0xa8')]=[{'all':!![]}];}return db[_0xa03f('0x61')][_0xa03f('0x3a')](_0x3da1fb);})[_0xa03f('0x16')](function(_0x180fdc){_0x53efb8[_0xa03f('0xa9')]=_0x180fdc;return _0x53efb8;});}})[_0xa03f('0x16')](respondWithFilteredResult(_0x4f392a,_0x3da1fb))['catch'](handleError(_0x4f392a,null));};exports[_0xa03f('0xac')]=function(_0x5db843,_0x412a3e){return db['ChatInteraction'][_0xa03f('0x4b')]({'where':{'id':_0x5db843[_0xa03f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x412a3e,null))[_0xa03f('0x16')](function(_0x5a3520){if(_0x5a3520){return _0x5a3520[_0xa03f('0xad')](_0x5db843[_0xa03f('0x30')][_0xa03f('0x9a')],_[_0xa03f('0x9b')](_0x5db843[_0xa03f('0x30')],[_0xa03f('0x9a'),'id'])||{})[_0xa03f('0xae')](function(){return db[_0xa03f('0xaf')][_0xa03f('0x3a')]({'attributes':['id',_0xa03f('0x2d'),'color'],'where':{'id':_0x5db843[_0xa03f('0x30')][_0xa03f('0x9a')]}});})['then'](function(_0x1dd0b6){socket[_0xa03f('0xb0')](_0xa03f('0xb1'),{'id':Number(_0x5db843[_0xa03f('0x3f')]['id']),'tags':_0x1dd0b6||[]});return{'id':Number(_0x5db843[_0xa03f('0x3f')]['id']),'tags':_0x1dd0b6||[]};});}})[_0xa03f('0x16')](respondWithResult(_0x412a3e,null))[_0xa03f('0x1f')](handleError(_0x412a3e,null));};exports[_0xa03f('0xb2')]=function(_0x38d390,_0x4108a6){return db[_0xa03f('0x36')][_0xa03f('0x4b')]({'where':{'id':_0x38d390[_0xa03f('0x3f')]['id']}})[_0xa03f('0x16')](handleEntityNotFound(_0x4108a6,null))[_0xa03f('0x16')](function(_0xf4a0de){if(_0xf4a0de){return _0xf4a0de['removeTags'](_0x38d390[_0xa03f('0x3c')][_0xa03f('0x9a')]);}})[_0xa03f('0x16')](respondWithStatusCode(_0x4108a6,null))[_0xa03f('0x1f')](handleError(_0x4108a6,null));};exports[_0xa03f('0x77')]=function(_0x596435,_0x583fdf){var _0x36d6eb=moment()[_0xa03f('0xb3')]()['toString']();var _0x1bc66e=path[_0xa03f('0x74')](config['root'],'server',_0xa03f('0xb4'),_0xa03f('0xb5'));var _0x372fe1=path[_0xa03f('0x74')](config[_0xa03f('0x75')],'server',_0xa03f('0xb4'),_0xa03f('0xb6'));var _0x28ef80=path['join'](_0x1bc66e,_0x36d6eb);var _0x504d44=util[_0xa03f('0x81')](_0xa03f('0xb7'),_0x596435[_0xa03f('0x3f')]['id'],_0x36d6eb);var _0x2713db=path['join'](_0x1bc66e,_0x504d44);var _0x209d70=[];_0x209d70[_0xa03f('0xb8')]({'model':db[_0xa03f('0x7d')],'as':_0xa03f('0x7d'),'attributes':['id',_0xa03f('0x89')],'raw':!![]});_0x209d70[_0xa03f('0xb8')]({'model':db[_0xa03f('0x64')],'as':'Contact','attributes':['id',_0xa03f('0xb9'),_0xa03f('0xba')],'raw':!![]});if(_0x596435[_0xa03f('0x3c')]['attachments']){_0x209d70['push']({'model':db[_0xa03f('0x71')],'as':'Attachment','raw':!![]});}var _0x3febb4=[{'model':db[_0xa03f('0x61')],'as':_0xa03f('0x80'),'attributes':['id',_0xa03f('0x30'),'createdAt',_0xa03f('0x8e'),'secret',_0xa03f('0xbb')],'include':_0x209d70}];_0x3febb4['push']({'model':db[_0xa03f('0x7e')],'as':'Account','attributes':['id','name']});_0x3febb4[_0xa03f('0xb8')]({'model':db[_0xa03f('0x7d')],'as':_0xa03f('0xbc'),'attributes':['id',_0xa03f('0x89')]});return db['ChatInteraction'][_0xa03f('0x4b')]({'where':{'id':_0x596435[_0xa03f('0x3f')]['id']},'include':_0x3febb4})[_0xa03f('0x16')](handleEntityNotFound(_0x583fdf,null))['then'](function(_0x55ea99){if(_0x55ea99){var _0x1060e3=_0x55ea99[_0xa03f('0xbd')]({'plain':!![]});fs[_0xa03f('0xbe')](_0x28ef80);var _0x507e45={'channel':_0xa03f('0xbf'),'account':_0x1060e3[_0xa03f('0xc0')][_0xa03f('0x2d')],'agent':_0x1060e3[_0xa03f('0xbc')]?_0x1060e3[_0xa03f('0xbc')][_0xa03f('0x89')]:'N.A.','createdAt':moment(_0x1060e3[_0xa03f('0x8c')])[_0xa03f('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa03f('0xc1')](),'closedAt':_0x1060e3['closed']?moment(_0x1060e3[_0xa03f('0xc2')])[_0xa03f('0x81')](_0xa03f('0xa7'))[_0xa03f('0xc1')]():'','disposition':_0x1060e3['disposition'],'chatInfo':{'browser':_0x1060e3[_0xa03f('0xc3')],'os':_0x1060e3['osName'],'referer':_0x1060e3[_0xa03f('0xc4')],'customerIp':_0x1060e3[_0xa03f('0xc5')],'customerPort':_0x1060e3[_0xa03f('0xc6')]?_0x1060e3[_0xa03f('0xc6')]:_0xa03f('0xc7')},'messages':_(_0x1060e3[_0xa03f('0x80')])[_0xa03f('0xc8')]()[_0xa03f('0xa4')]({'secret':![]})[_0xa03f('0x35')](function(_0x35cd5f){if(_0x35cd5f[_0xa03f('0x71')]){var _0x3a013e=path[_0xa03f('0x74')](_0x372fe1,_0x35cd5f[_0xa03f('0x71')][_0xa03f('0x6e')]);if(fs[_0xa03f('0xc9')](_0x3a013e)){fs[_0xa03f('0xca')](_0x3a013e)[_0xa03f('0xcb')](fs['createWriteStream'](path[_0xa03f('0x74')](_0x28ef80,_0x35cd5f['Attachment'][_0xa03f('0x6e')])));}}return{'date':moment(_0x35cd5f['createdAt'])[_0xa03f('0x81')](_0xa03f('0xa7'))['toString'](),'sender':_0x35cd5f[_0xa03f('0x8e')]===_0xa03f('0x60')?_0x35cd5f['User']?_0x35cd5f[_0xa03f('0x7d')][_0xa03f('0x89')]:'System':_0x35cd5f['Contact']['firstName']+(_0x35cd5f[_0xa03f('0x65')][_0xa03f('0xba')]?'\x20'+_0x35cd5f[_0xa03f('0x65')][_0xa03f('0xba')]:''),'body':_0x35cd5f[_0xa03f('0x71')]?_0x35cd5f[_0xa03f('0x71')]['basename']:_0x35cd5f[_0xa03f('0x30')],'direction':_0x35cd5f[_0xa03f('0x8e')]===_0xa03f('0x60')?'A':'C','secret':_0x35cd5f['secret'],'read':_0x35cd5f['read'],'attachment':_0x35cd5f[_0xa03f('0x71')]};})[_0xa03f('0xcc')]()};return ejs[_0xa03f('0xcd')](path[_0xa03f('0x74')](config[_0xa03f('0x75')],'server','views','downloadInteraction.ejs'),{'interaction':_0x507e45})[_0xa03f('0x16')](function(_0x2e6295){var _0x10c333=path['join'](_0x28ef80,_0xa03f('0xce')+_0x1060e3['id']+'-'+_0x36d6eb+_0xa03f('0xcf'));var _0x202de1={'path':_0x10c333,'channel':_0xa03f('0xbf'),'interactionId':_0x1060e3['id']};return pdf['createPdfFromHTML'](_0x2e6295,_0x202de1);})[_0xa03f('0x16')](function(){return new Promise(function(_0x16e6ef,_0x46b7d2){zipdir(_0x28ef80,{'saveTo':_0x2713db},function(_0x2360fe,_0x16f53b){if(_0x2360fe)return _0x46b7d2(_0x2360fe);return _0x16e6ef(_0x16f53b);});})[_0xa03f('0x16')](function(){return new BPromise(function(_0x4e7878,_0x23b937){rimraf(_0x28ef80,function(_0x5e7733){if(_0x5e7733)_0x23b937(_0x5e7733);return _0x4e7878();});});})['then'](function(){return _0x583fdf[_0xa03f('0x77')](_0x2713db,_0x504d44,function(_0x48ee5e){if(_0x48ee5e){logger['error'](_0xa03f('0xd0'),_0x48ee5e);}else{fs[_0xa03f('0xd1')](_0x2713db);}});});});}else{return _0x583fdf['sendStatus'](0xc8);}})['catch'](handleError(_0x583fdf,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 3327bcb..ba3abf8 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 _0xd02d=['setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','then','Users','map'];(function(_0x22f35d,_0x22fb48){var _0x586a07=function(_0x3a266a){while(--_0x3a266a){_0x22f35d['push'](_0x22f35d['shift']());}};_0x586a07(++_0x22fb48);}(_0xd02d,0x1ab));var _0xdd02=function(_0x2e155b,_0x3169ae){_0x2e155b=_0x2e155b-0x0;var _0x6c0d69=_0xd02d[_0x2e155b];return _0x6c0d69;};'use strict';var EventEmitter=require(_0xdd02('0x0'));var ChatInteraction=require(_0xdd02('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdd02('0x1'))['db'][_0xdd02('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdd02('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd02('0x4'),'afterDestroy':'remove'};function emitEvent(_0x30cb63){return function(_0x30aada,_0x8b969c,_0x37ac8f){_0x30aada['getUsers']({'attributes':['id'],'raw':!![]})[_0xdd02('0x5')](function(_0x53d29b){_0x30aada['setDataValue'](_0xdd02('0x6'),_0x53d29b[_0xdd02('0x7')](function(_0x19875c){return{'id':_0x19875c['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x30aada['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x44c328){_0x30aada[_0xdd02('0x8')]('unreadMessages',_0x44c328[_0xdd02('0x9')]);ChatInteractionEvents[_0xdd02('0xa')](_0x30cb63+':'+_0x30aada['id'],_0x30aada);ChatInteractionEvents[_0xdd02('0xa')](_0x30cb63,_0x30aada);_0x37ac8f(null);})[_0xdd02('0xb')](_0x37ac8f(null));};}for(var e in events){if(events[_0xdd02('0xc')](e)){var event=events[e];ChatInteraction[_0xdd02('0xd')](e,emitEvent(event));}}module[_0xdd02('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9ee6=['../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users','map','emit','catch','hasOwnProperty','exports','events'];(function(_0xc7484e,_0x33d408){var _0x3a2ae7=function(_0xe774f7){while(--_0xe774f7){_0xc7484e['push'](_0xc7484e['shift']());}};_0x3a2ae7(++_0x33d408);}(_0x9ee6,0x11c));var _0x69ee=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0x9ee6[_0x37b3e5];return _0x207f20;};'use strict';var EventEmitter=require(_0x69ee('0x0'));var ChatInteraction=require(_0x69ee('0x1'))['db'][_0x69ee('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x69ee('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x69ee('0x4'),'afterUpdate':'update','afterDestroy':_0x69ee('0x5')};function emitEvent(_0x1b2db6){return function(_0x2f109e,_0x143bb2,_0x154891){_0x2f109e[_0x69ee('0x6')]({'attributes':['id'],'raw':!![]})[_0x69ee('0x7')](function(_0x5cd47a){_0x2f109e[_0x69ee('0x8')](_0x69ee('0x9'),_0x5cd47a[_0x69ee('0xa')](function(_0x49bdcb){return{'id':_0x49bdcb['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2f109e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x69ee('0x7')](function(_0x451a18){_0x2f109e[_0x69ee('0x8')]('unreadMessages',_0x451a18['length']);ChatInteractionEvents[_0x69ee('0xb')](_0x1b2db6+':'+_0x2f109e['id'],_0x2f109e);ChatInteractionEvents[_0x69ee('0xb')](_0x1b2db6,_0x2f109e);_0x154891(null);})[_0x69ee('0xc')](_0x154891(null));};}for(var e in events){if(events[_0x69ee('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x69ee('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 40a7f55..50e701c 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 _0xedbf=['chat_interactions','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xedbf,0xf2));var _0xfedb=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0xedbf[_0x5c6244];return _0x5800ce;};'use strict';var _=require(_0xfedb('0x0'));var util=require(_0xfedb('0x1'));var logger=require(_0xfedb('0x2'))(_0xfedb('0x3'));var moment=require(_0xfedb('0x4'));var BPromise=require(_0xfedb('0x5'));var rp=require(_0xfedb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfedb('0x7'));var config=require(_0xfedb('0x8'));var attributes=require(_0xfedb('0x9'));module[_0xfedb('0xa')]=function(_0x4fb7a5,_0x530ead){return _0x4fb7a5[_0xfedb('0xb')](_0xfedb('0xc'),attributes,{'tableName':_0xfedb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b1013,_0x2fcdff,_0x41ce3f){if(_0x4b1013['changed']('closed')){_0x4b1013[_0xfedb('0xe')]=moment()[_0xfedb('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x41ce3f(null,_0x4b1013);}},'charset':_0xfedb('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0454=['utf8mb4','util','api','moment','request-promise','path','rimraf','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x27e208,_0x4d1182){var _0xcda460=function(_0x2b7f75){while(--_0x2b7f75){_0x27e208['push'](_0x27e208['shift']());}};_0xcda460(++_0x4d1182);}(_0x0454,0x1dd));var _0x4045=function(_0x552a93,_0x154d78){_0x552a93=_0x552a93-0x0;var _0x2a2fed=_0x0454[_0x552a93];return _0x2a2fed;};'use strict';var _=require('lodash');var util=require(_0x4045('0x0'));var logger=require('../../config/logger')(_0x4045('0x1'));var moment=require(_0x4045('0x2'));var BPromise=require('bluebird');var rp=require(_0x4045('0x3'));var fs=require('fs');var path=require(_0x4045('0x4'));var rimraf=require(_0x4045('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x4d12e4,_0x269748){return _0x4d12e4['define'](_0x4045('0x6'),attributes,{'tableName':_0x4045('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2470c3,_0x19fcad,_0x2ab312){if(_0x2470c3[_0x4045('0x8')](_0x4045('0x9'))){_0x2470c3[_0x4045('0xa')]=moment()[_0x4045('0xb')](_0x4045('0xc'));}_0x2ab312(null,_0x2470c3);}},'charset':_0x4045('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d6a41d4..051c3b1 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 _0xf42b=['attributes','limit','then','debug','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf42b,0x64));var _0xbf42=function(_0x556397,_0x49dca4){_0x556397=_0x556397-0x0;var _0x4a593e=_0xf42b[_0x556397];return _0x4a593e;};'use strict';var _=require(_0xbf42('0x0'));var util=require(_0xbf42('0x1'));var moment=require(_0xbf42('0x2'));var BPromise=require(_0xbf42('0x3'));var rs=require(_0xbf42('0x4'));var fs=require('fs');var Redis=require(_0xbf42('0x5'));var db=require(_0xbf42('0x6'))['db'];var utils=require(_0xbf42('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbf42('0x8'));var client=jayson[_0xbf42('0x9')][_0xbf42('0xa')]({'port':0x232a});config[_0xbf42('0xb')]=_[_0xbf42('0xc')](config[_0xbf42('0xb')],{'host':_0xbf42('0xd'),'port':0x18eb});var socket=require(_0xbf42('0xe'))(new Redis(config['redis']));require(_0xbf42('0xf'))[_0xbf42('0x10')](socket);function respondWithRpcPromise(_0x3db589,_0x34acda,_0x1bdf40){return new BPromise(function(_0x232063,_0x2ddc8b){return client[_0xbf42('0x11')](_0x3db589,_0x1bdf40)['then'](function(_0x4646b2){logger[_0xbf42('0x12')](_0xbf42('0x13'),_0x34acda,_0xbf42('0x14'));logger['debug'](_0xbf42('0x15'),_0x34acda,'request\x20sent',JSON[_0xbf42('0x16')](_0x4646b2));if(_0x4646b2[_0xbf42('0x17')]){if(_0x4646b2[_0xbf42('0x17')][_0xbf42('0x18')]===0x1f4){logger['error'](_0xbf42('0x13'),_0x34acda,_0x4646b2[_0xbf42('0x17')][_0xbf42('0x19')]);return _0x2ddc8b(_0x4646b2[_0xbf42('0x17')][_0xbf42('0x19')]);}logger[_0xbf42('0x17')](_0xbf42('0x13'),_0x34acda,_0x4646b2['error']['message']);return _0x232063(_0x4646b2[_0xbf42('0x17')][_0xbf42('0x19')]);}else{logger[_0xbf42('0x12')](_0xbf42('0x13'),_0x34acda,_0xbf42('0x14'));_0x232063(_0x4646b2[_0xbf42('0x1a')][_0xbf42('0x19')]);}})[_0xbf42('0x1b')](function(_0xa77bf1){logger[_0xbf42('0x17')](_0xbf42('0x13'),_0x34acda,_0xa77bf1);_0x2ddc8b(_0xa77bf1);});});}exports[_0xbf42('0x1c')]=function(_0x5d5720){var _0x4924b3=this;return new Promise(function(_0xfeca7b,_0x5a095a){return db[_0xbf42('0x1d')][_0xbf42('0x1e')](_0x5d5720[_0xbf42('0x1f')],{'raw':_0x5d5720[_0xbf42('0x20')]?_0x5d5720['options'][_0xbf42('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d5720['options']?_0x5d5720[_0xbf42('0x20')][_0xbf42('0x22')]||null:null,'attributes':_0x5d5720['options']?_0x5d5720['options'][_0xbf42('0x23')]||null:null,'limit':_0x5d5720[_0xbf42('0x20')]?_0x5d5720[_0xbf42('0x20')][_0xbf42('0x24')]||null:null})[_0xbf42('0x25')](function(_0x4fee90){logger[_0xbf42('0x12')]('UpdateChatInteraction',_0x5d5720);logger[_0xbf42('0x26')](_0xbf42('0x1c'),_0x5d5720,JSON[_0xbf42('0x16')](_0x4fee90));_0xfeca7b(_0x4fee90);})[_0xbf42('0x1b')](function(_0x10d72a){logger[_0xbf42('0x17')](_0xbf42('0x1c'),_0x10d72a[_0xbf42('0x19')],_0x5d5720);_0x5a095a(_0x4924b3[_0xbf42('0x17')](0x1f4,_0x10d72a[_0xbf42('0x19')]));});});};exports[_0xbf42('0x27')]=function(_0x14dce5){return new Promise(function(_0x3b8c3c,_0x4a7557){return db[_0xbf42('0x1d')][_0xbf42('0x28')]({'where':_0x14dce5[_0xbf42('0x20')]?_0x14dce5[_0xbf42('0x20')]['where']||null:null})[_0xbf42('0x25')](function(_0x3c802b){if(_0x3c802b){return _0x3c802b[_0xbf42('0x29')](_0x14dce5[_0xbf42('0x1f')][_0xbf42('0x2a')],_['omit'](_0x14dce5[_0xbf42('0x1f')],['ids','id'])||{});}})[_0xbf42('0x2b')](function(_0x963d38){logger[_0xbf42('0x12')](_0xbf42('0x2c'),_0x14dce5);logger[_0xbf42('0x26')]('AddTags',_0x14dce5,JSON[_0xbf42('0x16')](_0x963d38));_0x3b8c3c(_0x963d38);})[_0xbf42('0x1b')](function(_0x4cecb7){logger['error']('AddTags',_0x4cecb7['message'],_0x14dce5);_0x4a7557(_this[_0xbf42('0x17')](0x1f4,_0x4cecb7[_0xbf42('0x19')]));});});};
\ No newline at end of file
+var _0xedb3=['client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x53e661,_0xc28ce3){var _0xb5873f=function(_0x3a2af5){while(--_0x3a2af5){_0x53e661['push'](_0x53e661['shift']());}};_0xb5873f(++_0xc28ce3);}(_0xedb3,0x1a5));var _0x3edb=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xedb3[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x3edb('0x0'));var util=require('util');var moment=require(_0x3edb('0x1'));var BPromise=require(_0x3edb('0x2'));var rs=require(_0x3edb('0x3'));var fs=require('fs');var Redis=require(_0x3edb('0x4'));var db=require(_0x3edb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3edb('0x6'))(_0x3edb('0x7'));var config=require('../../config/environment');var jayson=require(_0x3edb('0x8'));var client=jayson[_0x3edb('0x9')][_0x3edb('0xa')]({'port':0x232a});config[_0x3edb('0xb')]=_[_0x3edb('0xc')](config[_0x3edb('0xb')],{'host':_0x3edb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3edb('0xb')]));require('./chatInteraction.socket')[_0x3edb('0xe')](socket);function respondWithRpcPromise(_0x2d8eec,_0x3f07b3,_0xdc1591){return new BPromise(function(_0x465f51,_0x2aeb00){return client[_0x3edb('0xf')](_0x2d8eec,_0xdc1591)[_0x3edb('0x10')](function(_0x80ae06){logger[_0x3edb('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3f07b3,'request\x20sent');logger['debug'](_0x3edb('0x12'),_0x3f07b3,_0x3edb('0x13'),JSON[_0x3edb('0x14')](_0x80ae06));if(_0x80ae06[_0x3edb('0x15')]){if(_0x80ae06[_0x3edb('0x15')][_0x3edb('0x16')]===0x1f4){logger[_0x3edb('0x15')](_0x3edb('0x17'),_0x3f07b3,_0x80ae06[_0x3edb('0x15')][_0x3edb('0x18')]);return _0x2aeb00(_0x80ae06[_0x3edb('0x15')][_0x3edb('0x18')]);}logger[_0x3edb('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3f07b3,_0x80ae06[_0x3edb('0x15')][_0x3edb('0x18')]);return _0x465f51(_0x80ae06['error'][_0x3edb('0x18')]);}else{logger[_0x3edb('0x11')](_0x3edb('0x17'),_0x3f07b3,'request\x20sent');_0x465f51(_0x80ae06[_0x3edb('0x19')][_0x3edb('0x18')]);}})[_0x3edb('0x1a')](function(_0x5899da){logger[_0x3edb('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3f07b3,_0x5899da);_0x2aeb00(_0x5899da);});});}exports['UpdateChatInteraction']=function(_0x49e539){var _0x1515e9=this;return new Promise(function(_0x2616cd,_0x1ed4b2){return db['ChatInteraction'][_0x3edb('0x1b')](_0x49e539[_0x3edb('0x1c')],{'raw':_0x49e539[_0x3edb('0x1d')]?_0x49e539[_0x3edb('0x1d')][_0x3edb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49e539['options']?_0x49e539[_0x3edb('0x1d')][_0x3edb('0x1f')]||null:null,'attributes':_0x49e539[_0x3edb('0x1d')]?_0x49e539['options'][_0x3edb('0x20')]||null:null,'limit':_0x49e539[_0x3edb('0x1d')]?_0x49e539[_0x3edb('0x1d')][_0x3edb('0x21')]||null:null})[_0x3edb('0x10')](function(_0x39228e){logger[_0x3edb('0x11')](_0x3edb('0x22'),_0x49e539);logger[_0x3edb('0x23')](_0x3edb('0x22'),_0x49e539,JSON[_0x3edb('0x14')](_0x39228e));_0x2616cd(_0x39228e);})['catch'](function(_0xeef83f){logger[_0x3edb('0x15')](_0x3edb('0x22'),_0xeef83f[_0x3edb('0x18')],_0x49e539);_0x1ed4b2(_0x1515e9[_0x3edb('0x15')](0x1f4,_0xeef83f[_0x3edb('0x18')]));});});};exports[_0x3edb('0x24')]=function(_0x3f73ec){return new Promise(function(_0x3b4804,_0x49460e){return db[_0x3edb('0x25')][_0x3edb('0x26')]({'where':_0x3f73ec[_0x3edb('0x1d')]?_0x3f73ec[_0x3edb('0x1d')]['where']||null:null})[_0x3edb('0x10')](function(_0x12f397){if(_0x12f397){return _0x12f397[_0x3edb('0x27')](_0x3f73ec[_0x3edb('0x1c')][_0x3edb('0x28')],_['omit'](_0x3f73ec[_0x3edb('0x1c')],[_0x3edb('0x28'),'id'])||{});}})[_0x3edb('0x29')](function(_0x400dce){logger[_0x3edb('0x11')](_0x3edb('0x2a'),_0x3f73ec);logger[_0x3edb('0x23')]('AddTags',_0x3f73ec,JSON[_0x3edb('0x14')](_0x400dce));_0x3b4804(_0x400dce);})[_0x3edb('0x1a')](function(_0x58efdc){logger[_0x3edb('0x15')]('AddTags',_0x58efdc[_0x3edb('0x18')],_0x3f73ec);_0x49460e(_this[_0x3edb('0x15')](0x1f4,_0x58efdc['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index eec8806..ad84b5f 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 _0x95e7=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','register','length'];(function(_0x34ffac,_0x416951){var _0x4f0d03=function(_0x57689f){while(--_0x57689f){_0x34ffac['push'](_0x34ffac['shift']());}};_0x4f0d03(++_0x416951);}(_0x95e7,0xa1));var _0x795e=function(_0x4511b5,_0x1b50cd){_0x4511b5=_0x4511b5-0x0;var _0x1e540e=_0x95e7[_0x4511b5];return _0x1e540e;};'use strict';var ChatInteractionEvents=require(_0x795e('0x0'));var events=[_0x795e('0x1'),_0x795e('0x2'),_0x795e('0x3')];function createListener(_0x580ccf,_0x456db6){return function(_0x5cc1cd){_0x456db6['emit'](_0x580ccf,_0x5cc1cd);};}function removeListener(_0x4950be,_0x176ac3){return function(){ChatInteractionEvents[_0x795e('0x4')](_0x4950be,_0x176ac3);};}exports[_0x795e('0x5')]=function(_0x25045a){for(var _0x5519d4=0x0,_0xda4a70=events[_0x795e('0x6')];_0x5519d4<_0xda4a70;_0x5519d4++){var _0x3a400d=events[_0x5519d4];var _0x23c210=createListener(_0x795e('0x7')+_0x3a400d,_0x25045a);ChatInteractionEvents['on'](_0x3a400d,_0x23c210);}};
\ No newline at end of file
+var _0x53d5=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x3eda00,_0x224b78){var _0x44b022=function(_0x377ef0){while(--_0x377ef0){_0x3eda00['push'](_0x3eda00['shift']());}};_0x44b022(++_0x224b78);}(_0x53d5,0x1cc));var _0x553d=function(_0x2ff5c6,_0x248fe2){_0x2ff5c6=_0x2ff5c6-0x0;var _0x5605f2=_0x53d5[_0x2ff5c6];return _0x5605f2;};'use strict';var ChatInteractionEvents=require(_0x553d('0x0'));var events=[_0x553d('0x1'),_0x553d('0x2'),_0x553d('0x3')];function createListener(_0x1036b6,_0x81eca2){return function(_0x36f940){_0x81eca2['emit'](_0x1036b6,_0x36f940);};}function removeListener(_0xd5d2f7,_0x9e2c06){return function(){ChatInteractionEvents[_0x553d('0x4')](_0xd5d2f7,_0x9e2c06);};}exports[_0x553d('0x5')]=function(_0x2936ad){for(var _0x5328ca=0x0,_0x1d5a5e=events[_0x553d('0x6')];_0x5328ca<_0x1d5a5e;_0x5328ca++){var _0x1c38b2=events[_0x5328ca];var _0x14ef22=createListener(_0x553d('0x7')+_0x1c38b2,_0x2936ad);ChatInteractionEvents['on'](_0x1c38b2,_0x14ef22);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 1fde97e..c319b98 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 _0x512e=['getMyMessages','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','%s-%s','now','originalname','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x512e,0x1d6));var _0xe512=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x512e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe512('0x0'));var path=require(_0xe512('0x1'));var timeout=require(_0xe512('0x2'));var express=require(_0xe512('0x3'));var router=express[_0xe512('0x4')]();var fs_extra=require(_0xe512('0x5'));var auth=require(_0xe512('0x6'));var interaction=require(_0xe512('0x7'));var config=require('../../config/environment');var controller=require(_0xe512('0x8'));router['get']('/',auth[_0xe512('0x9')](),controller[_0xe512('0xa')]);router[_0xe512('0xb')](_0xe512('0xc'),auth[_0xe512('0x9')](),controller[_0xe512('0xd')]);router[_0xe512('0xb')](_0xe512('0xe'),auth[_0xe512('0xf')](),controller['show']);router[_0xe512('0xb')](_0xe512('0x10'),auth[_0xe512('0xf')](),controller['attachmentDownload']);router['get'](_0xe512('0x11'),auth[_0xe512('0x9')](),controller[_0xe512('0x12')]);router[_0xe512('0xb')](_0xe512('0x13'),auth[_0xe512('0xf')](),controller[_0xe512('0x14')]);router[_0xe512('0xb')]('/:id/download',auth[_0xe512('0x9')](),controller[_0xe512('0x15')]);router[_0xe512('0x16')]('/',auth[_0xe512('0x9')](),controller['create']);router['post'](_0xe512('0x17'),auth[_0xe512('0x9')](),controller[_0xe512('0x18')]);var upload=multer({'storage':multer[_0xe512('0x19')]({'destination':function(_0x2a1a4d,_0x3b0b43,_0x1fbef5){_0x1fbef5(null,path[_0xe512('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x172e8b,_0x257f0b,_0xd34b2d){_0xd34b2d(null,util['format'](_0xe512('0x1b'),Date[_0xe512('0x1c')](),_0x257f0b[_0xe512('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xe512('0x1e'),upload['single'](_0xe512('0x1f')),controller['attachmentUpload']);router[_0xe512('0x16')](_0xe512('0x11'),auth[_0xe512('0xf')](),controller[_0xe512('0x20')]);router[_0xe512('0x16')](_0xe512('0x21'),auth['isAuthenticated'](),interaction[_0xe512('0x22')](_0xe512('0x23'),_0xe512('0x24')),controller[_0xe512('0x25')]);router[_0xe512('0x26')]('/:id',auth[_0xe512('0x9')](),interaction[_0xe512('0x22')](_0xe512('0x23'),'chatinteraction:update'),controller[_0xe512('0x27')]);router[_0xe512('0x26')]('/:id/custom_update',controller[_0xe512('0x28')]);router[_0xe512('0x26')](_0xe512('0x29'),auth[_0xe512('0xf')](),controller[_0xe512('0x2a')]);router[_0xe512('0x26')](_0xe512('0x2b'),controller[_0xe512('0x2c')]);router[_0xe512('0x2d')](_0xe512('0xe'),auth[_0xe512('0x9')](),interaction[_0xe512('0x22')](_0xe512('0x23'),'chatinteraction:destroy'),controller[_0xe512('0x2e')]);router[_0xe512('0x2d')](_0xe512('0x21'),auth['isAuthenticated'](),controller[_0xe512('0x2f')]);module[_0xe512('0x30')]=router;
\ No newline at end of file
+var _0x7ec7=['/:id/attachment_download','/:id/messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7ec7,0x1d6));var _0x77ec=function(_0x1be34d,_0x1c5537){_0x1be34d=_0x1be34d-0x0;var _0x449843=_0x7ec7[_0x1be34d];return _0x449843;};'use strict';var multer=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ec('0x2'));var router=express[_0x77ec('0x3')]();var fs_extra=require(_0x77ec('0x4'));var auth=require(_0x77ec('0x5'));var interaction=require(_0x77ec('0x6'));var config=require(_0x77ec('0x7'));var controller=require(_0x77ec('0x8'));router['get']('/',auth[_0x77ec('0x9')](),controller[_0x77ec('0xa')]);router['get'](_0x77ec('0xb'),auth[_0x77ec('0x9')](),controller[_0x77ec('0xc')]);router[_0x77ec('0xd')](_0x77ec('0xe'),auth[_0x77ec('0xf')](),controller['show']);router[_0x77ec('0xd')](_0x77ec('0x10'),auth[_0x77ec('0xf')](),controller['attachmentDownload']);router[_0x77ec('0xd')](_0x77ec('0x11'),auth[_0x77ec('0x9')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0x77ec('0xf')](),controller[_0x77ec('0x12')]);router[_0x77ec('0xd')](_0x77ec('0x13'),auth[_0x77ec('0x9')](),controller['download']);router[_0x77ec('0x14')]('/',auth[_0x77ec('0x9')](),controller[_0x77ec('0x15')]);router[_0x77ec('0x14')](_0x77ec('0x16'),auth[_0x77ec('0x9')](),controller[_0x77ec('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b18c6,_0x28b260,_0x1f6523){_0x1f6523(null,path[_0x77ec('0x18')](config[_0x77ec('0x19')],_0x77ec('0x1a')));},'filename':function(_0x964f4e,_0x301815,_0x1ae428){_0x1ae428(null,util[_0x77ec('0x1b')](_0x77ec('0x1c'),Date[_0x77ec('0x1d')](),_0x301815[_0x77ec('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x77ec('0x14')](_0x77ec('0x1f'),upload[_0x77ec('0x20')](_0x77ec('0x21')),controller[_0x77ec('0x22')]);router[_0x77ec('0x14')](_0x77ec('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x77ec('0x23')]);router[_0x77ec('0x14')](_0x77ec('0x24'),auth[_0x77ec('0x9')](),interaction[_0x77ec('0x25')](_0x77ec('0x26'),_0x77ec('0x27')),controller[_0x77ec('0x28')]);router[_0x77ec('0x29')](_0x77ec('0xe'),auth['isAuthenticated'](),interaction[_0x77ec('0x25')]('chat',_0x77ec('0x2a')),controller['update']);router['put'](_0x77ec('0x2b'),controller[_0x77ec('0x2c')]);router[_0x77ec('0x29')](_0x77ec('0x2d'),auth[_0x77ec('0xf')](),controller[_0x77ec('0x2e')]);router[_0x77ec('0x29')](_0x77ec('0x2f'),controller[_0x77ec('0x30')]);router[_0x77ec('0x31')](_0x77ec('0xe'),auth[_0x77ec('0x9')](),interaction[_0x77ec('0x25')](_0x77ec('0x26'),_0x77ec('0x32')),controller[_0x77ec('0x33')]);router[_0x77ec('0x31')](_0x77ec('0x24'),auth['isAuthenticated'](),controller[_0x77ec('0x34')]);module[_0x77ec('0x35')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 8cadc24..aad828a 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 _0xede6=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5908f9,_0x59d9d1){var _0xbdc629=function(_0x129012){while(--_0x129012){_0x5908f9['push'](_0x5908f9['shift']());}};_0xbdc629(++_0x59d9d1);}(_0xede6,0x1e3));var _0x6ede=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xede6[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require(_0x6ede('0x0'));module[_0x6ede('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6ede('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6ede('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6ede('0x4')]}};
\ No newline at end of file
+var _0x610e=['exports','medium','BOOLEAN','sequelize'];(function(_0x31fb32,_0x52dd18){var _0x3ee276=function(_0x4c53a6){while(--_0x4c53a6){_0x31fb32['push'](_0x31fb32['shift']());}};_0x3ee276(++_0x52dd18);}(_0x610e,0x73));var _0xe610=function(_0x3946f0,_0x50663c){_0x3946f0=_0x3946f0-0x0;var _0x5dfae0=_0x610e[_0x3946f0];return _0x5dfae0;};'use strict';var Sequelize=require(_0xe610('0x0'));module[_0xe610('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe610('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe610('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 3a60088..a5adc19 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 _0x6da4=['reject','save','update','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','create','body','find','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x5ec34c,_0x3b7b23){var _0x2f1d82=function(_0x5155da){while(--_0x5155da){_0x5ec34c['push'](_0x5ec34c['shift']());}};_0x2f1d82(++_0x3b7b23);}(_0x6da4,0x12c));var _0x46da=function(_0x43a5d2,_0x279cd1){_0x43a5d2=_0x43a5d2-0x0;var _0x58465d=_0x6da4[_0x43a5d2];return _0x58465d;};'use strict';var emlformat=require(_0x46da('0x0'));var rimraf=require(_0x46da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46da('0x2'));var rp=require(_0x46da('0x3'));var moment=require(_0x46da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46da('0x5'));var util=require('util');var path=require('path');var sox=require(_0x46da('0x6'));var csv=require(_0x46da('0x7'));var ejs=require(_0x46da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46da('0x9'));var crypto=require(_0x46da('0xa'));var jsforce=require(_0x46da('0xb'));var deskjs=require(_0x46da('0xc'));var toCsv=require(_0x46da('0x7'));var querystring=require(_0x46da('0xd'));var Papa=require(_0x46da('0xe'));var Redis=require(_0x46da('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x46da('0x10'));var hardwareService=require(_0x46da('0x11'));var logger=require(_0x46da('0x12'))(_0x46da('0x13'));var utils=require(_0x46da('0x14'));var config=require(_0x46da('0x15'));var licenseUtil=require(_0x46da('0x16'));var db=require(_0x46da('0x17'))['db'];config[_0x46da('0x18')]=_['defaults'](config[_0x46da('0x18')],{'host':_0x46da('0x19'),'port':0x18eb});var socket=require(_0x46da('0x1a'))(new Redis(config['redis']));require(_0x46da('0x1b'))[_0x46da('0x1c')](socket);function respondWithStatusCode(_0xc65bd0,_0x42314a){_0x42314a=_0x42314a||0xcc;return function(_0x139c18){if(_0x139c18){return _0xc65bd0[_0x46da('0x1d')](_0x42314a);}return _0xc65bd0[_0x46da('0x1e')](_0x42314a)[_0x46da('0x1f')]();};}function respondWithResult(_0x572fb9,_0x1f4953){_0x1f4953=_0x1f4953||0xc8;return function(_0x1ed5af){if(_0x1ed5af){return _0x572fb9[_0x46da('0x1e')](_0x1f4953)[_0x46da('0x20')](_0x1ed5af);}};}function respondWithFilteredResult(_0x6d06a0,_0xe15cc8){return function(_0x23f0e1){if(_0x23f0e1){var _0x52dcc2=typeof _0xe15cc8[_0x46da('0x21')]===_0x46da('0x22')&&typeof _0xe15cc8[_0x46da('0x23')]===_0x46da('0x22');var _0x4ac2c8=_0x23f0e1[_0x46da('0x24')];var _0x48c95c=_0x52dcc2?0x0:_0xe15cc8[_0x46da('0x21')];var _0xd996d2=_0x52dcc2?_0x23f0e1['count']:_0xe15cc8[_0x46da('0x21')]+_0xe15cc8['limit'];var _0x46bc88;if(_0xd996d2>=_0x4ac2c8){_0xd996d2=_0x4ac2c8;_0x46bc88=0xc8;}else{_0x46bc88=0xce;}_0x6d06a0[_0x46da('0x1e')](_0x46bc88);return _0x6d06a0['set'](_0x46da('0x25'),_0x48c95c+'-'+_0xd996d2+'/'+_0x4ac2c8)[_0x46da('0x20')](_0x23f0e1);}return null;};}function patchUpdates(_0x5e8a4d){return function(_0x3a3952){try{jsonpatch[_0x46da('0x26')](_0x3a3952,_0x5e8a4d,!![]);}catch(_0x1d506f){return BPromise[_0x46da('0x27')](_0x1d506f);}return _0x3a3952[_0x46da('0x28')]();};}function saveUpdates(_0x8fb50a,_0x18c87f){return function(_0xf9cfed){if(_0xf9cfed){return _0xf9cfed[_0x46da('0x29')](_0x8fb50a)['then'](function(_0x2359be){return _0x2359be;});}return null;};}function removeEntity(_0x2db388,_0x102536){return function(_0x25c37c){if(_0x25c37c){return _0x25c37c[_0x46da('0x2a')]()['then'](function(){_0x2db388[_0x46da('0x1e')](0xcc)[_0x46da('0x1f')]();});}};}function handleEntityNotFound(_0x316f91,_0x271c49){return function(_0x5f4dec){if(!_0x5f4dec){_0x316f91[_0x46da('0x1d')](0x194);}return _0x5f4dec;};}function handleError(_0x51b7ea,_0x26ba71){_0x26ba71=_0x26ba71||0x1f4;return function(_0x4105da){logger[_0x46da('0x2b')](_0x4105da[_0x46da('0x2c')]);if(_0x4105da[_0x46da('0x2d')]){delete _0x4105da[_0x46da('0x2d')];}_0x51b7ea[_0x46da('0x1e')](_0x26ba71)['send'](_0x4105da);};}exports[_0x46da('0x2e')]=function(_0x4a8811,_0x5044f9){var _0x392a25={},_0x5aebbd={},_0xa45c97={'count':0x0,'rows':[]};var _0x2e857c=_[_0x46da('0x2f')](db[_0x46da('0x30')][_0x46da('0x31')],function(_0xecc25e){return{'name':_0xecc25e[_0x46da('0x32')],'type':_0xecc25e[_0x46da('0x33')][_0x46da('0x34')]};});_0x5aebbd[_0x46da('0x35')]=_['map'](_0x2e857c,'name');_0x5aebbd['query']=_[_0x46da('0x36')](_0x4a8811[_0x46da('0x37')]);_0x5aebbd[_0x46da('0x38')]=_['intersection'](_0x5aebbd['model'],_0x5aebbd['query']);_0x392a25[_0x46da('0x39')]=_[_0x46da('0x3a')](_0x5aebbd['model'],qs[_0x46da('0x3b')](_0x4a8811['query'][_0x46da('0x3b')]));_0x392a25['attributes']=_0x392a25[_0x46da('0x39')][_0x46da('0x3c')]?_0x392a25[_0x46da('0x39')]:_0x5aebbd['model'];if(!_0x4a8811[_0x46da('0x37')][_0x46da('0x3d')](_0x46da('0x3e'))){_0x392a25['limit']=qs[_0x46da('0x23')](_0x4a8811[_0x46da('0x37')][_0x46da('0x23')]);_0x392a25[_0x46da('0x21')]=qs[_0x46da('0x21')](_0x4a8811[_0x46da('0x37')][_0x46da('0x21')]);}_0x392a25[_0x46da('0x3f')]=qs[_0x46da('0x40')](_0x4a8811[_0x46da('0x37')][_0x46da('0x40')]);_0x392a25['where']=qs['filters'](_[_0x46da('0x41')](_0x4a8811['query'],_0x5aebbd[_0x46da('0x38')]),_0x2e857c);if(_0x4a8811[_0x46da('0x37')][_0x46da('0x42')]){_0x392a25[_0x46da('0x43')]=_[_0x46da('0x44')](_0x392a25[_0x46da('0x43')],{'$or':_['map'](_0x2e857c,function(_0x5439f2){if(_0x5439f2['type']!==_0x46da('0x45')){var _0x2cff3e={};_0x2cff3e[_0x5439f2['name']]={'$like':'%'+_0x4a8811[_0x46da('0x37')][_0x46da('0x42')]+'%'};return _0x2cff3e;}})});}_0x392a25=_[_0x46da('0x44')]({},_0x392a25,_0x4a8811[_0x46da('0x46')]);var _0x121878={'where':_0x392a25[_0x46da('0x43')]};return db[_0x46da('0x30')]['count'](_0x121878)['then'](function(_0x44bb85){_0xa45c97[_0x46da('0x24')]=_0x44bb85;if(_0x4a8811[_0x46da('0x37')][_0x46da('0x47')]){_0x392a25[_0x46da('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x46da('0x49')](_0x392a25);})[_0x46da('0x4a')](function(_0x372276){_0xa45c97[_0x46da('0x4b')]=_0x372276;return _0xa45c97;})[_0x46da('0x4a')](respondWithFilteredResult(_0x5044f9,_0x392a25))[_0x46da('0x4c')](handleError(_0x5044f9,null));};exports[_0x46da('0x4d')]=function(_0x5bdfa9,_0x413e47){var _0x506637={'raw':!![],'where':{'id':_0x5bdfa9[_0x46da('0x4e')]['id']}},_0x111acf={};_0x111acf[_0x46da('0x35')]=_[_0x46da('0x36')](db['ChatInternalMessage'][_0x46da('0x31')]);_0x111acf[_0x46da('0x37')]=_['keys'](_0x5bdfa9[_0x46da('0x37')]);_0x111acf[_0x46da('0x38')]=_['intersection'](_0x111acf[_0x46da('0x35')],_0x111acf[_0x46da('0x37')]);_0x506637[_0x46da('0x39')]=_[_0x46da('0x3a')](_0x111acf[_0x46da('0x35')],qs['fields'](_0x5bdfa9[_0x46da('0x37')][_0x46da('0x3b')]));_0x506637[_0x46da('0x39')]=_0x506637[_0x46da('0x39')]['length']?_0x506637[_0x46da('0x39')]:_0x111acf[_0x46da('0x35')];if(_0x5bdfa9[_0x46da('0x37')][_0x46da('0x47')]){_0x506637[_0x46da('0x48')]=[{'all':!![]}];}_0x506637=_[_0x46da('0x44')]({},_0x506637,_0x5bdfa9[_0x46da('0x46')]);return db['ChatInternalMessage']['find'](_0x506637)[_0x46da('0x4a')](handleEntityNotFound(_0x413e47,null))['then'](respondWithResult(_0x413e47,null))[_0x46da('0x4c')](handleError(_0x413e47,null));};exports['create']=function(_0x37102e,_0x40e5f3){return db['ChatInternalMessage'][_0x46da('0x4f')](_0x37102e[_0x46da('0x50')],{})[_0x46da('0x4a')](respondWithResult(_0x40e5f3,0xc9))[_0x46da('0x4c')](handleError(_0x40e5f3,null));};exports['update']=function(_0x4088c4,_0x5003d8){if(_0x4088c4[_0x46da('0x50')]['id']){delete _0x4088c4[_0x46da('0x50')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x4088c4[_0x46da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5003d8,null))[_0x46da('0x4a')](saveUpdates(_0x4088c4[_0x46da('0x50')],null))['then'](respondWithResult(_0x5003d8,null))[_0x46da('0x4c')](handleError(_0x5003d8,null));};exports[_0x46da('0x2a')]=function(_0x4f97c6,_0x4063bd){return db[_0x46da('0x30')][_0x46da('0x51')]({'where':{'id':_0x4f97c6['params']['id']}})[_0x46da('0x4a')](handleEntityNotFound(_0x4063bd,null))[_0x46da('0x4a')](removeEntity(_0x4063bd,null))[_0x46da('0x4c')](handleError(_0x4063bd,null));};exports[_0x46da('0x52')]=function(_0x3c8ab1,_0x2396f9){return db['ChatInternalMessage'][_0x46da('0x52')]()[_0x46da('0x4a')](respondWithResult(_0x2396f9,null))[_0x46da('0x4c')](handleError(_0x2396f9,null));};function wrapUser(_0x4b35cf){return function(_0x2a4699){var _0x1beff9=_0x4b35cf[_0x46da('0x53')]({'plain':!![]});_0x1beff9['messages']=[];if(_0x2a4699){_0x1beff9[_0x46da('0x54')]=_0x2a4699[_0x46da('0x55')];_0x1beff9[_0x46da('0x56')]=_0x2a4699;}else{_0x1beff9[_0x46da('0x54')]=moment(0x0)[_0x46da('0x57')](_0x46da('0x58'));_0x1beff9[_0x46da('0x56')]={};}return _0x1beff9;};}exports[_0x46da('0x59')]=function(_0x10850b,_0x338670,_0x3be94a){var _0x1bcde4=[];return db[_0x46da('0x5a')][_0x46da('0x49')]({'where':{'role':[_0x46da('0x5b'),_0x46da('0x5c'),'user']},'attributes':['id','fullname','name',_0x46da('0x5d'),_0x46da('0x5e'),_0x46da('0x5f'),'online',_0x46da('0x60'),_0x46da('0x61'),_0x46da('0x62')],'order':qs[_0x46da('0x40')]('-online'),'include':[{'model':db[_0x46da('0x63')],'as':_0x46da('0x64'),'attributes':['id',_0x46da('0x2d'),_0x46da('0x33')],'through':{'attributes':[]}}]})[_0x46da('0x4a')](function(_0x5e48c7){if(_0x5e48c7){var _0x1332f7=_0x10850b['user']['get']({'plain':!![]});if(!_0x1332f7)throw new Error(_0x46da('0x65'));if(_0x1332f7[_0x46da('0x5d')]===_0x46da('0x66')){return db['UserProfileSection'][_0x46da('0x51')]({'where':{'name':_0x46da('0x67'),'userProfileId':_0x1332f7[_0x46da('0x68')]},'raw':!![]})[_0x46da('0x4a')](function(_0x5b6960){if(_0x5b6960){if(_0x5b6960[_0x46da('0x69')]===0x0){return db[_0x46da('0x6a')][_0x46da('0x49')]({'where':{'sectionId':_0x5b6960['id']},'raw':!![]})['then'](function(_0x4fad4d){var _0x35cf51=[];if(_['isEmpty'](_0x4fad4d)){_0x35cf51=_[_0x46da('0x42')](_0x5e48c7,function(_0x16f254){if(_0x16f254[_0x46da('0x5d')]!==_0x46da('0x5b')){return _0x16f254;}});return _0x35cf51;}else{for(var _0x55a55b=0x0;_0x55a55b<_0x5e48c7[_0x46da('0x3c')];_0x55a55b++){var _0x24ed0b=_0x5e48c7[_0x55a55b];if(_0x24ed0b[_0x46da('0x5d')]===_0x46da('0x5b')){var _0x16aa52=_[_0x46da('0x51')](_0x4fad4d,function(_0x107f08){return _0x107f08[_0x46da('0x6b')]===_0x24ed0b['id'];});if(_0x16aa52)_0x35cf51['push'](_0x24ed0b);}else{_0x35cf51[_0x46da('0x6c')](_0x24ed0b);}}return _0x35cf51;}});}else{return _0x5e48c7;}}else{var _0x4fcbe4=_[_0x46da('0x42')](_0x5e48c7,function(_0x1e04d3){if(_0x1e04d3['role']!==_0x46da('0x5b')){return _0x1e04d3;}});return _0x4fcbe4;}});}else{return _0x5e48c7;}}})[_0x46da('0x4a')](function(_0x25a701){var _0x306bf0=[];if(_0x25a701){_0x1bcde4=_0x25a701;for(var _0x2f2c06=0x0;_0x2f2c06<_0x25a701[_0x46da('0x3c')];_0x2f2c06+=0x1){_0x1bcde4[_0x2f2c06][_0x46da('0x6d')]=[];_0x306bf0[_0x46da('0x6c')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x10850b['user']['id'],_0x25a701[_0x2f2c06]['id']],'ToId':[_0x10850b['user']['id'],_0x25a701[_0x2f2c06]['id']],'ChatGroupId':null},'attributes':['id',_0x46da('0x55'),'FromId','ToId',_0x46da('0x6e'),_0x46da('0x50')],'order':qs[_0x46da('0x40')](_0x46da('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x46da('0x4a')](wrapUser(_0x25a701[_0x2f2c06])));}return BPromise[_0x46da('0x70')](_0x306bf0);}return[];})[_0x46da('0x4a')](function(_0x47cd40){return{'rows':_0x47cd40,'count':_0x47cd40[_0x46da('0x3c')]};})[_0x46da('0x4a')](respondWithResult(_0x338670,null))['catch'](handleError(_0x338670,null));};
\ No newline at end of file
+var _0x950a=['create','body','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','user','fullname','userpic','online','showWebBar','-online','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','role','resourceId','push','FromId','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find'];(function(_0x1abad1,_0x54ec22){var _0x46639a=function(_0x284108){while(--_0x284108){_0x1abad1['push'](_0x1abad1['shift']());}};_0x46639a(++_0x54ec22);}(_0x950a,0x100));var _0xa950=function(_0x31d353,_0x438585){_0x31d353=_0x31d353-0x0;var _0x46ace9=_0x950a[_0x31d353];return _0x46ace9;};'use strict';var emlformat=require(_0xa950('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa950('0x1'));var jsonpatch=require(_0xa950('0x2'));var rp=require(_0xa950('0x3'));var moment=require(_0xa950('0x4'));var BPromise=require(_0xa950('0x5'));var Mustache=require(_0xa950('0x6'));var util=require(_0xa950('0x7'));var path=require(_0xa950('0x8'));var sox=require('sox');var csv=require(_0xa950('0x9'));var ejs=require(_0xa950('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa950('0xb'));var squel=require(_0xa950('0xc'));var crypto=require(_0xa950('0xd'));var jsforce=require(_0xa950('0xe'));var deskjs=require(_0xa950('0xf'));var toCsv=require(_0xa950('0x9'));var querystring=require(_0xa950('0x10'));var Papa=require(_0xa950('0x11'));var Redis=require(_0xa950('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa950('0x13'));var as=require(_0xa950('0x14'));var hardwareService=require(_0xa950('0x15'));var logger=require(_0xa950('0x16'))(_0xa950('0x17'));var utils=require(_0xa950('0x18'));var config=require(_0xa950('0x19'));var licenseUtil=require(_0xa950('0x1a'));var db=require(_0xa950('0x1b'))['db'];config[_0xa950('0x1c')]=_[_0xa950('0x1d')](config[_0xa950('0x1c')],{'host':_0xa950('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa950('0x1f'))[_0xa950('0x20')](socket);function respondWithStatusCode(_0x19e8ef,_0x3922fc){_0x3922fc=_0x3922fc||0xcc;return function(_0x2c6575){if(_0x2c6575){return _0x19e8ef[_0xa950('0x21')](_0x3922fc);}return _0x19e8ef[_0xa950('0x22')](_0x3922fc)[_0xa950('0x23')]();};}function respondWithResult(_0x596fec,_0x557e77){_0x557e77=_0x557e77||0xc8;return function(_0x11a870){if(_0x11a870){return _0x596fec[_0xa950('0x22')](_0x557e77)[_0xa950('0x24')](_0x11a870);}};}function respondWithFilteredResult(_0x3737cb,_0x463a33){return function(_0x12c4cf){if(_0x12c4cf){var _0x5c2edd=typeof _0x463a33[_0xa950('0x25')]==='undefined'&&typeof _0x463a33[_0xa950('0x26')]===_0xa950('0x27');var _0x4e552e=_0x12c4cf[_0xa950('0x28')];var _0x568c96=_0x5c2edd?0x0:_0x463a33[_0xa950('0x25')];var _0x39c529=_0x5c2edd?_0x12c4cf[_0xa950('0x28')]:_0x463a33[_0xa950('0x25')]+_0x463a33[_0xa950('0x26')];var _0x47f9ae;if(_0x39c529>=_0x4e552e){_0x39c529=_0x4e552e;_0x47f9ae=0xc8;}else{_0x47f9ae=0xce;}_0x3737cb['status'](_0x47f9ae);return _0x3737cb['set'](_0xa950('0x29'),_0x568c96+'-'+_0x39c529+'/'+_0x4e552e)[_0xa950('0x24')](_0x12c4cf);}return null;};}function patchUpdates(_0x52ec4d){return function(_0x58db42){try{jsonpatch[_0xa950('0x2a')](_0x58db42,_0x52ec4d,!![]);}catch(_0x4aa1dd){return BPromise[_0xa950('0x2b')](_0x4aa1dd);}return _0x58db42[_0xa950('0x2c')]();};}function saveUpdates(_0x415b0a,_0x653ed7){return function(_0x5af40b){if(_0x5af40b){return _0x5af40b[_0xa950('0x2d')](_0x415b0a)[_0xa950('0x2e')](function(_0x306807){return _0x306807;});}return null;};}function removeEntity(_0x57582c,_0x1e1529){return function(_0x357f71){if(_0x357f71){return _0x357f71[_0xa950('0x2f')]()[_0xa950('0x2e')](function(){_0x57582c['status'](0xcc)[_0xa950('0x23')]();});}};}function handleEntityNotFound(_0x13dce0,_0x37008f){return function(_0xb14b4c){if(!_0xb14b4c){_0x13dce0['sendStatus'](0x194);}return _0xb14b4c;};}function handleError(_0x4543b7,_0x3e4824){_0x3e4824=_0x3e4824||0x1f4;return function(_0x116c24){logger['error'](_0x116c24[_0xa950('0x30')]);if(_0x116c24[_0xa950('0x31')]){delete _0x116c24[_0xa950('0x31')];}_0x4543b7[_0xa950('0x22')](_0x3e4824)[_0xa950('0x32')](_0x116c24);};}exports['index']=function(_0x152aaa,_0xfa0333){var _0x271e87={},_0x331989={},_0x1b6a2a={'count':0x0,'rows':[]};var _0x1e3157=_[_0xa950('0x33')](db[_0xa950('0x34')][_0xa950('0x35')],function(_0x9b8edb){return{'name':_0x9b8edb[_0xa950('0x36')],'type':_0x9b8edb[_0xa950('0x37')][_0xa950('0x38')]};});_0x331989[_0xa950('0x39')]=_['map'](_0x1e3157,_0xa950('0x31'));_0x331989['query']=_[_0xa950('0x3a')](_0x152aaa['query']);_0x331989[_0xa950('0x3b')]=_[_0xa950('0x3c')](_0x331989[_0xa950('0x39')],_0x331989[_0xa950('0x3d')]);_0x271e87[_0xa950('0x3e')]=_[_0xa950('0x3c')](_0x331989[_0xa950('0x39')],qs[_0xa950('0x3f')](_0x152aaa['query'][_0xa950('0x3f')]));_0x271e87['attributes']=_0x271e87[_0xa950('0x3e')]['length']?_0x271e87['attributes']:_0x331989[_0xa950('0x39')];if(!_0x152aaa[_0xa950('0x3d')]['hasOwnProperty'](_0xa950('0x40'))){_0x271e87[_0xa950('0x26')]=qs[_0xa950('0x26')](_0x152aaa[_0xa950('0x3d')][_0xa950('0x26')]);_0x271e87[_0xa950('0x25')]=qs[_0xa950('0x25')](_0x152aaa[_0xa950('0x3d')][_0xa950('0x25')]);}_0x271e87['order']=qs['sort'](_0x152aaa[_0xa950('0x3d')][_0xa950('0x41')]);_0x271e87[_0xa950('0x42')]=qs[_0xa950('0x3b')](_['pick'](_0x152aaa[_0xa950('0x3d')],_0x331989[_0xa950('0x3b')]),_0x1e3157);if(_0x152aaa['query'][_0xa950('0x43')]){_0x271e87[_0xa950('0x42')]=_[_0xa950('0x44')](_0x271e87['where'],{'$or':_[_0xa950('0x33')](_0x1e3157,function(_0x115b23){if(_0x115b23[_0xa950('0x37')]!==_0xa950('0x45')){var _0x1eb499={};_0x1eb499[_0x115b23[_0xa950('0x31')]]={'$like':'%'+_0x152aaa[_0xa950('0x3d')][_0xa950('0x43')]+'%'};return _0x1eb499;}})});}_0x271e87=_[_0xa950('0x44')]({},_0x271e87,_0x152aaa[_0xa950('0x46')]);var _0x2eec53={'where':_0x271e87['where']};return db[_0xa950('0x34')]['count'](_0x2eec53)['then'](function(_0x4643c6){_0x1b6a2a[_0xa950('0x28')]=_0x4643c6;if(_0x152aaa[_0xa950('0x3d')][_0xa950('0x47')]){_0x271e87[_0xa950('0x48')]=[{'all':!![]}];}return db[_0xa950('0x34')]['findAll'](_0x271e87);})[_0xa950('0x2e')](function(_0x15fa60){_0x1b6a2a['rows']=_0x15fa60;return _0x1b6a2a;})['then'](respondWithFilteredResult(_0xfa0333,_0x271e87))[_0xa950('0x49')](handleError(_0xfa0333,null));};exports[_0xa950('0x4a')]=function(_0xf40575,_0x4e2c23){var _0x2ffd19={'raw':!![],'where':{'id':_0xf40575[_0xa950('0x4b')]['id']}},_0x1e6ac7={};_0x1e6ac7[_0xa950('0x39')]=_[_0xa950('0x3a')](db[_0xa950('0x34')]['rawAttributes']);_0x1e6ac7[_0xa950('0x3d')]=_[_0xa950('0x3a')](_0xf40575[_0xa950('0x3d')]);_0x1e6ac7['filters']=_[_0xa950('0x3c')](_0x1e6ac7[_0xa950('0x39')],_0x1e6ac7[_0xa950('0x3d')]);_0x2ffd19[_0xa950('0x3e')]=_[_0xa950('0x3c')](_0x1e6ac7['model'],qs[_0xa950('0x3f')](_0xf40575[_0xa950('0x3d')][_0xa950('0x3f')]));_0x2ffd19[_0xa950('0x3e')]=_0x2ffd19['attributes']['length']?_0x2ffd19['attributes']:_0x1e6ac7[_0xa950('0x39')];if(_0xf40575[_0xa950('0x3d')]['includeAll']){_0x2ffd19[_0xa950('0x48')]=[{'all':!![]}];}_0x2ffd19=_['merge']({},_0x2ffd19,_0xf40575[_0xa950('0x46')]);return db['ChatInternalMessage'][_0xa950('0x4c')](_0x2ffd19)['then'](handleEntityNotFound(_0x4e2c23,null))[_0xa950('0x2e')](respondWithResult(_0x4e2c23,null))['catch'](handleError(_0x4e2c23,null));};exports[_0xa950('0x4d')]=function(_0x26e9c0,_0x3c600a){return db['ChatInternalMessage'][_0xa950('0x4d')](_0x26e9c0['body'],{})[_0xa950('0x2e')](respondWithResult(_0x3c600a,0xc9))['catch'](handleError(_0x3c600a,null));};exports[_0xa950('0x2d')]=function(_0x2f27a8,_0x291017){if(_0x2f27a8[_0xa950('0x4e')]['id']){delete _0x2f27a8['body']['id'];}return db[_0xa950('0x34')][_0xa950('0x4c')]({'where':{'id':_0x2f27a8['params']['id']}})[_0xa950('0x2e')](handleEntityNotFound(_0x291017,null))[_0xa950('0x2e')](saveUpdates(_0x2f27a8[_0xa950('0x4e')],null))[_0xa950('0x2e')](respondWithResult(_0x291017,null))[_0xa950('0x49')](handleError(_0x291017,null));};exports[_0xa950('0x2f')]=function(_0x51481a,_0x39c125){return db[_0xa950('0x34')][_0xa950('0x4c')]({'where':{'id':_0x51481a[_0xa950('0x4b')]['id']}})[_0xa950('0x2e')](handleEntityNotFound(_0x39c125,null))[_0xa950('0x2e')](removeEntity(_0x39c125,null))[_0xa950('0x49')](handleError(_0x39c125,null));};exports[_0xa950('0x4f')]=function(_0x5aaa84,_0x23a211){return db[_0xa950('0x34')][_0xa950('0x4f')]()[_0xa950('0x2e')](respondWithResult(_0x23a211,null))[_0xa950('0x49')](handleError(_0x23a211,null));};function wrapUser(_0x3d7e57){return function(_0x3e511c){var _0xf0a8a=_0x3d7e57[_0xa950('0x50')]({'plain':!![]});_0xf0a8a[_0xa950('0x51')]=[];if(_0x3e511c){_0xf0a8a['lastMessageAt']=_0x3e511c[_0xa950('0x52')];_0xf0a8a[_0xa950('0x53')]=_0x3e511c;}else{_0xf0a8a[_0xa950('0x54')]=moment(0x0)[_0xa950('0x55')](_0xa950('0x56'));_0xf0a8a[_0xa950('0x53')]={};}return _0xf0a8a;};}exports[_0xa950('0x57')]=function(_0x10fa02,_0x58fd84,_0x5c86c9){var _0x1db7ac=[];return db[_0xa950('0x58')][_0xa950('0x59')]({'where':{'role':[_0xa950('0x5a'),'admin',_0xa950('0x5b')]},'attributes':['id',_0xa950('0x5c'),_0xa950('0x31'),'role',_0xa950('0x5d'),'internal',_0xa950('0x5e'),'lastLoginAt','allowmessenger',_0xa950('0x5f')],'order':qs[_0xa950('0x41')](_0xa950('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0xa950('0x61'),'attributes':['id','name',_0xa950('0x37')],'through':{'attributes':[]}}]})[_0xa950('0x2e')](function(_0x57ae0f){if(_0x57ae0f){var _0xee450=_0x10fa02[_0xa950('0x5b')][_0xa950('0x50')]({'plain':!![]});if(!_0xee450)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xee450['role']===_0xa950('0x5b')){return db[_0xa950('0x62')][_0xa950('0x4c')]({'where':{'name':_0xa950('0x63'),'userProfileId':_0xee450[_0xa950('0x64')]},'raw':!![]})['then'](function(_0x290162){if(_0x290162){if(_0x290162[_0xa950('0x65')]===0x0){return db[_0xa950('0x66')][_0xa950('0x59')]({'where':{'sectionId':_0x290162['id']},'raw':!![]})[_0xa950('0x2e')](function(_0xcf5da){var _0x301e88=[];if(_[_0xa950('0x67')](_0xcf5da)){_0x301e88=_[_0xa950('0x43')](_0x57ae0f,function(_0x347e9d){if(_0x347e9d['role']!=='agent'){return _0x347e9d;}});return _0x301e88;}else{for(var _0x4c4e6d=0x0;_0x4c4e6d<_0x57ae0f[_0xa950('0x68')];_0x4c4e6d++){var _0x56588d=_0x57ae0f[_0x4c4e6d];if(_0x56588d[_0xa950('0x69')]===_0xa950('0x5a')){var _0x11e25d=_['find'](_0xcf5da,function(_0x5cd86f){return _0x5cd86f[_0xa950('0x6a')]===_0x56588d['id'];});if(_0x11e25d)_0x301e88[_0xa950('0x6b')](_0x56588d);}else{_0x301e88[_0xa950('0x6b')](_0x56588d);}}return _0x301e88;}});}else{return _0x57ae0f;}}else{var _0x5c81a2=_['filter'](_0x57ae0f,function(_0x2ce80c){if(_0x2ce80c['role']!==_0xa950('0x5a')){return _0x2ce80c;}});return _0x5c81a2;}});}else{return _0x57ae0f;}}})[_0xa950('0x2e')](function(_0x17e710){var _0x115352=[];if(_0x17e710){_0x1db7ac=_0x17e710;for(var _0x5a6943=0x0;_0x5a6943<_0x17e710[_0xa950('0x68')];_0x5a6943+=0x1){_0x1db7ac[_0x5a6943][_0xa950('0x51')]=[];_0x115352['push'](db[_0xa950('0x34')][_0xa950('0x4c')]({'where':{'FromId':[_0x10fa02[_0xa950('0x5b')]['id'],_0x17e710[_0x5a6943]['id']],'ToId':[_0x10fa02[_0xa950('0x5b')]['id'],_0x17e710[_0x5a6943]['id']],'ChatGroupId':null},'attributes':['id',_0xa950('0x52'),_0xa950('0x6c'),_0xa950('0x6d'),_0xa950('0x6e'),_0xa950('0x4e')],'order':qs[_0xa950('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa950('0x2e')](wrapUser(_0x17e710[_0x5a6943])));}return BPromise['all'](_0x115352);}return[];})[_0xa950('0x2e')](function(_0x220b05){return{'rows':_0x220b05,'count':_0x220b05[_0xa950('0x68')]};})[_0xa950('0x2e')](respondWithResult(_0x58fd84,null))[_0xa950('0x49')](handleError(_0x58fd84,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index c275588..c0fed80 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 _0x9017=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4cb8d7,_0x485454){var _0x2cc0e4=function(_0x304757){while(--_0x304757){_0x4cb8d7['push'](_0x4cb8d7['shift']());}};_0x2cc0e4(++_0x485454);}(_0x9017,0xbe));var _0x7901=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9017[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7901('0x0'));var ChatInternalMessage=require(_0x7901('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7901('0x2')](0x0);var events={'afterCreate':_0x7901('0x3'),'afterUpdate':_0x7901('0x4'),'afterDestroy':_0x7901('0x5')};function emitEvent(_0x380c3f){return function(_0x2b8c21,_0x2ae415,_0x22377b){ChatInternalMessageEvents[_0x7901('0x6')](_0x380c3f+':'+_0x2b8c21['id'],_0x2b8c21);ChatInternalMessageEvents['emit'](_0x380c3f,_0x2b8c21);_0x22377b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x7901('0x7')](e,emitEvent(event));}}module[_0x7901('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb126=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','remove','emit'];(function(_0x1ff8d7,_0x309a3b){var _0x22afc1=function(_0x309f38){while(--_0x309f38){_0x1ff8d7['push'](_0x1ff8d7['shift']());}};_0x22afc1(++_0x309a3b);}(_0xb126,0x127));var _0x6b12=function(_0x7ff018,_0x5719a6){_0x7ff018=_0x7ff018-0x0;var _0x470172=_0xb126[_0x7ff018];return _0x470172;};'use strict';var EventEmitter=require(_0x6b12('0x0'));var ChatInternalMessage=require(_0x6b12('0x1'))['db'][_0x6b12('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6b12('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6b12('0x4')};function emitEvent(_0xcecb2){return function(_0x4bae8c,_0x4e0286,_0x12fbf2){ChatInternalMessageEvents[_0x6b12('0x5')](_0xcecb2+':'+_0x4bae8c['id'],_0x4bae8c);ChatInternalMessageEvents['emit'](_0xcecb2,_0x4bae8c);_0x12fbf2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x6b12('0x6')](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 de4989f..fdb94e2 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 _0x7474=['lodash','../../config/logger','api','moment','request-promise','rimraf','./chatInternalMessage.attributes','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4a84d,_0x5e3c24){var _0x2bc51a=function(_0x3cf154){while(--_0x3cf154){_0x4a84d['push'](_0x4a84d['shift']());}};_0x2bc51a(++_0x5e3c24);}(_0x7474,0xe7));var _0x4747=function(_0x3f1204,_0x2da03e){_0x3f1204=_0x3f1204-0x0;var _0x8bcca1=_0x7474[_0x3f1204];return _0x8bcca1;};'use strict';var _=require(_0x4747('0x0'));var util=require('util');var logger=require(_0x4747('0x1'))(_0x4747('0x2'));var moment=require(_0x4747('0x3'));var BPromise=require('bluebird');var rp=require(_0x4747('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4747('0x5'));var config=require('../../config/environment');var attributes=require(_0x4747('0x6'));module['exports']=function(_0x35f8c1,_0x23179c){return _0x35f8c1[_0x4747('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x4747('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4747('0x9'),'collate':_0x4747('0xa')});};
\ No newline at end of file
+var _0x35fe=['utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x2a36ea,_0x312d3f){var _0x248369=function(_0x15401e){while(--_0x15401e){_0x2a36ea['push'](_0x2a36ea['shift']());}};_0x248369(++_0x312d3f);}(_0x35fe,0x85));var _0xe35f=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x35fe[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xe35f('0x0'));var util=require(_0xe35f('0x1'));var logger=require('../../config/logger')(_0xe35f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe35f('0x3'));var rimraf=require(_0xe35f('0x4'));var config=require(_0xe35f('0x5'));var attributes=require(_0xe35f('0x6'));module['exports']=function(_0x19d8c4,_0x1a5e76){return _0x19d8c4[_0xe35f('0x7')](_0xe35f('0x8'),attributes,{'tableName':_0xe35f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe35f('0xa'),'collate':_0xe35f('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e290551..dadf410 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 _0x2908=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client'];(function(_0x57cfc8,_0x22116b){var _0x1a024b=function(_0x215d16){while(--_0x215d16){_0x57cfc8['push'](_0x57cfc8['shift']());}};_0x1a024b(++_0x22116b);}(_0x2908,0x1ef));var _0x8290=function(_0x5ad5f8,_0x433a55){_0x5ad5f8=_0x5ad5f8-0x0;var _0x4befc6=_0x2908[_0x5ad5f8];return _0x4befc6;};'use strict';var _=require(_0x8290('0x0'));var util=require(_0x8290('0x1'));var moment=require(_0x8290('0x2'));var BPromise=require(_0x8290('0x3'));var rs=require(_0x8290('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8290('0x5'));var logger=require('../../config/logger')(_0x8290('0x6'));var config=require(_0x8290('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8290('0x8')]['http']({'port':0x232a});config[_0x8290('0x9')]=_[_0x8290('0xa')](config['redis'],{'host':_0x8290('0xb'),'port':0x18eb});var socket=require(_0x8290('0xc'))(new Redis(config[_0x8290('0x9')]));require(_0x8290('0xd'))['register'](socket);function respondWithRpcPromise(_0x21fca1,_0x46e0c9,_0x2b0c6a){return new BPromise(function(_0x46fb6b,_0x226edc){return client['request'](_0x21fca1,_0x2b0c6a)[_0x8290('0xe')](function(_0x3037b8){logger[_0x8290('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x46e0c9,'request\x20sent');logger['debug'](_0x8290('0x10'),_0x46e0c9,_0x8290('0x11'),JSON[_0x8290('0x12')](_0x3037b8));if(_0x3037b8[_0x8290('0x13')]){if(_0x3037b8[_0x8290('0x13')][_0x8290('0x14')]===0x1f4){logger[_0x8290('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x46e0c9,_0x3037b8[_0x8290('0x13')][_0x8290('0x15')]);return _0x226edc(_0x3037b8[_0x8290('0x13')][_0x8290('0x15')]);}logger['error'](_0x8290('0x16'),_0x46e0c9,_0x3037b8[_0x8290('0x13')][_0x8290('0x15')]);return _0x46fb6b(_0x3037b8['error'][_0x8290('0x15')]);}else{logger[_0x8290('0xf')](_0x8290('0x16'),_0x46e0c9,_0x8290('0x11'));_0x46fb6b(_0x3037b8[_0x8290('0x17')][_0x8290('0x15')]);}})['catch'](function(_0x4caf0c){logger[_0x8290('0x13')](_0x8290('0x16'),_0x46e0c9,_0x4caf0c);_0x226edc(_0x4caf0c);});});}
\ No newline at end of file
+var _0x4cad=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x22e535,_0x2344a7){var _0x2b8eac=function(_0xcea172){while(--_0xcea172){_0x22e535['push'](_0x22e535['shift']());}};_0x2b8eac(++_0x2344a7);}(_0x4cad,0xe7));var _0xd4ca=function(_0x536aea,_0x48e27d){_0x536aea=_0x536aea-0x0;var _0x275449=_0x4cad[_0x536aea];return _0x275449;};'use strict';var _=require(_0xd4ca('0x0'));var util=require(_0xd4ca('0x1'));var moment=require(_0xd4ca('0x2'));var BPromise=require(_0xd4ca('0x3'));var rs=require(_0xd4ca('0x4'));var fs=require('fs');var Redis=require(_0xd4ca('0x5'));var db=require(_0xd4ca('0x6'))['db'];var utils=require(_0xd4ca('0x7'));var logger=require(_0xd4ca('0x8'))(_0xd4ca('0x9'));var config=require(_0xd4ca('0xa'));var jayson=require(_0xd4ca('0xb'));var client=jayson[_0xd4ca('0xc')][_0xd4ca('0xd')]({'port':0x232a});config[_0xd4ca('0xe')]=_[_0xd4ca('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd4ca('0x10'))(new Redis(config[_0xd4ca('0xe')]));require('./chatInternalMessage.socket')[_0xd4ca('0x11')](socket);function respondWithRpcPromise(_0x47855b,_0x428f88,_0x3d5781){return new BPromise(function(_0x19abf7,_0x1e66e6){return client['request'](_0x47855b,_0x3d5781)['then'](function(_0xb8ffbf){logger[_0xd4ca('0x12')](_0xd4ca('0x13'),_0x428f88,_0xd4ca('0x14'));logger[_0xd4ca('0x15')](_0xd4ca('0x16'),_0x428f88,'request\x20sent',JSON['stringify'](_0xb8ffbf));if(_0xb8ffbf[_0xd4ca('0x17')]){if(_0xb8ffbf['error'][_0xd4ca('0x18')]===0x1f4){logger[_0xd4ca('0x17')](_0xd4ca('0x13'),_0x428f88,_0xb8ffbf[_0xd4ca('0x17')][_0xd4ca('0x19')]);return _0x1e66e6(_0xb8ffbf[_0xd4ca('0x17')][_0xd4ca('0x19')]);}logger[_0xd4ca('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x428f88,_0xb8ffbf[_0xd4ca('0x17')][_0xd4ca('0x19')]);return _0x19abf7(_0xb8ffbf[_0xd4ca('0x17')]['message']);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x428f88,_0xd4ca('0x14'));_0x19abf7(_0xb8ffbf[_0xd4ca('0x1a')][_0xd4ca('0x19')]);}})[_0xd4ca('0x1b')](function(_0x2fd3cb){logger[_0xd4ca('0x17')](_0xd4ca('0x13'),_0x428f88,_0x2fd3cb);_0x1e66e6(_0x2fd3cb);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 609c7f2..dedb097 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 _0xd2c8=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','register'];(function(_0x418874,_0x3c4c7e){var _0x1420e4=function(_0x26b306){while(--_0x26b306){_0x418874['push'](_0x418874['shift']());}};_0x1420e4(++_0x3c4c7e);}(_0xd2c8,0x18a));var _0x8d2c=function(_0x259697,_0x17e1b0){_0x259697=_0x259697-0x0;var _0x390f0f=_0xd2c8[_0x259697];return _0x390f0f;};'use strict';var ChatInternalMessageEvents=require(_0x8d2c('0x0'));var events=[_0x8d2c('0x1'),_0x8d2c('0x2'),_0x8d2c('0x3')];function createListener(_0x5101da,_0x25f243){return function(_0x6ae5ba){_0x25f243['emit'](_0x5101da,_0x6ae5ba);};}function removeListener(_0xdfeb66,_0x5bd8ba){return function(){ChatInternalMessageEvents['removeListener'](_0xdfeb66,_0x5bd8ba);};}exports[_0x8d2c('0x4')]=function(_0x3ba0c4){for(var _0x5bd5d6=0x0,_0x407bec=events[_0x8d2c('0x5')];_0x5bd5d6<_0x407bec;_0x5bd5d6++){var _0x196c16=events[_0x5bd5d6];var _0x1e4864=createListener(_0x8d2c('0x6')+_0x196c16,_0x3ba0c4);ChatInternalMessageEvents['on'](_0x196c16,_0x1e4864);}};
\ No newline at end of file
+var _0x9523=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','removeListener'];(function(_0x52c71b,_0x4d8190){var _0x12fd26=function(_0x3dd283){while(--_0x3dd283){_0x52c71b['push'](_0x52c71b['shift']());}};_0x12fd26(++_0x4d8190);}(_0x9523,0x14c));var _0x3952=function(_0x20cb27,_0x13a7f){_0x20cb27=_0x20cb27-0x0;var _0xeee669=_0x9523[_0x20cb27];return _0xeee669;};'use strict';var ChatInternalMessageEvents=require(_0x3952('0x0'));var events=[_0x3952('0x1'),'remove',_0x3952('0x2')];function createListener(_0x5f04e2,_0x4097f1){return function(_0x48c613){_0x4097f1['emit'](_0x5f04e2,_0x48c613);};}function removeListener(_0x4bcca2,_0x345b8d){return function(){ChatInternalMessageEvents[_0x3952('0x3')](_0x4bcca2,_0x345b8d);};}exports[_0x3952('0x4')]=function(_0x29e194){for(var _0x1fd6e7=0x0,_0x21847e=events[_0x3952('0x5')];_0x1fd6e7<_0x21847e;_0x1fd6e7++){var _0x4a7d40=events[_0x1fd6e7];var _0x4d77ed=createListener(_0x3952('0x6')+_0x4a7d40,_0x29e194);ChatInternalMessageEvents['on'](_0x4a7d40,_0x4d77ed);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2837868..4e538a2 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 _0xb1b7=['get','/describe','describe','isAuthenticated','getUsers','/:id','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','./chatInternalMessage.controller'];(function(_0x449aa4,_0x394570){var _0x7f5619=function(_0x22d068){while(--_0x22d068){_0x449aa4['push'](_0x449aa4['shift']());}};_0x7f5619(++_0x394570);}(_0xb1b7,0x13e));var _0x7b1b=function(_0x206fc6,_0x1c1db9){_0x206fc6=_0x206fc6-0x0;var _0x35cc76=_0xb1b7[_0x206fc6];return _0x35cc76;};'use strict';var multer=require(_0x7b1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7b1b('0x1'));var express=require(_0x7b1b('0x2'));var router=express[_0x7b1b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b1b('0x4'));var config=require('../../config/environment');var controller=require(_0x7b1b('0x5'));router[_0x7b1b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b1b('0x6')](_0x7b1b('0x7'),auth['isAuthenticated'](),controller[_0x7b1b('0x8')]);router['get']('/users',auth[_0x7b1b('0x9')](),controller[_0x7b1b('0xa')]);router[_0x7b1b('0x6')](_0x7b1b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7b1b('0xc')]('/',auth['isAuthenticated'](),controller[_0x7b1b('0xd')]);router['put'](_0x7b1b('0xb'),controller[_0x7b1b('0xe')]);router[_0x7b1b('0xf')](_0x7b1b('0xb'),auth[_0x7b1b('0x9')](),controller[_0x7b1b('0x10')]);module[_0x7b1b('0x11')]=router;
\ No newline at end of file
+var _0x260e=['index','/describe','describe','/users','getUsers','/:id','show','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x57cf34,_0x2cf8c5){var _0x378b6a=function(_0x423342){while(--_0x423342){_0x57cf34['push'](_0x57cf34['shift']());}};_0x378b6a(++_0x2cf8c5);}(_0x260e,0x1d7));var _0xe260=function(_0x1b8cb0,_0x148054){_0x1b8cb0=_0x1b8cb0-0x0;var _0x5cfe5a=_0x260e[_0x1b8cb0];return _0x5cfe5a;};'use strict';var multer=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var path=require('path');var timeout=require(_0xe260('0x2'));var express=require(_0xe260('0x3'));var router=express[_0xe260('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe260('0x5'));var config=require('../../config/environment');var controller=require(_0xe260('0x6'));router[_0xe260('0x7')]('/',auth[_0xe260('0x8')](),controller[_0xe260('0x9')]);router[_0xe260('0x7')](_0xe260('0xa'),auth['isAuthenticated'](),controller[_0xe260('0xb')]);router[_0xe260('0x7')](_0xe260('0xc'),auth[_0xe260('0x8')](),controller[_0xe260('0xd')]);router[_0xe260('0x7')](_0xe260('0xe'),auth['isAuthenticated'](),controller[_0xe260('0xf')]);router['post']('/',auth[_0xe260('0x8')](),controller[_0xe260('0x10')]);router[_0xe260('0x11')](_0xe260('0xe'),controller[_0xe260('0x12')]);router['delete'](_0xe260('0xe'),auth[_0xe260('0x8')](),controller[_0xe260('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index da8200b..56e7bc1 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 _0xbd8e=['out','DATE','STRING','sequelize','exports','BOOLEAN','ENUM'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xbd8e,0x1b5));var _0xebd8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbd8e[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xebd8('0x0'));module[_0xebd8('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xebd8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xebd8('0x3')]('in',_0xebd8('0x4')),'defaultValue':_0xebd8('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xebd8('0x5')]},'providerName':{'type':Sequelize[_0xebd8('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xd0e4=['out','DATE','STRING','sequelize','exports','TEXT','medium','ENUM'];(function(_0x3e36be,_0xf8506){var _0x107cbe=function(_0x3cab73){while(--_0x3cab73){_0x3e36be['push'](_0x3e36be['shift']());}};_0x107cbe(++_0xf8506);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x52017c,_0x393604){_0x52017c=_0x52017c-0x0;var _0xada67d=_0xd0e4[_0x52017c];return _0xada67d;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'body':{'type':Sequelize[_0x4d0e('0x2')](_0x4d0e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4d0e('0x4')]('in',_0x4d0e('0x5')),'defaultValue':_0x4d0e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4d0e('0x6')]},'providerName':{'type':Sequelize[_0x4d0e('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index e9ab451..9427827 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 _0xb774=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','describe','accept','chat','read','readAt','format','UserId','agent','message','get','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','internal','manual','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteraction','ChatInteractionId','RejectMessage','rejectMessage','fullname','email','interface','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','info','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','end','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model'];(function(_0x3342aa,_0x45057b){var _0xe85254=function(_0x30ad64){while(--_0x30ad64){_0x3342aa['push'](_0x3342aa['shift']());}};_0xe85254(++_0x45057b);}(_0xb774,0x15a));var _0x4b77=function(_0x5dcc6b,_0x3766a7){_0x5dcc6b=_0x5dcc6b-0x0;var _0x5a06b3=_0xb774[_0x5dcc6b];return _0x5a06b3;};'use strict';var emlformat=require(_0x4b77('0x0'));var rimraf=require(_0x4b77('0x1'));var zipdir=require(_0x4b77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4b77('0x3'));var BPromise=require(_0x4b77('0x4'));var Mustache=require(_0x4b77('0x5'));var util=require(_0x4b77('0x6'));var path=require('path');var sox=require(_0x4b77('0x7'));var csv=require(_0x4b77('0x8'));var ejs=require(_0x4b77('0x9'));var fs=require('fs');var fs_extra=require(_0x4b77('0xa'));var _=require(_0x4b77('0xb'));var squel=require(_0x4b77('0xc'));var crypto=require(_0x4b77('0xd'));var jsforce=require(_0x4b77('0xe'));var deskjs=require(_0x4b77('0xf'));var toCsv=require(_0x4b77('0x8'));var querystring=require(_0x4b77('0x10'));var Papa=require(_0x4b77('0x11'));var Redis=require('ioredis');var authService=require(_0x4b77('0x12'));var qs=require(_0x4b77('0x13'));var as=require(_0x4b77('0x14'));var hardwareService=require(_0x4b77('0x15'));var logger=require(_0x4b77('0x16'))(_0x4b77('0x17'));var utils=require('../../config/utils');var config=require(_0x4b77('0x18'));var licenseUtil=require(_0x4b77('0x19'));var db=require(_0x4b77('0x1a'))['db'];config['redis']=_[_0x4b77('0x1b')](config[_0x4b77('0x1c')],{'host':_0x4b77('0x1d'),'port':0x18eb});var socket=require(_0x4b77('0x1e'))(new Redis(config[_0x4b77('0x1c')]));require(_0x4b77('0x1f'))[_0x4b77('0x20')](socket);var jayson=require(_0x4b77('0x21'));var client=jayson[_0x4b77('0x22')][_0x4b77('0x23')]({'port':0x232c});var client9002=jayson[_0x4b77('0x22')][_0x4b77('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1ba1a4,_0x4dc61b,_0xa2199d,_0x4369e9){return new BPromise(function(_0x38a948,_0x354f5e){var _0x2ac41f=_0x4369e9||client;return _0x2ac41f[_0x4b77('0x24')](_0x1ba1a4,_0xa2199d)[_0x4b77('0x25')](function(_0x57b70c){logger['info'](_0x4b77('0x26'),_0x4dc61b,_0x4b77('0x27'));logger['debug'](_0x4b77('0x28'),_0x4dc61b,_0x4b77('0x27'),JSON[_0x4b77('0x29')](_0x57b70c));if(_0x57b70c[_0x4b77('0x2a')]){if(_0x57b70c[_0x4b77('0x2a')]['code']===0x1f4){logger['error'](_0x4b77('0x26'),_0x4dc61b,_0x57b70c[_0x4b77('0x2a')]['message']);return _0x354f5e(_0x57b70c[_0x4b77('0x2a')]['message']);}logger[_0x4b77('0x2a')](_0x4b77('0x26'),_0x4dc61b,_0x57b70c['error']['message']);return _0x38a948(_0x57b70c[_0x4b77('0x2a')]['message']);}else{logger[_0x4b77('0x2b')](_0x4b77('0x26'),_0x4dc61b,_0x4b77('0x27'));_0x38a948(_0x57b70c[_0x4b77('0x2c')]['message']);}})[_0x4b77('0x2d')](function(_0x54bcad){logger['error'](_0x4b77('0x26'),_0x4dc61b,_0x54bcad);_0x354f5e(_0x54bcad);});});}function respondWithStatusCode(_0x2bfb3b,_0x3bb855){_0x3bb855=_0x3bb855||0xcc;return function(_0x393e83){if(_0x393e83){return _0x2bfb3b[_0x4b77('0x2e')](_0x3bb855);}return _0x2bfb3b[_0x4b77('0x2f')](_0x3bb855)['end']();};}function respondWithResult(_0x4f8acf,_0x423214){_0x423214=_0x423214||0xc8;return function(_0x1dad29){if(_0x1dad29){return _0x4f8acf[_0x4b77('0x2f')](_0x423214)['json'](_0x1dad29);}};}function respondWithFilteredResult(_0x587f35,_0x2b596b){return function(_0x1e84b8){if(_0x1e84b8){var _0x5acefe=typeof _0x2b596b[_0x4b77('0x30')]===_0x4b77('0x31')&&typeof _0x2b596b[_0x4b77('0x32')]===_0x4b77('0x31');var _0x575ded=_0x1e84b8[_0x4b77('0x33')];var _0x4a6a72=_0x5acefe?0x0:_0x2b596b[_0x4b77('0x30')];var _0xd509a0=_0x5acefe?_0x1e84b8[_0x4b77('0x33')]:_0x2b596b[_0x4b77('0x30')]+_0x2b596b[_0x4b77('0x32')];var _0x55579c;if(_0xd509a0>=_0x575ded){_0xd509a0=_0x575ded;_0x55579c=0xc8;}else{_0x55579c=0xce;}_0x587f35[_0x4b77('0x2f')](_0x55579c);return _0x587f35['set'](_0x4b77('0x34'),_0x4a6a72+'-'+_0xd509a0+'/'+_0x575ded)[_0x4b77('0x35')](_0x1e84b8);}return null;};}function patchUpdates(_0x2d0030){return function(_0x46fc02){try{jsonpatch['apply'](_0x46fc02,_0x2d0030,!![]);}catch(_0x118f9a){return BPromise[_0x4b77('0x36')](_0x118f9a);}return _0x46fc02[_0x4b77('0x37')]();};}function saveUpdates(_0x15da3a,_0x1037c4){return function(_0x4dcf18){if(_0x4dcf18){return _0x4dcf18[_0x4b77('0x38')](_0x15da3a)[_0x4b77('0x25')](function(_0x3357e2){return _0x3357e2;});}return null;};}function removeEntity(_0x175096,_0x2f2d8d){return function(_0x1d368e){if(_0x1d368e){return _0x1d368e[_0x4b77('0x39')]()[_0x4b77('0x25')](function(){_0x175096[_0x4b77('0x2f')](0xcc)[_0x4b77('0x3a')]();});}};}function handleEntityNotFound(_0x3a9a62,_0x4e0c37){return function(_0x321b51){if(!_0x321b51){_0x3a9a62[_0x4b77('0x2e')](0x194);}return _0x321b51;};}function handleError(_0x12d076,_0x5223eb){_0x5223eb=_0x5223eb||0x1f4;return function(_0x2c5a7e){logger['error'](_0x2c5a7e['stack']);if(_0x2c5a7e[_0x4b77('0x3b')]){delete _0x2c5a7e[_0x4b77('0x3b')];}_0x12d076[_0x4b77('0x2f')](_0x5223eb)[_0x4b77('0x3c')](_0x2c5a7e);};}exports[_0x4b77('0x3d')]=function(_0x26ef4f,_0x1f16f0){var _0x2e8405={},_0x3b2755={},_0xe3132f={'count':0x0,'rows':[]};var _0x3bd994=_[_0x4b77('0x3e')](db[_0x4b77('0x3f')][_0x4b77('0x40')],function(_0x830ba5){return{'name':_0x830ba5[_0x4b77('0x41')],'type':_0x830ba5['type'][_0x4b77('0x42')]};});_0x3b2755[_0x4b77('0x43')]=_[_0x4b77('0x3e')](_0x3bd994,_0x4b77('0x3b'));_0x3b2755[_0x4b77('0x44')]=_['keys'](_0x26ef4f['query']);_0x3b2755[_0x4b77('0x45')]=_[_0x4b77('0x46')](_0x3b2755[_0x4b77('0x43')],_0x3b2755['query']);_0x2e8405['attributes']=_['intersection'](_0x3b2755[_0x4b77('0x43')],qs[_0x4b77('0x47')](_0x26ef4f['query'][_0x4b77('0x47')]));_0x2e8405[_0x4b77('0x48')]=_0x2e8405[_0x4b77('0x48')][_0x4b77('0x49')]?_0x2e8405[_0x4b77('0x48')]:_0x3b2755['model'];if(!_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x4a')](_0x4b77('0x4b'))){_0x2e8405[_0x4b77('0x32')]=qs['limit'](_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x32')]);_0x2e8405[_0x4b77('0x30')]=qs[_0x4b77('0x30')](_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x30')]);}_0x2e8405[_0x4b77('0x4c')]=qs[_0x4b77('0x4d')](_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x4d')]);_0x2e8405[_0x4b77('0x4e')]=qs[_0x4b77('0x45')](_[_0x4b77('0x4f')](_0x26ef4f[_0x4b77('0x44')],_0x3b2755[_0x4b77('0x45')]),_0x3bd994);if(_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x50')]){_0x2e8405[_0x4b77('0x4e')]=_[_0x4b77('0x51')](_0x2e8405['where'],{'$or':_[_0x4b77('0x3e')](_0x3bd994,function(_0x3db58d){if(_0x3db58d[_0x4b77('0x52')]!==_0x4b77('0x53')){var _0x337e47={};_0x337e47[_0x3db58d['name']]={'$like':'%'+_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x50')]+'%'};return _0x337e47;}})});}_0x2e8405=_[_0x4b77('0x51')]({},_0x2e8405,_0x26ef4f[_0x4b77('0x54')]);var _0x3ba911={'where':_0x2e8405[_0x4b77('0x4e')]};return db[_0x4b77('0x3f')][_0x4b77('0x33')](_0x3ba911)[_0x4b77('0x25')](function(_0x3ad4d5){_0xe3132f[_0x4b77('0x33')]=_0x3ad4d5;if(_0x26ef4f[_0x4b77('0x44')][_0x4b77('0x55')]){_0x2e8405[_0x4b77('0x56')]=[{'all':!![]}];}return db[_0x4b77('0x3f')][_0x4b77('0x57')](_0x2e8405);})[_0x4b77('0x25')](function(_0x1271a7){_0xe3132f['rows']=_0x1271a7;return _0xe3132f;})[_0x4b77('0x25')](respondWithFilteredResult(_0x1f16f0,_0x2e8405))[_0x4b77('0x2d')](handleError(_0x1f16f0,null));};exports[_0x4b77('0x58')]=function(_0xc3441c,_0x43a0f4){var _0x32b02b={'raw':!![],'where':{'id':_0xc3441c[_0x4b77('0x59')]['id']}},_0x12e876={};_0x12e876[_0x4b77('0x43')]=_['keys'](db[_0x4b77('0x3f')][_0x4b77('0x40')]);_0x12e876[_0x4b77('0x44')]=_[_0x4b77('0x5a')](_0xc3441c['query']);_0x12e876['filters']=_[_0x4b77('0x46')](_0x12e876[_0x4b77('0x43')],_0x12e876[_0x4b77('0x44')]);_0x32b02b[_0x4b77('0x48')]=_[_0x4b77('0x46')](_0x12e876[_0x4b77('0x43')],qs[_0x4b77('0x47')](_0xc3441c[_0x4b77('0x44')][_0x4b77('0x47')]));_0x32b02b[_0x4b77('0x48')]=_0x32b02b[_0x4b77('0x48')][_0x4b77('0x49')]?_0x32b02b[_0x4b77('0x48')]:_0x12e876[_0x4b77('0x43')];if(_0xc3441c['query'][_0x4b77('0x55')]){_0x32b02b['include']=[{'all':!![]}];}_0x32b02b=_[_0x4b77('0x51')]({},_0x32b02b,_0xc3441c[_0x4b77('0x54')]);return db[_0x4b77('0x3f')][_0x4b77('0x5b')](_0x32b02b)[_0x4b77('0x25')](handleEntityNotFound(_0x43a0f4,null))[_0x4b77('0x25')](respondWithResult(_0x43a0f4,null))[_0x4b77('0x2d')](handleError(_0x43a0f4,null));};exports[_0x4b77('0x5c')]=function(_0x307048,_0x504e66){return db[_0x4b77('0x3f')][_0x4b77('0x5c')](_0x307048[_0x4b77('0x5d')],{})['then'](respondWithResult(_0x504e66,0xc9))[_0x4b77('0x2d')](handleError(_0x504e66,null));};exports[_0x4b77('0x38')]=function(_0x11bf60,_0x48c415){if(_0x11bf60[_0x4b77('0x5d')]['id']){delete _0x11bf60['body']['id'];}return db[_0x4b77('0x3f')][_0x4b77('0x5b')]({'where':{'id':_0x11bf60[_0x4b77('0x59')]['id']}})[_0x4b77('0x25')](handleEntityNotFound(_0x48c415,null))['then'](saveUpdates(_0x11bf60[_0x4b77('0x5d')],null))[_0x4b77('0x25')](respondWithResult(_0x48c415,null))['catch'](handleError(_0x48c415,null));};exports[_0x4b77('0x39')]=function(_0x2fa2b5,_0x4b1e17){return db['ChatMessage'][_0x4b77('0x5b')]({'where':{'id':_0x2fa2b5[_0x4b77('0x59')]['id']}})[_0x4b77('0x25')](handleEntityNotFound(_0x4b1e17,null))[_0x4b77('0x25')](removeEntity(_0x4b1e17,null))[_0x4b77('0x2d')](handleError(_0x4b1e17,null));};exports['describe']=function(_0x4f9ebb,_0x13cfd3){return db[_0x4b77('0x3f')][_0x4b77('0x5e')]()[_0x4b77('0x25')](respondWithResult(_0x13cfd3,null))[_0x4b77('0x2d')](handleError(_0x13cfd3,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x4b77('0x5f')]=function(_0x371f0e,_0x5302fc,_0x3648f9){var _0x458621={'agent':{},'channel':_0x4b77('0x60')};if(_0x371f0e[_0x4b77('0x5d')]['id']){delete _0x371f0e['body']['id'];}_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x61')]=!![];_0x371f0e['body'][_0x4b77('0x62')]=moment()[_0x4b77('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x64')]=_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x64')]||_0x371f0e['user']['id'];_0x458621[_0x4b77('0x65')]['id']=_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x64')];return db['ChatMessage'][_0x4b77('0x5b')]({'where':{'id':_0x371f0e[_0x4b77('0x59')]['id'],'UserId':null}})[_0x4b77('0x25')](handleEntityNotFound(_0x5302fc,null))[_0x4b77('0x25')](saveUpdates(_0x371f0e[_0x4b77('0x5d')],null))[_0x4b77('0x25')](function(_0xd54159){if(_0xd54159){_0x458621[_0x4b77('0x66')]=_0xd54159[_0x4b77('0x67')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xd54159['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5302fc,null))[_0x4b77('0x25')](function(_0x5882b9){if(_0x5882b9){return _0x5882b9[_0x4b77('0x38')]({'UserId':_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x64')],'read1stAt':_[_0x4b77('0x68')](_0x5882b9['read1stAt'])?moment()['format'](_0x4b77('0x69')):undefined});}return null;})['then'](function(_0x1a137c){if(_0x1a137c){_0x458621[_0x4b77('0x6a')]=_0x1a137c[_0x4b77('0x67')]({'plain':!![]});interaction_log[_0x4b77('0x2b')](_0x4b77('0x6b'),_0x371f0e['user']['id'],_0x371f0e['user'][_0x4b77('0x3b')],_0x371f0e[_0x4b77('0x6c')][_0x4b77('0x6d')],_0x458621[_0x4b77('0x6a')]['id'],_0x371f0e['body']?JSON['stringify'](_0x371f0e['body']):_0x4b77('0x6e'));return respondWithRpcPromise(_0x4b77('0x6f'),_0x4b77('0x70'),_0x458621);}return null;})[_0x4b77('0x25')](function(_0x45af61){var _0x3b6b74=_0x4b77('0x71')+_0x45af61[_0x4b77('0x66')][_0x4b77('0x72')];return db[_0x4b77('0x73')]['query'](_0x3b6b74,{'type':db['Sequelize'][_0x4b77('0x74')][_0x4b77('0x75')],'raw':!![]})[_0x4b77('0x25')](function(_0x4f51d2){return _0x4f51d2;});})[_0x4b77('0x25')](function(_0x2ef88a){if(_0x2ef88a){_0x458621[_0x4b77('0x66')][_0x4b77('0x76')]=_0x2ef88a[0x0];if(!_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x64')])return;return db['User'][_0x4b77('0x5b')]({'where':{'id':_0x371f0e['body'][_0x4b77('0x64')],'role':_0x4b77('0x65')},'attributes':['id',_0x4b77('0x3b'),'fullname','email',_0x4b77('0x77')],'raw':!![]});}return null;})[_0x4b77('0x25')](function(_0x33bebc){if(!_0x33bebc)return null;_0x458621[_0x4b77('0x66')]['agent']=_0x33bebc;return _0x458621;})['then'](function(_0x50d124){if(_0x50d124){if(_0x371f0e[_0x4b77('0x5d')][_0x4b77('0x78')]){_0x458621[_0x4b77('0x66')]['interface']=util[_0x4b77('0x63')]('SIP/%s',_0x371f0e[_0x4b77('0x6c')][_0x4b77('0x3b')]);_0x458621[_0x4b77('0x66')][_0x4b77('0x79')]=_0x458621[_0x4b77('0x79')];_0x458621[_0x4b77('0x66')]['motionChannel']=_0x458621['channel'];_0x458621['message'][_0x4b77('0x7a')]=_0x4b77('0x5f');return respondWithRpcPromise(_0x4b77('0x7b'),_0x4b77('0x7b'),{'event':_0x4b77('0x7c'),'message':_[_0x4b77('0x51')](_0x458621[_0x4b77('0x66')],JSON[_0x4b77('0x7d')](_0x458621['interaction'][_0x4b77('0x7e')]))},client9002)[_0x4b77('0x25')](function(){return _0x458621;});}return _0x458621;}return null;})[_0x4b77('0x25')](respondWithResult(_0x5302fc,null))[_0x4b77('0x2d')](handleError(_0x5302fc,null));};var interaction_log=require(_0x4b77('0x16'))(_0x4b77('0x7f'));exports[_0x4b77('0x36')]=function(_0x46f14f,_0x266666,_0x4518ea){var _0x2b0805={'agent':{},'channel':_0x4b77('0x60')};if(_0x46f14f['body']['id']){delete _0x46f14f[_0x4b77('0x5d')]['id'];}_0x46f14f['body']['UserId']=_0x46f14f[_0x4b77('0x5d')][_0x4b77('0x64')]||_0x46f14f['user']['id'];_0x2b0805[_0x4b77('0x65')]['id']=_0x46f14f[_0x4b77('0x5d')][_0x4b77('0x64')];return db[_0x4b77('0x3f')][_0x4b77('0x5b')]({'where':{'id':_0x46f14f[_0x4b77('0x59')]['id'],'UserId':null}})[_0x4b77('0x25')](handleEntityNotFound(_0x266666,null))['then'](function(_0x513942){if(_0x513942){_0x2b0805[_0x4b77('0x66')]=_0x513942[_0x4b77('0x67')]({'plain':!![]});return db[_0x4b77('0x80')][_0x4b77('0x5b')]({'where':{'id':_0x513942[_0x4b77('0x81')]}});}return null;})[_0x4b77('0x25')](handleEntityNotFound(_0x266666,null))[_0x4b77('0x25')](function(_0x2aaf9d){if(_0x2aaf9d){_0x2b0805[_0x4b77('0x6a')]=_0x2aaf9d[_0x4b77('0x67')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46f14f[_0x4b77('0x6c')]['id'],_0x46f14f['user'][_0x4b77('0x3b')],_0x46f14f['user'][_0x4b77('0x6d')],_0x2b0805[_0x4b77('0x6a')]['id'],_0x46f14f[_0x4b77('0x5d')]?JSON[_0x4b77('0x29')](_0x46f14f[_0x4b77('0x5d')]):_0x4b77('0x6e'));return respondWithRpcPromise(_0x4b77('0x82'),_0x4b77('0x83'),_0x2b0805);}return null;})[_0x4b77('0x25')](function(_0x5cdc0e){var _0x357b13=_0x4b77('0x71')+_0x5cdc0e['message'][_0x4b77('0x72')];return db['sequelize'][_0x4b77('0x44')](_0x357b13,{'type':db['Sequelize'][_0x4b77('0x74')][_0x4b77('0x75')],'raw':!![]})['then'](function(_0x1f1ed6){return _0x1f1ed6;});})['then'](function(_0x2d7a56){if(_0x2d7a56){_0x2b0805[_0x4b77('0x66')][_0x4b77('0x76')]=_0x2d7a56[0x0];if(!_0x46f14f['body'][_0x4b77('0x64')])return;return db['User'][_0x4b77('0x5b')]({'where':{'id':_0x46f14f[_0x4b77('0x5d')]['UserId'],'role':_0x4b77('0x65')},'attributes':['id','name',_0x4b77('0x84'),_0x4b77('0x85'),_0x4b77('0x77')],'raw':!![]});}return null;})[_0x4b77('0x25')](function(_0x42d702){if(!_0x42d702)return null;_0x2b0805[_0x4b77('0x66')][_0x4b77('0x65')]=_0x42d702;return _0x2b0805;})[_0x4b77('0x25')](function(_0x4625b5){if(_0x4625b5){_0x4625b5['message'][_0x4b77('0x86')]=util[_0x4b77('0x63')](_0x4b77('0x87'),_0x46f14f[_0x4b77('0x6c')][_0x4b77('0x3b')]);_0x4625b5[_0x4b77('0x66')][_0x4b77('0x79')]=_0x2b0805[_0x4b77('0x79')];_0x4625b5[_0x4b77('0x66')][_0x4b77('0x88')]=_0x2b0805['channel'];_0x4625b5[_0x4b77('0x66')]['event']='reject';respondWithRpcPromise(_0x4b77('0x7b'),'EventManager',{'event':_0x4b77('0x89'),'message':_[_0x4b77('0x51')](_0x2b0805[_0x4b77('0x66')],JSON[_0x4b77('0x7d')](_0x2b0805[_0x4b77('0x6a')][_0x4b77('0x7e')]))},client9002);return _0x2b0805;}return null;})['then'](respondWithResult(_0x266666,null))['catch'](handleError(_0x266666,null));};
\ No newline at end of file
+var _0x7e74=['includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','email','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options'];(function(_0xee76bb,_0x583e9b){var _0x35a5c1=function(_0x3f516b){while(--_0x3f516b){_0xee76bb['push'](_0xee76bb['shift']());}};_0x35a5c1(++_0x583e9b);}(_0x7e74,0xbd));var _0x47e7=function(_0x5d1ca7,_0x40be3c){_0x5d1ca7=_0x5d1ca7-0x0;var _0x1448f6=_0x7e74[_0x5d1ca7];return _0x1448f6;};'use strict';var emlformat=require(_0x47e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47e7('0x1'));var jsonpatch=require(_0x47e7('0x2'));var rp=require(_0x47e7('0x3'));var moment=require(_0x47e7('0x4'));var BPromise=require(_0x47e7('0x5'));var Mustache=require('mustache');var util=require(_0x47e7('0x6'));var path=require(_0x47e7('0x7'));var sox=require(_0x47e7('0x8'));var csv=require(_0x47e7('0x9'));var ejs=require(_0x47e7('0xa'));var fs=require('fs');var fs_extra=require(_0x47e7('0xb'));var _=require(_0x47e7('0xc'));var squel=require('squel');var crypto=require(_0x47e7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x47e7('0xe'));var toCsv=require(_0x47e7('0x9'));var querystring=require(_0x47e7('0xf'));var Papa=require(_0x47e7('0x10'));var Redis=require(_0x47e7('0x11'));var authService=require(_0x47e7('0x12'));var qs=require(_0x47e7('0x13'));var as=require(_0x47e7('0x14'));var hardwareService=require(_0x47e7('0x15'));var logger=require(_0x47e7('0x16'))(_0x47e7('0x17'));var utils=require(_0x47e7('0x18'));var config=require(_0x47e7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x47e7('0x1a'))['db'];config[_0x47e7('0x1b')]=_[_0x47e7('0x1c')](config['redis'],{'host':_0x47e7('0x1d'),'port':0x18eb});var socket=require(_0x47e7('0x1e'))(new Redis(config[_0x47e7('0x1b')]));require(_0x47e7('0x1f'))['register'](socket);var jayson=require(_0x47e7('0x20'));var client=jayson[_0x47e7('0x21')][_0x47e7('0x22')]({'port':0x232c});var client9002=jayson[_0x47e7('0x21')][_0x47e7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5369d4,_0x2e2aeb,_0x5d4801,_0x402ccc){return new BPromise(function(_0x8c320e,_0x14b43f){var _0x433705=_0x402ccc||client;return _0x433705[_0x47e7('0x23')](_0x5369d4,_0x5d4801)[_0x47e7('0x24')](function(_0x6a3682){logger[_0x47e7('0x25')](_0x47e7('0x26'),_0x2e2aeb,_0x47e7('0x27'));logger[_0x47e7('0x28')](_0x47e7('0x29'),_0x2e2aeb,_0x47e7('0x27'),JSON[_0x47e7('0x2a')](_0x6a3682));if(_0x6a3682['error']){if(_0x6a3682['error']['code']===0x1f4){logger['error'](_0x47e7('0x26'),_0x2e2aeb,_0x6a3682[_0x47e7('0x2b')][_0x47e7('0x2c')]);return _0x14b43f(_0x6a3682[_0x47e7('0x2b')]['message']);}logger['error'](_0x47e7('0x26'),_0x2e2aeb,_0x6a3682['error'][_0x47e7('0x2c')]);return _0x8c320e(_0x6a3682['error'][_0x47e7('0x2c')]);}else{logger[_0x47e7('0x25')](_0x47e7('0x26'),_0x2e2aeb,_0x47e7('0x27'));_0x8c320e(_0x6a3682['result']['message']);}})[_0x47e7('0x2d')](function(_0x25c0ca){logger[_0x47e7('0x2b')](_0x47e7('0x26'),_0x2e2aeb,_0x25c0ca);_0x14b43f(_0x25c0ca);});});}function respondWithStatusCode(_0x5b6736,_0x43fa51){_0x43fa51=_0x43fa51||0xcc;return function(_0x105add){if(_0x105add){return _0x5b6736[_0x47e7('0x2e')](_0x43fa51);}return _0x5b6736[_0x47e7('0x2f')](_0x43fa51)['end']();};}function respondWithResult(_0x2fb377,_0x1bdb4c){_0x1bdb4c=_0x1bdb4c||0xc8;return function(_0x301a68){if(_0x301a68){return _0x2fb377[_0x47e7('0x2f')](_0x1bdb4c)[_0x47e7('0x30')](_0x301a68);}};}function respondWithFilteredResult(_0x303ff6,_0x150c8b){return function(_0x55866e){if(_0x55866e){var _0x172c80=typeof _0x150c8b[_0x47e7('0x31')]===_0x47e7('0x32')&&typeof _0x150c8b[_0x47e7('0x33')]===_0x47e7('0x32');var _0x247515=_0x55866e['count'];var _0x2bc66d=_0x172c80?0x0:_0x150c8b[_0x47e7('0x31')];var _0x4078bd=_0x172c80?_0x55866e[_0x47e7('0x34')]:_0x150c8b[_0x47e7('0x31')]+_0x150c8b['limit'];var _0x47662b;if(_0x4078bd>=_0x247515){_0x4078bd=_0x247515;_0x47662b=0xc8;}else{_0x47662b=0xce;}_0x303ff6[_0x47e7('0x2f')](_0x47662b);return _0x303ff6[_0x47e7('0x35')](_0x47e7('0x36'),_0x2bc66d+'-'+_0x4078bd+'/'+_0x247515)[_0x47e7('0x30')](_0x55866e);}return null;};}function patchUpdates(_0x24f833){return function(_0x437b89){try{jsonpatch['apply'](_0x437b89,_0x24f833,!![]);}catch(_0x5dfae3){return BPromise[_0x47e7('0x37')](_0x5dfae3);}return _0x437b89['save']();};}function saveUpdates(_0x2d73c8,_0x6be695){return function(_0x5667fe){if(_0x5667fe){return _0x5667fe[_0x47e7('0x38')](_0x2d73c8)[_0x47e7('0x24')](function(_0x1f80e0){return _0x1f80e0;});}return null;};}function removeEntity(_0x526ad1,_0x58657f){return function(_0x2ad26d){if(_0x2ad26d){return _0x2ad26d[_0x47e7('0x39')]()['then'](function(){_0x526ad1[_0x47e7('0x2f')](0xcc)[_0x47e7('0x3a')]();});}};}function handleEntityNotFound(_0x3af095,_0x54542a){return function(_0x1fc445){if(!_0x1fc445){_0x3af095['sendStatus'](0x194);}return _0x1fc445;};}function handleError(_0x442081,_0x33c4f6){_0x33c4f6=_0x33c4f6||0x1f4;return function(_0x182cb9){logger['error'](_0x182cb9[_0x47e7('0x3b')]);if(_0x182cb9[_0x47e7('0x3c')]){delete _0x182cb9[_0x47e7('0x3c')];}_0x442081[_0x47e7('0x2f')](_0x33c4f6)[_0x47e7('0x3d')](_0x182cb9);};}exports[_0x47e7('0x3e')]=function(_0x4a551a,_0x5621ed){var _0x2b4994={},_0x4dabbb={},_0x16f2dd={'count':0x0,'rows':[]};var _0x3eb435=_[_0x47e7('0x3f')](db[_0x47e7('0x40')][_0x47e7('0x41')],function(_0x127bdc){return{'name':_0x127bdc[_0x47e7('0x42')],'type':_0x127bdc[_0x47e7('0x43')][_0x47e7('0x44')]};});_0x4dabbb[_0x47e7('0x45')]=_['map'](_0x3eb435,_0x47e7('0x3c'));_0x4dabbb['query']=_['keys'](_0x4a551a['query']);_0x4dabbb[_0x47e7('0x46')]=_[_0x47e7('0x47')](_0x4dabbb['model'],_0x4dabbb[_0x47e7('0x48')]);_0x2b4994[_0x47e7('0x49')]=_[_0x47e7('0x47')](_0x4dabbb[_0x47e7('0x45')],qs[_0x47e7('0x4a')](_0x4a551a['query'][_0x47e7('0x4a')]));_0x2b4994['attributes']=_0x2b4994[_0x47e7('0x49')][_0x47e7('0x4b')]?_0x2b4994[_0x47e7('0x49')]:_0x4dabbb['model'];if(!_0x4a551a[_0x47e7('0x48')][_0x47e7('0x4c')]('nolimit')){_0x2b4994['limit']=qs[_0x47e7('0x33')](_0x4a551a[_0x47e7('0x48')][_0x47e7('0x33')]);_0x2b4994['offset']=qs[_0x47e7('0x31')](_0x4a551a[_0x47e7('0x48')][_0x47e7('0x31')]);}_0x2b4994[_0x47e7('0x4d')]=qs[_0x47e7('0x4e')](_0x4a551a[_0x47e7('0x48')][_0x47e7('0x4e')]);_0x2b4994[_0x47e7('0x4f')]=qs[_0x47e7('0x46')](_[_0x47e7('0x50')](_0x4a551a[_0x47e7('0x48')],_0x4dabbb['filters']),_0x3eb435);if(_0x4a551a[_0x47e7('0x48')]['filter']){_0x2b4994[_0x47e7('0x4f')]=_['merge'](_0x2b4994[_0x47e7('0x4f')],{'$or':_['map'](_0x3eb435,function(_0x515665){if(_0x515665[_0x47e7('0x43')]!==_0x47e7('0x51')){var _0x594509={};_0x594509[_0x515665[_0x47e7('0x3c')]]={'$like':'%'+_0x4a551a[_0x47e7('0x48')][_0x47e7('0x52')]+'%'};return _0x594509;}})});}_0x2b4994=_[_0x47e7('0x53')]({},_0x2b4994,_0x4a551a[_0x47e7('0x54')]);var _0x8f2e5b={'where':_0x2b4994[_0x47e7('0x4f')]};return db[_0x47e7('0x40')][_0x47e7('0x34')](_0x8f2e5b)['then'](function(_0x18449a){_0x16f2dd['count']=_0x18449a;if(_0x4a551a['query'][_0x47e7('0x55')]){_0x2b4994[_0x47e7('0x56')]=[{'all':!![]}];}return db[_0x47e7('0x40')][_0x47e7('0x57')](_0x2b4994);})['then'](function(_0x59cc9a){_0x16f2dd[_0x47e7('0x58')]=_0x59cc9a;return _0x16f2dd;})[_0x47e7('0x24')](respondWithFilteredResult(_0x5621ed,_0x2b4994))[_0x47e7('0x2d')](handleError(_0x5621ed,null));};exports[_0x47e7('0x59')]=function(_0x5d0ad6,_0x926bc4){var _0x4db135={'raw':!![],'where':{'id':_0x5d0ad6[_0x47e7('0x5a')]['id']}},_0x5611fd={};_0x5611fd['model']=_[_0x47e7('0x5b')](db[_0x47e7('0x40')][_0x47e7('0x41')]);_0x5611fd[_0x47e7('0x48')]=_[_0x47e7('0x5b')](_0x5d0ad6[_0x47e7('0x48')]);_0x5611fd[_0x47e7('0x46')]=_[_0x47e7('0x47')](_0x5611fd[_0x47e7('0x45')],_0x5611fd[_0x47e7('0x48')]);_0x4db135[_0x47e7('0x49')]=_[_0x47e7('0x47')](_0x5611fd['model'],qs[_0x47e7('0x4a')](_0x5d0ad6['query'][_0x47e7('0x4a')]));_0x4db135[_0x47e7('0x49')]=_0x4db135[_0x47e7('0x49')][_0x47e7('0x4b')]?_0x4db135[_0x47e7('0x49')]:_0x5611fd[_0x47e7('0x45')];if(_0x5d0ad6[_0x47e7('0x48')][_0x47e7('0x55')]){_0x4db135[_0x47e7('0x56')]=[{'all':!![]}];}_0x4db135=_[_0x47e7('0x53')]({},_0x4db135,_0x5d0ad6[_0x47e7('0x54')]);return db[_0x47e7('0x40')][_0x47e7('0x5c')](_0x4db135)[_0x47e7('0x24')](handleEntityNotFound(_0x926bc4,null))[_0x47e7('0x24')](respondWithResult(_0x926bc4,null))['catch'](handleError(_0x926bc4,null));};exports['create']=function(_0x393a7e,_0x342ae3){return db['ChatMessage'][_0x47e7('0x5d')](_0x393a7e[_0x47e7('0x5e')],{})[_0x47e7('0x24')](respondWithResult(_0x342ae3,0xc9))['catch'](handleError(_0x342ae3,null));};exports[_0x47e7('0x38')]=function(_0x47d3fb,_0x4200c2){if(_0x47d3fb[_0x47e7('0x5e')]['id']){delete _0x47d3fb['body']['id'];}return db[_0x47e7('0x40')][_0x47e7('0x5c')]({'where':{'id':_0x47d3fb[_0x47e7('0x5a')]['id']}})[_0x47e7('0x24')](handleEntityNotFound(_0x4200c2,null))[_0x47e7('0x24')](saveUpdates(_0x47d3fb[_0x47e7('0x5e')],null))[_0x47e7('0x24')](respondWithResult(_0x4200c2,null))['catch'](handleError(_0x4200c2,null));};exports[_0x47e7('0x39')]=function(_0x12868c,_0x2da89c){return db[_0x47e7('0x40')]['find']({'where':{'id':_0x12868c[_0x47e7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2da89c,null))[_0x47e7('0x24')](removeEntity(_0x2da89c,null))['catch'](handleError(_0x2da89c,null));};exports[_0x47e7('0x5f')]=function(_0x5a953a,_0x192f8f){return db[_0x47e7('0x40')][_0x47e7('0x5f')]()[_0x47e7('0x24')](respondWithResult(_0x192f8f,null))[_0x47e7('0x2d')](handleError(_0x192f8f,null));};var interaction_log=require(_0x47e7('0x16'))(_0x47e7('0x60'));exports[_0x47e7('0x61')]=function(_0xb92a0b,_0x5c8213,_0x4f7aba){var _0x3788b8={'agent':{},'channel':_0x47e7('0x62')};if(_0xb92a0b['body']['id']){delete _0xb92a0b[_0x47e7('0x5e')]['id'];}_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x63')]=!![];_0xb92a0b[_0x47e7('0x5e')]['readAt']=moment()[_0x47e7('0x64')](_0x47e7('0x65'));_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')]=_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')]||_0xb92a0b[_0x47e7('0x67')]['id'];_0x3788b8[_0x47e7('0x68')]['id']=_0xb92a0b[_0x47e7('0x5e')]['UserId'];return db[_0x47e7('0x40')][_0x47e7('0x5c')]({'where':{'id':_0xb92a0b[_0x47e7('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c8213,null))[_0x47e7('0x24')](saveUpdates(_0xb92a0b[_0x47e7('0x5e')],null))['then'](function(_0x52de0c){if(_0x52de0c){_0x3788b8[_0x47e7('0x2c')]=_0x52de0c[_0x47e7('0x69')]({'plain':!![]});return db[_0x47e7('0x6a')][_0x47e7('0x5c')]({'where':{'id':_0x52de0c[_0x47e7('0x6b')]}});}return null;})[_0x47e7('0x24')](handleEntityNotFound(_0x5c8213,null))['then'](function(_0x50df62){if(_0x50df62){return _0x50df62[_0x47e7('0x38')]({'UserId':_0xb92a0b[_0x47e7('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x50df62[_0x47e7('0x6c')])?moment()[_0x47e7('0x64')](_0x47e7('0x65')):undefined});}return null;})['then'](function(_0x8c3fa6){if(_0x8c3fa6){_0x3788b8[_0x47e7('0x6d')]=_0x8c3fa6[_0x47e7('0x69')]({'plain':!![]});interaction_log['info'](_0x47e7('0x6e'),_0xb92a0b[_0x47e7('0x67')]['id'],_0xb92a0b[_0x47e7('0x67')][_0x47e7('0x3c')],_0xb92a0b[_0x47e7('0x67')]['role'],_0x3788b8[_0x47e7('0x6d')]['id'],_0xb92a0b['body']?JSON[_0x47e7('0x2a')](_0xb92a0b[_0x47e7('0x5e')]):_0x47e7('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3788b8);}return null;})[_0x47e7('0x24')](function(_0x5ac619){var _0x5a33b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5ac619['message'][_0x47e7('0x70')];return db['sequelize']['query'](_0x5a33b2,{'type':db[_0x47e7('0x71')][_0x47e7('0x72')][_0x47e7('0x73')],'raw':!![]})[_0x47e7('0x24')](function(_0x1e3cdb){return _0x1e3cdb;});})[_0x47e7('0x24')](function(_0x43ca43){if(_0x43ca43){_0x3788b8[_0x47e7('0x2c')][_0x47e7('0x74')]=_0x43ca43[0x0];if(!_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')])return;return db['User'][_0x47e7('0x5c')]({'where':{'id':_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x66')],'role':_0x47e7('0x68')},'attributes':['id',_0x47e7('0x3c'),_0x47e7('0x75'),'email',_0x47e7('0x76')],'raw':!![]});}return null;})[_0x47e7('0x24')](function(_0x5a5cfd){if(!_0x5a5cfd)return null;_0x3788b8[_0x47e7('0x2c')]['agent']=_0x5a5cfd;return _0x3788b8;})[_0x47e7('0x24')](function(_0x421efb){if(_0x421efb){if(_0xb92a0b[_0x47e7('0x5e')][_0x47e7('0x77')]){_0x3788b8['message'][_0x47e7('0x78')]=util[_0x47e7('0x64')](_0x47e7('0x79'),_0xb92a0b['user']['name']);_0x3788b8[_0x47e7('0x2c')]['channel']=_0x3788b8[_0x47e7('0x7a')];_0x3788b8[_0x47e7('0x2c')][_0x47e7('0x7b')]=_0x3788b8[_0x47e7('0x7a')];_0x3788b8['message'][_0x47e7('0x7c')]=_0x47e7('0x61');return respondWithRpcPromise(_0x47e7('0x7d'),_0x47e7('0x7d'),{'event':_0x47e7('0x7e'),'message':_[_0x47e7('0x53')](_0x3788b8[_0x47e7('0x2c')],JSON[_0x47e7('0x7f')](_0x3788b8['interaction'][_0x47e7('0x80')]))},client9002)[_0x47e7('0x24')](function(){return _0x3788b8;});}return _0x3788b8;}return null;})[_0x47e7('0x24')](respondWithResult(_0x5c8213,null))[_0x47e7('0x2d')](handleError(_0x5c8213,null));};var interaction_log=require(_0x47e7('0x16'))('chat-interactions');exports['reject']=function(_0x347ba9,_0x4916e1,_0x1ceed6){var _0x454d8c={'agent':{},'channel':_0x47e7('0x62')};if(_0x347ba9['body']['id']){delete _0x347ba9['body']['id'];}_0x347ba9[_0x47e7('0x5e')]['UserId']=_0x347ba9[_0x47e7('0x5e')][_0x47e7('0x66')]||_0x347ba9[_0x47e7('0x67')]['id'];_0x454d8c[_0x47e7('0x68')]['id']=_0x347ba9[_0x47e7('0x5e')][_0x47e7('0x66')];return db['ChatMessage'][_0x47e7('0x5c')]({'where':{'id':_0x347ba9[_0x47e7('0x5a')]['id'],'UserId':null}})[_0x47e7('0x24')](handleEntityNotFound(_0x4916e1,null))['then'](function(_0x3cba0d){if(_0x3cba0d){_0x454d8c['message']=_0x3cba0d[_0x47e7('0x69')]({'plain':!![]});return db[_0x47e7('0x6a')][_0x47e7('0x5c')]({'where':{'id':_0x3cba0d[_0x47e7('0x6b')]}});}return null;})[_0x47e7('0x24')](handleEntityNotFound(_0x4916e1,null))[_0x47e7('0x24')](function(_0x3d9f17){if(_0x3d9f17){_0x454d8c[_0x47e7('0x6d')]=_0x3d9f17['get']({'plain':!![]});interaction_log[_0x47e7('0x25')](_0x47e7('0x81'),_0x347ba9['user']['id'],_0x347ba9[_0x47e7('0x67')][_0x47e7('0x3c')],_0x347ba9['user'][_0x47e7('0x82')],_0x454d8c['interaction']['id'],_0x347ba9[_0x47e7('0x5e')]?JSON['stringify'](_0x347ba9[_0x47e7('0x5e')]):'null');return respondWithRpcPromise(_0x47e7('0x83'),_0x47e7('0x84'),_0x454d8c);}return null;})[_0x47e7('0x24')](function(_0x417da2){var _0x6f88fa=_0x47e7('0x85')+_0x417da2[_0x47e7('0x2c')][_0x47e7('0x70')];return db[_0x47e7('0x86')][_0x47e7('0x48')](_0x6f88fa,{'type':db[_0x47e7('0x71')][_0x47e7('0x72')][_0x47e7('0x73')],'raw':!![]})['then'](function(_0x58b318){return _0x58b318;});})[_0x47e7('0x24')](function(_0xd25b68){if(_0xd25b68){_0x454d8c[_0x47e7('0x2c')]['contact']=_0xd25b68[0x0];if(!_0x347ba9[_0x47e7('0x5e')]['UserId'])return;return db['User']['find']({'where':{'id':_0x347ba9['body'][_0x47e7('0x66')],'role':'agent'},'attributes':['id','name',_0x47e7('0x75'),_0x47e7('0x87'),'internal'],'raw':!![]});}return null;})[_0x47e7('0x24')](function(_0x149fe0){if(!_0x149fe0)return null;_0x454d8c[_0x47e7('0x2c')][_0x47e7('0x68')]=_0x149fe0;return _0x454d8c;})[_0x47e7('0x24')](function(_0x47b71d){if(_0x47b71d){_0x47b71d['message'][_0x47e7('0x78')]=util[_0x47e7('0x64')](_0x47e7('0x79'),_0x347ba9['user'][_0x47e7('0x3c')]);_0x47b71d[_0x47e7('0x2c')][_0x47e7('0x7a')]=_0x454d8c[_0x47e7('0x7a')];_0x47b71d[_0x47e7('0x2c')][_0x47e7('0x7b')]=_0x454d8c[_0x47e7('0x7a')];_0x47b71d[_0x47e7('0x2c')][_0x47e7('0x7c')]='reject';respondWithRpcPromise(_0x47e7('0x7d'),_0x47e7('0x7d'),{'event':_0x47e7('0x88'),'message':_[_0x47e7('0x53')](_0x454d8c[_0x47e7('0x2c')],JSON['parse'](_0x454d8c[_0x47e7('0x6d')]['formData']))},client9002);return _0x454d8c;}return null;})[_0x47e7('0x24')](respondWithResult(_0x4916e1,null))[_0x47e7('0x2d')](handleError(_0x4916e1,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 64abe5a..9df2b3e 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 _0x6505=['hasOwnProperty','hook','exports','ChatMessage','save','update','remove','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6505,0x1bb));var _0x5650=function(_0x379e1a,_0x5423f7){_0x379e1a=_0x379e1a-0x0;var _0xa4613e=_0x6505[_0x379e1a];return _0xa4613e;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x5650('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5650('0x1'),'afterUpdate':_0x5650('0x2'),'afterDestroy':_0x5650('0x3')};function emitEvent(_0x547fcc){return function(_0xc8feca,_0x4b88d2,_0x333de1){ChatMessageEvents['emit'](_0x547fcc+':'+_0xc8feca['id'],_0xc8feca);ChatMessageEvents[_0x5650('0x4')](_0x547fcc,_0xc8feca);_0x333de1(null);};}for(var e in events){if(events[_0x5650('0x5')](e)){var event=events[e];ChatMessage[_0x5650('0x6')](e,emitEvent(event));}}module[_0x5650('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x044c=['exports','../../mysqldb','save','update','emit','hasOwnProperty','hook'];(function(_0x155a6a,_0xd1824e){var _0x2d8a38=function(_0x44bbd3){while(--_0x44bbd3){_0x155a6a['push'](_0x155a6a['shift']());}};_0x2d8a38(++_0xd1824e);}(_0x044c,0xd3));var _0xc044=function(_0x352fbb,_0x2a6bfa){_0x352fbb=_0x352fbb-0x0;var _0x2a14ab=_0x044c[_0x352fbb];return _0x2a14ab;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xc044('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc044('0x1'),'afterUpdate':_0xc044('0x2'),'afterDestroy':'remove'};function emitEvent(_0x451826){return function(_0x5cfc29,_0x3e64a2,_0x201a7d){ChatMessageEvents[_0xc044('0x3')](_0x451826+':'+_0x5cfc29['id'],_0x5cfc29);ChatMessageEvents['emit'](_0x451826,_0x5cfc29);_0x201a7d(null);};}for(var e in events){if(events[_0xc044('0x4')](e)){var event=events[e];ChatMessage[_0xc044('0x5')](e,emitEvent(event));}}module[_0xc044('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 c9cf604..720ab24 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 _0x7ece=['findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x2ab251,_0x41f7bb){var _0x4461c4=function(_0x5258bf){while(--_0x5258bf){_0x2ab251['push'](_0x2ab251['shift']());}};_0x4461c4(++_0x41f7bb);}(_0x7ece,0xc9));var _0xe7ec=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x7ece[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0xe7ec('0x0'));var logger=require(_0xe7ec('0x1'))('api');var moment=require(_0xe7ec('0x2'));var BPromise=require(_0xe7ec('0x3'));var rp=require(_0xe7ec('0x4'));var fs=require('fs');var path=require(_0xe7ec('0x5'));var rimraf=require(_0xe7ec('0x6'));var config=require(_0xe7ec('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x3c75d4,_0x5607ec){return _0x3c75d4[_0xe7ec('0x8')](_0xe7ec('0x9'),attributes,{'tableName':_0xe7ec('0xa'),'paranoid':![],'indexes':[{'name':_0xe7ec('0xb'),'fields':[_0xe7ec('0xc')],'type':_0xe7ec('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c1a09,_0x80c380,_0x54770e){var _0x2b6681=_0x3c75d4[_0xe7ec('0xe')];var _0x56762c=_0x5c1a09[_0xe7ec('0xf')]({'plain':!![]});if(_0x56762c[_0xe7ec('0x10')]['toLowerCase']()==='in'||_0x56762c[_0xe7ec('0x10')][_0xe7ec('0x11')]()===_0xe7ec('0x12')&&!_0x56762c[_0xe7ec('0x13')]&&!_[_0xe7ec('0x14')](_0x56762c[_0xe7ec('0x15')])){_0x2b6681[_0xe7ec('0x16')][_0xe7ec('0x17')]({'where':{'id':_0x56762c[_0xe7ec('0x18')]}})[_0xe7ec('0x19')](function(_0x4bc02d){if(_0x4bc02d){_0x4bc02d[_0xe7ec('0x1a')]({'lastMsgAt':_0x56762c[_0xe7ec('0x1b')],'lastMsgDirection':_0x56762c['direction']['toLowerCase']()});}})[_0xe7ec('0x1c')](function(_0x28c353){console[_0xe7ec('0x1d')](_0x28c353);});}_0x54770e();}},'charset':_0xe7ec('0x1e'),'collate':_0xe7ec('0x1f')});};
\ No newline at end of file
+var _0xdbd0=['moment','request-promise','path','rimraf','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdbd0,0x88));var _0x0dbd=function(_0x464292,_0x33a95b){_0x464292=_0x464292-0x0;var _0x3c0e40=_0xdbd0[_0x464292];return _0x3c0e40;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var logger=require(_0x0dbd('0x2'))(_0x0dbd('0x3'));var moment=require(_0x0dbd('0x4'));var BPromise=require('bluebird');var rp=require(_0x0dbd('0x5'));var fs=require('fs');var path=require(_0x0dbd('0x6'));var rimraf=require(_0x0dbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x0dbd('0x8'));module[_0x0dbd('0x9')]=function(_0xcd515f,_0x3bd770){return _0xcd515f['define']('ChatMessage',attributes,{'tableName':_0x0dbd('0xa'),'paranoid':![],'indexes':[{'name':_0x0dbd('0xb'),'fields':[_0x0dbd('0xc')],'type':_0x0dbd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12057a,_0x453836,_0x5329e7){var _0x55f318=_0xcd515f[_0x0dbd('0xe')];var _0x1e0d57=_0x12057a[_0x0dbd('0xf')]({'plain':!![]});if(_0x1e0d57[_0x0dbd('0x10')][_0x0dbd('0x11')]()==='in'||_0x1e0d57[_0x0dbd('0x10')][_0x0dbd('0x11')]()===_0x0dbd('0x12')&&!_0x1e0d57['secret']&&!_[_0x0dbd('0x13')](_0x1e0d57[_0x0dbd('0x14')])){_0x55f318[_0x0dbd('0x15')]['findOne']({'where':{'id':_0x1e0d57[_0x0dbd('0x16')]}})[_0x0dbd('0x17')](function(_0x1a45d0){if(_0x1a45d0){_0x1a45d0[_0x0dbd('0x18')]({'lastMsgAt':_0x1e0d57[_0x0dbd('0x19')],'lastMsgDirection':_0x1e0d57[_0x0dbd('0x10')][_0x0dbd('0x11')]()});}})[_0x0dbd('0x1a')](function(_0x1b9134){console['error'](_0x1b9134);});}_0x5329e7();}},'charset':'utf8mb4','collate':_0x0dbd('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 7b6624d..e09f211 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 _0x7f5f=['error','message','result','catch','CreateChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','register','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x7f5f,0xa0));var _0xf7f5=function(_0x3cb29e,_0x18685c){_0x3cb29e=_0x3cb29e-0x0;var _0x578d7e=_0x7f5f[_0x3cb29e];return _0x578d7e;};'use strict';var _=require(_0xf7f5('0x0'));var util=require(_0xf7f5('0x1'));var moment=require(_0xf7f5('0x2'));var BPromise=require(_0xf7f5('0x3'));var rs=require(_0xf7f5('0x4'));var fs=require('fs');var Redis=require(_0xf7f5('0x5'));var db=require(_0xf7f5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7f5('0x7'))(_0xf7f5('0x8'));var config=require(_0xf7f5('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf7f5('0xa')]=_['defaults'](config[_0xf7f5('0xa')],{'host':_0xf7f5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7f5('0xa')]));require('./chatMessage.socket')[_0xf7f5('0xc')](socket);function respondWithRpcPromise(_0x217eb1,_0x22712a,_0x20f38e){return new BPromise(function(_0x1ffe26,_0x497590){return client[_0xf7f5('0xd')](_0x217eb1,_0x20f38e)[_0xf7f5('0xe')](function(_0x462a37){logger[_0xf7f5('0xf')](_0xf7f5('0x10'),_0x22712a,'request\x20sent');logger['debug'](_0xf7f5('0x11'),_0x22712a,_0xf7f5('0x12'),JSON[_0xf7f5('0x13')](_0x462a37));if(_0x462a37[_0xf7f5('0x14')]){if(_0x462a37['error']['code']===0x1f4){logger[_0xf7f5('0x14')]('ChatMessage,\x20%s,\x20%s',_0x22712a,_0x462a37[_0xf7f5('0x14')][_0xf7f5('0x15')]);return _0x497590(_0x462a37['error'][_0xf7f5('0x15')]);}logger[_0xf7f5('0x14')](_0xf7f5('0x10'),_0x22712a,_0x462a37[_0xf7f5('0x14')][_0xf7f5('0x15')]);return _0x1ffe26(_0x462a37[_0xf7f5('0x14')][_0xf7f5('0x15')]);}else{logger['info'](_0xf7f5('0x10'),_0x22712a,_0xf7f5('0x12'));_0x1ffe26(_0x462a37[_0xf7f5('0x16')][_0xf7f5('0x15')]);}})[_0xf7f5('0x17')](function(_0x52f72f){logger['error'](_0xf7f5('0x10'),_0x22712a,_0x52f72f);_0x497590(_0x52f72f);});});}exports[_0xf7f5('0x18')]=function(_0x50c4e2){var _0x4b3cd5=this;return new Promise(function(_0x477cf4,_0x3c6f4a){return db['ChatMessage'][_0xf7f5('0x19')](_0x50c4e2[_0xf7f5('0x1a')],{'raw':_0x50c4e2['options']?_0x50c4e2[_0xf7f5('0x1b')][_0xf7f5('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2f5b74){logger[_0xf7f5('0xf')]('CreateChatMessage',_0x50c4e2);logger[_0xf7f5('0x1d')](_0xf7f5('0x18'),_0x50c4e2,JSON[_0xf7f5('0x13')](_0x2f5b74));_0x477cf4(_0x2f5b74);})[_0xf7f5('0x17')](function(_0x4b4d26){logger[_0xf7f5('0x14')](_0xf7f5('0x18'),_0x4b4d26[_0xf7f5('0x15')],_0x50c4e2);_0x3c6f4a(_0x4b3cd5['error'](0x1f4,_0x4b4d26[_0xf7f5('0x15')]));});});};
\ No newline at end of file
+var _0x209e=['request\x20sent','debug','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x209e,0x70));var _0xe209=function(_0x504023,_0x8d76bc){_0x504023=_0x504023-0x0;var _0x36acf4=_0x209e[_0x504023];return _0x36acf4;};'use strict';var _=require(_0xe209('0x0'));var util=require(_0xe209('0x1'));var moment=require(_0xe209('0x2'));var BPromise=require(_0xe209('0x3'));var rs=require(_0xe209('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe209('0x5'))['db'];var utils=require(_0xe209('0x6'));var logger=require(_0xe209('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe209('0x8'));var client=jayson[_0xe209('0x9')][_0xe209('0xa')]({'port':0x232a});config[_0xe209('0xb')]=_[_0xe209('0xc')](config[_0xe209('0xb')],{'host':_0xe209('0xd'),'port':0x18eb});var socket=require(_0xe209('0xe'))(new Redis(config[_0xe209('0xb')]));require('./chatMessage.socket')[_0xe209('0xf')](socket);function respondWithRpcPromise(_0x2c2437,_0x517e98,_0x8dd254){return new BPromise(function(_0x4511a9,_0x90f35e){return client[_0xe209('0x10')](_0x2c2437,_0x8dd254)[_0xe209('0x11')](function(_0x4fc971){logger[_0xe209('0x12')](_0xe209('0x13'),_0x517e98,_0xe209('0x14'));logger[_0xe209('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x517e98,_0xe209('0x14'),JSON['stringify'](_0x4fc971));if(_0x4fc971[_0xe209('0x16')]){if(_0x4fc971[_0xe209('0x16')][_0xe209('0x17')]===0x1f4){logger[_0xe209('0x16')](_0xe209('0x13'),_0x517e98,_0x4fc971[_0xe209('0x16')]['message']);return _0x90f35e(_0x4fc971[_0xe209('0x16')][_0xe209('0x18')]);}logger[_0xe209('0x16')](_0xe209('0x13'),_0x517e98,_0x4fc971['error'][_0xe209('0x18')]);return _0x4511a9(_0x4fc971[_0xe209('0x16')][_0xe209('0x18')]);}else{logger[_0xe209('0x12')](_0xe209('0x13'),_0x517e98,'request\x20sent');_0x4511a9(_0x4fc971[_0xe209('0x19')][_0xe209('0x18')]);}})[_0xe209('0x1a')](function(_0x1e927a){logger[_0xe209('0x16')](_0xe209('0x13'),_0x517e98,_0x1e927a);_0x90f35e(_0x1e927a);});});}exports[_0xe209('0x1b')]=function(_0x35b05c){var _0x5197ef=this;return new Promise(function(_0xde1346,_0x1e35ed){return db[_0xe209('0x1c')][_0xe209('0x1d')](_0x35b05c['body'],{'raw':_0x35b05c['options']?_0x35b05c[_0xe209('0x1e')][_0xe209('0x1f')]===undefined?!![]:![]:!![]})[_0xe209('0x11')](function(_0x9a7ee){logger[_0xe209('0x12')](_0xe209('0x1b'),_0x35b05c);logger['debug'](_0xe209('0x1b'),_0x35b05c,JSON[_0xe209('0x20')](_0x9a7ee));_0xde1346(_0x9a7ee);})[_0xe209('0x1a')](function(_0x173f4d){logger['error'](_0xe209('0x1b'),_0x173f4d[_0xe209('0x18')],_0x35b05c);_0x1e35ed(_0x5197ef[_0xe209('0x16')](0x1f4,_0x173f4d['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index e417bde..771cbe1 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 _0xd9ef=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x147501,_0x117d97){var _0x5e8a73=function(_0x3254a3){while(--_0x3254a3){_0x147501['push'](_0x147501['shift']());}};_0x5e8a73(++_0x117d97);}(_0xd9ef,0x95));var _0xfd9e=function(_0x5e0297,_0x11dd50){_0x5e0297=_0x5e0297-0x0;var _0x47c1ec=_0xd9ef[_0x5e0297];return _0x47c1ec;};'use strict';var ChatMessageEvents=require(_0xfd9e('0x0'));var events=[_0xfd9e('0x1'),'remove',_0xfd9e('0x2')];function createListener(_0x55d1e2,_0x57c743){return function(_0x505f7f){_0x57c743[_0xfd9e('0x3')](_0x55d1e2,_0x505f7f);};}function removeListener(_0x28cfac,_0xe6990b){return function(){ChatMessageEvents[_0xfd9e('0x4')](_0x28cfac,_0xe6990b);};}exports[_0xfd9e('0x5')]=function(_0x178ceb){for(var _0x2d549f=0x0,_0x3c3dec=events[_0xfd9e('0x6')];_0x2d549f<_0x3c3dec;_0x2d549f++){var _0x302795=events[_0x2d549f];var _0xb61585=createListener(_0xfd9e('0x7')+_0x302795,_0x178ceb);ChatMessageEvents['on'](_0x302795,_0xb61585);}};
\ No newline at end of file
+var _0xaa3f=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x11bcbd,_0x4d39b3){var _0x58aa24=function(_0x7b15f3){while(--_0x7b15f3){_0x11bcbd['push'](_0x11bcbd['shift']());}};_0x58aa24(++_0x4d39b3);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x503a45,_0x12312f){_0x503a45=_0x503a45-0x0;var _0x1a27d1=_0xaa3f[_0x503a45];return _0x1a27d1;};'use strict';var ChatMessageEvents=require(_0xfaa3('0x0'));var events=[_0xfaa3('0x1'),_0xfaa3('0x2'),_0xfaa3('0x3')];function createListener(_0x1ebbfb,_0x1da39b){return function(_0x408343){_0x1da39b[_0xfaa3('0x4')](_0x1ebbfb,_0x408343);};}function removeListener(_0x32f4e1,_0x5123a3){return function(){ChatMessageEvents['removeListener'](_0x32f4e1,_0x5123a3);};}exports[_0xfaa3('0x5')]=function(_0x4bac92){for(var _0x3d09aa=0x0,_0xeecce5=events[_0xfaa3('0x6')];_0x3d09aa<_0xeecce5;_0x3d09aa++){var _0xbf270c=events[_0x3d09aa];var _0x328d5f=createListener(_0xfaa3('0x7')+_0xbf270c,_0x4bac92);ChatMessageEvents['on'](_0xbf270c,_0x328d5f);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 9c2772c..85f1ed6 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 _0x9753=['isAuthenticated','describe','/:id','post','tracked','chatmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','index'];(function(_0x21a616,_0x285a7f){var _0x2d0cd6=function(_0x7b77f){while(--_0x7b77f){_0x21a616['push'](_0x21a616['shift']());}};_0x2d0cd6(++_0x285a7f);}(_0x9753,0xce));var _0x3975=function(_0x53f3ad,_0x39163e){_0x53f3ad=_0x53f3ad-0x0;var _0x48b203=_0x9753[_0x53f3ad];return _0x48b203;};'use strict';var multer=require(_0x3975('0x0'));var util=require(_0x3975('0x1'));var path=require(_0x3975('0x2'));var timeout=require('connect-timeout');var express=require(_0x3975('0x3'));var router=express[_0x3975('0x4')]();var fs_extra=require(_0x3975('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3975('0x6'));var controller=require(_0x3975('0x7'));router[_0x3975('0x8')]('/',auth['isAuthenticated'](),controller[_0x3975('0x9')]);router['get']('/describe',auth[_0x3975('0xa')](),controller[_0x3975('0xb')]);router[_0x3975('0x8')](_0x3975('0xc'),auth[_0x3975('0xa')](),controller['show']);router[_0x3975('0xd')]('/',auth['isAuthenticated'](),interaction[_0x3975('0xe')]('chat',_0x3975('0xf')),controller['create']);router[_0x3975('0x10')](_0x3975('0xc'),controller[_0x3975('0x11')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x3975('0x12')]);router[_0x3975('0x10')](_0x3975('0x13'),auth[_0x3975('0xa')](),controller[_0x3975('0x14')]);router[_0x3975('0x15')](_0x3975('0xc'),auth['isAuthenticated'](),controller[_0x3975('0x16')]);module[_0x3975('0x17')]=router;
\ No newline at end of file
+var _0x3c8a=['update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','chat','chatmessage:create','put'];(function(_0x5dafd0,_0x3bcbb6){var _0x364354=function(_0x5da31c){while(--_0x5da31c){_0x5dafd0['push'](_0x5dafd0['shift']());}};_0x364354(++_0x3bcbb6);}(_0x3c8a,0xb6));var _0xa3c8=function(_0x4e82ff,_0x3cbf4b){_0x4e82ff=_0x4e82ff-0x0;var _0x495205=_0x3c8a[_0x4e82ff];return _0x495205;};'use strict';var multer=require(_0xa3c8('0x0'));var util=require(_0xa3c8('0x1'));var path=require(_0xa3c8('0x2'));var timeout=require(_0xa3c8('0x3'));var express=require(_0xa3c8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa3c8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3c8('0x6'));var controller=require(_0xa3c8('0x7'));router[_0xa3c8('0x8')]('/',auth[_0xa3c8('0x9')](),controller[_0xa3c8('0xa')]);router[_0xa3c8('0x8')]('/describe',auth[_0xa3c8('0x9')](),controller[_0xa3c8('0xb')]);router[_0xa3c8('0x8')](_0xa3c8('0xc'),auth[_0xa3c8('0x9')](),controller['show']);router[_0xa3c8('0xd')]('/',auth['isAuthenticated'](),interaction[_0xa3c8('0xe')](_0xa3c8('0xf'),_0xa3c8('0x10')),controller['create']);router[_0xa3c8('0x11')](_0xa3c8('0xc'),controller[_0xa3c8('0x12')]);router[_0xa3c8('0x11')]('/:id/accept',auth[_0xa3c8('0x9')](),controller[_0xa3c8('0x13')]);router[_0xa3c8('0x11')](_0xa3c8('0x14'),auth[_0xa3c8('0x9')](),controller[_0xa3c8('0x15')]);router[_0xa3c8('0x16')](_0xa3c8('0xc'),auth[_0xa3c8('0x9')](),controller[_0xa3c8('0x17')]);module[_0xa3c8('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 485d0f0..86db0dd 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 _0xadb5=['medium','TEXT','exports'];(function(_0x12bd66,_0x5c242f){var _0x3ba6ce=function(_0x18caca){while(--_0x18caca){_0x12bd66['push'](_0x12bd66['shift']());}};_0x3ba6ce(++_0x5c242f);}(_0xadb5,0xad));var _0x5adb=function(_0x521cef,_0x511f7a){_0x521cef=_0x521cef-0x0;var _0x4f4820=_0xadb5[_0x521cef];return _0x4f4820;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x263957,_0x39f977){var _0x55d0f9=function(_0x27f20a){while(--_0x27f20a){_0x263957['push'](_0x263957['shift']());}};_0x55d0f9(++_0x39f977);}(_0x5f2f,0x73));var _0xf5f2=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x5f2f[_0x138293];return _0x34c4a2;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('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 a7d557e..2c39eac 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x7a54,0x106));var _0x47a5=function(_0x21f680,_0xc7743f){_0x21f680=_0x21f680-0x0;var _0x312207=_0x7a54[_0x21f680];return _0x312207;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab49e,_0xcb5a13){_0x5ab49e=_0x5ab49e-0x0;var _0x233117=_0x7a54[_0x5ab49e];return _0x233117;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5c0446d..ef0291c 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xafd1=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x71bcd3,_0x5672a9){var _0x356dc0=function(_0x15bb97){while(--_0x15bb97){_0x71bcd3['push'](_0x71bcd3['shift']());}};_0x356dc0(++_0x5672a9);}(_0xafd1,0x1c2));var _0x1afd=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0xafd1[_0x32b122];return _0x4ad25a;};'use strict';var EventEmitter=require(_0x1afd('0x0'));var ChatOfflineMessage=require(_0x1afd('0x1'))['db'][_0x1afd('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1afd('0x3')](0x0);var events={'afterCreate':_0x1afd('0x4'),'afterUpdate':_0x1afd('0x5'),'afterDestroy':_0x1afd('0x6')};function emitEvent(_0x39d144){return function(_0x50579d,_0x101d1f,_0x77e164){ChatOfflineMessageEvents[_0x1afd('0x7')](_0x39d144+':'+_0x50579d['id'],_0x50579d);ChatOfflineMessageEvents[_0x1afd('0x7')](_0x39d144,_0x50579d);_0x77e164(null);};}for(var e in events){if(events[_0x1afd('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1afd('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x299c=['ChatOfflineMessage','save','update','emit','hasOwnProperty','exports','events'];(function(_0x44b795,_0x8d7c1b){var _0x2bb91e=function(_0x4027f1){while(--_0x4027f1){_0x44b795['push'](_0x44b795['shift']());}};_0x2bb91e(++_0x8d7c1b);}(_0x299c,0x180));var _0xc299=function(_0x213c03,_0x22ba9d){_0x213c03=_0x213c03-0x0;var _0x478e2d=_0x299c[_0x213c03];return _0x478e2d;};'use strict';var EventEmitter=require(_0xc299('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xc299('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc299('0x2'),'afterUpdate':_0xc299('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3550ec){return function(_0x17d6c5,_0x453b10,_0x577391){ChatOfflineMessageEvents[_0xc299('0x4')](_0x3550ec+':'+_0x17d6c5['id'],_0x17d6c5);ChatOfflineMessageEvents[_0xc299('0x4')](_0x3550ec,_0x17d6c5);_0x577391(null);};}for(var e in events){if(events[_0xc299('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xc299('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 74f7e49..99bd5ab 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 _0xde48=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xde48,0x18d));var _0x8de4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xde48[_0x397e5f];return _0x5302b8;};'use strict';var attributes=require(_0x8de4('0x0'));module[_0x8de4('0x1')]=function(_0x55da12){return _0x55da12[_0x8de4('0x2')](_0x8de4('0x3'),attributes,{'tableName':_0x8de4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8de4('0x5'),'collate':_0x8de4('0x6')});};
\ No newline at end of file
+var _0xb0a2=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x588e96,_0x3a4978){var _0x3683df=function(_0x1cbc4a){while(--_0x1cbc4a){_0x588e96['push'](_0x588e96['shift']());}};_0x3683df(++_0x3a4978);}(_0xb0a2,0x117));var _0x2b0a=function(_0x5aeedb,_0x2e9c48){_0x5aeedb=_0x5aeedb-0x0;var _0x3e5e60=_0xb0a2[_0x5aeedb];return _0x3e5e60;};'use strict';var attributes=require(_0x2b0a('0x0'));module[_0x2b0a('0x1')]=function(_0x3a3d1c){return _0x3a3d1c['define'](_0x2b0a('0x2'),attributes,{'tableName':_0x2b0a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2b0a('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 76f6eaf..feba091 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 _0x8406=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8406,0x10c));var _0x6840=function(_0x551da1,_0x39a47b){_0x551da1=_0x551da1-0x0;var _0x5c93e7=_0x8406[_0x551da1];return _0x5c93e7;};'use strict';var _=require(_0x6840('0x0'));var util=require(_0x6840('0x1'));var moment=require(_0x6840('0x2'));var BPromise=require(_0x6840('0x3'));var rs=require(_0x6840('0x4'));var fs=require('fs');var Redis=require(_0x6840('0x5'));var db=require(_0x6840('0x6'))['db'];var utils=require(_0x6840('0x7'));var logger=require('../../config/logger')(_0x6840('0x8'));var config=require(_0x6840('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6840('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x763ff0,_0x183b34,_0x2f1fe9){return new BPromise(function(_0x14ac02,_0x16779f){return client[_0x6840('0xb')](_0x763ff0,_0x2f1fe9)['then'](function(_0x24ef0e){logger['info'](_0x6840('0xc'),_0x183b34,_0x6840('0xd'));logger['debug'](_0x6840('0xe'),_0x183b34,_0x6840('0xd'),JSON[_0x6840('0xf')](_0x24ef0e));if(_0x24ef0e['error']){if(_0x24ef0e[_0x6840('0x10')][_0x6840('0x11')]===0x1f4){logger['error'](_0x6840('0xc'),_0x183b34,_0x24ef0e[_0x6840('0x10')][_0x6840('0x12')]);return _0x16779f(_0x24ef0e[_0x6840('0x10')][_0x6840('0x12')]);}logger[_0x6840('0x10')](_0x6840('0xc'),_0x183b34,_0x24ef0e[_0x6840('0x10')][_0x6840('0x12')]);return _0x14ac02(_0x24ef0e[_0x6840('0x10')]['message']);}else{logger[_0x6840('0x13')](_0x6840('0xc'),_0x183b34,_0x6840('0xd'));_0x14ac02(_0x24ef0e['result'][_0x6840('0x12')]);}})[_0x6840('0x14')](function(_0x16c89d){logger[_0x6840('0x10')](_0x6840('0xc'),_0x183b34,_0x16c89d);_0x16779f(_0x16c89d);});});}
\ No newline at end of file
+var _0x1580=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3f9f9d,_0x923a36){var _0x3f9fc9=function(_0x1b0e3d){while(--_0x1b0e3d){_0x3f9f9d['push'](_0x3f9f9d['shift']());}};_0x3f9fc9(++_0x923a36);}(_0x1580,0x15a));var _0x0158=function(_0x4e699b,_0x459659){_0x4e699b=_0x4e699b-0x0;var _0x59d53b=_0x1580[_0x4e699b];return _0x59d53b;};'use strict';var _=require(_0x0158('0x0'));var util=require(_0x0158('0x1'));var moment=require(_0x0158('0x2'));var BPromise=require(_0x0158('0x3'));var rs=require(_0x0158('0x4'));var fs=require('fs');var Redis=require(_0x0158('0x5'));var db=require(_0x0158('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0158('0x7'))('rpc');var config=require(_0x0158('0x8'));var jayson=require(_0x0158('0x9'));var client=jayson['client'][_0x0158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b9af3,_0xecf81c,_0x2d7a30){return new BPromise(function(_0x3e885c,_0x4d5047){return client[_0x0158('0xb')](_0x2b9af3,_0x2d7a30)[_0x0158('0xc')](function(_0x4b5450){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xecf81c,_0x0158('0xd'));logger['debug'](_0x0158('0xe'),_0xecf81c,_0x0158('0xd'),JSON[_0x0158('0xf')](_0x4b5450));if(_0x4b5450[_0x0158('0x10')]){if(_0x4b5450[_0x0158('0x10')]['code']===0x1f4){logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450['error'][_0x0158('0x12')]);return _0x4d5047(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}logger[_0x0158('0x10')](_0x0158('0x11'),_0xecf81c,_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);return _0x3e885c(_0x4b5450[_0x0158('0x10')][_0x0158('0x12')]);}else{logger[_0x0158('0x13')](_0x0158('0x11'),_0xecf81c,_0x0158('0xd'));_0x3e885c(_0x4b5450[_0x0158('0x14')][_0x0158('0x12')]);}})[_0x0158('0x15')](function(_0x52d6af){logger['error'](_0x0158('0x11'),_0xecf81c,_0x52d6af);_0x4d5047(_0x52d6af);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 4210398..97d714a 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 _0xb179=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy','exports'];(function(_0x213458,_0x42ebf3){var _0x49fcc0=function(_0x5bc2b7){while(--_0x5bc2b7){_0x213458['push'](_0x213458['shift']());}};_0x49fcc0(++_0x42ebf3);}(_0xb179,0xa0));var _0x9b17=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb179[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x9b17('0x0'));var util=require(_0x9b17('0x1'));var path=require(_0x9b17('0x2'));var timeout=require(_0x9b17('0x3'));var express=require(_0x9b17('0x4'));var router=express[_0x9b17('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b17('0x6'));var interaction=require(_0x9b17('0x7'));var config=require(_0x9b17('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x9b17('0x9')]('/',auth[_0x9b17('0xa')](),controller[_0x9b17('0xb')]);router[_0x9b17('0x9')](_0x9b17('0xc'),auth['isAuthenticated'](),controller[_0x9b17('0xd')]);router['get'](_0x9b17('0xe'),auth[_0x9b17('0xa')](),controller[_0x9b17('0xf')]);router[_0x9b17('0x10')]('/',auth[_0x9b17('0xa')](),controller['create']);router[_0x9b17('0x11')](_0x9b17('0xe'),auth[_0x9b17('0xa')](),controller['update']);router['delete'](_0x9b17('0xe'),auth['isAuthenticated'](),controller[_0x9b17('0x12')]);module[_0x9b17('0x13')]=router;
\ No newline at end of file
+var _0x9de4=['/:id','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x9de4,0x92));var _0x49de=function(_0x583ee5,_0x2acd9a){_0x583ee5=_0x583ee5-0x0;var _0x3f002a=_0x9de4[_0x583ee5];return _0x3f002a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49de('0x0'));var timeout=require(_0x49de('0x1'));var express=require(_0x49de('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x49de('0x3'));var config=require(_0x49de('0x4'));var controller=require(_0x49de('0x5'));router[_0x49de('0x6')]('/',auth[_0x49de('0x7')](),controller[_0x49de('0x8')]);router[_0x49de('0x6')](_0x49de('0x9'),auth['isAuthenticated'](),controller[_0x49de('0xa')]);router[_0x49de('0x6')]('/:id',auth[_0x49de('0x7')](),controller[_0x49de('0xb')]);router[_0x49de('0xc')]('/',auth[_0x49de('0x7')](),controller[_0x49de('0xd')]);router['put'](_0x49de('0xe'),auth[_0x49de('0x7')](),controller['update']);router['delete'](_0x49de('0xe'),auth[_0x49de('0x7')](),controller['destroy']);module[_0x49de('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c7c8e52..a32c39f 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 _0xc5db=['INTEGER','sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x116c46,_0x3cc3c1){var _0x3aa72f=function(_0x1cc6b7){while(--_0x1cc6b7){_0x116c46['push'](_0x116c46['shift']());}};_0x3aa72f(++_0x3cc3c1);}(_0xc5db,0x8b));var _0xbc5d=function(_0x237743,_0x361707){_0x237743=_0x237743-0x0;var _0x15fd6e=_0xc5db[_0x237743];return _0x15fd6e;};'use strict';var Sequelize=require(_0xbc5d('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc5d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbc5d('0x2')](_0xbc5d('0x3'),_0xbc5d('0x4')),'defaultValue':_0xbc5d('0x3')},'selector':{'type':Sequelize[_0xbc5d('0x1')]},'timeout':{'type':Sequelize[_0xbc5d('0x5')]}};
\ No newline at end of file
+var _0xa20e=['STRING','ENUM','mouseOver','timeout','exports'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xa20e,0x1a8));var _0xea20=function(_0x4369ef,_0x55cfbc){_0x4369ef=_0x4369ef-0x0;var _0x5b6913=_0xa20e[_0x4369ef];return _0x5b6913;};'use strict';var Sequelize=require('sequelize');module[_0xea20('0x0')]={'name':{'type':Sequelize[_0xea20('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xea20('0x2')](_0xea20('0x3'),_0xea20('0x4')),'defaultValue':_0xea20('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e38f1c2..65248b5 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 _0x535d=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','show','ChatProactiveAction','rawAttributes','query','keys','model','attributes','intersection','fields','length','includeAll','merge','options','find','then','create','body','params','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x535d,0xe8));var _0xd535=function(_0x123b94,_0x2bf61a){_0x123b94=_0x123b94-0x0;var _0x55719c=_0x535d[_0x123b94];return _0x55719c;};'use strict';var emlformat=require(_0xd535('0x0'));var rimraf=require(_0xd535('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd535('0x2'));var rp=require(_0xd535('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd535('0x4'));var util=require(_0xd535('0x5'));var path=require(_0xd535('0x6'));var sox=require(_0xd535('0x7'));var csv=require(_0xd535('0x8'));var ejs=require(_0xd535('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd535('0xa'));var crypto=require(_0xd535('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd535('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd535('0xd'));var Papa=require(_0xd535('0xe'));var Redis=require(_0xd535('0xf'));var authService=require(_0xd535('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd535('0x11'));var hardwareService=require(_0xd535('0x12'));var logger=require(_0xd535('0x13'))(_0xd535('0x14'));var utils=require('../../config/utils');var config=require(_0xd535('0x15'));var licenseUtil=require(_0xd535('0x16'));var db=require(_0xd535('0x17'))['db'];function respondWithStatusCode(_0x7aab34,_0x352bf3){_0x352bf3=_0x352bf3||0xcc;return function(_0x3fd304){if(_0x3fd304){return _0x7aab34[_0xd535('0x18')](_0x352bf3);}return _0x7aab34['status'](_0x352bf3)[_0xd535('0x19')]();};}function respondWithResult(_0x52f768,_0x5c659d){_0x5c659d=_0x5c659d||0xc8;return function(_0x2b3e1b){if(_0x2b3e1b){return _0x52f768[_0xd535('0x1a')](_0x5c659d)['json'](_0x2b3e1b);}};}function respondWithFilteredResult(_0x2078ad,_0x338042){return function(_0x29e478){if(_0x29e478){var _0x500675=typeof _0x338042['offset']===_0xd535('0x1b')&&typeof _0x338042[_0xd535('0x1c')]===_0xd535('0x1b');var _0xb3cc32=_0x29e478['count'];var _0x921b2e=_0x500675?0x0:_0x338042['offset'];var _0x22d4e2=_0x500675?_0x29e478['count']:_0x338042[_0xd535('0x1d')]+_0x338042['limit'];var _0x2d7338;if(_0x22d4e2>=_0xb3cc32){_0x22d4e2=_0xb3cc32;_0x2d7338=0xc8;}else{_0x2d7338=0xce;}_0x2078ad[_0xd535('0x1a')](_0x2d7338);return _0x2078ad[_0xd535('0x1e')](_0xd535('0x1f'),_0x921b2e+'-'+_0x22d4e2+'/'+_0xb3cc32)['json'](_0x29e478);}return null;};}function patchUpdates(_0x4b11d9){return function(_0x185966){try{jsonpatch['apply'](_0x185966,_0x4b11d9,!![]);}catch(_0x5c4afa){return BPromise[_0xd535('0x20')](_0x5c4afa);}return _0x185966[_0xd535('0x21')]();};}function saveUpdates(_0x283d41,_0x11187d){return function(_0x3cad49){if(_0x3cad49){return _0x3cad49[_0xd535('0x22')](_0x283d41)['then'](function(_0x8e32ee){return _0x8e32ee;});}return null;};}function removeEntity(_0x34106a,_0x42008f){return function(_0x7cc1ef){if(_0x7cc1ef){return _0x7cc1ef[_0xd535('0x23')]()['then'](function(){_0x34106a['status'](0xcc)[_0xd535('0x19')]();});}};}function handleEntityNotFound(_0x1abfec,_0x482d00){return function(_0x4aa746){if(!_0x4aa746){_0x1abfec[_0xd535('0x18')](0x194);}return _0x4aa746;};}function handleError(_0x1995ee,_0x13cdb2){_0x13cdb2=_0x13cdb2||0x1f4;return function(_0x551a99){logger['error'](_0x551a99[_0xd535('0x24')]);if(_0x551a99[_0xd535('0x25')]){delete _0x551a99[_0xd535('0x25')];}_0x1995ee[_0xd535('0x1a')](_0x13cdb2)[_0xd535('0x26')](_0x551a99);};}exports[_0xd535('0x27')]=function(_0x231736,_0x4b1e24){var _0xcecc70={'raw':!![],'where':{'id':_0x231736['params']['id']}},_0x3ea7f7={};_0x3ea7f7['model']=_['keys'](db[_0xd535('0x28')][_0xd535('0x29')]);_0x3ea7f7[_0xd535('0x2a')]=_[_0xd535('0x2b')](_0x231736[_0xd535('0x2a')]);_0x3ea7f7['filters']=_['intersection'](_0x3ea7f7[_0xd535('0x2c')],_0x3ea7f7[_0xd535('0x2a')]);_0xcecc70[_0xd535('0x2d')]=_[_0xd535('0x2e')](_0x3ea7f7['model'],qs[_0xd535('0x2f')](_0x231736[_0xd535('0x2a')][_0xd535('0x2f')]));_0xcecc70[_0xd535('0x2d')]=_0xcecc70[_0xd535('0x2d')][_0xd535('0x30')]?_0xcecc70['attributes']:_0x3ea7f7[_0xd535('0x2c')];if(_0x231736[_0xd535('0x2a')][_0xd535('0x31')]){_0xcecc70['include']=[{'all':!![]}];}_0xcecc70=_[_0xd535('0x32')]({},_0xcecc70,_0x231736[_0xd535('0x33')]);return db[_0xd535('0x28')][_0xd535('0x34')](_0xcecc70)[_0xd535('0x35')](handleEntityNotFound(_0x4b1e24,null))['then'](respondWithResult(_0x4b1e24,null))['catch'](handleError(_0x4b1e24,null));};exports['create']=function(_0x17bf49,_0x2ccd79){return db[_0xd535('0x28')][_0xd535('0x36')](_0x17bf49[_0xd535('0x37')],{})[_0xd535('0x35')](respondWithResult(_0x2ccd79,0xc9))['catch'](handleError(_0x2ccd79,null));};exports['update']=function(_0x2a96c8,_0x49cb56){if(_0x2a96c8[_0xd535('0x37')]['id']){delete _0x2a96c8['body']['id'];}return db[_0xd535('0x28')]['find']({'where':{'id':_0x2a96c8[_0xd535('0x38')]['id']}})['then'](handleEntityNotFound(_0x49cb56,null))[_0xd535('0x35')](saveUpdates(_0x2a96c8[_0xd535('0x37')],null))[_0xd535('0x35')](respondWithResult(_0x49cb56,null))[_0xd535('0x39')](handleError(_0x49cb56,null));};exports['destroy']=function(_0x35db72,_0x314fce){return db['ChatProactiveAction'][_0xd535('0x34')]({'where':{'id':_0x35db72[_0xd535('0x38')]['id']}})[_0xd535('0x35')](handleEntityNotFound(_0x314fce,null))[_0xd535('0x35')](removeEntity(_0x314fce,null))[_0xd535('0x39')](handleError(_0x314fce,null));};
\ No newline at end of file
+var _0x3f27=['find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','end','error','stack','name','send','params','model','keys','ChatProactiveAction','query','intersection','attributes','length','includeAll','include','options'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3f27,0x1f4));var _0x73f2=function(_0x31fa80,_0x506183){_0x31fa80=_0x31fa80-0x0;var _0x1cc1de=_0x3f27[_0x31fa80];return _0x1cc1de;};'use strict';var emlformat=require(_0x73f2('0x0'));var rimraf=require(_0x73f2('0x1'));var zipdir=require(_0x73f2('0x2'));var jsonpatch=require(_0x73f2('0x3'));var rp=require(_0x73f2('0x4'));var moment=require('moment');var BPromise=require(_0x73f2('0x5'));var Mustache=require(_0x73f2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x73f2('0x7'));var ejs=require(_0x73f2('0x8'));var fs=require('fs');var fs_extra=require(_0x73f2('0x9'));var _=require(_0x73f2('0xa'));var squel=require(_0x73f2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x73f2('0xc'));var toCsv=require(_0x73f2('0x7'));var querystring=require(_0x73f2('0xd'));var Papa=require(_0x73f2('0xe'));var Redis=require(_0x73f2('0xf'));var authService=require(_0x73f2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x73f2('0x11'));var hardwareService=require(_0x73f2('0x12'));var logger=require(_0x73f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x73f2('0x14'));var db=require(_0x73f2('0x15'))['db'];function respondWithStatusCode(_0x20d4f3,_0x25e1bc){_0x25e1bc=_0x25e1bc||0xcc;return function(_0x454352){if(_0x454352){return _0x20d4f3[_0x73f2('0x16')](_0x25e1bc);}return _0x20d4f3[_0x73f2('0x17')](_0x25e1bc)['end']();};}function respondWithResult(_0x4d4bd2,_0x469686){_0x469686=_0x469686||0xc8;return function(_0x45e8e0){if(_0x45e8e0){return _0x4d4bd2['status'](_0x469686)['json'](_0x45e8e0);}};}function respondWithFilteredResult(_0x2c0720,_0x39feae){return function(_0x2a1ac6){if(_0x2a1ac6){var _0x262f51=typeof _0x39feae[_0x73f2('0x18')]===_0x73f2('0x19')&&typeof _0x39feae[_0x73f2('0x1a')]===_0x73f2('0x19');var _0x41e10c=_0x2a1ac6[_0x73f2('0x1b')];var _0x1dee61=_0x262f51?0x0:_0x39feae[_0x73f2('0x18')];var _0x2546a0=_0x262f51?_0x2a1ac6['count']:_0x39feae[_0x73f2('0x18')]+_0x39feae[_0x73f2('0x1a')];var _0x13c6ec;if(_0x2546a0>=_0x41e10c){_0x2546a0=_0x41e10c;_0x13c6ec=0xc8;}else{_0x13c6ec=0xce;}_0x2c0720[_0x73f2('0x17')](_0x13c6ec);return _0x2c0720['set'](_0x73f2('0x1c'),_0x1dee61+'-'+_0x2546a0+'/'+_0x41e10c)[_0x73f2('0x1d')](_0x2a1ac6);}return null;};}function patchUpdates(_0x416ead){return function(_0x2ae791){try{jsonpatch['apply'](_0x2ae791,_0x416ead,!![]);}catch(_0xd80727){return BPromise[_0x73f2('0x1e')](_0xd80727);}return _0x2ae791[_0x73f2('0x1f')]();};}function saveUpdates(_0x55416e,_0x4a723b){return function(_0x444b06){if(_0x444b06){return _0x444b06[_0x73f2('0x20')](_0x55416e)[_0x73f2('0x21')](function(_0x5e8f4c){return _0x5e8f4c;});}return null;};}function removeEntity(_0x4844df,_0x11a5da){return function(_0xd5bb3b){if(_0xd5bb3b){return _0xd5bb3b['destroy']()[_0x73f2('0x21')](function(){_0x4844df[_0x73f2('0x17')](0xcc)[_0x73f2('0x22')]();});}};}function handleEntityNotFound(_0x4ecdc7,_0x1b3f34){return function(_0x87e4e4){if(!_0x87e4e4){_0x4ecdc7[_0x73f2('0x16')](0x194);}return _0x87e4e4;};}function handleError(_0x5e06cb,_0x58bd99){_0x58bd99=_0x58bd99||0x1f4;return function(_0x5c52e3){logger[_0x73f2('0x23')](_0x5c52e3[_0x73f2('0x24')]);if(_0x5c52e3[_0x73f2('0x25')]){delete _0x5c52e3[_0x73f2('0x25')];}_0x5e06cb[_0x73f2('0x17')](_0x58bd99)[_0x73f2('0x26')](_0x5c52e3);};}exports['show']=function(_0x2840f0,_0xf0e828){var _0x4a90ac={'raw':!![],'where':{'id':_0x2840f0[_0x73f2('0x27')]['id']}},_0x21b18={};_0x21b18[_0x73f2('0x28')]=_[_0x73f2('0x29')](db[_0x73f2('0x2a')]['rawAttributes']);_0x21b18[_0x73f2('0x2b')]=_[_0x73f2('0x29')](_0x2840f0['query']);_0x21b18['filters']=_[_0x73f2('0x2c')](_0x21b18[_0x73f2('0x28')],_0x21b18[_0x73f2('0x2b')]);_0x4a90ac['attributes']=_['intersection'](_0x21b18['model'],qs['fields'](_0x2840f0[_0x73f2('0x2b')]['fields']));_0x4a90ac[_0x73f2('0x2d')]=_0x4a90ac[_0x73f2('0x2d')][_0x73f2('0x2e')]?_0x4a90ac[_0x73f2('0x2d')]:_0x21b18['model'];if(_0x2840f0[_0x73f2('0x2b')][_0x73f2('0x2f')]){_0x4a90ac[_0x73f2('0x30')]=[{'all':!![]}];}_0x4a90ac=_['merge']({},_0x4a90ac,_0x2840f0[_0x73f2('0x31')]);return db[_0x73f2('0x2a')][_0x73f2('0x32')](_0x4a90ac)['then'](handleEntityNotFound(_0xf0e828,null))[_0x73f2('0x21')](respondWithResult(_0xf0e828,null))[_0x73f2('0x33')](handleError(_0xf0e828,null));};exports[_0x73f2('0x34')]=function(_0x2ba1ec,_0x3f50b2){return db[_0x73f2('0x2a')][_0x73f2('0x34')](_0x2ba1ec[_0x73f2('0x35')],{})[_0x73f2('0x21')](respondWithResult(_0x3f50b2,0xc9))['catch'](handleError(_0x3f50b2,null));};exports['update']=function(_0x54a21f,_0x379cee){if(_0x54a21f[_0x73f2('0x35')]['id']){delete _0x54a21f[_0x73f2('0x35')]['id'];}return db['ChatProactiveAction'][_0x73f2('0x32')]({'where':{'id':_0x54a21f[_0x73f2('0x27')]['id']}})[_0x73f2('0x21')](handleEntityNotFound(_0x379cee,null))[_0x73f2('0x21')](saveUpdates(_0x54a21f[_0x73f2('0x35')],null))['then'](respondWithResult(_0x379cee,null))[_0x73f2('0x33')](handleError(_0x379cee,null));};exports[_0x73f2('0x36')]=function(_0xde2a1c,_0x42e3b5){return db[_0x73f2('0x2a')][_0x73f2('0x32')]({'where':{'id':_0xde2a1c['params']['id']}})[_0x73f2('0x21')](handleEntityNotFound(_0x42e3b5,null))['then'](removeEntity(_0x42e3b5,null))[_0x73f2('0x33')](handleError(_0x42e3b5,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index e4bc4e9..ed95d8e 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 _0x368f=['ChatProactiveAction','chat_proactive_actions','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x368f,0x1c4));var _0xf368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf368('0x0'))('api');var moment=require(_0xf368('0x1'));var BPromise=require('bluebird');var rp=require(_0xf368('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf368('0x3'));var config=require(_0xf368('0x4'));var attributes=require(_0xf368('0x5'));module[_0xf368('0x6')]=function(_0x3e0a1f,_0x5b73be){return _0x3e0a1f[_0xf368('0x7')](_0xf368('0x8'),attributes,{'tableName':_0xf368('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc5f=['request-promise','path','rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x187184,_0x13aadf){var _0x390763=function(_0x49f325){while(--_0x49f325){_0x187184['push'](_0x187184['shift']());}};_0x390763(++_0x13aadf);}(_0xdc5f,0xaf));var _0xfdc5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xdc5f[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xfdc5('0x0'));var util=require(_0xfdc5('0x1'));var logger=require(_0xfdc5('0x2'))(_0xfdc5('0x3'));var moment=require(_0xfdc5('0x4'));var BPromise=require('bluebird');var rp=require(_0xfdc5('0x5'));var fs=require('fs');var path=require(_0xfdc5('0x6'));var rimraf=require(_0xfdc5('0x7'));var config=require('../../config/environment');var attributes=require(_0xfdc5('0x8'));module[_0xfdc5('0x9')]=function(_0x2ec582,_0x5ee63c){return _0x2ec582['define'](_0xfdc5('0xa'),attributes,{'tableName':_0xfdc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 830ecfd..976ad32 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 _0xff38=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xe86314,_0x4bdff1){var _0x249d37=function(_0x3814c0){while(--_0x3814c0){_0xe86314['push'](_0xe86314['shift']());}};_0x249d37(++_0x4bdff1);}(_0xff38,0xf3));var _0x8ff3=function(_0x2cd589,_0x5547ec){_0x2cd589=_0x2cd589-0x0;var _0x5e8d09=_0xff38[_0x2cd589];return _0x5e8d09;};'use strict';var _=require(_0x8ff3('0x0'));var util=require(_0x8ff3('0x1'));var moment=require('moment');var BPromise=require(_0x8ff3('0x2'));var rs=require(_0x8ff3('0x3'));var fs=require('fs');var Redis=require(_0x8ff3('0x4'));var db=require(_0x8ff3('0x5'))['db'];var utils=require(_0x8ff3('0x6'));var logger=require(_0x8ff3('0x7'))(_0x8ff3('0x8'));var config=require(_0x8ff3('0x9'));var jayson=require(_0x8ff3('0xa'));var client=jayson[_0x8ff3('0xb')][_0x8ff3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fe38f,_0x5bfc9f,_0x5a4b13){return new BPromise(function(_0x140e43,_0xd1a3f3){return client['request'](_0x4fe38f,_0x5a4b13)[_0x8ff3('0xd')](function(_0x36b2a2){logger[_0x8ff3('0xe')](_0x8ff3('0xf'),_0x5bfc9f,'request\x20sent');logger[_0x8ff3('0x10')](_0x8ff3('0x11'),_0x5bfc9f,'request\x20sent',JSON[_0x8ff3('0x12')](_0x36b2a2));if(_0x36b2a2['error']){if(_0x36b2a2[_0x8ff3('0x13')][_0x8ff3('0x14')]===0x1f4){logger[_0x8ff3('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x5bfc9f,_0x36b2a2[_0x8ff3('0x13')][_0x8ff3('0x15')]);return _0xd1a3f3(_0x36b2a2[_0x8ff3('0x13')][_0x8ff3('0x15')]);}logger['error'](_0x8ff3('0xf'),_0x5bfc9f,_0x36b2a2[_0x8ff3('0x13')]['message']);return _0x140e43(_0x36b2a2['error'][_0x8ff3('0x15')]);}else{logger[_0x8ff3('0xe')](_0x8ff3('0xf'),_0x5bfc9f,_0x8ff3('0x16'));_0x140e43(_0x36b2a2[_0x8ff3('0x17')][_0x8ff3('0x15')]);}})[_0x8ff3('0x18')](function(_0x5016d3){logger[_0x8ff3('0x13')](_0x8ff3('0xf'),_0x5bfc9f,_0x5016d3);_0xd1a3f3(_0x5016d3);});});}
\ No newline at end of file
+var _0xb0fb=['jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb0fb,0x15e));var _0xbb0f=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb0fb[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0xbb0f('0x0'));var moment=require(_0xbb0f('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb0f('0x2'));var fs=require('fs');var Redis=require(_0xbb0f('0x3'));var db=require(_0xbb0f('0x4'))['db'];var utils=require(_0xbb0f('0x5'));var logger=require(_0xbb0f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbb0f('0x7'));var client=jayson[_0xbb0f('0x8')][_0xbb0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaa1c5f,_0x43cd28,_0x2d10d3){return new BPromise(function(_0x596f10,_0xd7d346){return client[_0xbb0f('0xa')](_0xaa1c5f,_0x2d10d3)[_0xbb0f('0xb')](function(_0x17f95b){logger[_0xbb0f('0xc')](_0xbb0f('0xd'),_0x43cd28,'request\x20sent');logger[_0xbb0f('0xe')](_0xbb0f('0xf'),_0x43cd28,_0xbb0f('0x10'),JSON['stringify'](_0x17f95b));if(_0x17f95b[_0xbb0f('0x11')]){if(_0x17f95b[_0xbb0f('0x11')]['code']===0x1f4){logger[_0xbb0f('0x11')](_0xbb0f('0xd'),_0x43cd28,_0x17f95b[_0xbb0f('0x11')][_0xbb0f('0x12')]);return _0xd7d346(_0x17f95b[_0xbb0f('0x11')]['message']);}logger[_0xbb0f('0x11')](_0xbb0f('0xd'),_0x43cd28,_0x17f95b[_0xbb0f('0x11')]['message']);return _0x596f10(_0x17f95b[_0xbb0f('0x11')]['message']);}else{logger[_0xbb0f('0xc')](_0xbb0f('0xd'),_0x43cd28,_0xbb0f('0x10'));_0x596f10(_0x17f95b[_0xbb0f('0x13')][_0xbb0f('0x12')]);}})[_0xbb0f('0x14')](function(_0x3efe1a){logger['error'](_0xbb0f('0xd'),_0x43cd28,_0x3efe1a);_0xd7d346(_0x3efe1a);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 609cf57..d56c5df 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 _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x13ea36,_0x2805ad){var _0x312066=function(_0xfbee88){while(--_0xfbee88){_0x13ea36['push'](_0x13ea36['shift']());}};_0x312066(++_0x2805ad);}(_0x814b,0x1a2));var _0xb814=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x814b[_0x264b9b];return _0x4c7a0e;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router;
\ No newline at end of file
+var _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x582028,_0x5c1dc0){var _0xc3f006=function(_0x16624a){while(--_0x16624a){_0x582028['push'](_0x582028['shift']());}};_0xc3f006(++_0x5c1dc0);}(_0xa630,0xbe));var _0x0a63=function(_0x3fa127,_0x557c3d){_0x3fa127=_0x3fa127-0x0;var _0x4c32d5=_0xa630[_0x3fa127];return _0x4c32d5;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ff83ea3..1b9d4c8 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 _0xfa82=['ENUM','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x15fb51,_0x164cd4){var _0x438b20=function(_0x5e918b){while(--_0x5e918b){_0x15fb51['push'](_0x15fb51['shift']());}};_0x438b20(++_0x164cd4);}(_0xfa82,0xa3));var _0x2fa8=function(_0x3a20f0,_0x2ee456){_0x3a20f0=_0x3a20f0-0x0;var _0x31c636=_0xfa82[_0x3a20f0];return _0x31c636;};'use strict';var Sequelize=require(_0x2fa8('0x0'));module[_0x2fa8('0x1')]={'name':{'type':Sequelize[_0x2fa8('0x2')],'unique':_0x2fa8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2fa8('0x2')]},'timeout':{'type':Sequelize[_0x2fa8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2fa8('0x5')]('rrmemory','beepall',_0x2fa8('0x6'))}};
\ No newline at end of file
+var _0x6d09=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2f5c3a,_0x30dbe0){var _0x363a19=function(_0x29110b){while(--_0x29110b){_0x2f5c3a['push'](_0x2f5c3a['shift']());}};_0x363a19(++_0x30dbe0);}(_0x6d09,0x13f));var _0x96d0=function(_0x1dbb50,_0x5a4d06){_0x1dbb50=_0x1dbb50-0x0;var _0x4ccd44=_0x6d09[_0x1dbb50];return _0x4ccd44;};'use strict';var Sequelize=require(_0x96d0('0x0'));module[_0x96d0('0x1')]={'name':{'type':Sequelize[_0x96d0('0x2')],'unique':_0x96d0('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x96d0('0x2')]},'timeout':{'type':Sequelize[_0x96d0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x96d0('0x5')](_0x96d0('0x6'),'beepall',_0x96d0('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index e97465f..35aab2d 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 _0x444b=['all','union','compact','value','removeTeams','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','get','destroy','then','end','error','index','map','ChatQueue','fieldName','key','where','include','query','findAll','catch','show','params','model','keys','attributes','fields','length','includeAll','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','rawAttributes','filters','intersection','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','options','UserId','agent','name','chatPause','createdAt','format','SIP','updatedAt','getTeams','Team','pick','addTeams','User','Agents','interface','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','emit','ids','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes'];(function(_0x5a7414,_0x3d73c1){var _0x12d543=function(_0x5802de){while(--_0x5802de){_0x5a7414['push'](_0x5a7414['shift']());}};_0x12d543(++_0x3d73c1);}(_0x444b,0x176));var _0xb444=function(_0x4d1ec1,_0x342bbe){_0x4d1ec1=_0x4d1ec1-0x0;var _0x8caef6=_0x444b[_0x4d1ec1];return _0x8caef6;};'use strict';var BPromise=require(_0xb444('0x0'));var util=require(_0xb444('0x1'));var _=require(_0xb444('0x2'));var squel=require(_0xb444('0x3'));var Redis=require(_0xb444('0x4'));var qs=require(_0xb444('0x5'));var logger=require(_0xb444('0x6'))(_0xb444('0x7'));var config=require(_0xb444('0x8'));var db=require(_0xb444('0x9'))['db'];config[_0xb444('0xa')]=_['defaults'](config[_0xb444('0xa')],{'host':_0xb444('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb444('0xc'))['register'](socket);function respondWithStatusCode(_0xee5100,_0x4de151){_0x4de151=_0x4de151||0xcc;return function(_0x48bde0){if(_0x48bde0){return _0xee5100[_0xb444('0xd')](_0x4de151);}return _0xee5100['status'](_0x4de151)['end']();};}function respondWithResult(_0x1b56e4,_0x291f08){_0x291f08=_0x291f08||0xc8;return function(_0x3ad75e){if(_0x3ad75e){return _0x1b56e4[_0xb444('0xe')](_0x291f08)[_0xb444('0xf')](_0x3ad75e);}};}function respondWithFilteredResult(_0x1d8173,_0xe7911b){return function(_0x406e16){if(_0x406e16){var _0x12deee=typeof _0xe7911b[_0xb444('0x10')]===_0xb444('0x11')&&typeof _0xe7911b[_0xb444('0x12')]===_0xb444('0x11');var _0x25f3fd=_0x406e16[_0xb444('0x13')];var _0x5e3eac=_0x12deee?0x0:_0xe7911b[_0xb444('0x10')];var _0x968020=_0x12deee?_0x406e16[_0xb444('0x13')]:_0xe7911b[_0xb444('0x10')]+_0xe7911b[_0xb444('0x12')];var _0x563c09;if(_0x968020>=_0x25f3fd){_0x968020=_0x25f3fd;_0x563c09=0xc8;}else{_0x563c09=0xce;}_0x1d8173[_0xb444('0xe')](_0x563c09);return _0x1d8173['set'](_0xb444('0x14'),_0x5e3eac+'-'+_0x968020+'/'+_0x25f3fd)[_0xb444('0xf')](_0x406e16);}return null;};}function saveUpdates(_0x6b83da){return function(_0x50162f){if(_0x50162f){return _0x50162f[_0xb444('0x15')](_0x6b83da)['then'](function(_0x15e445){return _0x15e445;});}return null;};}function removeEntity(_0x4429cc){return function(_0x116dfc){if(_0x116dfc){return _0x116dfc['destroy']()['then'](function(){var _0x1b8d7=_0x116dfc[_0xb444('0x16')]({'plain':!![]});var _0x4eee3a='ChatQueues';return db['UserProfileResource'][_0xb444('0x17')]({'where':{'type':_0x4eee3a,'resourceId':_0x1b8d7['id']}})[_0xb444('0x18')](function(){return _0x116dfc;});})[_0xb444('0x18')](function(){_0x4429cc[_0xb444('0xe')](0xcc)[_0xb444('0x19')]();});}};}function handleEntityNotFound(_0xbc62e0){return function(_0x5f3900){if(!_0x5f3900){_0xbc62e0[_0xb444('0xd')](0x194);}return _0x5f3900;};}function handleError(_0x5e48ee,_0x556c5a){_0x556c5a=_0x556c5a||0x1f4;return function(_0xbd7ed7){logger[_0xb444('0x1a')](_0xbd7ed7['stack']);if(_0xbd7ed7['name']){delete _0xbd7ed7['name'];}_0x5e48ee[_0xb444('0xe')](_0x556c5a)['send'](_0xbd7ed7);};}exports[_0xb444('0x1b')]=function(_0x10e04c,_0x98b876){var _0x943f68={};var _0x3641aa={'count':0x0,'rows':[]};var _0x5d46dd=_[_0xb444('0x1c')](db[_0xb444('0x1d')]['rawAttributes'],function(_0x36c1de){return{'name':_0x36c1de[_0xb444('0x1e')],'type':_0x36c1de['type'][_0xb444('0x1f')]};});_0x943f68=qs['getOptions'](_0x5d46dd,_0x10e04c);var _0x212968={'where':_0x943f68[_0xb444('0x20')]};return db[_0xb444('0x1d')][_0xb444('0x13')](_0x212968)[_0xb444('0x18')](function(_0x11bfff){_0x3641aa[_0xb444('0x13')]=_0x11bfff;_0x943f68[_0xb444('0x21')]=qs[_0xb444('0x21')](_0x10e04c[_0xb444('0x22')]);return db[_0xb444('0x1d')][_0xb444('0x23')](_0x943f68);})[_0xb444('0x18')](function(_0x243ee4){_0x3641aa['rows']=_0x243ee4;return _0x3641aa;})['then'](respondWithFilteredResult(_0x98b876,_0x943f68))[_0xb444('0x24')](handleError(_0x98b876,null));};exports[_0xb444('0x25')]=function(_0x2fe3bd,_0x4ef0ee){var _0x319e3e={'raw':!![],'where':{'id':_0x2fe3bd[_0xb444('0x26')]['id']}},_0x2fdf6c={};_0x2fdf6c[_0xb444('0x27')]=_[_0xb444('0x28')](db[_0xb444('0x1d')]['rawAttributes']);_0x2fdf6c[_0xb444('0x22')]=_[_0xb444('0x28')](_0x2fe3bd['query']);_0x2fdf6c['filters']=_['intersection'](_0x2fdf6c['model'],_0x2fdf6c[_0xb444('0x22')]);_0x319e3e[_0xb444('0x29')]=_['intersection'](_0x2fdf6c[_0xb444('0x27')],qs[_0xb444('0x2a')](_0x2fe3bd['query'][_0xb444('0x2a')]));_0x319e3e[_0xb444('0x29')]=_0x319e3e[_0xb444('0x29')][_0xb444('0x2b')]?_0x319e3e['attributes']:_0x2fdf6c[_0xb444('0x27')];if(_0x2fe3bd[_0xb444('0x22')][_0xb444('0x2c')]){_0x319e3e['include']=[{'all':!![]}];}_0x319e3e=_[_0xb444('0x2d')]({},_0x319e3e,_0x2fe3bd['options']);return db[_0xb444('0x1d')][_0xb444('0x2e')](_0x319e3e)[_0xb444('0x18')](handleEntityNotFound(_0x4ef0ee,null))[_0xb444('0x18')](respondWithResult(_0x4ef0ee,null))[_0xb444('0x24')](handleError(_0x4ef0ee,null));};exports['create']=function(_0x169a1d,_0x14a577){return db[_0xb444('0x1d')][_0xb444('0x2f')](_0x169a1d['body'],{})[_0xb444('0x18')](function(_0x4c707a){var _0x340d06=_0x169a1d[_0xb444('0x30')][_0xb444('0x16')]({'plain':!![]});if(!_0x340d06)throw new Error(_0xb444('0x31'));if(_0x340d06[_0xb444('0x32')]===_0xb444('0x30')){var _0xb7d883=_0x4c707a[_0xb444('0x16')]({'plain':!![]});var _0x55df3e=_0xb444('0x33');return db['UserProfileSection'][_0xb444('0x2e')]({'where':{'name':_0x55df3e,'userProfileId':_0x340d06[_0xb444('0x34')]},'raw':!![]})[_0xb444('0x18')](function(_0x53e009){if(_0x53e009&&_0x53e009[_0xb444('0x35')]===0x0){return db['UserProfileResource'][_0xb444('0x2f')]({'name':_0xb7d883['name'],'resourceId':_0xb7d883['id'],'type':_0x53e009['name'],'sectionId':_0x53e009['id']},{})[_0xb444('0x18')](function(){return _0x4c707a;});}else{return _0x4c707a;}})[_0xb444('0x24')](function(_0x2c50c1){logger['error'](_0xb444('0x36'),_0x2c50c1);throw _0x2c50c1;});}return _0x4c707a;})[_0xb444('0x18')](respondWithResult(_0x14a577,0xc9))[_0xb444('0x24')](handleError(_0x14a577,null));};exports['update']=function(_0x22f3a6,_0x194fde){if(_0x22f3a6[_0xb444('0x37')]['id']){delete _0x22f3a6[_0xb444('0x37')]['id'];}return db[_0xb444('0x1d')][_0xb444('0x2e')]({'where':{'id':_0x22f3a6['params']['id']}})[_0xb444('0x18')](handleEntityNotFound(_0x194fde,null))[_0xb444('0x18')](saveUpdates(_0x22f3a6[_0xb444('0x37')],null))[_0xb444('0x18')](respondWithResult(_0x194fde,null))[_0xb444('0x24')](handleError(_0x194fde,null));};exports[_0xb444('0x17')]=function(_0x5bc51f,_0x24ff6f){return db[_0xb444('0x1d')][_0xb444('0x2e')]({'where':{'id':_0x5bc51f[_0xb444('0x26')]['id']}})[_0xb444('0x18')](handleEntityNotFound(_0x24ff6f,null))['then'](removeEntity(_0x24ff6f,null))[_0xb444('0x24')](handleError(_0x24ff6f,null));};exports[_0xb444('0x38')]=function(_0x100ead,_0x2ec538){return db[_0xb444('0x1d')][_0xb444('0x38')]()['then'](respondWithResult(_0x2ec538,null))[_0xb444('0x24')](handleError(_0x2ec538,null));};exports['getMembers']=function(_0x4c1388,_0x1e16e7){var _0x18b5eb={'raw':!![],'where':{}},_0x4cf9b7={},_0x3ec166;return db[_0xb444('0x1d')][_0xb444('0x39')]({'where':{'id':_0x4c1388['params']['id']}})[_0xb444('0x18')](handleEntityNotFound(_0x1e16e7,null))[_0xb444('0x18')](function(_0x327218){if(_0x327218){_0x3ec166=_0x327218['get']({'plain':!![]});_0x4cf9b7['model']=_[_0xb444('0x28')](db['UserChatQueue'][_0xb444('0x3a')]);_0x4cf9b7['query']=_[_0xb444('0x28')](_0x4c1388[_0xb444('0x22')]);_0x4cf9b7[_0xb444('0x3b')]=_[_0xb444('0x3c')](_0x4cf9b7['model'],_0x4cf9b7[_0xb444('0x22')]);_0x18b5eb[_0xb444('0x29')]=_[_0xb444('0x3c')](_0x4cf9b7['model'],qs[_0xb444('0x2a')](_0x4c1388[_0xb444('0x22')][_0xb444('0x2a')]));_0x18b5eb[_0xb444('0x29')]=_0x18b5eb[_0xb444('0x29')][_0xb444('0x2b')]?_0x18b5eb['attributes']:_0x4cf9b7[_0xb444('0x27')];if(!_0x4c1388['query'][_0xb444('0x3d')](_0xb444('0x3e'))){_0x18b5eb['limit']=qs[_0xb444('0x12')](_0x4c1388[_0xb444('0x22')]['limit']);_0x18b5eb[_0xb444('0x10')]=qs[_0xb444('0x10')](_0x4c1388[_0xb444('0x22')][_0xb444('0x10')]);}_0x18b5eb[_0xb444('0x3f')]=qs[_0xb444('0x40')](_0x4c1388[_0xb444('0x22')][_0xb444('0x40')]);_0x18b5eb[_0xb444('0x20')]=qs['filters'](_['pick'](_0x4c1388['query'],_0x4cf9b7[_0xb444('0x3b')]));_0x18b5eb[_0xb444('0x20')][_0xb444('0x41')]=_0x327218['id'];if(_0x4c1388[_0xb444('0x22')][_0xb444('0x42')]){_0x18b5eb[_0xb444('0x20')]=_[_0xb444('0x2d')](_0x18b5eb[_0xb444('0x20')],{'$or':_['map'](_0x18b5eb[_0xb444('0x29')],function(_0x341b20){var _0x49fa97={};_0x49fa97[_0x341b20]={'$like':'%'+_0x4c1388[_0xb444('0x22')][_0xb444('0x42')]+'%'};return _0x49fa97;})});}_0x18b5eb=_['merge']({},_0x18b5eb,_0x4c1388[_0xb444('0x43')]);return db['UserChatQueue'][_0xb444('0x23')](_0x18b5eb);}})[_0xb444('0x18')](function(_0x26460d){if(_0x26460d){return db['User']['findAndCountAll']({'where':{'id':_[_0xb444('0x1c')](_0x26460d,_0xb444('0x44')),'role':_0xb444('0x45')},'attributes':['id',_0xb444('0x46'),_0xb444('0x47'),'updatedAt',_0xb444('0x48')]});}})[_0xb444('0x18')](function(_0xb13923){if(_0xb13923){return{'count':_0xb13923[_0xb444('0x13')],'rows':_['map'](_0xb13923['rows'],function(_0x32ab37){return{'membername':_0x32ab37['name'],'UserId':_0x32ab37['id'],'queue_name':_0x3ec166['name'],'ChatQueueId':_0x3ec166['id'],'interface':util[_0xb444('0x49')]('%s/%s',_0xb444('0x4a'),_0x32ab37[_0xb444('0x46')]),'penalty':0x0,'paused':_0x32ab37[_0xb444('0x47')],'createdAt':_0x32ab37[_0xb444('0x48')],'updatedAt':_0x32ab37[_0xb444('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb444('0x18')](respondWithFilteredResult(_0x1e16e7,_0x18b5eb))['catch'](handleError(_0x1e16e7,null));};exports[_0xb444('0x4c')]=function(_0x149410,_0x445d68){var _0x155dcc={};var _0x22ccb5={};var _0x3610c3;var _0x2a4300;return db[_0xb444('0x1d')][_0xb444('0x39')]({'where':{'id':_0x149410['params']['id']}})['then'](handleEntityNotFound(_0x445d68,null))[_0xb444('0x18')](function(_0x346f47){if(_0x346f47){_0x3610c3=_0x346f47;_0x22ccb5[_0xb444('0x27')]=_['keys'](db[_0xb444('0x4d')]['rawAttributes']);_0x22ccb5[_0xb444('0x22')]=_[_0xb444('0x28')](_0x149410[_0xb444('0x22')]);_0x22ccb5[_0xb444('0x3b')]=_['intersection'](_0x22ccb5[_0xb444('0x27')],_0x22ccb5[_0xb444('0x22')]);_0x155dcc[_0xb444('0x29')]=_[_0xb444('0x3c')](_0x22ccb5[_0xb444('0x27')],qs['fields'](_0x149410[_0xb444('0x22')][_0xb444('0x2a')]));_0x155dcc['attributes']=_0x155dcc[_0xb444('0x29')][_0xb444('0x2b')]?_0x155dcc[_0xb444('0x29')]:_0x22ccb5[_0xb444('0x27')];_0x155dcc[_0xb444('0x3f')]=qs['sort'](_0x149410[_0xb444('0x22')][_0xb444('0x40')]);_0x155dcc[_0xb444('0x20')]=qs[_0xb444('0x3b')](_[_0xb444('0x4e')](_0x149410[_0xb444('0x22')],_0x22ccb5['filters']));if(_0x149410['query'][_0xb444('0x42')]){_0x155dcc[_0xb444('0x20')]=_[_0xb444('0x2d')](_0x155dcc[_0xb444('0x20')],{'$or':_[_0xb444('0x1c')](_0x155dcc[_0xb444('0x29')],function(_0x4f37a6){var _0x543626={};_0x543626[_0x4f37a6]={'$like':'%'+_0x149410['query'][_0xb444('0x42')]+'%'};return _0x543626;})});}_0x155dcc=_['merge']({},_0x155dcc,_0x149410[_0xb444('0x43')]);return _0x3610c3[_0xb444('0x4c')](_0x155dcc);}})[_0xb444('0x18')](function(_0x463c97){if(_0x463c97){_0x2a4300=_0x463c97[_0xb444('0x2b')];if(!_0x149410[_0xb444('0x22')]['hasOwnProperty']('nolimit')){_0x155dcc[_0xb444('0x12')]=qs['limit'](_0x149410['query'][_0xb444('0x12')]);_0x155dcc[_0xb444('0x10')]=qs['offset'](_0x149410['query'][_0xb444('0x10')]);}return _0x3610c3[_0xb444('0x4c')](_0x155dcc);}})[_0xb444('0x18')](function(_0x468c1c){if(_0x468c1c){return _0x468c1c?{'count':_0x2a4300,'rows':_0x468c1c}:null;}})[_0xb444('0x18')](respondWithResult(_0x445d68,null))[_0xb444('0x24')](handleError(_0x445d68,null));};exports[_0xb444('0x4f')]=function(_0x42aaea,_0x4cb910){var _0x29c287=_0x42aaea[_0xb444('0x37')]['ids'];return db[_0xb444('0x4d')][_0xb444('0x23')]({'where':{'id':_0x29c287},'attributes':['id'],'include':[{'model':db[_0xb444('0x50')],'as':_0xb444('0x51'),'attributes':['id',_0xb444('0x46'),'online','voicePause',_0xb444('0x52')],'raw':!![]}]})[_0xb444('0x18')](function(_0x169f49){if(_0x169f49){var _0x57c5e4=_[_0xb444('0x53')](_0x169f49,function(_0x57a76a){var _0x349f0a=_0x57a76a[_0xb444('0x16')]({'plain':!![]});return _0x349f0a[_0xb444('0x51')];});return db['ChatQueue']['find']({'where':{'id':_0x42aaea[_0xb444('0x26')]['id']}})[_0xb444('0x18')](function(_0x58e83e){return db[_0xb444('0x54')][_0xb444('0x55')](function(_0x2e44a2){return _0x58e83e[_0xb444('0x4f')](_0x29c287,{'transaction':_0x2e44a2})['then'](function(){return BPromise[_0xb444('0x56')](_0x57c5e4,function(_0x2fe7e6){return db[_0xb444('0x57')][_0xb444('0x58')]({'where':{'UserId':_0x2fe7e6['id'],'ChatQueueId':_0x42aaea['params']['id']},'transaction':_0x2e44a2});});})['then'](function(){_0x57c5e4['forEach'](function(_0x4069bf){socket[_0xb444('0x59')]('userChatQueue:save',{'UserId':_0x4069bf['id'],'ChatQueueId':_0x58e83e['id']});});});});});}})[_0xb444('0x18')](respondWithStatusCode(_0x4cb910,null))[_0xb444('0x24')](handleError(_0x4cb910,null));};exports['removeTeams']=function(_0x2c9c12,_0x12442){return db[_0xb444('0x4d')][_0xb444('0x23')]({'where':{'id':_0x2c9c12[_0xb444('0x22')][_0xb444('0x5a')]},'attributes':['id'],'include':[{'model':db[_0xb444('0x50')],'as':_0xb444('0x51'),'attributes':['id'],'raw':!![]}]})[_0xb444('0x18')](handleEntityNotFound(_0x12442,null))[_0xb444('0x18')](function(_0x162441){var _0x284c86=_[_0xb444('0x1c')](_0x162441,'id');var _0x2c1a3d=[];var _0x4521dc=[];var _0x625d=squel[_0xb444('0x5b')]();_0x625d[_0xb444('0x5c')]('tq.TeamId')[_0xb444('0x5d')]('team_has_chat_queues','tq')[_0xb444('0x5e')](_0xb444('0x5f'),'ut',_0xb444('0x60'))[_0xb444('0x20')](_0xb444('0x61'),_0x2c9c12['params']['id']);for(var _0x24700a=0x0;_0x24700a<_0x162441[_0xb444('0x2b')];_0x24700a+=0x1){let _0x2e41a4=_0x162441[_0x24700a];for(var _0x38e59c=0x0;_0x38e59c<_0x2e41a4[_0xb444('0x51')][_0xb444('0x2b')];_0x38e59c+=0x1){let _0x21df72=_0x2e41a4[_0xb444('0x51')][_0x38e59c];var _0x1da6bf=_0x625d[_0xb444('0x62')]();_0x1da6bf['where'](_0xb444('0x63'),_0x21df72['id']);_0x4521dc[_0xb444('0x64')](db[_0xb444('0x54')][_0xb444('0x22')](_0x1da6bf[_0xb444('0x65')](),{'type':db['sequelize'][_0xb444('0x66')][_0xb444('0x67')]})[_0xb444('0x18')](function(_0x49641a){if(_0x49641a[_0xb444('0x2b')]===0x1){return _0x21df72['id'];}else{var _0x3b6930=_[_0xb444('0x68')](_['map'](_0x49641a,'TeamId'),function(_0x39e823){return _[_0xb444('0x69')](_0x284c86,_0x39e823);});if(_0x3b6930){return _0x21df72['id'];}}}));}}return BPromise[_0xb444('0x6a')](_0x4521dc)[_0xb444('0x18')](function(_0x9ad77d){_0x2c1a3d=_(_0x2c1a3d)[_0xb444('0x6b')](_0x9ad77d)[_0xb444('0x6c')]()[_0xb444('0x6d')]();return db[_0xb444('0x1d')]['find']({'where':{'id':_0x2c9c12['params']['id']}})[_0xb444('0x18')](function(_0x4245a4){return db[_0xb444('0x54')]['transaction'](function(_0x58c0d1){return _0x4245a4[_0xb444('0x6e')](_0x2c9c12[_0xb444('0x22')][_0xb444('0x5a')],{'transaction':_0x58c0d1})[_0xb444('0x18')](function(){if(!_[_0xb444('0x6f')](_0x2c1a3d)){return _0x4245a4['removeAgents'](_0x2c1a3d,{'transaction':_0x58c0d1});}})['then'](function(){_0x2c1a3d[_0xb444('0x70')](function(_0x22f6c5){socket[_0xb444('0x59')](_0xb444('0x71'),{'UserId':_0x22f6c5,'ChatQueueId':_0x4245a4['id']});});});});});});})[_0xb444('0x18')](respondWithStatusCode(_0x12442,null))[_0xb444('0x24')](handleError(_0x12442,null));};exports[_0xb444('0x72')]=function(_0x1955cb,_0x22c69e){return db[_0xb444('0x1d')][_0xb444('0x2e')]({'where':{'id':_0x1955cb[_0xb444('0x26')]['id']}})['then'](handleEntityNotFound(_0x22c69e,null))['then'](function(_0x10ba9e){if(_0x10ba9e){return _0x10ba9e['addAgents'](_0x1955cb['body'][_0xb444('0x5a')],_[_0xb444('0x73')](_0x1955cb[_0xb444('0x37')],[_0xb444('0x5a'),'id'])||{})[_0xb444('0x74')](function(_0x3e6ea8){for(var _0x357ef8=0x0;_0x357ef8<_0x1955cb[_0xb444('0x37')]['ids'][_0xb444('0x2b')];_0x357ef8+=0x1){socket['emit'](_0xb444('0x75'),{'UserId':Number(_0x1955cb['body'][_0xb444('0x5a')][_0x357ef8]),'ChatQueueId':Number(_0x1955cb[_0xb444('0x26')]['id'])});}return _0x3e6ea8;});}})[_0xb444('0x18')](respondWithResult(_0x22c69e,null))[_0xb444('0x24')](handleError(_0x22c69e,null));};exports[_0xb444('0x76')]=function(_0x61b8d8,_0x53d3c2){return db['ChatQueue'][_0xb444('0x2e')]({'where':{'id':_0x61b8d8['params']['id']}})[_0xb444('0x18')](handleEntityNotFound(_0x53d3c2,null))['then'](function(_0x1ad30b){if(_0x1ad30b){return _0x1ad30b[_0xb444('0x76')](_0x61b8d8[_0xb444('0x22')][_0xb444('0x5a')])['then'](function(){if(_['isArray'](_0x61b8d8['query']['ids'])){for(var _0x2017a1=0x0;_0x2017a1<_0x61b8d8[_0xb444('0x22')][_0xb444('0x5a')]['length'];_0x2017a1+=0x1){socket[_0xb444('0x59')](_0xb444('0x71'),{'UserId':Number(_0x61b8d8[_0xb444('0x22')][_0xb444('0x5a')][_0x2017a1]),'ChatQueueId':Number(_0x61b8d8[_0xb444('0x26')]['id'])});}}else{socket[_0xb444('0x59')](_0xb444('0x71'),{'UserId':Number(_0x61b8d8['query']['ids']),'ChatQueueId':Number(_0x61b8d8[_0xb444('0x26')]['id'])});}});}})[_0xb444('0x18')](respondWithStatusCode(_0x53d3c2,null))['catch'](handleError(_0x53d3c2,null));};exports['getAgents']=function(_0x75dee7,_0x24a78b){var _0x302415={};var _0x4ce7f7={};var _0x7f5426;var _0xf7c167;return db[_0xb444('0x1d')][_0xb444('0x39')]({'where':{'id':_0x75dee7[_0xb444('0x26')]['id']}})['then'](handleEntityNotFound(_0x24a78b,null))[_0xb444('0x18')](function(_0x476417){if(_0x476417){_0x7f5426=_0x476417;_0x4ce7f7['model']=_['keys'](db[_0xb444('0x50')][_0xb444('0x3a')]);_0x4ce7f7[_0xb444('0x22')]=_[_0xb444('0x28')](_0x75dee7[_0xb444('0x22')]);_0x4ce7f7['filters']=_[_0xb444('0x3c')](_0x4ce7f7[_0xb444('0x27')],_0x4ce7f7[_0xb444('0x22')]);_0x302415[_0xb444('0x29')]=_[_0xb444('0x3c')](_0x4ce7f7[_0xb444('0x27')],qs['fields'](_0x75dee7[_0xb444('0x22')][_0xb444('0x2a')]));_0x302415['attributes']=_0x302415[_0xb444('0x29')][_0xb444('0x2b')]?_0x302415[_0xb444('0x29')]:_0x4ce7f7['model'];_0x302415['order']=qs['sort'](_0x75dee7[_0xb444('0x22')][_0xb444('0x40')]);_0x302415[_0xb444('0x20')]=qs['filters'](_[_0xb444('0x4e')](_0x75dee7['query'],_0x4ce7f7['filters']));if(_0x75dee7[_0xb444('0x22')][_0xb444('0x42')]){_0x302415[_0xb444('0x20')]=_[_0xb444('0x2d')](_0x302415['where'],{'$or':_[_0xb444('0x1c')](_0x302415[_0xb444('0x29')],function(_0x2ad183){var _0x464ca0={};_0x464ca0[_0x2ad183]={'$like':'%'+_0x75dee7[_0xb444('0x22')][_0xb444('0x42')]+'%'};return _0x464ca0;})});}_0x302415=_[_0xb444('0x2d')]({},_0x302415,_0x75dee7[_0xb444('0x43')]);return _0x7f5426['getAgents'](_0x302415);}})[_0xb444('0x18')](function(_0x582fe1){if(_0x582fe1){_0xf7c167=_0x582fe1[_0xb444('0x2b')];if(!_0x75dee7['query'][_0xb444('0x3d')](_0xb444('0x3e'))){_0x302415['limit']=qs[_0xb444('0x12')](_0x75dee7[_0xb444('0x22')][_0xb444('0x12')]);_0x302415[_0xb444('0x10')]=qs['offset'](_0x75dee7[_0xb444('0x22')]['offset']);}return _0x7f5426[_0xb444('0x77')](_0x302415);}})[_0xb444('0x18')](function(_0x2c8c86){if(_0x2c8c86){return _0x2c8c86?{'count':_0xf7c167,'rows':_0x2c8c86}:null;}})['then'](respondWithResult(_0x24a78b,null))['catch'](handleError(_0x24a78b,null));};
\ No newline at end of file
+var _0x8a25=['rows','catch','show','model','keys','intersection','fields','attributes','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','findOne','length','nolimit','order','sort','filters','pick','UserChatQueue','findAndCountAll','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','filter','ids','User','Agents','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','field','tq.TeamId','from','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','transaction','isEmpty','removeAgents','emit','userChatQueue:remove','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','sendStatus','status','offset','undefined','count','limit','set','then','destroy','get','ChatQueues','UserProfileResource','end','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll'];(function(_0x2573ca,_0x550022){var _0x220656=function(_0x1ac82c){while(--_0x1ac82c){_0x2573ca['push'](_0x2573ca['shift']());}};_0x220656(++_0x550022);}(_0x8a25,0x12f));var _0x58a2=function(_0x4b75e7,_0xdb714a){_0x4b75e7=_0x4b75e7-0x0;var _0x1ea0d8=_0x8a25[_0x4b75e7];return _0x1ea0d8;};'use strict';var BPromise=require(_0x58a2('0x0'));var util=require(_0x58a2('0x1'));var _=require(_0x58a2('0x2'));var squel=require(_0x58a2('0x3'));var Redis=require(_0x58a2('0x4'));var qs=require(_0x58a2('0x5'));var logger=require(_0x58a2('0x6'))(_0x58a2('0x7'));var config=require(_0x58a2('0x8'));var db=require(_0x58a2('0x9'))['db'];config[_0x58a2('0xa')]=_[_0x58a2('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58a2('0xc'))(new Redis(config[_0x58a2('0xa')]));require(_0x58a2('0xd'))['register'](socket);function respondWithStatusCode(_0x5d9d60,_0x2fadfd){_0x2fadfd=_0x2fadfd||0xcc;return function(_0x2d3318){if(_0x2d3318){return _0x5d9d60[_0x58a2('0xe')](_0x2fadfd);}return _0x5d9d60[_0x58a2('0xf')](_0x2fadfd)['end']();};}function respondWithResult(_0x4664b6,_0x15e75d){_0x15e75d=_0x15e75d||0xc8;return function(_0x3f6b2c){if(_0x3f6b2c){return _0x4664b6[_0x58a2('0xf')](_0x15e75d)['json'](_0x3f6b2c);}};}function respondWithFilteredResult(_0x486c89,_0x2d9497){return function(_0x40c476){if(_0x40c476){var _0xc728fb=typeof _0x2d9497[_0x58a2('0x10')]===_0x58a2('0x11')&&typeof _0x2d9497['limit']===_0x58a2('0x11');var _0x12d102=_0x40c476['count'];var _0x27f897=_0xc728fb?0x0:_0x2d9497[_0x58a2('0x10')];var _0x2a7422=_0xc728fb?_0x40c476[_0x58a2('0x12')]:_0x2d9497['offset']+_0x2d9497[_0x58a2('0x13')];var _0x337d25;if(_0x2a7422>=_0x12d102){_0x2a7422=_0x12d102;_0x337d25=0xc8;}else{_0x337d25=0xce;}_0x486c89[_0x58a2('0xf')](_0x337d25);return _0x486c89[_0x58a2('0x14')]('Content-Range',_0x27f897+'-'+_0x2a7422+'/'+_0x12d102)['json'](_0x40c476);}return null;};}function saveUpdates(_0x11abe4){return function(_0x5cf5f){if(_0x5cf5f){return _0x5cf5f['update'](_0x11abe4)[_0x58a2('0x15')](function(_0x53b834){return _0x53b834;});}return null;};}function removeEntity(_0x9401d5){return function(_0x3d8cbe){if(_0x3d8cbe){return _0x3d8cbe[_0x58a2('0x16')]()[_0x58a2('0x15')](function(){var _0x46937e=_0x3d8cbe[_0x58a2('0x17')]({'plain':!![]});var _0x2491f5=_0x58a2('0x18');return db[_0x58a2('0x19')][_0x58a2('0x16')]({'where':{'type':_0x2491f5,'resourceId':_0x46937e['id']}})[_0x58a2('0x15')](function(){return _0x3d8cbe;});})['then'](function(){_0x9401d5[_0x58a2('0xf')](0xcc)[_0x58a2('0x1a')]();});}};}function handleEntityNotFound(_0x49529f){return function(_0x50198b){if(!_0x50198b){_0x49529f['sendStatus'](0x194);}return _0x50198b;};}function handleError(_0x2fc2bc,_0x3da2b1){_0x3da2b1=_0x3da2b1||0x1f4;return function(_0x4f7df6){logger[_0x58a2('0x1b')](_0x4f7df6[_0x58a2('0x1c')]);if(_0x4f7df6[_0x58a2('0x1d')]){delete _0x4f7df6[_0x58a2('0x1d')];}_0x2fc2bc[_0x58a2('0xf')](_0x3da2b1)[_0x58a2('0x1e')](_0x4f7df6);};}exports['index']=function(_0x3c7b9a,_0x5308e2){var _0x276194={};var _0x25d705={'count':0x0,'rows':[]};var _0x34b7d9=_[_0x58a2('0x1f')](db[_0x58a2('0x20')][_0x58a2('0x21')],function(_0x1226cc){return{'name':_0x1226cc[_0x58a2('0x22')],'type':_0x1226cc[_0x58a2('0x23')][_0x58a2('0x24')]};});_0x276194=qs[_0x58a2('0x25')](_0x34b7d9,_0x3c7b9a);var _0x4bff13={'where':_0x276194[_0x58a2('0x26')]};return db[_0x58a2('0x20')][_0x58a2('0x12')](_0x4bff13)[_0x58a2('0x15')](function(_0x1f59d0){_0x25d705[_0x58a2('0x12')]=_0x1f59d0;_0x276194[_0x58a2('0x27')]=qs[_0x58a2('0x27')](_0x3c7b9a[_0x58a2('0x28')]);return db['ChatQueue'][_0x58a2('0x29')](_0x276194);})[_0x58a2('0x15')](function(_0x575a97){_0x25d705[_0x58a2('0x2a')]=_0x575a97;return _0x25d705;})['then'](respondWithFilteredResult(_0x5308e2,_0x276194))[_0x58a2('0x2b')](handleError(_0x5308e2,null));};exports[_0x58a2('0x2c')]=function(_0x423feb,_0x175a4d){var _0x508374={'raw':!![],'where':{'id':_0x423feb['params']['id']}},_0x123ef3={};_0x123ef3[_0x58a2('0x2d')]=_[_0x58a2('0x2e')](db['ChatQueue']['rawAttributes']);_0x123ef3[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x423feb[_0x58a2('0x28')]);_0x123ef3['filters']=_['intersection'](_0x123ef3[_0x58a2('0x2d')],_0x123ef3[_0x58a2('0x28')]);_0x508374['attributes']=_[_0x58a2('0x2f')](_0x123ef3['model'],qs[_0x58a2('0x30')](_0x423feb['query']['fields']));_0x508374[_0x58a2('0x31')]=_0x508374[_0x58a2('0x31')]['length']?_0x508374[_0x58a2('0x31')]:_0x123ef3['model'];if(_0x423feb['query']['includeAll']){_0x508374[_0x58a2('0x27')]=[{'all':!![]}];}_0x508374=_[_0x58a2('0x32')]({},_0x508374,_0x423feb[_0x58a2('0x33')]);return db[_0x58a2('0x20')][_0x58a2('0x34')](_0x508374)[_0x58a2('0x15')](handleEntityNotFound(_0x175a4d,null))[_0x58a2('0x15')](respondWithResult(_0x175a4d,null))[_0x58a2('0x2b')](handleError(_0x175a4d,null));};exports[_0x58a2('0x35')]=function(_0xee6ac6,_0x4d0c86){return db[_0x58a2('0x20')]['create'](_0xee6ac6[_0x58a2('0x36')],{})[_0x58a2('0x15')](function(_0x377aa1){var _0x3eacc0=_0xee6ac6['user'][_0x58a2('0x17')]({'plain':!![]});if(!_0x3eacc0)throw new Error(_0x58a2('0x37'));if(_0x3eacc0[_0x58a2('0x38')]===_0x58a2('0x39')){var _0x584899=_0x377aa1[_0x58a2('0x17')]({'plain':!![]});var _0x5a9215='ChatQueues';return db[_0x58a2('0x3a')][_0x58a2('0x34')]({'where':{'name':_0x5a9215,'userProfileId':_0x3eacc0[_0x58a2('0x3b')]},'raw':!![]})[_0x58a2('0x15')](function(_0x3387a2){if(_0x3387a2&&_0x3387a2['autoAssociation']===0x0){return db[_0x58a2('0x19')][_0x58a2('0x35')]({'name':_0x584899['name'],'resourceId':_0x584899['id'],'type':_0x3387a2['name'],'sectionId':_0x3387a2['id']},{})[_0x58a2('0x15')](function(){return _0x377aa1;});}else{return _0x377aa1;}})['catch'](function(_0x58d4e8){logger['error'](_0x58a2('0x3c'),_0x58d4e8);throw _0x58d4e8;});}return _0x377aa1;})[_0x58a2('0x15')](respondWithResult(_0x4d0c86,0xc9))[_0x58a2('0x2b')](handleError(_0x4d0c86,null));};exports['update']=function(_0x1edab5,_0xfc281b){if(_0x1edab5[_0x58a2('0x36')]['id']){delete _0x1edab5['body']['id'];}return db[_0x58a2('0x20')]['find']({'where':{'id':_0x1edab5[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0xfc281b,null))[_0x58a2('0x15')](saveUpdates(_0x1edab5[_0x58a2('0x36')],null))['then'](respondWithResult(_0xfc281b,null))['catch'](handleError(_0xfc281b,null));};exports[_0x58a2('0x16')]=function(_0x47f8df,_0x20a731){return db['ChatQueue'][_0x58a2('0x34')]({'where':{'id':_0x47f8df[_0x58a2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x20a731,null))[_0x58a2('0x15')](removeEntity(_0x20a731,null))[_0x58a2('0x2b')](handleError(_0x20a731,null));};exports['describe']=function(_0x4917f8,_0x7903c9){return db['ChatQueue']['describe']()[_0x58a2('0x15')](respondWithResult(_0x7903c9,null))[_0x58a2('0x2b')](handleError(_0x7903c9,null));};exports[_0x58a2('0x3e')]=function(_0x20ee69,_0x3058cd){var _0x2220c8={'raw':!![],'where':{}},_0x168454={},_0xd1b879;return db[_0x58a2('0x20')][_0x58a2('0x3f')]({'where':{'id':_0x20ee69[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x3058cd,null))[_0x58a2('0x15')](function(_0x193836){if(_0x193836){_0xd1b879=_0x193836[_0x58a2('0x17')]({'plain':!![]});_0x168454[_0x58a2('0x2d')]=_[_0x58a2('0x2e')](db['UserChatQueue']['rawAttributes']);_0x168454[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x20ee69[_0x58a2('0x28')]);_0x168454['filters']=_[_0x58a2('0x2f')](_0x168454[_0x58a2('0x2d')],_0x168454[_0x58a2('0x28')]);_0x2220c8[_0x58a2('0x31')]=_[_0x58a2('0x2f')](_0x168454[_0x58a2('0x2d')],qs[_0x58a2('0x30')](_0x20ee69[_0x58a2('0x28')][_0x58a2('0x30')]));_0x2220c8['attributes']=_0x2220c8[_0x58a2('0x31')][_0x58a2('0x40')]?_0x2220c8['attributes']:_0x168454[_0x58a2('0x2d')];if(!_0x20ee69['query']['hasOwnProperty'](_0x58a2('0x41'))){_0x2220c8[_0x58a2('0x13')]=qs['limit'](_0x20ee69[_0x58a2('0x28')][_0x58a2('0x13')]);_0x2220c8[_0x58a2('0x10')]=qs[_0x58a2('0x10')](_0x20ee69['query']['offset']);}_0x2220c8[_0x58a2('0x42')]=qs[_0x58a2('0x43')](_0x20ee69['query'][_0x58a2('0x43')]);_0x2220c8[_0x58a2('0x26')]=qs[_0x58a2('0x44')](_[_0x58a2('0x45')](_0x20ee69[_0x58a2('0x28')],_0x168454[_0x58a2('0x44')]));_0x2220c8[_0x58a2('0x26')]['ChatQueueId']=_0x193836['id'];if(_0x20ee69[_0x58a2('0x28')]['filter']){_0x2220c8['where']=_[_0x58a2('0x32')](_0x2220c8[_0x58a2('0x26')],{'$or':_[_0x58a2('0x1f')](_0x2220c8['attributes'],function(_0x402d5b){var _0x278f55={};_0x278f55[_0x402d5b]={'$like':'%'+_0x20ee69[_0x58a2('0x28')]['filter']+'%'};return _0x278f55;})});}_0x2220c8=_[_0x58a2('0x32')]({},_0x2220c8,_0x20ee69[_0x58a2('0x33')]);return db[_0x58a2('0x46')][_0x58a2('0x29')](_0x2220c8);}})[_0x58a2('0x15')](function(_0x366175){if(_0x366175){return db['User'][_0x58a2('0x47')]({'where':{'id':_['map'](_0x366175,'UserId'),'role':_0x58a2('0x48')},'attributes':['id',_0x58a2('0x1d'),_0x58a2('0x49'),'updatedAt',_0x58a2('0x4a')]});}})[_0x58a2('0x15')](function(_0x5f5d55){if(_0x5f5d55){return{'count':_0x5f5d55[_0x58a2('0x12')],'rows':_[_0x58a2('0x1f')](_0x5f5d55[_0x58a2('0x2a')],function(_0x4fd85a){return{'membername':_0x4fd85a[_0x58a2('0x1d')],'UserId':_0x4fd85a['id'],'queue_name':_0xd1b879[_0x58a2('0x1d')],'ChatQueueId':_0xd1b879['id'],'interface':util['format'](_0x58a2('0x4b'),_0x58a2('0x4c'),_0x4fd85a[_0x58a2('0x1d')]),'penalty':0x0,'paused':_0x4fd85a[_0x58a2('0x49')],'createdAt':_0x4fd85a[_0x58a2('0x4a')],'updatedAt':_0x4fd85a[_0x58a2('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3058cd,_0x2220c8))[_0x58a2('0x2b')](handleError(_0x3058cd,null));};exports[_0x58a2('0x4e')]=function(_0x383316,_0x5da002){var _0x5c4598={};var _0x4ac150={};var _0x2519a8;var _0x2b7637;return db['ChatQueue'][_0x58a2('0x3f')]({'where':{'id':_0x383316[_0x58a2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5da002,null))[_0x58a2('0x15')](function(_0x5d6550){if(_0x5d6550){_0x2519a8=_0x5d6550;_0x4ac150['model']=_[_0x58a2('0x2e')](db[_0x58a2('0x4f')][_0x58a2('0x21')]);_0x4ac150[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x383316[_0x58a2('0x28')]);_0x4ac150[_0x58a2('0x44')]=_[_0x58a2('0x2f')](_0x4ac150[_0x58a2('0x2d')],_0x4ac150[_0x58a2('0x28')]);_0x5c4598[_0x58a2('0x31')]=_[_0x58a2('0x2f')](_0x4ac150[_0x58a2('0x2d')],qs[_0x58a2('0x30')](_0x383316[_0x58a2('0x28')][_0x58a2('0x30')]));_0x5c4598[_0x58a2('0x31')]=_0x5c4598[_0x58a2('0x31')][_0x58a2('0x40')]?_0x5c4598['attributes']:_0x4ac150[_0x58a2('0x2d')];_0x5c4598['order']=qs[_0x58a2('0x43')](_0x383316[_0x58a2('0x28')][_0x58a2('0x43')]);_0x5c4598[_0x58a2('0x26')]=qs['filters'](_['pick'](_0x383316['query'],_0x4ac150[_0x58a2('0x44')]));if(_0x383316[_0x58a2('0x28')]['filter']){_0x5c4598[_0x58a2('0x26')]=_[_0x58a2('0x32')](_0x5c4598[_0x58a2('0x26')],{'$or':_[_0x58a2('0x1f')](_0x5c4598[_0x58a2('0x31')],function(_0x1dab55){var _0x5b6166={};_0x5b6166[_0x1dab55]={'$like':'%'+_0x383316['query'][_0x58a2('0x50')]+'%'};return _0x5b6166;})});}_0x5c4598=_[_0x58a2('0x32')]({},_0x5c4598,_0x383316[_0x58a2('0x33')]);return _0x2519a8[_0x58a2('0x4e')](_0x5c4598);}})[_0x58a2('0x15')](function(_0x241163){if(_0x241163){_0x2b7637=_0x241163['length'];if(!_0x383316[_0x58a2('0x28')]['hasOwnProperty'](_0x58a2('0x41'))){_0x5c4598[_0x58a2('0x13')]=qs['limit'](_0x383316['query']['limit']);_0x5c4598[_0x58a2('0x10')]=qs[_0x58a2('0x10')](_0x383316[_0x58a2('0x28')][_0x58a2('0x10')]);}return _0x2519a8['getTeams'](_0x5c4598);}})['then'](function(_0x16c1ec){if(_0x16c1ec){return _0x16c1ec?{'count':_0x2b7637,'rows':_0x16c1ec}:null;}})['then'](respondWithResult(_0x5da002,null))[_0x58a2('0x2b')](handleError(_0x5da002,null));};exports['addTeams']=function(_0xa1f741,_0x2f0d0e){var _0x400fd2=_0xa1f741[_0x58a2('0x36')][_0x58a2('0x51')];return db['Team'][_0x58a2('0x29')]({'where':{'id':_0x400fd2},'attributes':['id'],'include':[{'model':db[_0x58a2('0x52')],'as':_0x58a2('0x53'),'attributes':['id','name','online',_0x58a2('0x54'),_0x58a2('0x55')],'raw':!![]}]})[_0x58a2('0x15')](function(_0x45879d){if(_0x45879d){var _0x1077a5=_[_0x58a2('0x56')](_0x45879d,function(_0xc99838){var _0x31e992=_0xc99838[_0x58a2('0x17')]({'plain':!![]});return _0x31e992[_0x58a2('0x53')];});return db[_0x58a2('0x20')]['find']({'where':{'id':_0xa1f741[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](function(_0x343d0a){return db[_0x58a2('0x57')]['transaction'](function(_0x408ffc){return _0x343d0a[_0x58a2('0x58')](_0x400fd2,{'transaction':_0x408ffc})[_0x58a2('0x15')](function(){return BPromise[_0x58a2('0x59')](_0x1077a5,function(_0x24ab2b){return db['UserChatQueue'][_0x58a2('0x5a')]({'where':{'UserId':_0x24ab2b['id'],'ChatQueueId':_0xa1f741['params']['id']},'transaction':_0x408ffc});});})[_0x58a2('0x15')](function(){_0x1077a5['forEach'](function(_0x5e2a9c){socket['emit'](_0x58a2('0x5b'),{'UserId':_0x5e2a9c['id'],'ChatQueueId':_0x343d0a['id']});});});});});}})[_0x58a2('0x15')](respondWithStatusCode(_0x2f0d0e,null))['catch'](handleError(_0x2f0d0e,null));};exports[_0x58a2('0x5c')]=function(_0x3da9fc,_0x47efb4){return db[_0x58a2('0x4f')]['findAll']({'where':{'id':_0x3da9fc[_0x58a2('0x28')][_0x58a2('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x58a2('0x15')](handleEntityNotFound(_0x47efb4,null))[_0x58a2('0x15')](function(_0x3b03f6){var _0x51a593=_[_0x58a2('0x1f')](_0x3b03f6,'id');var _0xed6d92=[];var _0x301afd=[];var _0x993553=squel['select']();_0x993553[_0x58a2('0x5d')](_0x58a2('0x5e'))[_0x58a2('0x5f')]('team_has_chat_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x58a2('0x60'),_0x3da9fc[_0x58a2('0x3d')]['id']);for(var _0x103ca0=0x0;_0x103ca0<_0x3b03f6[_0x58a2('0x40')];_0x103ca0+=0x1){let _0x4371fc=_0x3b03f6[_0x103ca0];for(var _0x1958a7=0x0;_0x1958a7<_0x4371fc[_0x58a2('0x53')][_0x58a2('0x40')];_0x1958a7+=0x1){let _0x48d0e1=_0x4371fc[_0x58a2('0x53')][_0x1958a7];var _0x15642b=_0x993553['clone']();_0x15642b[_0x58a2('0x26')](_0x58a2('0x61'),_0x48d0e1['id']);_0x301afd[_0x58a2('0x62')](db[_0x58a2('0x57')][_0x58a2('0x28')](_0x15642b['toString'](),{'type':db[_0x58a2('0x57')][_0x58a2('0x63')][_0x58a2('0x64')]})[_0x58a2('0x15')](function(_0x106ba3){if(_0x106ba3[_0x58a2('0x40')]===0x1){return _0x48d0e1['id'];}else{var _0x4c623b=_[_0x58a2('0x65')](_[_0x58a2('0x1f')](_0x106ba3,_0x58a2('0x66')),function(_0x1704aa){return _[_0x58a2('0x67')](_0x51a593,_0x1704aa);});if(_0x4c623b){return _0x48d0e1['id'];}}}));}}return BPromise[_0x58a2('0x68')](_0x301afd)[_0x58a2('0x15')](function(_0x2b381f){_0xed6d92=_(_0xed6d92)[_0x58a2('0x69')](_0x2b381f)['compact']()['value']();return db[_0x58a2('0x20')][_0x58a2('0x34')]({'where':{'id':_0x3da9fc['params']['id']}})['then'](function(_0xf3b157){return db[_0x58a2('0x57')][_0x58a2('0x6a')](function(_0x4483e5){return _0xf3b157[_0x58a2('0x5c')](_0x3da9fc[_0x58a2('0x28')][_0x58a2('0x51')],{'transaction':_0x4483e5})['then'](function(){if(!_[_0x58a2('0x6b')](_0xed6d92)){return _0xf3b157[_0x58a2('0x6c')](_0xed6d92,{'transaction':_0x4483e5});}})[_0x58a2('0x15')](function(){_0xed6d92['forEach'](function(_0x1b0ec7){socket[_0x58a2('0x6d')](_0x58a2('0x6e'),{'UserId':_0x1b0ec7,'ChatQueueId':_0xf3b157['id']});});});});});});})[_0x58a2('0x15')](respondWithStatusCode(_0x47efb4,null))[_0x58a2('0x2b')](handleError(_0x47efb4,null));};exports['addAgents']=function(_0x510463,_0x33e19a){return db['ChatQueue']['find']({'where':{'id':_0x510463[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x33e19a,null))['then'](function(_0x200108){if(_0x200108){return _0x200108['addAgents'](_0x510463[_0x58a2('0x36')][_0x58a2('0x51')],_[_0x58a2('0x6f')](_0x510463[_0x58a2('0x36')],['ids','id'])||{})[_0x58a2('0x70')](function(_0x713134){for(var _0x2bb710=0x0;_0x2bb710<_0x510463['body'][_0x58a2('0x51')]['length'];_0x2bb710+=0x1){socket[_0x58a2('0x6d')](_0x58a2('0x5b'),{'UserId':Number(_0x510463[_0x58a2('0x36')][_0x58a2('0x51')][_0x2bb710]),'ChatQueueId':Number(_0x510463[_0x58a2('0x3d')]['id'])});}return _0x713134;});}})['then'](respondWithResult(_0x33e19a,null))[_0x58a2('0x2b')](handleError(_0x33e19a,null));};exports[_0x58a2('0x6c')]=function(_0x1da349,_0x3f6905){return db[_0x58a2('0x20')]['find']({'where':{'id':_0x1da349[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x3f6905,null))[_0x58a2('0x15')](function(_0x426f93){if(_0x426f93){return _0x426f93[_0x58a2('0x6c')](_0x1da349[_0x58a2('0x28')]['ids'])['then'](function(){if(_[_0x58a2('0x71')](_0x1da349[_0x58a2('0x28')][_0x58a2('0x51')])){for(var _0x3dd624=0x0;_0x3dd624<_0x1da349['query'][_0x58a2('0x51')][_0x58a2('0x40')];_0x3dd624+=0x1){socket[_0x58a2('0x6d')](_0x58a2('0x6e'),{'UserId':Number(_0x1da349[_0x58a2('0x28')][_0x58a2('0x51')][_0x3dd624]),'ChatQueueId':Number(_0x1da349[_0x58a2('0x3d')]['id'])});}}else{socket[_0x58a2('0x6d')](_0x58a2('0x6e'),{'UserId':Number(_0x1da349[_0x58a2('0x28')][_0x58a2('0x51')]),'ChatQueueId':Number(_0x1da349[_0x58a2('0x3d')]['id'])});}});}})[_0x58a2('0x15')](respondWithStatusCode(_0x3f6905,null))[_0x58a2('0x2b')](handleError(_0x3f6905,null));};exports[_0x58a2('0x72')]=function(_0x59866c,_0x49f3e0){var _0x3c020e={};var _0x257131={};var _0x28f0d7;var _0x3e3757;return db[_0x58a2('0x20')][_0x58a2('0x3f')]({'where':{'id':_0x59866c[_0x58a2('0x3d')]['id']}})[_0x58a2('0x15')](handleEntityNotFound(_0x49f3e0,null))[_0x58a2('0x15')](function(_0x238396){if(_0x238396){_0x28f0d7=_0x238396;_0x257131[_0x58a2('0x2d')]=_[_0x58a2('0x2e')](db[_0x58a2('0x52')][_0x58a2('0x21')]);_0x257131[_0x58a2('0x28')]=_[_0x58a2('0x2e')](_0x59866c[_0x58a2('0x28')]);_0x257131[_0x58a2('0x44')]=_[_0x58a2('0x2f')](_0x257131[_0x58a2('0x2d')],_0x257131[_0x58a2('0x28')]);_0x3c020e[_0x58a2('0x31')]=_[_0x58a2('0x2f')](_0x257131[_0x58a2('0x2d')],qs[_0x58a2('0x30')](_0x59866c['query']['fields']));_0x3c020e[_0x58a2('0x31')]=_0x3c020e[_0x58a2('0x31')][_0x58a2('0x40')]?_0x3c020e[_0x58a2('0x31')]:_0x257131[_0x58a2('0x2d')];_0x3c020e[_0x58a2('0x42')]=qs[_0x58a2('0x43')](_0x59866c[_0x58a2('0x28')]['sort']);_0x3c020e[_0x58a2('0x26')]=qs['filters'](_[_0x58a2('0x45')](_0x59866c['query'],_0x257131[_0x58a2('0x44')]));if(_0x59866c[_0x58a2('0x28')]['filter']){_0x3c020e['where']=_[_0x58a2('0x32')](_0x3c020e['where'],{'$or':_[_0x58a2('0x1f')](_0x3c020e[_0x58a2('0x31')],function(_0x5cbfb){var _0xe08006={};_0xe08006[_0x5cbfb]={'$like':'%'+_0x59866c['query'][_0x58a2('0x50')]+'%'};return _0xe08006;})});}_0x3c020e=_[_0x58a2('0x32')]({},_0x3c020e,_0x59866c[_0x58a2('0x33')]);return _0x28f0d7[_0x58a2('0x72')](_0x3c020e);}})[_0x58a2('0x15')](function(_0x5dc26c){if(_0x5dc26c){_0x3e3757=_0x5dc26c[_0x58a2('0x40')];if(!_0x59866c[_0x58a2('0x28')]['hasOwnProperty'](_0x58a2('0x41'))){_0x3c020e[_0x58a2('0x13')]=qs[_0x58a2('0x13')](_0x59866c['query']['limit']);_0x3c020e[_0x58a2('0x10')]=qs[_0x58a2('0x10')](_0x59866c[_0x58a2('0x28')][_0x58a2('0x10')]);}return _0x28f0d7[_0x58a2('0x72')](_0x3c020e);}})[_0x58a2('0x15')](function(_0x2fb75c){if(_0x2fb75c){return _0x2fb75c?{'count':_0x3e3757,'rows':_0x2fb75c}:null;}})[_0x58a2('0x15')](respondWithResult(_0x49f3e0,null))['catch'](handleError(_0x49f3e0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e889d14..c2972a2 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 _0xa33b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xa33b,0x68));var _0xba33=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xa33b[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0xba33('0x0'));var ChatQueue=require(_0xba33('0x1'))['db'][_0xba33('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xba33('0x3')](0x0);var events={'afterCreate':_0xba33('0x4'),'afterUpdate':_0xba33('0x5'),'afterDestroy':_0xba33('0x6')};function emitEvent(_0x289106){return function(_0x24c0ea,_0x5cc658,_0x296b61){ChatQueueEvents['emit'](_0x289106+':'+_0x24c0ea['id'],_0x24c0ea);ChatQueueEvents[_0xba33('0x7')](_0x289106,_0x24c0ea);_0x296b61(null);};}for(var e in events){if(events[_0xba33('0x8')](e)){var event=events[e];ChatQueue[_0xba33('0x9')](e,emitEvent(event));}}module[_0xba33('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0xa001=['events','../../mysqldb','setMaxListeners','update','emit','hook','exports'];(function(_0x2f8cd9,_0x3c07da){var _0x21554b=function(_0x10e2d5){while(--_0x10e2d5){_0x2f8cd9['push'](_0x2f8cd9['shift']());}};_0x21554b(++_0x3c07da);}(_0xa001,0x93));var _0x1a00=function(_0xdf58ed,_0x1de90e){_0xdf58ed=_0xdf58ed-0x0;var _0x374120=_0xa001[_0xdf58ed];return _0x374120;};'use strict';var EventEmitter=require(_0x1a00('0x0'));var ChatQueue=require(_0x1a00('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1a00('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a00('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50afe8){return function(_0x52b9df,_0x17d4e9,_0x4ca9cc){ChatQueueEvents[_0x1a00('0x4')](_0x50afe8+':'+_0x52b9df['id'],_0x52b9df);ChatQueueEvents['emit'](_0x50afe8,_0x52b9df);_0x4ca9cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1a00('0x5')](e,emitEvent(event));}}module[_0x1a00('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 6be0aee..069bb88 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 _0xae72=['./chatQueue.attributes','define','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae72,0x121));var _0x2ae7=function(_0x546261,_0x44b70f){_0x546261=_0x546261-0x0;var _0x1c6263=_0xae72[_0x546261];return _0x1c6263;};'use strict';var _=require(_0x2ae7('0x0'));var util=require(_0x2ae7('0x1'));var logger=require(_0x2ae7('0x2'))(_0x2ae7('0x3'));var moment=require(_0x2ae7('0x4'));var BPromise=require(_0x2ae7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ae7('0x6'));var rimraf=require('rimraf');var config=require(_0x2ae7('0x7'));var attributes=require(_0x2ae7('0x8'));module['exports']=function(_0x704d5,_0x772274){return _0x704d5[_0x2ae7('0x9')](_0x2ae7('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc791=['chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc791,0x1e1));var _0x1c79=function(_0x27c741,_0x4bab7c){_0x27c741=_0x27c741-0x0;var _0x353e2b=_0xc791[_0x27c741];return _0x353e2b;};'use strict';var _=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var logger=require('../../config/logger')(_0x1c79('0x2'));var moment=require(_0x1c79('0x3'));var BPromise=require(_0x1c79('0x4'));var rp=require(_0x1c79('0x5'));var fs=require('fs');var path=require(_0x1c79('0x6'));var rimraf=require(_0x1c79('0x7'));var config=require(_0x1c79('0x8'));var attributes=require(_0x1c79('0x9'));module[_0x1c79('0xa')]=function(_0x3b50ec,_0x5d12a8){return _0x3b50ec['define']('ChatQueue',attributes,{'tableName':_0x1c79('0xb'),'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 19a09cf..bd74cda 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 _0x8a2a=['result','catch','GetChatQueue','ChatQueue','findAll','options','raw','include','map','model','attributes','ShowChatQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x11c244,_0x1b1aa4){var _0x1c8d70=function(_0x386070){while(--_0x386070){_0x11c244['push'](_0x11c244['shift']());}};_0x1c8d70(++_0x1b1aa4);}(_0x8a2a,0x11f));var _0xa8a2=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x8a2a[_0x403c20];return _0x2b271a;};'use strict';var _=require('lodash');var util=require(_0xa8a2('0x0'));var moment=require(_0xa8a2('0x1'));var BPromise=require(_0xa8a2('0x2'));var rs=require(_0xa8a2('0x3'));var fs=require('fs');var Redis=require(_0xa8a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8a2('0x5'));var logger=require(_0xa8a2('0x6'))(_0xa8a2('0x7'));var config=require(_0xa8a2('0x8'));var jayson=require(_0xa8a2('0x9'));var client=jayson[_0xa8a2('0xa')][_0xa8a2('0xb')]({'port':0x232a});config[_0xa8a2('0xc')]=_['defaults'](config[_0xa8a2('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa8a2('0xd'))[_0xa8a2('0xe')](socket);function respondWithRpcPromise(_0x33c48c,_0x59a522,_0x45702c){return new BPromise(function(_0x394813,_0x4624c4){return client[_0xa8a2('0xf')](_0x33c48c,_0x45702c)[_0xa8a2('0x10')](function(_0x28ab32){logger['info'](_0xa8a2('0x11'),_0x59a522,_0xa8a2('0x12'));logger[_0xa8a2('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x59a522,_0xa8a2('0x12'),JSON[_0xa8a2('0x14')](_0x28ab32));if(_0x28ab32[_0xa8a2('0x15')]){if(_0x28ab32[_0xa8a2('0x15')][_0xa8a2('0x16')]===0x1f4){logger[_0xa8a2('0x15')](_0xa8a2('0x11'),_0x59a522,_0x28ab32['error'][_0xa8a2('0x17')]);return _0x4624c4(_0x28ab32[_0xa8a2('0x15')][_0xa8a2('0x17')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x59a522,_0x28ab32[_0xa8a2('0x15')][_0xa8a2('0x17')]);return _0x394813(_0x28ab32[_0xa8a2('0x15')][_0xa8a2('0x17')]);}else{logger[_0xa8a2('0x18')](_0xa8a2('0x11'),_0x59a522,_0xa8a2('0x12'));_0x394813(_0x28ab32[_0xa8a2('0x19')]['message']);}})[_0xa8a2('0x1a')](function(_0x391f87){logger[_0xa8a2('0x15')]('ChatQueue,\x20%s,\x20%s',_0x59a522,_0x391f87);_0x4624c4(_0x391f87);});});}exports[_0xa8a2('0x1b')]=function(_0x1b33dd){var _0x10aa02=this;return new Promise(function(_0x30ee45,_0x4cb363){return db[_0xa8a2('0x1c')][_0xa8a2('0x1d')]({'raw':_0x1b33dd[_0xa8a2('0x1e')]?_0x1b33dd[_0xa8a2('0x1e')][_0xa8a2('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b33dd[_0xa8a2('0x1e')]?_0x1b33dd[_0xa8a2('0x1e')]['where']||null:null,'attributes':_0x1b33dd[_0xa8a2('0x1e')]?_0x1b33dd[_0xa8a2('0x1e')]['attributes']||null:null,'limit':_0x1b33dd[_0xa8a2('0x1e')]?_0x1b33dd[_0xa8a2('0x1e')]['limit']||null:null,'include':_0x1b33dd['options']?_0x1b33dd['options'][_0xa8a2('0x20')]?_[_0xa8a2('0x21')](_0x1b33dd[_0xa8a2('0x1e')][_0xa8a2('0x20')],function(_0x293786){return{'model':db[_0x293786[_0xa8a2('0x22')]],'as':_0x293786['as'],'attributes':_0x293786[_0xa8a2('0x23')],'include':_0x293786[_0xa8a2('0x20')]?_['map'](_0x293786['include'],function(_0x4aeec1){return{'model':db[_0x4aeec1[_0xa8a2('0x22')]],'as':_0x4aeec1['as'],'attributes':_0x4aeec1[_0xa8a2('0x23')],'include':_0x4aeec1[_0xa8a2('0x20')]?_[_0xa8a2('0x21')](_0x4aeec1[_0xa8a2('0x20')],function(_0x49a4c5){return{'model':db[_0x49a4c5[_0xa8a2('0x22')]],'as':_0x49a4c5['as'],'attributes':_0x49a4c5[_0xa8a2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa8a2('0x10')](function(_0x4b6d3b){logger['info']('GetChatQueue',_0x1b33dd);logger[_0xa8a2('0x13')]('GetChatQueue',_0x1b33dd,JSON[_0xa8a2('0x14')](_0x4b6d3b));_0x30ee45(_0x4b6d3b);})[_0xa8a2('0x1a')](function(_0x266076){logger[_0xa8a2('0x15')]('GetChatQueue',_0x266076[_0xa8a2('0x17')],_0x1b33dd);_0x4cb363(_0x10aa02[_0xa8a2('0x15')](0x1f4,_0x266076[_0xa8a2('0x17')]));});});};exports[_0xa8a2('0x24')]=function(_0x2fa1a4){var _0x2381dd=this;return new Promise(function(_0x303222,_0x426f26){return db[_0xa8a2('0x1c')][_0xa8a2('0x25')]({'raw':_0x2fa1a4[_0xa8a2('0x1e')]?_0x2fa1a4[_0xa8a2('0x1e')][_0xa8a2('0x1f')]===undefined?!![]:![]:!![],'where':_0x2fa1a4['options']?_0x2fa1a4[_0xa8a2('0x1e')][_0xa8a2('0x26')]||null:null,'attributes':_0x2fa1a4['options']?_0x2fa1a4[_0xa8a2('0x1e')][_0xa8a2('0x23')]||null:null,'include':_0x2fa1a4['options']?_0x2fa1a4[_0xa8a2('0x1e')][_0xa8a2('0x20')]?_[_0xa8a2('0x21')](_0x2fa1a4[_0xa8a2('0x1e')][_0xa8a2('0x20')],function(_0x5dc00e){return{'model':db[_0x5dc00e[_0xa8a2('0x22')]],'as':_0x5dc00e['as'],'attributes':_0x5dc00e[_0xa8a2('0x23')],'include':_0x5dc00e['include']?_[_0xa8a2('0x21')](_0x5dc00e['include'],function(_0x5c1b1f){return{'model':db[_0x5c1b1f[_0xa8a2('0x22')]],'as':_0x5c1b1f['as'],'attributes':_0x5c1b1f[_0xa8a2('0x23')],'include':_0x5c1b1f[_0xa8a2('0x20')]?_[_0xa8a2('0x21')](_0x5c1b1f['include'],function(_0x4a0bf4){return{'model':db[_0x4a0bf4['model']],'as':_0x4a0bf4['as'],'attributes':_0x4a0bf4['attributes']};}):[]};}):[]};}):[]:[]})[_0xa8a2('0x10')](function(_0x1a68aa){logger[_0xa8a2('0x18')](_0xa8a2('0x24'),_0x2fa1a4);logger[_0xa8a2('0x13')](_0xa8a2('0x24'),_0x2fa1a4,JSON['stringify'](_0x1a68aa));_0x303222(_0x1a68aa);})[_0xa8a2('0x1a')](function(_0x46df49){logger[_0xa8a2('0x15')](_0xa8a2('0x24'),_0x46df49[_0xa8a2('0x17')],_0x2fa1a4);_0x426f26(_0x2381dd[_0xa8a2('0x15')](0x1f4,_0x46df49['message']));});});};
\ No newline at end of file
+var _0x404d=['register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','find','ShowChatQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x34273d,_0x4cee59){var _0xd7efeb=function(_0x1491c0){while(--_0x1491c0){_0x34273d['push'](_0x34273d['shift']());}};_0xd7efeb(++_0x4cee59);}(_0x404d,0x1e9));var _0xd404=function(_0x4a652a,_0x20a238){_0x4a652a=_0x4a652a-0x0;var _0x13a67e=_0x404d[_0x4a652a];return _0x13a67e;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});config[_0xd404('0xc')]=_['defaults'](config['redis'],{'host':_0xd404('0xd'),'port':0x18eb});var socket=require(_0xd404('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xd404('0xf')](socket);function respondWithRpcPromise(_0x1b99d2,_0x3a1a89,_0xb018fc){return new BPromise(function(_0x5d3faf,_0x4b60f2){return client[_0xd404('0x10')](_0x1b99d2,_0xb018fc)[_0xd404('0x11')](function(_0x569542){logger[_0xd404('0x12')](_0xd404('0x13'),_0x3a1a89,_0xd404('0x14'));logger[_0xd404('0x15')](_0xd404('0x16'),_0x3a1a89,_0xd404('0x14'),JSON[_0xd404('0x17')](_0x569542));if(_0x569542[_0xd404('0x18')]){if(_0x569542[_0xd404('0x18')][_0xd404('0x19')]===0x1f4){logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);return _0x4b60f2(_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);}logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x569542[_0xd404('0x18')][_0xd404('0x1a')]);return _0x5d3faf(_0x569542[_0xd404('0x18')]['message']);}else{logger[_0xd404('0x12')](_0xd404('0x13'),_0x3a1a89,'request\x20sent');_0x5d3faf(_0x569542[_0xd404('0x1b')][_0xd404('0x1a')]);}})['catch'](function(_0x209a6b){logger[_0xd404('0x18')](_0xd404('0x13'),_0x3a1a89,_0x209a6b);_0x4b60f2(_0x209a6b);});});}exports['GetChatQueue']=function(_0x2fd888){var _0x399a06=this;return new Promise(function(_0x27d9a1,_0x3e8183){return db[_0xd404('0x1c')][_0xd404('0x1d')]({'raw':_0x2fd888[_0xd404('0x1e')]?_0x2fd888['options'][_0xd404('0x1f')]===undefined?!![]:![]:!![],'where':_0x2fd888[_0xd404('0x1e')]?_0x2fd888['options'][_0xd404('0x20')]||null:null,'attributes':_0x2fd888['options']?_0x2fd888['options'][_0xd404('0x21')]||null:null,'limit':_0x2fd888[_0xd404('0x1e')]?_0x2fd888[_0xd404('0x1e')][_0xd404('0x22')]||null:null,'include':_0x2fd888['options']?_0x2fd888[_0xd404('0x1e')][_0xd404('0x23')]?_[_0xd404('0x24')](_0x2fd888['options']['include'],function(_0x3e706a){return{'model':db[_0x3e706a[_0xd404('0x25')]],'as':_0x3e706a['as'],'attributes':_0x3e706a[_0xd404('0x21')],'include':_0x3e706a[_0xd404('0x23')]?_[_0xd404('0x24')](_0x3e706a[_0xd404('0x23')],function(_0x256277){return{'model':db[_0x256277[_0xd404('0x25')]],'as':_0x256277['as'],'attributes':_0x256277['attributes'],'include':_0x256277['include']?_[_0xd404('0x24')](_0x256277['include'],function(_0x2b14ec){return{'model':db[_0x2b14ec['model']],'as':_0x2b14ec['as'],'attributes':_0x2b14ec[_0xd404('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd404('0x11')](function(_0x3e746e){logger[_0xd404('0x12')](_0xd404('0x26'),_0x2fd888);logger[_0xd404('0x15')](_0xd404('0x26'),_0x2fd888,JSON['stringify'](_0x3e746e));_0x27d9a1(_0x3e746e);})['catch'](function(_0xc60d87){logger['error']('GetChatQueue',_0xc60d87[_0xd404('0x1a')],_0x2fd888);_0x3e8183(_0x399a06[_0xd404('0x18')](0x1f4,_0xc60d87[_0xd404('0x1a')]));});});};exports['ShowChatQueue']=function(_0x63430e){var _0x54f0c5=this;return new Promise(function(_0x2ee9b3,_0x1de7b9){return db['ChatQueue'][_0xd404('0x27')]({'raw':_0x63430e[_0xd404('0x1e')]?_0x63430e[_0xd404('0x1e')][_0xd404('0x1f')]===undefined?!![]:![]:!![],'where':_0x63430e[_0xd404('0x1e')]?_0x63430e['options'][_0xd404('0x20')]||null:null,'attributes':_0x63430e[_0xd404('0x1e')]?_0x63430e[_0xd404('0x1e')]['attributes']||null:null,'include':_0x63430e[_0xd404('0x1e')]?_0x63430e[_0xd404('0x1e')][_0xd404('0x23')]?_[_0xd404('0x24')](_0x63430e['options']['include'],function(_0x2551b5){return{'model':db[_0x2551b5[_0xd404('0x25')]],'as':_0x2551b5['as'],'attributes':_0x2551b5[_0xd404('0x21')],'include':_0x2551b5[_0xd404('0x23')]?_[_0xd404('0x24')](_0x2551b5[_0xd404('0x23')],function(_0x50d8ef){return{'model':db[_0x50d8ef[_0xd404('0x25')]],'as':_0x50d8ef['as'],'attributes':_0x50d8ef[_0xd404('0x21')],'include':_0x50d8ef[_0xd404('0x23')]?_['map'](_0x50d8ef[_0xd404('0x23')],function(_0x2e0786){return{'model':db[_0x2e0786[_0xd404('0x25')]],'as':_0x2e0786['as'],'attributes':_0x2e0786['attributes']};}):[]};}):[]};}):[]:[]})[_0xd404('0x11')](function(_0x21111e){logger[_0xd404('0x12')]('ShowChatQueue',_0x63430e);logger[_0xd404('0x15')](_0xd404('0x28'),_0x63430e,JSON['stringify'](_0x21111e));_0x2ee9b3(_0x21111e);})[_0xd404('0x29')](function(_0x128da0){logger[_0xd404('0x18')](_0xd404('0x28'),_0x128da0[_0xd404('0x1a')],_0x63430e);_0x1de7b9(_0x54f0c5[_0xd404('0x18')](0x1f4,_0x128da0[_0xd404('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 9f03e87..c534b3b 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 _0x0ba7=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x42567e,_0x55f60f){var _0x2ee88b=function(_0x558ef0){while(--_0x558ef0){_0x42567e['push'](_0x42567e['shift']());}};_0x2ee88b(++_0x55f60f);}(_0x0ba7,0x16d));var _0x70ba=function(_0x92f0d8,_0x191821){_0x92f0d8=_0x92f0d8-0x0;var _0x4674fe=_0x0ba7[_0x92f0d8];return _0x4674fe;};'use strict';var ChatQueueEvents=require(_0x70ba('0x0'));var events=['save',_0x70ba('0x1'),_0x70ba('0x2')];function createListener(_0xadfc69,_0x42d93c){return function(_0x5e5368){_0x42d93c[_0x70ba('0x3')](_0xadfc69,_0x5e5368);};}function removeListener(_0x3e20ab,_0x3cb2e3){return function(){ChatQueueEvents[_0x70ba('0x4')](_0x3e20ab,_0x3cb2e3);};}exports[_0x70ba('0x5')]=function(_0x3f9877){for(var _0x17a00c=0x0,_0x2d5a16=events[_0x70ba('0x6')];_0x17a00c<_0x2d5a16;_0x17a00c++){var _0x1185cb=events[_0x17a00c];var _0x1a968b=createListener(_0x70ba('0x7')+_0x1185cb,_0x3f9877);ChatQueueEvents['on'](_0x1185cb,_0x1a968b);}};
\ No newline at end of file
+var _0x9b9b=['save','emit','removeListener','register','length','chatQueue:'];(function(_0x43a327,_0xb19748){var _0x4a6d7e=function(_0x219643){while(--_0x219643){_0x43a327['push'](_0x43a327['shift']());}};_0x4a6d7e(++_0xb19748);}(_0x9b9b,0x114));var _0xb9b9=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x9b9b[_0x2675da];return _0x5e6153;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xb9b9('0x0'),'remove','update'];function createListener(_0x2ae8a0,_0x153734){return function(_0x1adf50){_0x153734[_0xb9b9('0x1')](_0x2ae8a0,_0x1adf50);};}function removeListener(_0x1d6ab6,_0x43c8ff){return function(){ChatQueueEvents[_0xb9b9('0x2')](_0x1d6ab6,_0x43c8ff);};}exports[_0xb9b9('0x3')]=function(_0x79dd){for(var _0x3d1a95=0x0,_0x85eec=events[_0xb9b9('0x4')];_0x3d1a95<_0x85eec;_0x3d1a95++){var _0x5be5bc=events[_0x3d1a95];var _0x297cb6=createListener(_0xb9b9('0x5')+_0x5be5bc,_0x79dd);ChatQueueEvents['on'](_0x5be5bc,_0x297cb6);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 16e0094..64f9ed1 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 _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(_0x21f151,_0xea1bc3){_0x21f151=_0x21f151-0x0;var _0x33f986=_0x3e74[_0x21f151];return _0x33f986;};'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
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x935c9c,_0x56f0b7){var _0x10dfad=function(_0x54af8e){while(--_0x54af8e){_0x935c9c['push'](_0x935c9c['shift']());}};_0x10dfad(++_0x56f0b7);}(_0x55ca,0x126));var _0xa55c=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x55ca[_0x3b2369];return _0x5a1367;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 412b5d5..289d7ae 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 _0xc46f=['exports','DATE','moment'];(function(_0x205401,_0x3832c4){var _0x569ec1=function(_0x21d59f){while(--_0x21d59f){_0x205401['push'](_0x205401['shift']());}};_0x569ec1(++_0x3832c4);}(_0xc46f,0x158));var _0xfc46=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc46f[_0x199572];return _0x13cfa3;};'use strict';var moment=require(_0xfc46('0x0'));var Sequelize=require('sequelize');module[_0xfc46('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfc46('0x2')]},'leaveAt':{'type':Sequelize[_0xfc46('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfc46('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2c19=['exports','STRING','DATE','moment','sequelize'];(function(_0x591875,_0x195f1d){var _0x51778e=function(_0x3c28b0){while(--_0x3c28b0){_0x591875['push'](_0x591875['shift']());}};_0x51778e(++_0x195f1d);}(_0x2c19,0x17a));var _0x92c1=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2c19[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0x92c1('0x0'));var Sequelize=require(_0x92c1('0x1'));module[_0x92c1('0x2')]={'uniqueid':{'type':Sequelize[_0x92c1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x92c1('0x4')]},'acceptAt':{'type':Sequelize[_0x92c1('0x4')]},'exitAt':{'type':Sequelize[_0x92c1('0x4')]},'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 13638b0..d423ad8 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 _0x15b2=['limit','count','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','ChatQueueReport','rawAttributes','fieldName','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','merge','map','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','model','intersection','options','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x15b2,0x145));var _0x215b=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x15b2[_0x15dbca];return _0x326533;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x215b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x215b('0x1'));var rp=require(_0x215b('0x2'));var moment=require('moment');var BPromise=require(_0x215b('0x3'));var Mustache=require(_0x215b('0x4'));var util=require(_0x215b('0x5'));var path=require(_0x215b('0x6'));var sox=require('sox');var csv=require(_0x215b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x215b('0x8'));var _=require(_0x215b('0x9'));var squel=require(_0x215b('0xa'));var crypto=require(_0x215b('0xb'));var jsforce=require(_0x215b('0xc'));var deskjs=require(_0x215b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x215b('0xe'));var Papa=require(_0x215b('0xf'));var Redis=require('ioredis');var authService=require(_0x215b('0x10'));var qs=require(_0x215b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x215b('0x12'))('api');var utils=require(_0x215b('0x13'));var config=require(_0x215b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x215b('0x15'))['db'];function respondWithStatusCode(_0x49a9cc,_0x4a9360){_0x4a9360=_0x4a9360||0xcc;return function(_0x1cf40c){if(_0x1cf40c){return _0x49a9cc['sendStatus'](_0x4a9360);}return _0x49a9cc[_0x215b('0x16')](_0x4a9360)['end']();};}function respondWithResult(_0x2aa945,_0xc1d4d1){_0xc1d4d1=_0xc1d4d1||0xc8;return function(_0x38d765){if(_0x38d765){return _0x2aa945['status'](_0xc1d4d1)['json'](_0x38d765);}};}function respondWithFilteredResult(_0x4c39d1,_0x1006fe){return function(_0x1c4030){if(_0x1c4030){var _0x2d04cb=typeof _0x1006fe[_0x215b('0x17')]===_0x215b('0x18')&&typeof _0x1006fe[_0x215b('0x19')]===_0x215b('0x18');var _0x4a27aa=_0x1c4030[_0x215b('0x1a')];var _0x2ca496=_0x2d04cb?0x0:_0x1006fe[_0x215b('0x17')];var _0x37248f=_0x2d04cb?_0x1c4030[_0x215b('0x1a')]:_0x1006fe[_0x215b('0x17')]+_0x1006fe[_0x215b('0x19')];var _0x2a1921;if(_0x37248f>=_0x4a27aa){_0x37248f=_0x4a27aa;_0x2a1921=0xc8;}else{_0x2a1921=0xce;}_0x4c39d1['status'](_0x2a1921);return _0x4c39d1['set'](_0x215b('0x1b'),_0x2ca496+'-'+_0x37248f+'/'+_0x4a27aa)['json'](_0x1c4030);}return null;};}function patchUpdates(_0x16732d){return function(_0xac9792){try{jsonpatch[_0x215b('0x1c')](_0xac9792,_0x16732d,!![]);}catch(_0x303c89){return BPromise[_0x215b('0x1d')](_0x303c89);}return _0xac9792[_0x215b('0x1e')]();};}function saveUpdates(_0x7e413c,_0x1a41c0){return function(_0x5cce5d){if(_0x5cce5d){return _0x5cce5d['update'](_0x7e413c)[_0x215b('0x1f')](function(_0x515a5c){return _0x515a5c;});}return null;};}function removeEntity(_0x24386b,_0x267af9){return function(_0x48568a){if(_0x48568a){return _0x48568a[_0x215b('0x20')]()['then'](function(){_0x24386b[_0x215b('0x16')](0xcc)[_0x215b('0x21')]();});}};}function handleEntityNotFound(_0x1b7c12,_0x245a36){return function(_0x1f30b1){if(!_0x1f30b1){_0x1b7c12[_0x215b('0x22')](0x194);}return _0x1f30b1;};}function handleError(_0x29c05e,_0x19fc6f){_0x19fc6f=_0x19fc6f||0x1f4;return function(_0x49dc3d){logger[_0x215b('0x23')](_0x49dc3d[_0x215b('0x24')]);if(_0x49dc3d['name']){delete _0x49dc3d[_0x215b('0x25')];}_0x29c05e[_0x215b('0x16')](_0x19fc6f)[_0x215b('0x26')](_0x49dc3d);};}exports['index']=function(_0x23ffca,_0x41b373){var _0x1471a9={},_0x2038d9={},_0x8dea4c={'count':0x0,'rows':[]};var _0xca5e4a=_['map'](db[_0x215b('0x27')][_0x215b('0x28')],function(_0x1f59dc){return{'name':_0x1f59dc[_0x215b('0x29')],'type':_0x1f59dc['type']['key']};});_0x2038d9['model']=_['map'](_0xca5e4a,'name');_0x2038d9[_0x215b('0x2a')]=_[_0x215b('0x2b')](_0x23ffca[_0x215b('0x2a')]);_0x2038d9[_0x215b('0x2c')]=_['intersection'](_0x2038d9['model'],_0x2038d9['query']);_0x1471a9[_0x215b('0x2d')]=_['intersection'](_0x2038d9['model'],qs[_0x215b('0x2e')](_0x23ffca[_0x215b('0x2a')][_0x215b('0x2e')]));_0x1471a9['attributes']=_0x1471a9[_0x215b('0x2d')][_0x215b('0x2f')]?_0x1471a9['attributes']:_0x2038d9['model'];if(!_0x23ffca[_0x215b('0x2a')]['hasOwnProperty'](_0x215b('0x30'))){_0x1471a9['limit']=qs['limit'](_0x23ffca[_0x215b('0x2a')][_0x215b('0x19')]);_0x1471a9[_0x215b('0x17')]=qs['offset'](_0x23ffca[_0x215b('0x2a')]['offset']);}_0x1471a9['order']=qs[_0x215b('0x31')](_0x23ffca[_0x215b('0x2a')][_0x215b('0x31')]);_0x1471a9[_0x215b('0x32')]=qs[_0x215b('0x2c')](_[_0x215b('0x33')](_0x23ffca['query'],_0x2038d9[_0x215b('0x2c')]),_0xca5e4a);if(_0x23ffca[_0x215b('0x2a')]['filter']){_0x1471a9[_0x215b('0x32')]=_[_0x215b('0x34')](_0x1471a9[_0x215b('0x32')],{'$or':_[_0x215b('0x35')](_0xca5e4a,function(_0x48ecbc){if(_0x48ecbc[_0x215b('0x36')]!==_0x215b('0x37')){var _0x365373={};_0x365373[_0x48ecbc[_0x215b('0x25')]]={'$like':'%'+_0x23ffca[_0x215b('0x2a')][_0x215b('0x38')]+'%'};return _0x365373;}})});}_0x1471a9=_['merge']({},_0x1471a9,_0x23ffca['options']);var _0xae3e16={'where':_0x1471a9[_0x215b('0x32')]};return db['ChatQueueReport'][_0x215b('0x1a')](_0xae3e16)[_0x215b('0x1f')](function(_0x1cf253){_0x8dea4c['count']=_0x1cf253;if(_0x23ffca[_0x215b('0x2a')][_0x215b('0x39')]){_0x1471a9[_0x215b('0x3a')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x215b('0x3b')](_0x1471a9);})['then'](function(_0x5b366d){_0x8dea4c[_0x215b('0x3c')]=_0x5b366d;return _0x8dea4c;})[_0x215b('0x1f')](respondWithFilteredResult(_0x41b373,_0x1471a9))[_0x215b('0x3d')](handleError(_0x41b373,null));};exports['show']=function(_0xa8f48e,_0x20908e){var _0x782816={'raw':!![],'where':{'id':_0xa8f48e['params']['id']}},_0x20e51c={};_0x20e51c[_0x215b('0x3e')]=_[_0x215b('0x2b')](db[_0x215b('0x27')][_0x215b('0x28')]);_0x20e51c[_0x215b('0x2a')]=_['keys'](_0xa8f48e[_0x215b('0x2a')]);_0x20e51c['filters']=_[_0x215b('0x3f')](_0x20e51c['model'],_0x20e51c[_0x215b('0x2a')]);_0x782816[_0x215b('0x2d')]=_[_0x215b('0x3f')](_0x20e51c[_0x215b('0x3e')],qs[_0x215b('0x2e')](_0xa8f48e['query']['fields']));_0x782816[_0x215b('0x2d')]=_0x782816['attributes'][_0x215b('0x2f')]?_0x782816[_0x215b('0x2d')]:_0x20e51c[_0x215b('0x3e')];if(_0xa8f48e[_0x215b('0x2a')]['includeAll']){_0x782816[_0x215b('0x3a')]=[{'all':!![]}];}_0x782816=_[_0x215b('0x34')]({},_0x782816,_0xa8f48e[_0x215b('0x40')]);return db['ChatQueueReport'][_0x215b('0x41')](_0x782816)[_0x215b('0x1f')](handleEntityNotFound(_0x20908e,null))[_0x215b('0x1f')](respondWithResult(_0x20908e,null))[_0x215b('0x3d')](handleError(_0x20908e,null));};exports['create']=function(_0x42e026,_0x5230de){return db[_0x215b('0x27')][_0x215b('0x42')](_0x42e026['body'],{})[_0x215b('0x1f')](respondWithResult(_0x5230de,0xc9))[_0x215b('0x3d')](handleError(_0x5230de,null));};exports['update']=function(_0x533571,_0x3ee566){if(_0x533571[_0x215b('0x43')]['id']){delete _0x533571[_0x215b('0x43')]['id'];}return db['ChatQueueReport'][_0x215b('0x41')]({'where':{'id':_0x533571[_0x215b('0x44')]['id']}})[_0x215b('0x1f')](handleEntityNotFound(_0x3ee566,null))[_0x215b('0x1f')](saveUpdates(_0x533571['body'],null))[_0x215b('0x1f')](respondWithResult(_0x3ee566,null))['catch'](handleError(_0x3ee566,null));};exports[_0x215b('0x20')]=function(_0xf6517b,_0x3a0df2){return db['ChatQueueReport'][_0x215b('0x41')]({'where':{'id':_0xf6517b[_0x215b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a0df2,null))['then'](removeEntity(_0x3a0df2,null))[_0x215b('0x3d')](handleError(_0x3a0df2,null));};exports[_0x215b('0x45')]=function(_0x4fb7f7,_0x389f34){return db[_0x215b('0x27')][_0x215b('0x45')]()[_0x215b('0x1f')](respondWithResult(_0x389f34,null))[_0x215b('0x3d')](handleError(_0x389f34,null));};
\ No newline at end of file
+var _0x00cd=['find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params'];(function(_0x37aece,_0xdbfe91){var _0x34dd0b=function(_0x4533ec){while(--_0x4533ec){_0x37aece['push'](_0x37aece['shift']());}};_0x34dd0b(++_0xdbfe91);}(_0x00cd,0xee));var _0xd00c=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x00cd[_0x16a223];return _0x5ded66;};'use strict';var emlformat=require(_0xd00c('0x0'));var rimraf=require(_0xd00c('0x1'));var zipdir=require(_0xd00c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd00c('0x3'));var BPromise=require(_0xd00c('0x4'));var Mustache=require(_0xd00c('0x5'));var util=require(_0xd00c('0x6'));var path=require(_0xd00c('0x7'));var sox=require('sox');var csv=require(_0xd00c('0x8'));var ejs=require(_0xd00c('0x9'));var fs=require('fs');var fs_extra=require(_0xd00c('0xa'));var _=require(_0xd00c('0xb'));var squel=require(_0xd00c('0xc'));var crypto=require(_0xd00c('0xd'));var jsforce=require(_0xd00c('0xe'));var deskjs=require(_0xd00c('0xf'));var toCsv=require(_0xd00c('0x8'));var querystring=require(_0xd00c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd00c('0x11'));var qs=require(_0xd00c('0x12'));var as=require(_0xd00c('0x13'));var hardwareService=require(_0xd00c('0x14'));var logger=require('../../config/logger')(_0xd00c('0x15'));var utils=require('../../config/utils');var config=require(_0xd00c('0x16'));var licenseUtil=require(_0xd00c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49238e,_0x51f391){_0x51f391=_0x51f391||0xcc;return function(_0x4afd7d){if(_0x4afd7d){return _0x49238e[_0xd00c('0x18')](_0x51f391);}return _0x49238e[_0xd00c('0x19')](_0x51f391)[_0xd00c('0x1a')]();};}function respondWithResult(_0x4c0c0f,_0x24c12b){_0x24c12b=_0x24c12b||0xc8;return function(_0x5ed7e7){if(_0x5ed7e7){return _0x4c0c0f[_0xd00c('0x19')](_0x24c12b)[_0xd00c('0x1b')](_0x5ed7e7);}};}function respondWithFilteredResult(_0x3dc54d,_0x4a52b0){return function(_0x50b22e){if(_0x50b22e){var _0x41f67c=typeof _0x4a52b0[_0xd00c('0x1c')]===_0xd00c('0x1d')&&typeof _0x4a52b0[_0xd00c('0x1e')]===_0xd00c('0x1d');var _0x2a5531=_0x50b22e[_0xd00c('0x1f')];var _0x3864a9=_0x41f67c?0x0:_0x4a52b0['offset'];var _0x2b167a=_0x41f67c?_0x50b22e[_0xd00c('0x1f')]:_0x4a52b0[_0xd00c('0x1c')]+_0x4a52b0['limit'];var _0x541174;if(_0x2b167a>=_0x2a5531){_0x2b167a=_0x2a5531;_0x541174=0xc8;}else{_0x541174=0xce;}_0x3dc54d[_0xd00c('0x19')](_0x541174);return _0x3dc54d[_0xd00c('0x20')](_0xd00c('0x21'),_0x3864a9+'-'+_0x2b167a+'/'+_0x2a5531)[_0xd00c('0x1b')](_0x50b22e);}return null;};}function patchUpdates(_0xbced81){return function(_0x40a352){try{jsonpatch[_0xd00c('0x22')](_0x40a352,_0xbced81,!![]);}catch(_0x4ef9f8){return BPromise[_0xd00c('0x23')](_0x4ef9f8);}return _0x40a352[_0xd00c('0x24')]();};}function saveUpdates(_0x3a0b2f,_0x3807fb){return function(_0x10d08d){if(_0x10d08d){return _0x10d08d['update'](_0x3a0b2f)['then'](function(_0x27c892){return _0x27c892;});}return null;};}function removeEntity(_0x22b914,_0x5bcf19){return function(_0x4a6c84){if(_0x4a6c84){return _0x4a6c84['destroy']()[_0xd00c('0x25')](function(){_0x22b914['status'](0xcc)[_0xd00c('0x1a')]();});}};}function handleEntityNotFound(_0x4a918f,_0x25300a){return function(_0x276eef){if(!_0x276eef){_0x4a918f['sendStatus'](0x194);}return _0x276eef;};}function handleError(_0x4c78e9,_0x24f5c8){_0x24f5c8=_0x24f5c8||0x1f4;return function(_0x32e998){logger[_0xd00c('0x26')](_0x32e998[_0xd00c('0x27')]);if(_0x32e998['name']){delete _0x32e998[_0xd00c('0x28')];}_0x4c78e9[_0xd00c('0x19')](_0x24f5c8)[_0xd00c('0x29')](_0x32e998);};}exports[_0xd00c('0x2a')]=function(_0x4987c5,_0x17e58d){var _0x5bb7c4={},_0x3e7e2c={},_0x127a0b={'count':0x0,'rows':[]};var _0x291b71=_[_0xd00c('0x2b')](db[_0xd00c('0x2c')][_0xd00c('0x2d')],function(_0xbbbf0e){return{'name':_0xbbbf0e[_0xd00c('0x2e')],'type':_0xbbbf0e[_0xd00c('0x2f')][_0xd00c('0x30')]};});_0x3e7e2c[_0xd00c('0x31')]=_[_0xd00c('0x2b')](_0x291b71,_0xd00c('0x28'));_0x3e7e2c[_0xd00c('0x32')]=_[_0xd00c('0x33')](_0x4987c5[_0xd00c('0x32')]);_0x3e7e2c[_0xd00c('0x34')]=_[_0xd00c('0x35')](_0x3e7e2c['model'],_0x3e7e2c['query']);_0x5bb7c4[_0xd00c('0x36')]=_['intersection'](_0x3e7e2c[_0xd00c('0x31')],qs[_0xd00c('0x37')](_0x4987c5[_0xd00c('0x32')][_0xd00c('0x37')]));_0x5bb7c4[_0xd00c('0x36')]=_0x5bb7c4['attributes'][_0xd00c('0x38')]?_0x5bb7c4[_0xd00c('0x36')]:_0x3e7e2c['model'];if(!_0x4987c5[_0xd00c('0x32')][_0xd00c('0x39')](_0xd00c('0x3a'))){_0x5bb7c4[_0xd00c('0x1e')]=qs[_0xd00c('0x1e')](_0x4987c5[_0xd00c('0x32')]['limit']);_0x5bb7c4[_0xd00c('0x1c')]=qs['offset'](_0x4987c5[_0xd00c('0x32')]['offset']);}_0x5bb7c4['order']=qs['sort'](_0x4987c5[_0xd00c('0x32')][_0xd00c('0x3b')]);_0x5bb7c4[_0xd00c('0x3c')]=qs['filters'](_[_0xd00c('0x3d')](_0x4987c5[_0xd00c('0x32')],_0x3e7e2c[_0xd00c('0x34')]),_0x291b71);if(_0x4987c5['query'][_0xd00c('0x3e')]){_0x5bb7c4[_0xd00c('0x3c')]=_[_0xd00c('0x3f')](_0x5bb7c4[_0xd00c('0x3c')],{'$or':_[_0xd00c('0x2b')](_0x291b71,function(_0xfb7519){if(_0xfb7519[_0xd00c('0x2f')]!==_0xd00c('0x40')){var _0x1fdc4d={};_0x1fdc4d[_0xfb7519[_0xd00c('0x28')]]={'$like':'%'+_0x4987c5['query'][_0xd00c('0x3e')]+'%'};return _0x1fdc4d;}})});}_0x5bb7c4=_[_0xd00c('0x3f')]({},_0x5bb7c4,_0x4987c5['options']);var _0x1e565f={'where':_0x5bb7c4[_0xd00c('0x3c')]};return db['ChatQueueReport'][_0xd00c('0x1f')](_0x1e565f)[_0xd00c('0x25')](function(_0x3d31a7){_0x127a0b[_0xd00c('0x1f')]=_0x3d31a7;if(_0x4987c5[_0xd00c('0x32')][_0xd00c('0x41')]){_0x5bb7c4[_0xd00c('0x42')]=[{'all':!![]}];}return db[_0xd00c('0x2c')]['findAll'](_0x5bb7c4);})[_0xd00c('0x25')](function(_0x193117){_0x127a0b[_0xd00c('0x43')]=_0x193117;return _0x127a0b;})[_0xd00c('0x25')](respondWithFilteredResult(_0x17e58d,_0x5bb7c4))['catch'](handleError(_0x17e58d,null));};exports[_0xd00c('0x44')]=function(_0x6bcc79,_0x5b0b2b){var _0x923db0={'raw':!![],'where':{'id':_0x6bcc79[_0xd00c('0x45')]['id']}},_0x640a87={};_0x640a87['model']=_[_0xd00c('0x33')](db['ChatQueueReport']['rawAttributes']);_0x640a87[_0xd00c('0x32')]=_['keys'](_0x6bcc79[_0xd00c('0x32')]);_0x640a87[_0xd00c('0x34')]=_[_0xd00c('0x35')](_0x640a87[_0xd00c('0x31')],_0x640a87[_0xd00c('0x32')]);_0x923db0[_0xd00c('0x36')]=_[_0xd00c('0x35')](_0x640a87[_0xd00c('0x31')],qs[_0xd00c('0x37')](_0x6bcc79[_0xd00c('0x32')][_0xd00c('0x37')]));_0x923db0['attributes']=_0x923db0[_0xd00c('0x36')][_0xd00c('0x38')]?_0x923db0[_0xd00c('0x36')]:_0x640a87['model'];if(_0x6bcc79[_0xd00c('0x32')][_0xd00c('0x41')]){_0x923db0['include']=[{'all':!![]}];}_0x923db0=_['merge']({},_0x923db0,_0x6bcc79['options']);return db[_0xd00c('0x2c')][_0xd00c('0x46')](_0x923db0)[_0xd00c('0x25')](handleEntityNotFound(_0x5b0b2b,null))[_0xd00c('0x25')](respondWithResult(_0x5b0b2b,null))[_0xd00c('0x47')](handleError(_0x5b0b2b,null));};exports[_0xd00c('0x48')]=function(_0x3bc7e6,_0x1efbda){return db['ChatQueueReport'][_0xd00c('0x48')](_0x3bc7e6[_0xd00c('0x49')],{})[_0xd00c('0x25')](respondWithResult(_0x1efbda,0xc9))[_0xd00c('0x47')](handleError(_0x1efbda,null));};exports[_0xd00c('0x4a')]=function(_0x207cbc,_0x20ed7c){if(_0x207cbc[_0xd00c('0x49')]['id']){delete _0x207cbc[_0xd00c('0x49')]['id'];}return db[_0xd00c('0x2c')][_0xd00c('0x46')]({'where':{'id':_0x207cbc[_0xd00c('0x45')]['id']}})[_0xd00c('0x25')](handleEntityNotFound(_0x20ed7c,null))[_0xd00c('0x25')](saveUpdates(_0x207cbc['body'],null))[_0xd00c('0x25')](respondWithResult(_0x20ed7c,null))[_0xd00c('0x47')](handleError(_0x20ed7c,null));};exports[_0xd00c('0x4b')]=function(_0x380147,_0x1f7d40){return db[_0xd00c('0x2c')]['find']({'where':{'id':_0x380147[_0xd00c('0x45')]['id']}})[_0xd00c('0x25')](handleEntityNotFound(_0x1f7d40,null))[_0xd00c('0x25')](removeEntity(_0x1f7d40,null))['catch'](handleError(_0x1f7d40,null));};exports[_0xd00c('0x4c')]=function(_0x3c237c,_0x28d8ff){return db['ChatQueueReport']['describe']()[_0xd00c('0x25')](respondWithResult(_0x28d8ff,null))[_0xd00c('0x47')](handleError(_0x28d8ff,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 0ae9cec..66e76f7 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1a744b,_0x5f0579){var _0x3ece9e=function(_0x5e2c5f){while(--_0x5e2c5f){_0x1a744b['push'](_0x1a744b['shift']());}};_0x3ece9e(++_0x5f0579);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0xe706,0xa3));var _0x6e70=function(_0x3f553b,_0x49a9c2){_0x3f553b=_0x3f553b-0x0;var _0x183c4e=_0xe706[_0x3f553b];return _0x183c4e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 835ccfd..43b182d 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 _0x4e16=['where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','update','raw'];(function(_0x5dae65,_0x1874d0){var _0x4dcd2b=function(_0x29d2a3){while(--_0x29d2a3){_0x5dae65['push'](_0x5dae65['shift']());}};_0x4dcd2b(++_0x1874d0);}(_0x4e16,0x1ee));var _0x64e1=function(_0x396474,_0x58ec28){_0x396474=_0x396474-0x0;var _0x59542d=_0x4e16[_0x396474];return _0x59542d;};'use strict';var _=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var moment=require(_0x64e1('0x2'));var BPromise=require(_0x64e1('0x3'));var rs=require(_0x64e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64e1('0x5'))['db'];var utils=require(_0x64e1('0x6'));var logger=require(_0x64e1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x64e1('0x8'));var client=jayson[_0x64e1('0x9')][_0x64e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x116fdb,_0xc2529e,_0x4c2004){return new BPromise(function(_0x192173,_0x54aeff){return client[_0x64e1('0xb')](_0x116fdb,_0x4c2004)[_0x64e1('0xc')](function(_0x33e0fb){logger[_0x64e1('0xd')](_0x64e1('0xe'),_0xc2529e,_0x64e1('0xf'));logger[_0x64e1('0x10')](_0x64e1('0x11'),_0xc2529e,_0x64e1('0xf'),JSON[_0x64e1('0x12')](_0x33e0fb));if(_0x33e0fb[_0x64e1('0x13')]){if(_0x33e0fb[_0x64e1('0x13')][_0x64e1('0x14')]===0x1f4){logger['error'](_0x64e1('0xe'),_0xc2529e,_0x33e0fb['error'][_0x64e1('0x15')]);return _0x54aeff(_0x33e0fb[_0x64e1('0x13')][_0x64e1('0x15')]);}logger[_0x64e1('0x13')](_0x64e1('0xe'),_0xc2529e,_0x33e0fb[_0x64e1('0x13')][_0x64e1('0x15')]);return _0x192173(_0x33e0fb['error'][_0x64e1('0x15')]);}else{logger[_0x64e1('0xd')](_0x64e1('0xe'),_0xc2529e,_0x64e1('0xf'));_0x192173(_0x33e0fb[_0x64e1('0x16')][_0x64e1('0x15')]);}})[_0x64e1('0x17')](function(_0x3160ba){logger[_0x64e1('0x13')](_0x64e1('0xe'),_0xc2529e,_0x3160ba);_0x54aeff(_0x3160ba);});});}exports[_0x64e1('0x18')]=function(_0x6ec9bc){var _0x32384e=this;return new Promise(function(_0x5b5b0f,_0x2ec414){return db[_0x64e1('0x19')][_0x64e1('0x1a')](_0x6ec9bc[_0x64e1('0x1b')],{'raw':_0x6ec9bc['options']?_0x6ec9bc[_0x64e1('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x64e1('0xc')](function(_0x596a8e){logger[_0x64e1('0xd')](_0x64e1('0x18'),_0x6ec9bc);logger[_0x64e1('0x10')](_0x64e1('0x18'),_0x6ec9bc,JSON['stringify'](_0x596a8e));_0x5b5b0f(_0x596a8e);})['catch'](function(_0x12b781){logger['error'](_0x64e1('0x18'),_0x12b781[_0x64e1('0x15')],_0x6ec9bc);_0x2ec414(_0x32384e['error'](0x1f4,_0x12b781[_0x64e1('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x5d7eb4){var _0x1a6797=this;return new Promise(function(_0x27916c,_0x936e64){return db[_0x64e1('0x19')][_0x64e1('0x1d')](_0x5d7eb4[_0x64e1('0x1b')],{'raw':_0x5d7eb4[_0x64e1('0x1c')]?_0x5d7eb4[_0x64e1('0x1c')][_0x64e1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7eb4[_0x64e1('0x1c')]?_0x5d7eb4[_0x64e1('0x1c')][_0x64e1('0x1f')]||null:null,'attributes':_0x5d7eb4[_0x64e1('0x1c')]?_0x5d7eb4['options'][_0x64e1('0x20')]||null:null,'limit':_0x5d7eb4[_0x64e1('0x1c')]?_0x5d7eb4[_0x64e1('0x1c')][_0x64e1('0x21')]||null:null})[_0x64e1('0xc')](function(_0x303384){logger[_0x64e1('0xd')](_0x64e1('0x22'),_0x5d7eb4);logger[_0x64e1('0x10')](_0x64e1('0x22'),_0x5d7eb4,JSON[_0x64e1('0x12')](_0x303384));_0x27916c(_0x303384);})['catch'](function(_0x54644e){logger[_0x64e1('0x13')](_0x64e1('0x22'),_0x54644e[_0x64e1('0x15')],_0x5d7eb4);_0x936e64(_0x1a6797[_0x64e1('0x13')](0x1f4,_0x54644e[_0x64e1('0x15')]));});});};
\ No newline at end of file
+var _0xaad5=['error','code','message','result','ChatQueueReport','create','options','raw','catch','CreateChatQueueReport','UpdateChatQueueReport','update','body','attributes','limit','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1ae951,_0x28d675){var _0x3570aa=function(_0x458cb5){while(--_0x458cb5){_0x1ae951['push'](_0x1ae951['shift']());}};_0x3570aa(++_0x28d675);}(_0xaad5,0x177));var _0x5aad=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xaad5[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x5aad('0x0'));var util=require(_0x5aad('0x1'));var moment=require(_0x5aad('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5aad('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5aad('0x4'))(_0x5aad('0x5'));var config=require(_0x5aad('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5aad('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b02e4,_0x59aef4,_0x57e1ed){return new BPromise(function(_0x3f7a73,_0x2dc9d4){return client[_0x5aad('0x8')](_0x3b02e4,_0x57e1ed)[_0x5aad('0x9')](function(_0x543d05){logger[_0x5aad('0xa')](_0x5aad('0xb'),_0x59aef4,_0x5aad('0xc'));logger[_0x5aad('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x59aef4,_0x5aad('0xc'),JSON[_0x5aad('0xe')](_0x543d05));if(_0x543d05[_0x5aad('0xf')]){if(_0x543d05[_0x5aad('0xf')][_0x5aad('0x10')]===0x1f4){logger[_0x5aad('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x59aef4,_0x543d05['error'][_0x5aad('0x11')]);return _0x2dc9d4(_0x543d05[_0x5aad('0xf')][_0x5aad('0x11')]);}logger[_0x5aad('0xf')](_0x5aad('0xb'),_0x59aef4,_0x543d05[_0x5aad('0xf')]['message']);return _0x3f7a73(_0x543d05[_0x5aad('0xf')][_0x5aad('0x11')]);}else{logger[_0x5aad('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x59aef4,'request\x20sent');_0x3f7a73(_0x543d05[_0x5aad('0x12')][_0x5aad('0x11')]);}})['catch'](function(_0x3d5720){logger['error'](_0x5aad('0xb'),_0x59aef4,_0x3d5720);_0x2dc9d4(_0x3d5720);});});}exports['CreateChatQueueReport']=function(_0x26d226){var _0x194b2c=this;return new Promise(function(_0x5e4ca3,_0x108464){return db[_0x5aad('0x13')][_0x5aad('0x14')](_0x26d226['body'],{'raw':_0x26d226[_0x5aad('0x15')]?_0x26d226[_0x5aad('0x15')][_0x5aad('0x16')]===undefined?!![]:![]:!![]})[_0x5aad('0x9')](function(_0x42a98b){logger['info']('CreateChatQueueReport',_0x26d226);logger[_0x5aad('0xd')]('CreateChatQueueReport',_0x26d226,JSON[_0x5aad('0xe')](_0x42a98b));_0x5e4ca3(_0x42a98b);})[_0x5aad('0x17')](function(_0x3ceb52){logger[_0x5aad('0xf')](_0x5aad('0x18'),_0x3ceb52['message'],_0x26d226);_0x108464(_0x194b2c[_0x5aad('0xf')](0x1f4,_0x3ceb52[_0x5aad('0x11')]));});});};exports[_0x5aad('0x19')]=function(_0x19e67a){var _0x5ad3fe=this;return new Promise(function(_0x48f075,_0x233a36){return db[_0x5aad('0x13')][_0x5aad('0x1a')](_0x19e67a[_0x5aad('0x1b')],{'raw':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')][_0x5aad('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')]['where']||null:null,'attributes':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')][_0x5aad('0x1c')]||null:null,'limit':_0x19e67a[_0x5aad('0x15')]?_0x19e67a[_0x5aad('0x15')][_0x5aad('0x1d')]||null:null})['then'](function(_0x29a9e9){logger[_0x5aad('0xa')](_0x5aad('0x19'),_0x19e67a);logger[_0x5aad('0xd')](_0x5aad('0x19'),_0x19e67a,JSON[_0x5aad('0xe')](_0x29a9e9));_0x48f075(_0x29a9e9);})['catch'](function(_0x59e7c6){logger[_0x5aad('0xf')]('UpdateChatQueueReport',_0x59e7c6[_0x5aad('0x11')],_0x19e67a);_0x233a36(_0x5ad3fe[_0x5aad('0xf')](0x1f4,_0x59e7c6[_0x5aad('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a09487c..d44763e 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 _0x132a=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','/describe','/:id','show','post','put'];(function(_0x583993,_0x3ad7a6){var _0x35ac71=function(_0x5477c7){while(--_0x5477c7){_0x583993['push'](_0x583993['shift']());}};_0x35ac71(++_0x3ad7a6);}(_0x132a,0x100));var _0xa132=function(_0x583d46,_0x2bfbf6){_0x583d46=_0x583d46-0x0;var _0x133967=_0x132a[_0x583d46];return _0x133967;};'use strict';var multer=require(_0xa132('0x0'));var util=require(_0xa132('0x1'));var path=require(_0xa132('0x2'));var timeout=require('connect-timeout');var express=require(_0xa132('0x3'));var router=express[_0xa132('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa132('0x5'));var config=require(_0xa132('0x6'));var controller=require(_0xa132('0x7'));router['get']('/',auth[_0xa132('0x8')](),controller['index']);router['get'](_0xa132('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa132('0xa'),auth[_0xa132('0x8')](),controller[_0xa132('0xb')]);router[_0xa132('0xc')]('/',auth[_0xa132('0x8')](),controller['create']);router[_0xa132('0xd')]('/:id',auth[_0xa132('0x8')](),controller[_0xa132('0xe')]);router[_0xa132('0xf')](_0xa132('0xa'),auth[_0xa132('0x8')](),controller[_0xa132('0x10')]);module[_0xa132('0x11')]=router;
\ No newline at end of file
+var _0x9d5c=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','/:id','post'];(function(_0x375f69,_0x53535f){var _0x34ffba=function(_0x1709c1){while(--_0x1709c1){_0x375f69['push'](_0x375f69['shift']());}};_0x34ffba(++_0x53535f);}(_0x9d5c,0x64));var _0xc9d5=function(_0x1a1055,_0x36ed21){_0x1a1055=_0x1a1055-0x0;var _0x1abd1b=_0x9d5c[_0x1a1055];return _0x1abd1b;};'use strict';var multer=require(_0xc9d5('0x0'));var util=require(_0xc9d5('0x1'));var path=require(_0xc9d5('0x2'));var timeout=require(_0xc9d5('0x3'));var express=require(_0xc9d5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9d5('0x5'));var controller=require(_0xc9d5('0x6'));router[_0xc9d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc9d5('0x7')]('/describe',auth[_0xc9d5('0x8')](),controller[_0xc9d5('0x9')]);router[_0xc9d5('0x7')](_0xc9d5('0xa'),auth[_0xc9d5('0x8')](),controller['show']);router[_0xc9d5('0xb')]('/',auth[_0xc9d5('0x8')](),controller[_0xc9d5('0xc')]);router['put']('/:id',auth[_0xc9d5('0x8')](),controller['update']);router[_0xc9d5('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc9d5('0xe')]);module[_0xc9d5('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 476db56..37dc448 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x9bde,0xe1));var _0xe9bd=function(_0x27c774,_0x56e774){_0x27c774=_0x27c774-0x0;var _0x1193a6=_0x9bde[_0x27c774];return _0x1193a6;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x29f720,_0x13226d){var _0x47519d=function(_0x123858){while(--_0x123858){_0x29f720['push'](_0x29f720['shift']());}};_0x47519d(++_0x13226d);}(_0xe706,0xa3));var _0x6e70=function(_0x36a997,_0x288f0b){_0x36a997=_0x36a997-0x0;var _0x561b1b=_0xe706[_0x36a997];return _0x561b1b;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 897ecb9..11228ef 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 _0x902d=['rawAttributes','fields','length','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','set','reject','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x7c068e,_0x41d489){var _0x572df7=function(_0x37f9c7){while(--_0x37f9c7){_0x7c068e['push'](_0x7c068e['shift']());}};_0x572df7(++_0x41d489);}(_0x902d,0x165));var _0xd902=function(_0x4dae00,_0x15b194){_0x4dae00=_0x4dae00-0x0;var _0x16bf42=_0x902d[_0x4dae00];return _0x16bf42;};'use strict';var emlformat=require(_0xd902('0x0'));var rimraf=require(_0xd902('0x1'));var zipdir=require(_0xd902('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd902('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd902('0x4'));var util=require(_0xd902('0x5'));var path=require(_0xd902('0x6'));var sox=require(_0xd902('0x7'));var csv=require('to-csv');var ejs=require(_0xd902('0x8'));var fs=require('fs');var fs_extra=require(_0xd902('0x9'));var _=require(_0xd902('0xa'));var squel=require(_0xd902('0xb'));var crypto=require('crypto');var jsforce=require(_0xd902('0xc'));var deskjs=require(_0xd902('0xd'));var toCsv=require(_0xd902('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd902('0xf'));var qs=require(_0xd902('0x10'));var as=require(_0xd902('0x11'));var hardwareService=require(_0xd902('0x12'));var logger=require('../../config/logger')(_0xd902('0x13'));var utils=require(_0xd902('0x14'));var config=require(_0xd902('0x15'));var licenseUtil=require(_0xd902('0x16'));var db=require(_0xd902('0x17'))['db'];function respondWithStatusCode(_0xd4f849,_0x5aab6e){_0x5aab6e=_0x5aab6e||0xcc;return function(_0x58788b){if(_0x58788b){return _0xd4f849['sendStatus'](_0x5aab6e);}return _0xd4f849[_0xd902('0x18')](_0x5aab6e)['end']();};}function respondWithResult(_0x4aecf9,_0xc5a538){_0xc5a538=_0xc5a538||0xc8;return function(_0x33f9bf){if(_0x33f9bf){return _0x4aecf9[_0xd902('0x18')](_0xc5a538)[_0xd902('0x19')](_0x33f9bf);}};}function respondWithFilteredResult(_0x350d03,_0x4ae9a1){return function(_0x384da4){if(_0x384da4){var _0x2e5ac7=typeof _0x4ae9a1[_0xd902('0x1a')]==='undefined'&&typeof _0x4ae9a1[_0xd902('0x1b')]==='undefined';var _0x1f3eb0=_0x384da4['count'];var _0x234876=_0x2e5ac7?0x0:_0x4ae9a1[_0xd902('0x1a')];var _0x45254f=_0x2e5ac7?_0x384da4['count']:_0x4ae9a1[_0xd902('0x1a')]+_0x4ae9a1[_0xd902('0x1b')];var _0x542430;if(_0x45254f>=_0x1f3eb0){_0x45254f=_0x1f3eb0;_0x542430=0xc8;}else{_0x542430=0xce;}_0x350d03[_0xd902('0x18')](_0x542430);return _0x350d03[_0xd902('0x1c')]('Content-Range',_0x234876+'-'+_0x45254f+'/'+_0x1f3eb0)[_0xd902('0x19')](_0x384da4);}return null;};}function patchUpdates(_0x90ad14){return function(_0x85c1f){try{jsonpatch['apply'](_0x85c1f,_0x90ad14,!![]);}catch(_0x2c1ef9){return BPromise[_0xd902('0x1d')](_0x2c1ef9);}return _0x85c1f['save']();};}function saveUpdates(_0x5a6459,_0x11d233){return function(_0x36e014){if(_0x36e014){return _0x36e014['update'](_0x5a6459)[_0xd902('0x1e')](function(_0x38d74c){return _0x38d74c;});}return null;};}function removeEntity(_0x5a2e3c,_0x5265a1){return function(_0x557ede){if(_0x557ede){return _0x557ede['destroy']()[_0xd902('0x1e')](function(){_0x5a2e3c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe0ae0e,_0x18f802){return function(_0x2aa321){if(!_0x2aa321){_0xe0ae0e[_0xd902('0x1f')](0x194);}return _0x2aa321;};}function handleError(_0x2766a4,_0x29be2f){_0x29be2f=_0x29be2f||0x1f4;return function(_0xb90d88){logger[_0xd902('0x20')](_0xb90d88[_0xd902('0x21')]);if(_0xb90d88[_0xd902('0x22')]){delete _0xb90d88[_0xd902('0x22')];}_0x2766a4[_0xd902('0x18')](_0x29be2f)[_0xd902('0x23')](_0xb90d88);};}exports[_0xd902('0x24')]=function(_0x2d0a9d,_0x425a4d){var _0x140776={},_0x216133={},_0x25f259={'count':0x0,'rows':[]};var _0x49b5bf=_[_0xd902('0x25')](db[_0xd902('0x26')]['rawAttributes'],function(_0x15fb34){return{'name':_0x15fb34[_0xd902('0x27')],'type':_0x15fb34[_0xd902('0x28')][_0xd902('0x29')]};});_0x216133[_0xd902('0x2a')]=_[_0xd902('0x25')](_0x49b5bf,_0xd902('0x22'));_0x216133[_0xd902('0x2b')]=_[_0xd902('0x2c')](_0x2d0a9d[_0xd902('0x2b')]);_0x216133[_0xd902('0x2d')]=_[_0xd902('0x2e')](_0x216133[_0xd902('0x2a')],_0x216133[_0xd902('0x2b')]);_0x140776[_0xd902('0x2f')]=_[_0xd902('0x2e')](_0x216133[_0xd902('0x2a')],qs['fields'](_0x2d0a9d[_0xd902('0x2b')]['fields']));_0x140776[_0xd902('0x2f')]=_0x140776[_0xd902('0x2f')]['length']?_0x140776[_0xd902('0x2f')]:_0x216133[_0xd902('0x2a')];if(!_0x2d0a9d[_0xd902('0x2b')]['hasOwnProperty'](_0xd902('0x30'))){_0x140776['limit']=qs['limit'](_0x2d0a9d['query'][_0xd902('0x1b')]);_0x140776[_0xd902('0x1a')]=qs[_0xd902('0x1a')](_0x2d0a9d[_0xd902('0x2b')]['offset']);}_0x140776['order']=qs[_0xd902('0x31')](_0x2d0a9d[_0xd902('0x2b')][_0xd902('0x31')]);_0x140776[_0xd902('0x32')]=qs[_0xd902('0x2d')](_['pick'](_0x2d0a9d[_0xd902('0x2b')],_0x216133[_0xd902('0x2d')]),_0x49b5bf);if(_0x2d0a9d[_0xd902('0x2b')][_0xd902('0x33')]){_0x140776['where']=_[_0xd902('0x34')](_0x140776[_0xd902('0x32')],{'$or':_['map'](_0x49b5bf,function(_0x340fde){if(_0x340fde[_0xd902('0x28')]!==_0xd902('0x35')){var _0x1ef46e={};_0x1ef46e[_0x340fde[_0xd902('0x22')]]={'$like':'%'+_0x2d0a9d[_0xd902('0x2b')][_0xd902('0x33')]+'%'};return _0x1ef46e;}})});}_0x140776=_[_0xd902('0x34')]({},_0x140776,_0x2d0a9d[_0xd902('0x36')]);var _0x512fca={'where':_0x140776[_0xd902('0x32')]};return db[_0xd902('0x26')]['count'](_0x512fca)[_0xd902('0x1e')](function(_0x5a89f7){_0x25f259[_0xd902('0x37')]=_0x5a89f7;if(_0x2d0a9d[_0xd902('0x2b')][_0xd902('0x38')]){_0x140776[_0xd902('0x39')]=[{'all':!![]}];}return db[_0xd902('0x26')][_0xd902('0x3a')](_0x140776);})['then'](function(_0x21475e){_0x25f259[_0xd902('0x3b')]=_0x21475e;return _0x25f259;})['then'](respondWithFilteredResult(_0x425a4d,_0x140776))[_0xd902('0x3c')](handleError(_0x425a4d,null));};exports[_0xd902('0x3d')]=function(_0x4c7557,_0x52bf47){var _0x2d7898={'raw':!![],'where':{'id':_0x4c7557[_0xd902('0x3e')]['id']}},_0x1f56aa={};_0x1f56aa[_0xd902('0x2a')]=_[_0xd902('0x2c')](db['ChatTransferReport'][_0xd902('0x3f')]);_0x1f56aa[_0xd902('0x2b')]=_[_0xd902('0x2c')](_0x4c7557[_0xd902('0x2b')]);_0x1f56aa[_0xd902('0x2d')]=_[_0xd902('0x2e')](_0x1f56aa['model'],_0x1f56aa[_0xd902('0x2b')]);_0x2d7898['attributes']=_['intersection'](_0x1f56aa[_0xd902('0x2a')],qs['fields'](_0x4c7557['query'][_0xd902('0x40')]));_0x2d7898[_0xd902('0x2f')]=_0x2d7898[_0xd902('0x2f')][_0xd902('0x41')]?_0x2d7898['attributes']:_0x1f56aa[_0xd902('0x2a')];if(_0x4c7557[_0xd902('0x2b')][_0xd902('0x38')]){_0x2d7898[_0xd902('0x39')]=[{'all':!![]}];}_0x2d7898=_[_0xd902('0x34')]({},_0x2d7898,_0x4c7557['options']);return db[_0xd902('0x26')][_0xd902('0x42')](_0x2d7898)[_0xd902('0x1e')](handleEntityNotFound(_0x52bf47,null))[_0xd902('0x1e')](respondWithResult(_0x52bf47,null))[_0xd902('0x3c')](handleError(_0x52bf47,null));};exports[_0xd902('0x43')]=function(_0x46bf07,_0xb7c5b){return db['ChatTransferReport'][_0xd902('0x43')](_0x46bf07['body'],{})[_0xd902('0x1e')](respondWithResult(_0xb7c5b,0xc9))['catch'](handleError(_0xb7c5b,null));};exports['update']=function(_0x339995,_0x1e7855){if(_0x339995[_0xd902('0x44')]['id']){delete _0x339995[_0xd902('0x44')]['id'];}return db['ChatTransferReport'][_0xd902('0x42')]({'where':{'id':_0x339995['params']['id']}})[_0xd902('0x1e')](handleEntityNotFound(_0x1e7855,null))[_0xd902('0x1e')](saveUpdates(_0x339995[_0xd902('0x44')],null))[_0xd902('0x1e')](respondWithResult(_0x1e7855,null))[_0xd902('0x3c')](handleError(_0x1e7855,null));};exports['destroy']=function(_0x563b89,_0x1ea919){return db[_0xd902('0x26')][_0xd902('0x42')]({'where':{'id':_0x563b89[_0xd902('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1ea919,null))[_0xd902('0x1e')](removeEntity(_0x1ea919,null))[_0xd902('0x3c')](handleError(_0x1ea919,null));};exports[_0xd902('0x45')]=function(_0x25f24e,_0x4a400e){return db[_0xd902('0x26')]['describe']()[_0xd902('0x1e')](respondWithResult(_0x4a400e,null))['catch'](handleError(_0x4a400e,null));};
\ No newline at end of file
+var _0x7918=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis'];(function(_0x2acd7e,_0x4a5f48){var _0x5a6790=function(_0x52e03c){while(--_0x52e03c){_0x2acd7e['push'](_0x2acd7e['shift']());}};_0x5a6790(++_0x4a5f48);}(_0x7918,0x1e1));var _0x8791=function(_0x10ea94,_0x45b5f1){_0x10ea94=_0x10ea94-0x0;var _0x87c1bf=_0x7918[_0x10ea94];return _0x87c1bf;};'use strict';var emlformat=require(_0x8791('0x0'));var rimraf=require(_0x8791('0x1'));var zipdir=require(_0x8791('0x2'));var jsonpatch=require(_0x8791('0x3'));var rp=require(_0x8791('0x4'));var moment=require(_0x8791('0x5'));var BPromise=require(_0x8791('0x6'));var Mustache=require(_0x8791('0x7'));var util=require('util');var path=require(_0x8791('0x8'));var sox=require(_0x8791('0x9'));var csv=require(_0x8791('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8791('0xb'));var crypto=require(_0x8791('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8791('0xd'));var Papa=require(_0x8791('0xe'));var Redis=require(_0x8791('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8791('0x10'));var as=require(_0x8791('0x11'));var hardwareService=require(_0x8791('0x12'));var logger=require('../../config/logger')(_0x8791('0x13'));var utils=require('../../config/utils');var config=require(_0x8791('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b190,_0x42000e){_0x42000e=_0x42000e||0xcc;return function(_0x313273){if(_0x313273){return _0x20b190[_0x8791('0x15')](_0x42000e);}return _0x20b190['status'](_0x42000e)[_0x8791('0x16')]();};}function respondWithResult(_0x2b42db,_0x32d001){_0x32d001=_0x32d001||0xc8;return function(_0x5cb392){if(_0x5cb392){return _0x2b42db[_0x8791('0x17')](_0x32d001)[_0x8791('0x18')](_0x5cb392);}};}function respondWithFilteredResult(_0xc74b91,_0x58b131){return function(_0x53600b){if(_0x53600b){var _0xc85c60=typeof _0x58b131['offset']==='undefined'&&typeof _0x58b131['limit']==='undefined';var _0x33c9db=_0x53600b[_0x8791('0x19')];var _0x1db2e1=_0xc85c60?0x0:_0x58b131['offset'];var _0x2f8672=_0xc85c60?_0x53600b[_0x8791('0x19')]:_0x58b131[_0x8791('0x1a')]+_0x58b131[_0x8791('0x1b')];var _0x61b79a;if(_0x2f8672>=_0x33c9db){_0x2f8672=_0x33c9db;_0x61b79a=0xc8;}else{_0x61b79a=0xce;}_0xc74b91[_0x8791('0x17')](_0x61b79a);return _0xc74b91[_0x8791('0x1c')](_0x8791('0x1d'),_0x1db2e1+'-'+_0x2f8672+'/'+_0x33c9db)[_0x8791('0x18')](_0x53600b);}return null;};}function patchUpdates(_0x1003f9){return function(_0xb37712){try{jsonpatch['apply'](_0xb37712,_0x1003f9,!![]);}catch(_0x58326f){return BPromise[_0x8791('0x1e')](_0x58326f);}return _0xb37712['save']();};}function saveUpdates(_0x5e25de,_0x5eade7){return function(_0x9d6d90){if(_0x9d6d90){return _0x9d6d90[_0x8791('0x1f')](_0x5e25de)[_0x8791('0x20')](function(_0x13d92e){return _0x13d92e;});}return null;};}function removeEntity(_0x19a75d,_0x17b090){return function(_0x17329f){if(_0x17329f){return _0x17329f['destroy']()[_0x8791('0x20')](function(){_0x19a75d['status'](0xcc)[_0x8791('0x16')]();});}};}function handleEntityNotFound(_0x372fa2,_0x492b1d){return function(_0x411ffe){if(!_0x411ffe){_0x372fa2[_0x8791('0x15')](0x194);}return _0x411ffe;};}function handleError(_0x1de0bc,_0x51edbd){_0x51edbd=_0x51edbd||0x1f4;return function(_0x2e400b){logger[_0x8791('0x21')](_0x2e400b[_0x8791('0x22')]);if(_0x2e400b[_0x8791('0x23')]){delete _0x2e400b['name'];}_0x1de0bc[_0x8791('0x17')](_0x51edbd)['send'](_0x2e400b);};}exports[_0x8791('0x24')]=function(_0x306e3a,_0x1aa4ef){var _0x5b13e1={},_0x546636={},_0x5dc91f={'count':0x0,'rows':[]};var _0x257d0e=_[_0x8791('0x25')](db[_0x8791('0x26')][_0x8791('0x27')],function(_0x3f410c){return{'name':_0x3f410c[_0x8791('0x28')],'type':_0x3f410c[_0x8791('0x29')][_0x8791('0x2a')]};});_0x546636[_0x8791('0x2b')]=_['map'](_0x257d0e,'name');_0x546636[_0x8791('0x2c')]=_[_0x8791('0x2d')](_0x306e3a[_0x8791('0x2c')]);_0x546636['filters']=_[_0x8791('0x2e')](_0x546636['model'],_0x546636[_0x8791('0x2c')]);_0x5b13e1['attributes']=_['intersection'](_0x546636[_0x8791('0x2b')],qs['fields'](_0x306e3a[_0x8791('0x2c')][_0x8791('0x2f')]));_0x5b13e1[_0x8791('0x30')]=_0x5b13e1[_0x8791('0x30')][_0x8791('0x31')]?_0x5b13e1[_0x8791('0x30')]:_0x546636[_0x8791('0x2b')];if(!_0x306e3a[_0x8791('0x2c')]['hasOwnProperty'](_0x8791('0x32'))){_0x5b13e1[_0x8791('0x1b')]=qs[_0x8791('0x1b')](_0x306e3a[_0x8791('0x2c')][_0x8791('0x1b')]);_0x5b13e1[_0x8791('0x1a')]=qs[_0x8791('0x1a')](_0x306e3a['query'][_0x8791('0x1a')]);}_0x5b13e1[_0x8791('0x33')]=qs['sort'](_0x306e3a['query']['sort']);_0x5b13e1['where']=qs[_0x8791('0x34')](_[_0x8791('0x35')](_0x306e3a['query'],_0x546636[_0x8791('0x34')]),_0x257d0e);if(_0x306e3a[_0x8791('0x2c')][_0x8791('0x36')]){_0x5b13e1['where']=_[_0x8791('0x37')](_0x5b13e1[_0x8791('0x38')],{'$or':_['map'](_0x257d0e,function(_0x13eb4b){if(_0x13eb4b[_0x8791('0x29')]!==_0x8791('0x39')){var _0x9372a1={};_0x9372a1[_0x13eb4b['name']]={'$like':'%'+_0x306e3a[_0x8791('0x2c')]['filter']+'%'};return _0x9372a1;}})});}_0x5b13e1=_[_0x8791('0x37')]({},_0x5b13e1,_0x306e3a['options']);var _0x127547={'where':_0x5b13e1[_0x8791('0x38')]};return db[_0x8791('0x26')][_0x8791('0x19')](_0x127547)[_0x8791('0x20')](function(_0x1fe837){_0x5dc91f['count']=_0x1fe837;if(_0x306e3a[_0x8791('0x2c')][_0x8791('0x3a')]){_0x5b13e1[_0x8791('0x3b')]=[{'all':!![]}];}return db[_0x8791('0x26')][_0x8791('0x3c')](_0x5b13e1);})[_0x8791('0x20')](function(_0x30b988){_0x5dc91f[_0x8791('0x3d')]=_0x30b988;return _0x5dc91f;})[_0x8791('0x20')](respondWithFilteredResult(_0x1aa4ef,_0x5b13e1))[_0x8791('0x3e')](handleError(_0x1aa4ef,null));};exports[_0x8791('0x3f')]=function(_0x5bc630,_0x15b2de){var _0x477edf={'raw':!![],'where':{'id':_0x5bc630[_0x8791('0x40')]['id']}},_0x3220e4={};_0x3220e4[_0x8791('0x2b')]=_[_0x8791('0x2d')](db[_0x8791('0x26')][_0x8791('0x27')]);_0x3220e4[_0x8791('0x2c')]=_[_0x8791('0x2d')](_0x5bc630['query']);_0x3220e4['filters']=_[_0x8791('0x2e')](_0x3220e4[_0x8791('0x2b')],_0x3220e4[_0x8791('0x2c')]);_0x477edf[_0x8791('0x30')]=_[_0x8791('0x2e')](_0x3220e4[_0x8791('0x2b')],qs['fields'](_0x5bc630[_0x8791('0x2c')][_0x8791('0x2f')]));_0x477edf[_0x8791('0x30')]=_0x477edf[_0x8791('0x30')][_0x8791('0x31')]?_0x477edf[_0x8791('0x30')]:_0x3220e4[_0x8791('0x2b')];if(_0x5bc630[_0x8791('0x2c')][_0x8791('0x3a')]){_0x477edf[_0x8791('0x3b')]=[{'all':!![]}];}_0x477edf=_[_0x8791('0x37')]({},_0x477edf,_0x5bc630[_0x8791('0x41')]);return db['ChatTransferReport'][_0x8791('0x42')](_0x477edf)[_0x8791('0x20')](handleEntityNotFound(_0x15b2de,null))[_0x8791('0x20')](respondWithResult(_0x15b2de,null))[_0x8791('0x3e')](handleError(_0x15b2de,null));};exports[_0x8791('0x43')]=function(_0x4b9d2d,_0x4894f9){return db[_0x8791('0x26')]['create'](_0x4b9d2d[_0x8791('0x44')],{})[_0x8791('0x20')](respondWithResult(_0x4894f9,0xc9))[_0x8791('0x3e')](handleError(_0x4894f9,null));};exports['update']=function(_0x197525,_0x1cab3){if(_0x197525['body']['id']){delete _0x197525[_0x8791('0x44')]['id'];}return db[_0x8791('0x26')]['find']({'where':{'id':_0x197525[_0x8791('0x40')]['id']}})[_0x8791('0x20')](handleEntityNotFound(_0x1cab3,null))[_0x8791('0x20')](saveUpdates(_0x197525[_0x8791('0x44')],null))[_0x8791('0x20')](respondWithResult(_0x1cab3,null))['catch'](handleError(_0x1cab3,null));};exports[_0x8791('0x45')]=function(_0x164d0e,_0x30f5f8){return db[_0x8791('0x26')][_0x8791('0x42')]({'where':{'id':_0x164d0e[_0x8791('0x40')]['id']}})[_0x8791('0x20')](handleEntityNotFound(_0x30f5f8,null))[_0x8791('0x20')](removeEntity(_0x30f5f8,null))[_0x8791('0x3e')](handleError(_0x30f5f8,null));};exports['describe']=function(_0x5a7791,_0x331785){return db[_0x8791('0x26')][_0x8791('0x46')]()[_0x8791('0x20')](respondWithResult(_0x331785,null))['catch'](handleError(_0x331785,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 9cae1cd..a313e35 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 _0x5f46=['exports','report_chat_transfer','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0x5f46,0xc8));var _0x65f4=function(_0x356ccb,_0x2b16d0){_0x356ccb=_0x356ccb-0x0;var _0x4ecb55=_0x5f46[_0x356ccb];return _0x4ecb55;};'use strict';var _=require(_0x65f4('0x0'));var util=require(_0x65f4('0x1'));var logger=require(_0x65f4('0x2'))(_0x65f4('0x3'));var moment=require(_0x65f4('0x4'));var BPromise=require(_0x65f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65f4('0x6'));var rimraf=require(_0x65f4('0x7'));var config=require(_0x65f4('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x65f4('0x9')]=function(_0x5f2616,_0x52c65c){return _0x5f2616['define']('ChatTransferReport',attributes,{'tableName':_0x65f4('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a54=['request-promise','path','rimraf','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x14d06a,_0x4fa706){var _0x580485=function(_0x286fa3){while(--_0x286fa3){_0x14d06a['push'](_0x14d06a['shift']());}};_0x580485(++_0x4fa706);}(_0x4a54,0x133));var _0x44a5=function(_0x58ef64,_0x47c44e){_0x58ef64=_0x58ef64-0x0;var _0x51584b=_0x4a54[_0x58ef64];return _0x51584b;};'use strict';var _=require(_0x44a5('0x0'));var util=require(_0x44a5('0x1'));var logger=require(_0x44a5('0x2'))(_0x44a5('0x3'));var moment=require(_0x44a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x44a5('0x5'));var fs=require('fs');var path=require(_0x44a5('0x6'));var rimraf=require(_0x44a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x44a5('0x8'));module['exports']=function(_0x4f1ff3,_0x45cbe5){return _0x4f1ff3['define'](_0x44a5('0x9'),attributes,{'tableName':_0x44a5('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x44a5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 2433cea..d3fb934 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 _0x25af=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0x25af,0x173));var _0xf25a=function(_0x451754,_0x23b69c){_0x451754=_0x451754-0x0;var _0x520826=_0x25af[_0x451754];return _0x520826;};'use strict';var _=require(_0xf25a('0x0'));var util=require('util');var moment=require(_0xf25a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf25a('0x2'));var fs=require('fs');var Redis=require(_0xf25a('0x3'));var db=require(_0xf25a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf25a('0x5'))(_0xf25a('0x6'));var config=require(_0xf25a('0x7'));var jayson=require(_0xf25a('0x8'));var client=jayson[_0xf25a('0x9')][_0xf25a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387ba0,_0x2780e8,_0x4c87f8){return new BPromise(function(_0x221769,_0x2b5689){return client[_0xf25a('0xb')](_0x387ba0,_0x4c87f8)[_0xf25a('0xc')](function(_0x58e6e6){logger[_0xf25a('0xd')](_0xf25a('0xe'),_0x2780e8,_0xf25a('0xf'));logger[_0xf25a('0x10')](_0xf25a('0x11'),_0x2780e8,_0xf25a('0xf'),JSON[_0xf25a('0x12')](_0x58e6e6));if(_0x58e6e6['error']){if(_0x58e6e6['error'][_0xf25a('0x13')]===0x1f4){logger[_0xf25a('0x14')](_0xf25a('0xe'),_0x2780e8,_0x58e6e6[_0xf25a('0x14')]['message']);return _0x2b5689(_0x58e6e6[_0xf25a('0x14')][_0xf25a('0x15')]);}logger[_0xf25a('0x14')](_0xf25a('0xe'),_0x2780e8,_0x58e6e6['error'][_0xf25a('0x15')]);return _0x221769(_0x58e6e6[_0xf25a('0x14')]['message']);}else{logger[_0xf25a('0xd')](_0xf25a('0xe'),_0x2780e8,_0xf25a('0xf'));_0x221769(_0x58e6e6[_0xf25a('0x16')][_0xf25a('0x15')]);}})[_0xf25a('0x17')](function(_0x22cc00){logger['error'](_0xf25a('0xe'),_0x2780e8,_0x22cc00);_0x2b5689(_0x22cc00);});});}
\ No newline at end of file
+var _0x1ef8=['then','info','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x11e2d1,_0x1edb96){var _0x51fb77=function(_0x246a1d){while(--_0x246a1d){_0x11e2d1['push'](_0x11e2d1['shift']());}};_0x51fb77(++_0x1edb96);}(_0x1ef8,0x137));var _0x81ef=function(_0x38c8c0,_0x52678b){_0x38c8c0=_0x38c8c0-0x0;var _0x397bd5=_0x1ef8[_0x38c8c0];return _0x397bd5;};'use strict';var _=require(_0x81ef('0x0'));var util=require(_0x81ef('0x1'));var moment=require(_0x81ef('0x2'));var BPromise=require(_0x81ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81ef('0x4'));var db=require(_0x81ef('0x5'))['db'];var utils=require(_0x81ef('0x6'));var logger=require(_0x81ef('0x7'))(_0x81ef('0x8'));var config=require(_0x81ef('0x9'));var jayson=require(_0x81ef('0xa'));var client=jayson[_0x81ef('0xb')][_0x81ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16bc33,_0x468d55,_0x1c6e46){return new BPromise(function(_0x39235f,_0x19c253){return client[_0x81ef('0xd')](_0x16bc33,_0x1c6e46)[_0x81ef('0xe')](function(_0x19ef26){logger[_0x81ef('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x468d55,'request\x20sent');logger['debug'](_0x81ef('0x10'),_0x468d55,_0x81ef('0x11'),JSON[_0x81ef('0x12')](_0x19ef26));if(_0x19ef26['error']){if(_0x19ef26['error'][_0x81ef('0x13')]===0x1f4){logger[_0x81ef('0x14')](_0x81ef('0x15'),_0x468d55,_0x19ef26[_0x81ef('0x14')]['message']);return _0x19c253(_0x19ef26[_0x81ef('0x14')][_0x81ef('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x468d55,_0x19ef26['error'][_0x81ef('0x16')]);return _0x39235f(_0x19ef26['error'][_0x81ef('0x16')]);}else{logger['info'](_0x81ef('0x15'),_0x468d55,_0x81ef('0x11'));_0x39235f(_0x19ef26[_0x81ef('0x17')][_0x81ef('0x16')]);}})[_0x81ef('0x18')](function(_0x5bd731){logger[_0x81ef('0x14')](_0x81ef('0x15'),_0x468d55,_0x5bd731);_0x19c253(_0x5bd731);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 82c0fe8..42e2389 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 _0x8a85=['index','/describe','describe','show','post','create','update','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x4f7cd0,_0x1f716f){var _0x1d6e35=function(_0x3b3b13){while(--_0x3b3b13){_0x4f7cd0['push'](_0x4f7cd0['shift']());}};_0x1d6e35(++_0x1f716f);}(_0x8a85,0xe6));var _0x58a8=function(_0x33df14,_0x2ba900){_0x33df14=_0x33df14-0x0;var _0x180d1d=_0x8a85[_0x33df14];return _0x180d1d;};'use strict';var multer=require('multer');var util=require(_0x58a8('0x0'));var path=require(_0x58a8('0x1'));var timeout=require(_0x58a8('0x2'));var express=require(_0x58a8('0x3'));var router=express[_0x58a8('0x4')]();var fs_extra=require(_0x58a8('0x5'));var auth=require(_0x58a8('0x6'));var interaction=require(_0x58a8('0x7'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x58a8('0x8')]('/',auth[_0x58a8('0x9')](),controller[_0x58a8('0xa')]);router[_0x58a8('0x8')](_0x58a8('0xb'),auth[_0x58a8('0x9')](),controller[_0x58a8('0xc')]);router['get']('/:id',auth[_0x58a8('0x9')](),controller[_0x58a8('0xd')]);router[_0x58a8('0xe')]('/',auth[_0x58a8('0x9')](),controller[_0x58a8('0xf')]);router['put']('/:id',auth[_0x58a8('0x9')](),controller[_0x58a8('0x10')]);router['delete'](_0x58a8('0x11'),auth[_0x58a8('0x9')](),controller[_0x58a8('0x12')]);module[_0x58a8('0x13')]=router;
\ No newline at end of file
+var _0x5889=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','connect-timeout','express','../../components/auth/service'];(function(_0x310990,_0x245984){var _0x648534=function(_0xd320e5){while(--_0xd320e5){_0x310990['push'](_0x310990['shift']());}};_0x648534(++_0x245984);}(_0x5889,0x1e2));var _0x9588=function(_0x3714ae,_0x2b7ddd){_0x3714ae=_0x3714ae-0x0;var _0x23aa06=_0x5889[_0x3714ae];return _0x23aa06;};'use strict';var multer=require(_0x9588('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9588('0x1'));var express=require(_0x9588('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9588('0x3'));var interaction=require(_0x9588('0x4'));var config=require(_0x9588('0x5'));var controller=require(_0x9588('0x6'));router[_0x9588('0x7')]('/',auth[_0x9588('0x8')](),controller[_0x9588('0x9')]);router['get'](_0x9588('0xa'),auth[_0x9588('0x8')](),controller[_0x9588('0xb')]);router[_0x9588('0x7')](_0x9588('0xc'),auth[_0x9588('0x8')](),controller[_0x9588('0xd')]);router[_0x9588('0xe')]('/',auth[_0x9588('0x8')](),controller[_0x9588('0xf')]);router['put'](_0x9588('0xc'),auth['isAuthenticated'](),controller[_0x9588('0x10')]);router[_0x9588('0x11')](_0x9588('0xc'),auth[_0x9588('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 24d5f5a..a140f5a 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 _0xcfaa=['Skip','star','thumb','input','name','text','getDataValue','onlineForm','parse','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x353a87,_0x2730fb){var _0xfe692d=function(_0x3ec956){while(--_0x3ec956){_0x353a87['push'](_0x353a87['shift']());}};_0xfe692d(++_0x2730fb);}(_0xcfaa,0xbc));var _0xacfa=function(_0x2e8660,_0x21b463){_0x2e8660=_0x2e8660-0x0;var _0x2b574e=_0xcfaa[_0x2e8660];return _0x2b574e;};'use strict';var Sequelize=require(_0xacfa('0x0'));var rs=require(_0xacfa('0x1'));module[_0xacfa('0x2')]={'name':{'type':Sequelize[_0xacfa('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xacfa('0x3')],'allowNull':![],'unique':_0xacfa('0x4')},'description':{'type':Sequelize[_0xacfa('0x3')]},'mapKey':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x5')},'mapKeyOffline':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xacfa('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x6')},'customerAlias':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xacfa('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xacfa('0x3')],'allowNull':![],'defaultValue':_0xacfa('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xacfa('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xacfa('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xacfa('0x3')]},'animation':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xacfa('0xb')](_0xacfa('0xc'),_0xacfa('0xd')),'defaultValue':_0xacfa('0xc')},'header_online':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0xe')},'start_chat_button':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xacfa('0x11')]},'closingQuestion':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x14')},'noteTitle':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x15')},'placeholderMessage':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xacfa('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xacfa('0x18')},'conditionAgreement':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xacfa('0x19'),_0xacfa('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xacfa('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xacfa('0x1b'),'variable':null,'config':{'placeholder':_0xacfa('0x1c'),'type':_0xacfa('0x1d'),'required':!![]},'props':{'title':_0xacfa('0x1c'),'helpText':''}},{'type':_0xacfa('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xacfa('0x5'),'type':_0xacfa('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xacfa('0x1e')](_0xacfa('0x1f'))?JSON[_0xacfa('0x20')](this[_0xacfa('0x1e')](_0xacfa('0x1f'))):{};},'set':function(_0x3ee9cf){return this['setDataValue'](_0xacfa('0x1f'),JSON[_0xacfa('0x21')](_0x3ee9cf));}},'offlineForm':{'type':Sequelize[_0xacfa('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xacfa('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xacfa('0x5'),'type':_0xacfa('0x5')},'variable':null},{'type':_0xacfa('0x22'),'config':{'placeholder':_0xacfa('0x23')},'props':{'title':_0xacfa('0x23'),'helpText':_0xacfa('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xacfa('0x1e')](_0xacfa('0x25'))?JSON[_0xacfa('0x20')](this[_0xacfa('0x1e')]('offlineForm')):{};},'set':function(_0x965e02){return this[_0xacfa('0x26')](_0xacfa('0x25'),JSON[_0xacfa('0x21')](_0x965e02));}},'token':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':function(){return rs[_0xacfa('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xacfa('0x3')]},'waitingTitle':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xacfa('0x29')},'offlineMessageSubject':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x2a')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x18')},'sendUnmanaged':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xacfa('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xacfa('0x2b');}},'notificationSound':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xacfa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xacfa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x2d')},'verticalAlignment':{'type':Sequelize[_0xacfa('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x2e')},'messagesAlignment':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':_0xacfa('0x2f')},'defaultTitle':{'type':Sequelize[_0xacfa('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xacfa('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xacfa('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xacfa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xacfa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xacfa('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xacfa('0x9')],'comment':_0xacfa('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![],'comment':_0xacfa('0x31'),'set':function(_0x4b9605){if(!_0x4b9605)this[_0xacfa('0x26')]('mandatoryDispositionPauseId',null);this[_0xacfa('0x26')](_0xacfa('0x32'),_0x4b9605);}},'vidaooEscalation':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xacfa('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xacfa('0x33')},'vidaooNote':{'type':Sequelize[_0xacfa('0x3')],'defaultValue':function(){return _0xacfa('0x34');}},'vidaooMetadata':{'type':Sequelize[_0xacfa('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xacfa('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdfea=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','offlineForm','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','Your\x20request\x20has\x20not\x20been\x20processed.'];(function(_0x4efc87,_0x17a7d1){var _0x191fc4=function(_0x19dda1){while(--_0x19dda1){_0x4efc87['push'](_0x4efc87['shift']());}};_0x191fc4(++_0x17a7d1);}(_0xdfea,0x12f));var _0xadfe=function(_0x38a1b6,_0x652988){_0x38a1b6=_0x38a1b6-0x0;var _0xfbd3d2=_0xdfea[_0x38a1b6];return _0xfbd3d2;};'use strict';var Sequelize=require(_0xadfe('0x0'));var rs=require(_0xadfe('0x1'));module[_0xadfe('0x2')]={'name':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xadfe('0x4')},'description':{'type':Sequelize[_0xadfe('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0x5')},'mapKeyOffline':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0x6')},'customerAlias':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xadfe('0x3')]},'animation':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xadfe('0xa')](_0xadfe('0xb'),_0xadfe('0xc')),'defaultValue':_0xadfe('0xb')},'header_online':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0xd')},'start_chat_button':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0xe')},'header_offline':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0xf')},'download_transcript':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xadfe('0x11')]},'closingQuestion':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x14')},'noteTitle':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x15')},'placeholderMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x16')},'closingMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x18')},'conditionAgreement':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xadfe('0xa')](_0xadfe('0x19'),_0xadfe('0x1a')),'defaultValue':_0xadfe('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xadfe('0x1b')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xadfe('0x11')],'defaultValue':function(){return JSON[_0xadfe('0x1c')]({'items':[{'type':_0xadfe('0x1d'),'variable':null,'config':{'placeholder':_0xadfe('0x1e'),'type':'text','required':!![]},'props':{'title':_0xadfe('0x1e'),'helpText':''}},{'type':_0xadfe('0x1d'),'props':{'title':_0xadfe('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xadfe('0x5'),'type':_0xadfe('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xadfe('0x1f')](_0xadfe('0x20'))?JSON['parse'](this['getDataValue'](_0xadfe('0x20'))):{};},'set':function(_0x3996e6){return this[_0xadfe('0x21')](_0xadfe('0x20'),JSON[_0xadfe('0x1c')](_0x3996e6));}},'offlineForm':{'type':Sequelize[_0xadfe('0x11')],'defaultValue':function(){return JSON[_0xadfe('0x1c')]({'items':[{'type':_0xadfe('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xadfe('0x5'),'type':_0xadfe('0x5')},'variable':null},{'type':_0xadfe('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xadfe('0x1f')](_0xadfe('0x23'))?JSON['parse'](this[_0xadfe('0x1f')](_0xadfe('0x23'))):{};},'set':function(_0x162aec){return this[_0xadfe('0x21')]('offlineForm',JSON[_0xadfe('0x1c')](_0x162aec));}},'token':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xadfe('0x3')]},'forwardOffline':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xadfe('0x3')]},'waitingTitle':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x24')},'waitingMessage':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x26')},'offlineMessageBody':{'type':Sequelize[_0xadfe('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[_0xadfe('0x3')],'defaultValue':_0xadfe('0x27')},'skipUnmanaged':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xadfe('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xadfe('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xadfe('0x28');}},'notificationSound':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xadfe('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xadfe('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x2a')},'messagesAlignment':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x2b')},'defaultTitle':{'type':Sequelize[_0xadfe('0x3')]},'customerAvatar':{'type':Sequelize[_0xadfe('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xadfe('0x1b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':_0xadfe('0x2d')},'systemAvatar':{'type':Sequelize[_0xadfe('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xadfe('0x1b')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![],'comment':_0xadfe('0x2e'),'set':function(_0x339465){if(!_0x339465)this[_0xadfe('0x21')]('mandatoryDispositionPauseId',null);this[_0xadfe('0x21')]('mandatoryDisposition',_0x339465);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xadfe('0x3')],'allowNull':![],'defaultValue':_0xadfe('0x2f')},'vidaooNote':{'type':Sequelize[_0xadfe('0x3')],'defaultValue':function(){return _0xadfe('0x30');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xadfe('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xadfe('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4b4e0a2..6b95dd2 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 _0x986b=['interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','map','Intervals','all','some','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','update','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','nolimit','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','options','removeAnswers','addLogo','file','filename','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','join','root','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','download','notify','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','ChatApplication','Applications','Interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','List','account','list','applications','priority','asc','defaults','contact','headers','threadId','externalUrl','ChatInteraction','interaction','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','queueId','waitForTheAssignedQueue','Start','EventManager','offline','files','CmContact','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','hasOwnProperty','Owner','fullname','internal','Tag','Tags','color','tag','virtual','custom','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','origin','3.5.0','remote','connection','remoteAddress','render','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','transaction','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','getSnippet','timezone','format','iftime\x20%s,%s'];(function(_0x178848,_0x1bd7d2){var _0x286c30=function(_0x5f207b){while(--_0x5f207b){_0x178848['push'](_0x178848['shift']());}};_0x286c30(++_0x1bd7d2);}(_0x986b,0xf9));var _0xb986=function(_0xeb7593,_0x8d90c){_0xeb7593=_0xeb7593-0x0;var _0x135411=_0x986b[_0xeb7593];return _0x135411;};'use strict';var Mustache=require(_0xb986('0x0'));var util=require('util');var path=require(_0xb986('0x1'));var ejs=require(_0xb986('0x2'));var fs=require('fs');var fs_extra=require(_0xb986('0x3'));var _=require(_0xb986('0x4'));var querystring=require(_0xb986('0x5'));var htmlToText=require(_0xb986('0x6'));var Redis=require(_0xb986('0x7'));var jayson=require(_0xb986('0x8'));var url=require(_0xb986('0x9'));var qs=require(_0xb986('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xb986('0xb'));var APIOutOfIntervalError=require(_0xb986('0xc'))[_0xb986('0xd')];var APINotFoundError=require('../../errors/api')[_0xb986('0xe')];var APIHandleError=require(_0xb986('0xc'))[_0xb986('0xf')];var db=require(_0xb986('0x10'))['db'];config['redis']=_['defaults'](config[_0xb986('0x11')],{'host':_0xb986('0x12'),'port':0x18eb});var socket=require(_0xb986('0x13'))(new Redis(config[_0xb986('0x11')]));require(_0xb986('0x14'))[_0xb986('0x15')](socket);var client=jayson[_0xb986('0x16')][_0xb986('0x17')]({'port':0x232c});var client9002=jayson[_0xb986('0x16')][_0xb986('0x17')]({'port':0x232a});var client9003=jayson[_0xb986('0x16')][_0xb986('0x17')]({'port':0x232b});var client9001=jayson[_0xb986('0x16')][_0xb986('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x53c1cf,_0x4f048a,_0x23e044,_0xd7f4e2){return new Promise(function(_0x3d0403,_0x1dfa4e){var _0x5aabd8=_0xd7f4e2||client;return _0x5aabd8[_0xb986('0x18')](_0x53c1cf,_0x23e044)['then'](function(_0x3d414a){logger['info'](_0xb986('0x19'),_0x4f048a,'request\x20sent');logger[_0xb986('0x1a')](_0xb986('0x1b'),_0x4f048a,_0xb986('0x1c'),JSON[_0xb986('0x1d')](_0x3d414a));if(_0x3d414a['error']){if(_0x3d414a['error']['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4f048a,_0x3d414a[_0xb986('0x1e')][_0xb986('0x1f')]);return _0x1dfa4e(_0x3d414a[_0xb986('0x1e')][_0xb986('0x1f')]);}logger[_0xb986('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x4f048a,_0x3d414a[_0xb986('0x1e')][_0xb986('0x1f')]);return _0x3d0403(_0x3d414a[_0xb986('0x1e')]['message']);}else{logger[_0xb986('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x4f048a,'request\x20sent');_0x3d0403(_0x3d414a[_0xb986('0x21')][_0xb986('0x1f')]);}})[_0xb986('0x22')](function(_0x2e66ed){logger[_0xb986('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x4f048a,_0x2e66ed);_0x1dfa4e(_0x2e66ed);});});}function respondWithStatusCode(_0xf207de,_0x19e1b4){_0x19e1b4=_0x19e1b4||0xcc;return function(_0x16c466){if(_0x16c466){return _0xf207de[_0xb986('0x23')](_0x19e1b4);}return _0xf207de[_0xb986('0x24')](_0x19e1b4)[_0xb986('0x25')]();};}function respondWithResult(_0x31aca4,_0x5d5b5b){_0x5d5b5b=_0x5d5b5b||0xc8;return function(_0x182e92){if(_0x182e92){return _0x31aca4[_0xb986('0x24')](_0x5d5b5b)[_0xb986('0x26')](_0x182e92);}};}function respondWithFilteredResult(_0xa086dc,_0x5b14c2){return function(_0x2a71ca){if(_0x2a71ca){var _0x1d9f1d=typeof _0x5b14c2['offset']==='undefined'&&typeof _0x5b14c2[_0xb986('0x27')]===_0xb986('0x28');var _0xa20715=_0x2a71ca[_0xb986('0x29')];var _0x2460bb=_0x1d9f1d?0x0:_0x5b14c2[_0xb986('0x2a')];var _0x198f04=_0x1d9f1d?_0x2a71ca[_0xb986('0x29')]:_0x5b14c2[_0xb986('0x2a')]+_0x5b14c2['limit'];var _0x258e62;if(_0x198f04>=_0xa20715){_0x198f04=_0xa20715;_0x258e62=0xc8;}else{_0x258e62=0xce;}_0xa086dc[_0xb986('0x24')](_0x258e62);return _0xa086dc[_0xb986('0x2b')]('Content-Range',_0x2460bb+'-'+_0x198f04+'/'+_0xa20715)[_0xb986('0x26')](_0x2a71ca);}return null;};}function saveUpdates(_0x5f497d){return function(_0x1a9b5a){if(_0x1a9b5a){return _0x1a9b5a['update'](_0x5f497d)[_0xb986('0x2c')](function(_0x1f62bc){return _0x1f62bc;});}return null;};}function removeEntity(_0x123e54){return function(_0x43fc06){if(_0x43fc06){return _0x43fc06[_0xb986('0x2d')]()[_0xb986('0x2c')](function(){var _0x3ba6f8=_0x43fc06[_0xb986('0x2e')]({'plain':!![]});var _0x33eb43=_0xb986('0x2f');return db[_0xb986('0x30')][_0xb986('0x2d')]({'where':{'type':_0x33eb43,'resourceId':_0x3ba6f8['id']}})[_0xb986('0x2c')](function(){return _0x43fc06;});})[_0xb986('0x2c')](function(){_0x123e54[_0xb986('0x24')](0xcc)[_0xb986('0x25')]();});}};}function handleEntityNotFound(_0x26079c){return function(_0x429e00){if(!_0x429e00){_0x26079c[_0xb986('0x23')](0x194);}return _0x429e00;};}function handleError(_0x22812b,_0x11d407){_0x11d407=_0x11d407||0x1f4;return function(_0x580529){logger[_0xb986('0x1e')](_0x580529[_0xb986('0x31')]);if(_0x580529[_0xb986('0x32')]){delete _0x580529[_0xb986('0x32')];}_0x22812b[_0xb986('0x24')](_0x11d407)['send'](_0x580529);};}function iftimePromise(_0x25cc17,_0x198689){return respondWithRpcPromise('Command',_0xb986('0x33'),{'command':_0x198689[_0xb986('0x34')]?util[_0xb986('0x35')](_0xb986('0x36'),_0x25cc17['interval'],_0x198689[_0xb986('0x34')]):util[_0xb986('0x35')]('iftime\x20%s',_0x25cc17[_0xb986('0x37')])},client9002)[_0xb986('0x2c')](function(_0x3c817b){var _0x32c802=_0x3c817b&&_0x3c817b[_0xb986('0x38')]('true')>=0x0?!![]:![];logger['info'](_0xb986('0x39'),_0x198689['id'],_0x25cc17['id'],_0x25cc17[_0xb986('0x37')],_0x32c802?'ONLINE':'OFFLINE',_0x198689[_0xb986('0x34')]?_0x198689[_0xb986('0x34')]:_0xb986('0x3a'));return _0x32c802;})['catch'](function(_0xf9e408){logger[_0xb986('0x1e')](_0xb986('0x39'),_0x198689['id'],_0x25cc17['id'],_0x25cc17['interval'],util[_0xb986('0x3b')](_0xf9e408,{'showHidden':![],'depth':null}),_0x198689[_0xb986('0x34')]?_0x198689[_0xb986('0x34')]:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x13e48c){var _0x4541f0=_[_0xb986('0x3c')](_0x13e48c['Interval'][_0xb986('0x3d')],function(_0x29e1f6){var _0x3577a6=_0x29e1f6[_0xb986('0x2e')]({'plain':!![]});return iftimePromise(_0x3577a6,_0x13e48c);});return Promise[_0xb986('0x3e')](_0x4541f0)[_0xb986('0x2c')](function(_0x51897d){return _[_0xb986('0x3f')](_0x51897d);});}function createInteractionObject(_0x1f1f8c,_0x343420,_0x1dcc39,_0x5b4eca){var _0x23f9b2=require(_0xb986('0x40'));var _0x4dfda2=new _0x23f9b2();var _0x49ab55=_0x4dfda2[_0xb986('0x41')](_0x1dcc39[_0xb986('0x42')])[_0xb986('0x43')]();var _0x24aa7b=_0x343420['customerIp'];if(_0x1dcc39[_0xb986('0x44')]){_0x24aa7b=_0x1dcc39['cf-connecting-ip'];}else if(_0x1dcc39[_0xb986('0x45')]){_0x24aa7b=_[_0xb986('0x46')](_0x1dcc39['x-forwarded-for'][_0xb986('0x47')](','));}return{'ContactId':_0x5b4eca['id'],'ChatWebsiteId':_0x1f1f8c,'from':(_0x5b4eca[_0xb986('0x48')]||'')+'\x20'+(_0x5b4eca[_0xb986('0x49')]||''),'customerIp':_0x24aa7b,'customerPort':_0x1dcc39[_0xb986('0x4a')]?_0x1dcc39[_0xb986('0x4a')]:null,'referer':_0x343420[_0xb986('0x4b')],'browserName':_0x49ab55[_0xb986('0x4c')]['name']&&_0x49ab55[_0xb986('0x4c')]['version']?util[_0xb986('0x35')](_0xb986('0x4d'),_0x49ab55['browser']['name'],_0x49ab55[_0xb986('0x4c')][_0xb986('0x4e')]):'unknown','browserVersion':_0x49ab55[_0xb986('0x4c')][_0xb986('0x4e')]||_0xb986('0x4f'),'osName':util[_0xb986('0x35')](_0xb986('0x4d'),_0x49ab55['os'][_0xb986('0x32')],_0x49ab55['os'][_0xb986('0x4e')]),'osVersion':_0x49ab55['os'][_0xb986('0x4e')],'deviceModel':_0x49ab55['device'][_0xb986('0x50')]&&_0x49ab55[_0xb986('0x51')][_0xb986('0x52')]?util[_0xb986('0x35')](_0xb986('0x53'),_0x49ab55[_0xb986('0x51')][_0xb986('0x50')],_0x49ab55[_0xb986('0x51')]['vendor'],_0x49ab55[_0xb986('0x51')]['type']):null,'deviceVendor':_0x49ab55[_0xb986('0x51')][_0xb986('0x52')],'deviceType':_0x49ab55['device'][_0xb986('0x54')],'formData':JSON[_0xb986('0x1d')](_0x343420)};}exports[_0xb986('0x55')]=function(_0x1ed915,_0x171d5a){var _0x1c8cbc={'include':[{'model':db[_0xb986('0x56')],'as':_0xb986('0x57')}]},_0x58a16d={},_0x2e4747={'count':0x0,'rows':[]};var _0x5373e9=_[_0xb986('0x3c')](db[_0xb986('0x58')][_0xb986('0x59')],function(_0x5e6307){return{'name':_0x5e6307[_0xb986('0x5a')],'type':_0x5e6307[_0xb986('0x54')][_0xb986('0x5b')]};});_0x58a16d[_0xb986('0x50')]=_[_0xb986('0x3c')](_0x5373e9,_0xb986('0x32'));_0x58a16d[_0xb986('0x5c')]=_[_0xb986('0x5d')](_0x1ed915[_0xb986('0x5c')]);_0x58a16d[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x58a16d[_0xb986('0x50')],_0x58a16d[_0xb986('0x5c')]);_0x1c8cbc[_0xb986('0x60')]=_[_0xb986('0x5f')](_0x58a16d[_0xb986('0x50')],qs[_0xb986('0x61')](_0x1ed915[_0xb986('0x5c')]['fields']));_0x1c8cbc[_0xb986('0x60')]=_0x1c8cbc[_0xb986('0x60')][_0xb986('0x62')]?_0x1c8cbc['attributes']:_0x58a16d[_0xb986('0x50')];if(!_0x1ed915[_0xb986('0x5c')]['hasOwnProperty']('nolimit')){_0x1c8cbc[_0xb986('0x27')]=qs[_0xb986('0x27')](_0x1ed915[_0xb986('0x5c')]['limit']);_0x1c8cbc['offset']=qs['offset'](_0x1ed915[_0xb986('0x5c')][_0xb986('0x2a')]);}_0x1c8cbc[_0xb986('0x63')]=qs[_0xb986('0x64')](_0x1ed915[_0xb986('0x5c')][_0xb986('0x64')]);_0x1c8cbc[_0xb986('0x65')]=qs[_0xb986('0x5e')](_[_0xb986('0x66')](_0x1ed915['query'],_0x58a16d[_0xb986('0x5e')]),_0x5373e9);if(_0x1ed915[_0xb986('0x5c')][_0xb986('0x67')]){_0x1c8cbc[_0xb986('0x65')]=_[_0xb986('0x68')](_0x1c8cbc[_0xb986('0x65')],{'$or':_[_0xb986('0x3c')](_0x5373e9,function(_0x5db15c){if(_0x5db15c[_0xb986('0x54')]!==_0xb986('0x69')){var _0x1c3cf0={};_0x1c3cf0[_0x5db15c[_0xb986('0x32')]]={'$like':'%'+_0x1ed915[_0xb986('0x5c')]['filter']+'%'};return _0x1c3cf0;}})});}_0x1c8cbc=_[_0xb986('0x68')]({},_0x1c8cbc,_0x1ed915['options']);var _0x35073a={'where':_0x1c8cbc[_0xb986('0x65')]};return db[_0xb986('0x58')][_0xb986('0x29')](_0x35073a)[_0xb986('0x2c')](function(_0x51da57){_0x2e4747[_0xb986('0x29')]=_0x51da57;if(_0x1ed915[_0xb986('0x5c')]['includeAll']){_0x1c8cbc['include']=[{'all':!![]}];}return db[_0xb986('0x58')][_0xb986('0x6a')](_0x1c8cbc);})[_0xb986('0x2c')](function(_0x2205f4){_0x2e4747[_0xb986('0x6b')]=_0x2205f4;return _0x2e4747;})['then'](respondWithFilteredResult(_0x171d5a,_0x1c8cbc))[_0xb986('0x22')](handleError(_0x171d5a,null));};exports[_0xb986('0x6c')]=function(_0x2794f4,_0x1c2246){var _0x389297={'raw':![],'where':{'id':_0x2794f4['params']['id']},'include':[{'model':db[_0xb986('0x56')],'as':_0xb986('0x57')}]},_0x30e56b={};_0x30e56b[_0xb986('0x50')]=_['keys'](db['ChatWebsite']['rawAttributes']);_0x30e56b['query']=_['keys'](_0x2794f4['query']);_0x30e56b[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x30e56b[_0xb986('0x50')],_0x30e56b['query']);_0x389297[_0xb986('0x60')]=_[_0xb986('0x5f')](_0x30e56b[_0xb986('0x50')],qs[_0xb986('0x61')](_0x2794f4['query']['fields']));_0x389297[_0xb986('0x60')]=_0x389297['attributes'][_0xb986('0x62')]?_0x389297[_0xb986('0x60')]:_0x30e56b[_0xb986('0x50')];if(_0x2794f4['query']['includeAll']){_0x389297[_0xb986('0x6d')]=[{'all':!![]}];}_0x389297=_[_0xb986('0x68')]({},_0x389297,_0x2794f4['options']);return db[_0xb986('0x58')]['find'](_0x389297)['then'](handleEntityNotFound(_0x1c2246,null))['then'](respondWithResult(_0x1c2246,null))['catch'](handleError(_0x1c2246,null));};exports[_0xb986('0x6e')]=function(_0x191b42,_0x5d968f){return db['ChatWebsite'][_0xb986('0x6e')](_0x191b42[_0xb986('0x6f')],{})[_0xb986('0x2c')](function(_0x48e66b){var _0x42760a=_0x191b42['user']['get']({'plain':!![]});if(!_0x42760a)throw new Error(_0xb986('0x70'));if(_0x42760a[_0xb986('0x71')]===_0xb986('0x72')){var _0x48decc=_0x48e66b[_0xb986('0x2e')]({'plain':!![]});var _0x346711=_0xb986('0x2f');return db[_0xb986('0x73')][_0xb986('0x74')]({'where':{'name':_0x346711,'userProfileId':_0x42760a[_0xb986('0x75')]},'raw':!![]})[_0xb986('0x2c')](function(_0x485b13){if(_0x485b13&&_0x485b13[_0xb986('0x76')]===0x0){return db['UserProfileResource'][_0xb986('0x6e')]({'name':_0x48decc['name'],'resourceId':_0x48decc['id'],'type':_0x485b13[_0xb986('0x32')],'sectionId':_0x485b13['id']},{})[_0xb986('0x2c')](function(){return _0x48e66b;});}else{return _0x48e66b;}})[_0xb986('0x22')](function(_0x5f0e3e){logger[_0xb986('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f0e3e);throw _0x5f0e3e;});}return _0x48e66b;})[_0xb986('0x2c')](respondWithResult(_0x5d968f,0xc9))['catch'](handleError(_0x5d968f,null));};exports[_0xb986('0x77')]=function(_0x4718c5,_0x4f75a1){if(_0x4718c5[_0xb986('0x6f')]['id']){delete _0x4718c5[_0xb986('0x6f')]['id'];}return db[_0xb986('0x58')][_0xb986('0x74')]({'where':{'id':_0x4718c5[_0xb986('0x78')]['id']},'include':[{'model':db[_0xb986('0x56')],'as':_0xb986('0x57')}]})[_0xb986('0x2c')](handleEntityNotFound(_0x4f75a1,null))['then'](saveUpdates(_0x4718c5[_0xb986('0x6f')],null))['then'](respondWithResult(_0x4f75a1,null))[_0xb986('0x22')](handleError(_0x4f75a1,null));};exports[_0xb986('0x2d')]=function(_0x1b1ddf,_0x5dab2e){return db[_0xb986('0x58')][_0xb986('0x74')]({'where':{'id':_0x1b1ddf[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x5dab2e,null))[_0xb986('0x2c')](removeEntity(_0x5dab2e,null))[_0xb986('0x22')](handleError(_0x5dab2e,null));};exports[_0xb986('0x79')]=function(_0x11b4da,_0xaa5326){return db[_0xb986('0x58')][_0xb986('0x79')]()[_0xb986('0x2c')](respondWithResult(_0xaa5326,null))['catch'](handleError(_0xaa5326,null));};exports[_0xb986('0x7a')]=function(_0x4f4a34,_0x235f96){if(_0x4f4a34[_0xb986('0x6f')]['id']){delete _0x4f4a34[_0xb986('0x6f')]['id'];}return db['ChatWebsite'][_0xb986('0x74')]({'where':{'id':_0x4f4a34[_0xb986('0x78')]['id']}})['then'](handleEntityNotFound(_0x235f96,null))['then'](function(_0x1011e9){if(_0x1011e9){_0x4f4a34[_0xb986('0x6f')][_0xb986('0x7b')]=_0x1011e9['id'];return db['Disposition'][_0xb986('0x6e')](_0x4f4a34['body']);}})[_0xb986('0x2c')](respondWithResult(_0x235f96,null))['catch'](handleError(_0x235f96,null));};exports[_0xb986('0x7c')]=function(_0x902fdc,_0x2f1bda){var _0x586e77={'raw':![],'where':{}};var _0x346dc0={};var _0x3e4f9f={'count':0x0,'rows':[]};return db[_0xb986('0x58')][_0xb986('0x7d')]({'where':{'id':_0x902fdc[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x2f1bda,null))[_0xb986('0x2c')](function(_0x5d4c3d){if(_0x5d4c3d){_0x346dc0['model']=_[_0xb986('0x5d')](db[_0xb986('0x7e')]['rawAttributes']);_0x346dc0[_0xb986('0x5c')]=_[_0xb986('0x5d')](_0x902fdc['query']);_0x346dc0[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x346dc0[_0xb986('0x50')],_0x346dc0['query']);_0x586e77[_0xb986('0x60')]=_['intersection'](_0x346dc0['model'],qs[_0xb986('0x61')](_0x902fdc[_0xb986('0x5c')][_0xb986('0x61')]));_0x586e77['attributes']=_0x586e77[_0xb986('0x60')]['length']?_0x586e77[_0xb986('0x60')]:_0x346dc0[_0xb986('0x50')];if(!_0x902fdc[_0xb986('0x5c')]['hasOwnProperty'](_0xb986('0x7f'))){_0x586e77[_0xb986('0x27')]=qs[_0xb986('0x27')](_0x902fdc[_0xb986('0x5c')][_0xb986('0x27')]);_0x586e77[_0xb986('0x2a')]=qs[_0xb986('0x2a')](_0x902fdc[_0xb986('0x5c')][_0xb986('0x2a')]);}_0x586e77[_0xb986('0x63')]=qs['sort'](_0x902fdc[_0xb986('0x5c')][_0xb986('0x64')]);_0x586e77[_0xb986('0x65')]=qs[_0xb986('0x5e')](_[_0xb986('0x66')](_0x902fdc['query'],_0x346dc0[_0xb986('0x5e')]));_0x586e77['where'][_0xb986('0x7b')]=_0x5d4c3d['id'];if(_0x902fdc[_0xb986('0x5c')][_0xb986('0x67')]){_0x586e77[_0xb986('0x65')]=_[_0xb986('0x68')](_0x586e77[_0xb986('0x65')],{'$or':_['map'](_0x586e77[_0xb986('0x60')],function(_0x5a9272){var _0x51e5ee={};_0x51e5ee[_0x5a9272]={'$like':'%'+_0x902fdc['query'][_0xb986('0x67')]+'%'};return _0x51e5ee;})});}_0x586e77=_['merge']({},_0x586e77,_0x902fdc['options']);return db[_0xb986('0x7e')]['count']({'where':_0x586e77[_0xb986('0x65')]})[_0xb986('0x2c')](function(_0x44dbcc){_0x3e4f9f[_0xb986('0x29')]=_0x44dbcc;if(_0x902fdc['query'][_0xb986('0x80')]){_0x586e77['include']=[{'all':!![]}];}return db['Disposition'][_0xb986('0x6a')](_0x586e77);})['then'](function(_0x5252e4){_0x3e4f9f[_0xb986('0x6b')]=_0x5252e4;return _0x3e4f9f;});}})[_0xb986('0x2c')](respondWithFilteredResult(_0x2f1bda,_0x586e77))[_0xb986('0x22')](handleError(_0x2f1bda,null));};exports[_0xb986('0x81')]=function(_0x44b934,_0xcad48c){return db[_0xb986('0x58')][_0xb986('0x74')]({'where':{'id':_0x44b934[_0xb986('0x78')]['id']}})['then'](handleEntityNotFound(_0xcad48c,null))[_0xb986('0x2c')](function(_0x4717aa){if(_0x4717aa){return _0x4717aa[_0xb986('0x81')](_0x44b934[_0xb986('0x5c')][_0xb986('0x82')]);}})[_0xb986('0x2c')](respondWithStatusCode(_0xcad48c,null))['catch'](handleError(_0xcad48c,null));};exports[_0xb986('0x83')]=function(_0x548e23,_0x3e11cb){if(_0x548e23[_0xb986('0x6f')]['id']){delete _0x548e23[_0xb986('0x6f')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x548e23[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x3e11cb,null))[_0xb986('0x2c')](function(_0x3c3fe0){if(_0x3c3fe0){_0x548e23[_0xb986('0x6f')][_0xb986('0x7b')]=_0x3c3fe0['id'];return db[_0xb986('0x84')][_0xb986('0x6e')](_0x548e23[_0xb986('0x6f')]);}})[_0xb986('0x2c')](respondWithResult(_0x3e11cb,null))['catch'](handleError(_0x3e11cb,null));};exports['getAnswers']=function(_0x1872cd,_0x50131){var _0x5bd132={'raw':![],'where':{}};var _0x288c0f={};var _0x2ec996={'count':0x0,'rows':[]};return db[_0xb986('0x58')][_0xb986('0x7d')]({'where':{'id':_0x1872cd[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x50131,null))[_0xb986('0x2c')](function(_0x3a976b){if(_0x3a976b){_0x288c0f[_0xb986('0x50')]=_[_0xb986('0x5d')](db[_0xb986('0x84')][_0xb986('0x59')]);_0x288c0f[_0xb986('0x5c')]=_['keys'](_0x1872cd[_0xb986('0x5c')]);_0x288c0f[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x288c0f[_0xb986('0x50')],_0x288c0f['query']);_0x5bd132[_0xb986('0x60')]=_['intersection'](_0x288c0f[_0xb986('0x50')],qs['fields'](_0x1872cd[_0xb986('0x5c')][_0xb986('0x61')]));_0x5bd132[_0xb986('0x60')]=_0x5bd132[_0xb986('0x60')][_0xb986('0x62')]?_0x5bd132['attributes']:_0x288c0f['model'];if(!_0x1872cd[_0xb986('0x5c')]['hasOwnProperty'](_0xb986('0x7f'))){_0x5bd132[_0xb986('0x27')]=qs[_0xb986('0x27')](_0x1872cd[_0xb986('0x5c')][_0xb986('0x27')]);_0x5bd132[_0xb986('0x2a')]=qs[_0xb986('0x2a')](_0x1872cd['query']['offset']);}_0x5bd132[_0xb986('0x63')]=qs[_0xb986('0x64')](_0x1872cd[_0xb986('0x5c')][_0xb986('0x64')]);_0x5bd132[_0xb986('0x65')]=qs[_0xb986('0x5e')](_[_0xb986('0x66')](_0x1872cd[_0xb986('0x5c')],_0x288c0f['filters']));_0x5bd132[_0xb986('0x65')][_0xb986('0x7b')]=_0x3a976b['id'];if(_0x1872cd[_0xb986('0x5c')][_0xb986('0x67')]){_0x5bd132[_0xb986('0x65')]=_[_0xb986('0x68')](_0x5bd132['where'],{'$or':_[_0xb986('0x3c')](_0x5bd132[_0xb986('0x60')],function(_0x3db336){var _0x43d30a={};_0x43d30a[_0x3db336]={'$like':'%'+_0x1872cd[_0xb986('0x5c')][_0xb986('0x67')]+'%'};return _0x43d30a;})});}_0x5bd132=_[_0xb986('0x68')]({},_0x5bd132,_0x1872cd[_0xb986('0x85')]);return db[_0xb986('0x84')][_0xb986('0x29')]({'where':_0x5bd132[_0xb986('0x65')]})[_0xb986('0x2c')](function(_0x4d395d){_0x2ec996[_0xb986('0x29')]=_0x4d395d;if(_0x1872cd[_0xb986('0x5c')][_0xb986('0x80')]){_0x5bd132[_0xb986('0x6d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb986('0x6a')](_0x5bd132);})[_0xb986('0x2c')](function(_0x49b77d){_0x2ec996[_0xb986('0x6b')]=_0x49b77d;return _0x2ec996;});}})['then'](respondWithFilteredResult(_0x50131,_0x5bd132))[_0xb986('0x22')](handleError(_0x50131,null));};exports[_0xb986('0x86')]=function(_0x4424a9,_0x4402fc){return db['ChatWebsite']['find']({'where':{'id':_0x4424a9[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x4402fc,null))[_0xb986('0x2c')](function(_0x5e1f3e){if(_0x5e1f3e){return _0x5e1f3e[_0xb986('0x86')](_0x4424a9[_0xb986('0x5c')][_0xb986('0x82')]);}})[_0xb986('0x2c')](respondWithStatusCode(_0x4402fc,null))[_0xb986('0x22')](handleError(_0x4402fc,null));};exports[_0xb986('0x87')]=function(_0x158806,_0x35d4e6){_0x158806['body']['sitepic']=_0x158806[_0xb986('0x88')]['filename'];return db['ChatWebsite'][_0xb986('0x74')]({'where':{'id':_0x158806[_0xb986('0x78')]['id']}})['then'](handleEntityNotFound(_0x35d4e6,null))[_0xb986('0x2c')](saveUpdates(_0x158806['body'],null))[_0xb986('0x2c')](respondWithResult(_0x35d4e6,null))['catch'](handleError(_0x35d4e6,null));};exports['addAvatar']=function(_0x7fb8cd,_0x29977d){_0x7fb8cd[_0xb986('0x6f')]['agentAvatar']=_0x7fb8cd[_0xb986('0x88')][_0xb986('0x89')];return db[_0xb986('0x58')][_0xb986('0x74')]({'where':{'id':_0x7fb8cd[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x29977d,null))[_0xb986('0x2c')](saveUpdates(_0x7fb8cd[_0xb986('0x6f')],null))['then'](respondWithResult(_0x29977d,null))[_0xb986('0x22')](handleError(_0x29977d,null));};exports['addCustomerAvatar']=function(_0x2c57b9,_0x267759){_0x2c57b9[_0xb986('0x6f')]['customerAvatar']=_0x2c57b9['file'][_0xb986('0x89')];return db[_0xb986('0x58')][_0xb986('0x74')]({'where':{'id':_0x2c57b9[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x267759,null))[_0xb986('0x2c')](saveUpdates(_0x2c57b9['body'],null))[_0xb986('0x2c')](respondWithResult(_0x267759,null))['catch'](handleError(_0x267759,null));};exports[_0xb986('0x8a')]=function(_0x2c4327,_0x2116aa){_0x2c4327['body'][_0xb986('0x8b')]=_0x2c4327[_0xb986('0x88')]['filename'];return db[_0xb986('0x58')][_0xb986('0x74')]({'where':{'id':_0x2c4327[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x2116aa,null))[_0xb986('0x2c')](saveUpdates(_0x2c4327['body'],null))[_0xb986('0x2c')](respondWithResult(_0x2116aa,null))['catch'](handleError(_0x2116aa,null));};exports[_0xb986('0x8c')]=function(_0x28334e,_0x56b321){var _0x5a6f24=path['join'](config['root'],_0xb986('0x8d'));var _0x425020={'where':{'id':_0x28334e[_0xb986('0x78')]['id']},'attributes':['id',_0xb986('0x8e')],'raw':!![]};var _0x5e40b4=![];return require(_0xb986('0x8f'))[_0xb986('0x90')]()[_0xb986('0x2c')](function(_0x369b05){if(_0x369b05){_0x5e40b4=_0x369b05['custom'];}})['then'](function(){return db[_0xb986('0x58')]['find'](_0x425020);})[_0xb986('0x2c')](handleEntityNotFound(_0x56b321,null))['then'](function(_0x6e3e1f){if(_0x6e3e1f){if(!_[_0xb986('0x91')](_0x6e3e1f[_0xb986('0x8e')])){if(fs[_0xb986('0x92')](path[_0xb986('0x93')](config[_0xb986('0x94')],_0xb986('0x95'),_0x6e3e1f[_0xb986('0x8e')]))&&_0x5e40b4){_0x5a6f24=path[_0xb986('0x93')](config['root'],_0xb986('0x95'),_0x6e3e1f['sitepic']);}}return _0x56b321['download'](_0x5a6f24);}})[_0xb986('0x22')](handleError(_0x56b321,null));};exports[_0xb986('0x96')]=function(_0x3f2dd5,_0x3440fa){var _0x518eba=path['join'](config[_0xb986('0x94')],'server/files/images/avatars/default_avatar.png');var _0x2427ee={'where':{'id':_0x3f2dd5[_0xb986('0x78')]['id']},'attributes':['id',_0xb986('0x97')],'raw':!![]};return db[_0xb986('0x58')][_0xb986('0x74')](_0x2427ee)[_0xb986('0x2c')](handleEntityNotFound(_0x3440fa,null))[_0xb986('0x2c')](function(_0x36535e){if(_0x36535e){if(!_[_0xb986('0x91')](_0x36535e[_0xb986('0x97')])){if(fs[_0xb986('0x92')](path[_0xb986('0x93')](config[_0xb986('0x94')],_0xb986('0x98'),_0x36535e[_0xb986('0x97')]))){_0x518eba=path[_0xb986('0x93')](config['root'],_0xb986('0x98'),_0x36535e['agentAvatar']);}}return _0x3440fa['download'](_0x518eba);}})[_0xb986('0x22')](handleError(_0x3440fa,null));};exports[_0xb986('0x99')]=function(_0x579653,_0x3e8b45){var _0x53c520=path[_0xb986('0x93')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x39bb65={'where':{'id':_0x579653['params']['id']},'attributes':['id',_0xb986('0x9a'),_0xb986('0x9b')],'raw':!![]};return db[_0xb986('0x58')][_0xb986('0x74')](_0x39bb65)['then'](handleEntityNotFound(_0x3e8b45,null))[_0xb986('0x2c')](function(_0x5e4538){if(_0x5e4538){if(!_[_0xb986('0x91')](_0x5e4538['customerAvatar'])){if(fs[_0xb986('0x92')](path[_0xb986('0x93')](config[_0xb986('0x94')],_0xb986('0x98'),_0x5e4538[_0xb986('0x9a')]))&&_0x5e4538[_0xb986('0x9b')]){_0x53c520=path[_0xb986('0x93')](config['root'],'server/files/images/avatars/',_0x5e4538[_0xb986('0x9a')]);}}return _0x3e8b45['download'](_0x53c520);}})[_0xb986('0x22')](handleError(_0x3e8b45,null));};exports[_0xb986('0x9c')]=function(_0x2c8f7b,_0xe1cb08){var _0x114037=path['join'](config[_0xb986('0x94')],'server/files/images/avatars/system_avatar.png');var _0x20aeef={'where':{'id':_0x2c8f7b[_0xb986('0x78')]['id']},'attributes':['id',_0xb986('0x8b')],'raw':!![]};return db['ChatWebsite'][_0xb986('0x74')](_0x20aeef)[_0xb986('0x2c')](handleEntityNotFound(_0xe1cb08,null))['then'](function(_0x191ea0){if(_0x191ea0){if(!_['isNil'](_0x191ea0[_0xb986('0x8b')])){if(fs['existsSync'](path[_0xb986('0x93')](config[_0xb986('0x94')],_0xb986('0x98'),_0x191ea0[_0xb986('0x8b')]))){_0x114037=path['join'](config[_0xb986('0x94')],_0xb986('0x98'),_0x191ea0['systemAvatar']);}}return _0xe1cb08[_0xb986('0x9d')](_0x114037);}})[_0xb986('0x22')](handleError(_0xe1cb08,null));};exports[_0xb986('0x9e')]=function(_0x1f752d,_0x491aa3){var _0x5452be={'body':_0x1f752d[_0xb986('0x6f')],'channel':_0xb986('0x9f')};var _0x2f1563=[];var _0x14d6d0=[];var _0xc33135={};var _0x385475=![];return db['CmContact'][_0xb986('0x79')]()[_0xb986('0x2c')](function(_0x106ff8){if(!_0x106ff8){throw new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xa2'));}_0x2f1563=_['difference'](_[_0xb986('0x5d')](_0x106ff8),[_0xb986('0xa3'),_0xb986('0xa4')]);_0x14d6d0=_[_0xb986('0xa5')](_[_0xb986('0x5d')](_0x106ff8),[_0xb986('0xa3'),_0xb986('0xa4'),_0xb986('0xa6'),_0xb986('0xa7')]);if(_0x1f752d[_0xb986('0x6f')]['id']){delete _0x1f752d[_0xb986('0x6f')]['id'];}if(_[_0xb986('0x91')](_0x1f752d[_0xb986('0x6f')]['from'])){throw new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xa8'));}if(_[_0xb986('0x91')](_0x1f752d[_0xb986('0x6f')][_0xb986('0x6f')])||_0x1f752d['body']['body']===''){throw new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xa9'));}if(_[_0xb986('0x91')](_0x1f752d[_0xb986('0x6f')]['mapKey'])){throw new db[(_0xb986('0xa0'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14d6d0);}if(!_[_0xb986('0xaa')](_0x14d6d0,_0x1f752d[_0xb986('0x6f')][_0xb986('0xab')])){throw new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xac')+_0x14d6d0);}_0xc33135[_0x1f752d[_0xb986('0x6f')]['mapKey']]=_0x1f752d['body'][_0xb986('0xad')];})['then'](function(){return db['ChatWebsite'][_0xb986('0x74')]({'where':{'id':_0x1f752d[_0xb986('0x78')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xb986('0xae'),'where':_0xc33135,'limit':0x1,'order':[[_0xb986('0xa4'),_0xb986('0xaf')]]}]},{'model':db[_0xb986('0xb0')],'as':_0xb986('0xb1')},{'model':db[_0xb986('0xb2')],'as':_0xb986('0xb2'),'include':[{'model':db[_0xb986('0xb2')],'as':_0xb986('0x3d'),'attributes':['id',_0xb986('0x37')],'raw':!![]}]}]});})[_0xb986('0x2c')](function(_0x1a3de9){if(!_0x1a3de9)throw new APINotFoundError(util[_0xb986('0x35')](_0xb986('0xb3'),_0x1f752d['params']['id']));if(!_0x1a3de9[_0xb986('0xb2')]||!_0x1a3de9['Interval'][_0xb986('0x3d')])return[_0x1a3de9,!![]];return[_0x1a3de9,checkWebsiteIntervals(_0x1a3de9)];})['spread'](function(_0xdcb9b,_0x582f79){if(!_0x582f79)throw new APIOutOfIntervalError();if(!_0xdcb9b[_0xb986('0xb4')])return;_0x5452be[_0xb986('0xb5')]=_0xdcb9b;_0x5452be[_0xb986('0xb6')]=_0xdcb9b[_0xb986('0xb4')];_0x5452be[_0xb986('0xb7')]=_['orderBy'](_0xdcb9b[_0xb986('0xb1')],[_0xb986('0xb8')],[_0xb986('0xb9')]);if(_0x5452be[_0xb986('0xb5')]['Applications']){delete _0x5452be['account'][_0xb986('0xb1')];}if(_0x5452be['account'][_0xb986('0xb4')]&&_0x5452be[_0xb986('0xb5')][_0xb986('0xb4')]['Contacts'][_0xb986('0x62')]){return _0x5452be[_0xb986('0xb5')][_0xb986('0xb4')]['Contacts'][0x0];}var _0x336134=_[_0xb986('0xba')](_0x1f752d[_0xb986('0x6f')],{'firstName':_0x1f752d[_0xb986('0x6f')][_0xb986('0xad')],'ListId':_0xdcb9b[_0xb986('0xa7')]});_0x336134[_0x1f752d[_0xb986('0x6f')][_0xb986('0xab')]]=_0x1f752d[_0xb986('0x6f')][_0xb986('0xad')];return db['CmContact'][_0xb986('0x6e')](_0x336134,{'fields':_0x2f1563,'raw':!![]});})[_0xb986('0x2c')](function(_0x419593){_0x5452be[_0xb986('0xbb')]=_0x419593;var _0x4abb86=createInteractionObject(_0x1f752d[_0xb986('0x78')]['id'],_0x1f752d[_0xb986('0x6f')],_0x1f752d[_0xb986('0xbc')],_0x419593);var _0x2e4553={'ChatWebsiteId':_0x1f752d['params']['id'],'closed':![]};if(_0x1f752d['body'][_0xb986('0xbd')]){_0x2e4553[_0xb986('0xbd')]=_0x1f752d[_0xb986('0x6f')][_0xb986('0xbd')];return db['ChatInteraction'][_0xb986('0x74')]({'where':_0x2e4553})['then'](function(_0x40b623){if(_0x40b623){_0x385475=!![];return _0x40b623;}_0x4abb86['threadId']=_0x1f752d[_0xb986('0x6f')][_0xb986('0xbd')];_0x4abb86['externalUrl']=_0x1f752d['body'][_0xb986('0xbe')];return db[_0xb986('0xbf')]['create'](_0x4abb86);});}_0x2e4553['ContactId']=_0x419593['id'];if(_0x1f752d[_0xb986('0x6f')][_0xb986('0xc0')]&&_0x1f752d[_0xb986('0x6f')]['interaction']['id']){_0x2e4553['id']=_0x1f752d[_0xb986('0x6f')][_0xb986('0xc0')]['id'];return db['ChatInteraction'][_0xb986('0x74')]({'where':_0x2e4553})[_0xb986('0x2c')](function(_0x253816){if(_0x253816){_0x385475=!![];return _0x253816;}return db[_0xb986('0xbf')][_0xb986('0x6e')](_0x4abb86);});}return db['ChatInteraction'][_0xb986('0x6e')](_0x4abb86);})[_0xb986('0x2c')](function(_0x2be7df){if(!_0x385475)return _0x2be7df;var _0x216358={'from':(_0x5452be[_0xb986('0xbb')][_0xb986('0x48')]||'')+'\x20'+(_0x5452be[_0xb986('0xbb')]['lastName']||'')};if(_0x1f752d[_0xb986('0x6f')]['threadId']&&_0x1f752d[_0xb986('0x6f')][_0xb986('0xc1')]&&_0x1f752d[_0xb986('0x6f')]['threadId']!=_0x1f752d[_0xb986('0x6f')][_0xb986('0xc1')]){_0x216358[_0xb986('0xbd')]=_0x1f752d[_0xb986('0x6f')][_0xb986('0xc1')];}return _0x2be7df['update'](_0x216358);})[_0xb986('0x2c')](function(_0x441479){_0x5452be[_0xb986('0xc0')]=_0x441479[_0xb986('0x2e')]({'plain':!![]});_0x5452be['interaction'][_0xb986('0xc2')]=!_0x385475;if(_0x5452be['interaction'][_0xb986('0xc2')]){if(_0x5452be[_0xb986('0xb5')][_0xb986('0xc3')]){_0x5452be[_0xb986('0xb7')]['push']({'id':0x0,'priority':_0x5452be[_0xb986('0xb7')]['length']+0x1,'app':'close','appdata':_0xb986('0xc4'),'interval':_0xb986('0xc5')});}}return db[_0xb986('0xc6')][_0xb986('0x6e')]({'body':_0x1f752d[_0xb986('0x6f')][_0xb986('0x6f')],'ChatWebsiteId':_0x1f752d[_0xb986('0x78')]['id'],'ChatInteractionId':_0x441479['id'],'direction':'in','ContactId':_0x5452be['contact']['id'],'AttachmentId':_0x1f752d[_0xb986('0x6f')][_0xb986('0xc7')]});})[_0xb986('0x2c')](function(_0x4cd5b9){_0x5452be['message']=_0x4cd5b9;if(!_0x5452be[_0xb986('0xc0')][_0xb986('0xc8')]){return;}return db[_0xb986('0xc9')]['find']({'attributes':['id',_0xb986('0x32')],'where':{'id':_0x5452be[_0xb986('0xc0')]['UserId']}});})[_0xb986('0x2c')](function(_0x5cba61){if(_0x5cba61){_0x5452be['applications'][_0xb986('0xca')]({'id':0x0,'priority':0x0,'app':_0xb986('0xcb'),'appdata':_0x5cba61['name']+','+(_0x5452be['account']['waitForTheAssignedAgent']||0xa),'interval':_0xb986('0xc5')});_0x5452be['forcedOwnership']=!![];}if(!_0x5452be[_0xb986('0xc0')]['queueId']){return;}return db['ChatQueue'][_0xb986('0x74')]({'attributes':['id',_0xb986('0x32')],'where':{'id':_0x5452be[_0xb986('0xc0')][_0xb986('0xcc')]}});})['then'](function(_0x3dee1c){if(_0x3dee1c){_0x5452be[_0xb986('0xb7')][_0xb986('0xca')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3dee1c[_0xb986('0x32')]+','+(_0x5452be[_0xb986('0xb5')][_0xb986('0xcd')]||0x12c),'interval':_0xb986('0xc5')});}return respondWithRpcPromise(_0xb986('0xce'),'startRouting',_0x5452be);})[_0xb986('0x2c')](function(_0x37e70e){respondWithRpcPromise(_0xb986('0xcf'),_0xb986('0xcf'),{'event':_0xb986('0x9e'),'message':_0x37e70e},client9002);return _0x37e70e;})['then'](respondWithResult(_0x491aa3,null))[_0xb986('0x22')](APIHandleError(_0x491aa3));};exports[_0xb986('0xd0')]=function(_0x274acc,_0x55bfad){var _0x473292,_0x439265,_0x25b63c;var _0x30167e=[];var _0x244231={};var _0x5e899f=_0x274acc[_0xb986('0xd1')]||[];var _0x575738=[];var _0x401833;return db[_0xb986('0xd2')][_0xb986('0x79')]()[_0xb986('0x2c')](function(_0x4c8ced){if(!_0x4c8ced){throw new db['Sequelize']['ValidationError'](_0xb986('0xa2'));}_0x30167e=_[_0xb986('0xa5')](_[_0xb986('0x5d')](_0x4c8ced),[_0xb986('0xa3'),_0xb986('0xa4'),'CompanyId',_0xb986('0xa7')]);if(_0x274acc[_0xb986('0x6f')]['id']){delete _0x274acc[_0xb986('0x6f')]['id'];}if(_[_0xb986('0x91')](_0x274acc[_0xb986('0x6f')]['from'])){throw _0x55bfad[_0xb986('0x24')](0x1f4)['send'](new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xa8')));}if(_[_0xb986('0x91')](_0x274acc[_0xb986('0x6f')][_0xb986('0x6f')])||_0x274acc[_0xb986('0x6f')][_0xb986('0x6f')]===''){throw _0x55bfad[_0xb986('0x24')](0x1f4)[_0xb986('0xd3')](new db[(_0xb986('0xa0'))]['ValidationError'](_0xb986('0xa9')));}if(_[_0xb986('0x91')](_0x274acc[_0xb986('0x6f')][_0xb986('0xd4')])){throw _0x55bfad[_0xb986('0x24')](0x1f4)[_0xb986('0xd3')](new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xd5')+_0x30167e));}if(!_[_0xb986('0xaa')](_0x30167e,_0x274acc[_0xb986('0x6f')][_0xb986('0xd4')])){throw _0x55bfad[_0xb986('0x24')](0x1f4)[_0xb986('0xd3')](new db[(_0xb986('0xa0'))][(_0xb986('0xa1'))](_0xb986('0xd6')+_0x30167e));}_0x244231[_0x274acc[_0xb986('0x6f')]['mapKeyOffline']]=_0x274acc[_0xb986('0x6f')][_0xb986('0xad')];})[_0xb986('0x2c')](function(){return db['ChatWebsite'][_0xb986('0x74')]({'where':{'id':_0x274acc[_0xb986('0x78')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xb986('0xd7')],'as':'MailAccount'}]});})[_0xb986('0x2c')](handleEntityNotFound(_0x55bfad,null))[_0xb986('0x2c')](function(_0x310181){if(_0x310181&&_0x310181[_0xb986('0xb4')]){_0x439265=_0x310181;var _0x59b5c9=_[_0xb986('0xba')](_0x274acc['body'],{'firstName':_0x274acc[_0xb986('0x6f')][_0xb986('0xad')],'phone':_0x274acc[_0xb986('0x6f')][_0xb986('0xad')],'ListId':_0x310181[_0xb986('0xa7')]});_0x59b5c9[_0x274acc[_0xb986('0x6f')][_0xb986('0xd4')]]=_0x274acc[_0xb986('0x6f')][_0xb986('0xad')];return db[_0xb986('0xd2')]['findOrCreate']({'where':_0x244231,'defaults':_0x59b5c9});}})[_0xb986('0xd8')](function(_0x4ba9a3){if(_0x4ba9a3){_0x25b63c=_0x4ba9a3;var _0x3c2606=fs['readFileSync'](path[_0xb986('0x93')](config[_0xb986('0x94')],_0xb986('0xd9')),_0xb986('0xda'));var _0x381a4b=ejs['render'](_0x3c2606,{'body':_['toPairs'](_0x274acc['body']['body']),'bodyTitle':_0x439265[_0xb986('0xdb')]});return db[_0xb986('0xdc')][_0xb986('0x6e')]({'body':_0x381a4b,'plainBody':htmlToText['fromString'](_0x381a4b),'ContactId':_0x4ba9a3['id'],'ChatWebsiteId':_0x439265['id']});}})['then'](function(_0x4a6978){_0x401833=_0x4a6978;if(_0x5e899f[_0xb986('0x62')]){var _0x19dc32=_0x5e899f['map'](function(_0x2e1710){return{'name':_0x2e1710[_0xb986('0xdd')],'basename':_0x2e1710[_0xb986('0x89')],'type':_0x2e1710['mimetype'],'ChatOfflineMessageId':_0x4a6978['id']};});_0x575738=_0x19dc32[_0xb986('0x3c')](_0x103e64=>{var _0x1a6137={'filename':_0x103e64['name'],'path':path['join'](config[_0xb986('0x94')],_0xb986('0xde'),_0xb986('0xd1'),_0xb986('0xdf'),'offline-chat',_0x103e64[_0xb986('0xe0')])};return _0x1a6137;});if(!_0x439265[_0xb986('0xe1')]){return db[_0xb986('0xe2')]['transaction'](function(_0x429b2b){return db[_0xb986('0xe3')][_0xb986('0xe4')](_0x19dc32,{'transaction':_0x429b2b});});}}})[_0xb986('0x2c')](function(){if(_0x401833){_0x473292=_0x401833;return db[_0xb986('0xd7')][_0xb986('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0xb986('0xe5')],'as':_0xb986('0xe6'),'raw':!![],'include':[{'model':db[_0xb986('0xe7')],'as':_0xb986('0xe7'),'raw':!![]}]}]});}})[_0xb986('0x2c')](function(_0xae91c5){if(_0xae91c5&&_0xae91c5[_0xb986('0xe6')]&&_0x439265[_0xb986('0xe8')]&&_0x439265[_0xb986('0xe9')]){var _0x3c96ba=_0xae91c5[_0xb986('0xea')]();return respondWithRpcPromise('SendMail',_0xb986('0xeb'),{'account':_0x3c96ba,'message':{'from':util[_0xb986('0x35')](_0xb986('0xec'),_0xae91c5[_0xb986('0x32')],_0xae91c5[_0xb986('0xed')]||_0xae91c5[_0xb986('0xe6')][_0xb986('0x72')]),'to':_0x439265['forwardOfflineAddress'],'subject':_0x439265[_0xb986('0xee')],'html':_0x473292['body'],'attachments':_0x575738}},client9003)[_0xb986('0x2c')](function(){return _0x473292;})['catch'](function(_0x23f4f5){logger[_0xb986('0x1e')](_0x23f4f5);});}})[_0xb986('0x2c')](function(){if(_0x439265&&_0x439265[_0xb986('0xe1')]&&_0x439265[_0xb986('0xef')]){var _0x4df51e=[];if(_0x5e899f[_0xb986('0x62')]){_0x4df51e=_0x5e899f[_0xb986('0x3c')](function(_0x288f74){return{'name':_0x288f74[_0xb986('0xdd')],'basename':_0x288f74[_0xb986('0x89')],'type':_0x288f74[_0xb986('0xf0')],'ChatOfflineMessageId':_0x401833['id']};});}var _0x17c67d;if(!_[_0xb986('0x91')](_0x439265[_0xb986('0xf1')])){var _0x2fd1b2=_['map'](_0x274acc['body'],function(_0x329117){return _0x329117;});var _0x112d58=_[_0xb986('0xf2')](_0x2fd1b2)[0x0];var _0x9fe403=_[_0xb986('0xf3')](_0x112d58,function(_0x13ea4d){return _0x13ea4d;});_0x17c67d=_0x9fe403[0x1][_0x439265[_0xb986('0xf1')]];}var _0x5e1da2={'from':_0x25b63c[_0xb986('0xed')],'firstName':_0x25b63c[_0xb986('0x48')],'lastName':_0x25b63c['lastName'],'mapKey':_0xb986('0xed'),'message':{'from':_0x25b63c[_0xb986('0xed')],'to':_0x439265['MailAccount'][_0xb986('0xed')],'cc':'','subject':_[_0xb986('0x91')](_0x17c67d)?_0x439265[_0xb986('0xee')]:_0x17c67d,'messageId':'','sentAt':new Date(),'attach':_0x4df51e[_0xb986('0x62')],'attachments':_0x4df51e,'originChannel':'Chat','ChatWebsiteId':_0x439265['id'],'ChatOfflineMessageId':_0x473292['id'],'originTo':_0x439265[_0xb986('0xd7')]['email']},'body':_0x473292[_0xb986('0x6f')]};var _0x2f6228={'account':{'id':_0x439265[_0xb986('0xef')]},'body':_0x5e1da2,'log':_0xb986('0xf4')};return respondWithRpcPromise(_0xb986('0xf4'),_0xb986('0xf5'),_0x2f6228,client9001)['then'](function(){return _0x473292;})['catch'](function(_0x30cd0b){logger[_0xb986('0x1e')](_0x30cd0b);});}return;})[_0xb986('0x2c')](function(){if(_0x473292){return _0x473292;}})[_0xb986('0x2c')](respondWithResult(_0x55bfad,null))[_0xb986('0x22')](function(){for(var _0x5d3414 of _0x5e899f){var _0x1462d2=path[_0xb986('0x93')](config[_0xb986('0x94')],_0xb986('0xde'),_0xb986('0xd1'),_0xb986('0xdf'),'offline-chat',_0x5d3414['filename']);fs_extra['remove'](_0x1462d2)[_0xb986('0x22')](function(_0x157ede){logger['error'](_0xb986('0xf6'),_0x1462d2,_0x157ede);});}});};exports[_0xb986('0xf7')]=function(_0x4daf62,_0x5abecf){return db['ChatInteraction'][_0xb986('0x74')]({'where':{'id':_0x4daf62[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x5abecf,null))[_0xb986('0x2c')](function(_0x3aa348){if(_0x3aa348){return _0x3aa348[_0xb986('0xf7')](_0x4daf62[_0xb986('0x6f')][_0xb986('0x82')],_[_0xb986('0xf8')](_0x4daf62[_0xb986('0x6f')],['ids','id'])||{});}})['then'](respondWithResult(_0x5abecf,null))['catch'](handleError(_0x5abecf,null));};exports[_0xb986('0xf9')]=function(_0xb24df6,_0x3e87e7){var _0x5beae8={'raw':![],'where':{}};var _0x44f3f6={};var _0x11ace6={'count':0x0,'rows':[]};return db[_0xb986('0x58')][_0xb986('0x7d')]({'where':{'id':_0xb24df6['params']['id']}})['then'](handleEntityNotFound(_0x3e87e7,null))['then'](function(_0x4ced81){if(_0x4ced81){_0x44f3f6[_0xb986('0x50')]=_[_0xb986('0x5d')](db[_0xb986('0xbf')][_0xb986('0x59')]);_0x44f3f6[_0xb986('0x5c')]=_[_0xb986('0x5d')](_0xb24df6[_0xb986('0x5c')]);_0x44f3f6[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x44f3f6[_0xb986('0x50')],_0x44f3f6['query']);_0x5beae8[_0xb986('0x60')]=_[_0xb986('0x5f')](_0x44f3f6[_0xb986('0x50')],qs['fields'](_0xb24df6['query'][_0xb986('0x61')]));_0x5beae8[_0xb986('0x60')]=_0x5beae8[_0xb986('0x60')][_0xb986('0x62')]?_0x5beae8[_0xb986('0x60')]:_0x44f3f6[_0xb986('0x50')];if(!_0xb24df6[_0xb986('0x5c')][_0xb986('0xfa')]('nolimit')){_0x5beae8[_0xb986('0x27')]=qs[_0xb986('0x27')](_0xb24df6['query']['limit']);_0x5beae8[_0xb986('0x2a')]=qs[_0xb986('0x2a')](_0xb24df6[_0xb986('0x5c')][_0xb986('0x2a')]);}_0x5beae8[_0xb986('0x63')]=qs[_0xb986('0x64')](_0xb24df6[_0xb986('0x5c')]['sort']);_0x5beae8[_0xb986('0x65')]=qs[_0xb986('0x5e')](_[_0xb986('0x66')](_0xb24df6[_0xb986('0x5c')],_0x44f3f6['filters']));_0x5beae8['where']['ChatWebsiteId']=_0x4ced81['id'];if(_0xb24df6[_0xb986('0x5c')]['filter']){_0x5beae8[_0xb986('0x65')]=_['merge'](_0x5beae8[_0xb986('0x65')],{'$or':_[_0xb986('0x3c')](_0x5beae8[_0xb986('0x60')],function(_0x59335e){var _0x4ded9c={};_0x4ded9c[_0x59335e]={'$like':'%'+_0xb24df6[_0xb986('0x5c')][_0xb986('0x67')]+'%'};return _0x4ded9c;})});}_0x5beae8=_[_0xb986('0x68')]({},_0x5beae8,_0xb24df6[_0xb986('0x85')]);return db[_0xb986('0xbf')][_0xb986('0x29')]({'where':_0x5beae8[_0xb986('0x65')]})[_0xb986('0x2c')](function(_0x27d3da){_0x11ace6['count']=_0x27d3da;if(_0xb24df6[_0xb986('0x5c')][_0xb986('0x80')]){_0x5beae8[_0xb986('0x6d')]=[{'model':db[_0xb986('0xd2')],'as':'Contact','required':![]},{'model':db[_0xb986('0xc9')],'as':_0xb986('0xfb'),'attributes':['name',_0xb986('0xfc'),_0xb986('0xfd')],'required':![]},{'model':db[_0xb986('0xfe')],'as':_0xb986('0xff'),'attributes':['id',_0xb986('0x32'),_0xb986('0x100')],'where':_0xb24df6['query'][_0xb986('0x101')]?{'id':_0xb24df6[_0xb986('0x5c')][_0xb986('0x101')]}:undefined,'required':_0xb24df6[_0xb986('0x5c')][_0xb986('0x101')]?!![]:![]}];}return db[_0xb986('0xbf')][_0xb986('0x6a')](_0x5beae8);})[_0xb986('0x2c')](function(_0x4d0dfb){_0x11ace6[_0xb986('0x6b')]=_0x4d0dfb;return _0x11ace6;});}})[_0xb986('0x2c')](respondWithFilteredResult(_0x3e87e7,_0x5beae8))['catch'](handleError(_0x3e87e7,null));};exports[_0xb986('0x33')]=function(_0x1443b4,_0x249d1b){var _0x28203c=0x0;var _0x11ded3=0x0;var _0x29e5f4=![];var _0x411371;var _0x517e4a;return db['ChatWebsite'][_0xb986('0x74')]({'where':{'id':_0x1443b4[_0xb986('0x78')]['id']},'include':[{'model':db['Interval'],'as':_0xb986('0xb2'),'include':[{'model':db[_0xb986('0xb2')],'as':_0xb986('0x3d'),'attributes':['id',_0xb986('0x37')]}]}]})[_0xb986('0x2c')](handleEntityNotFound(_0x249d1b,null))[_0xb986('0x2c')](function(_0x24f608){if(_0x24f608){_0x411371=_0x24f608;return _0x24f608['getProactiveActions']({'raw':!![]});}})[_0xb986('0x2c')](function(_0x4d608c){if(_0x411371){if(_0x4d608c){_0x517e4a=_0x4d608c;}}return require(_0xb986('0x8f'))[_0xb986('0x90')]();})[_0xb986('0x2c')](function(_0x172cd1){if(_0x172cd1){_0x11ded3=_0x172cd1[_0xb986('0x102')];_0x29e5f4=_0x172cd1[_0xb986('0x103')];}})[_0xb986('0x2c')](function(){return db[_0xb986('0xbf')][_0xb986('0x29')]({'where':{'closed':![]}});})[_0xb986('0x2c')](function(_0xec62db){_0x28203c=_0xec62db;if(_0x11ded3&&_0xec62db>_0x11ded3){return db[_0xb986('0x104')][_0xb986('0x7d')]({'where':{'id':0x1}})[_0xb986('0x2c')](function(_0x528850){if(_0x528850){_0x528850[_0xb986('0x105')](_0xb986('0x106'));}});}})['then'](function(){if(!_0x411371[_0xb986('0xb2')]||!_0x411371[_0xb986('0xb2')][_0xb986('0x3d')])return!![];return checkWebsiteIntervals(_0x411371);})['then'](function(_0x2e1e58){var _0x13e47f=fs[_0xb986('0x107')](path[_0xb986('0x93')](config['root'],_0xb986('0x108')),_0xb986('0xda'));var _0x284507=new url[(_0xb986('0x109'))](_0x411371['address'])[_0xb986('0x10a')];var _0xa4cc49=_0xb986('0x10b');var _0x3f8c72=![];var _0x4c1401={'chatVersion':_0xa4cc49,'chatWebsiteAddressOrigin':_0x284507,'remote':_0x411371[_0xb986('0x10c')],'query':querystring[_0xb986('0x1d')](_[_0xb986('0x68')](_0x411371[_0xb986('0x2e')]({'plain':!![]}),{'customerIp':_0x1443b4[_0xb986('0xbc')][_0xb986('0x45')]||_0x1443b4[_0xb986('0xbc')]['x-real-ip']||_0x1443b4[_0xb986('0x10d')][_0xb986('0x10e')]||_0x1443b4['ip'],'referer':_0x1443b4[_0xb986('0xbc')]['referer'],'openedInteractions':_0x28203c,'maxInteractions':_0x11ded3,'virtual':_0x29e5f4[_0xb986('0x102')],'online':_0x2e1e58,'custom':_0x29e5f4}))['replace'](/'/g,'\x5c\x27')};_0x249d1b[_0xb986('0xd3')](ejs[_0xb986('0x10f')](Mustache['render'](_0x13e47f,_0x4c1401),{'proactiveActions':_0x517e4a,'alignment':_0x411371['alignment'],'verticalAlignment':_0x411371[_0xb986('0x110')],'div_color':_0x411371[_0xb986('0x100')],'labelText':_0x411371[_0xb986('0x111')],'text_color':_0x411371[_0xb986('0x112')],'text_button_color':_0x411371[_0xb986('0x113')],'button_color':_0x411371[_0xb986('0x114')],'background_color':_0x411371[_0xb986('0x115')],'hideWhenOffline':_0x411371[_0xb986('0x116')],'intervalId':_0x411371[_0xb986('0x117')],'isDevelopment':_0x3f8c72,'chatVersion':_0xa4cc49}));})[_0xb986('0x22')](handleError(_0x249d1b,null));};exports['addApplications']=function(_0x1fcd39,_0x590b63){var _0xc747ef=_0x1fcd39[_0xb986('0x78')]['id'];var _0x1593be=_0x1fcd39[_0xb986('0x6f')];var _0x21bbe1=0xc8;var _0x40ece7=null;return db[_0xb986('0xe2')][_0xb986('0x118')]({'isolationLevel':db[_0xb986('0xe2')]['Transaction']['ISOLATION_LEVELS'][_0xb986('0x119')]},function(_0x558ae3){return db['ChatWebsite'][_0xb986('0x7d')]({'where':{'id':_0xc747ef},'transaction':_0x558ae3})[_0xb986('0x2c')](function(_0x20ece9){if(_0x20ece9){return db[_0xb986('0xb0')][_0xb986('0x2d')]({'where':{'ChatWebsiteId':_0xc747ef},'transaction':_0x558ae3})[_0xb986('0x2c')](function(){var _0xa50c39=_[_0xb986('0x3c')](_0x1593be,function(_0x1b5c2e){_0x1b5c2e[_0xb986('0x7b')]=_0xc747ef;return _0x1b5c2e;});return db[_0xb986('0xb0')][_0xb986('0xe4')](_0xa50c39,{'transaction':_0x558ae3});});}else{_0x21bbe1=0x194;_0x40ece7=[];}});})[_0xb986('0x2c')](function(){if(_0x21bbe1!==0x194){return db['ChatApplication'][_0xb986('0x11a')]({'where':{'ChatWebsiteId':_0xc747ef},'order':_0xb986('0xb8')})[_0xb986('0x2c')](function(_0x32e1e2){_0x40ece7=_0x32e1e2;});}})[_0xb986('0x22')](function(_0x4b681d){_0x21bbe1=0x1f4;logger[_0xb986('0x1e')](_0x4b681d['stack']);if(_0x4b681d['name']){delete _0x4b681d['name'];}_0x40ece7=_0x4b681d;})['finally'](function(){if(_0x40ece7===null){_0x590b63[_0xb986('0x23')](_0x21bbe1);}else{if(_0x21bbe1===0x1f4){_0x590b63[_0xb986('0x24')](_0x21bbe1)[_0xb986('0xd3')](_0x40ece7);}else{_0x590b63[_0xb986('0x24')](_0x21bbe1)[_0xb986('0x26')](_0x40ece7);}}});};exports[_0xb986('0x11b')]=function(_0xf19770,_0x4bacfe){var _0x4e75f3={};var _0x2bb45d={};var _0x740194;var _0x2d311a;return db['ChatWebsite'][_0xb986('0x7d')]({'where':{'id':_0xf19770[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x4bacfe,null))[_0xb986('0x2c')](function(_0x14effd){if(_0x14effd){_0x740194=_0x14effd;_0x2bb45d[_0xb986('0x50')]=_[_0xb986('0x5d')](db[_0xb986('0xb0')][_0xb986('0x59')]);_0x2bb45d[_0xb986('0x5c')]=_[_0xb986('0x5d')](_0xf19770[_0xb986('0x5c')]);_0x2bb45d[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x2bb45d['model'],_0x2bb45d['query']);_0x4e75f3['attributes']=_[_0xb986('0x5f')](_0x2bb45d[_0xb986('0x50')],qs[_0xb986('0x61')](_0xf19770[_0xb986('0x5c')][_0xb986('0x61')]));_0x4e75f3[_0xb986('0x60')]=_0x4e75f3['attributes'][_0xb986('0x62')]?_0x4e75f3[_0xb986('0x60')]:_0x2bb45d[_0xb986('0x50')];_0x4e75f3[_0xb986('0x63')]=qs[_0xb986('0x64')](_0xf19770[_0xb986('0x5c')][_0xb986('0x64')]);_0x4e75f3[_0xb986('0x65')]=qs[_0xb986('0x5e')](_['pick'](_0xf19770[_0xb986('0x5c')],_0x2bb45d[_0xb986('0x5e')]));if(_0xf19770[_0xb986('0x5c')][_0xb986('0x67')]){_0x4e75f3['where']=_[_0xb986('0x68')](_0x4e75f3[_0xb986('0x65')],{'$or':_[_0xb986('0x3c')](_0x4e75f3[_0xb986('0x60')],function(_0x5b722f){var _0xc3b0a2={};_0xc3b0a2[_0x5b722f]={'$like':'%'+_0xf19770[_0xb986('0x5c')][_0xb986('0x67')]+'%'};return _0xc3b0a2;})});}_0x4e75f3=_['merge']({},_0x4e75f3,_0xf19770[_0xb986('0x85')]);return _0x740194[_0xb986('0x11b')](_0x4e75f3);}})['then'](function(_0x26d4e5){if(_0x26d4e5){_0x2d311a=_0x26d4e5['length'];if(!_0xf19770[_0xb986('0x5c')][_0xb986('0xfa')]('nolimit')){_0x4e75f3['limit']=qs[_0xb986('0x27')](_0xf19770['query'][_0xb986('0x27')]);_0x4e75f3[_0xb986('0x2a')]=qs[_0xb986('0x2a')](_0xf19770[_0xb986('0x5c')]['offset']);}return _0x740194['getApplications'](_0x4e75f3);}})[_0xb986('0x2c')](function(_0x21c596){if(_0x21c596){return _0x21c596?{'count':_0x2d311a,'rows':_0x21c596}:null;}})[_0xb986('0x2c')](respondWithResult(_0x4bacfe,null))['catch'](handleError(_0x4bacfe,null));};exports[_0xb986('0x11c')]=function(_0x24bce3,_0x5dcb8a){return db['chatProactiveAction'][_0xb986('0x74')]({'where':{'id':_0x24bce3[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x5dcb8a,null))[_0xb986('0x2c')](function(_0x1e3d13){if(_0x1e3d13){return _0x1e3d13[_0xb986('0x11c')](_0x24bce3[_0xb986('0x6f')][_0xb986('0x82')],_[_0xb986('0xf8')](_0x24bce3[_0xb986('0x6f')],[_0xb986('0x82'),'id'])||{});}})['then'](respondWithResult(_0x5dcb8a,null))[_0xb986('0x22')](handleError(_0x5dcb8a,null));};exports[_0xb986('0x11d')]=function(_0x41d52b,_0x3ceac7){var _0x1759c2={};var _0x57c66d={};var _0x41593c;var _0x278e3d;return db['ChatWebsite'][_0xb986('0x7d')]({'where':{'id':_0x41d52b[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x3ceac7,null))[_0xb986('0x2c')](function(_0x633f37){if(_0x633f37){_0x41593c=_0x633f37;_0x57c66d['model']=_['keys'](db[_0xb986('0x11e')][_0xb986('0x59')]);_0x57c66d['query']=_['keys'](_0x41d52b['query']);_0x57c66d['filters']=_[_0xb986('0x5f')](_0x57c66d[_0xb986('0x50')],_0x57c66d[_0xb986('0x5c')]);_0x1759c2[_0xb986('0x60')]=_[_0xb986('0x5f')](_0x57c66d['model'],qs[_0xb986('0x61')](_0x41d52b[_0xb986('0x5c')]['fields']));_0x1759c2[_0xb986('0x60')]=_0x1759c2['attributes'][_0xb986('0x62')]?_0x1759c2[_0xb986('0x60')]:_0x57c66d[_0xb986('0x50')];_0x1759c2[_0xb986('0x63')]=qs[_0xb986('0x64')](_0x41d52b[_0xb986('0x5c')]['sort']);_0x1759c2[_0xb986('0x65')]=qs[_0xb986('0x5e')](_[_0xb986('0x66')](_0x41d52b[_0xb986('0x5c')],_0x57c66d['filters']));if(_0x41d52b[_0xb986('0x5c')][_0xb986('0x67')]){_0x1759c2[_0xb986('0x65')]=_['merge'](_0x1759c2[_0xb986('0x65')],{'$or':_[_0xb986('0x3c')](_0x1759c2[_0xb986('0x60')],function(_0x161804){var _0x2fde9c={};_0x2fde9c[_0x161804]={'$like':'%'+_0x41d52b['query']['filter']+'%'};return _0x2fde9c;})});}_0x1759c2=_['merge']({},_0x1759c2,_0x41d52b[_0xb986('0x85')]);return _0x41593c['getProactiveActions'](_0x1759c2);}})[_0xb986('0x2c')](function(_0x47f813){if(_0x47f813){_0x278e3d=_0x47f813['length'];if(!_0x41d52b[_0xb986('0x5c')][_0xb986('0xfa')](_0xb986('0x7f'))){_0x1759c2['limit']=qs[_0xb986('0x27')](_0x41d52b[_0xb986('0x5c')][_0xb986('0x27')]);_0x1759c2[_0xb986('0x2a')]=qs['offset'](_0x41d52b[_0xb986('0x5c')][_0xb986('0x2a')]);}return _0x41593c[_0xb986('0x11d')](_0x1759c2);}})['then'](function(_0x11874d){if(_0x11874d){return _0x11874d?{'count':_0x278e3d,'rows':_0x11874d}:null;}})[_0xb986('0x2c')](respondWithResult(_0x3ceac7,null))[_0xb986('0x22')](handleError(_0x3ceac7,null));};exports[_0xb986('0x11f')]=function(_0x372f75,_0x2c2497){var _0x2c7078=_0x372f75[_0xb986('0x5c')][_0xb986('0x120')]===_0xb986('0x121')?_0xb986('0x122'):_0xb986('0x123');return db[_0xb986('0x58')][_0xb986('0x74')]({'attributes':['id',_0x2c7078],'where':{'id':_0x372f75[_0xb986('0x78')]['id']}})['then'](handleEntityNotFound(_0x2c2497,null))[_0xb986('0x2c')](function(_0x3ae87f){if(_0x3ae87f){var _0x4761d5=_0x3ae87f[_0x2c7078];var _0x21a437=_0x4761d5&&_0x4761d5[_0xb986('0x124')]?_0x4761d5[_0xb986('0x124')]:[];_0x2c2497[_0xb986('0xd3')]({'fromKey':_[_0xb986('0x91')](_0x4761d5[_0xb986('0x125')])?undefined:_0x4761d5[_0xb986('0x125')],'count':_0x21a437[_0xb986('0x62')],'rows':_0x21a437});}})['catch'](handleError(_0x2c2497,null));};exports[_0xb986('0x126')]=function(_0x4b05e2,_0x591357){var _0x3033d1={'raw':![],'where':{}};var _0x461907={};var _0x281587={'count':0x0,'rows':[]};return db[_0xb986('0x58')][_0xb986('0x7d')]({'where':{'id':_0x4b05e2[_0xb986('0x78')]['id']}})['then'](handleEntityNotFound(_0x591357,null))[_0xb986('0x2c')](function(_0x45260a){if(_0x45260a){_0x461907[_0xb986('0x50')]=_[_0xb986('0x5d')](db['ChatOfflineMessage'][_0xb986('0x59')]);_0x461907[_0xb986('0x5c')]=_[_0xb986('0x5d')](_0x4b05e2[_0xb986('0x5c')]);_0x461907[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x461907[_0xb986('0x50')],_0x461907['query']);_0x3033d1[_0xb986('0x60')]=_['intersection'](_0x461907[_0xb986('0x50')],qs[_0xb986('0x61')](_0x4b05e2[_0xb986('0x5c')][_0xb986('0x61')]));_0x3033d1[_0xb986('0x60')]=_0x3033d1['attributes'][_0xb986('0x62')]?_0x3033d1['attributes']:_0x461907['model'];if(!_0x4b05e2[_0xb986('0x5c')][_0xb986('0xfa')](_0xb986('0x7f'))){_0x3033d1['limit']=qs[_0xb986('0x27')](_0x4b05e2[_0xb986('0x5c')]['limit']);_0x3033d1[_0xb986('0x2a')]=qs['offset'](_0x4b05e2[_0xb986('0x5c')][_0xb986('0x2a')]);}_0x3033d1[_0xb986('0x63')]=qs[_0xb986('0x64')](_0x4b05e2[_0xb986('0x5c')][_0xb986('0x64')]);_0x3033d1[_0xb986('0x65')]=qs['filters'](_['pick'](_0x4b05e2[_0xb986('0x5c')],_0x461907[_0xb986('0x5e')]));_0x3033d1[_0xb986('0x65')][_0xb986('0x7b')]=_0x45260a['id'];if(_0x4b05e2['query'][_0xb986('0x67')]){_0x3033d1[_0xb986('0x65')]=_[_0xb986('0x68')](_0x3033d1[_0xb986('0x65')],{'$or':_[_0xb986('0x3c')](_0x3033d1[_0xb986('0x60')],function(_0x17379e){var _0x289bf2={};_0x289bf2[_0x17379e]={'$like':'%'+_0x4b05e2[_0xb986('0x5c')][_0xb986('0x67')]+'%'};return _0x289bf2;})});}_0x3033d1=_['merge']({},_0x3033d1,_0x4b05e2[_0xb986('0x85')]);return db[_0xb986('0xdc')][_0xb986('0x29')]({'where':_0x3033d1[_0xb986('0x65')]})['then'](function(_0x15e3a2){_0x281587[_0xb986('0x29')]=_0x15e3a2;if(_0x4b05e2['query'][_0xb986('0x80')]){_0x3033d1[_0xb986('0x6d')]=[{'all':!![]}];}else{_0x3033d1[_0xb986('0x6d')]=[{'model':db[_0xb986('0xd2')],'as':_0xb986('0x127'),'required':![]},{'model':db[_0xb986('0xe3')],'as':_0xb986('0x128'),'required':![]}];}return db[_0xb986('0xdc')][_0xb986('0x6a')](_0x3033d1);})[_0xb986('0x2c')](function(_0x444a6b){_0x281587[_0xb986('0x6b')]=_0x444a6b;return _0x281587;});}})[_0xb986('0x2c')](respondWithFilteredResult(_0x591357,_0x3033d1))['catch'](handleError(_0x591357,null));};exports[_0xb986('0x129')]=function(_0x1a7a80,_0xe5efa0){return db[_0xb986('0x58')]['find']({'where':{'id':_0x1a7a80[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0xe5efa0,null))[_0xb986('0x2c')](function(_0x467891){if(_0x467891){return _0x467891[_0xb986('0x129')](_0x1a7a80[_0xb986('0x6f')]['ids'],_[_0xb986('0xf8')](_0x1a7a80[_0xb986('0x6f')],[_0xb986('0x82'),'id'])||{})['spread'](function(_0x370db8){for(var _0x54417c=0x0;_0x54417c<_0x1a7a80[_0xb986('0x6f')][_0xb986('0x82')][_0xb986('0x62')];_0x54417c+=0x1){socket[_0xb986('0x12a')](_0xb986('0x12b'),{'UserId':Number(_0x1a7a80[_0xb986('0x6f')][_0xb986('0x82')][_0x54417c]),'ChatWebsiteId':Number(_0x1a7a80[_0xb986('0x78')]['id'])});}return _0x370db8;});}})[_0xb986('0x2c')](respondWithResult(_0xe5efa0,null))[_0xb986('0x22')](handleError(_0xe5efa0,null));};exports[_0xb986('0x12c')]=function(_0x272973,_0x361f22){return db[_0xb986('0x58')]['find']({'where':{'id':_0x272973['params']['id']}})['then'](handleEntityNotFound(_0x361f22,null))[_0xb986('0x2c')](function(_0x3fa190){if(_0x3fa190){return _0x3fa190[_0xb986('0x12c')](_0x272973['query']['ids'])[_0xb986('0x2c')](function(){if(_[_0xb986('0x12d')](_0x272973[_0xb986('0x5c')][_0xb986('0x82')])){for(var _0x5287e1=0x0;_0x5287e1<_0x272973[_0xb986('0x5c')][_0xb986('0x82')][_0xb986('0x62')];_0x5287e1+=0x1){socket[_0xb986('0x12a')](_0xb986('0x12e'),{'UserId':Number(_0x272973[_0xb986('0x5c')][_0xb986('0x82')][_0x5287e1]),'ChatWebsiteId':Number(_0x272973[_0xb986('0x78')]['id'])});}}else{socket[_0xb986('0x12a')](_0xb986('0x12e'),{'UserId':Number(_0x272973[_0xb986('0x5c')][_0xb986('0x82')]),'ChatWebsiteId':Number(_0x272973['params']['id'])});}});}})[_0xb986('0x2c')](respondWithStatusCode(_0x361f22,null))[_0xb986('0x22')](handleError(_0x361f22,null));};exports[_0xb986('0x12f')]=function(_0x253f80,_0x2e60dc){var _0x2676ac={};var _0x226729={};var _0x56ca90;var _0x354656;return db[_0xb986('0x58')][_0xb986('0x7d')]({'where':{'id':_0x253f80[_0xb986('0x78')]['id']}})[_0xb986('0x2c')](handleEntityNotFound(_0x2e60dc,null))[_0xb986('0x2c')](function(_0x4a7894){if(_0x4a7894){_0x56ca90=_0x4a7894;_0x226729[_0xb986('0x50')]=_[_0xb986('0x5d')](db[_0xb986('0xc9')][_0xb986('0x59')]);_0x226729[_0xb986('0x5c')]=_['keys'](_0x253f80[_0xb986('0x5c')]);_0x226729[_0xb986('0x5e')]=_[_0xb986('0x5f')](_0x226729['model'],_0x226729['query']);_0x2676ac['attributes']=_['intersection'](_0x226729[_0xb986('0x50')],qs['fields'](_0x253f80[_0xb986('0x5c')]['fields']));_0x2676ac[_0xb986('0x60')]=_0x2676ac['attributes'][_0xb986('0x62')]?_0x2676ac['attributes']:_0x226729[_0xb986('0x50')];_0x2676ac[_0xb986('0x63')]=qs['sort'](_0x253f80[_0xb986('0x5c')][_0xb986('0x64')]);_0x2676ac[_0xb986('0x65')]=qs[_0xb986('0x5e')](_['pick'](_0x253f80[_0xb986('0x5c')],_0x226729['filters']));if(_0x253f80[_0xb986('0x5c')]['filter']){_0x2676ac['where']=_['merge'](_0x2676ac[_0xb986('0x65')],{'$or':_[_0xb986('0x3c')](_0x2676ac['attributes'],function(_0x4374ac){var _0x164111={};_0x164111[_0x4374ac]={'$like':'%'+_0x253f80['query'][_0xb986('0x67')]+'%'};return _0x164111;})});}_0x2676ac=_[_0xb986('0x68')]({},_0x2676ac,_0x253f80[_0xb986('0x85')]);return _0x56ca90[_0xb986('0x12f')](_0x2676ac);}})[_0xb986('0x2c')](function(_0x3c9075){if(_0x3c9075){_0x354656=_0x3c9075[_0xb986('0x62')];if(!_0x253f80[_0xb986('0x5c')][_0xb986('0xfa')]('nolimit')){_0x2676ac['limit']=qs[_0xb986('0x27')](_0x253f80[_0xb986('0x5c')][_0xb986('0x27')]);_0x2676ac[_0xb986('0x2a')]=qs[_0xb986('0x2a')](_0x253f80[_0xb986('0x5c')]['offset']);}return _0x56ca90['getAgents'](_0x2676ac);}})[_0xb986('0x2c')](function(_0x392c58){if(_0x392c58){return _0x392c58?{'count':_0x354656,'rows':_0x392c58}:null;}})[_0xb986('0x2c')](respondWithResult(_0x2e60dc,null))['catch'](handleError(_0x2e60dc,null));};
\ No newline at end of file
+var _0x5ca6=['created','autoclose','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','difference','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','email','MailAccountId','subjectOffline','offlineMessageSubject','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','tag','getProactiveActions','getLicense','virtual','increment','utf8','URL','3.5.0','remote','x-real-ip','remoteAddress','referer','replace','alignment','labelText','textColor','textButtonColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','ChatProactiveAction','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','html-to-text','url','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','../../mysqldb','redis','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','name','timezone','interval','true','ONLINE','OFFLINE','No\x20timezone','map','Intervals','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','browser','version','format','unknown','%s\x20%s','model','device','vendor','Pause','rawAttributes','fieldName','query','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatWebsite','include','findAll','rows','params','mandatoryDispositionPause','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','ValidationError','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','ChatApplication','Applications','Interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','defaults','ListId','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','messageId'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0x5ca6,0x181));var _0x65ca=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x5ca6[_0x5d6e30];return _0x3d3f3b;};'use strict';var Mustache=require(_0x65ca('0x0'));var util=require('util');var path=require(_0x65ca('0x1'));var ejs=require(_0x65ca('0x2'));var fs=require('fs');var fs_extra=require(_0x65ca('0x3'));var _=require(_0x65ca('0x4'));var querystring=require(_0x65ca('0x5'));var htmlToText=require(_0x65ca('0x6'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x65ca('0x7'));var qs=require(_0x65ca('0x8'));var logger=require('../../config/logger')(_0x65ca('0x9'));var config=require(_0x65ca('0xa'));var APIOutOfIntervalError=require(_0x65ca('0xb'))[_0x65ca('0xc')];var APINotFoundError=require(_0x65ca('0xb'))[_0x65ca('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x65ca('0xe'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65ca('0xf')]));require('./chatWebsite.socket')[_0x65ca('0x10')](socket);var client=jayson[_0x65ca('0x11')][_0x65ca('0x12')]({'port':0x232c});var client9002=jayson[_0x65ca('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x65ca('0x11')][_0x65ca('0x12')]({'port':0x232b});var client9001=jayson[_0x65ca('0x11')][_0x65ca('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x782230,_0x189a32,_0x18adc0,_0x6c7a94){return new Promise(function(_0x89ed0f,_0x2cc491){var _0x5d6e20=_0x6c7a94||client;return _0x5d6e20[_0x65ca('0x13')](_0x782230,_0x18adc0)[_0x65ca('0x14')](function(_0x2708c7){logger[_0x65ca('0x15')](_0x65ca('0x16'),_0x189a32,_0x65ca('0x17'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x189a32,'request\x20sent',JSON[_0x65ca('0x18')](_0x2708c7));if(_0x2708c7[_0x65ca('0x19')]){if(_0x2708c7['error'][_0x65ca('0x1a')]===0x1f4){logger[_0x65ca('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x189a32,_0x2708c7[_0x65ca('0x19')][_0x65ca('0x1b')]);return _0x2cc491(_0x2708c7[_0x65ca('0x19')][_0x65ca('0x1b')]);}logger[_0x65ca('0x19')](_0x65ca('0x16'),_0x189a32,_0x2708c7['error'][_0x65ca('0x1b')]);return _0x89ed0f(_0x2708c7[_0x65ca('0x19')][_0x65ca('0x1b')]);}else{logger[_0x65ca('0x15')](_0x65ca('0x16'),_0x189a32,_0x65ca('0x17'));_0x89ed0f(_0x2708c7[_0x65ca('0x1c')][_0x65ca('0x1b')]);}})[_0x65ca('0x1d')](function(_0x333a4f){logger['error'](_0x65ca('0x16'),_0x189a32,_0x333a4f);_0x2cc491(_0x333a4f);});});}function respondWithStatusCode(_0x4fe67f,_0x3a99c9){_0x3a99c9=_0x3a99c9||0xcc;return function(_0x4e389c){if(_0x4e389c){return _0x4fe67f['sendStatus'](_0x3a99c9);}return _0x4fe67f[_0x65ca('0x1e')](_0x3a99c9)[_0x65ca('0x1f')]();};}function respondWithResult(_0x295015,_0x4be997){_0x4be997=_0x4be997||0xc8;return function(_0x19d189){if(_0x19d189){return _0x295015['status'](_0x4be997)[_0x65ca('0x20')](_0x19d189);}};}function respondWithFilteredResult(_0x539045,_0x21dc45){return function(_0x2156c0){if(_0x2156c0){var _0x1cb000=typeof _0x21dc45[_0x65ca('0x21')]==='undefined'&&typeof _0x21dc45[_0x65ca('0x22')]==='undefined';var _0x197f47=_0x2156c0['count'];var _0xb2726c=_0x1cb000?0x0:_0x21dc45[_0x65ca('0x21')];var _0x43a25b=_0x1cb000?_0x2156c0[_0x65ca('0x23')]:_0x21dc45[_0x65ca('0x21')]+_0x21dc45[_0x65ca('0x22')];var _0x1de895;if(_0x43a25b>=_0x197f47){_0x43a25b=_0x197f47;_0x1de895=0xc8;}else{_0x1de895=0xce;}_0x539045['status'](_0x1de895);return _0x539045['set'](_0x65ca('0x24'),_0xb2726c+'-'+_0x43a25b+'/'+_0x197f47)['json'](_0x2156c0);}return null;};}function saveUpdates(_0x51dba2){return function(_0x53b815){if(_0x53b815){return _0x53b815[_0x65ca('0x25')](_0x51dba2)[_0x65ca('0x14')](function(_0x4ab7dc){return _0x4ab7dc;});}return null;};}function removeEntity(_0x387910){return function(_0x14ad15){if(_0x14ad15){return _0x14ad15[_0x65ca('0x26')]()[_0x65ca('0x14')](function(){var _0xc74c7c=_0x14ad15[_0x65ca('0x27')]({'plain':!![]});var _0x3f3fd8=_0x65ca('0x28');return db['UserProfileResource'][_0x65ca('0x26')]({'where':{'type':_0x3f3fd8,'resourceId':_0xc74c7c['id']}})['then'](function(){return _0x14ad15;});})[_0x65ca('0x14')](function(){_0x387910['status'](0xcc)[_0x65ca('0x1f')]();});}};}function handleEntityNotFound(_0x1dd335){return function(_0x34374a){if(!_0x34374a){_0x1dd335[_0x65ca('0x29')](0x194);}return _0x34374a;};}function handleError(_0xbf92b5,_0x12fe28){_0x12fe28=_0x12fe28||0x1f4;return function(_0x50dcb7){logger[_0x65ca('0x19')](_0x50dcb7[_0x65ca('0x2a')]);if(_0x50dcb7[_0x65ca('0x2b')]){delete _0x50dcb7[_0x65ca('0x2b')];}_0xbf92b5['status'](_0x12fe28)['send'](_0x50dcb7);};}function iftimePromise(_0x1a912a,_0x46b66f){return respondWithRpcPromise('Command','getSnippet',{'command':_0x46b66f[_0x65ca('0x2c')]?util['format']('iftime\x20%s,%s',_0x1a912a[_0x65ca('0x2d')],_0x46b66f[_0x65ca('0x2c')]):util['format']('iftime\x20%s',_0x1a912a['interval'])},client9002)[_0x65ca('0x14')](function(_0x18040e){var _0x4f2ba6=_0x18040e&&_0x18040e['indexOf'](_0x65ca('0x2e'))>=0x0?!![]:![];logger[_0x65ca('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46b66f['id'],_0x1a912a['id'],_0x1a912a[_0x65ca('0x2d')],_0x4f2ba6?_0x65ca('0x2f'):_0x65ca('0x30'),_0x46b66f['timezone']?_0x46b66f[_0x65ca('0x2c')]:'No\x20timezone');return _0x4f2ba6;})[_0x65ca('0x1d')](function(_0x56b303){logger[_0x65ca('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x46b66f['id'],_0x1a912a['id'],_0x1a912a[_0x65ca('0x2d')],util['inspect'](_0x56b303,{'showHidden':![],'depth':null}),_0x46b66f[_0x65ca('0x2c')]?_0x46b66f['timezone']:_0x65ca('0x31'));return![];});}function checkWebsiteIntervals(_0x1ee098){var _0x51bba3=_[_0x65ca('0x32')](_0x1ee098['Interval'][_0x65ca('0x33')],function(_0x44a80f){var _0xfa72c3=_0x44a80f[_0x65ca('0x27')]({'plain':!![]});return iftimePromise(_0xfa72c3,_0x1ee098);});return Promise['all'](_0x51bba3)[_0x65ca('0x14')](function(_0xbca68d){return _[_0x65ca('0x34')](_0xbca68d);});}function createInteractionObject(_0x877020,_0x21a900,_0x4627c9,_0x481699){var _0x1a559e=require(_0x65ca('0x35'));var _0x28aa66=new _0x1a559e();var _0x31b83a=_0x28aa66['setUA'](_0x4627c9[_0x65ca('0x36')])[_0x65ca('0x37')]();var _0x5ea32d=_0x21a900[_0x65ca('0x38')];if(_0x4627c9[_0x65ca('0x39')]){_0x5ea32d=_0x4627c9[_0x65ca('0x39')];}else if(_0x4627c9[_0x65ca('0x3a')]){_0x5ea32d=_['first'](_0x4627c9[_0x65ca('0x3a')][_0x65ca('0x3b')](','));}return{'ContactId':_0x481699['id'],'ChatWebsiteId':_0x877020,'from':(_0x481699['firstName']||'')+'\x20'+(_0x481699[_0x65ca('0x3c')]||''),'customerIp':_0x5ea32d,'customerPort':_0x4627c9['x-real-port']?_0x4627c9['x-real-port']:null,'referer':_0x21a900['referer'],'browserName':_0x31b83a['browser'][_0x65ca('0x2b')]&&_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x3e')]?util[_0x65ca('0x3f')]('%s\x20%s',_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x2b')],_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x3e')]):_0x65ca('0x40'),'browserVersion':_0x31b83a[_0x65ca('0x3d')][_0x65ca('0x3e')]||'unknown','osName':util['format'](_0x65ca('0x41'),_0x31b83a['os'][_0x65ca('0x2b')],_0x31b83a['os']['version']),'osVersion':_0x31b83a['os'][_0x65ca('0x3e')],'deviceModel':_0x31b83a['device'][_0x65ca('0x42')]&&_0x31b83a[_0x65ca('0x43')][_0x65ca('0x44')]?util[_0x65ca('0x3f')]('%s\x20%s\x20%s',_0x31b83a[_0x65ca('0x43')]['model'],_0x31b83a[_0x65ca('0x43')][_0x65ca('0x44')],_0x31b83a['device']['type']):null,'deviceVendor':_0x31b83a[_0x65ca('0x43')][_0x65ca('0x44')],'deviceType':_0x31b83a[_0x65ca('0x43')]['type'],'formData':JSON['stringify'](_0x21a900)};}exports['index']=function(_0x6969de,_0x45456d){var _0x5e555f={'include':[{'model':db[_0x65ca('0x45')],'as':'mandatoryDispositionPause'}]},_0x3e1b77={},_0x509037={'count':0x0,'rows':[]};var _0x271289=_[_0x65ca('0x32')](db['ChatWebsite'][_0x65ca('0x46')],function(_0x53c33c){return{'name':_0x53c33c[_0x65ca('0x47')],'type':_0x53c33c['type']['key']};});_0x3e1b77['model']=_[_0x65ca('0x32')](_0x271289,_0x65ca('0x2b'));_0x3e1b77[_0x65ca('0x48')]=_['keys'](_0x6969de[_0x65ca('0x48')]);_0x3e1b77[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x3e1b77[_0x65ca('0x42')],_0x3e1b77[_0x65ca('0x48')]);_0x5e555f['attributes']=_[_0x65ca('0x4a')](_0x3e1b77['model'],qs['fields'](_0x6969de[_0x65ca('0x48')][_0x65ca('0x4b')]));_0x5e555f[_0x65ca('0x4c')]=_0x5e555f[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x5e555f[_0x65ca('0x4c')]:_0x3e1b77[_0x65ca('0x42')];if(!_0x6969de[_0x65ca('0x48')]['hasOwnProperty'](_0x65ca('0x4e'))){_0x5e555f[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x6969de[_0x65ca('0x48')][_0x65ca('0x22')]);_0x5e555f['offset']=qs[_0x65ca('0x21')](_0x6969de[_0x65ca('0x48')]['offset']);}_0x5e555f['order']=qs['sort'](_0x6969de['query'][_0x65ca('0x4f')]);_0x5e555f['where']=qs['filters'](_[_0x65ca('0x50')](_0x6969de[_0x65ca('0x48')],_0x3e1b77[_0x65ca('0x49')]),_0x271289);if(_0x6969de[_0x65ca('0x48')][_0x65ca('0x51')]){_0x5e555f[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x5e555f[_0x65ca('0x52')],{'$or':_[_0x65ca('0x32')](_0x271289,function(_0x4c3036){if(_0x4c3036['type']!==_0x65ca('0x54')){var _0x3d22e5={};_0x3d22e5[_0x4c3036[_0x65ca('0x2b')]]={'$like':'%'+_0x6969de[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x3d22e5;}})});}_0x5e555f=_[_0x65ca('0x53')]({},_0x5e555f,_0x6969de[_0x65ca('0x55')]);var _0x4c05e9={'where':_0x5e555f[_0x65ca('0x52')]};return db[_0x65ca('0x56')][_0x65ca('0x23')](_0x4c05e9)[_0x65ca('0x14')](function(_0x45819a){_0x509037['count']=_0x45819a;if(_0x6969de[_0x65ca('0x48')]['includeAll']){_0x5e555f[_0x65ca('0x57')]=[{'all':!![]}];}return db[_0x65ca('0x56')][_0x65ca('0x58')](_0x5e555f);})[_0x65ca('0x14')](function(_0x133d78){_0x509037[_0x65ca('0x59')]=_0x133d78;return _0x509037;})['then'](respondWithFilteredResult(_0x45456d,_0x5e555f))['catch'](handleError(_0x45456d,null));};exports['show']=function(_0x55fee2,_0x2d1fb4){var _0x4db809={'raw':![],'where':{'id':_0x55fee2[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x45')],'as':_0x65ca('0x5b')}]},_0x1d7a0a={};_0x1d7a0a[_0x65ca('0x42')]=_['keys'](db[_0x65ca('0x56')][_0x65ca('0x46')]);_0x1d7a0a[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x55fee2[_0x65ca('0x48')]);_0x1d7a0a[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x1d7a0a[_0x65ca('0x42')],_0x1d7a0a[_0x65ca('0x48')]);_0x4db809['attributes']=_['intersection'](_0x1d7a0a[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x55fee2['query']['fields']));_0x4db809[_0x65ca('0x4c')]=_0x4db809['attributes'][_0x65ca('0x4d')]?_0x4db809[_0x65ca('0x4c')]:_0x1d7a0a[_0x65ca('0x42')];if(_0x55fee2[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x4db809['include']=[{'all':!![]}];}_0x4db809=_['merge']({},_0x4db809,_0x55fee2[_0x65ca('0x55')]);return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0x4db809)[_0x65ca('0x14')](handleEntityNotFound(_0x2d1fb4,null))['then'](respondWithResult(_0x2d1fb4,null))[_0x65ca('0x1d')](handleError(_0x2d1fb4,null));};exports[_0x65ca('0x5f')]=function(_0x42b216,_0x5688d2){return db[_0x65ca('0x56')][_0x65ca('0x5f')](_0x42b216[_0x65ca('0x60')],{})[_0x65ca('0x14')](function(_0x14f91b){var _0x4c0932=_0x42b216[_0x65ca('0x61')][_0x65ca('0x27')]({'plain':!![]});if(!_0x4c0932)throw new Error(_0x65ca('0x62'));if(_0x4c0932['role']===_0x65ca('0x61')){var _0x2c6f73=_0x14f91b['get']({'plain':!![]});var _0x438ca5=_0x65ca('0x28');return db[_0x65ca('0x63')][_0x65ca('0x5e')]({'where':{'name':_0x438ca5,'userProfileId':_0x4c0932[_0x65ca('0x64')]},'raw':!![]})['then'](function(_0x5c31bf){if(_0x5c31bf&&_0x5c31bf[_0x65ca('0x65')]===0x0){return db[_0x65ca('0x66')]['create']({'name':_0x2c6f73[_0x65ca('0x2b')],'resourceId':_0x2c6f73['id'],'type':_0x5c31bf[_0x65ca('0x2b')],'sectionId':_0x5c31bf['id']},{})[_0x65ca('0x14')](function(){return _0x14f91b;});}else{return _0x14f91b;}})[_0x65ca('0x1d')](function(_0x7d769e){logger[_0x65ca('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7d769e);throw _0x7d769e;});}return _0x14f91b;})[_0x65ca('0x14')](respondWithResult(_0x5688d2,0xc9))['catch'](handleError(_0x5688d2,null));};exports[_0x65ca('0x25')]=function(_0x14dec6,_0xa323a2){if(_0x14dec6['body']['id']){delete _0x14dec6[_0x65ca('0x60')]['id'];}return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x14dec6[_0x65ca('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x65ca('0x5b')}]})[_0x65ca('0x14')](handleEntityNotFound(_0xa323a2,null))['then'](saveUpdates(_0x14dec6[_0x65ca('0x60')],null))['then'](respondWithResult(_0xa323a2,null))[_0x65ca('0x1d')](handleError(_0xa323a2,null));};exports['destroy']=function(_0x36c132,_0x25c39f){return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x36c132[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x25c39f,null))[_0x65ca('0x14')](removeEntity(_0x25c39f,null))['catch'](handleError(_0x25c39f,null));};exports['describe']=function(_0x5c4718,_0x49712f){return db['ChatWebsite'][_0x65ca('0x67')]()[_0x65ca('0x14')](respondWithResult(_0x49712f,null))[_0x65ca('0x1d')](handleError(_0x49712f,null));};exports[_0x65ca('0x68')]=function(_0x5cd4d1,_0x112ce4){if(_0x5cd4d1['body']['id']){delete _0x5cd4d1['body']['id'];}return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x5cd4d1[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x112ce4,null))[_0x65ca('0x14')](function(_0x8716fd){if(_0x8716fd){_0x5cd4d1[_0x65ca('0x60')][_0x65ca('0x69')]=_0x8716fd['id'];return db[_0x65ca('0x6a')][_0x65ca('0x5f')](_0x5cd4d1['body']);}})[_0x65ca('0x14')](respondWithResult(_0x112ce4,null))['catch'](handleError(_0x112ce4,null));};exports['getDispositions']=function(_0x45e31a,_0x38c5a3){var _0x219b9a={'raw':![],'where':{}};var _0x3ffc24={};var _0x52abc2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x65ca('0x6b')]({'where':{'id':_0x45e31a[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x38c5a3,null))['then'](function(_0x19ff90){if(_0x19ff90){_0x3ffc24[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db[_0x65ca('0x6a')][_0x65ca('0x46')]);_0x3ffc24[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x45e31a['query']);_0x3ffc24[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x3ffc24[_0x65ca('0x42')],_0x3ffc24[_0x65ca('0x48')]);_0x219b9a[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x3ffc24[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x45e31a[_0x65ca('0x48')][_0x65ca('0x4b')]));_0x219b9a['attributes']=_0x219b9a['attributes'][_0x65ca('0x4d')]?_0x219b9a[_0x65ca('0x4c')]:_0x3ffc24[_0x65ca('0x42')];if(!_0x45e31a[_0x65ca('0x48')][_0x65ca('0x6c')](_0x65ca('0x4e'))){_0x219b9a[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x45e31a['query'][_0x65ca('0x22')]);_0x219b9a[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x45e31a[_0x65ca('0x48')][_0x65ca('0x21')]);}_0x219b9a['order']=qs[_0x65ca('0x4f')](_0x45e31a[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x219b9a[_0x65ca('0x52')]=qs['filters'](_[_0x65ca('0x50')](_0x45e31a[_0x65ca('0x48')],_0x3ffc24[_0x65ca('0x49')]));_0x219b9a['where'][_0x65ca('0x69')]=_0x19ff90['id'];if(_0x45e31a[_0x65ca('0x48')][_0x65ca('0x51')]){_0x219b9a[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x219b9a[_0x65ca('0x52')],{'$or':_[_0x65ca('0x32')](_0x219b9a['attributes'],function(_0xcfaf1d){var _0x9d63cd={};_0x9d63cd[_0xcfaf1d]={'$like':'%'+_0x45e31a[_0x65ca('0x48')]['filter']+'%'};return _0x9d63cd;})});}_0x219b9a=_[_0x65ca('0x53')]({},_0x219b9a,_0x45e31a[_0x65ca('0x55')]);return db['Disposition'][_0x65ca('0x23')]({'where':_0x219b9a[_0x65ca('0x52')]})[_0x65ca('0x14')](function(_0x153ae8){_0x52abc2[_0x65ca('0x23')]=_0x153ae8;if(_0x45e31a[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x219b9a[_0x65ca('0x57')]=[{'all':!![]}];}return db[_0x65ca('0x6a')]['findAll'](_0x219b9a);})['then'](function(_0x56feaf){_0x52abc2['rows']=_0x56feaf;return _0x52abc2;});}})['then'](respondWithFilteredResult(_0x38c5a3,_0x219b9a))[_0x65ca('0x1d')](handleError(_0x38c5a3,null));};exports['removeDispositions']=function(_0x977f32,_0x5e25de){return db[_0x65ca('0x56')]['find']({'where':{'id':_0x977f32[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x5e25de,null))[_0x65ca('0x14')](function(_0x1a577a){if(_0x1a577a){return _0x1a577a[_0x65ca('0x6d')](_0x977f32['query'][_0x65ca('0x6e')]);}})[_0x65ca('0x14')](respondWithStatusCode(_0x5e25de,null))['catch'](handleError(_0x5e25de,null));};exports[_0x65ca('0x6f')]=function(_0x22fab6,_0x4826d3){if(_0x22fab6[_0x65ca('0x60')]['id']){delete _0x22fab6[_0x65ca('0x60')]['id'];}return db['ChatWebsite'][_0x65ca('0x5e')]({'where':{'id':_0x22fab6[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4826d3,null))[_0x65ca('0x14')](function(_0x930e51){if(_0x930e51){_0x22fab6[_0x65ca('0x60')][_0x65ca('0x69')]=_0x930e51['id'];return db[_0x65ca('0x70')]['create'](_0x22fab6[_0x65ca('0x60')]);}})['then'](respondWithResult(_0x4826d3,null))['catch'](handleError(_0x4826d3,null));};exports[_0x65ca('0x71')]=function(_0x540e2c,_0x545514){var _0x51fcae={'raw':![],'where':{}};var _0x222f4f={};var _0xea3cd2={'count':0x0,'rows':[]};return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x540e2c[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x545514,null))[_0x65ca('0x14')](function(_0x5d52e6){if(_0x5d52e6){_0x222f4f[_0x65ca('0x42')]=_['keys'](db['CannedAnswer'][_0x65ca('0x46')]);_0x222f4f[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x540e2c[_0x65ca('0x48')]);_0x222f4f[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x222f4f['model'],_0x222f4f[_0x65ca('0x48')]);_0x51fcae['attributes']=_[_0x65ca('0x4a')](_0x222f4f[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x540e2c['query'][_0x65ca('0x4b')]));_0x51fcae[_0x65ca('0x4c')]=_0x51fcae[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x51fcae[_0x65ca('0x4c')]:_0x222f4f[_0x65ca('0x42')];if(!_0x540e2c[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x51fcae[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x540e2c[_0x65ca('0x48')][_0x65ca('0x22')]);_0x51fcae['offset']=qs['offset'](_0x540e2c['query'][_0x65ca('0x21')]);}_0x51fcae[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x540e2c[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x51fcae[_0x65ca('0x52')]=qs['filters'](_[_0x65ca('0x50')](_0x540e2c[_0x65ca('0x48')],_0x222f4f['filters']));_0x51fcae[_0x65ca('0x52')][_0x65ca('0x69')]=_0x5d52e6['id'];if(_0x540e2c[_0x65ca('0x48')][_0x65ca('0x51')]){_0x51fcae[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x51fcae['where'],{'$or':_['map'](_0x51fcae[_0x65ca('0x4c')],function(_0x3054ab){var _0x3ba20b={};_0x3ba20b[_0x3054ab]={'$like':'%'+_0x540e2c[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x3ba20b;})});}_0x51fcae=_['merge']({},_0x51fcae,_0x540e2c[_0x65ca('0x55')]);return db[_0x65ca('0x70')]['count']({'where':_0x51fcae[_0x65ca('0x52')]})[_0x65ca('0x14')](function(_0x20f5ba){_0xea3cd2[_0x65ca('0x23')]=_0x20f5ba;if(_0x540e2c[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x51fcae[_0x65ca('0x57')]=[{'all':!![]}];}return db[_0x65ca('0x70')]['findAll'](_0x51fcae);})[_0x65ca('0x14')](function(_0x3c9dce){_0xea3cd2[_0x65ca('0x59')]=_0x3c9dce;return _0xea3cd2;});}})[_0x65ca('0x14')](respondWithFilteredResult(_0x545514,_0x51fcae))[_0x65ca('0x1d')](handleError(_0x545514,null));};exports[_0x65ca('0x73')]=function(_0x314217,_0x24c2e9){return db[_0x65ca('0x56')]['find']({'where':{'id':_0x314217[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x24c2e9,null))['then'](function(_0x5a74c8){if(_0x5a74c8){return _0x5a74c8[_0x65ca('0x73')](_0x314217[_0x65ca('0x48')]['ids']);}})[_0x65ca('0x14')](respondWithStatusCode(_0x24c2e9,null))[_0x65ca('0x1d')](handleError(_0x24c2e9,null));};exports[_0x65ca('0x74')]=function(_0x27a9d7,_0x1ddc42){_0x27a9d7[_0x65ca('0x60')]['sitepic']=_0x27a9d7['file'][_0x65ca('0x75')];return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x27a9d7[_0x65ca('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ddc42,null))[_0x65ca('0x14')](saveUpdates(_0x27a9d7[_0x65ca('0x60')],null))['then'](respondWithResult(_0x1ddc42,null))[_0x65ca('0x1d')](handleError(_0x1ddc42,null));};exports[_0x65ca('0x76')]=function(_0x5cb5d3,_0x4b56c0){_0x5cb5d3[_0x65ca('0x60')][_0x65ca('0x77')]=_0x5cb5d3[_0x65ca('0x78')][_0x65ca('0x75')];return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x5cb5d3[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4b56c0,null))['then'](saveUpdates(_0x5cb5d3[_0x65ca('0x60')],null))[_0x65ca('0x14')](respondWithResult(_0x4b56c0,null))['catch'](handleError(_0x4b56c0,null));};exports[_0x65ca('0x79')]=function(_0x24627c,_0x1809e0){_0x24627c['body'][_0x65ca('0x7a')]=_0x24627c['file'][_0x65ca('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x24627c[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x1809e0,null))[_0x65ca('0x14')](saveUpdates(_0x24627c[_0x65ca('0x60')],null))['then'](respondWithResult(_0x1809e0,null))['catch'](handleError(_0x1809e0,null));};exports['addSystemAvatar']=function(_0xf649fd,_0x5e474f){_0xf649fd[_0x65ca('0x60')]['systemAvatar']=_0xf649fd[_0x65ca('0x78')][_0x65ca('0x75')];return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0xf649fd[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x5e474f,null))[_0x65ca('0x14')](saveUpdates(_0xf649fd[_0x65ca('0x60')],null))[_0x65ca('0x14')](respondWithResult(_0x5e474f,null))[_0x65ca('0x1d')](handleError(_0x5e474f,null));};exports[_0x65ca('0x7b')]=function(_0x2b0e7b,_0x4fe8f3){var _0x45d47b=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x7e'));var _0x497880={'where':{'id':_0x2b0e7b[_0x65ca('0x5a')]['id']},'attributes':['id',_0x65ca('0x7f')],'raw':!![]};var _0xbad6ef=![];return require('../../config/license/util')['getLicense']()[_0x65ca('0x14')](function(_0x59b9e2){if(_0x59b9e2){_0xbad6ef=_0x59b9e2[_0x65ca('0x80')];}})[_0x65ca('0x14')](function(){return db[_0x65ca('0x56')]['find'](_0x497880);})[_0x65ca('0x14')](handleEntityNotFound(_0x4fe8f3,null))[_0x65ca('0x14')](function(_0x2b31f2){if(_0x2b31f2){if(!_[_0x65ca('0x81')](_0x2b31f2['sitepic'])){if(fs[_0x65ca('0x82')](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server/files/images/logos/',_0x2b31f2[_0x65ca('0x7f')]))&&_0xbad6ef){_0x45d47b=path[_0x65ca('0x7c')](config['root'],'server/files/images/logos/',_0x2b31f2[_0x65ca('0x7f')]);}}return _0x4fe8f3[_0x65ca('0x83')](_0x45d47b);}})['catch'](handleError(_0x4fe8f3,null));};exports[_0x65ca('0x84')]=function(_0x535634,_0x3c30ab){var _0x3109e5=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x85'));var _0x4549eb={'where':{'id':_0x535634[_0x65ca('0x5a')]['id']},'attributes':['id',_0x65ca('0x77')],'raw':!![]};return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0x4549eb)[_0x65ca('0x14')](handleEntityNotFound(_0x3c30ab,null))[_0x65ca('0x14')](function(_0x3bc765){if(_0x3bc765){if(!_[_0x65ca('0x81')](_0x3bc765[_0x65ca('0x77')])){if(fs[_0x65ca('0x82')](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x86'),_0x3bc765[_0x65ca('0x77')]))){_0x3109e5=path[_0x65ca('0x7c')](config['root'],_0x65ca('0x86'),_0x3bc765[_0x65ca('0x77')]);}}return _0x3c30ab[_0x65ca('0x83')](_0x3109e5);}})[_0x65ca('0x1d')](handleError(_0x3c30ab,null));};exports[_0x65ca('0x87')]=function(_0x3a1ad5,_0x51910c){var _0x383cbc=path[_0x65ca('0x7c')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0xfcda7e={'where':{'id':_0x3a1ad5['params']['id']},'attributes':['id',_0x65ca('0x7a'),'showCustomerAvatar'],'raw':!![]};return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0xfcda7e)[_0x65ca('0x14')](handleEntityNotFound(_0x51910c,null))['then'](function(_0x1e735c){if(_0x1e735c){if(!_[_0x65ca('0x81')](_0x1e735c[_0x65ca('0x7a')])){if(fs[_0x65ca('0x82')](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x86'),_0x1e735c[_0x65ca('0x7a')]))&&_0x1e735c[_0x65ca('0x88')]){_0x383cbc=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x86'),_0x1e735c[_0x65ca('0x7a')]);}}return _0x51910c[_0x65ca('0x83')](_0x383cbc);}})['catch'](handleError(_0x51910c,null));};exports[_0x65ca('0x89')]=function(_0x30bfa3,_0x4903bf){var _0x222649=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0x8a'));var _0x331093={'where':{'id':_0x30bfa3['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x65ca('0x56')][_0x65ca('0x5e')](_0x331093)[_0x65ca('0x14')](handleEntityNotFound(_0x4903bf,null))['then'](function(_0x5bbc7a){if(_0x5bbc7a){if(!_[_0x65ca('0x81')](_0x5bbc7a[_0x65ca('0x8b')])){if(fs[_0x65ca('0x82')](path['join'](config[_0x65ca('0x7d')],'server/files/images/avatars/',_0x5bbc7a[_0x65ca('0x8b')]))){_0x222649=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server/files/images/avatars/',_0x5bbc7a['systemAvatar']);}}return _0x4903bf['download'](_0x222649);}})['catch'](handleError(_0x4903bf,null));};exports[_0x65ca('0x8c')]=function(_0x1768d1,_0x5e5c3b){var _0xd1aac={'body':_0x1768d1[_0x65ca('0x60')],'channel':'chat'};var _0x525f3e=[];var _0x4db97b=[];var _0x13dcb6={};var _0x2eda1a=![];return db['CmContact'][_0x65ca('0x67')]()[_0x65ca('0x14')](function(_0x117389){if(!_0x117389){throw new db['Sequelize'][(_0x65ca('0x8d'))]('no\x20available\x20attributes');}_0x525f3e=_['difference'](_[_0x65ca('0x5c')](_0x117389),[_0x65ca('0x8e'),_0x65ca('0x8f')]);_0x4db97b=_['difference'](_[_0x65ca('0x5c')](_0x117389),[_0x65ca('0x8e'),_0x65ca('0x8f'),_0x65ca('0x90'),'ListId']);if(_0x1768d1[_0x65ca('0x60')]['id']){delete _0x1768d1[_0x65ca('0x60')]['id'];}if(_[_0x65ca('0x81')](_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')])){throw new db['Sequelize'][(_0x65ca('0x8d'))](_0x65ca('0x92'));}if(_[_0x65ca('0x81')](_0x1768d1[_0x65ca('0x60')][_0x65ca('0x60')])||_0x1768d1[_0x65ca('0x60')][_0x65ca('0x60')]===''){throw new db[(_0x65ca('0x93'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1768d1['body'][_0x65ca('0x94')])){throw new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0x95')+_0x4db97b);}if(!_['includes'](_0x4db97b,_0x1768d1[_0x65ca('0x60')][_0x65ca('0x94')])){throw new db['Sequelize']['ValidationError'](_0x65ca('0x96')+_0x4db97b);}_0x13dcb6[_0x1768d1[_0x65ca('0x60')][_0x65ca('0x94')]]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1768d1[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x97')],'as':_0x65ca('0x98'),'include':[{'model':db[_0x65ca('0x99')],'as':_0x65ca('0x9a'),'where':_0x13dcb6,'limit':0x1,'order':[[_0x65ca('0x8f'),'DESC']]}]},{'model':db[_0x65ca('0x9b')],'as':_0x65ca('0x9c')},{'model':db['Interval'],'as':_0x65ca('0x9d'),'include':[{'model':db[_0x65ca('0x9d')],'as':'Intervals','attributes':['id',_0x65ca('0x2d')],'raw':!![]}]}]});})['then'](function(_0x3f0eaf){if(!_0x3f0eaf)throw new APINotFoundError(util[_0x65ca('0x3f')](_0x65ca('0x9e'),_0x1768d1[_0x65ca('0x5a')]['id']));if(!_0x3f0eaf['Interval']||!_0x3f0eaf['Interval'][_0x65ca('0x33')])return[_0x3f0eaf,!![]];return[_0x3f0eaf,checkWebsiteIntervals(_0x3f0eaf)];})[_0x65ca('0x9f')](function(_0x4700c7,_0x3782fc){if(!_0x3782fc)throw new APIOutOfIntervalError();if(!_0x4700c7[_0x65ca('0x98')])return;_0xd1aac[_0x65ca('0xa0')]=_0x4700c7;_0xd1aac[_0x65ca('0xa1')]=_0x4700c7['List'];_0xd1aac[_0x65ca('0xa2')]=_[_0x65ca('0xa3')](_0x4700c7[_0x65ca('0x9c')],[_0x65ca('0xa4')],[_0x65ca('0xa5')]);if(_0xd1aac[_0x65ca('0xa0')][_0x65ca('0x9c')]){delete _0xd1aac[_0x65ca('0xa0')][_0x65ca('0x9c')];}if(_0xd1aac['account'][_0x65ca('0x98')]&&_0xd1aac[_0x65ca('0xa0')]['List'][_0x65ca('0x9a')][_0x65ca('0x4d')]){return _0xd1aac[_0x65ca('0xa0')][_0x65ca('0x98')][_0x65ca('0x9a')][0x0];}var _0x4a7cf0=_[_0x65ca('0xa6')](_0x1768d1['body'],{'firstName':_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')],'ListId':_0x4700c7[_0x65ca('0xa7')]});_0x4a7cf0[_0x1768d1[_0x65ca('0x60')]['mapKey']]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0x91')];return db[_0x65ca('0x99')][_0x65ca('0x5f')](_0x4a7cf0,{'fields':_0x525f3e,'raw':!![]});})[_0x65ca('0x14')](function(_0x3fcbbb){_0xd1aac['contact']=_0x3fcbbb;var _0x53ad5b=createInteractionObject(_0x1768d1[_0x65ca('0x5a')]['id'],_0x1768d1[_0x65ca('0x60')],_0x1768d1[_0x65ca('0xa8')],_0x3fcbbb);var _0x29db8c={'ChatWebsiteId':_0x1768d1[_0x65ca('0x5a')]['id'],'closed':![]};if(_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')]){_0x29db8c[_0x65ca('0xa9')]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')];return db[_0x65ca('0xaa')][_0x65ca('0x5e')]({'where':_0x29db8c})[_0x65ca('0x14')](function(_0x408ed4){if(_0x408ed4){_0x2eda1a=!![];return _0x408ed4;}_0x53ad5b[_0x65ca('0xa9')]=_0x1768d1['body'][_0x65ca('0xa9')];_0x53ad5b[_0x65ca('0xab')]=_0x1768d1[_0x65ca('0x60')][_0x65ca('0xab')];return db['ChatInteraction'][_0x65ca('0x5f')](_0x53ad5b);});}_0x29db8c[_0x65ca('0xac')]=_0x3fcbbb['id'];if(_0x1768d1[_0x65ca('0x60')][_0x65ca('0xad')]&&_0x1768d1[_0x65ca('0x60')][_0x65ca('0xad')]['id']){_0x29db8c['id']=_0x1768d1[_0x65ca('0x60')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x29db8c})['then'](function(_0xff95a5){if(_0xff95a5){_0x2eda1a=!![];return _0xff95a5;}return db[_0x65ca('0xaa')][_0x65ca('0x5f')](_0x53ad5b);});}return db['ChatInteraction'][_0x65ca('0x5f')](_0x53ad5b);})['then'](function(_0x13245b){if(!_0x2eda1a)return _0x13245b;var _0x4345d7={'from':(_0xd1aac[_0x65ca('0xae')][_0x65ca('0xaf')]||'')+'\x20'+(_0xd1aac[_0x65ca('0xae')]['lastName']||'')};if(_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')]&&_0x1768d1[_0x65ca('0x60')][_0x65ca('0xb0')]&&_0x1768d1[_0x65ca('0x60')][_0x65ca('0xa9')]!=_0x1768d1[_0x65ca('0x60')][_0x65ca('0xb0')]){_0x4345d7[_0x65ca('0xa9')]=_0x1768d1['body'][_0x65ca('0xb0')];}return _0x13245b[_0x65ca('0x25')](_0x4345d7);})[_0x65ca('0x14')](function(_0x3edb11){_0xd1aac[_0x65ca('0xad')]=_0x3edb11[_0x65ca('0x27')]({'plain':!![]});_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb1')]=!_0x2eda1a;if(_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb1')]){if(_0xd1aac['account'][_0x65ca('0xb2')]){_0xd1aac['applications']['push']({'id':0x0,'priority':_0xd1aac['applications'][_0x65ca('0x4d')]+0x1,'app':_0x65ca('0xb3'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x65ca('0xb4')][_0x65ca('0x5f')]({'body':_0x1768d1[_0x65ca('0x60')][_0x65ca('0x60')],'ChatWebsiteId':_0x1768d1['params']['id'],'ChatInteractionId':_0x3edb11['id'],'direction':'in','ContactId':_0xd1aac[_0x65ca('0xae')]['id'],'AttachmentId':_0x1768d1[_0x65ca('0x60')][_0x65ca('0xb5')]});})[_0x65ca('0x14')](function(_0x29f9a8){_0xd1aac[_0x65ca('0x1b')]=_0x29f9a8;if(!_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb6')]){return;}return db[_0x65ca('0xb7')][_0x65ca('0x5e')]({'attributes':['id',_0x65ca('0x2b')],'where':{'id':_0xd1aac[_0x65ca('0xad')][_0x65ca('0xb6')]}});})[_0x65ca('0x14')](function(_0x57218d){if(_0x57218d){_0xd1aac[_0x65ca('0xa2')][_0x65ca('0xb8')]({'id':0x0,'priority':0x0,'app':_0x65ca('0xb9'),'appdata':_0x57218d['name']+','+(_0xd1aac[_0x65ca('0xa0')][_0x65ca('0xba')]||0xa),'interval':_0x65ca('0xbb')});_0xd1aac[_0x65ca('0xbc')]=!![];}if(!_0xd1aac[_0x65ca('0xad')]['queueId']){return;}return db[_0x65ca('0xbd')][_0x65ca('0x5e')]({'attributes':['id',_0x65ca('0x2b')],'where':{'id':_0xd1aac['interaction']['queueId']}});})[_0x65ca('0x14')](function(_0x2b0b0b){if(_0x2b0b0b){_0xd1aac[_0x65ca('0xa2')][_0x65ca('0xb8')]({'id':0x0,'priority':0x1,'app':_0x65ca('0xbe'),'appdata':_0x2b0b0b[_0x65ca('0x2b')]+','+(_0xd1aac[_0x65ca('0xa0')][_0x65ca('0xbf')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x65ca('0xc0'),_0x65ca('0xc1'),_0xd1aac);})[_0x65ca('0x14')](function(_0x2ce01d){respondWithRpcPromise(_0x65ca('0xc2'),_0x65ca('0xc2'),{'event':_0x65ca('0x8c'),'message':_0x2ce01d},client9002);return _0x2ce01d;})[_0x65ca('0x14')](respondWithResult(_0x5e5c3b,null))[_0x65ca('0x1d')](APIHandleError(_0x5e5c3b));};exports[_0x65ca('0xc3')]=function(_0x3c4d6c,_0x109db6){var _0x58d483,_0x495df0,_0x575f1d;var _0xd33a5f=[];var _0x8e4505={};var _0x4a371f=_0x3c4d6c['files']||[];var _0x4e9e53=[];var _0x428263;return db[_0x65ca('0x99')][_0x65ca('0x67')]()[_0x65ca('0x14')](function(_0x17e65e){if(!_0x17e65e){throw new db[(_0x65ca('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0xd33a5f=_[_0x65ca('0xc4')](_[_0x65ca('0x5c')](_0x17e65e),['createdAt','updatedAt',_0x65ca('0x90'),_0x65ca('0xa7')]);if(_0x3c4d6c['body']['id']){delete _0x3c4d6c[_0x65ca('0x60')]['id'];}if(_[_0x65ca('0x81')](_0x3c4d6c['body'][_0x65ca('0x91')])){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db['Sequelize'][(_0x65ca('0x8d'))](_0x65ca('0x92')));}if(_[_0x65ca('0x81')](_0x3c4d6c['body'][_0x65ca('0x60')])||_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x60')]===''){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0xc6')));}if(_[_0x65ca('0x81')](_0x3c4d6c[_0x65ca('0x60')]['mapKeyOffline'])){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0xc7')+_0xd33a5f));}if(!_['includes'](_0xd33a5f,_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0xc8')])){throw _0x109db6[_0x65ca('0x1e')](0x1f4)[_0x65ca('0xc5')](new db[(_0x65ca('0x93'))][(_0x65ca('0x8d'))](_0x65ca('0xc9')+_0xd33a5f));}_0x8e4505[_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0xc8')]]=_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x91')];})[_0x65ca('0x14')](function(){return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'where':{'id':_0x3c4d6c[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x97')],'as':_0x65ca('0x98')},{'model':db[_0x65ca('0xca')],'as':_0x65ca('0xca')}]});})['then'](handleEntityNotFound(_0x109db6,null))['then'](function(_0x37accc){if(_0x37accc&&_0x37accc[_0x65ca('0x98')]){_0x495df0=_0x37accc;var _0xf1a60a=_[_0x65ca('0xa6')](_0x3c4d6c[_0x65ca('0x60')],{'firstName':_0x3c4d6c[_0x65ca('0x60')]['from'],'phone':_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x91')],'ListId':_0x37accc[_0x65ca('0xa7')]});_0xf1a60a[_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0xc8')]]=_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x91')];return db[_0x65ca('0x99')]['findOrCreate']({'where':_0x8e4505,'defaults':_0xf1a60a});}})[_0x65ca('0x9f')](function(_0x438a21){if(_0x438a21){_0x575f1d=_0x438a21;var _0x24135e=fs[_0x65ca('0xcb')](path['join'](config[_0x65ca('0x7d')],_0x65ca('0xcc')),'utf8');var _0x178c63=ejs[_0x65ca('0xcd')](_0x24135e,{'body':_[_0x65ca('0xce')](_0x3c4d6c[_0x65ca('0x60')][_0x65ca('0x60')]),'bodyTitle':_0x495df0[_0x65ca('0xcf')]});return db[_0x65ca('0xd0')][_0x65ca('0x5f')]({'body':_0x178c63,'plainBody':htmlToText[_0x65ca('0xd1')](_0x178c63),'ContactId':_0x438a21['id'],'ChatWebsiteId':_0x495df0['id']});}})[_0x65ca('0x14')](function(_0x44cd94){_0x428263=_0x44cd94;if(_0x4a371f[_0x65ca('0x4d')]){var _0x5ea09b=_0x4a371f[_0x65ca('0x32')](function(_0x5b5e45){return{'name':_0x5b5e45[_0x65ca('0xd2')],'basename':_0x5b5e45[_0x65ca('0x75')],'type':_0x5b5e45[_0x65ca('0xd3')],'ChatOfflineMessageId':_0x44cd94['id']};});_0x4e9e53=_0x5ea09b[_0x65ca('0x32')](_0x15dae9=>{var _0x42689b={'filename':_0x15dae9[_0x65ca('0x2b')],'path':path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],_0x65ca('0xd4'),_0x65ca('0xd5'),_0x65ca('0xd6'),_0x65ca('0xd7'),_0x15dae9[_0x65ca('0xd8')])};return _0x42689b;});if(!_0x495df0[_0x65ca('0xd9')]){return db[_0x65ca('0xda')][_0x65ca('0xdb')](function(_0x1aa96b){return db[_0x65ca('0xdc')][_0x65ca('0xdd')](_0x5ea09b,{'transaction':_0x1aa96b});});}}})['then'](function(){if(_0x428263){_0x58d483=_0x428263;return db[_0x65ca('0xca')][_0x65ca('0x6b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x65ca('0xde'),'raw':!![],'include':[{'model':db[_0x65ca('0xdf')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x65ca('0x14')](function(_0x3a1938){if(_0x3a1938&&_0x3a1938[_0x65ca('0xde')]&&_0x495df0[_0x65ca('0xe0')]&&_0x495df0[_0x65ca('0xe1')]){var _0x45b23a=_0x3a1938['getSmtpOptions']();return respondWithRpcPromise(_0x65ca('0xe2'),'sendMail',{'account':_0x45b23a,'message':{'from':util[_0x65ca('0x3f')]('\x22%s\x22\x20<%s>',_0x3a1938[_0x65ca('0x2b')],_0x3a1938[_0x65ca('0xe3')]||_0x3a1938[_0x65ca('0xde')][_0x65ca('0x61')]),'to':_0x495df0[_0x65ca('0xe1')],'subject':_0x495df0['offlineMessageSubject'],'html':_0x58d483[_0x65ca('0x60')],'attachments':_0x4e9e53}},client9003)[_0x65ca('0x14')](function(){return _0x58d483;})[_0x65ca('0x1d')](function(_0x34f660){logger['error'](_0x34f660);});}})[_0x65ca('0x14')](function(){if(_0x495df0&&_0x495df0[_0x65ca('0xd9')]&&_0x495df0[_0x65ca('0xe4')]){var _0x52ccec=[];if(_0x4a371f[_0x65ca('0x4d')]){_0x52ccec=_0x4a371f[_0x65ca('0x32')](function(_0xf51ca6){return{'name':_0xf51ca6[_0x65ca('0xd2')],'basename':_0xf51ca6['filename'],'type':_0xf51ca6[_0x65ca('0xd3')],'ChatOfflineMessageId':_0x428263['id']};});}var _0x5a557f;if(!_[_0x65ca('0x81')](_0x495df0['subjectOffline'])){var _0x31abbf=_['map'](_0x3c4d6c[_0x65ca('0x60')],function(_0xf24f07){return _0xf24f07;});var _0x2857b8=_['toPairsIn'](_0x31abbf)[0x0];var _0x2190a5=_['mapValues'](_0x2857b8,function(_0x338901){return _0x338901;});_0x5a557f=_0x2190a5[0x1][_0x495df0[_0x65ca('0xe5')]];}var _0x1c3688={'from':_0x575f1d[_0x65ca('0xe3')],'firstName':_0x575f1d[_0x65ca('0xaf')],'lastName':_0x575f1d['lastName'],'mapKey':_0x65ca('0xe3'),'message':{'from':_0x575f1d['email'],'to':_0x495df0[_0x65ca('0xca')]['email'],'cc':'','subject':_[_0x65ca('0x81')](_0x5a557f)?_0x495df0[_0x65ca('0xe6')]:_0x5a557f,'messageId':'','sentAt':new Date(),'attach':_0x52ccec[_0x65ca('0x4d')],'attachments':_0x52ccec,'originChannel':'Chat','ChatWebsiteId':_0x495df0['id'],'ChatOfflineMessageId':_0x58d483['id'],'originTo':_0x495df0[_0x65ca('0xca')][_0x65ca('0xe3')]},'body':_0x58d483[_0x65ca('0x60')]};var _0x3a200d={'account':{'id':_0x495df0['MailAccountId']},'body':_0x1c3688,'log':_0x65ca('0xe7')};return respondWithRpcPromise(_0x65ca('0xe7'),_0x65ca('0xe8'),_0x3a200d,client9001)['then'](function(){return _0x58d483;})[_0x65ca('0x1d')](function(_0x905625){logger[_0x65ca('0x19')](_0x905625);});}return;})[_0x65ca('0x14')](function(){if(_0x58d483){return _0x58d483;}})['then'](respondWithResult(_0x109db6,null))[_0x65ca('0x1d')](function(){for(var _0x31ba50 of _0x4a371f){var _0x4a0957=path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server',_0x65ca('0xd5'),_0x65ca('0xd6'),_0x65ca('0xd7'),_0x31ba50[_0x65ca('0x75')]);fs_extra[_0x65ca('0xe9')](_0x4a0957)[_0x65ca('0x1d')](function(_0x10e2f4){logger[_0x65ca('0x19')](_0x65ca('0xea'),_0x4a0957,_0x10e2f4);});}});};exports['addInteraction']=function(_0x104eff,_0x1d97c7){return db[_0x65ca('0xaa')]['find']({'where':{'id':_0x104eff['params']['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x1d97c7,null))['then'](function(_0x2f3158){if(_0x2f3158){return _0x2f3158[_0x65ca('0xeb')](_0x104eff['body'][_0x65ca('0x6e')],_[_0x65ca('0xec')](_0x104eff[_0x65ca('0x60')],[_0x65ca('0x6e'),'id'])||{});}})[_0x65ca('0x14')](respondWithResult(_0x1d97c7,null))['catch'](handleError(_0x1d97c7,null));};exports[_0x65ca('0xed')]=function(_0x545935,_0x4952f9){var _0x4ac9e1={'raw':![],'where':{}};var _0x110640={};var _0x23fcfe={'count':0x0,'rows':[]};return db[_0x65ca('0x56')]['findOne']({'where':{'id':_0x545935[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4952f9,null))[_0x65ca('0x14')](function(_0x3778cb){if(_0x3778cb){_0x110640[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db[_0x65ca('0xaa')][_0x65ca('0x46')]);_0x110640[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x545935['query']);_0x110640[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x110640[_0x65ca('0x42')],_0x110640['query']);_0x4ac9e1[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x110640[_0x65ca('0x42')],qs['fields'](_0x545935['query'][_0x65ca('0x4b')]));_0x4ac9e1['attributes']=_0x4ac9e1['attributes']['length']?_0x4ac9e1[_0x65ca('0x4c')]:_0x110640[_0x65ca('0x42')];if(!_0x545935[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x4ac9e1[_0x65ca('0x22')]=qs['limit'](_0x545935[_0x65ca('0x48')][_0x65ca('0x22')]);_0x4ac9e1[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x545935[_0x65ca('0x48')][_0x65ca('0x21')]);}_0x4ac9e1[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x545935[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x4ac9e1[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x545935[_0x65ca('0x48')],_0x110640[_0x65ca('0x49')]));_0x4ac9e1['where'][_0x65ca('0x69')]=_0x3778cb['id'];if(_0x545935['query']['filter']){_0x4ac9e1[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x4ac9e1['where'],{'$or':_['map'](_0x4ac9e1[_0x65ca('0x4c')],function(_0x120cb3){var _0x4f7c6d={};_0x4f7c6d[_0x120cb3]={'$like':'%'+_0x545935[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x4f7c6d;})});}_0x4ac9e1=_[_0x65ca('0x53')]({},_0x4ac9e1,_0x545935[_0x65ca('0x55')]);return db['ChatInteraction']['count']({'where':_0x4ac9e1['where']})[_0x65ca('0x14')](function(_0x5d5556){_0x23fcfe[_0x65ca('0x23')]=_0x5d5556;if(_0x545935[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x4ac9e1['include']=[{'model':db[_0x65ca('0x99')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x65ca('0xee'),'attributes':[_0x65ca('0x2b'),_0x65ca('0xef'),_0x65ca('0xf0')],'required':![]},{'model':db['Tag'],'as':_0x65ca('0xf1'),'attributes':['id',_0x65ca('0x2b'),'color'],'where':_0x545935[_0x65ca('0x48')][_0x65ca('0xf2')]?{'id':_0x545935[_0x65ca('0x48')][_0x65ca('0xf2')]}:undefined,'required':_0x545935[_0x65ca('0x48')][_0x65ca('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0x65ca('0x58')](_0x4ac9e1);})[_0x65ca('0x14')](function(_0x442f08){_0x23fcfe[_0x65ca('0x59')]=_0x442f08;return _0x23fcfe;});}})['then'](respondWithFilteredResult(_0x4952f9,_0x4ac9e1))[_0x65ca('0x1d')](handleError(_0x4952f9,null));};exports['getSnippet']=function(_0x3077e0,_0x5dfbf4){var _0x90752e=0x0;var _0xb5afcd=0x0;var _0x5a16b3=![];var _0x54cd6f;var _0x2215b4;return db['ChatWebsite'][_0x65ca('0x5e')]({'where':{'id':_0x3077e0[_0x65ca('0x5a')]['id']},'include':[{'model':db[_0x65ca('0x9d')],'as':_0x65ca('0x9d'),'include':[{'model':db[_0x65ca('0x9d')],'as':_0x65ca('0x33'),'attributes':['id',_0x65ca('0x2d')]}]}]})[_0x65ca('0x14')](handleEntityNotFound(_0x5dfbf4,null))[_0x65ca('0x14')](function(_0x5469b0){if(_0x5469b0){_0x54cd6f=_0x5469b0;return _0x5469b0[_0x65ca('0xf3')]({'raw':!![]});}})[_0x65ca('0x14')](function(_0x28df01){if(_0x54cd6f){if(_0x28df01){_0x2215b4=_0x28df01;}}return require('../../config/license/util')[_0x65ca('0xf4')]();})[_0x65ca('0x14')](function(_0x183979){if(_0x183979){_0xb5afcd=_0x183979[_0x65ca('0xf5')];_0x5a16b3=_0x183979['custom'];}})['then'](function(){return db[_0x65ca('0xaa')]['count']({'where':{'closed':![]}});})[_0x65ca('0x14')](function(_0x1543bf){_0x90752e=_0x1543bf;if(_0xb5afcd&&_0x1543bf>_0xb5afcd){return db['License'][_0x65ca('0x6b')]({'where':{'id':0x1}})[_0x65ca('0x14')](function(_0x4373a9){if(_0x4373a9){_0x4373a9[_0x65ca('0xf6')]('chatLicenseExceeded');}});}})['then'](function(){if(!_0x54cd6f[_0x65ca('0x9d')]||!_0x54cd6f['Interval'][_0x65ca('0x33')])return!![];return checkWebsiteIntervals(_0x54cd6f);})['then'](function(_0xc7c019){var _0x4eed0f=fs['readFileSync'](path[_0x65ca('0x7c')](config[_0x65ca('0x7d')],'server/files/chat/iframe.ejs'),_0x65ca('0xf7'));var _0x4004bd=new url[(_0x65ca('0xf8'))](_0x54cd6f['address'])['origin'];var _0x4d4f48=_0x65ca('0xf9');var _0x49be28=![];var _0xfe3576={'chatVersion':_0x4d4f48,'chatWebsiteAddressOrigin':_0x4004bd,'remote':_0x54cd6f[_0x65ca('0xfa')],'query':querystring[_0x65ca('0x18')](_[_0x65ca('0x53')](_0x54cd6f[_0x65ca('0x27')]({'plain':!![]}),{'customerIp':_0x3077e0['headers'][_0x65ca('0x3a')]||_0x3077e0[_0x65ca('0xa8')][_0x65ca('0xfb')]||_0x3077e0['connection'][_0x65ca('0xfc')]||_0x3077e0['ip'],'referer':_0x3077e0[_0x65ca('0xa8')][_0x65ca('0xfd')],'openedInteractions':_0x90752e,'maxInteractions':_0xb5afcd,'virtual':_0x5a16b3[_0x65ca('0xf5')],'online':_0xc7c019,'custom':_0x5a16b3}))[_0x65ca('0xfe')](/'/g,'\x5c\x27')};_0x5dfbf4[_0x65ca('0xc5')](ejs[_0x65ca('0xcd')](Mustache[_0x65ca('0xcd')](_0x4eed0f,_0xfe3576),{'proactiveActions':_0x2215b4,'alignment':_0x54cd6f[_0x65ca('0xff')],'verticalAlignment':_0x54cd6f['verticalAlignment'],'div_color':_0x54cd6f['color'],'labelText':_0x54cd6f[_0x65ca('0x100')],'text_color':_0x54cd6f[_0x65ca('0x101')],'text_button_color':_0x54cd6f[_0x65ca('0x102')],'button_color':_0x54cd6f['color_button'],'background_color':_0x54cd6f['backgroundColor'],'hideWhenOffline':_0x54cd6f[_0x65ca('0x103')],'intervalId':_0x54cd6f[_0x65ca('0x104')],'isDevelopment':_0x49be28,'chatVersion':_0x4d4f48}));})[_0x65ca('0x1d')](handleError(_0x5dfbf4,null));};exports['addApplications']=function(_0x1d7d66,_0x258ea6){var _0x30954d=_0x1d7d66[_0x65ca('0x5a')]['id'];var _0x317ef8=_0x1d7d66[_0x65ca('0x60')];var _0x550ebc=0xc8;var _0x13a2b2=null;return db[_0x65ca('0xda')][_0x65ca('0xdb')]({'isolationLevel':db[_0x65ca('0xda')][_0x65ca('0x105')][_0x65ca('0x106')][_0x65ca('0x107')]},function(_0x1409ca){return db[_0x65ca('0x56')]['findOne']({'where':{'id':_0x30954d},'transaction':_0x1409ca})['then'](function(_0x579a33){if(_0x579a33){return db[_0x65ca('0x9b')][_0x65ca('0x26')]({'where':{'ChatWebsiteId':_0x30954d},'transaction':_0x1409ca})[_0x65ca('0x14')](function(){var _0x48672d=_[_0x65ca('0x32')](_0x317ef8,function(_0x239487){_0x239487[_0x65ca('0x69')]=_0x30954d;return _0x239487;});return db['ChatApplication'][_0x65ca('0xdd')](_0x48672d,{'transaction':_0x1409ca});});}else{_0x550ebc=0x194;_0x13a2b2=[];}});})[_0x65ca('0x14')](function(){if(_0x550ebc!==0x194){return db[_0x65ca('0x9b')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x30954d},'order':_0x65ca('0xa4')})[_0x65ca('0x14')](function(_0x3e1ada){_0x13a2b2=_0x3e1ada;});}})[_0x65ca('0x1d')](function(_0x2ef69f){_0x550ebc=0x1f4;logger[_0x65ca('0x19')](_0x2ef69f[_0x65ca('0x2a')]);if(_0x2ef69f[_0x65ca('0x2b')]){delete _0x2ef69f[_0x65ca('0x2b')];}_0x13a2b2=_0x2ef69f;})[_0x65ca('0x108')](function(){if(_0x13a2b2===null){_0x258ea6['sendStatus'](_0x550ebc);}else{if(_0x550ebc===0x1f4){_0x258ea6[_0x65ca('0x1e')](_0x550ebc)[_0x65ca('0xc5')](_0x13a2b2);}else{_0x258ea6[_0x65ca('0x1e')](_0x550ebc)['json'](_0x13a2b2);}}});};exports[_0x65ca('0x109')]=function(_0x3ff6dc,_0x4c5093){var _0x2066fe={};var _0x164317={};var _0x11b39b;var _0x455ef7;return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x3ff6dc[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x4c5093,null))['then'](function(_0x2b6297){if(_0x2b6297){_0x11b39b=_0x2b6297;_0x164317['model']=_[_0x65ca('0x5c')](db['ChatApplication'][_0x65ca('0x46')]);_0x164317[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x3ff6dc[_0x65ca('0x48')]);_0x164317[_0x65ca('0x49')]=_['intersection'](_0x164317['model'],_0x164317['query']);_0x2066fe[_0x65ca('0x4c')]=_['intersection'](_0x164317[_0x65ca('0x42')],qs[_0x65ca('0x4b')](_0x3ff6dc['query'][_0x65ca('0x4b')]));_0x2066fe[_0x65ca('0x4c')]=_0x2066fe[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x2066fe['attributes']:_0x164317[_0x65ca('0x42')];_0x2066fe[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x3ff6dc[_0x65ca('0x48')]['sort']);_0x2066fe[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x3ff6dc['query'],_0x164317[_0x65ca('0x49')]));if(_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x51')]){_0x2066fe['where']=_[_0x65ca('0x53')](_0x2066fe['where'],{'$or':_[_0x65ca('0x32')](_0x2066fe[_0x65ca('0x4c')],function(_0x339ce0){var _0x2539cf={};_0x2539cf[_0x339ce0]={'$like':'%'+_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x51')]+'%'};return _0x2539cf;})});}_0x2066fe=_[_0x65ca('0x53')]({},_0x2066fe,_0x3ff6dc[_0x65ca('0x55')]);return _0x11b39b['getApplications'](_0x2066fe);}})[_0x65ca('0x14')](function(_0x23a85d){if(_0x23a85d){_0x455ef7=_0x23a85d[_0x65ca('0x4d')];if(!_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x2066fe['limit']=qs[_0x65ca('0x22')](_0x3ff6dc[_0x65ca('0x48')][_0x65ca('0x22')]);_0x2066fe[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x3ff6dc['query'][_0x65ca('0x21')]);}return _0x11b39b[_0x65ca('0x109')](_0x2066fe);}})[_0x65ca('0x14')](function(_0x121959){if(_0x121959){return _0x121959?{'count':_0x455ef7,'rows':_0x121959}:null;}})['then'](respondWithResult(_0x4c5093,null))[_0x65ca('0x1d')](handleError(_0x4c5093,null));};exports[_0x65ca('0x10a')]=function(_0x1b34a5,_0x29a56a){return db['chatProactiveAction'][_0x65ca('0x5e')]({'where':{'id':_0x1b34a5['params']['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x29a56a,null))[_0x65ca('0x14')](function(_0x58f852){if(_0x58f852){return _0x58f852[_0x65ca('0x10a')](_0x1b34a5[_0x65ca('0x60')][_0x65ca('0x6e')],_['omit'](_0x1b34a5['body'],[_0x65ca('0x6e'),'id'])||{});}})[_0x65ca('0x14')](respondWithResult(_0x29a56a,null))['catch'](handleError(_0x29a56a,null));};exports[_0x65ca('0xf3')]=function(_0x4cbf4a,_0x196769){var _0x397c14={};var _0x578c54={};var _0x3c08d3;var _0xcf9335;return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x4cbf4a[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x196769,null))[_0x65ca('0x14')](function(_0x3833fc){if(_0x3833fc){_0x3c08d3=_0x3833fc;_0x578c54[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db[_0x65ca('0x10b')][_0x65ca('0x46')]);_0x578c54[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x4cbf4a[_0x65ca('0x48')]);_0x578c54[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x578c54[_0x65ca('0x42')],_0x578c54[_0x65ca('0x48')]);_0x397c14[_0x65ca('0x4c')]=_['intersection'](_0x578c54['model'],qs[_0x65ca('0x4b')](_0x4cbf4a['query'][_0x65ca('0x4b')]));_0x397c14[_0x65ca('0x4c')]=_0x397c14['attributes'][_0x65ca('0x4d')]?_0x397c14[_0x65ca('0x4c')]:_0x578c54[_0x65ca('0x42')];_0x397c14[_0x65ca('0x72')]=qs['sort'](_0x4cbf4a[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x397c14[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x4cbf4a[_0x65ca('0x48')],_0x578c54[_0x65ca('0x49')]));if(_0x4cbf4a[_0x65ca('0x48')]['filter']){_0x397c14[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x397c14[_0x65ca('0x52')],{'$or':_['map'](_0x397c14['attributes'],function(_0x19bf8a){var _0x121224={};_0x121224[_0x19bf8a]={'$like':'%'+_0x4cbf4a['query'][_0x65ca('0x51')]+'%'};return _0x121224;})});}_0x397c14=_[_0x65ca('0x53')]({},_0x397c14,_0x4cbf4a[_0x65ca('0x55')]);return _0x3c08d3[_0x65ca('0xf3')](_0x397c14);}})[_0x65ca('0x14')](function(_0x2bc40a){if(_0x2bc40a){_0xcf9335=_0x2bc40a[_0x65ca('0x4d')];if(!_0x4cbf4a[_0x65ca('0x48')][_0x65ca('0x6c')](_0x65ca('0x4e'))){_0x397c14[_0x65ca('0x22')]=qs[_0x65ca('0x22')](_0x4cbf4a[_0x65ca('0x48')][_0x65ca('0x22')]);_0x397c14['offset']=qs[_0x65ca('0x21')](_0x4cbf4a['query'][_0x65ca('0x21')]);}return _0x3c08d3['getProactiveActions'](_0x397c14);}})[_0x65ca('0x14')](function(_0x3013c6){if(_0x3013c6){return _0x3013c6?{'count':_0xcf9335,'rows':_0x3013c6}:null;}})[_0x65ca('0x14')](respondWithResult(_0x196769,null))[_0x65ca('0x1d')](handleError(_0x196769,null));};exports['getFields']=function(_0x225412,_0x3199b3){var _0x23a14f=_0x225412[_0x65ca('0x48')]['online']===_0x65ca('0x10c')?_0x65ca('0x10d'):'onlineForm';return db[_0x65ca('0x56')][_0x65ca('0x5e')]({'attributes':['id',_0x23a14f],'where':{'id':_0x225412[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x3199b3,null))[_0x65ca('0x14')](function(_0x1589c9){if(_0x1589c9){var _0x4b6c1f=_0x1589c9[_0x23a14f];var _0x29f953=_0x4b6c1f&&_0x4b6c1f['items']?_0x4b6c1f[_0x65ca('0x10e')]:[];_0x3199b3[_0x65ca('0xc5')]({'fromKey':_['isNil'](_0x4b6c1f[_0x65ca('0x10f')])?undefined:_0x4b6c1f['fromKey'],'count':_0x29f953['length'],'rows':_0x29f953});}})[_0x65ca('0x1d')](handleError(_0x3199b3,null));};exports[_0x65ca('0x110')]=function(_0x2bd1b4,_0x10468b){var _0x14c8e4={'raw':![],'where':{}};var _0x5887a0={};var _0x314dd3={'count':0x0,'rows':[]};return db[_0x65ca('0x56')][_0x65ca('0x6b')]({'where':{'id':_0x2bd1b4[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x10468b,null))[_0x65ca('0x14')](function(_0x33da7b){if(_0x33da7b){_0x5887a0[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db['ChatOfflineMessage'][_0x65ca('0x46')]);_0x5887a0[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x2bd1b4[_0x65ca('0x48')]);_0x5887a0['filters']=_[_0x65ca('0x4a')](_0x5887a0[_0x65ca('0x42')],_0x5887a0[_0x65ca('0x48')]);_0x14c8e4[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x5887a0[_0x65ca('0x42')],qs['fields'](_0x2bd1b4['query'][_0x65ca('0x4b')]));_0x14c8e4['attributes']=_0x14c8e4[_0x65ca('0x4c')]['length']?_0x14c8e4[_0x65ca('0x4c')]:_0x5887a0[_0x65ca('0x42')];if(!_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x6c')]('nolimit')){_0x14c8e4['limit']=qs[_0x65ca('0x22')](_0x2bd1b4['query'][_0x65ca('0x22')]);_0x14c8e4[_0x65ca('0x21')]=qs[_0x65ca('0x21')](_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x21')]);}_0x14c8e4[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x14c8e4[_0x65ca('0x52')]=qs[_0x65ca('0x49')](_[_0x65ca('0x50')](_0x2bd1b4[_0x65ca('0x48')],_0x5887a0[_0x65ca('0x49')]));_0x14c8e4[_0x65ca('0x52')][_0x65ca('0x69')]=_0x33da7b['id'];if(_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x51')]){_0x14c8e4['where']=_[_0x65ca('0x53')](_0x14c8e4[_0x65ca('0x52')],{'$or':_['map'](_0x14c8e4[_0x65ca('0x4c')],function(_0x506328){var _0x301d5d={};_0x301d5d[_0x506328]={'$like':'%'+_0x2bd1b4['query']['filter']+'%'};return _0x301d5d;})});}_0x14c8e4=_[_0x65ca('0x53')]({},_0x14c8e4,_0x2bd1b4[_0x65ca('0x55')]);return db['ChatOfflineMessage'][_0x65ca('0x23')]({'where':_0x14c8e4[_0x65ca('0x52')]})[_0x65ca('0x14')](function(_0x5755db){_0x314dd3[_0x65ca('0x23')]=_0x5755db;if(_0x2bd1b4[_0x65ca('0x48')][_0x65ca('0x5d')]){_0x14c8e4[_0x65ca('0x57')]=[{'all':!![]}];}else{_0x14c8e4[_0x65ca('0x57')]=[{'model':db[_0x65ca('0x99')],'as':_0x65ca('0x111'),'required':![]},{'model':db[_0x65ca('0xdc')],'as':_0x65ca('0x112'),'required':![]}];}return db[_0x65ca('0xd0')][_0x65ca('0x58')](_0x14c8e4);})['then'](function(_0x3a2047){_0x314dd3['rows']=_0x3a2047;return _0x314dd3;});}})['then'](respondWithFilteredResult(_0x10468b,_0x14c8e4))[_0x65ca('0x1d')](handleError(_0x10468b,null));};exports[_0x65ca('0x113')]=function(_0x4399db,_0x53bdc5){return db[_0x65ca('0x56')]['find']({'where':{'id':_0x4399db[_0x65ca('0x5a')]['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x53bdc5,null))[_0x65ca('0x14')](function(_0x209d58){if(_0x209d58){return _0x209d58[_0x65ca('0x113')](_0x4399db['body']['ids'],_[_0x65ca('0xec')](_0x4399db[_0x65ca('0x60')],['ids','id'])||{})['spread'](function(_0x157569){for(var _0x3a3954=0x0;_0x3a3954<_0x4399db[_0x65ca('0x60')]['ids'][_0x65ca('0x4d')];_0x3a3954+=0x1){socket[_0x65ca('0x114')](_0x65ca('0x115'),{'UserId':Number(_0x4399db[_0x65ca('0x60')][_0x65ca('0x6e')][_0x3a3954]),'ChatWebsiteId':Number(_0x4399db['params']['id'])});}return _0x157569;});}})[_0x65ca('0x14')](respondWithResult(_0x53bdc5,null))['catch'](handleError(_0x53bdc5,null));};exports[_0x65ca('0x116')]=function(_0x5ecd25,_0x143293){return db['ChatWebsite'][_0x65ca('0x5e')]({'where':{'id':_0x5ecd25[_0x65ca('0x5a')]['id']}})['then'](handleEntityNotFound(_0x143293,null))[_0x65ca('0x14')](function(_0x157fa3){if(_0x157fa3){return _0x157fa3[_0x65ca('0x116')](_0x5ecd25[_0x65ca('0x48')][_0x65ca('0x6e')])[_0x65ca('0x14')](function(){if(_['isArray'](_0x5ecd25['query'][_0x65ca('0x6e')])){for(var _0x1d2180=0x0;_0x1d2180<_0x5ecd25[_0x65ca('0x48')]['ids'][_0x65ca('0x4d')];_0x1d2180+=0x1){socket['emit'](_0x65ca('0x117'),{'UserId':Number(_0x5ecd25[_0x65ca('0x48')]['ids'][_0x1d2180]),'ChatWebsiteId':Number(_0x5ecd25[_0x65ca('0x5a')]['id'])});}}else{socket[_0x65ca('0x114')](_0x65ca('0x117'),{'UserId':Number(_0x5ecd25[_0x65ca('0x48')][_0x65ca('0x6e')]),'ChatWebsiteId':Number(_0x5ecd25[_0x65ca('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x143293,null))[_0x65ca('0x1d')](handleError(_0x143293,null));};exports['getAgents']=function(_0x183aa3,_0x505356){var _0x3bc0c2={};var _0x55772e={};var _0x176bd6;var _0x3a807b;return db[_0x65ca('0x56')]['findOne']({'where':{'id':_0x183aa3['params']['id']}})[_0x65ca('0x14')](handleEntityNotFound(_0x505356,null))['then'](function(_0x187eea){if(_0x187eea){_0x176bd6=_0x187eea;_0x55772e[_0x65ca('0x42')]=_[_0x65ca('0x5c')](db['User'][_0x65ca('0x46')]);_0x55772e[_0x65ca('0x48')]=_[_0x65ca('0x5c')](_0x183aa3[_0x65ca('0x48')]);_0x55772e[_0x65ca('0x49')]=_[_0x65ca('0x4a')](_0x55772e['model'],_0x55772e[_0x65ca('0x48')]);_0x3bc0c2[_0x65ca('0x4c')]=_[_0x65ca('0x4a')](_0x55772e[_0x65ca('0x42')],qs['fields'](_0x183aa3['query'][_0x65ca('0x4b')]));_0x3bc0c2[_0x65ca('0x4c')]=_0x3bc0c2[_0x65ca('0x4c')][_0x65ca('0x4d')]?_0x3bc0c2[_0x65ca('0x4c')]:_0x55772e[_0x65ca('0x42')];_0x3bc0c2[_0x65ca('0x72')]=qs[_0x65ca('0x4f')](_0x183aa3[_0x65ca('0x48')][_0x65ca('0x4f')]);_0x3bc0c2[_0x65ca('0x52')]=qs['filters'](_[_0x65ca('0x50')](_0x183aa3[_0x65ca('0x48')],_0x55772e[_0x65ca('0x49')]));if(_0x183aa3['query'][_0x65ca('0x51')]){_0x3bc0c2[_0x65ca('0x52')]=_[_0x65ca('0x53')](_0x3bc0c2[_0x65ca('0x52')],{'$or':_[_0x65ca('0x32')](_0x3bc0c2[_0x65ca('0x4c')],function(_0x66c77b){var _0x331be7={};_0x331be7[_0x66c77b]={'$like':'%'+_0x183aa3['query'][_0x65ca('0x51')]+'%'};return _0x331be7;})});}_0x3bc0c2=_[_0x65ca('0x53')]({},_0x3bc0c2,_0x183aa3[_0x65ca('0x55')]);return _0x176bd6[_0x65ca('0x118')](_0x3bc0c2);}})[_0x65ca('0x14')](function(_0x39f851){if(_0x39f851){_0x3a807b=_0x39f851[_0x65ca('0x4d')];if(!_0x183aa3[_0x65ca('0x48')][_0x65ca('0x6c')](_0x65ca('0x4e'))){_0x3bc0c2[_0x65ca('0x22')]=qs['limit'](_0x183aa3[_0x65ca('0x48')][_0x65ca('0x22')]);_0x3bc0c2[_0x65ca('0x21')]=qs['offset'](_0x183aa3['query']['offset']);}return _0x176bd6[_0x65ca('0x118')](_0x3bc0c2);}})['then'](function(_0xc0d25){if(_0xc0d25){return _0xc0d25?{'count':_0x3a807b,'rows':_0xc0d25}:null;}})[_0x65ca('0x14')](respondWithResult(_0x505356,null))[_0x65ca('0x1d')](handleError(_0x505356,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 045281d..f5475eb 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 _0x2ce1=['save','update','remove','emit','hasOwnProperty','exports','setMaxListeners'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x2ce1,0x8b));var _0x12ce=function(_0x2416a5,_0x4210a1){_0x2416a5=_0x2416a5-0x0;var _0x529e49=_0x2ce1[_0x2416a5];return _0x529e49;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x12ce('0x0')](0x0);var events={'afterCreate':_0x12ce('0x1'),'afterUpdate':_0x12ce('0x2'),'afterDestroy':_0x12ce('0x3')};function emitEvent(_0x4918dc){return function(_0x37b568,_0x168e95,_0x47dbf8){ChatWebsiteEvents[_0x12ce('0x4')](_0x4918dc+':'+_0x37b568['id'],_0x37b568);ChatWebsiteEvents[_0x12ce('0x4')](_0x4918dc,_0x37b568);_0x47dbf8(null);};}for(var e in events){if(events[_0x12ce('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x12ce('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xb7a8=['hook','exports','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x2eee25,_0x53460d){var _0x1cb8c4=function(_0x4dad56){while(--_0x4dad56){_0x2eee25['push'](_0x2eee25['shift']());}};_0x1cb8c4(++_0x53460d);}(_0xb7a8,0xec));var _0x8b7a=function(_0x3c5752,_0x4df06b){_0x3c5752=_0x3c5752-0x0;var _0x1a98c7=_0xb7a8[_0x3c5752];return _0x1a98c7;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x8b7a('0x0'))['db'][_0x8b7a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b7a('0x2'),'afterUpdate':_0x8b7a('0x3'),'afterDestroy':_0x8b7a('0x4')};function emitEvent(_0x5b033a){return function(_0x3847b8,_0x2c7217,_0x1185b9){ChatWebsiteEvents[_0x8b7a('0x5')](_0x5b033a+':'+_0x3847b8['id'],_0x3847b8);ChatWebsiteEvents[_0x8b7a('0x5')](_0x5b033a,_0x3847b8);_0x1185b9(null);};}for(var e in events){if(events[_0x8b7a('0x6')](e)){var event=events[e];ChatWebsite[_0x8b7a('0x7')](e,emitEvent(event));}}module[_0x8b7a('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 5d54f4c..cba2de3 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 _0x5274=['lodash','../../config/logger','request-promise','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x499a9a,_0x2cd718){var _0x17d768=function(_0x26664e){while(--_0x26664e){_0x499a9a['push'](_0x499a9a['shift']());}};_0x17d768(++_0x2cd718);}(_0x5274,0x90));var _0x4527=function(_0x5baed9,_0x409757){_0x5baed9=_0x5baed9-0x0;var _0x43aad3=_0x5274[_0x5baed9];return _0x43aad3;};'use strict';var _=require(_0x4527('0x0'));var util=require('util');var logger=require(_0x4527('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4527('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4527('0x3'));var config=require('../../config/environment');var attributes=require(_0x4527('0x4'));module[_0x4527('0x5')]=function(_0x3c6f0e,_0xa56ff9){return _0x3c6f0e[_0x4527('0x6')](_0x4527('0x7'),attributes,{'tableName':_0x4527('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c74=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_websites','lodash'];(function(_0x1377da,_0x116f21){var _0x4acefe=function(_0x3bb55e){while(--_0x3bb55e){_0x1377da['push'](_0x1377da['shift']());}};_0x4acefe(++_0x116f21);}(_0x9c74,0x167));var _0x49c7=function(_0x368563,_0x1720cb){_0x368563=_0x368563-0x0;var _0x50a723=_0x9c74[_0x368563];return _0x50a723;};'use strict';var _=require(_0x49c7('0x0'));var util=require(_0x49c7('0x1'));var logger=require(_0x49c7('0x2'))(_0x49c7('0x3'));var moment=require(_0x49c7('0x4'));var BPromise=require(_0x49c7('0x5'));var rp=require(_0x49c7('0x6'));var fs=require('fs');var path=require(_0x49c7('0x7'));var rimraf=require(_0x49c7('0x8'));var config=require(_0x49c7('0x9'));var attributes=require('./chatWebsite.attributes');module[_0x49c7('0xa')]=function(_0x490f2e,_0xed0bb0){return _0x490f2e['define']('ChatWebsite',attributes,{'tableName':_0x49c7('0xb'),'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 65d6807..40a54d8 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 _0xf3c7=['request','then','info','ChatWebsite,\x20%s,\x20%s','debug','error','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register'];(function(_0x3b6648,_0x2d723a){var _0x5a0a0d=function(_0x133dea){while(--_0x133dea){_0x3b6648['push'](_0x3b6648['shift']());}};_0x5a0a0d(++_0x2d723a);}(_0xf3c7,0x17d));var _0x7f3c=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0xf3c7[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0x7f3c('0x0'));var util=require(_0x7f3c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f3c('0x2'));var fs=require('fs');var Redis=require(_0x7f3c('0x3'));var db=require(_0x7f3c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f3c('0x5'))(_0x7f3c('0x6'));var config=require(_0x7f3c('0x7'));var jayson=require(_0x7f3c('0x8'));var client=jayson['client'][_0x7f3c('0x9')]({'port':0x232a});config[_0x7f3c('0xa')]=_[_0x7f3c('0xb')](config[_0x7f3c('0xa')],{'host':_0x7f3c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f3c('0xa')]));require(_0x7f3c('0xd'))[_0x7f3c('0xe')](socket);function respondWithRpcPromise(_0x3f9f91,_0x589a1c,_0xa4c533){return new BPromise(function(_0x405545,_0x77929f){return client[_0x7f3c('0xf')](_0x3f9f91,_0xa4c533)[_0x7f3c('0x10')](function(_0x189e2e){logger[_0x7f3c('0x11')](_0x7f3c('0x12'),_0x589a1c,'request\x20sent');logger[_0x7f3c('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x589a1c,'request\x20sent',JSON['stringify'](_0x189e2e));if(_0x189e2e[_0x7f3c('0x14')]){if(_0x189e2e[_0x7f3c('0x14')]['code']===0x1f4){logger['error'](_0x7f3c('0x12'),_0x589a1c,_0x189e2e['error'][_0x7f3c('0x15')]);return _0x77929f(_0x189e2e['error'][_0x7f3c('0x15')]);}logger[_0x7f3c('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x589a1c,_0x189e2e[_0x7f3c('0x14')][_0x7f3c('0x15')]);return _0x405545(_0x189e2e[_0x7f3c('0x14')][_0x7f3c('0x15')]);}else{logger['info'](_0x7f3c('0x12'),_0x589a1c,'request\x20sent');_0x405545(_0x189e2e['result'][_0x7f3c('0x15')]);}})['catch'](function(_0x11cb16){logger['error'](_0x7f3c('0x12'),_0x589a1c,_0x11cb16);_0x77929f(_0x11cb16);});});}
\ No newline at end of file
+var _0x1e1f=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0xfbca3,_0xfba1fd){var _0x2c3fa1=function(_0x47d5bd){while(--_0x47d5bd){_0xfbca3['push'](_0xfbca3['shift']());}};_0x2c3fa1(++_0xfba1fd);}(_0x1e1f,0x1c4));var _0xf1e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e1f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf1e1('0x0'));var util=require('util');var moment=require(_0xf1e1('0x1'));var BPromise=require('bluebird');var rs=require(_0xf1e1('0x2'));var fs=require('fs');var Redis=require(_0xf1e1('0x3'));var db=require(_0xf1e1('0x4'))['db'];var utils=require(_0xf1e1('0x5'));var logger=require(_0xf1e1('0x6'))(_0xf1e1('0x7'));var config=require(_0xf1e1('0x8'));var jayson=require(_0xf1e1('0x9'));var client=jayson['client'][_0xf1e1('0xa')]({'port':0x232a});config[_0xf1e1('0xb')]=_[_0xf1e1('0xc')](config[_0xf1e1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1e1('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xf1e1('0xe')](socket);function respondWithRpcPromise(_0x1a54e6,_0x2cdccf,_0x2f7c3d){return new BPromise(function(_0xa30826,_0x208cd2){return client['request'](_0x1a54e6,_0x2f7c3d)[_0xf1e1('0xf')](function(_0x5544be){logger[_0xf1e1('0x10')](_0xf1e1('0x11'),_0x2cdccf,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2cdccf,_0xf1e1('0x12'),JSON[_0xf1e1('0x13')](_0x5544be));if(_0x5544be['error']){if(_0x5544be['error'][_0xf1e1('0x14')]===0x1f4){logger[_0xf1e1('0x15')](_0xf1e1('0x11'),_0x2cdccf,_0x5544be[_0xf1e1('0x15')][_0xf1e1('0x16')]);return _0x208cd2(_0x5544be[_0xf1e1('0x15')][_0xf1e1('0x16')]);}logger[_0xf1e1('0x15')](_0xf1e1('0x11'),_0x2cdccf,_0x5544be[_0xf1e1('0x15')]['message']);return _0xa30826(_0x5544be[_0xf1e1('0x15')][_0xf1e1('0x16')]);}else{logger[_0xf1e1('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x2cdccf,_0xf1e1('0x12'));_0xa30826(_0x5544be[_0xf1e1('0x17')][_0xf1e1('0x16')]);}})[_0xf1e1('0x18')](function(_0x46bdad){logger[_0xf1e1('0x15')](_0xf1e1('0x11'),_0x2cdccf,_0x46bdad);_0x208cd2(_0x46bdad);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 40fc773..0fd9d03 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 _0xe34d=['update','emit','register','length','./chatWebsite.events','save','remove'];(function(_0xd97b73,_0xce94b1){var _0xefe357=function(_0x48bc4b){while(--_0x48bc4b){_0xd97b73['push'](_0xd97b73['shift']());}};_0xefe357(++_0xce94b1);}(_0xe34d,0xac));var _0xde34=function(_0x5e38cf,_0x469109){_0x5e38cf=_0x5e38cf-0x0;var _0x259d98=_0xe34d[_0x5e38cf];return _0x259d98;};'use strict';var ChatWebsiteEvents=require(_0xde34('0x0'));var events=[_0xde34('0x1'),_0xde34('0x2'),_0xde34('0x3')];function createListener(_0x4ea0b4,_0x910bbc){return function(_0x1fff9f){_0x910bbc[_0xde34('0x4')](_0x4ea0b4,_0x1fff9f);};}function removeListener(_0x28d7e8,_0x729013){return function(){ChatWebsiteEvents['removeListener'](_0x28d7e8,_0x729013);};}exports[_0xde34('0x5')]=function(_0x58002a){for(var _0x421a6a=0x0,_0x420d0c=events[_0xde34('0x6')];_0x421a6a<_0x420d0c;_0x421a6a++){var _0x57f45d=events[_0x421a6a];var _0x302686=createListener('chatWebsite:'+_0x57f45d,_0x58002a);ChatWebsiteEvents['on'](_0x57f45d,_0x302686);}};
\ No newline at end of file
+var _0x2e0f=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0xc35608,_0x6f0a34){var _0x4be993=function(_0x424f6c){while(--_0x424f6c){_0xc35608['push'](_0xc35608['shift']());}};_0x4be993(++_0x6f0a34);}(_0x2e0f,0x17c));var _0xf2e0=function(_0x4b32d1,_0xd8ac22){_0x4b32d1=_0x4b32d1-0x0;var _0xcd942d=_0x2e0f[_0x4b32d1];return _0xcd942d;};'use strict';var ChatWebsiteEvents=require(_0xf2e0('0x0'));var events=[_0xf2e0('0x1'),_0xf2e0('0x2'),_0xf2e0('0x3')];function createListener(_0x41ea3b,_0x41af33){return function(_0x4df069){_0x41af33['emit'](_0x41ea3b,_0x4df069);};}function removeListener(_0x25eeeb,_0x493d2c){return function(){ChatWebsiteEvents[_0xf2e0('0x4')](_0x25eeeb,_0x493d2c);};}exports[_0xf2e0('0x5')]=function(_0x24a61b){for(var _0x495fa3=0x0,_0xf40ad9=events[_0xf2e0('0x6')];_0x495fa3<_0xf40ad9;_0x495fa3++){var _0xaa48fc=events[_0x495fa3];var _0x949231=createListener(_0xf2e0('0x7')+_0xaa48fc,_0x24a61b);ChatWebsiteEvents['on'](_0xaa48fc,_0x949231);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 318d569..c57da56 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 _0x492d=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','file','server/files/images/avatars/','originalname','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeAnswers'];(function(_0x40c2e,_0x23f20e){var _0x17e891=function(_0x1b39b5){while(--_0x1b39b5){_0x40c2e['push'](_0x40c2e['shift']());}};_0x17e891(++_0x23f20e);}(_0x492d,0x16e));var _0xd492=function(_0x34a863,_0x43936f){_0x34a863=_0x34a863-0x0;var _0x134dd7=_0x492d[_0x34a863];return _0x134dd7;};'use strict';var multer=require('multer');var util=require(_0xd492('0x0'));var path=require(_0xd492('0x1'));var timeout=require(_0xd492('0x2'));var express=require(_0xd492('0x3'));var router=express[_0xd492('0x4')]();var fs_extra=require(_0xd492('0x5'));var auth=require(_0xd492('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd492('0x7'));var controller=require(_0xd492('0x8'));router[_0xd492('0x9')]('/',auth['isAuthenticated'](),controller[_0xd492('0xa')]);router[_0xd492('0x9')](_0xd492('0xb'),auth[_0xd492('0xc')](),controller[_0xd492('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd492('0x9')](_0xd492('0xe'),auth['isAuthenticated'](),controller[_0xd492('0xf')]);router[_0xd492('0x9')](_0xd492('0x10'),auth['isAuthenticated'](),controller[_0xd492('0x11')]);router[_0xd492('0x9')](_0xd492('0x12'),controller[_0xd492('0x13')]);router[_0xd492('0x9')]('/:id/avatar',controller[_0xd492('0x14')]);router['get'](_0xd492('0x15'),controller[_0xd492('0x16')]);router['get'](_0xd492('0x17'),controller[_0xd492('0x18')]);router[_0xd492('0x9')](_0xd492('0x19'),auth[_0xd492('0xc')](),controller[_0xd492('0x1a')]);router[_0xd492('0x9')](_0xd492('0x1b'),controller[_0xd492('0x1c')]);router[_0xd492('0x9')](_0xd492('0x1d'),auth[_0xd492('0xc')](),controller[_0xd492('0x1e')]);router[_0xd492('0x9')](_0xd492('0x1f'),auth[_0xd492('0xc')](),controller[_0xd492('0x20')]);router[_0xd492('0x9')](_0xd492('0x21'),controller[_0xd492('0x22')]);router[_0xd492('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xd492('0x23')]);router[_0xd492('0x9')](_0xd492('0x24'),auth[_0xd492('0xc')](),controller[_0xd492('0x25')]);router[_0xd492('0x26')]('/',auth[_0xd492('0xc')](),controller['create']);router[_0xd492('0x26')]('/:id/dispositions',auth[_0xd492('0xc')](),controller['addDisposition']);router[_0xd492('0x26')](_0xd492('0x10'),auth[_0xd492('0xc')](),controller[_0xd492('0x27')]);var upload=multer({'storage':multer[_0xd492('0x28')]({'destination':function(_0x10737a,_0x143a7a,_0x1629df){_0x1629df(null,path[_0xd492('0x29')](config[_0xd492('0x2a')],_0xd492('0x2b')));},'filename':function(_0x421a6d,_0x491567,_0x49da24){_0x49da24(null,util[_0xd492('0x2c')](_0xd492('0x2d'),Date[_0xd492('0x2e')](),_0x491567['originalname']));}})});router[_0xd492('0x26')](_0xd492('0x12'),upload['single'](_0xd492('0x2f')),controller['addLogo']);var upload=multer({'storage':multer[_0xd492('0x28')]({'destination':function(_0x4b3692,_0x2e1862,_0xfd324c){_0xfd324c(null,path[_0xd492('0x29')](config[_0xd492('0x2a')],_0xd492('0x30')));},'filename':function(_0x51fe74,_0x447b12,_0x3e7aa0){_0x3e7aa0(null,util[_0xd492('0x2c')](_0xd492('0x2d'),Date[_0xd492('0x2e')](),_0x447b12[_0xd492('0x31')]));}})});router[_0xd492('0x26')]('/:id/avatar',upload['single'](_0xd492('0x2f')),controller[_0xd492('0x32')]);var upload=multer({'storage':multer[_0xd492('0x28')]({'destination':function(_0x3d4b8f,_0x2ab8ef,_0x20c9db){_0x20c9db(null,path[_0xd492('0x29')](config[_0xd492('0x2a')],_0xd492('0x30')));},'filename':function(_0x2d2bbd,_0x4c8f7f,_0x12c13f){_0x12c13f(null,util[_0xd492('0x2c')](_0xd492('0x2d'),Date[_0xd492('0x2e')](),_0x4c8f7f[_0xd492('0x31')]));}})});router[_0xd492('0x26')](_0xd492('0x15'),upload[_0xd492('0x33')](_0xd492('0x2f')),controller[_0xd492('0x34')]);var upload=multer({'storage':multer[_0xd492('0x28')]({'destination':function(_0x334150,_0x4ac3fb,_0x4729bc){_0x4729bc(null,path[_0xd492('0x29')](config['root'],_0xd492('0x30')));},'filename':function(_0x4316b6,_0x3465c1,_0x45f78e){_0x45f78e(null,util[_0xd492('0x2c')](_0xd492('0x2d'),Date['now'](),_0x3465c1[_0xd492('0x31')]));}})});router[_0xd492('0x26')](_0xd492('0x17'),upload[_0xd492('0x33')](_0xd492('0x2f')),controller[_0xd492('0x35')]);router[_0xd492('0x26')](_0xd492('0x36'),controller[_0xd492('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x498cba,_0x12cdcb,_0x55212f){const _0x444ab2=path['join'](config[_0xd492('0x2a')],'server/files',_0xd492('0x38'),_0xd492('0x39'));fs_extra[_0xd492('0x3a')](_0x444ab2,function(){_0x55212f(null,_0x444ab2);});},'filename':function(_0x76e9a9,_0x48a238,_0xb8b593){const _0x4d0994=_0x48a238[_0xd492('0x31')][_0xd492('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x552ed5=path[_0xd492('0x3c')](_0x4d0994);const _0x38f888=Date[_0xd492('0x2e')]()+'-'+_0x4d0994['replace'](_0x552ed5,'')+_0x552ed5;_0xb8b593(null,_0x38f888);}})});router[_0xd492('0x26')](_0xd492('0x3d'),offlineUploadMulter[_0xd492('0x3e')](),controller['offline']);router[_0xd492('0x26')]('/:id/interactions',auth[_0xd492('0xc')](),controller[_0xd492('0x3f')]);router[_0xd492('0x26')](_0xd492('0x1d'),auth[_0xd492('0xc')](),controller[_0xd492('0x40')]);router[_0xd492('0x26')](_0xd492('0x1f'),auth[_0xd492('0xc')](),controller[_0xd492('0x41')]);router[_0xd492('0x26')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xd492('0x42')](_0xd492('0x43'),auth['isAuthenticated'](),controller[_0xd492('0x44')]);router[_0xd492('0x45')]('/:id',auth[_0xd492('0xc')](),controller[_0xd492('0x46')]);router[_0xd492('0x45')](_0xd492('0xe'),auth[_0xd492('0xc')](),controller['removeDispositions']);router['delete'](_0xd492('0x10'),auth[_0xd492('0xc')](),controller[_0xd492('0x47')]);router[_0xd492('0x45')](_0xd492('0x24'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd492('0x48')]=router;
\ No newline at end of file
+var _0x008f=['/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','file','server/files/images/avatars/','single','addAvatar','addCustomerAvatar','%s-%s','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x008f,0x10c));var _0xf008=function(_0x3b04ce,_0x1030f8){_0x3b04ce=_0x3b04ce-0x0;var _0x4fe066=_0x008f[_0x3b04ce];return _0x4fe066;};'use strict';var multer=require(_0xf008('0x0'));var util=require(_0xf008('0x1'));var path=require(_0xf008('0x2'));var timeout=require(_0xf008('0x3'));var express=require('express');var router=express[_0xf008('0x4')]();var fs_extra=require(_0xf008('0x5'));var auth=require(_0xf008('0x6'));var interaction=require(_0xf008('0x7'));var config=require(_0xf008('0x8'));var controller=require(_0xf008('0x9'));router['get']('/',auth[_0xf008('0xa')](),controller[_0xf008('0xb')]);router[_0xf008('0xc')](_0xf008('0xd'),auth['isAuthenticated'](),controller[_0xf008('0xe')]);router[_0xf008('0xc')](_0xf008('0xf'),auth[_0xf008('0xa')](),controller['show']);router[_0xf008('0xc')](_0xf008('0x10'),auth[_0xf008('0xa')](),controller[_0xf008('0x11')]);router[_0xf008('0xc')](_0xf008('0x12'),auth[_0xf008('0xa')](),controller['getAnswers']);router[_0xf008('0xc')](_0xf008('0x13'),controller['getLogo']);router['get'](_0xf008('0x14'),controller[_0xf008('0x15')]);router['get'](_0xf008('0x16'),controller[_0xf008('0x17')]);router['get'](_0xf008('0x18'),controller[_0xf008('0x19')]);router[_0xf008('0xc')]('/:id/interactions',auth[_0xf008('0xa')](),controller[_0xf008('0x1a')]);router[_0xf008('0xc')](_0xf008('0x1b'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xf008('0xa')](),controller[_0xf008('0x1c')]);router[_0xf008('0xc')](_0xf008('0x1d'),auth[_0xf008('0xa')](),controller['getProactiveActions']);router[_0xf008('0xc')]('/:id/fields',controller[_0xf008('0x1e')]);router[_0xf008('0xc')](_0xf008('0x1f'),auth[_0xf008('0xa')](),controller[_0xf008('0x20')]);router[_0xf008('0xc')](_0xf008('0x21'),auth[_0xf008('0xa')](),controller[_0xf008('0x22')]);router[_0xf008('0x23')]('/',auth[_0xf008('0xa')](),controller[_0xf008('0x24')]);router[_0xf008('0x23')](_0xf008('0x10'),auth[_0xf008('0xa')](),controller['addDisposition']);router[_0xf008('0x23')](_0xf008('0x12'),auth[_0xf008('0xa')](),controller[_0xf008('0x25')]);var upload=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x319f05,_0x42033a,_0xb03eaf){_0xb03eaf(null,path[_0xf008('0x27')](config[_0xf008('0x28')],_0xf008('0x29')));},'filename':function(_0x19919b,_0x316b01,_0x439bd0){_0x439bd0(null,util[_0xf008('0x2a')]('%s-%s',Date[_0xf008('0x2b')](),_0x316b01[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x13'),upload['single'](_0xf008('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x60abc4,_0x43c193,_0x1bcfee){_0x1bcfee(null,path[_0xf008('0x27')](config['root'],_0xf008('0x2e')));},'filename':function(_0x591848,_0x11d849,_0x4cf232){_0x4cf232(null,util[_0xf008('0x2a')]('%s-%s',Date[_0xf008('0x2b')](),_0x11d849[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x14'),upload[_0xf008('0x2f')](_0xf008('0x2d')),controller[_0xf008('0x30')]);var upload=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x463d69,_0x2ad02f,_0xf3f325){_0xf3f325(null,path[_0xf008('0x27')](config[_0xf008('0x28')],_0xf008('0x2e')));},'filename':function(_0x29efc4,_0x115806,_0xb007f3){_0xb007f3(null,util[_0xf008('0x2a')]('%s-%s',Date[_0xf008('0x2b')](),_0x115806[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x16'),upload[_0xf008('0x2f')](_0xf008('0x2d')),controller[_0xf008('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd509d5,_0x4394ea,_0x3f5884){_0x3f5884(null,path['join'](config[_0xf008('0x28')],_0xf008('0x2e')));},'filename':function(_0x52bbdd,_0x1ac458,_0x243d9d){_0x243d9d(null,util['format'](_0xf008('0x32'),Date['now'](),_0x1ac458[_0xf008('0x2c')]));}})});router[_0xf008('0x23')](_0xf008('0x18'),upload['single']('file'),controller[_0xf008('0x33')]);router[_0xf008('0x23')](_0xf008('0x34'),controller[_0xf008('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xf008('0x26')]({'destination':function(_0x340f9a,_0x10738a,_0x18be09){const _0x5e16ea=path[_0xf008('0x27')](config['root'],_0xf008('0x36'),_0xf008('0x37'),_0xf008('0x38'));fs_extra[_0xf008('0x39')](_0x5e16ea,function(){_0x18be09(null,_0x5e16ea);});},'filename':function(_0x4848ca,_0x531720,_0x7e7443){const _0x4f7e14=_0x531720[_0xf008('0x2c')][_0xf008('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1410ee=path['extname'](_0x4f7e14);const _0x49dc2b=Date['now']()+'-'+_0x4f7e14[_0xf008('0x3a')](_0x1410ee,'')+_0x1410ee;_0x7e7443(null,_0x49dc2b);}})});router[_0xf008('0x23')](_0xf008('0x3b'),offlineUploadMulter['any'](),controller['offline']);router['post']('/:id/interactions',auth[_0xf008('0xa')](),controller[_0xf008('0x3c')]);router['post'](_0xf008('0x3d'),auth['isAuthenticated'](),controller[_0xf008('0x3e')]);router[_0xf008('0x23')](_0xf008('0x1d'),auth[_0xf008('0xa')](),controller[_0xf008('0x3f')]);router[_0xf008('0x23')](_0xf008('0x21'),auth[_0xf008('0xa')](),controller[_0xf008('0x40')]);router[_0xf008('0x41')](_0xf008('0xf'),auth[_0xf008('0xa')](),controller[_0xf008('0x42')]);router[_0xf008('0x43')](_0xf008('0xf'),auth[_0xf008('0xa')](),controller[_0xf008('0x44')]);router[_0xf008('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xf008('0x43')](_0xf008('0x12'),auth[_0xf008('0xa')](),controller[_0xf008('0x45')]);router[_0xf008('0x43')](_0xf008('0x21'),auth[_0xf008('0xa')](),controller[_0xf008('0x46')]);module[_0xf008('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index bcaacca..75bfe4b 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3247=['expressEndpoint','/client-logs','isAuthenticated','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x60004,_0x1a53fd){var _0x1b4b52=function(_0x59cb0d){while(--_0x59cb0d){_0x60004['push'](_0x60004['shift']());}};_0x1b4b52(++_0x1a53fd);}(_0x3247,0xc9));var _0x7324=function(_0xb8920f,_0x4a50ea){_0xb8920f=_0xb8920f-0x0;var _0xdc9bfc=_0x3247[_0xb8920f];return _0xdc9bfc;};var beaverLogger=require(_0x7324('0x0'));var express=require('express');var auth=require(_0x7324('0x1'));var config=require(_0x7324('0x2'));var router=express[_0x7324('0x3')]();var isProduction=config[_0x7324('0x4')]===_0x7324('0x5')||![];function clientSideLogs(_0x38cd9e,_0x2c8b6c,_0x3a96fd){var _0x4fb19a=_0x38cd9e['app']['get'](_0x7324('0x6'));if(!_0x4fb19a){throw new Error(_0x7324('0x7'));}return beaverLogger[_0x7324('0x8')]({'uri':_0x7324('0x9'),'logger':_0x4fb19a,'enableCors':!isProduction})(_0x38cd9e,_0x2c8b6c,_0x3a96fd);}router['use'](auth[_0x7324('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x6d8a=['exports','beaver-logger/server','../components/auth/service','env','production','app','get','client-side-logger','expressEndpoint','use'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x6d8a,0x1a5));var _0xa6d8=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x6d8a[_0x1196bd];return _0x26014f;};var beaverLogger=require(_0xa6d8('0x0'));var express=require('express');var auth=require(_0xa6d8('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xa6d8('0x2')]===_0xa6d8('0x3')||![];function clientSideLogs(_0x53f40,_0x202397,_0x5f19be){var _0x545d72=_0x53f40[_0xa6d8('0x4')][_0xa6d8('0x5')](_0xa6d8('0x6'));if(!_0x545d72){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xa6d8('0x7')]({'uri':'/client-logs','logger':_0x545d72,'enableCors':!isProduction})(_0x53f40,_0x202397,_0x5f19be);}router[_0xa6d8('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0xa6d8('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index c05869d..2f54b67 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 _0x2a18=['Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','ENUM','Google','MicrosoftAzure','Outlook365'];(function(_0x14166a,_0x2ce7cb){var _0x90ce7b=function(_0x5de890){while(--_0x5de890){_0x14166a['push'](_0x14166a['shift']());}};_0x90ce7b(++_0x2ce7cb);}(_0x2a18,0x1b6));var _0x82a1=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x2a18[_0x1fc18b];return _0x16a351;};'use strict';var Sequelize=require(_0x82a1('0x0'));module[_0x82a1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x82a1('0x2')]('AmazonAWS',_0x82a1('0x3'),_0x82a1('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x82a1('0x2')](_0x82a1('0x5'),_0x82a1('0x6'))},'data1':{'type':Sequelize[_0x82a1('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x82a1('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0x82a1('0x8')},'data4':{'type':Sequelize[_0x82a1('0x7')],'comment':_0x82a1('0x9')},'data5':{'type':Sequelize[_0x82a1('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x82a1('0xa')],'comment':_0x82a1('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x51de=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','ENUM','AmazonAWS','MicrosoftAzure','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x1feb3b,_0x54f735){var _0x28b0a2=function(_0xdfe1d3){while(--_0xdfe1d3){_0x1feb3b['push'](_0x1feb3b['shift']());}};_0x28b0a2(++_0x54f735);}(_0x51de,0x1d5));var _0xe51d=function(_0x66840d,_0x4106af){_0x66840d=_0x66840d-0x0;var _0x5ef852=_0x51de[_0x66840d];return _0x5ef852;};'use strict';var Sequelize=require(_0xe51d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe51d('0x1')](_0xe51d('0x2'),'Google',_0xe51d('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe51d('0x1')]('Outlook365',_0xe51d('0x4'))},'data1':{'type':Sequelize[_0xe51d('0x5')],'comment':_0xe51d('0x6')},'data2':{'type':Sequelize['STRING'],'comment':_0xe51d('0x7')},'data3':{'type':Sequelize[_0xe51d('0x5')],'comment':_0xe51d('0x8')},'data4':{'type':Sequelize[_0xe51d('0x5')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xe51d('0x9')],'comment':_0xe51d('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0xe51d('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xe51d('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 6455f02..3f0b9c4 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 _0xda28=['refresh_token','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','end','error','stack','name','send','slice','map','CloudProvider','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','options','includeAll','rows','MicrosoftAzure','decryptString','data3','show','keys','rawAttributes','include','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','service','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','catch','params','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','parse','from','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6'];(function(_0x32651b,_0x5553ec){var _0x31080f=function(_0x3aaec8){while(--_0x3aaec8){_0x32651b['push'](_0x32651b['shift']());}};_0x31080f(++_0x5553ec);}(_0xda28,0x112));var _0x8da2=function(_0x383ac0,_0x386219){_0x383ac0=_0x383ac0-0x0;var _0xfb8d41=_0xda28[_0x383ac0];return _0xfb8d41;};'use strict';var _=require(_0x8da2('0x0'));var Redis=require(_0x8da2('0x1'));var qs=require(_0x8da2('0x2'));var encryptor=require(_0x8da2('0x3'));var config=require(_0x8da2('0x4'));var logger=require(_0x8da2('0x5'))(_0x8da2('0x6'));var db=require(_0x8da2('0x7'))['db'];var oauth=require(_0x8da2('0x8'));config[_0x8da2('0x9')]=_[_0x8da2('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8da2('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x12567d,_0x4f5437){_0x4f5437=_0x4f5437||0xcc;return function(_0x2e3d4f){if(_0x2e3d4f){return _0x12567d[_0x8da2('0xb')](_0x4f5437);}return _0x12567d[_0x8da2('0xc')](_0x4f5437)['end']();};}function respondWithResult(_0x122499,_0x4c8413){_0x4c8413=_0x4c8413||0xc8;return function(_0x4a1802){if(_0x4a1802){return _0x122499[_0x8da2('0xc')](_0x4c8413)[_0x8da2('0xd')](_0x4a1802);}};}function respondWithFilteredResult(_0x3c4c6f,_0x15689c){return function(_0xc51205){if(_0xc51205){var _0x3c633d=typeof _0x15689c[_0x8da2('0xe')]==='undefined'&&typeof _0x15689c[_0x8da2('0xf')]===_0x8da2('0x10');var _0x23e90f=_0xc51205[_0x8da2('0x11')];var _0x98f422=_0x3c633d?0x0:_0x15689c[_0x8da2('0xe')];var _0x39d547=_0x3c633d?_0xc51205['count']:_0x15689c[_0x8da2('0xe')]+_0x15689c['limit'];var _0x2a1914;if(_0x39d547>=_0x23e90f){_0x39d547=_0x23e90f;_0x2a1914=0xc8;}else{_0x2a1914=0xce;}_0x3c4c6f['status'](_0x2a1914);return _0x3c4c6f[_0x8da2('0x12')](_0x8da2('0x13'),_0x98f422+'-'+_0x39d547+'/'+_0x23e90f)[_0x8da2('0xd')](_0xc51205);}return null;};}function saveUpdates(_0x19df9a){return function(_0x2cc570){if(_0x2cc570){return _0x2cc570['update'](_0x19df9a)[_0x8da2('0x14')](function(_0x3a3d64){return _0x3a3d64;});}return null;};}function removeEntity(_0x41b9fa){return function(_0x33c255){if(_0x33c255){return _0x33c255[_0x8da2('0x15')]()['then'](function(){_0x41b9fa[_0x8da2('0xc')](0xcc)[_0x8da2('0x16')]();});}};}function handleEntityNotFound(_0x37093c){return function(_0x2c89e0){if(!_0x2c89e0){_0x37093c[_0x8da2('0xb')](0x194);}return _0x2c89e0;};}function handleError(_0x22af74,_0x526a07){_0x526a07=_0x526a07||0x1f4;return function(_0x2b0096){logger[_0x8da2('0x17')](_0x2b0096[_0x8da2('0x18')]);if(_0x2b0096[_0x8da2('0x19')]){delete _0x2b0096[_0x8da2('0x19')];}_0x22af74[_0x8da2('0xc')](_0x526a07)[_0x8da2('0x1a')](_0x2b0096);};}function maskClientSecret(_0x301ca1){return _['padEnd'](_0x301ca1[_0x8da2('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x506101,_0x4d5823){var _0x1bcbbe={},_0x1e37d3={},_0x450a75={'count':0x0,'rows':[]};var _0xc03747=_[_0x8da2('0x1c')](db[_0x8da2('0x1d')]['rawAttributes'],function(_0x43342f){return{'name':_0x43342f[_0x8da2('0x1e')],'type':_0x43342f['type'][_0x8da2('0x1f')]};});_0x1e37d3[_0x8da2('0x20')]=_[_0x8da2('0x1c')](_0xc03747,'name');_0x1e37d3[_0x8da2('0x21')]=_['keys'](_0x506101[_0x8da2('0x21')]);_0x1e37d3[_0x8da2('0x22')]=_[_0x8da2('0x23')](_0x1e37d3[_0x8da2('0x20')],_0x1e37d3[_0x8da2('0x21')]);_0x1bcbbe[_0x8da2('0x24')]=_['intersection'](_0x1e37d3[_0x8da2('0x20')],qs[_0x8da2('0x25')](_0x506101[_0x8da2('0x21')][_0x8da2('0x25')]));_0x1bcbbe['attributes']=_0x1bcbbe[_0x8da2('0x24')][_0x8da2('0x26')]?_0x1bcbbe[_0x8da2('0x24')]:_0x1e37d3[_0x8da2('0x20')];if(!_0x506101[_0x8da2('0x21')][_0x8da2('0x27')]('nolimit')){_0x1bcbbe[_0x8da2('0xf')]=qs[_0x8da2('0xf')](_0x506101[_0x8da2('0x21')]['limit']);_0x1bcbbe[_0x8da2('0xe')]=qs[_0x8da2('0xe')](_0x506101[_0x8da2('0x21')][_0x8da2('0xe')]);}_0x1bcbbe[_0x8da2('0x28')]=qs[_0x8da2('0x29')](_0x506101[_0x8da2('0x21')][_0x8da2('0x29')]);_0x1bcbbe['where']=qs[_0x8da2('0x22')](_['pick'](_0x506101['query'],_0x1e37d3[_0x8da2('0x22')]),_0xc03747);if(_0x506101[_0x8da2('0x21')]['filter']){_0x1bcbbe[_0x8da2('0x2a')]=_[_0x8da2('0x2b')](_0x1bcbbe[_0x8da2('0x2a')],{'$or':_[_0x8da2('0x1c')](_0xc03747,function(_0x4107bd){if(_0x4107bd[_0x8da2('0x2c')]!==_0x8da2('0x2d')){var _0x40593d={};_0x40593d[_0x4107bd['name']]={'$like':'%'+_0x506101['query']['filter']+'%'};return _0x40593d;}})});}_0x1bcbbe=_[_0x8da2('0x2b')]({},_0x1bcbbe,_0x506101[_0x8da2('0x2e')]);var _0x183230={'where':_0x1bcbbe['where']};return db[_0x8da2('0x1d')][_0x8da2('0x11')](_0x183230)['then'](function(_0x624462){_0x450a75[_0x8da2('0x11')]=_0x624462;if(_0x506101[_0x8da2('0x21')][_0x8da2('0x2f')]){_0x1bcbbe['include']=[{'all':!![]}];}return db[_0x8da2('0x1d')]['findAll'](_0x1bcbbe);})[_0x8da2('0x14')](function(_0xf5a1c5){_0x450a75[_0x8da2('0x30')]=_[_0x8da2('0x1c')](_0xf5a1c5,function(_0x5be8bb){if(_0x5be8bb['service']===_0x8da2('0x31')){var _0x4d8ab9=encryptor[_0x8da2('0x32')](_0x5be8bb[_0x8da2('0x33')]);_0x5be8bb[_0x8da2('0x33')]=maskClientSecret(_0x4d8ab9);}return _0x5be8bb;});return _0x450a75;})[_0x8da2('0x14')](respondWithFilteredResult(_0x4d5823,_0x1bcbbe))['catch'](handleError(_0x4d5823,null));};exports[_0x8da2('0x34')]=function(_0x48125b,_0xfd0b0d){var _0x5ab49e={'raw':!![],'where':{'id':_0x48125b['params']['id']}},_0x50b5af={};_0x50b5af[_0x8da2('0x20')]=_[_0x8da2('0x35')](db[_0x8da2('0x1d')][_0x8da2('0x36')]);_0x50b5af[_0x8da2('0x21')]=_[_0x8da2('0x35')](_0x48125b[_0x8da2('0x21')]);_0x50b5af['filters']=_[_0x8da2('0x23')](_0x50b5af['model'],_0x50b5af[_0x8da2('0x21')]);_0x5ab49e['attributes']=_[_0x8da2('0x23')](_0x50b5af[_0x8da2('0x20')],qs['fields'](_0x48125b[_0x8da2('0x21')][_0x8da2('0x25')]));_0x5ab49e['attributes']=_0x5ab49e[_0x8da2('0x24')]['length']?_0x5ab49e[_0x8da2('0x24')]:_0x50b5af['model'];if(_0x48125b['query'][_0x8da2('0x2f')]){_0x5ab49e[_0x8da2('0x37')]=[{'all':!![]}];}_0x5ab49e=_['merge']({},_0x5ab49e,_0x48125b[_0x8da2('0x2e')]);return db[_0x8da2('0x1d')][_0x8da2('0x38')](_0x5ab49e)['then'](handleEntityNotFound(_0xfd0b0d,null))[_0x8da2('0x14')](function(_0xf8289a){if(_0xf8289a['service']===_0x8da2('0x31')){var _0x33bfd3=encryptor[_0x8da2('0x32')](_0xf8289a[_0x8da2('0x33')]);_0xf8289a['data3']=maskClientSecret(_0x33bfd3);}return _0xf8289a;})['then'](respondWithResult(_0xfd0b0d,null))['catch'](handleError(_0xfd0b0d,null));};exports[_0x8da2('0x39')]=function(_0x1add81,_0x5af61e){if(!_0x1add81[_0x8da2('0x3a')][_0x8da2('0x19')])throw new Error(_0x8da2('0x3b'));if(!_0x1add81[_0x8da2('0x3a')]['service'])throw new Error(_0x8da2('0x3c'));var _0x15745e=db[_0x8da2('0x1d')][_0x8da2('0x36')][_0x8da2('0x3d')][_0x8da2('0x3e')];if(!_0x15745e[_0x8da2('0x3f')](_0x1add81[_0x8da2('0x3a')][_0x8da2('0x3d')]))throw new Error(_0x8da2('0x40')+_0x15745e[_0x8da2('0x41')](',\x20'));if(_0x1add81[_0x8da2('0x3a')]['service']===_0x8da2('0x31')&&_0x1add81[_0x8da2('0x3a')][_0x8da2('0x33')]){_0x1add81['body'][_0x8da2('0x33')]=encryptor[_0x8da2('0x42')](_0x1add81[_0x8da2('0x3a')][_0x8da2('0x33')]);}return db[_0x8da2('0x1d')][_0x8da2('0x39')](_0x1add81['body'],{})['then'](respondWithResult(_0x5af61e,0xc9))['catch'](handleError(_0x5af61e,null));};exports[_0x8da2('0x43')]=function(_0x5d10dc,_0x18c2a4){if(_0x5d10dc[_0x8da2('0x3a')]['id']){delete _0x5d10dc[_0x8da2('0x3a')]['id'];}return db[_0x8da2('0x1d')]['find']({'where':{'id':_0x5d10dc['params']['id']}})['then'](handleEntityNotFound(_0x18c2a4,null))['then'](function(_0x2a6aba){if(_0x2a6aba[_0x8da2('0x3d')]===_0x8da2('0x31')&&_0x5d10dc[_0x8da2('0x3a')][_0x8da2('0x33')]){_0x5d10dc['body'][_0x8da2('0x33')]=encryptor['encryptString'](_0x5d10dc[_0x8da2('0x3a')][_0x8da2('0x33')]);}return _0x2a6aba;})[_0x8da2('0x14')](saveUpdates(_0x5d10dc[_0x8da2('0x3a')],null))[_0x8da2('0x14')](respondWithResult(_0x18c2a4,null))[_0x8da2('0x44')](handleError(_0x18c2a4,null));};exports[_0x8da2('0x15')]=function(_0x3869a1,_0x577d61){return db[_0x8da2('0x1d')][_0x8da2('0x38')]({'where':{'id':_0x3869a1[_0x8da2('0x45')]['id']}})[_0x8da2('0x14')](handleEntityNotFound(_0x577d61,null))[_0x8da2('0x14')](removeEntity(_0x577d61,null))[_0x8da2('0x44')](handleError(_0x577d61,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3a1f8b,_0x339f75){return db[_0x8da2('0x1d')][_0x8da2('0x46')]({'where':{'id':_0x3a1f8b['params']['id']},'raw':!![]})['then'](function(_0x2ad6e5){if(!_0x2ad6e5)return _0x339f75[_0x8da2('0xb')](0x194);return{'url':oauth[_0x8da2('0x47')](_0x2ad6e5,_0x3a1f8b['user']['id'])};})[_0x8da2('0x14')](respondWithResult(_0x339f75,null))[_0x8da2('0x44')](handleError(_0x339f75,null));};exports[_0x8da2('0x48')]=function(_0x2d9da7,_0x8cd357){var _0x461484=_0x2d9da7[_0x8da2('0x3a')];var _0x4a9159;var _0x90c0b;if(_0x461484[_0x8da2('0x17')])throw _0x461484;redis[_0x8da2('0x49')](_0x461484[_0x8da2('0x4a')])['then'](function(_0x3dbdf6){if(!_0x3dbdf6)throw new Error('Invalid\x20state\x20parameter');_0x4a9159=JSON[_0x8da2('0x4b')](_0x3dbdf6);var _0x176a5b=Buffer[_0x8da2('0x4c')](_0x461484[_0x8da2('0x4a')],'base64')['toString'](_0x8da2('0x4d'));_0x90c0b=JSON[_0x8da2('0x4b')](_0x176a5b);if(!oauth[_0x8da2('0x4e')](_0x461484[_0x8da2('0x4f')],_0x4a9159['oauth2Claims']))throw new Error(_0x8da2('0x50'));redis[_0x8da2('0x51')](_0x461484[_0x8da2('0x4a')]);return oauth[_0x8da2('0x52')](_0x461484[_0x8da2('0x53')],_0x4a9159);})['then'](function(_0x23c19d){_0x4a9159[_0x8da2('0x54')]=_0x23c19d['access_token'];_0x4a9159[_0x8da2('0x55')]=_0x23c19d[_0x8da2('0x56')];return db['CloudProvider'][_0x8da2('0x43')]({'data5':_0x4a9159[_0x8da2('0x54')],'data6':_0x4a9159[_0x8da2('0x55')]},{'where':{'id':_0x4a9159['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x4a9159);socket['emit']('microsoftAuthorization:success',{'id':_0x90c0b['id']});return;})['then'](respondWithStatusCode(_0x8cd357,null))[_0x8da2('0x44')](function(_0x2bdb98){if(_0x90c0b){socket['emit'](_0x8da2('0x57'),{'id':_0x90c0b['id']});}if(!_0x4a9159){logger[_0x8da2('0x17')](_0x8da2('0x58'),_0x2bdb98);return _0x8cd357['status'](0x1f4)[_0x8da2('0x1a')](_0x2bdb98[_0x8da2('0x59')]);}logger[_0x8da2('0x17')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4a9159['id'],JSON['stringify'](_0x2bdb98));});};
\ No newline at end of file
+var _0x0029=['update','then','end','stack','name','send','padEnd','slice','index','map','type','key','model','keys','intersection','query','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','rawAttributes','find','Service\x20parameter\x20not\x20specified','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','params','destroy','findOne','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0029,0x1bd));var _0x9002=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0029[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var Redis=require(_0x9002('0x0'));var qs=require(_0x9002('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x9002('0x2'));var logger=require(_0x9002('0x3'))(_0x9002('0x4'));var db=require(_0x9002('0x5'))['db'];var oauth=require(_0x9002('0x6'));config[_0x9002('0x7')]=_[_0x9002('0x8')](config['redis'],{'host':_0x9002('0x9'),'port':0x18eb});var socket=require(_0x9002('0xa'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0xaa6cfe,_0x1bc871){_0x1bc871=_0x1bc871||0xcc;return function(_0x439cd4){if(_0x439cd4){return _0xaa6cfe[_0x9002('0xb')](_0x1bc871);}return _0xaa6cfe[_0x9002('0xc')](_0x1bc871)['end']();};}function respondWithResult(_0x21df76,_0x87e11f){_0x87e11f=_0x87e11f||0xc8;return function(_0x530c37){if(_0x530c37){return _0x21df76[_0x9002('0xc')](_0x87e11f)[_0x9002('0xd')](_0x530c37);}};}function respondWithFilteredResult(_0x1016a4,_0x3e9a65){return function(_0x46416b){if(_0x46416b){var _0x68b66f=typeof _0x3e9a65[_0x9002('0xe')]===_0x9002('0xf')&&typeof _0x3e9a65[_0x9002('0x10')]===_0x9002('0xf');var _0x27e4cb=_0x46416b[_0x9002('0x11')];var _0x1586b4=_0x68b66f?0x0:_0x3e9a65[_0x9002('0xe')];var _0x533e6c=_0x68b66f?_0x46416b[_0x9002('0x11')]:_0x3e9a65['offset']+_0x3e9a65['limit'];var _0x5e2060;if(_0x533e6c>=_0x27e4cb){_0x533e6c=_0x27e4cb;_0x5e2060=0xc8;}else{_0x5e2060=0xce;}_0x1016a4[_0x9002('0xc')](_0x5e2060);return _0x1016a4[_0x9002('0x12')](_0x9002('0x13'),_0x1586b4+'-'+_0x533e6c+'/'+_0x27e4cb)[_0x9002('0xd')](_0x46416b);}return null;};}function saveUpdates(_0x7a208f){return function(_0x5767ee){if(_0x5767ee){return _0x5767ee[_0x9002('0x14')](_0x7a208f)['then'](function(_0x196329){return _0x196329;});}return null;};}function removeEntity(_0x103909){return function(_0x307558){if(_0x307558){return _0x307558['destroy']()[_0x9002('0x15')](function(){_0x103909[_0x9002('0xc')](0xcc)[_0x9002('0x16')]();});}};}function handleEntityNotFound(_0x280b74){return function(_0x18d74a){if(!_0x18d74a){_0x280b74[_0x9002('0xb')](0x194);}return _0x18d74a;};}function handleError(_0x5d1bd2,_0x590bf6){_0x590bf6=_0x590bf6||0x1f4;return function(_0x12c71b){logger['error'](_0x12c71b[_0x9002('0x17')]);if(_0x12c71b[_0x9002('0x18')]){delete _0x12c71b[_0x9002('0x18')];}_0x5d1bd2[_0x9002('0xc')](_0x590bf6)[_0x9002('0x19')](_0x12c71b);};}function maskClientSecret(_0x4a3309){return _[_0x9002('0x1a')](_0x4a3309[_0x9002('0x1b')](0x0,0x3),0x14,'*');}exports[_0x9002('0x1c')]=function(_0x288253,_0x2b80f9){var _0x29801b={},_0x10885d={},_0x2129fa={'count':0x0,'rows':[]};var _0x11800f=_[_0x9002('0x1d')](db['CloudProvider']['rawAttributes'],function(_0x3dcb21){return{'name':_0x3dcb21['fieldName'],'type':_0x3dcb21[_0x9002('0x1e')][_0x9002('0x1f')]};});_0x10885d[_0x9002('0x20')]=_[_0x9002('0x1d')](_0x11800f,_0x9002('0x18'));_0x10885d['query']=_[_0x9002('0x21')](_0x288253['query']);_0x10885d['filters']=_[_0x9002('0x22')](_0x10885d[_0x9002('0x20')],_0x10885d[_0x9002('0x23')]);_0x29801b[_0x9002('0x24')]=_[_0x9002('0x22')](_0x10885d[_0x9002('0x20')],qs[_0x9002('0x25')](_0x288253[_0x9002('0x23')]['fields']));_0x29801b['attributes']=_0x29801b[_0x9002('0x24')]['length']?_0x29801b[_0x9002('0x24')]:_0x10885d[_0x9002('0x20')];if(!_0x288253[_0x9002('0x23')]['hasOwnProperty'](_0x9002('0x26'))){_0x29801b[_0x9002('0x10')]=qs['limit'](_0x288253[_0x9002('0x23')][_0x9002('0x10')]);_0x29801b['offset']=qs['offset'](_0x288253[_0x9002('0x23')][_0x9002('0xe')]);}_0x29801b['order']=qs['sort'](_0x288253[_0x9002('0x23')][_0x9002('0x27')]);_0x29801b[_0x9002('0x28')]=qs[_0x9002('0x29')](_[_0x9002('0x2a')](_0x288253[_0x9002('0x23')],_0x10885d[_0x9002('0x29')]),_0x11800f);if(_0x288253[_0x9002('0x23')][_0x9002('0x2b')]){_0x29801b[_0x9002('0x28')]=_[_0x9002('0x2c')](_0x29801b[_0x9002('0x28')],{'$or':_[_0x9002('0x1d')](_0x11800f,function(_0x5273fa){if(_0x5273fa[_0x9002('0x1e')]!==_0x9002('0x2d')){var _0x67efe0={};_0x67efe0[_0x5273fa[_0x9002('0x18')]]={'$like':'%'+_0x288253[_0x9002('0x23')][_0x9002('0x2b')]+'%'};return _0x67efe0;}})});}_0x29801b=_[_0x9002('0x2c')]({},_0x29801b,_0x288253[_0x9002('0x2e')]);var _0x424aa0={'where':_0x29801b[_0x9002('0x28')]};return db[_0x9002('0x2f')][_0x9002('0x11')](_0x424aa0)[_0x9002('0x15')](function(_0xab61ef){_0x2129fa['count']=_0xab61ef;if(_0x288253[_0x9002('0x23')][_0x9002('0x30')]){_0x29801b[_0x9002('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x9002('0x32')](_0x29801b);})['then'](function(_0x38a339){_0x2129fa[_0x9002('0x33')]=_[_0x9002('0x1d')](_0x38a339,function(_0x9b1275){if(_0x9b1275[_0x9002('0x34')]==='MicrosoftAzure'){var _0x4b9499=encryptor[_0x9002('0x35')](_0x9b1275[_0x9002('0x36')]);_0x9b1275[_0x9002('0x36')]=maskClientSecret(_0x4b9499);}return _0x9b1275;});return _0x2129fa;})[_0x9002('0x15')](respondWithFilteredResult(_0x2b80f9,_0x29801b))[_0x9002('0x37')](handleError(_0x2b80f9,null));};exports['show']=function(_0x28639a,_0x157232){var _0xe2b587={'raw':!![],'where':{'id':_0x28639a['params']['id']}},_0x47ab63={};_0x47ab63[_0x9002('0x20')]=_[_0x9002('0x21')](db[_0x9002('0x2f')][_0x9002('0x38')]);_0x47ab63[_0x9002('0x23')]=_[_0x9002('0x21')](_0x28639a[_0x9002('0x23')]);_0x47ab63['filters']=_[_0x9002('0x22')](_0x47ab63[_0x9002('0x20')],_0x47ab63[_0x9002('0x23')]);_0xe2b587[_0x9002('0x24')]=_[_0x9002('0x22')](_0x47ab63[_0x9002('0x20')],qs['fields'](_0x28639a[_0x9002('0x23')][_0x9002('0x25')]));_0xe2b587[_0x9002('0x24')]=_0xe2b587[_0x9002('0x24')]['length']?_0xe2b587[_0x9002('0x24')]:_0x47ab63[_0x9002('0x20')];if(_0x28639a[_0x9002('0x23')][_0x9002('0x30')]){_0xe2b587[_0x9002('0x31')]=[{'all':!![]}];}_0xe2b587=_[_0x9002('0x2c')]({},_0xe2b587,_0x28639a[_0x9002('0x2e')]);return db[_0x9002('0x2f')][_0x9002('0x39')](_0xe2b587)['then'](handleEntityNotFound(_0x157232,null))['then'](function(_0x13a40e){if(_0x13a40e['service']==='MicrosoftAzure'){var _0x2c2c53=encryptor[_0x9002('0x35')](_0x13a40e[_0x9002('0x36')]);_0x13a40e[_0x9002('0x36')]=maskClientSecret(_0x2c2c53);}return _0x13a40e;})[_0x9002('0x15')](respondWithResult(_0x157232,null))['catch'](handleError(_0x157232,null));};exports['create']=function(_0x6e5dbb,_0x48e19d){if(!_0x6e5dbb['body'][_0x9002('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x6e5dbb['body']['service'])throw new Error(_0x9002('0x3a'));var _0x669d33=db[_0x9002('0x2f')][_0x9002('0x38')][_0x9002('0x34')]['values'];if(!_0x669d33['includes'](_0x6e5dbb[_0x9002('0x3b')]['service']))throw new Error(_0x9002('0x3c')+_0x669d33[_0x9002('0x3d')](',\x20'));if(_0x6e5dbb[_0x9002('0x3b')]['service']===_0x9002('0x3e')&&_0x6e5dbb['body'][_0x9002('0x36')]){_0x6e5dbb['body'][_0x9002('0x36')]=encryptor[_0x9002('0x3f')](_0x6e5dbb['body'][_0x9002('0x36')]);}return db['CloudProvider']['create'](_0x6e5dbb[_0x9002('0x3b')],{})[_0x9002('0x15')](respondWithResult(_0x48e19d,0xc9))[_0x9002('0x37')](handleError(_0x48e19d,null));};exports[_0x9002('0x14')]=function(_0x5a7000,_0x30726c){if(_0x5a7000['body']['id']){delete _0x5a7000[_0x9002('0x3b')]['id'];}return db[_0x9002('0x2f')]['find']({'where':{'id':_0x5a7000[_0x9002('0x40')]['id']}})[_0x9002('0x15')](handleEntityNotFound(_0x30726c,null))[_0x9002('0x15')](function(_0x3c8a0b){if(_0x3c8a0b[_0x9002('0x34')]===_0x9002('0x3e')&&_0x5a7000[_0x9002('0x3b')]['data3']){_0x5a7000[_0x9002('0x3b')][_0x9002('0x36')]=encryptor['encryptString'](_0x5a7000[_0x9002('0x3b')][_0x9002('0x36')]);}return _0x3c8a0b;})[_0x9002('0x15')](saveUpdates(_0x5a7000[_0x9002('0x3b')],null))[_0x9002('0x15')](respondWithResult(_0x30726c,null))['catch'](handleError(_0x30726c,null));};exports[_0x9002('0x41')]=function(_0x3b094b,_0x3273e3){return db[_0x9002('0x2f')][_0x9002('0x39')]({'where':{'id':_0x3b094b['params']['id']}})[_0x9002('0x15')](handleEntityNotFound(_0x3273e3,null))['then'](removeEntity(_0x3273e3,null))[_0x9002('0x37')](handleError(_0x3273e3,null));};exports['oauth2MicrosoftAuthorize']=function(_0x569bef,_0x36561c){return db[_0x9002('0x2f')][_0x9002('0x42')]({'where':{'id':_0x569bef[_0x9002('0x40')]['id']},'raw':!![]})['then'](function(_0x321acd){if(!_0x321acd)return _0x36561c['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x321acd,_0x569bef['user']['id'])};})['then'](respondWithResult(_0x36561c,null))[_0x9002('0x37')](handleError(_0x36561c,null));};exports[_0x9002('0x43')]=function(_0x15c5fe,_0x5ad4dd){var _0x29d993=_0x15c5fe[_0x9002('0x3b')];var _0x42d845;var _0x45b53c;if(_0x29d993['error'])throw _0x29d993;redis['get'](_0x29d993[_0x9002('0x44')])[_0x9002('0x15')](function(_0x17e4e1){if(!_0x17e4e1)throw new Error(_0x9002('0x45'));_0x42d845=JSON[_0x9002('0x46')](_0x17e4e1);var _0x396d07=Buffer[_0x9002('0x47')](_0x29d993[_0x9002('0x44')],_0x9002('0x48'))[_0x9002('0x49')](_0x9002('0x4a'));_0x45b53c=JSON[_0x9002('0x46')](_0x396d07);if(!oauth[_0x9002('0x4b')](_0x29d993[_0x9002('0x4c')],_0x42d845[_0x9002('0x4d')]))throw new Error(_0x9002('0x4e'));redis['del'](_0x29d993[_0x9002('0x44')]);return oauth[_0x9002('0x4f')](_0x29d993['code'],_0x42d845);})[_0x9002('0x15')](function(_0x4c6206){_0x42d845[_0x9002('0x50')]=_0x4c6206[_0x9002('0x51')];_0x42d845[_0x9002('0x52')]=_0x4c6206[_0x9002('0x53')];return db[_0x9002('0x2f')][_0x9002('0x14')]({'data5':_0x42d845['data5'],'data6':_0x42d845['data6']},{'where':{'id':_0x42d845['id']}});})[_0x9002('0x15')](function(){oauth[_0x9002('0x54')](_0x42d845);socket[_0x9002('0x55')](_0x9002('0x56'),{'id':_0x45b53c['id']});return;})[_0x9002('0x15')](respondWithStatusCode(_0x5ad4dd,null))[_0x9002('0x37')](function(_0x18b5f7){if(_0x45b53c){socket[_0x9002('0x55')](_0x9002('0x57'),{'id':_0x45b53c['id']});}if(!_0x42d845){logger[_0x9002('0x58')](_0x9002('0x59'),_0x18b5f7);return _0x5ad4dd[_0x9002('0xc')](0x1f4)[_0x9002('0x19')](_0x18b5f7[_0x9002('0x5a')]);}logger[_0x9002('0x58')](_0x9002('0x5b'),_0x42d845['id'],JSON[_0x9002('0x5c')](_0x18b5f7));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 1a52db2..bfdea8c 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 _0x3f8d=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x3f8d,0x172));var _0xd3f8=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0x3f8d[_0x19d350];return _0x3bfc8d;};'use strict';var _=require(_0xd3f8('0x0'));var util=require(_0xd3f8('0x1'));var logger=require(_0xd3f8('0x2'))(_0xd3f8('0x3'));var moment=require(_0xd3f8('0x4'));var BPromise=require(_0xd3f8('0x5'));var rp=require(_0xd3f8('0x6'));var fs=require('fs');var path=require(_0xd3f8('0x7'));var rimraf=require(_0xd3f8('0x8'));var config=require(_0xd3f8('0x9'));var attributes=require(_0xd3f8('0xa'));module[_0xd3f8('0xb')]=function(_0x112308,_0x485a82){return _0x112308[_0xd3f8('0xc')](_0xd3f8('0xd'),attributes,{'tableName':_0xd3f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb965=['request-promise','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird'];(function(_0x21b438,_0x45de54){var _0x2d1fcf=function(_0xce22d7){while(--_0xce22d7){_0x21b438['push'](_0x21b438['shift']());}};_0x2d1fcf(++_0x45de54);}(_0xb965,0x15b));var _0x5b96=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xb965[_0x382a62];return _0x490a25;};'use strict';var _=require(_0x5b96('0x0'));var util=require(_0x5b96('0x1'));var logger=require('../../config/logger')(_0x5b96('0x2'));var moment=require(_0x5b96('0x3'));var BPromise=require(_0x5b96('0x4'));var rp=require(_0x5b96('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b96('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x5b96('0x7')]=function(_0x95655,_0x29935c){return _0x95655[_0x5b96('0x8')](_0x5b96('0x9'),attributes,{'tableName':_0x5b96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 35b2540..d12dfea 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa493=['data1','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2Claims','oauth2/','iss','issuer','aud','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','push','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','hex','client_id'];(function(_0xc911b0,_0x4b667a){var _0x8c0c77=function(_0x534140){while(--_0x534140){_0xc911b0['push'](_0xc911b0['shift']());}};_0x8c0c77(++_0x4b667a);}(_0xa493,0x1f0));var _0x3a49=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa493[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x3a49('0x0'));var crypto=require(_0x3a49('0x1'));var jwt=require(_0x3a49('0x2'));var moment=require(_0x3a49('0x3'));var Redis=require(_0x3a49('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x3a49('0x5'));var config=require(_0x3a49('0x6'));var logger=require('../../config/logger')(_0x3a49('0x7'));var schedule=require(_0x3a49('0x8'));var db=require('../../mysqldb')['db'];config[_0x3a49('0x9')]=_[_0x3a49('0xa')](config[_0x3a49('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x3a49('0x9')]);var MICROSOFT_AUTH_URL=_0x3a49('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x3a49('0xc'),'email',_0x3a49('0xd'),_0x3a49('0xe'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x3a49('0xf'),_0x3a49('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x3a49('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x3a49('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x449637){var _0x2934a1=_[_0x3a49('0x12')](AZURE_AUTH_SCOPES[_0x449637[_0x3a49('0x13')]]);if(_0x449637[_0x3a49('0x13')]===_0x3a49('0x14'))_0x2934a1[_0x3a49('0x15')](_0x449637['data7']+_0x3a49('0x16'));return _0x2934a1[_0x3a49('0x17')]('\x20');}function getAccessTokenScope(_0x16b384){if(_0x16b384[_0x3a49('0x13')]===_0x3a49('0x18'))return _0x3a49('0xe');if(_0x16b384[_0x3a49('0x13')]==='Dynamics365')return _0x16b384['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x32ddb7,_0x3e235d){var _0x4604fb=MICROSOFT_AUTH_URL[_0x3a49('0x19')](_0x3a49('0x1a'),_0x32ddb7[_0x3a49('0x1b')]);var _0x46cd3a=[_0x3a49('0x1c'),'id_token'];var _0x4f028e=Buffer[_0x3a49('0x1d')](JSON[_0x3a49('0x1e')]({'id':_0x3e235d}))[_0x3a49('0x1f')](_0x3a49('0x20'));var _0x448ec9=crypto[_0x3a49('0x21')](0x10)['toString'](_0x3a49('0x22'));var _0xe2193=getAuthorizationScopes(_0x32ddb7);var _0x34e963=[{'key':_0x3a49('0x23'),'value':_0x32ddb7[_0x3a49('0x24')]},{'key':_0x3a49('0x25'),'value':encodeURIComponent(_0x46cd3a[_0x3a49('0x17')]('\x20'))},{'key':_0x3a49('0x26'),'value':_0x32ddb7[_0x3a49('0x27')]},{'key':_0x3a49('0x28'),'value':_0x3a49('0x29')},{'key':_0x3a49('0x2a'),'value':encodeURIComponent(_0xe2193)},{'key':'state','value':_0x4f028e},{'key':_0x3a49('0x2b'),'value':_0x448ec9},{'key':_0x3a49('0x2c'),'value':_0x3a49('0x2d')}];var _0x32c8f9=_0x4604fb+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x34e963,function(_0x4d4079){return _0x4d4079[_0x3a49('0x2e')]+'='+_0x4d4079[_0x3a49('0x2f')];})['join']('&');_0x32ddb7[_0x3a49('0x30')]={'issuer':_0x4604fb['replace'](_0x3a49('0x31'),''),'audience':_0x32ddb7[_0x3a49('0x24')],'state':_0x4f028e,'nonce':_0x448ec9};redis['set'](_0x4f028e,JSON[_0x3a49('0x1e')](_0x32ddb7));return _0x32c8f9;}function isValidIdToken(_0xf2ba28,_0x3dae0c){try{var _0x3ba4e2=jwt['decode'](_0xf2ba28,{'complete':!![]});var _0x3660bc=_0x3ba4e2['payload'];if(_0x3660bc[_0x3a49('0x32')]!==_0x3dae0c[_0x3a49('0x33')])return![];if(_0x3660bc[_0x3a49('0x34')]!==_0x3dae0c['audience'])return![];if(_0x3660bc[_0x3a49('0x2b')]!==_0x3dae0c[_0x3a49('0x2b')])return![];if(moment()[_0x3a49('0x35')](moment[_0x3a49('0x36')](_0x3660bc[_0x3a49('0x37')])))return![];return!![];}catch(_0x1cb6b7){throw _0x1cb6b7;}}function refreshOauth2MicrosoftAccessToken(_0x3a241a){return Promise[_0x3a49('0x38')]()[_0x3a49('0x39')](function(){if(_0x3a241a['data3'])return _0x3a241a;return db[_0x3a49('0x3a')][_0x3a49('0x3b')]({'where':{'id':_0x3a241a['id']},'raw':!![]});})[_0x3a49('0x39')](function(_0x13a102){var _0xc4e201={'grant_type':_0x3a49('0x3c'),'refresh_token':_0x13a102[_0x3a49('0x3d')],'scope':getAccessTokenScope(_0x13a102),'redirect_uri':_0x13a102[_0x3a49('0x27')],'client_id':_0x13a102[_0x3a49('0x24')],'client_secret':encryptor[_0x3a49('0x3e')](_0x13a102[_0x3a49('0x3f')])};var _0x30003c={'method':_0x3a49('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3a49('0x1a'),_0x13a102[_0x3a49('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xc4e201,'json':!![]};return rp(_0x30003c);})[_0x3a49('0x39')](function(_0x8b91b5){_0x3a241a[_0x3a49('0x41')]=_0x8b91b5[_0x3a49('0x42')];_0x3a241a[_0x3a49('0x3d')]=_0x8b91b5['refresh_token'];return db[_0x3a49('0x3a')]['update']({'data5':_0x3a241a[_0x3a49('0x41')],'data6':_0x3a241a['data6']},{'where':{'id':_0x3a241a['id']}});})[_0x3a49('0x39')](function(){return _0x3a241a;})[_0x3a49('0x43')](function(_0x217a40){logger[_0x3a49('0x44')](_0x3a49('0x45'),_0x3a241a['id'],_0x217a40);});}function getOauth2MicrosoftAccessToken(_0x57f720,_0x48bc8d){var _0x1d6e8b={'grant_type':_0x3a49('0x46'),'code':_0x57f720,'scope':getAccessTokenScope(_0x48bc8d),'redirect_uri':_0x48bc8d[_0x3a49('0x27')],'client_id':_0x48bc8d['data1'],'client_secret':encryptor[_0x3a49('0x3e')](_0x48bc8d['data3'])};var _0x2984bb={'method':_0x3a49('0x40'),'uri':MICROSOFT_AUTH_URL[_0x3a49('0x19')](_0x3a49('0x1a'),_0x48bc8d[_0x3a49('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d6e8b,'json':!![]};return rp(_0x2984bb);}function startRefreshInterval(_0x32b6b1){var _0x103bdf=schedule[_0x3a49('0x47')];if(_0x103bdf[_0x32b6b1['id']])clearInterval(_0x103bdf[_0x32b6b1['id']]);_0x103bdf[_0x32b6b1['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x32b6b1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3a49('0x47')]=_0x103bdf;}function startAllRefreshIntervals(){return db[_0x3a49('0x3a')][_0x3a49('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3a49('0x39')](function(_0x4da592){var _0x3b8ff9=_0x4da592[_0x3a49('0x12')](function(_0x1077d4){return refreshOauth2MicrosoftAccessToken(_0x1077d4)[_0x3a49('0x39')](function(_0x34447e){startRefreshInterval(_0x34447e);});});return Promise[_0x3a49('0x49')](_0x3b8ff9);})[_0x3a49('0x43')](function(_0x58aa59){var _0x33c87b=_0x58aa59?util['inspect'](_0x58aa59,{'showHidden':![],'depth':null}):'';logger[_0x3a49('0x44')](_0x3a49('0x4a'),_0x33c87b);});}module[_0x3a49('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x227e=['id_token','stringify','toString','base64','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','set','decode','payload','iss','issuer','aud','isAfter','exp','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','data5','access_token','intervals','bind','findAll','catch','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','push','data7','Outlook365','replace','{TENANT_ID}','data2','code'];(function(_0x28d21b,_0x29693c){var _0x1b1c41=function(_0x4d73f6){while(--_0x4d73f6){_0x28d21b['push'](_0x28d21b['shift']());}};_0x1b1c41(++_0x29693c);}(_0x227e,0x75));var _0xe227=function(_0x1ed95b,_0x1e0bbe){_0x1ed95b=_0x1ed95b-0x0;var _0x4d96a8=_0x227e[_0x1ed95b];return _0x4d96a8;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xe227('0x0'));var encryptor=require(_0xe227('0x1'));var config=require(_0xe227('0x2'));var logger=require(_0xe227('0x3'))(_0xe227('0x4'));var schedule=require(_0xe227('0x5'));var db=require(_0xe227('0x6'))['db'];config[_0xe227('0x7')]=_[_0xe227('0x8')](config['redis'],{'host':_0xe227('0x9'),'port':0x18eb});var redis=new Redis(config[_0xe227('0x7')]);var MICROSOFT_AUTH_URL=_0xe227('0xa');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xe227('0xb'),_0xe227('0xc'),_0xe227('0xd'),_0xe227('0xe'),_0xe227('0xf'),_0xe227('0x10')],'Dynamics365':[_0xe227('0x11'),_0xe227('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xe227('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xe227('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b338a){var _0x4479a5=_[_0xe227('0x14')](AZURE_AUTH_SCOPES[_0x5b338a[_0xe227('0x15')]]);if(_0x5b338a['type']==='Dynamics365')_0x4479a5[_0xe227('0x16')](_0x5b338a[_0xe227('0x17')]+'/.default');return _0x4479a5['join']('\x20');}function getAccessTokenScope(_0x151f03){if(_0x151f03[_0xe227('0x15')]===_0xe227('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x151f03[_0xe227('0x15')]==='Dynamics365')return _0x151f03[_0xe227('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4c8fb3,_0x48dad3){var _0x460eb0=MICROSOFT_AUTH_URL[_0xe227('0x19')](_0xe227('0x1a'),_0x4c8fb3[_0xe227('0x1b')]);var _0x470ed3=[_0xe227('0x1c'),_0xe227('0x1d')];var _0x5150d0=Buffer['from'](JSON[_0xe227('0x1e')]({'id':_0x48dad3}))[_0xe227('0x1f')](_0xe227('0x20'));var _0x4e6a47=crypto['randomBytes'](0x10)['toString'](_0xe227('0x21'));var _0x36af94=getAuthorizationScopes(_0x4c8fb3);var _0x57c448=[{'key':_0xe227('0x22'),'value':_0x4c8fb3[_0xe227('0x23')]},{'key':_0xe227('0x24'),'value':encodeURIComponent(_0x470ed3[_0xe227('0x25')]('\x20'))},{'key':_0xe227('0x26'),'value':_0x4c8fb3[_0xe227('0x27')]},{'key':_0xe227('0x28'),'value':_0xe227('0x29')},{'key':_0xe227('0x2a'),'value':encodeURIComponent(_0x36af94)},{'key':_0xe227('0x2b'),'value':_0x5150d0},{'key':_0xe227('0x2c'),'value':_0x4e6a47},{'key':_0xe227('0x2d'),'value':_0xe227('0x2e')}];var _0x1ce688=_0x460eb0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x57c448,function(_0x273ac8){return _0x273ac8[_0xe227('0x2f')]+'='+_0x273ac8[_0xe227('0x30')];})[_0xe227('0x25')]('&');_0x4c8fb3['oauth2Claims']={'issuer':_0x460eb0[_0xe227('0x19')]('oauth2/',''),'audience':_0x4c8fb3[_0xe227('0x23')],'state':_0x5150d0,'nonce':_0x4e6a47};redis[_0xe227('0x31')](_0x5150d0,JSON['stringify'](_0x4c8fb3));return _0x1ce688;}function isValidIdToken(_0x53e28c,_0xba4703){try{var _0x2b228a=jwt[_0xe227('0x32')](_0x53e28c,{'complete':!![]});var _0x21fdbe=_0x2b228a[_0xe227('0x33')];if(_0x21fdbe[_0xe227('0x34')]!==_0xba4703[_0xe227('0x35')])return![];if(_0x21fdbe[_0xe227('0x36')]!==_0xba4703['audience'])return![];if(_0x21fdbe[_0xe227('0x2c')]!==_0xba4703[_0xe227('0x2c')])return![];if(moment()[_0xe227('0x37')](moment['unix'](_0x21fdbe[_0xe227('0x38')])))return![];return!![];}catch(_0x88d3e6){throw _0x88d3e6;}}function refreshOauth2MicrosoftAccessToken(_0x481f9c){return Promise[_0xe227('0x39')]()[_0xe227('0x3a')](function(){if(_0x481f9c[_0xe227('0x3b')])return _0x481f9c;return db[_0xe227('0x3c')][_0xe227('0x3d')]({'where':{'id':_0x481f9c['id']},'raw':!![]});})[_0xe227('0x3a')](function(_0x80e0e2){var _0x4f7dde={'grant_type':'refresh_token','refresh_token':_0x80e0e2[_0xe227('0x3e')],'scope':getAccessTokenScope(_0x80e0e2),'redirect_uri':_0x80e0e2['data4'],'client_id':_0x80e0e2[_0xe227('0x23')],'client_secret':encryptor[_0xe227('0x3f')](_0x80e0e2[_0xe227('0x3b')])};var _0xf0b447={'method':_0xe227('0x40'),'uri':MICROSOFT_AUTH_URL[_0xe227('0x19')](_0xe227('0x1a'),_0x80e0e2[_0xe227('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f7dde,'json':!![]};return rp(_0xf0b447);})['then'](function(_0x5b2afd){_0x481f9c[_0xe227('0x41')]=_0x5b2afd[_0xe227('0x42')];_0x481f9c['data6']=_0x5b2afd['refresh_token'];return db[_0xe227('0x3c')]['update']({'data5':_0x481f9c[_0xe227('0x41')],'data6':_0x481f9c['data6']},{'where':{'id':_0x481f9c['id']}});})[_0xe227('0x3a')](function(){return _0x481f9c;})['catch'](function(_0x40b2e9){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x481f9c['id'],_0x40b2e9);});}function getOauth2MicrosoftAccessToken(_0x23d953,_0x176afa){var _0xa593b5={'grant_type':'authorization_code','code':_0x23d953,'scope':getAccessTokenScope(_0x176afa),'redirect_uri':_0x176afa[_0xe227('0x27')],'client_id':_0x176afa['data1'],'client_secret':encryptor[_0xe227('0x3f')](_0x176afa[_0xe227('0x3b')])};var _0x35f8e1={'method':_0xe227('0x40'),'uri':MICROSOFT_AUTH_URL[_0xe227('0x19')](_0xe227('0x1a'),_0x176afa[_0xe227('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa593b5,'json':!![]};return rp(_0x35f8e1);}function startRefreshInterval(_0x3bbaa7){var _0x30c6d7=schedule[_0xe227('0x43')];if(_0x30c6d7[_0x3bbaa7['id']])clearInterval(_0x30c6d7[_0x3bbaa7['id']]);_0x30c6d7[_0x3bbaa7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe227('0x44')](this,{'id':_0x3bbaa7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xe227('0x43')]=_0x30c6d7;}function startAllRefreshIntervals(){return db[_0xe227('0x3c')][_0xe227('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe227('0x3a')](function(_0x5a6399){var _0x2b825f=_0x5a6399[_0xe227('0x14')](function(_0x35f9b8){return refreshOauth2MicrosoftAccessToken(_0x35f9b8)[_0xe227('0x3a')](function(_0x529847){startRefreshInterval(_0x529847);});});return Promise['all'](_0x2b825f);})[_0xe227('0x46')](function(_0x12614d){var _0x525040=_0x12614d?util['inspect'](_0x12614d,{'showHidden':![],'depth':null}):'';logger[_0xe227('0x47')](_0xe227('0x48'),_0x525040);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 305ad32..5987229 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 _0x7177=['stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7177,0x101));var _0x7717=function(_0x64b57d,_0x2a79d8){_0x64b57d=_0x64b57d-0x0;var _0x2f55bd=_0x7177[_0x64b57d];return _0x2f55bd;};'use strict';var _=require(_0x7717('0x0'));var util=require('util');var moment=require(_0x7717('0x1'));var BPromise=require('bluebird');var rs=require(_0x7717('0x2'));var fs=require('fs');var Redis=require(_0x7717('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7717('0x4'));var logger=require(_0x7717('0x5'))('rpc');var config=require(_0x7717('0x6'));var jayson=require(_0x7717('0x7'));var client=jayson[_0x7717('0x8')][_0x7717('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe3d36b,_0x3db511,_0xaca6aa){return new BPromise(function(_0x2ded67,_0x29a980){return client[_0x7717('0xa')](_0xe3d36b,_0xaca6aa)[_0x7717('0xb')](function(_0x51d2a6){logger[_0x7717('0xc')](_0x7717('0xd'),_0x3db511,'request\x20sent');logger[_0x7717('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3db511,_0x7717('0xf'),JSON[_0x7717('0x10')](_0x51d2a6));if(_0x51d2a6[_0x7717('0x11')]){if(_0x51d2a6[_0x7717('0x11')][_0x7717('0x12')]===0x1f4){logger['error'](_0x7717('0xd'),_0x3db511,_0x51d2a6[_0x7717('0x11')][_0x7717('0x13')]);return _0x29a980(_0x51d2a6[_0x7717('0x11')][_0x7717('0x13')]);}logger[_0x7717('0x11')](_0x7717('0xd'),_0x3db511,_0x51d2a6['error'][_0x7717('0x13')]);return _0x2ded67(_0x51d2a6[_0x7717('0x11')][_0x7717('0x13')]);}else{logger[_0x7717('0xc')](_0x7717('0xd'),_0x3db511,_0x7717('0xf'));_0x2ded67(_0x51d2a6[_0x7717('0x14')]['message']);}})['catch'](function(_0x4071ff){logger['error'](_0x7717('0xd'),_0x3db511,_0x4071ff);_0x29a980(_0x4071ff);});});}
\ No newline at end of file
+var _0x26c2=['request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26c2,0x1d6));var _0x226c=function(_0x3a54b1,_0x2a93cd){_0x3a54b1=_0x3a54b1-0x0;var _0x5b451b=_0x26c2[_0x3a54b1];return _0x5b451b;};'use strict';var _=require('lodash');var util=require(_0x226c('0x0'));var moment=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var rs=require(_0x226c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x226c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x5'))(_0x226c('0x6'));var config=require(_0x226c('0x7'));var jayson=require(_0x226c('0x8'));var client=jayson[_0x226c('0x9')][_0x226c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ccdb,_0x50654d,_0x58ebd8){return new BPromise(function(_0x53fc4f,_0x10cae2){return client[_0x226c('0xb')](_0x23ccdb,_0x58ebd8)['then'](function(_0x475e09){logger[_0x226c('0xc')](_0x226c('0xd'),_0x50654d,_0x226c('0xe'));logger[_0x226c('0xf')](_0x226c('0x10'),_0x50654d,_0x226c('0xe'),JSON['stringify'](_0x475e09));if(_0x475e09['error']){if(_0x475e09[_0x226c('0x11')][_0x226c('0x12')]===0x1f4){logger[_0x226c('0x11')](_0x226c('0xd'),_0x50654d,_0x475e09['error']['message']);return _0x10cae2(_0x475e09[_0x226c('0x11')][_0x226c('0x13')]);}logger[_0x226c('0x11')](_0x226c('0xd'),_0x50654d,_0x475e09[_0x226c('0x11')]['message']);return _0x53fc4f(_0x475e09[_0x226c('0x11')][_0x226c('0x13')]);}else{logger[_0x226c('0xc')]('CloudProvider,\x20%s,\x20%s',_0x50654d,_0x226c('0xe'));_0x53fc4f(_0x475e09[_0x226c('0x14')][_0x226c('0x13')]);}})[_0x226c('0x15')](function(_0x3b6d9a){logger[_0x226c('0x11')](_0x226c('0xd'),_0x50654d,_0x3b6d9a);_0x10cae2(_0x3b6d9a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 70ad3d1..6a708ef 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0x1261,0x144));var _0x1126=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x1261[_0x5ac1e5];return _0x1bccc6;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x5f2f,0x73));var _0xf5f2=function(_0x214c21,_0x545f27){_0x214c21=_0x214c21-0x0;var _0x34b2cf=_0x5f2f[_0x214c21];return _0x34b2cf;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index f8a3e22..162d2e4 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 _0x6f1d=['STRING','name','exports'];(function(_0x3fecfd,_0x89fe75){var _0x4e92d4=function(_0x2013e7){while(--_0x2013e7){_0x3fecfd['push'](_0x3fecfd['shift']());}};_0x4e92d4(++_0x89fe75);}(_0x6f1d,0x1b2));var _0xd6f1=function(_0x351430,_0x1489bd){_0x351430=_0x351430-0x0;var _0x5ae42d=_0x6f1d[_0x351430];return _0x5ae42d;};'use strict';var Sequelize=require('sequelize');module[_0xd6f1('0x0')]={'name':{'type':Sequelize[_0xd6f1('0x1')],'unique':_0xd6f1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd6f1('0x1')]},'companyId':{'type':Sequelize[_0xd6f1('0x1')]},'website':{'type':Sequelize[_0xd6f1('0x1')]},'phone':{'type':Sequelize[_0xd6f1('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd6f1('0x1')]},'street':{'type':Sequelize[_0xd6f1('0x1')]},'postalCode':{'type':Sequelize[_0xd6f1('0x1')]},'city':{'type':Sequelize[_0xd6f1('0x1')]},'country':{'type':Sequelize[_0xd6f1('0x1')]},'email':{'type':Sequelize[_0xd6f1('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd6f1('0x1')]},'sStreet':{'type':Sequelize[_0xd6f1('0x1')]},'sPostalCode':{'type':Sequelize[_0xd6f1('0x1')]},'sCity':{'type':Sequelize[_0xd6f1('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6f1('0x1')]}};
\ No newline at end of file
+var _0x4172=['sequelize','STRING','name'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0x4172,0x1aa));var _0x2417=function(_0x1293dc,_0x285c24){_0x1293dc=_0x1293dc-0x0;var _0x3f8089=_0x4172[_0x1293dc];return _0x3f8089;};'use strict';var Sequelize=require(_0x2417('0x0'));module['exports']={'name':{'type':Sequelize[_0x2417('0x1')],'unique':_0x2417('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2417('0x1')]},'companyId':{'type':Sequelize[_0x2417('0x1')]},'website':{'type':Sequelize[_0x2417('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2417('0x1')]},'street':{'type':Sequelize[_0x2417('0x1')]},'postalCode':{'type':Sequelize[_0x2417('0x1')]},'city':{'type':Sequelize[_0x2417('0x1')]},'country':{'type':Sequelize[_0x2417('0x1')]},'email':{'type':Sequelize[_0x2417('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2417('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x2417('0x1')]},'sCity':{'type':Sequelize[_0x2417('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2417('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7dda340..d2dc0a8 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 _0x44fe=['describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','stack','name','index','CmCompany'];(function(_0x1c33e2,_0x22412d){var _0x3dae1a=function(_0x569a97){while(--_0x569a97){_0x1c33e2['push'](_0x1c33e2['shift']());}};_0x3dae1a(++_0x22412d);}(_0x44fe,0x7f));var _0xe44f=function(_0x4c70da,_0x55f8ef){_0x4c70da=_0x4c70da-0x0;var _0x2f2931=_0x44fe[_0x4c70da];return _0x2f2931;};'use strict';var emlformat=require(_0xe44f('0x0'));var rimraf=require(_0xe44f('0x1'));var zipdir=require(_0xe44f('0x2'));var jsonpatch=require(_0xe44f('0x3'));var rp=require('request-promise');var moment=require(_0xe44f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe44f('0x5'));var util=require('util');var path=require(_0xe44f('0x6'));var sox=require(_0xe44f('0x7'));var csv=require(_0xe44f('0x8'));var ejs=require(_0xe44f('0x9'));var fs=require('fs');var fs_extra=require(_0xe44f('0xa'));var _=require(_0xe44f('0xb'));var squel=require(_0xe44f('0xc'));var crypto=require(_0xe44f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe44f('0xe'));var toCsv=require(_0xe44f('0x8'));var querystring=require(_0xe44f('0xf'));var Papa=require(_0xe44f('0x10'));var Redis=require(_0xe44f('0x11'));var authService=require(_0xe44f('0x12'));var qs=require(_0xe44f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe44f('0x14'));var logger=require(_0xe44f('0x15'))(_0xe44f('0x16'));var utils=require(_0xe44f('0x17'));var config=require(_0xe44f('0x18'));var licenseUtil=require(_0xe44f('0x19'));var db=require(_0xe44f('0x1a'))['db'];function respondWithStatusCode(_0x46b798,_0x4c9a07){_0x4c9a07=_0x4c9a07||0xcc;return function(_0x43620d){if(_0x43620d){return _0x46b798[_0xe44f('0x1b')](_0x4c9a07);}return _0x46b798[_0xe44f('0x1c')](_0x4c9a07)[_0xe44f('0x1d')]();};}function respondWithResult(_0x318472,_0x596ce2){_0x596ce2=_0x596ce2||0xc8;return function(_0x46a3b4){if(_0x46a3b4){return _0x318472[_0xe44f('0x1c')](_0x596ce2)['json'](_0x46a3b4);}};}function respondWithFilteredResult(_0x4279e6,_0x626c88){return function(_0x489d18){if(_0x489d18){var _0x2a5a98=typeof _0x626c88['offset']==='undefined'&&typeof _0x626c88['limit']===_0xe44f('0x1e');var _0x4a4721=_0x489d18[_0xe44f('0x1f')];var _0x413b2b=_0x2a5a98?0x0:_0x626c88[_0xe44f('0x20')];var _0x10f4f2=_0x2a5a98?_0x489d18[_0xe44f('0x1f')]:_0x626c88[_0xe44f('0x20')]+_0x626c88[_0xe44f('0x21')];var _0x11204a;if(_0x10f4f2>=_0x4a4721){_0x10f4f2=_0x4a4721;_0x11204a=0xc8;}else{_0x11204a=0xce;}_0x4279e6['status'](_0x11204a);return _0x4279e6[_0xe44f('0x22')](_0xe44f('0x23'),_0x413b2b+'-'+_0x10f4f2+'/'+_0x4a4721)['json'](_0x489d18);}return null;};}function patchUpdates(_0x1e318a){return function(_0xd8a9c3){try{jsonpatch[_0xe44f('0x24')](_0xd8a9c3,_0x1e318a,!![]);}catch(_0x5c71ec){return BPromise[_0xe44f('0x25')](_0x5c71ec);}return _0xd8a9c3['save']();};}function saveUpdates(_0x1ad876,_0x2f137f){return function(_0xbb3246){if(_0xbb3246){return _0xbb3246['update'](_0x1ad876)[_0xe44f('0x26')](function(_0x44de2f){return _0x44de2f;});}return null;};}function removeEntity(_0x1ce23d,_0x48bf35){return function(_0x326f35){if(_0x326f35){return _0x326f35[_0xe44f('0x27')]()[_0xe44f('0x26')](function(){var _0x2c7662=_0x326f35[_0xe44f('0x28')]({'plain':!![]});var _0x44ed9a=_0xe44f('0x29');return db[_0xe44f('0x2a')][_0xe44f('0x27')]({'where':{'type':_0x44ed9a,'resourceId':_0x2c7662['id']}})['then'](function(){return _0x326f35;});})['then'](function(){_0x1ce23d[_0xe44f('0x1c')](0xcc)[_0xe44f('0x1d')]();});}};}function handleEntityNotFound(_0x37b843,_0x49642b){return function(_0x2a696e){if(!_0x2a696e){_0x37b843[_0xe44f('0x1b')](0x194);}return _0x2a696e;};}function handleError(_0x15f7d9,_0x3a443c){_0x3a443c=_0x3a443c||0x1f4;return function(_0x512874){logger['error'](_0x512874[_0xe44f('0x2b')]);if(_0x512874[_0xe44f('0x2c')]){delete _0x512874[_0xe44f('0x2c')];}_0x15f7d9[_0xe44f('0x1c')](_0x3a443c)['send'](_0x512874);};}exports[_0xe44f('0x2d')]=function(_0xb311b2,_0x393aee){var _0x5b83b4={},_0x140931={},_0x3226e4={'count':0x0,'rows':[]};return db[_0xe44f('0x2e')][_0xe44f('0x2f')]()[_0xe44f('0x26')](function(_0x4a7b29){_0x140931[_0xe44f('0x30')]=_['keys'](_0x4a7b29);_0x140931[_0xe44f('0x31')]=_[_0xe44f('0x32')](_0xb311b2[_0xe44f('0x31')]);_0x140931[_0xe44f('0x33')]=_[_0xe44f('0x34')](_0x140931['model'],_0x140931[_0xe44f('0x31')]);_0x5b83b4[_0xe44f('0x35')]=_[_0xe44f('0x34')](_0x140931[_0xe44f('0x30')],qs[_0xe44f('0x36')](_0xb311b2[_0xe44f('0x31')]['fields']));_0x5b83b4[_0xe44f('0x35')]=_0x5b83b4[_0xe44f('0x35')][_0xe44f('0x37')]?_0x5b83b4[_0xe44f('0x35')]:_0x140931['model'];if(!_0xb311b2[_0xe44f('0x31')][_0xe44f('0x38')](_0xe44f('0x39'))){_0x5b83b4[_0xe44f('0x21')]=qs['limit'](_0xb311b2[_0xe44f('0x31')][_0xe44f('0x21')]);_0x5b83b4[_0xe44f('0x20')]=qs[_0xe44f('0x20')](_0xb311b2[_0xe44f('0x31')]['offset']);}_0x5b83b4[_0xe44f('0x3a')]=qs[_0xe44f('0x3b')](_0xb311b2[_0xe44f('0x31')][_0xe44f('0x3b')]);_0x5b83b4[_0xe44f('0x3c')]=qs[_0xe44f('0x33')](_[_0xe44f('0x3d')](_0xb311b2[_0xe44f('0x31')],_0x140931[_0xe44f('0x33')]),_0x4a7b29);if(_0xb311b2[_0xe44f('0x31')]['filter']){_0x5b83b4[_0xe44f('0x3c')]=_[_0xe44f('0x3e')](_0x5b83b4[_0xe44f('0x3c')],{'$or':_['map'](_0x5b83b4['attributes'],function(_0x1b5b50){var _0x4ebccb={};_0x4ebccb[_0x1b5b50]={'$like':'%'+_0xb311b2[_0xe44f('0x31')][_0xe44f('0x3f')]+'%'};return _0x4ebccb;})});}_0x5b83b4=_[_0xe44f('0x3e')]({},_0x5b83b4,_0xb311b2[_0xe44f('0x40')]);var _0x3d9528={'where':_0x5b83b4[_0xe44f('0x3c')]};return db[_0xe44f('0x2e')][_0xe44f('0x1f')](_0x3d9528)[_0xe44f('0x26')](function(_0x567cf9){_0x3226e4[_0xe44f('0x1f')]=_0x567cf9;if(_0xb311b2[_0xe44f('0x31')][_0xe44f('0x41')]){_0x5b83b4[_0xe44f('0x42')]=[{'all':!![]}];}return db[_0xe44f('0x2e')][_0xe44f('0x43')](_0x5b83b4);})[_0xe44f('0x26')](function(_0x15f2f0){_0x3226e4[_0xe44f('0x44')]=_0x15f2f0;return _0x3226e4;})[_0xe44f('0x26')](respondWithFilteredResult(_0x393aee,_0x5b83b4))[_0xe44f('0x45')](handleError(_0x393aee,null));})['catch'](handleError(_0x393aee,null));};exports[_0xe44f('0x46')]=function(_0x121175,_0x2fd308){var _0x29457d={'raw':![],'where':{'id':_0x121175[_0xe44f('0x47')]['id']}},_0x381672={};_0x381672['model']=_['keys'](db[_0xe44f('0x2e')]['rawAttributes']);_0x381672[_0xe44f('0x31')]=_[_0xe44f('0x32')](_0x121175[_0xe44f('0x31')]);_0x381672[_0xe44f('0x33')]=_[_0xe44f('0x34')](_0x381672['model'],_0x381672[_0xe44f('0x31')]);_0x29457d[_0xe44f('0x35')]=_['intersection'](_0x381672[_0xe44f('0x30')],qs[_0xe44f('0x36')](_0x121175[_0xe44f('0x31')]['fields']));_0x29457d['attributes']=_0x29457d[_0xe44f('0x35')][_0xe44f('0x37')]?_0x29457d['attributes']:_0x381672[_0xe44f('0x30')];if(_0x121175[_0xe44f('0x31')]['includeAll']){_0x29457d['include']=[{'all':!![]}];}_0x29457d=_[_0xe44f('0x3e')]({},_0x29457d,_0x121175[_0xe44f('0x40')]);return db[_0xe44f('0x2e')][_0xe44f('0x48')](_0x29457d)[_0xe44f('0x26')](handleEntityNotFound(_0x2fd308,null))['then'](respondWithResult(_0x2fd308,null))[_0xe44f('0x45')](handleError(_0x2fd308,null));};exports[_0xe44f('0x49')]=function(_0x356f81,_0x5f1cf7){return db['CmCompany'][_0xe44f('0x49')](_0x356f81[_0xe44f('0x4a')],{})['then'](function(_0x51f8c5){var _0x186edd=_0x356f81[_0xe44f('0x4b')][_0xe44f('0x28')]({'plain':!![]});if(!_0x186edd)throw new Error(_0xe44f('0x4c'));if(_0x186edd['role']===_0xe44f('0x4b')){var _0x4dd7a9=_0x51f8c5['get']({'plain':!![]});var _0xa919a9='Companies';return db[_0xe44f('0x4d')][_0xe44f('0x48')]({'where':{'name':_0xa919a9,'userProfileId':_0x186edd[_0xe44f('0x4e')]},'raw':!![]})[_0xe44f('0x26')](function(_0x304888){if(_0x304888&&_0x304888['autoAssociation']===0x0){return db[_0xe44f('0x2a')][_0xe44f('0x49')]({'name':_0x4dd7a9['name'],'resourceId':_0x4dd7a9['id'],'type':_0x304888['name'],'sectionId':_0x304888['id']},{})['then'](function(){return _0x51f8c5;});}else{return _0x51f8c5;}})['catch'](function(_0x1f474e){logger['error'](_0xe44f('0x4f'),_0x1f474e);throw _0x1f474e;});}return _0x51f8c5;})[_0xe44f('0x26')](respondWithResult(_0x5f1cf7,0xc9))['catch'](handleError(_0x5f1cf7,null));};exports[_0xe44f('0x50')]=function(_0x489e43,_0x283885){if(_0x489e43['body']['id']){delete _0x489e43[_0xe44f('0x4a')]['id'];}return db['CmCompany'][_0xe44f('0x48')]({'where':{'id':_0x489e43[_0xe44f('0x47')]['id']}})[_0xe44f('0x26')](handleEntityNotFound(_0x283885,null))[_0xe44f('0x26')](saveUpdates(_0x489e43['body'],null))['then'](respondWithResult(_0x283885,null))['catch'](handleError(_0x283885,null));};exports['destroy']=function(_0x2183b0,_0x26509b){return db[_0xe44f('0x2e')][_0xe44f('0x48')]({'where':{'id':_0x2183b0[_0xe44f('0x47')]['id']}})[_0xe44f('0x26')](handleEntityNotFound(_0x26509b,null))[_0xe44f('0x26')](removeEntity(_0x26509b,null))['catch'](handleError(_0x26509b,null));};exports['describe']=function(_0x577eec,_0xdea24a){return db[_0xe44f('0x2e')]['describe']()[_0xe44f('0x26')](respondWithResult(_0xdea24a,null))[_0xe44f('0x45')](handleError(_0xdea24a,null));};exports[_0xe44f('0x51')]=function(_0x2553f1,_0x203564,_0x24e06c){return db[_0xe44f('0x52')][_0xe44f('0x48')]({'where':{'id':_0x2553f1[_0xe44f('0x47')]['id']}})[_0xe44f('0x26')](handleEntityNotFound(_0x203564,null))['then'](function(_0x3d7008){if(_0x3d7008){return _0x3d7008[_0xe44f('0x51')](_0x2553f1[_0xe44f('0x4a')][_0xe44f('0x53')],_['omit'](_0x2553f1[_0xe44f('0x4a')],[_0xe44f('0x53'),'id'])||{});}})[_0xe44f('0x26')](respondWithResult(_0x203564,null))[_0xe44f('0x45')](handleError(_0x203564,null));};exports[_0xe44f('0x54')]=function(_0x4ebd9c,_0xada767,_0x532d24){var _0x4e7245={};var _0x3d0be6={};var _0x390275;var _0x3c121b;return db['CmCompany'][_0xe44f('0x55')]({'where':{'id':_0x4ebd9c['params']['id']}})[_0xe44f('0x26')](handleEntityNotFound(_0xada767,null))[_0xe44f('0x26')](function(_0x1d5b4a){if(_0x1d5b4a){_0x390275=_0x1d5b4a;_0x3d0be6[_0xe44f('0x30')]=_[_0xe44f('0x32')](db[_0xe44f('0x52')][_0xe44f('0x56')]);_0x3d0be6[_0xe44f('0x31')]=_[_0xe44f('0x32')](_0x4ebd9c[_0xe44f('0x31')]);_0x3d0be6[_0xe44f('0x33')]=_[_0xe44f('0x34')](_0x3d0be6['model'],_0x3d0be6['query']);_0x4e7245['attributes']=_[_0xe44f('0x34')](_0x3d0be6[_0xe44f('0x30')],qs[_0xe44f('0x36')](_0x4ebd9c[_0xe44f('0x31')]['fields']));_0x4e7245[_0xe44f('0x35')]=_0x4e7245[_0xe44f('0x35')][_0xe44f('0x37')]?_0x4e7245[_0xe44f('0x35')]:_0x3d0be6[_0xe44f('0x30')];_0x4e7245[_0xe44f('0x3a')]=qs[_0xe44f('0x3b')](_0x4ebd9c['query'][_0xe44f('0x3b')]);_0x4e7245[_0xe44f('0x3c')]=qs[_0xe44f('0x33')](_[_0xe44f('0x3d')](_0x4ebd9c[_0xe44f('0x31')],_0x3d0be6[_0xe44f('0x33')]));if(_0x4ebd9c[_0xe44f('0x31')]['filter']){_0x4e7245[_0xe44f('0x3c')]=_[_0xe44f('0x3e')](_0x4e7245['where'],{'$or':_['map'](_0x4e7245[_0xe44f('0x35')],function(_0x3a6d1c){var _0x1ee973={};_0x1ee973[_0x3a6d1c]={'$like':'%'+_0x4ebd9c[_0xe44f('0x31')][_0xe44f('0x3f')]+'%'};return _0x1ee973;})});}_0x4e7245=_['merge']({},_0x4e7245,_0x4ebd9c[_0xe44f('0x40')]);return _0x390275[_0xe44f('0x54')](_0x4e7245);}})['then'](function(_0x1c61b9){if(_0x1c61b9){_0x3c121b=_0x1c61b9[_0xe44f('0x37')];if(!_0x4ebd9c[_0xe44f('0x31')][_0xe44f('0x38')]('nolimit')){_0x4e7245[_0xe44f('0x21')]=qs[_0xe44f('0x21')](_0x4ebd9c['query'][_0xe44f('0x21')]);_0x4e7245[_0xe44f('0x20')]=qs[_0xe44f('0x20')](_0x4ebd9c[_0xe44f('0x31')][_0xe44f('0x20')]);}return _0x390275['getContacts'](_0x4e7245);}})[_0xe44f('0x26')](function(_0x8de28a){if(_0x8de28a){return _0x8de28a?{'count':_0x3c121b,'rows':_0x8de28a}:null;}})[_0xe44f('0x26')](respondWithResult(_0xada767,null))[_0xe44f('0x45')](handleError(_0xada767,null));};
\ No newline at end of file
+var _0xb10d=['send','index','CmCompany','describe','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','pick','filter','map','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb10d,0x132));var _0xdb10=function(_0x10b466,_0x18194f){_0x10b466=_0x10b466-0x0;var _0x2e860a=_0xb10d[_0x10b466];return _0x2e860a;};'use strict';var emlformat=require(_0xdb10('0x0'));var rimraf=require(_0xdb10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb10('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb10('0x3'));var Mustache=require(_0xdb10('0x4'));var util=require(_0xdb10('0x5'));var path=require(_0xdb10('0x6'));var sox=require(_0xdb10('0x7'));var csv=require(_0xdb10('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb10('0x9'));var _=require('lodash');var squel=require(_0xdb10('0xa'));var crypto=require(_0xdb10('0xb'));var jsforce=require(_0xdb10('0xc'));var deskjs=require(_0xdb10('0xd'));var toCsv=require(_0xdb10('0x8'));var querystring=require('querystring');var Papa=require(_0xdb10('0xe'));var Redis=require('ioredis');var authService=require(_0xdb10('0xf'));var qs=require(_0xdb10('0x10'));var as=require(_0xdb10('0x11'));var hardwareService=require(_0xdb10('0x12'));var logger=require(_0xdb10('0x13'))(_0xdb10('0x14'));var utils=require(_0xdb10('0x15'));var config=require(_0xdb10('0x16'));var licenseUtil=require(_0xdb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39fa93,_0x1df989){_0x1df989=_0x1df989||0xcc;return function(_0x3401e0){if(_0x3401e0){return _0x39fa93[_0xdb10('0x18')](_0x1df989);}return _0x39fa93[_0xdb10('0x19')](_0x1df989)[_0xdb10('0x1a')]();};}function respondWithResult(_0x25bbed,_0x2c8df9){_0x2c8df9=_0x2c8df9||0xc8;return function(_0x4dc75d){if(_0x4dc75d){return _0x25bbed[_0xdb10('0x19')](_0x2c8df9)[_0xdb10('0x1b')](_0x4dc75d);}};}function respondWithFilteredResult(_0x168f30,_0x508824){return function(_0x5f58c0){if(_0x5f58c0){var _0x388441=typeof _0x508824['offset']===_0xdb10('0x1c')&&typeof _0x508824[_0xdb10('0x1d')]===_0xdb10('0x1c');var _0x3ef485=_0x5f58c0[_0xdb10('0x1e')];var _0x263170=_0x388441?0x0:_0x508824[_0xdb10('0x1f')];var _0x1f5f47=_0x388441?_0x5f58c0['count']:_0x508824['offset']+_0x508824[_0xdb10('0x1d')];var _0x4b3b19;if(_0x1f5f47>=_0x3ef485){_0x1f5f47=_0x3ef485;_0x4b3b19=0xc8;}else{_0x4b3b19=0xce;}_0x168f30[_0xdb10('0x19')](_0x4b3b19);return _0x168f30[_0xdb10('0x20')](_0xdb10('0x21'),_0x263170+'-'+_0x1f5f47+'/'+_0x3ef485)[_0xdb10('0x1b')](_0x5f58c0);}return null;};}function patchUpdates(_0x93883){return function(_0x44b880){try{jsonpatch[_0xdb10('0x22')](_0x44b880,_0x93883,!![]);}catch(_0x58216f){return BPromise[_0xdb10('0x23')](_0x58216f);}return _0x44b880[_0xdb10('0x24')]();};}function saveUpdates(_0x4709b4,_0x445919){return function(_0x134cfc){if(_0x134cfc){return _0x134cfc[_0xdb10('0x25')](_0x4709b4)['then'](function(_0x491161){return _0x491161;});}return null;};}function removeEntity(_0x2b31c7,_0x250810){return function(_0x577e95){if(_0x577e95){return _0x577e95[_0xdb10('0x26')]()[_0xdb10('0x27')](function(){var _0x2185b2=_0x577e95[_0xdb10('0x28')]({'plain':!![]});var _0x1e7cc7=_0xdb10('0x29');return db[_0xdb10('0x2a')][_0xdb10('0x26')]({'where':{'type':_0x1e7cc7,'resourceId':_0x2185b2['id']}})[_0xdb10('0x27')](function(){return _0x577e95;});})[_0xdb10('0x27')](function(){_0x2b31c7[_0xdb10('0x19')](0xcc)[_0xdb10('0x1a')]();});}};}function handleEntityNotFound(_0x2d6998,_0x5f0d47){return function(_0x5995cc){if(!_0x5995cc){_0x2d6998['sendStatus'](0x194);}return _0x5995cc;};}function handleError(_0x3582d5,_0x3b6d77){_0x3b6d77=_0x3b6d77||0x1f4;return function(_0x47c633){logger[_0xdb10('0x2b')](_0x47c633[_0xdb10('0x2c')]);if(_0x47c633[_0xdb10('0x2d')]){delete _0x47c633[_0xdb10('0x2d')];}_0x3582d5['status'](_0x3b6d77)[_0xdb10('0x2e')](_0x47c633);};}exports[_0xdb10('0x2f')]=function(_0x4caefd,_0x46a728){var _0x1f04b0={},_0x59e77b={},_0x2468eb={'count':0x0,'rows':[]};return db[_0xdb10('0x30')][_0xdb10('0x31')]()[_0xdb10('0x27')](function(_0x11bcb9){_0x59e77b[_0xdb10('0x32')]=_[_0xdb10('0x33')](_0x11bcb9);_0x59e77b[_0xdb10('0x34')]=_[_0xdb10('0x33')](_0x4caefd['query']);_0x59e77b['filters']=_[_0xdb10('0x35')](_0x59e77b[_0xdb10('0x32')],_0x59e77b['query']);_0x1f04b0['attributes']=_['intersection'](_0x59e77b[_0xdb10('0x32')],qs['fields'](_0x4caefd['query'][_0xdb10('0x36')]));_0x1f04b0[_0xdb10('0x37')]=_0x1f04b0[_0xdb10('0x37')][_0xdb10('0x38')]?_0x1f04b0[_0xdb10('0x37')]:_0x59e77b['model'];if(!_0x4caefd[_0xdb10('0x34')][_0xdb10('0x39')](_0xdb10('0x3a'))){_0x1f04b0[_0xdb10('0x1d')]=qs[_0xdb10('0x1d')](_0x4caefd[_0xdb10('0x34')][_0xdb10('0x1d')]);_0x1f04b0['offset']=qs[_0xdb10('0x1f')](_0x4caefd[_0xdb10('0x34')][_0xdb10('0x1f')]);}_0x1f04b0[_0xdb10('0x3b')]=qs[_0xdb10('0x3c')](_0x4caefd[_0xdb10('0x34')][_0xdb10('0x3c')]);_0x1f04b0[_0xdb10('0x3d')]=qs[_0xdb10('0x3e')](_['pick'](_0x4caefd[_0xdb10('0x34')],_0x59e77b['filters']),_0x11bcb9);if(_0x4caefd[_0xdb10('0x34')]['filter']){_0x1f04b0[_0xdb10('0x3d')]=_[_0xdb10('0x3f')](_0x1f04b0['where'],{'$or':_['map'](_0x1f04b0['attributes'],function(_0x5b338a){var _0x1bb60e={};_0x1bb60e[_0x5b338a]={'$like':'%'+_0x4caefd[_0xdb10('0x34')]['filter']+'%'};return _0x1bb60e;})});}_0x1f04b0=_[_0xdb10('0x3f')]({},_0x1f04b0,_0x4caefd[_0xdb10('0x40')]);var _0x20261b={'where':_0x1f04b0[_0xdb10('0x3d')]};return db[_0xdb10('0x30')][_0xdb10('0x1e')](_0x20261b)['then'](function(_0x3f3009){_0x2468eb['count']=_0x3f3009;if(_0x4caefd[_0xdb10('0x34')][_0xdb10('0x41')]){_0x1f04b0[_0xdb10('0x42')]=[{'all':!![]}];}return db[_0xdb10('0x30')][_0xdb10('0x43')](_0x1f04b0);})['then'](function(_0x2d3561){_0x2468eb['rows']=_0x2d3561;return _0x2468eb;})[_0xdb10('0x27')](respondWithFilteredResult(_0x46a728,_0x1f04b0))[_0xdb10('0x44')](handleError(_0x46a728,null));})[_0xdb10('0x44')](handleError(_0x46a728,null));};exports[_0xdb10('0x45')]=function(_0x52cdc2,_0x19996d){var _0x4d2d4f={'raw':![],'where':{'id':_0x52cdc2[_0xdb10('0x46')]['id']}},_0x40ce47={};_0x40ce47[_0xdb10('0x32')]=_[_0xdb10('0x33')](db[_0xdb10('0x30')]['rawAttributes']);_0x40ce47[_0xdb10('0x34')]=_[_0xdb10('0x33')](_0x52cdc2[_0xdb10('0x34')]);_0x40ce47[_0xdb10('0x3e')]=_[_0xdb10('0x35')](_0x40ce47[_0xdb10('0x32')],_0x40ce47['query']);_0x4d2d4f['attributes']=_[_0xdb10('0x35')](_0x40ce47[_0xdb10('0x32')],qs[_0xdb10('0x36')](_0x52cdc2['query'][_0xdb10('0x36')]));_0x4d2d4f[_0xdb10('0x37')]=_0x4d2d4f[_0xdb10('0x37')]['length']?_0x4d2d4f[_0xdb10('0x37')]:_0x40ce47['model'];if(_0x52cdc2[_0xdb10('0x34')][_0xdb10('0x41')]){_0x4d2d4f[_0xdb10('0x42')]=[{'all':!![]}];}_0x4d2d4f=_[_0xdb10('0x3f')]({},_0x4d2d4f,_0x52cdc2[_0xdb10('0x40')]);return db[_0xdb10('0x30')][_0xdb10('0x47')](_0x4d2d4f)[_0xdb10('0x27')](handleEntityNotFound(_0x19996d,null))[_0xdb10('0x27')](respondWithResult(_0x19996d,null))[_0xdb10('0x44')](handleError(_0x19996d,null));};exports[_0xdb10('0x48')]=function(_0xe83e07,_0x4553c4){return db['CmCompany'][_0xdb10('0x48')](_0xe83e07[_0xdb10('0x49')],{})[_0xdb10('0x27')](function(_0x54ae80){var _0x2c0d47=_0xe83e07[_0xdb10('0x4a')][_0xdb10('0x28')]({'plain':!![]});if(!_0x2c0d47)throw new Error(_0xdb10('0x4b'));if(_0x2c0d47[_0xdb10('0x4c')]==='user'){var _0x168148=_0x54ae80[_0xdb10('0x28')]({'plain':!![]});var _0x497a18=_0xdb10('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x497a18,'userProfileId':_0x2c0d47[_0xdb10('0x4d')]},'raw':!![]})['then'](function(_0x1eaafd){if(_0x1eaafd&&_0x1eaafd['autoAssociation']===0x0){return db[_0xdb10('0x2a')]['create']({'name':_0x168148['name'],'resourceId':_0x168148['id'],'type':_0x1eaafd[_0xdb10('0x2d')],'sectionId':_0x1eaafd['id']},{})['then'](function(){return _0x54ae80;});}else{return _0x54ae80;}})[_0xdb10('0x44')](function(_0x298687){logger[_0xdb10('0x2b')](_0xdb10('0x4e'),_0x298687);throw _0x298687;});}return _0x54ae80;})[_0xdb10('0x27')](respondWithResult(_0x4553c4,0xc9))[_0xdb10('0x44')](handleError(_0x4553c4,null));};exports['update']=function(_0x422424,_0x180e93){if(_0x422424[_0xdb10('0x49')]['id']){delete _0x422424[_0xdb10('0x49')]['id'];}return db['CmCompany'][_0xdb10('0x47')]({'where':{'id':_0x422424[_0xdb10('0x46')]['id']}})['then'](handleEntityNotFound(_0x180e93,null))['then'](saveUpdates(_0x422424[_0xdb10('0x49')],null))[_0xdb10('0x27')](respondWithResult(_0x180e93,null))['catch'](handleError(_0x180e93,null));};exports['destroy']=function(_0x5f30d1,_0x1a3f35){return db['CmCompany'][_0xdb10('0x47')]({'where':{'id':_0x5f30d1[_0xdb10('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a3f35,null))[_0xdb10('0x27')](removeEntity(_0x1a3f35,null))[_0xdb10('0x44')](handleError(_0x1a3f35,null));};exports['describe']=function(_0x226bf7,_0xf03bb0){return db[_0xdb10('0x30')][_0xdb10('0x31')]()[_0xdb10('0x27')](respondWithResult(_0xf03bb0,null))[_0xdb10('0x44')](handleError(_0xf03bb0,null));};exports[_0xdb10('0x4f')]=function(_0x55e66f,_0x7df24f,_0x454c29){return db['CmContact']['find']({'where':{'id':_0x55e66f[_0xdb10('0x46')]['id']}})[_0xdb10('0x27')](handleEntityNotFound(_0x7df24f,null))[_0xdb10('0x27')](function(_0x40a7f1){if(_0x40a7f1){return _0x40a7f1[_0xdb10('0x4f')](_0x55e66f[_0xdb10('0x49')][_0xdb10('0x50')],_[_0xdb10('0x51')](_0x55e66f[_0xdb10('0x49')],[_0xdb10('0x50'),'id'])||{});}})['then'](respondWithResult(_0x7df24f,null))[_0xdb10('0x44')](handleError(_0x7df24f,null));};exports[_0xdb10('0x52')]=function(_0xf2e7e3,_0x3a9825,_0x311812){var _0x309cea={};var _0x398685={};var _0x3bff88;var _0x9a22a5;return db[_0xdb10('0x30')][_0xdb10('0x53')]({'where':{'id':_0xf2e7e3['params']['id']}})[_0xdb10('0x27')](handleEntityNotFound(_0x3a9825,null))['then'](function(_0x5390bc){if(_0x5390bc){_0x3bff88=_0x5390bc;_0x398685['model']=_[_0xdb10('0x33')](db[_0xdb10('0x54')]['rawAttributes']);_0x398685[_0xdb10('0x34')]=_[_0xdb10('0x33')](_0xf2e7e3[_0xdb10('0x34')]);_0x398685[_0xdb10('0x3e')]=_[_0xdb10('0x35')](_0x398685[_0xdb10('0x32')],_0x398685[_0xdb10('0x34')]);_0x309cea[_0xdb10('0x37')]=_[_0xdb10('0x35')](_0x398685[_0xdb10('0x32')],qs[_0xdb10('0x36')](_0xf2e7e3[_0xdb10('0x34')]['fields']));_0x309cea['attributes']=_0x309cea[_0xdb10('0x37')][_0xdb10('0x38')]?_0x309cea[_0xdb10('0x37')]:_0x398685[_0xdb10('0x32')];_0x309cea[_0xdb10('0x3b')]=qs[_0xdb10('0x3c')](_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x3c')]);_0x309cea[_0xdb10('0x3d')]=qs['filters'](_[_0xdb10('0x55')](_0xf2e7e3[_0xdb10('0x34')],_0x398685[_0xdb10('0x3e')]));if(_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x56')]){_0x309cea[_0xdb10('0x3d')]=_[_0xdb10('0x3f')](_0x309cea[_0xdb10('0x3d')],{'$or':_[_0xdb10('0x57')](_0x309cea['attributes'],function(_0x9d0161){var _0x59e5f2={};_0x59e5f2[_0x9d0161]={'$like':'%'+_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x56')]+'%'};return _0x59e5f2;})});}_0x309cea=_[_0xdb10('0x3f')]({},_0x309cea,_0xf2e7e3[_0xdb10('0x40')]);return _0x3bff88[_0xdb10('0x52')](_0x309cea);}})['then'](function(_0x58d648){if(_0x58d648){_0x9a22a5=_0x58d648[_0xdb10('0x38')];if(!_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x39')](_0xdb10('0x3a'))){_0x309cea['limit']=qs[_0xdb10('0x1d')](_0xf2e7e3[_0xdb10('0x34')]['limit']);_0x309cea[_0xdb10('0x1f')]=qs[_0xdb10('0x1f')](_0xf2e7e3[_0xdb10('0x34')][_0xdb10('0x1f')]);}return _0x3bff88['getContacts'](_0x309cea);}})[_0xdb10('0x27')](function(_0x45e689){if(_0x45e689){return _0x45e689?{'count':_0x9a22a5,'rows':_0x45e689}:null;}})[_0xdb10('0x27')](respondWithResult(_0x3a9825,null))[_0xdb10('0x44')](handleError(_0x3a9825,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 9fdc1c5..cb81716 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 _0xce7d=['path','../../config/environment','./cmCompany.attributes','exports','CmCompany','lodash','util','api','moment','bluebird','request-promise'];(function(_0x26acab,_0x515330){var _0x37c197=function(_0x42ad4f){while(--_0x42ad4f){_0x26acab['push'](_0x26acab['shift']());}};_0x37c197(++_0x515330);}(_0xce7d,0xaa));var _0xdce7=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xce7d[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xdce7('0x0'));var util=require(_0xdce7('0x1'));var logger=require('../../config/logger')(_0xdce7('0x2'));var moment=require(_0xdce7('0x3'));var BPromise=require(_0xdce7('0x4'));var rp=require(_0xdce7('0x5'));var fs=require('fs');var path=require(_0xdce7('0x6'));var rimraf=require('rimraf');var config=require(_0xdce7('0x7'));var attributes=require(_0xdce7('0x8'));module[_0xdce7('0x9')]=function(_0x125ed2,_0x2d788f){return _0x125ed2['define'](_0xdce7('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3446=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x26c11f,_0x196f33){var _0x4ca44b=function(_0x215c31){while(--_0x215c31){_0x26c11f['push'](_0x26c11f['shift']());}};_0x4ca44b(++_0x196f33);}(_0x3446,0x152));var _0x6344=function(_0x2a98fa,_0x3ce464){_0x2a98fa=_0x2a98fa-0x0;var _0x92da7f=_0x3446[_0x2a98fa];return _0x92da7f;};'use strict';var _=require(_0x6344('0x0'));var util=require(_0x6344('0x1'));var logger=require(_0x6344('0x2'))(_0x6344('0x3'));var moment=require(_0x6344('0x4'));var BPromise=require(_0x6344('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6344('0x6'));var rimraf=require(_0x6344('0x7'));var config=require(_0x6344('0x8'));var attributes=require('./cmCompany.attributes');module[_0x6344('0x9')]=function(_0x5a70ba,_0x135c16){return _0x5a70ba['define'](_0x6344('0xa'),attributes,{'tableName':_0x6344('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 339e635..3d87399 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 _0xaaf0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1007b3,_0x344f7f){var _0x7cf215=function(_0x5e25a0){while(--_0x5e25a0){_0x1007b3['push'](_0x1007b3['shift']());}};_0x7cf215(++_0x344f7f);}(_0xaaf0,0x15a));var _0x0aaf=function(_0x68d16a,_0x24d5af){_0x68d16a=_0x68d16a-0x0;var _0x5d2ad5=_0xaaf0[_0x68d16a];return _0x5d2ad5;};'use strict';var _=require(_0x0aaf('0x0'));var util=require('util');var moment=require(_0x0aaf('0x1'));var BPromise=require(_0x0aaf('0x2'));var rs=require(_0x0aaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0aaf('0x4'))['db'];var utils=require(_0x0aaf('0x5'));var logger=require(_0x0aaf('0x6'))(_0x0aaf('0x7'));var config=require(_0x0aaf('0x8'));var jayson=require(_0x0aaf('0x9'));var client=jayson[_0x0aaf('0xa')][_0x0aaf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e7c94,_0x3f1fdf,_0x4c2bde){return new BPromise(function(_0x4f4f6b,_0x496f5e){return client['request'](_0x1e7c94,_0x4c2bde)[_0x0aaf('0xc')](function(_0x3b1155){logger[_0x0aaf('0xd')](_0x0aaf('0xe'),_0x3f1fdf,_0x0aaf('0xf'));logger[_0x0aaf('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3f1fdf,'request\x20sent',JSON[_0x0aaf('0x11')](_0x3b1155));if(_0x3b1155[_0x0aaf('0x12')]){if(_0x3b1155[_0x0aaf('0x12')][_0x0aaf('0x13')]===0x1f4){logger[_0x0aaf('0x12')](_0x0aaf('0xe'),_0x3f1fdf,_0x3b1155['error'][_0x0aaf('0x14')]);return _0x496f5e(_0x3b1155[_0x0aaf('0x12')][_0x0aaf('0x14')]);}logger[_0x0aaf('0x12')](_0x0aaf('0xe'),_0x3f1fdf,_0x3b1155[_0x0aaf('0x12')][_0x0aaf('0x14')]);return _0x4f4f6b(_0x3b1155[_0x0aaf('0x12')][_0x0aaf('0x14')]);}else{logger[_0x0aaf('0xd')](_0x0aaf('0xe'),_0x3f1fdf,_0x0aaf('0xf'));_0x4f4f6b(_0x3b1155[_0x0aaf('0x15')][_0x0aaf('0x14')]);}})['catch'](function(_0x359b3e){logger['error'](_0x0aaf('0xe'),_0x3f1fdf,_0x359b3e);_0x496f5e(_0x359b3e);});});}
\ No newline at end of file
+var _0x4166=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x4166,0x82));var _0x6416=function(_0x2cad67,_0x30a165){_0x2cad67=_0x2cad67-0x0;var _0x557943=_0x4166[_0x2cad67];return _0x557943;};'use strict';var _=require(_0x6416('0x0'));var util=require('util');var moment=require(_0x6416('0x1'));var BPromise=require(_0x6416('0x2'));var rs=require(_0x6416('0x3'));var fs=require('fs');var Redis=require(_0x6416('0x4'));var db=require(_0x6416('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6416('0x6'))(_0x6416('0x7'));var config=require(_0x6416('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6416('0x9')][_0x6416('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a683,_0x5169ea,_0x180660){return new BPromise(function(_0x2e68ef,_0x99a990){return client[_0x6416('0xb')](_0x54a683,_0x180660)[_0x6416('0xc')](function(_0x2e72a3){logger[_0x6416('0xd')](_0x6416('0xe'),_0x5169ea,_0x6416('0xf'));logger['debug'](_0x6416('0x10'),_0x5169ea,_0x6416('0xf'),JSON['stringify'](_0x2e72a3));if(_0x2e72a3[_0x6416('0x11')]){if(_0x2e72a3['error']['code']===0x1f4){logger[_0x6416('0x11')](_0x6416('0xe'),_0x5169ea,_0x2e72a3[_0x6416('0x11')]['message']);return _0x99a990(_0x2e72a3[_0x6416('0x11')]['message']);}logger[_0x6416('0x11')](_0x6416('0xe'),_0x5169ea,_0x2e72a3[_0x6416('0x11')][_0x6416('0x12')]);return _0x2e68ef(_0x2e72a3[_0x6416('0x11')][_0x6416('0x12')]);}else{logger[_0x6416('0xd')](_0x6416('0xe'),_0x5169ea,_0x6416('0xf'));_0x2e68ef(_0x2e72a3['result'][_0x6416('0x12')]);}})[_0x6416('0x13')](function(_0x382a0d){logger[_0x6416('0x11')]('CmCompany,\x20%s,\x20%s',_0x5169ea,_0x382a0d);_0x99a990(_0x382a0d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 3e9dea6..d966745 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 _0x0858=['../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','update','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x42a08d,_0x135393){var _0x4418a0=function(_0x3d49c3){while(--_0x3d49c3){_0x42a08d['push'](_0x42a08d['shift']());}};_0x4418a0(++_0x135393);}(_0x0858,0x1f3));var _0x8085=function(_0x30e2ac,_0x569e21){_0x30e2ac=_0x30e2ac-0x0;var _0x4eaac5=_0x0858[_0x30e2ac];return _0x4eaac5;};'use strict';var multer=require('multer');var util=require(_0x8085('0x0'));var path=require('path');var timeout=require(_0x8085('0x1'));var express=require(_0x8085('0x2'));var router=express[_0x8085('0x3')]();var fs_extra=require(_0x8085('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8085('0x5'));var config=require(_0x8085('0x6'));var controller=require(_0x8085('0x7'));router['get']('/',auth[_0x8085('0x8')](),controller[_0x8085('0x9')]);router['get'](_0x8085('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8085('0xb')](_0x8085('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8085('0xd'),auth[_0x8085('0x8')](),controller[_0x8085('0xe')]);router[_0x8085('0xf')]('/',auth[_0x8085('0x8')](),controller[_0x8085('0x10')]);router[_0x8085('0xf')](_0x8085('0xd'),auth['isAuthenticated'](),controller[_0x8085('0x11')]);router['put'](_0x8085('0xc'),auth[_0x8085('0x8')](),controller[_0x8085('0x12')]);router['delete']('/:id',auth[_0x8085('0x8')](),controller[_0x8085('0x13')]);module[_0x8085('0x14')]=router;
\ No newline at end of file
+var _0xa551=['isAuthenticated','describe','show','/:id/contacts','post','addContacts','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa551,0x16a));var _0x1a55=function(_0x308b8e,_0x3de00c){_0x308b8e=_0x308b8e-0x0;var _0x308324=_0xa551[_0x308b8e];return _0x308324;};'use strict';var multer=require(_0x1a55('0x0'));var util=require(_0x1a55('0x1'));var path=require('path');var timeout=require(_0x1a55('0x2'));var express=require(_0x1a55('0x3'));var router=express[_0x1a55('0x4')]();var fs_extra=require(_0x1a55('0x5'));var auth=require(_0x1a55('0x6'));var interaction=require(_0x1a55('0x7'));var config=require(_0x1a55('0x8'));var controller=require(_0x1a55('0x9'));router[_0x1a55('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a55('0xa')](_0x1a55('0xb'),auth[_0x1a55('0xc')](),controller[_0x1a55('0xd')]);router[_0x1a55('0xa')]('/:id',auth[_0x1a55('0xc')](),controller[_0x1a55('0xe')]);router[_0x1a55('0xa')](_0x1a55('0xf'),auth[_0x1a55('0xc')](),controller['getContacts']);router[_0x1a55('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1a55('0xf'),auth['isAuthenticated'](),controller[_0x1a55('0x11')]);router[_0x1a55('0x12')](_0x1a55('0x13'),auth[_0x1a55('0xc')](),controller['update']);router['delete'](_0x1a55('0x13'),auth['isAuthenticated'](),controller[_0x1a55('0x14')]);module[_0x1a55('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 61ee788..bae8f72 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 _0xb862=['sequelize','exports','STRING','TEXT','INTEGER','NOW','lodash'];(function(_0x19df44,_0x547d23){var _0x4ab54e=function(_0x3d4d21){while(--_0x3d4d21){_0x19df44['push'](_0x19df44['shift']());}};_0x4ab54e(++_0x547d23);}(_0xb862,0xb5));var _0x2b86=function(_0xdf4f84,_0x537715){_0xdf4f84=_0xdf4f84-0x0;var _0x23e1f4=_0xb862[_0xdf4f84];return _0x23e1f4;};'use strict';var _=require(_0x2b86('0x0'));var Sequelize=require(_0x2b86('0x1'));module[_0x2b86('0x2')]={'firstName':{'type':Sequelize[_0x2b86('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2b86('0x3')]},'street':{'type':Sequelize[_0x2b86('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2b86('0x3')]},'country':{'type':Sequelize[_0x2b86('0x3')]},'dateOfBirth':{'type':Sequelize[_0x2b86('0x3')]},'description':{'type':Sequelize[_0x2b86('0x4')]},'phone':{'type':Sequelize[_0x2b86('0x3')]},'mobile':{'type':Sequelize[_0x2b86('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2b86('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x2b86('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x2b86('0x3')]},'teams':{'type':Sequelize[_0x2b86('0x3')]},'viber':{'type':Sequelize[_0x2b86('0x3')]},'line':{'type':Sequelize[_0x2b86('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x2b86('0x3')]},'UserId':{'type':Sequelize[_0x2b86('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x2b86('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2b86('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2b86('0x5')]}};
\ No newline at end of file
+var _0x54da=['UNSIGNED','NOW','INTEGER','sequelize','exports','STRING','TEXT'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x54da,0x106));var _0xa54d=function(_0x5699e7,_0xb9ca23){_0x5699e7=_0x5699e7-0x0;var _0x1e8559=_0x54da[_0x5699e7];return _0x1e8559;};'use strict';var _=require('lodash');var Sequelize=require(_0xa54d('0x0'));module[_0xa54d('0x1')]={'firstName':{'type':Sequelize[_0xa54d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa54d('0x2')]},'street':{'type':Sequelize[_0xa54d('0x2')]},'postalCode':{'type':Sequelize[_0xa54d('0x2')]},'city':{'type':Sequelize[_0xa54d('0x2')]},'country':{'type':Sequelize[_0xa54d('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa54d('0x2')]},'description':{'type':Sequelize[_0xa54d('0x3')]},'phone':{'type':Sequelize[_0xa54d('0x2')]},'mobile':{'type':Sequelize[_0xa54d('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa54d('0x2')]},'url':{'type':Sequelize[_0xa54d('0x2')]},'facebook':{'type':Sequelize[_0xa54d('0x2')]},'fb_data':{'type':Sequelize[_0xa54d('0x2')]},'twitter':{'type':Sequelize[_0xa54d('0x2')]},'skype':{'type':Sequelize[_0xa54d('0x2')]},'teams':{'type':Sequelize[_0xa54d('0x2')]},'viber':{'type':Sequelize[_0xa54d('0x2')]},'line':{'type':Sequelize[_0xa54d('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa54d('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa54d('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xa54d('0x5')]},'dialTimezone':{'type':Sequelize[_0xa54d('0x2')]},'utcOffset':{'type':Sequelize[_0xa54d('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f239c51..f145c5e 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 _0x1c1d=['findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','browserName','customerIp','deviceModel','ratingMessage','ratingValue','substatus','Interaction','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','squel','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','getOptions','findAll','query','user','catch','describe','CmContact','tags','keys','length','startsWith','cf_','columnName','CmCustomField','displayName','alias','values','info','forEach','hasOwnProperty','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','duplicates','where','$or','push','findOrCreate','spread','contact','show','params','color','tag','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','ListId','omit','map','cf_%d','find','$and','pickBy','format','isEmpty','setFields','id\x20=\x20?','toParam','phone','findOne','model','Tag','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','options','getTags','setTags','ids','setAdditionalPhones','all','OrderBy','item_types','items','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','nolimit','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','parse','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','stringify','message','pid','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','openchannel','whatsapp','-createdAt','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC'];(function(_0x2bb803,_0x1aa3fd){var _0x50a5ee=function(_0x4ca0e0){while(--_0x4ca0e0){_0x2bb803['push'](_0x2bb803['shift']());}};_0x50a5ee(++_0x1aa3fd);}(_0x1c1d,0x112));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd1c1('0x0'));var BPromise=require(_0xd1c1('0x1'));var util=require(_0xd1c1('0x2'));var path=require(_0xd1c1('0x3'));var fs=require('fs');var _=require(_0xd1c1('0x4'));var squel=require(_0xd1c1('0x5'));var Papa=require(_0xd1c1('0x6'));var Redis=require('ioredis');var contacts=require('../../components/contacts');var qs=require(_0xd1c1('0x7'));var logger=require(_0xd1c1('0x8'))(_0xd1c1('0x9'));var config=require(_0xd1c1('0xa'));var shared=require(_0xd1c1('0xb'));var db=require(_0xd1c1('0xc'))['db'];config[_0xd1c1('0xd')]=_[_0xd1c1('0xe')](config[_0xd1c1('0xd')],{'host':_0xd1c1('0xf'),'port':0x18eb});var socket=require(_0xd1c1('0x10'))(new Redis(config[_0xd1c1('0xd')]));require('./cmContact.socket')[_0xd1c1('0x11')](socket);function respondWithResult(_0x2f5839,_0x3a5cb3){_0x3a5cb3=_0x3a5cb3||0xc8;return function(_0x46c965){if(_0x46c965){return _0x2f5839[_0xd1c1('0x12')](_0x3a5cb3)[_0xd1c1('0x13')](_0x46c965);}};}function respondWithFilteredResult(_0x2395f1,_0xcf8b45){return function(_0x471369){if(_0x471369){var _0x48b29d=typeof _0xcf8b45[_0xd1c1('0x14')]===_0xd1c1('0x15')&&typeof _0xcf8b45['limit']===_0xd1c1('0x15');var _0x435e85=_0x471369[_0xd1c1('0x16')];var _0x5cbaa3=_0x48b29d?0x0:_0xcf8b45[_0xd1c1('0x14')];var _0xe25407=_0x48b29d?_0x471369[_0xd1c1('0x16')]:_0xcf8b45[_0xd1c1('0x14')]+_0xcf8b45[_0xd1c1('0x17')];var _0x3badc5;if(_0xe25407>=_0x435e85){_0xe25407=_0x435e85;_0x3badc5=0xc8;}else{_0x3badc5=0xce;}_0x2395f1[_0xd1c1('0x12')](_0x3badc5);return _0x2395f1[_0xd1c1('0x18')](_0xd1c1('0x19'),_0x5cbaa3+'-'+_0xe25407+'/'+_0x435e85)[_0xd1c1('0x13')](_0x471369);}return null;};}function saveUpdates(_0x5323f4){return function(_0x153db9){if(_0x153db9){return _0x153db9[_0xd1c1('0x1a')](_0x5323f4)[_0xd1c1('0x1b')](function(_0x21f114){return _0x21f114;});}return null;};}function removeEntity(_0x23b51a){return function(_0x182478){if(_0x182478){return _0x182478[_0xd1c1('0x1c')]()[_0xd1c1('0x1b')](function(){_0x23b51a[_0xd1c1('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a6eb9){return function(_0x2dcbf3){if(!_0x2dcbf3){_0x3a6eb9[_0xd1c1('0x1d')](0x194);}return _0x2dcbf3;};}function handleError(_0x552ecc,_0x376a76){_0x376a76=_0x376a76||0x1f4;return function(_0x583e7b){logger[_0xd1c1('0x1e')](_0x583e7b[_0xd1c1('0x1f')]);if(_0x583e7b[_0xd1c1('0x20')]){delete _0x583e7b['name'];}_0x552ecc[_0xd1c1('0x12')](_0x376a76)[_0xd1c1('0x21')](_0x583e7b);};}exports[_0xd1c1('0x22')]=function(_0x257e82,_0x569d2e){var _0x5864a5={};return contacts['describe']()[_0xd1c1('0x1b')](function(_0x4fc2c7){_0x5864a5=qs[_0xd1c1('0x23')](_0x4fc2c7,_0x257e82);return contacts[_0xd1c1('0x24')](_0x257e82[_0xd1c1('0x25')],_0x257e82[_0xd1c1('0x26')],_0x5864a5,_0x4fc2c7);})[_0xd1c1('0x1b')](respondWithFilteredResult(_0x569d2e,_0x5864a5))['catch'](handleError(_0x569d2e,null));};exports['destroy']=function(_0x29b39b,_0x2d98ae){return db['CmContact']['find']({'where':{'id':_0x29b39b['params']['id']}})[_0xd1c1('0x1b')](handleEntityNotFound(_0x2d98ae,null))[_0xd1c1('0x1b')](removeEntity(_0x2d98ae,null))[_0xd1c1('0x27')](handleError(_0x2d98ae,null));};exports[_0xd1c1('0x28')]=function(_0x4a32cd,_0x2897ee){return db[_0xd1c1('0x29')][_0xd1c1('0x28')]()[_0xd1c1('0x1b')](function(_0x18c327){delete _0x18c327[_0xd1c1('0x2a')];for(var _0x46ba25=0x0;_0x46ba25
','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','name','substring','indexOf','split','slice'];(function(_0x56b0d9,_0x5e2285){var _0x45f280=function(_0x5a178f){while(--_0x5a178f){_0x56b0d9['push'](_0x56b0d9['shift']());}};_0x45f280(++_0x5e2285);}(_0x3bfc,0x11b));var _0xc3bf=function(_0x29d87d,_0x23dc31){_0x29d87d=_0x29d87d-0x0;var _0x1fd84b=_0x3bfc[_0x29d87d];return _0x1fd84b;};'use strict';var _=require(_0xc3bf('0x0'));var moment=require(_0xc3bf('0x1'));var random=require(_0xc3bf('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xc3bf('0x3'));var tnef=require(_0xc3bf('0x4'));var logger=require(_0xc3bf('0x5'))(_0xc3bf('0x6'));var config=require('../../../config/environment');function getAddress(_0x14d3ce){var _0x5cc248=_[_0xc3bf('0x7')](_0x14d3ce[_0xc3bf('0x8')]);return _0x5cc248&&_0x5cc248[_0xc3bf('0x9')]?_0x5cc248[_0xc3bf('0x9')]:_0xc3bf('0xa')+random[_0xc3bf('0xb')](0x6)+'@xcally.com';}function getFirstName(_0xe4d0d5){var _0x38c43b=_[_0xc3bf('0x7')](_0xe4d0d5['value']);if(_0x38c43b&&_0x38c43b['name']){if(_0x38c43b['name']==_0x38c43b[_0xc3bf('0x9')]){return _0x38c43b[_0xc3bf('0xc')][_0xc3bf('0xd')](0x0,_0x38c43b[_0xc3bf('0xc')][_0xc3bf('0xe')]('@'));}var _0x4ef03c=_0x38c43b[_0xc3bf('0xc')][_0xc3bf('0xf')](/\s+/);return _0x4ef03c['length']>0x1?_0x4ef03c[_0xc3bf('0x10')](0x0,-0x1)[_0xc3bf('0x11')]('\x20'):_0x38c43b[_0xc3bf('0xc')];}return _0xc3bf('0x12');}function getLastName(_0x51129c){var _0x1729ff=_[_0xc3bf('0x7')](_0x51129c[_0xc3bf('0x8')]);if(_0x1729ff&&_0x1729ff[_0xc3bf('0xc')]){var _0x57dd01=_0x1729ff[_0xc3bf('0xc')][_0xc3bf('0xf')](/\s+/);return _0x57dd01['length']>0x1?_0x57dd01[_0xc3bf('0x13')]():'';}return'';}function getMails(_0x39ce26,_0x27ab77){var _0x45f4ff='';for(var _0x52dfca=0x0;_0x52dfca<_0x27ab77[_0xc3bf('0x8')]['length'];_0x52dfca+=0x1){if(_0x27ab77[_0xc3bf('0x8')][_0x52dfca][_0xc3bf('0x9')]!==_0x39ce26){if(!_[_0xc3bf('0x14')](_0x45f4ff)){_0x45f4ff+=',';}_0x45f4ff+=_0x27ab77[_0xc3bf('0x8')][_0x52dfca][_0xc3bf('0xc')]||_0x27ab77[_0xc3bf('0x8')][_0x52dfca][_0xc3bf('0x9')]||'';_0x45f4ff+='\x20<';_0x45f4ff+=_0x27ab77['value'][_0x52dfca][_0xc3bf('0x9')]?_0x27ab77[_0xc3bf('0x8')][_0x52dfca][_0xc3bf('0x9')]:_0xc3bf('0xa')+random['generate'](0x6)+_0xc3bf('0x15');_0x45f4ff+='>';}}return _0x45f4ff;}function parseEmail(_0x15bcd5,_0x1d6cea,_0x8e02ba){if(_0x1d6cea['html']){var _0x34d930=/