From: support
Date: Tue, 28 Mar 2023 13:29:59 +0000 (+0000)
Subject: Built motion from commit b0a9a629.|2.6.33
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg//%22%7B%7Blicense.messaging?a=commitdiff_plain;h=72814dbb99dc836e6a11f525907d63de1e5bc00c;p=motion2.git
Built motion from commit b0a9a629.|2.6.33
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 0bc805a..c51dbca 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-28T12:37:06.275Z",
+ "time": "2023-03-28T13:14:05.745Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 32cd1af..f13eb83 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-28T12:37:06.275Z",
+ "time": "2023-03-28T13:14:05.745Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 040ae72..343a4d7 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 _0x575d=['contactManager','integration','motionbar','urlForward','browser','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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING'];(function(_0x330061,_0x12ccdc){var _0x4f1366=function(_0x4b468d){while(--_0x4b468d){_0x330061['push'](_0x330061['shift']());}};_0x4f1366(++_0x12ccdc);}(_0x575d,0x1de));var _0xd575=function(_0xe12d49,_0x22264b){_0xe12d49=_0xe12d49-0x0;var _0x3050fd=_0x575d[_0xe12d49];return _0x3050fd;};'use strict';var Sequelize=require(_0xd575('0x0'));module[_0xd575('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b1c82){return this[_0xd575('0x2')](_0xd575('0x3'));}},'action':{'type':Sequelize[_0xd575('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd575('0x5'),_0xd575('0x6'),_0xd575('0x7'),'jscripty',_0xd575('0x8'),_0xd575('0x9'),_0xd575('0xa'),_0xd575('0xb')]],'msg':_0xd575('0xc')}},'comment':_0xd575('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xd575('0xd')},'data2':{'type':Sequelize[_0xd575('0x4')](0x1000),'comment':_0xd575('0xe')},'data3':{'type':Sequelize[_0xd575('0x4')](0x1000),'comment':_0xd575('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xd575('0x10')},'data5':{'type':Sequelize[_0xd575('0x4')](0x1000),'comments':_0xd575('0x11')},'data6':{'type':Sequelize[_0xd575('0x4')],'comments':_0xd575('0x12')},'data7':{'type':Sequelize[_0xd575('0x13')],'comments':_0xd575('0x14')}};
\ No newline at end of file
+var _0x884a=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x1d4e6e,_0x19f830){var _0x4a135e=function(_0xac770b){while(--_0xac770b){_0x1d4e6e['push'](_0x1d4e6e['shift']());}};_0x4a135e(++_0x19f830);}(_0x884a,0x1f2));var _0xa884=function(_0xb5a4a0,_0x3f8ffa){_0xb5a4a0=_0xb5a4a0-0x0;var _0x1b9ea6=_0x884a[_0xb5a4a0];return _0x1b9ea6;};'use strict';var Sequelize=require(_0xa884('0x0'));module[_0xa884('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1d5caa){return this['getDataValue'](_0xa884('0x2'));}},'action':{'type':Sequelize[_0xa884('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa884('0x4'),_0xa884('0x5'),_0xa884('0x6'),_0xa884('0x7'),_0xa884('0x8'),_0xa884('0x9'),_0xa884('0xa'),_0xa884('0xb')]],'msg':_0xa884('0xc')}},'comment':_0xa884('0xc')},'data1':{'type':Sequelize[_0xa884('0x3')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xa884('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xa884('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xa884('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xa884('0x10')},'data6':{'type':Sequelize[_0xa884('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xa884('0x11')],'comments':_0xa884('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2eb7202..c5d3bbb 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 _0xc1d8=['then','end','error','stack','name','send','body','find','params','Action','catch','zip-dir','fast-json-patch','moment','bluebird','sox','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x5b166e,_0xb1c1cd){var _0x2805b1=function(_0x34f8d8){while(--_0x34f8d8){_0x5b166e['push'](_0x5b166e['shift']());}};_0x2805b1(++_0xb1c1cd);}(_0xc1d8,0x123));var _0x8c1d=function(_0x1c4c47,_0x3d92c3){_0x1c4c47=_0x1c4c47-0x0;var _0x37ff58=_0xc1d8[_0x1c4c47];return _0x37ff58;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c1d('0x0'));var jsonpatch=require(_0x8c1d('0x1'));var rp=require('request-promise');var moment=require(_0x8c1d('0x2'));var BPromise=require(_0x8c1d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8c1d('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c1d('0x5'));var _=require(_0x8c1d('0x6'));var squel=require('squel');var crypto=require(_0x8c1d('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x8c1d('0x8'));var toCsv=require('to-csv');var querystring=require(_0x8c1d('0x9'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8c1d('0xa'));var qs=require(_0x8c1d('0xb'));var as=require(_0x8c1d('0xc'));var hardwareService=require(_0x8c1d('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0x8c1d('0xe'));var config=require(_0x8c1d('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c1d('0x10'))['db'];function respondWithStatusCode(_0x2bab51,_0x58bb21){_0x58bb21=_0x58bb21||0xcc;return function(_0x990339){if(_0x990339){return _0x2bab51[_0x8c1d('0x11')](_0x58bb21);}return _0x2bab51[_0x8c1d('0x12')](_0x58bb21)['end']();};}function respondWithResult(_0x413162,_0x2809b1){_0x2809b1=_0x2809b1||0xc8;return function(_0x3bdd9d){if(_0x3bdd9d){return _0x413162[_0x8c1d('0x12')](_0x2809b1)[_0x8c1d('0x13')](_0x3bdd9d);}};}function respondWithFilteredResult(_0x148bd9,_0xdb9820){return function(_0x189fed){if(_0x189fed){var _0x3fb293=typeof _0xdb9820[_0x8c1d('0x14')]===_0x8c1d('0x15')&&typeof _0xdb9820[_0x8c1d('0x16')]==='undefined';var _0x538ec2=_0x189fed[_0x8c1d('0x17')];var _0x249c17=_0x3fb293?0x0:_0xdb9820[_0x8c1d('0x14')];var _0x19610b=_0x3fb293?_0x189fed[_0x8c1d('0x17')]:_0xdb9820[_0x8c1d('0x14')]+_0xdb9820['limit'];var _0x430bf5;if(_0x19610b>=_0x538ec2){_0x19610b=_0x538ec2;_0x430bf5=0xc8;}else{_0x430bf5=0xce;}_0x148bd9[_0x8c1d('0x12')](_0x430bf5);return _0x148bd9[_0x8c1d('0x18')](_0x8c1d('0x19'),_0x249c17+'-'+_0x19610b+'/'+_0x538ec2)['json'](_0x189fed);}return null;};}function patchUpdates(_0x4b1336){return function(_0x348ff9){try{jsonpatch['apply'](_0x348ff9,_0x4b1336,!![]);}catch(_0x52714a){return BPromise[_0x8c1d('0x1a')](_0x52714a);}return _0x348ff9[_0x8c1d('0x1b')]();};}function saveUpdates(_0x3f3bb0,_0x5ad75e){return function(_0x1d644c){if(_0x1d644c){return _0x1d644c[_0x8c1d('0x1c')](_0x3f3bb0)[_0x8c1d('0x1d')](function(_0x524210){return _0x524210;});}return null;};}function removeEntity(_0x315be4,_0x457e93){return function(_0x123ceb){if(_0x123ceb){return _0x123ceb['destroy']()[_0x8c1d('0x1d')](function(){_0x315be4['status'](0xcc)[_0x8c1d('0x1e')]();});}};}function handleEntityNotFound(_0x4a2f32,_0x46077b){return function(_0x133905){if(!_0x133905){_0x4a2f32['sendStatus'](0x194);}return _0x133905;};}function handleError(_0x609e9c,_0x2d09ba){_0x2d09ba=_0x2d09ba||0x1f4;return function(_0xe4b5fd){logger[_0x8c1d('0x1f')](_0xe4b5fd[_0x8c1d('0x20')]);if(_0xe4b5fd['name']){delete _0xe4b5fd[_0x8c1d('0x21')];}_0x609e9c[_0x8c1d('0x12')](_0x2d09ba)[_0x8c1d('0x22')](_0xe4b5fd);};}exports['update']=function(_0x2b192c,_0x50a9f8){if(_0x2b192c[_0x8c1d('0x23')]['id']){delete _0x2b192c[_0x8c1d('0x23')]['id'];}return db['Action'][_0x8c1d('0x24')]({'where':{'id':_0x2b192c[_0x8c1d('0x25')]['id']}})[_0x8c1d('0x1d')](handleEntityNotFound(_0x50a9f8,null))[_0x8c1d('0x1d')](saveUpdates(_0x2b192c[_0x8c1d('0x23')],null))[_0x8c1d('0x1d')](respondWithResult(_0x50a9f8,null))['catch'](handleError(_0x50a9f8,null));};exports['destroy']=function(_0x1d2253,_0x503463){return db[_0x8c1d('0x26')][_0x8c1d('0x24')]({'where':{'id':_0x1d2253[_0x8c1d('0x25')]['id']}})[_0x8c1d('0x1d')](handleEntityNotFound(_0x503463,null))[_0x8c1d('0x1d')](removeEntity(_0x503463,null))[_0x8c1d('0x27')](handleError(_0x503463,null));};
\ No newline at end of file
+var _0xad07=['status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','name','send','update','body','Action','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad07,0x6a));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7ad0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7ad0('0x1'));var jsonpatch=require(_0x7ad0('0x2'));var rp=require(_0x7ad0('0x3'));var moment=require(_0x7ad0('0x4'));var BPromise=require(_0x7ad0('0x5'));var Mustache=require(_0x7ad0('0x6'));var util=require(_0x7ad0('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7ad0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ad0('0x9'));var deskjs=require(_0x7ad0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x7ad0('0xb'));var Papa=require(_0x7ad0('0xc'));var Redis=require(_0x7ad0('0xd'));var authService=require(_0x7ad0('0xe'));var qs=require(_0x7ad0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ad0('0x10'));var logger=require(_0x7ad0('0x11'))(_0x7ad0('0x12'));var utils=require(_0x7ad0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7ad0('0x14'));var db=require(_0x7ad0('0x15'))['db'];function respondWithStatusCode(_0x2e0747,_0x1bfc51){_0x1bfc51=_0x1bfc51||0xcc;return function(_0x150d34){if(_0x150d34){return _0x2e0747[_0x7ad0('0x16')](_0x1bfc51);}return _0x2e0747[_0x7ad0('0x17')](_0x1bfc51)['end']();};}function respondWithResult(_0x1c9537,_0x3cd9b7){_0x3cd9b7=_0x3cd9b7||0xc8;return function(_0x1bfe8f){if(_0x1bfe8f){return _0x1c9537[_0x7ad0('0x17')](_0x3cd9b7)[_0x7ad0('0x18')](_0x1bfe8f);}};}function respondWithFilteredResult(_0x54a916,_0x2b20c5){return function(_0x4316b1){if(_0x4316b1){var _0xece8e1=typeof _0x2b20c5[_0x7ad0('0x19')]==='undefined'&&typeof _0x2b20c5[_0x7ad0('0x1a')]===_0x7ad0('0x1b');var _0xeaab2f=_0x4316b1[_0x7ad0('0x1c')];var _0x1c410a=_0xece8e1?0x0:_0x2b20c5[_0x7ad0('0x19')];var _0x54624b=_0xece8e1?_0x4316b1[_0x7ad0('0x1c')]:_0x2b20c5[_0x7ad0('0x19')]+_0x2b20c5[_0x7ad0('0x1a')];var _0x504797;if(_0x54624b>=_0xeaab2f){_0x54624b=_0xeaab2f;_0x504797=0xc8;}else{_0x504797=0xce;}_0x54a916[_0x7ad0('0x17')](_0x504797);return _0x54a916[_0x7ad0('0x1d')](_0x7ad0('0x1e'),_0x1c410a+'-'+_0x54624b+'/'+_0xeaab2f)[_0x7ad0('0x18')](_0x4316b1);}return null;};}function patchUpdates(_0x10abbd){return function(_0x26e8d5){try{jsonpatch[_0x7ad0('0x1f')](_0x26e8d5,_0x10abbd,!![]);}catch(_0x56121b){return BPromise['reject'](_0x56121b);}return _0x26e8d5[_0x7ad0('0x20')]();};}function saveUpdates(_0x82c437,_0xe3bc25){return function(_0x401f2b){if(_0x401f2b){return _0x401f2b['update'](_0x82c437)[_0x7ad0('0x21')](function(_0x2a9cd0){return _0x2a9cd0;});}return null;};}function removeEntity(_0x3d3b76,_0x2d8018){return function(_0x399f8f){if(_0x399f8f){return _0x399f8f[_0x7ad0('0x22')]()[_0x7ad0('0x21')](function(){_0x3d3b76[_0x7ad0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aeb81,_0x1e40bd){return function(_0x576f49){if(!_0x576f49){_0x5aeb81[_0x7ad0('0x16')](0x194);}return _0x576f49;};}function handleError(_0x2771a7,_0x1f4b3b){_0x1f4b3b=_0x1f4b3b||0x1f4;return function(_0x15be61){logger[_0x7ad0('0x23')](_0x15be61['stack']);if(_0x15be61[_0x7ad0('0x24')]){delete _0x15be61[_0x7ad0('0x24')];}_0x2771a7['status'](_0x1f4b3b)[_0x7ad0('0x25')](_0x15be61);};}exports[_0x7ad0('0x26')]=function(_0x2cddef,_0x431ce8){if(_0x2cddef['body']['id']){delete _0x2cddef[_0x7ad0('0x27')]['id'];}return db[_0x7ad0('0x28')]['find']({'where':{'id':_0x2cddef[_0x7ad0('0x29')]['id']}})[_0x7ad0('0x21')](handleEntityNotFound(_0x431ce8,null))[_0x7ad0('0x21')](saveUpdates(_0x2cddef[_0x7ad0('0x27')],null))[_0x7ad0('0x21')](respondWithResult(_0x431ce8,null))[_0x7ad0('0x2a')](handleError(_0x431ce8,null));};exports[_0x7ad0('0x22')]=function(_0x1faf79,_0x274127){return db['Action']['find']({'where':{'id':_0x1faf79[_0x7ad0('0x29')]['id']}})[_0x7ad0('0x21')](handleEntityNotFound(_0x274127,null))[_0x7ad0('0x21')](removeEntity(_0x274127,null))[_0x7ad0('0x2a')](handleError(_0x274127,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 48924f3..b585d6d 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25fd=['request-promise','rimraf','../../config/environment','exports','define','../../config/logger','api','bluebird'];(function(_0x444154,_0x371c6b){var _0x56cfc6=function(_0x1685a8){while(--_0x1685a8){_0x444154['push'](_0x444154['shift']());}};_0x56cfc6(++_0x371c6b);}(_0x25fd,0x16d));var _0xd25f=function(_0x464b23,_0x2b4fac){_0x464b23=_0x464b23-0x0;var _0x4db267=_0x25fd[_0x464b23];return _0x4db267;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd25f('0x0'))(_0xd25f('0x1'));var moment=require('moment');var BPromise=require(_0xd25f('0x2'));var rp=require(_0xd25f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd25f('0x4'));var config=require(_0xd25f('0x5'));var attributes=require('./action.attributes');module[_0xd25f('0x6')]=function(_0x4ad800,_0x2752d7){return _0x4ad800[_0xd25f('0x7')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7400=['./action.attributes','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f087e,_0x24ae0c){var _0x2146c5=function(_0x4b755f){while(--_0x4b755f){_0x2f087e['push'](_0x2f087e['shift']());}};_0x2146c5(++_0x24ae0c);}(_0x7400,0x1d7));var _0x0740=function(_0x290c31,_0x534b8a){_0x290c31=_0x290c31-0x0;var _0x2eb0ac=_0x7400[_0x290c31];return _0x2eb0ac;};'use strict';var _=require('lodash');var util=require(_0x0740('0x0'));var logger=require(_0x0740('0x1'))(_0x0740('0x2'));var moment=require(_0x0740('0x3'));var BPromise=require(_0x0740('0x4'));var rp=require(_0x0740('0x5'));var fs=require('fs');var path=require(_0x0740('0x6'));var rimraf=require(_0x0740('0x7'));var config=require(_0x0740('0x8'));var attributes=require(_0x0740('0x9'));module['exports']=function(_0x430d15,_0x25cdee){return _0x430d15['define'](_0x0740('0xa'),attributes,{'tableName':_0x0740('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index eed0485..d00cf27 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xf494,0x1c6));var _0x4f49=function(_0x3f7650,_0x50cd0a){_0x3f7650=_0x3f7650-0x0;var _0x308e4f=_0xf494[_0x3f7650];return _0x308e4f;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x52193e,_0x5191eb){var _0x2ff254=function(_0x410484){while(--_0x410484){_0x52193e['push'](_0x52193e['shift']());}};_0x2ff254(++_0x5191eb);}(_0x5fab,0x177));var _0xb5fa=function(_0x15b932,_0x39ba3f){_0x15b932=_0x15b932-0x0;var _0x28fa64=_0x5fab[_0x15b932];return _0x28fa64;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index bae94f3..6c194ae 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 _0xf6e9=['delete','destroy','exports','util','path','Router','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x2238b9,_0x1c9a06){var _0xe294d5=function(_0x2b8f84){while(--_0x2b8f84){_0x2238b9['push'](_0x2238b9['shift']());}};_0xe294d5(++_0x1c9a06);}(_0xf6e9,0xe0));var _0x9f6e=function(_0xd83f3e,_0x3c909e){_0xd83f3e=_0xd83f3e-0x0;var _0x3afffc=_0xf6e9[_0xd83f3e];return _0x3afffc;};'use strict';var multer=require('multer');var util=require(_0x9f6e('0x0'));var path=require(_0x9f6e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9f6e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9f6e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9f6e('0x4'));var controller=require(_0x9f6e('0x5'));router[_0x9f6e('0x6')](_0x9f6e('0x7'),auth[_0x9f6e('0x8')](),controller[_0x9f6e('0x9')]);router[_0x9f6e('0xa')](_0x9f6e('0x7'),auth[_0x9f6e('0x8')](),controller[_0x9f6e('0xb')]);module[_0x9f6e('0xc')]=router;
\ No newline at end of file
+var _0xd495=['isAuthenticated','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x2e018c,_0x54ed5e){var _0x471254=function(_0x2040bf){while(--_0x2040bf){_0x2e018c['push'](_0x2e018c['shift']());}};_0x471254(++_0x54ed5e);}(_0xd495,0x189));var _0x5d49=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xd495[_0x489b87];return _0x1823b6;};'use strict';var multer=require(_0x5d49('0x0'));var util=require(_0x5d49('0x1'));var path=require(_0x5d49('0x2'));var timeout=require(_0x5d49('0x3'));var express=require(_0x5d49('0x4'));var router=express['Router']();var fs_extra=require(_0x5d49('0x5'));var auth=require(_0x5d49('0x6'));var interaction=require(_0x5d49('0x7'));var config=require(_0x5d49('0x8'));var controller=require(_0x5d49('0x9'));router[_0x5d49('0xa')](_0x5d49('0xb'),auth[_0x5d49('0xc')](),controller[_0x5d49('0xd')]);router['delete'](_0x5d49('0xb'),auth[_0x5d49('0xc')](),controller['destroy']);module[_0x5d49('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index f255142..d704a3e 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x255aa7,_0x774e3e){_0x255aa7=_0x255aa7-0x0;var _0x327639=_0xdc97[_0x255aa7];return _0x327639;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x1c31ec,_0x240f49){var _0x30d29d=function(_0x14b732){while(--_0x14b732){_0x1c31ec['push'](_0x1c31ec['shift']());}};_0x30d29d(++_0x240f49);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1cc3ce,_0x43791e){_0x1cc3ce=_0x1cc3ce-0x0;var _0x4ac6ac=_0x3f8a[_0x1cc3ce];return _0x4ac6ac;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f173c61..82aa3a1 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 _0xf2c2=['status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','cross_join','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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','length','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','ROUND(%s)','IS\x20NOT\x20EMPTY','operator','keyBy','from','function','web','randomstring','generate','output','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','savename','countTable','COUNT(*)','run','runReport','SUM(%s)','alias','debug','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf2c2,0x132));var _0x2f2c=function(_0x3c18bd,_0x5eda61){_0x3c18bd=_0x3c18bd-0x0;var _0x29ae98=_0xf2c2[_0x3c18bd];return _0x29ae98;};'use strict';var emlformat=require(_0x2f2c('0x0'));var rimraf=require(_0x2f2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2f2c('0x2'));var moment=require(_0x2f2c('0x3'));var BPromise=require(_0x2f2c('0x4'));var Mustache=require(_0x2f2c('0x5'));var util=require(_0x2f2c('0x6'));var path=require(_0x2f2c('0x7'));var sox=require('sox');var csv=require(_0x2f2c('0x8'));var ejs=require(_0x2f2c('0x9'));var fs=require('fs');var fs_extra=require(_0x2f2c('0xa'));var _=require('lodash');var squel=require(_0x2f2c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2f2c('0xc'));var toCsv=require(_0x2f2c('0x8'));var querystring=require(_0x2f2c('0xd'));var Papa=require('papaparse');var Redis=require(_0x2f2c('0xe'));var authService=require(_0x2f2c('0xf'));var qs=require(_0x2f2c('0x10'));var as=require(_0x2f2c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f2c('0x12'));var utils=require(_0x2f2c('0x13'));var config=require(_0x2f2c('0x14'));var licenseUtil=require(_0x2f2c('0x15'));var db=require(_0x2f2c('0x16'))['db'];var dbH=require(_0x2f2c('0x16'))['dbH'];function respondWithStatusCode(_0x52b387,_0x3ad41e){_0x3ad41e=_0x3ad41e||0xcc;return function(_0x526c7f){if(_0x526c7f){return _0x52b387[_0x2f2c('0x17')](_0x3ad41e);}return _0x52b387[_0x2f2c('0x18')](_0x3ad41e)[_0x2f2c('0x19')]();};}function respondWithResult(_0x154d23,_0x3ba97b){_0x3ba97b=_0x3ba97b||0xc8;return function(_0x9f7f9d){if(_0x9f7f9d){return _0x154d23[_0x2f2c('0x18')](_0x3ba97b)['json'](_0x9f7f9d);}};}function respondWithFilteredResult(_0x263c15,_0x24b260){return function(_0x37a6b2){if(_0x37a6b2){var _0x3af135=typeof _0x24b260[_0x2f2c('0x1a')]===_0x2f2c('0x1b')&&typeof _0x24b260[_0x2f2c('0x1c')]===_0x2f2c('0x1b');var _0x4e1350=_0x37a6b2['count'];var _0x235cbf=_0x3af135?0x0:_0x24b260[_0x2f2c('0x1a')];var _0x3f5adc=_0x3af135?_0x37a6b2[_0x2f2c('0x1d')]:_0x24b260[_0x2f2c('0x1a')]+_0x24b260[_0x2f2c('0x1c')];var _0x4fa73c;if(_0x3f5adc>=_0x4e1350){_0x3f5adc=_0x4e1350;_0x4fa73c=0xc8;}else{_0x4fa73c=0xce;}_0x263c15[_0x2f2c('0x18')](_0x4fa73c);return _0x263c15[_0x2f2c('0x1e')](_0x2f2c('0x1f'),_0x235cbf+'-'+_0x3f5adc+'/'+_0x4e1350)[_0x2f2c('0x20')](_0x37a6b2);}return null;};}function patchUpdates(_0x5f55c8){return function(_0x42c406){try{jsonpatch['apply'](_0x42c406,_0x5f55c8,!![]);}catch(_0x2e00c2){return BPromise[_0x2f2c('0x21')](_0x2e00c2);}return _0x42c406[_0x2f2c('0x22')]();};}function saveUpdates(_0x4ce150,_0x4d8156){return function(_0x3a2762){if(_0x3a2762){return _0x3a2762[_0x2f2c('0x23')](_0x4ce150)[_0x2f2c('0x24')](function(_0x38d161){return _0x38d161;});}return null;};}function removeEntity(_0x39730a,_0x74d3ef){return function(_0x584d48){if(_0x584d48){return _0x584d48[_0x2f2c('0x25')]()[_0x2f2c('0x24')](function(){var _0x1b6d02=_0x584d48['get']({'plain':!![]});var _0x13a619=_0x2f2c('0x26');return db['UserProfileResource'][_0x2f2c('0x25')]({'where':{'type':_0x13a619,'resourceId':_0x1b6d02['id']}})[_0x2f2c('0x24')](function(){return _0x584d48;});})[_0x2f2c('0x24')](function(){_0x39730a[_0x2f2c('0x18')](0xcc)[_0x2f2c('0x19')]();});}};}function handleEntityNotFound(_0xe58b8e,_0x531511){return function(_0x78e5e4){if(!_0x78e5e4){_0xe58b8e[_0x2f2c('0x17')](0x194);}return _0x78e5e4;};}function handleError(_0x16ee0a,_0x38e921){_0x38e921=_0x38e921||0x1f4;return function(_0x1015e8){logger[_0x2f2c('0x27')](_0x1015e8[_0x2f2c('0x28')]);if(_0x1015e8[_0x2f2c('0x29')]){delete _0x1015e8[_0x2f2c('0x29')];}_0x16ee0a[_0x2f2c('0x18')](_0x38e921)[_0x2f2c('0x2a')](_0x1015e8);};}exports[_0x2f2c('0x2b')]=function(_0x34daa9,_0xcf7b13){var _0x2fb406={},_0x53bf65={},_0x471874={'count':0x0,'rows':[]};var _0x373bb5=_[_0x2f2c('0x2c')](db[_0x2f2c('0x2d')][_0x2f2c('0x2e')],function(_0x3bcb5f){return{'name':_0x3bcb5f[_0x2f2c('0x2f')],'type':_0x3bcb5f[_0x2f2c('0x30')][_0x2f2c('0x31')]};});_0x53bf65['model']=_[_0x2f2c('0x2c')](_0x373bb5,_0x2f2c('0x29'));_0x53bf65['query']=_['keys'](_0x34daa9[_0x2f2c('0x32')]);_0x53bf65[_0x2f2c('0x33')]=_[_0x2f2c('0x34')](_0x53bf65['model'],_0x53bf65['query']);_0x2fb406[_0x2f2c('0x35')]=_[_0x2f2c('0x34')](_0x53bf65[_0x2f2c('0x36')],qs[_0x2f2c('0x37')](_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x37')]));_0x2fb406[_0x2f2c('0x35')]=_0x2fb406[_0x2f2c('0x35')]['length']?_0x2fb406[_0x2f2c('0x35')]:_0x53bf65[_0x2f2c('0x36')];if(!_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x38')]('nolimit')){_0x2fb406['limit']=qs[_0x2f2c('0x1c')](_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x1c')]);_0x2fb406[_0x2f2c('0x1a')]=qs[_0x2f2c('0x1a')](_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x1a')]);}_0x2fb406[_0x2f2c('0x39')]=qs[_0x2f2c('0x3a')](_0x34daa9['query']['sort']);_0x2fb406[_0x2f2c('0x3b')]=qs['filters'](_[_0x2f2c('0x3c')](_0x34daa9[_0x2f2c('0x32')],_0x53bf65[_0x2f2c('0x33')]),_0x373bb5);if(_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x3d')]){_0x2fb406[_0x2f2c('0x3b')]=_['merge'](_0x2fb406['where'],{'$or':_[_0x2f2c('0x2c')](_0x373bb5,function(_0x2945de){if(_0x2945de['type']!==_0x2f2c('0x3e')){var _0x11e0e6={};_0x11e0e6[_0x2945de['name']]={'$like':'%'+_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x3d')]+'%'};return _0x11e0e6;}})});}_0x2fb406=_[_0x2f2c('0x3f')]({},_0x2fb406,_0x34daa9[_0x2f2c('0x40')]);var _0xaafc82={'where':_0x2fb406['where']};return db[_0x2f2c('0x2d')][_0x2f2c('0x1d')](_0xaafc82)[_0x2f2c('0x24')](function(_0x2000d9){_0x471874[_0x2f2c('0x1d')]=_0x2000d9;if(_0x34daa9[_0x2f2c('0x32')][_0x2f2c('0x41')]){_0x2fb406[_0x2f2c('0x42')]=[{'all':!![]}];}return db[_0x2f2c('0x2d')][_0x2f2c('0x43')](_0x2fb406);})['then'](function(_0x5d9a0c){_0x471874[_0x2f2c('0x44')]=_0x5d9a0c;return _0x471874;})[_0x2f2c('0x24')](respondWithFilteredResult(_0xcf7b13,_0x2fb406))[_0x2f2c('0x45')](handleError(_0xcf7b13,null));};exports[_0x2f2c('0x46')]=function(_0x3aa4b0,_0x5da674){var _0x1835c4={'raw':![],'where':{'id':_0x3aa4b0[_0x2f2c('0x47')]['id']}},_0x4a05ef={};_0x4a05ef['model']=_[_0x2f2c('0x48')](db[_0x2f2c('0x2d')]['rawAttributes']);_0x4a05ef['query']=_['keys'](_0x3aa4b0[_0x2f2c('0x32')]);_0x4a05ef[_0x2f2c('0x33')]=_[_0x2f2c('0x34')](_0x4a05ef[_0x2f2c('0x36')],_0x4a05ef[_0x2f2c('0x32')]);_0x1835c4['attributes']=_[_0x2f2c('0x34')](_0x4a05ef[_0x2f2c('0x36')],qs['fields'](_0x3aa4b0[_0x2f2c('0x32')][_0x2f2c('0x37')]));_0x1835c4[_0x2f2c('0x35')]=_0x1835c4[_0x2f2c('0x35')]['length']?_0x1835c4[_0x2f2c('0x35')]:_0x4a05ef[_0x2f2c('0x36')];if(_0x3aa4b0['query']['includeAll']){_0x1835c4[_0x2f2c('0x42')]=[{'all':!![]}];}_0x1835c4=_[_0x2f2c('0x3f')]({},_0x1835c4,_0x3aa4b0[_0x2f2c('0x40')]);return db[_0x2f2c('0x2d')][_0x2f2c('0x49')](_0x1835c4)['then'](handleEntityNotFound(_0x5da674,null))[_0x2f2c('0x24')](respondWithResult(_0x5da674,null))[_0x2f2c('0x45')](handleError(_0x5da674,null));};exports[_0x2f2c('0x4a')]=function(_0x30d888,_0x132c02){return db[_0x2f2c('0x2d')]['create'](_0x30d888['body'],{})['then'](function(_0x30f6df){var _0x4e723c=_0x30d888[_0x2f2c('0x4b')][_0x2f2c('0x4c')]({'plain':!![]});if(!_0x4e723c)throw new Error(_0x2f2c('0x4d'));if(_0x4e723c[_0x2f2c('0x4e')]===_0x2f2c('0x4b')){var _0x28ac2f=_0x30f6df['get']({'plain':!![]});var _0x483ea7=_0x2f2c('0x4f');return db[_0x2f2c('0x50')][_0x2f2c('0x49')]({'where':{'name':_0x483ea7,'userProfileId':_0x4e723c[_0x2f2c('0x51')]},'raw':!![]})['then'](function(_0x18157d){if(_0x18157d&&_0x18157d[_0x2f2c('0x52')]===0x0){return db[_0x2f2c('0x53')][_0x2f2c('0x4a')]({'name':_0x28ac2f[_0x2f2c('0x29')],'resourceId':_0x28ac2f['id'],'type':'CustomReports','sectionId':_0x18157d['id']},{})['then'](function(){return _0x30f6df;});}else{return _0x30f6df;}})['catch'](function(_0x2b60ea){logger[_0x2f2c('0x27')](_0x2f2c('0x54'),_0x2b60ea);throw _0x2b60ea;});}return _0x30f6df;})[_0x2f2c('0x24')](respondWithResult(_0x132c02,0xc9))['catch'](handleError(_0x132c02,null));};exports[_0x2f2c('0x23')]=function(_0x1d367d,_0x507ef9){if(_0x1d367d['body']['id']){delete _0x1d367d[_0x2f2c('0x55')]['id'];}return db[_0x2f2c('0x2d')][_0x2f2c('0x49')]({'where':{'id':_0x1d367d[_0x2f2c('0x47')]['id']}})[_0x2f2c('0x24')](handleEntityNotFound(_0x507ef9,null))[_0x2f2c('0x24')](saveUpdates(_0x1d367d['body'],null))[_0x2f2c('0x24')](respondWithResult(_0x507ef9,null))[_0x2f2c('0x45')](handleError(_0x507ef9,null));};exports[_0x2f2c('0x25')]=function(_0xfc2612,_0x2ba350){return db['AnalyticCustomReport'][_0x2f2c('0x49')]({'where':{'id':_0xfc2612[_0x2f2c('0x47')]['id']}})[_0x2f2c('0x24')](handleEntityNotFound(_0x2ba350,null))[_0x2f2c('0x24')](removeEntity(_0x2ba350,null))[_0x2f2c('0x45')](handleError(_0x2ba350,null));};exports['preview']=function(_0x1cb238,_0x2eb800){var _0xcd834b=0xa;var _0x2ff8c2=[_0x2f2c('0x56'),_0x2f2c('0x57'),'right_join',_0x2f2c('0x58')];var _0x2bc8e3={'SUM':'SUM(%s)','COUNT':_0x2f2c('0x59'),'COUNT DISTINCT':_0x2f2c('0x5a'),'MAX':_0x2f2c('0x5b'),'MIN':_0x2f2c('0x5c'),'AVG':_0x2f2c('0x5d'),'GROUP_CONCAT':_0x2f2c('0x5e'),'GROUP_CONCAT ASC':_0x2f2c('0x5f'),'GROUP_CONCAT DESC':_0x2f2c('0x60')};var _0x358684={'SEC_TO_TIME':_0x2f2c('0x61'),'DATE':_0x2f2c('0x62'),'HOUR':_0x2f2c('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2f2c('0x64')};var _0x4c0a0a=function(_0xb166ab){return!_[_0x2f2c('0x65')]([_0x2f2c('0x66'),'IS\x20NOT\x20NULL',_0x2f2c('0x67'),'IS\x20NOT\x20EMPTY'],_0xb166ab);};var _0x4b11dc=function(_0x78e0f6){if(!_0x78e0f6||!_0x78e0f6[_0x2f2c('0x68')][_0x2f2c('0x69')]){return'';}for(var _0xe50982='(',_0x532e9f=0x0;_0x532e9f<_0x78e0f6['rules'][_0x2f2c('0x69')];_0x532e9f+=0x1){_0x532e9f>0x0&&(_0xe50982+='\x20'+_0x78e0f6['operator']+'\x20');_0xe50982+=_0x78e0f6[_0x2f2c('0x68')][_0x532e9f][_0x2f2c('0x6a')]?_0x4b11dc(_0x78e0f6[_0x2f2c('0x68')][_0x532e9f][_0x2f2c('0x6a')]):_0x78e0f6[_0x2f2c('0x68')][_0x532e9f][_0x2f2c('0x6b')]+'\x20'+_0x78e0f6[_0x2f2c('0x68')][_0x532e9f]['condition']+(_0x4c0a0a(_0x78e0f6[_0x2f2c('0x68')][_0x532e9f][_0x2f2c('0x6c')])?'\x20'+_0x78e0f6['rules'][_0x532e9f][_0x2f2c('0x6d')]:'');}return _0xe50982+')';};var _0x87f98d={'where':{'id':_0x1cb238[_0x2f2c('0x47')]['id']}},_0x30a2fa,_0x2ae587,_0x158715,_0x33cb27,_0x6f2f0f;_0x87f98d=_[_0x2f2c('0x3f')]({},_0x87f98d,_0x1cb238[_0x2f2c('0x40')]);return db[_0x2f2c('0x2d')][_0x2f2c('0x49')](_0x87f98d)[_0x2f2c('0x24')](function(_0xf7fc23){if(_0xf7fc23){_0x30a2fa=_0xf7fc23;return _0xf7fc23[_0x2f2c('0x6e')]();}return null;})[_0x2f2c('0x24')](function(_0x4209b3){if(_0x4209b3){if(!_0x4209b3[_0x2f2c('0x69')]){throw new db[(_0x2f2c('0x6f'))][(_0x2f2c('0x70'))](_0x2f2c('0x71'),0x193);}_0x2ae587=_0x4209b3;return db[_0x2f2c('0x72')][_0x2f2c('0x43')]({'raw':!![]});}return null;})[_0x2f2c('0x24')](function(_0x2d9926){if(_0x2d9926){_0x158715=_['keyBy'](_0x2d9926,'id');var _0x438bd1;var _0x492c21=squel[_0x2f2c('0x73')]();_0x492c21['from'](_0x30a2fa[_0x2f2c('0x74')]);for(var _0x41280a=0x0;_0x41280a<_0x2ae587['length'];_0x41280a+=0x1){_0x438bd1=_0x2ae587[_0x41280a][_0x2f2c('0x75')]?_0x158715[_0x2ae587[_0x41280a][_0x2f2c('0x75')]][_0x2f2c('0x76')]:_0x2ae587[_0x41280a][_0x2f2c('0x6b')];_0x438bd1=_0x2ae587[_0x41280a]['function']?_[_0x2f2c('0x77')](_0x2bc8e3[_0x2ae587[_0x41280a]['function']],'%s',_0x438bd1):_0x438bd1;_0x438bd1=_0x2ae587[_0x41280a]['format']?_['replace'](_0x358684[_0x2ae587[_0x41280a][_0x2f2c('0x78')]],'%s',_0x438bd1):_0x438bd1;if(_0x2ae587[_0x41280a][_0x2f2c('0x79')]){_0x492c21[_0x2f2c('0x6a')](_0x438bd1);}_0x2ae587[_0x41280a][_0x2f2c('0x7a')]&&_0x492c21[_0x2f2c('0x39')](_0x438bd1,_0x2ae587[_0x41280a][_0x2f2c('0x7a')]===_0x2f2c('0x7b')?![]:!![]);_0x492c21[_0x2f2c('0x6b')](_0x438bd1,_0x2ae587[_0x41280a]['alias']||_0x438bd1);}if(_0x30a2fa[_0x2f2c('0x7c')]){_0x30a2fa['joins']=JSON[_0x2f2c('0x7d')](_0x30a2fa[_0x2f2c('0x7c')]);for(var _0x45267b=0x0;_0x45267b<_0x30a2fa[_0x2f2c('0x7c')][_0x2f2c('0x69')];_0x45267b+=0x1){if(_0x30a2fa[_0x2f2c('0x7c')][_0x45267b]['type']&&_[_0x2f2c('0x65')](_0x2ff8c2,_0x30a2fa[_0x2f2c('0x7c')][_0x45267b][_0x2f2c('0x30')])&&_0x30a2fa[_0x2f2c('0x7c')][_0x45267b][_0x2f2c('0x7e')]&&_0x30a2fa['joins'][_0x45267b]['foreignTable']&&_0x30a2fa[_0x2f2c('0x7c')][_0x45267b][_0x2f2c('0x7f')]){_0x492c21[_0x30a2fa['joins'][_0x45267b]['type']](_0x30a2fa['joins'][_0x45267b][_0x2f2c('0x80')],null,util[_0x2f2c('0x78')](_0x2f2c('0x81'),_0x30a2fa[_0x2f2c('0x74')],_0x30a2fa[_0x2f2c('0x7c')][_0x45267b][_0x2f2c('0x7e')],_0x30a2fa[_0x2f2c('0x7c')][_0x45267b][_0x2f2c('0x80')],_0x30a2fa[_0x2f2c('0x7c')][_0x45267b][_0x2f2c('0x7f')]));}}}if(_0x30a2fa[_0x2f2c('0x82')]){_0x30a2fa[_0x2f2c('0x82')]=JSON[_0x2f2c('0x7d')](_0x30a2fa[_0x2f2c('0x82')]);_0x492c21['where'](_0x4b11dc(_0x30a2fa[_0x2f2c('0x82')][_0x2f2c('0x6a')]));}_0x6f2f0f=_0x492c21[_0x2f2c('0x83')]();_0x492c21[_0x2f2c('0x1c')](_0xcd834b);_0x492c21[_0x2f2c('0x1a')](0x0);logger['debug'](_0x2f2c('0x84'),_0x492c21[_0x2f2c('0x85')]());return dbH['sequelize'][_0x2f2c('0x32')](_0x492c21[_0x2f2c('0x85')](),{'type':dbH[_0x2f2c('0x86')][_0x2f2c('0x87')][_0x2f2c('0x88')]});}})['then'](respondWithResult(_0x2eb800,null))['catch'](handleError(_0x2eb800,null));};function runReport(_0x2fddb6,_0x3cb3ac,_0x1ccda9){var _0x5b3eaf=_0x3cb3ac[_0x2f2c('0x29')];var _0x2c7f8a=0xa;var _0x5a06c2=[_0x2f2c('0x56'),_0x2f2c('0x57'),_0x2f2c('0x89'),_0x2f2c('0x58')];var _0x122b27={'SUM':'SUM(%s)','COUNT':_0x2f2c('0x59'),'COUNT DISTINCT':_0x2f2c('0x5a'),'MAX':_0x2f2c('0x5b'),'MIN':_0x2f2c('0x5c'),'AVG':_0x2f2c('0x5d'),'GROUP_CONCAT':_0x2f2c('0x5e'),'GROUP_CONCAT ASC':_0x2f2c('0x5f'),'GROUP_CONCAT DESC':_0x2f2c('0x60')};var _0x19fb06={'SEC_TO_TIME':_0x2f2c('0x61'),'DATE':'DATE(%s)','HOUR':_0x2f2c('0x63'),'ROUND':_0x2f2c('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x18cd42=function(_0x49bc74){return!_['includes']([_0x2f2c('0x66'),'IS\x20NOT\x20NULL',_0x2f2c('0x67'),_0x2f2c('0x8b')],_0x49bc74);};var _0x522e97=function(_0x49a561){if(!_0x49a561||!_0x49a561[_0x2f2c('0x68')][_0x2f2c('0x69')]){return'';}for(var _0x246d84='(',_0x293730=0x0;_0x293730<_0x49a561['rules'][_0x2f2c('0x69')];_0x293730+=0x1){_0x293730>0x0&&(_0x246d84+='\x20'+_0x49a561[_0x2f2c('0x8c')]+'\x20');_0x246d84+=_0x49a561[_0x2f2c('0x68')][_0x293730][_0x2f2c('0x6a')]?_0x522e97(_0x49a561[_0x2f2c('0x68')][_0x293730]['group']):_0x49a561[_0x2f2c('0x68')][_0x293730]['field']+'\x20'+_0x49a561[_0x2f2c('0x68')][_0x293730][_0x2f2c('0x6c')]+(_0x18cd42(_0x49a561['rules'][_0x293730][_0x2f2c('0x6c')])?'\x20'+_0x49a561[_0x2f2c('0x68')][_0x293730][_0x2f2c('0x6d')]:'');}return _0x246d84+')';};var _0x3556b1={'where':{'id':_0x2fddb6['id']}},_0x3111a1,_0x36fa86,_0x3dabc5,_0x5710c6,_0x710210;_0x3556b1=_[_0x2f2c('0x3f')]({},_0x3556b1,_0x1ccda9);return db[_0x2f2c('0x2d')][_0x2f2c('0x49')](_0x3556b1)[_0x2f2c('0x24')](function(_0x589525){if(_0x589525){_0x3111a1=_0x589525;return _0x589525[_0x2f2c('0x6e')]();}return null;})[_0x2f2c('0x24')](function(_0x38c741){if(_0x38c741){if(!_0x38c741[_0x2f2c('0x69')]){throw new db[(_0x2f2c('0x6f'))]['ValidationErrorItem'](_0x2f2c('0x71'),0x193);}_0x36fa86=_0x38c741;return db[_0x2f2c('0x72')][_0x2f2c('0x43')]({'raw':!![]});}return null;})[_0x2f2c('0x24')](function(_0x267704){if(_0x267704){_0x3dabc5=_[_0x2f2c('0x8d')](_0x267704,'id');var _0x228730;var _0x3bda1b=squel[_0x2f2c('0x73')]();_0x3bda1b[_0x2f2c('0x8e')](_0x3111a1[_0x2f2c('0x74')]);for(var _0x1ee2cf=0x0;_0x1ee2cf<_0x36fa86['length'];_0x1ee2cf+=0x1){_0x228730=_0x36fa86[_0x1ee2cf][_0x2f2c('0x75')]?_0x3dabc5[_0x36fa86[_0x1ee2cf][_0x2f2c('0x75')]][_0x2f2c('0x76')]:_0x36fa86[_0x1ee2cf][_0x2f2c('0x6b')];_0x228730=_0x36fa86[_0x1ee2cf][_0x2f2c('0x8f')]?_[_0x2f2c('0x77')](_0x122b27[_0x36fa86[_0x1ee2cf][_0x2f2c('0x8f')]],'%s',_0x228730):_0x228730;_0x228730=_0x36fa86[_0x1ee2cf][_0x2f2c('0x78')]?_[_0x2f2c('0x77')](_0x19fb06[_0x36fa86[_0x1ee2cf][_0x2f2c('0x78')]],'%s',_0x228730):_0x228730;if(_0x36fa86[_0x1ee2cf][_0x2f2c('0x79')]){_0x3bda1b[_0x2f2c('0x6a')](_0x228730);}_0x36fa86[_0x1ee2cf][_0x2f2c('0x7a')]&&_0x3bda1b['order'](_0x228730,_0x36fa86[_0x1ee2cf]['orderBy']===_0x2f2c('0x7b')?![]:!![]);_0x3bda1b['field'](_0x228730,_0x36fa86[_0x1ee2cf]['alias']||_0x228730);}if(_0x3111a1['joins']){_0x3111a1[_0x2f2c('0x7c')]=JSON[_0x2f2c('0x7d')](_0x3111a1[_0x2f2c('0x7c')]);for(var _0x808227=0x0;_0x808227<_0x3111a1[_0x2f2c('0x7c')][_0x2f2c('0x69')];_0x808227+=0x1){if(_0x3111a1[_0x2f2c('0x7c')][_0x808227][_0x2f2c('0x30')]&&_[_0x2f2c('0x65')](_0x5a06c2,_0x3111a1[_0x2f2c('0x7c')][_0x808227][_0x2f2c('0x30')])&&_0x3111a1[_0x2f2c('0x7c')][_0x808227][_0x2f2c('0x7e')]&&_0x3111a1[_0x2f2c('0x7c')][_0x808227]['foreignTable']&&_0x3111a1[_0x2f2c('0x7c')][_0x808227]['foreignKey']){_0x3bda1b[_0x3111a1[_0x2f2c('0x7c')][_0x808227]['type']](_0x3111a1[_0x2f2c('0x7c')][_0x808227][_0x2f2c('0x80')],null,util[_0x2f2c('0x78')]('%s.%s\x20=\x20%s.%s',_0x3111a1[_0x2f2c('0x74')],_0x3111a1[_0x2f2c('0x7c')][_0x808227][_0x2f2c('0x7e')],_0x3111a1['joins'][_0x808227]['foreignTable'],_0x3111a1[_0x2f2c('0x7c')][_0x808227][_0x2f2c('0x7f')]));}}}if(_0x3111a1[_0x2f2c('0x82')]){_0x3111a1[_0x2f2c('0x82')]=JSON[_0x2f2c('0x7d')](_0x3111a1[_0x2f2c('0x82')]);_0x3bda1b['where'](_0x522e97(_0x3111a1[_0x2f2c('0x82')][_0x2f2c('0x6a')]));}_0x710210=_0x3bda1b['clone']();_0x3bda1b[_0x2f2c('0x1c')](_0x2c7f8a);_0x3bda1b['offset'](0x0);return;}})[_0x2f2c('0x24')](function(){if(_0x3cb3ac['output']===_0x2f2c('0x90')){return null;}var _0x18c2e3=_[_0x2f2c('0x3f')](_0x3cb3ac,{'name':_0x3cb3ac['fullPath']||_0x3cb3ac[_0x2f2c('0x29')]||_0x3111a1['name'],'basename':_0x5b3eaf,'savename':util['format']('%s-%s.%s',_0x3cb3ac['name']||_0x3111a1[_0x2f2c('0x29')],require(_0x2f2c('0x91'))[_0x2f2c('0x92')](0x4),_0x3cb3ac[_0x2f2c('0x93')]||_0x2f2c('0x94')),'reportId':_0x3111a1['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x2f2c('0x4a')](_0x18c2e3,{'raw':!![]});})[_0x2f2c('0x24')](function(_0x4ab61c){if(_0x3111a1[_0x2f2c('0x74')]===_0x2f2c('0x95')){_0x710210['where'](_0x3111a1[_0x2f2c('0x74')]+_0x2f2c('0x96'),_0x3cb3ac[_0x2f2c('0x97')],_0x3cb3ac[_0x2f2c('0x98')]);}else{_0x710210[_0x2f2c('0x3b')](_0x3111a1['table']+_0x2f2c('0x99'),_0x3cb3ac[_0x2f2c('0x97')],_0x3cb3ac[_0x2f2c('0x98')]);}if(_0x4ab61c){logger[_0x2f2c('0x9a')](_0x2f2c('0x9b'),_0x710210[_0x2f2c('0x85')]());require('child_process')[_0x2f2c('0x9c')](path[_0x2f2c('0x56')](__dirname,'../../components/export/',_0x4ab61c[_0x2f2c('0x93')]),[_0x4ab61c['id'],_0x710210['toString'](),path[_0x2f2c('0x56')](__dirname,'../../files/reports',_0x4ab61c[_0x2f2c('0x9d')]),_0x5b3eaf]);return _0x4ab61c;}else{var _0xf96117=squel[_0x2f2c('0x73')]();_0xf96117[_0x2f2c('0x8e')]('('+_0x710210[_0x2f2c('0x85')]()+')',_0x2f2c('0x9e'));_0xf96117[_0x2f2c('0x6b')](_0x2f2c('0x9f'),'count');_0x710210['limit'](_0x3cb3ac[_0x2f2c('0x1c')]||_0x2c7f8a);_0x710210['offset'](_0x3cb3ac[_0x2f2c('0x1a')]||0x0);return dbH[_0x2f2c('0x86')][_0x2f2c('0x32')](_0xf96117[_0x2f2c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x2f2c('0x88')]})[_0x2f2c('0x24')](function(_0x3a926b){if(!_0x3a926b[_0x2f2c('0x69')]){_0x5710c6=0x0;}else{_0x5710c6=_0x3a926b[0x0][_0x2f2c('0x1d')]||0x0;}return dbH[_0x2f2c('0x86')][_0x2f2c('0x32')](_0x710210[_0x2f2c('0x85')](),{'type':dbH[_0x2f2c('0x86')]['QueryTypes'][_0x2f2c('0x88')]});})[_0x2f2c('0x24')](function(_0x4a1e7b){return{'rows':_0x4a1e7b||[],'count':_0x5710c6};});}});}exports[_0x2f2c('0xa0')]=function(_0x4a077d,_0x25a6a5){return runReport(_0x4a077d[_0x2f2c('0x47')],_0x4a077d[_0x2f2c('0x32')],_0x4a077d[_0x2f2c('0x40')])[_0x2f2c('0x24')](respondWithResult(_0x25a6a5,null))['catch'](handleError(_0x25a6a5,null));};exports[_0x2f2c('0xa1')]=runReport;exports[_0x2f2c('0x32')]=function(_0x3ce7d2,_0x1613bd){var _0x1af2ee=0xa;var _0x527b18=['join','left_join',_0x2f2c('0x89'),_0x2f2c('0x58')];var _0x344949={'SUM':_0x2f2c('0xa2'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2f2c('0x5b'),'MIN':_0x2f2c('0x5c'),'AVG':_0x2f2c('0x5d'),'GROUP_CONCAT':_0x2f2c('0x5e'),'GROUP_CONCAT ASC':_0x2f2c('0x5f'),'GROUP_CONCAT DESC':_0x2f2c('0x60')};var _0x2658fe={'SEC_TO_TIME':_0x2f2c('0x61'),'DATE':_0x2f2c('0x62'),'HOUR':_0x2f2c('0x63'),'ROUND':_0x2f2c('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b16d7=function(_0x4761be){return!_[_0x2f2c('0x65')]([_0x2f2c('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2f2c('0x8b')],_0x4761be);};var _0x4bf8ef=function(_0x563c5c){if(!_0x563c5c||!_0x563c5c[_0x2f2c('0x68')][_0x2f2c('0x69')]){return'';}for(var _0x5b633f='(',_0x409883=0x0;_0x409883<_0x563c5c[_0x2f2c('0x68')][_0x2f2c('0x69')];_0x409883+=0x1){_0x409883>0x0&&(_0x5b633f+='\x20'+_0x563c5c['operator']+'\x20');_0x5b633f+=_0x563c5c[_0x2f2c('0x68')][_0x409883][_0x2f2c('0x6a')]?_0x4bf8ef(_0x563c5c[_0x2f2c('0x68')][_0x409883][_0x2f2c('0x6a')]):_0x563c5c[_0x2f2c('0x68')][_0x409883]['field']+'\x20'+_0x563c5c[_0x2f2c('0x68')][_0x409883][_0x2f2c('0x6c')]+(_0x4b16d7(_0x563c5c['rules'][_0x409883]['condition'])?'\x20'+_0x563c5c['rules'][_0x409883]['value']:'');}return _0x5b633f+')';};var _0x37e319={'where':{'id':_0x3ce7d2['params']['id']}},_0x11543d,_0x59fe41,_0x4dee9e,_0x1050f9,_0x1dfdc3;_0x37e319=_['merge']({},_0x37e319,_0x3ce7d2[_0x2f2c('0x40')]);return db[_0x2f2c('0x2d')][_0x2f2c('0x49')](_0x37e319)[_0x2f2c('0x24')](function(_0x37ec5f){if(_0x37ec5f){_0x11543d=_0x37ec5f;return _0x37ec5f[_0x2f2c('0x6e')]();}return null;})['then'](function(_0x286fc8){if(_0x286fc8){if(!_0x286fc8[_0x2f2c('0x69')]){throw new db[(_0x2f2c('0x6f'))][(_0x2f2c('0x70'))](_0x2f2c('0x71'),0x193);}_0x59fe41=_0x286fc8;return db[_0x2f2c('0x72')]['findAll']({'raw':!![]});}return null;})[_0x2f2c('0x24')](function(_0x9e1417){if(_0x9e1417){_0x4dee9e=_['keyBy'](_0x9e1417,'id');var _0x1af39d;var _0x1d2d3a=squel[_0x2f2c('0x73')]();_0x1d2d3a[_0x2f2c('0x8e')](_0x11543d[_0x2f2c('0x74')]);for(var _0x1c689e=0x0;_0x1c689e<_0x59fe41['length'];_0x1c689e+=0x1){_0x1af39d=_0x59fe41[_0x1c689e]['MetricId']?_0x4dee9e[_0x59fe41[_0x1c689e][_0x2f2c('0x75')]]['metric']:_0x59fe41[_0x1c689e][_0x2f2c('0x6b')];_0x1af39d=_0x59fe41[_0x1c689e]['function']?_['replace'](_0x344949[_0x59fe41[_0x1c689e][_0x2f2c('0x8f')]],'%s',_0x1af39d):_0x1af39d;_0x1af39d=_0x59fe41[_0x1c689e]['format']?_[_0x2f2c('0x77')](_0x2658fe[_0x59fe41[_0x1c689e][_0x2f2c('0x78')]],'%s',_0x1af39d):_0x1af39d;if(_0x59fe41[_0x1c689e][_0x2f2c('0x79')]){_0x1d2d3a['group'](_0x1af39d);}_0x59fe41[_0x1c689e][_0x2f2c('0x7a')]&&_0x1d2d3a[_0x2f2c('0x39')](_0x1af39d,_0x59fe41[_0x1c689e][_0x2f2c('0x7a')]===_0x2f2c('0x7b')?![]:!![]);_0x1d2d3a[_0x2f2c('0x6b')](_0x1af39d,_0x59fe41[_0x1c689e][_0x2f2c('0xa3')]||_0x1af39d);}if(_0x11543d[_0x2f2c('0x7c')]){_0x11543d[_0x2f2c('0x7c')]=JSON[_0x2f2c('0x7d')](_0x11543d[_0x2f2c('0x7c')]);for(var _0x461955=0x0;_0x461955<_0x11543d[_0x2f2c('0x7c')][_0x2f2c('0x69')];_0x461955+=0x1){if(_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x30')]&&_[_0x2f2c('0x65')](_0x527b18,_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x30')])&&_0x11543d['joins'][_0x461955][_0x2f2c('0x7e')]&&_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x80')]&&_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x7f')]){_0x1d2d3a[_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x30')]](_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x80')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x11543d[_0x2f2c('0x74')],_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x7e')],_0x11543d[_0x2f2c('0x7c')][_0x461955][_0x2f2c('0x80')],_0x11543d['joins'][_0x461955]['foreignKey']));}}}if(_0x11543d[_0x2f2c('0x82')]){_0x11543d[_0x2f2c('0x82')]=JSON['parse'](_0x11543d['conditions']);_0x1d2d3a['where'](_0x4bf8ef(_0x11543d[_0x2f2c('0x82')][_0x2f2c('0x6a')]));}_0x1dfdc3=_0x1d2d3a[_0x2f2c('0x83')]();_0x1d2d3a[_0x2f2c('0x1c')](_0x1af2ee);_0x1d2d3a[_0x2f2c('0x1a')](0x0);logger[_0x2f2c('0xa4')]('Limited\x20Query:',_0x1d2d3a[_0x2f2c('0x85')]());return dbH['sequelize'][_0x2f2c('0x32')](_0x1d2d3a[_0x2f2c('0x85')](),{'type':dbH[_0x2f2c('0x86')][_0x2f2c('0x87')][_0x2f2c('0x88')]});}})[_0x2f2c('0x24')](function(){return{'sql':_0x1dfdc3[_0x2f2c('0x85')]()};})['then'](respondWithResult(_0x1613bd,null))[_0x2f2c('0x45')](handleError(_0x1613bd,null));};
\ No newline at end of file
+var _0x8bec=['Sequelize','ValidationErrorItem','AnalyticMetric','table','MetricId','replace','function','format','groupBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','Limited\x20Query:','toString','QueryTypes','SELECT','join','right_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','metric','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','savename','select','countTable','COUNT(*)','sequelize','run','DATE(%s)','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields'];(function(_0x34e5a8,_0x1670a4){var _0x5bc365=function(_0x47a389){while(--_0x47a389){_0x34e5a8['push'](_0x34e5a8['shift']());}};_0x5bc365(++_0x1670a4);}(_0x8bec,0xdd));var _0xc8be=function(_0x3701cf,_0x25c0b8){_0x3701cf=_0x3701cf-0x0;var _0x4ea60b=_0x8bec[_0x3701cf];return _0x4ea60b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8be('0x1'));var rp=require(_0xc8be('0x2'));var moment=require(_0xc8be('0x3'));var BPromise=require(_0xc8be('0x4'));var Mustache=require(_0xc8be('0x5'));var util=require('util');var path=require(_0xc8be('0x6'));var sox=require(_0xc8be('0x7'));var csv=require(_0xc8be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8be('0x9'));var squel=require(_0xc8be('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8be('0xb'));var deskjs=require(_0xc8be('0xc'));var toCsv=require(_0xc8be('0x8'));var querystring=require(_0xc8be('0xd'));var Papa=require(_0xc8be('0xe'));var Redis=require(_0xc8be('0xf'));var authService=require(_0xc8be('0x10'));var qs=require(_0xc8be('0x11'));var as=require(_0xc8be('0x12'));var hardwareService=require(_0xc8be('0x13'));var logger=require(_0xc8be('0x14'))(_0xc8be('0x15'));var utils=require('../../config/utils');var config=require(_0xc8be('0x16'));var licenseUtil=require(_0xc8be('0x17'));var db=require(_0xc8be('0x18'))['db'];var dbH=require('../../mysqldb')[_0xc8be('0x19')];function respondWithStatusCode(_0x51f0b0,_0xc81750){_0xc81750=_0xc81750||0xcc;return function(_0x3474c1){if(_0x3474c1){return _0x51f0b0[_0xc8be('0x1a')](_0xc81750);}return _0x51f0b0[_0xc8be('0x1b')](_0xc81750)['end']();};}function respondWithResult(_0x530ad4,_0x715138){_0x715138=_0x715138||0xc8;return function(_0x49f9d5){if(_0x49f9d5){return _0x530ad4[_0xc8be('0x1b')](_0x715138)[_0xc8be('0x1c')](_0x49f9d5);}};}function respondWithFilteredResult(_0x5bd966,_0x18ec0b){return function(_0x4ba583){if(_0x4ba583){var _0x48e5ca=typeof _0x18ec0b['offset']==='undefined'&&typeof _0x18ec0b[_0xc8be('0x1d')]===_0xc8be('0x1e');var _0x349c08=_0x4ba583[_0xc8be('0x1f')];var _0x5eaef5=_0x48e5ca?0x0:_0x18ec0b['offset'];var _0x28a34f=_0x48e5ca?_0x4ba583[_0xc8be('0x1f')]:_0x18ec0b[_0xc8be('0x20')]+_0x18ec0b[_0xc8be('0x1d')];var _0xa357cf;if(_0x28a34f>=_0x349c08){_0x28a34f=_0x349c08;_0xa357cf=0xc8;}else{_0xa357cf=0xce;}_0x5bd966[_0xc8be('0x1b')](_0xa357cf);return _0x5bd966[_0xc8be('0x21')](_0xc8be('0x22'),_0x5eaef5+'-'+_0x28a34f+'/'+_0x349c08)[_0xc8be('0x1c')](_0x4ba583);}return null;};}function patchUpdates(_0x4ed146){return function(_0x28e58b){try{jsonpatch[_0xc8be('0x23')](_0x28e58b,_0x4ed146,!![]);}catch(_0x1c34b8){return BPromise['reject'](_0x1c34b8);}return _0x28e58b[_0xc8be('0x24')]();};}function saveUpdates(_0x275020,_0x926280){return function(_0x4a6a15){if(_0x4a6a15){return _0x4a6a15[_0xc8be('0x25')](_0x275020)[_0xc8be('0x26')](function(_0x45d13f){return _0x45d13f;});}return null;};}function removeEntity(_0x3d529b,_0xa0ed02){return function(_0x5039a4){if(_0x5039a4){return _0x5039a4[_0xc8be('0x27')]()['then'](function(){var _0x17e0c8=_0x5039a4[_0xc8be('0x28')]({'plain':!![]});var _0x4b3354=_0xc8be('0x29');return db[_0xc8be('0x2a')][_0xc8be('0x27')]({'where':{'type':_0x4b3354,'resourceId':_0x17e0c8['id']}})[_0xc8be('0x26')](function(){return _0x5039a4;});})[_0xc8be('0x26')](function(){_0x3d529b[_0xc8be('0x1b')](0xcc)[_0xc8be('0x2b')]();});}};}function handleEntityNotFound(_0x326b19,_0x3d3183){return function(_0x2d0886){if(!_0x2d0886){_0x326b19[_0xc8be('0x1a')](0x194);}return _0x2d0886;};}function handleError(_0xccb34a,_0x11f8e9){_0x11f8e9=_0x11f8e9||0x1f4;return function(_0x29ff47){logger[_0xc8be('0x2c')](_0x29ff47['stack']);if(_0x29ff47[_0xc8be('0x2d')]){delete _0x29ff47[_0xc8be('0x2d')];}_0xccb34a[_0xc8be('0x1b')](_0x11f8e9)[_0xc8be('0x2e')](_0x29ff47);};}exports['index']=function(_0x5087ea,_0x1595b9){var _0x179f80={},_0x4eb9b6={},_0x170b2e={'count':0x0,'rows':[]};var _0x224548=_['map'](db[_0xc8be('0x2f')][_0xc8be('0x30')],function(_0x39c631){return{'name':_0x39c631[_0xc8be('0x31')],'type':_0x39c631[_0xc8be('0x32')][_0xc8be('0x33')]};});_0x4eb9b6[_0xc8be('0x34')]=_['map'](_0x224548,_0xc8be('0x2d'));_0x4eb9b6[_0xc8be('0x35')]=_[_0xc8be('0x36')](_0x5087ea[_0xc8be('0x35')]);_0x4eb9b6[_0xc8be('0x37')]=_[_0xc8be('0x38')](_0x4eb9b6[_0xc8be('0x34')],_0x4eb9b6[_0xc8be('0x35')]);_0x179f80[_0xc8be('0x39')]=_[_0xc8be('0x38')](_0x4eb9b6[_0xc8be('0x34')],qs[_0xc8be('0x3a')](_0x5087ea['query'][_0xc8be('0x3a')]));_0x179f80[_0xc8be('0x39')]=_0x179f80[_0xc8be('0x39')][_0xc8be('0x3b')]?_0x179f80[_0xc8be('0x39')]:_0x4eb9b6['model'];if(!_0x5087ea[_0xc8be('0x35')][_0xc8be('0x3c')]('nolimit')){_0x179f80['limit']=qs[_0xc8be('0x1d')](_0x5087ea['query']['limit']);_0x179f80[_0xc8be('0x20')]=qs[_0xc8be('0x20')](_0x5087ea[_0xc8be('0x35')]['offset']);}_0x179f80[_0xc8be('0x3d')]=qs[_0xc8be('0x3e')](_0x5087ea['query'][_0xc8be('0x3e')]);_0x179f80[_0xc8be('0x3f')]=qs[_0xc8be('0x37')](_[_0xc8be('0x40')](_0x5087ea[_0xc8be('0x35')],_0x4eb9b6[_0xc8be('0x37')]),_0x224548);if(_0x5087ea[_0xc8be('0x35')][_0xc8be('0x41')]){_0x179f80[_0xc8be('0x3f')]=_['merge'](_0x179f80['where'],{'$or':_[_0xc8be('0x42')](_0x224548,function(_0x2a20f8){if(_0x2a20f8[_0xc8be('0x32')]!==_0xc8be('0x43')){var _0x1da866={};_0x1da866[_0x2a20f8[_0xc8be('0x2d')]]={'$like':'%'+_0x5087ea['query'][_0xc8be('0x41')]+'%'};return _0x1da866;}})});}_0x179f80=_[_0xc8be('0x44')]({},_0x179f80,_0x5087ea[_0xc8be('0x45')]);var _0x10da5c={'where':_0x179f80['where']};return db[_0xc8be('0x2f')]['count'](_0x10da5c)[_0xc8be('0x26')](function(_0x147698){_0x170b2e[_0xc8be('0x1f')]=_0x147698;if(_0x5087ea[_0xc8be('0x35')][_0xc8be('0x46')]){_0x179f80['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xc8be('0x47')](_0x179f80);})['then'](function(_0x120ba3){_0x170b2e[_0xc8be('0x48')]=_0x120ba3;return _0x170b2e;})[_0xc8be('0x26')](respondWithFilteredResult(_0x1595b9,_0x179f80))[_0xc8be('0x49')](handleError(_0x1595b9,null));};exports['show']=function(_0x3de8da,_0x5ade06){var _0x44fff4={'raw':![],'where':{'id':_0x3de8da[_0xc8be('0x4a')]['id']}},_0x5e6524={};_0x5e6524[_0xc8be('0x34')]=_[_0xc8be('0x36')](db[_0xc8be('0x2f')][_0xc8be('0x30')]);_0x5e6524[_0xc8be('0x35')]=_[_0xc8be('0x36')](_0x3de8da['query']);_0x5e6524['filters']=_[_0xc8be('0x38')](_0x5e6524[_0xc8be('0x34')],_0x5e6524['query']);_0x44fff4[_0xc8be('0x39')]=_['intersection'](_0x5e6524['model'],qs[_0xc8be('0x3a')](_0x3de8da['query'][_0xc8be('0x3a')]));_0x44fff4[_0xc8be('0x39')]=_0x44fff4[_0xc8be('0x39')][_0xc8be('0x3b')]?_0x44fff4[_0xc8be('0x39')]:_0x5e6524[_0xc8be('0x34')];if(_0x3de8da[_0xc8be('0x35')][_0xc8be('0x46')]){_0x44fff4[_0xc8be('0x4b')]=[{'all':!![]}];}_0x44fff4=_[_0xc8be('0x44')]({},_0x44fff4,_0x3de8da['options']);return db[_0xc8be('0x2f')]['find'](_0x44fff4)[_0xc8be('0x26')](handleEntityNotFound(_0x5ade06,null))[_0xc8be('0x26')](respondWithResult(_0x5ade06,null))[_0xc8be('0x49')](handleError(_0x5ade06,null));};exports[_0xc8be('0x4c')]=function(_0x472673,_0x48cb1f){return db['AnalyticCustomReport'][_0xc8be('0x4c')](_0x472673[_0xc8be('0x4d')],{})['then'](function(_0x3d1431){var _0x3ff5dd=_0x472673['user'][_0xc8be('0x28')]({'plain':!![]});if(!_0x3ff5dd)throw new Error(_0xc8be('0x4e'));if(_0x3ff5dd[_0xc8be('0x4f')]==='user'){var _0x15ec9e=_0x3d1431[_0xc8be('0x28')]({'plain':!![]});var _0x2d2d07=_0xc8be('0x50');return db[_0xc8be('0x51')]['find']({'where':{'name':_0x2d2d07,'userProfileId':_0x3ff5dd[_0xc8be('0x52')]},'raw':!![]})['then'](function(_0x235e96){if(_0x235e96&&_0x235e96[_0xc8be('0x53')]===0x0){return db[_0xc8be('0x2a')]['create']({'name':_0x15ec9e['name'],'resourceId':_0x15ec9e['id'],'type':_0xc8be('0x29'),'sectionId':_0x235e96['id']},{})[_0xc8be('0x26')](function(){return _0x3d1431;});}else{return _0x3d1431;}})[_0xc8be('0x49')](function(_0x2c07c9){logger[_0xc8be('0x2c')](_0xc8be('0x54'),_0x2c07c9);throw _0x2c07c9;});}return _0x3d1431;})[_0xc8be('0x26')](respondWithResult(_0x48cb1f,0xc9))['catch'](handleError(_0x48cb1f,null));};exports[_0xc8be('0x25')]=function(_0x3d5af8,_0x4b128f){if(_0x3d5af8[_0xc8be('0x4d')]['id']){delete _0x3d5af8[_0xc8be('0x4d')]['id'];}return db[_0xc8be('0x2f')]['find']({'where':{'id':_0x3d5af8[_0xc8be('0x4a')]['id']}})[_0xc8be('0x26')](handleEntityNotFound(_0x4b128f,null))[_0xc8be('0x26')](saveUpdates(_0x3d5af8['body'],null))[_0xc8be('0x26')](respondWithResult(_0x4b128f,null))[_0xc8be('0x49')](handleError(_0x4b128f,null));};exports[_0xc8be('0x27')]=function(_0x593e95,_0x2e6015){return db[_0xc8be('0x2f')][_0xc8be('0x55')]({'where':{'id':_0x593e95[_0xc8be('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e6015,null))[_0xc8be('0x26')](removeEntity(_0x2e6015,null))['catch'](handleError(_0x2e6015,null));};exports[_0xc8be('0x56')]=function(_0x455072,_0x2fcafd){var _0x5d3629=0xa;var _0x4c4964=['join',_0xc8be('0x57'),'right_join',_0xc8be('0x58')];var _0xadab50={'SUM':'SUM(%s)','COUNT':_0xc8be('0x59'),'COUNT DISTINCT':_0xc8be('0x5a'),'MAX':_0xc8be('0x5b'),'MIN':'MIN(%s)','AVG':_0xc8be('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc8be('0x5d'),'GROUP_CONCAT DESC':_0xc8be('0x5e')};var _0x311678={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xc8be('0x5f'),'UNIX_TIMESTAMP':_0xc8be('0x60')};var _0x430756=function(_0x212ec6){return!_[_0xc8be('0x61')](['IS\x20NULL',_0xc8be('0x62'),_0xc8be('0x63'),_0xc8be('0x64')],_0x212ec6);};var _0x43e1b8=function(_0x2e31de){if(!_0x2e31de||!_0x2e31de[_0xc8be('0x65')][_0xc8be('0x3b')]){return'';}for(var _0x5329c8='(',_0x393e50=0x0;_0x393e50<_0x2e31de[_0xc8be('0x65')][_0xc8be('0x3b')];_0x393e50+=0x1){_0x393e50>0x0&&(_0x5329c8+='\x20'+_0x2e31de[_0xc8be('0x66')]+'\x20');_0x5329c8+=_0x2e31de[_0xc8be('0x65')][_0x393e50][_0xc8be('0x67')]?_0x43e1b8(_0x2e31de[_0xc8be('0x65')][_0x393e50][_0xc8be('0x67')]):_0x2e31de[_0xc8be('0x65')][_0x393e50][_0xc8be('0x68')]+'\x20'+_0x2e31de[_0xc8be('0x65')][_0x393e50][_0xc8be('0x69')]+(_0x430756(_0x2e31de[_0xc8be('0x65')][_0x393e50][_0xc8be('0x69')])?'\x20'+_0x2e31de[_0xc8be('0x65')][_0x393e50]['value']:'');}return _0x5329c8+')';};var _0x4ff668={'where':{'id':_0x455072['params']['id']}},_0x485220,_0x9dacf,_0x5ad2f6,_0x2869e9,_0x108ec6;_0x4ff668=_[_0xc8be('0x44')]({},_0x4ff668,_0x455072['options']);return db['AnalyticCustomReport']['find'](_0x4ff668)['then'](function(_0x2fa9e0){if(_0x2fa9e0){_0x485220=_0x2fa9e0;return _0x2fa9e0[_0xc8be('0x6a')]();}return null;})[_0xc8be('0x26')](function(_0xbc2525){if(_0xbc2525){if(!_0xbc2525[_0xc8be('0x3b')]){throw new db[(_0xc8be('0x6b'))][(_0xc8be('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x9dacf=_0xbc2525;return db[_0xc8be('0x6d')][_0xc8be('0x47')]({'raw':!![]});}return null;})[_0xc8be('0x26')](function(_0xe065a0){if(_0xe065a0){_0x5ad2f6=_['keyBy'](_0xe065a0,'id');var _0x330423;var _0x419288=squel['select']();_0x419288['from'](_0x485220[_0xc8be('0x6e')]);for(var _0x3f1c05=0x0;_0x3f1c05<_0x9dacf[_0xc8be('0x3b')];_0x3f1c05+=0x1){_0x330423=_0x9dacf[_0x3f1c05][_0xc8be('0x6f')]?_0x5ad2f6[_0x9dacf[_0x3f1c05][_0xc8be('0x6f')]]['metric']:_0x9dacf[_0x3f1c05][_0xc8be('0x68')];_0x330423=_0x9dacf[_0x3f1c05]['function']?_[_0xc8be('0x70')](_0xadab50[_0x9dacf[_0x3f1c05][_0xc8be('0x71')]],'%s',_0x330423):_0x330423;_0x330423=_0x9dacf[_0x3f1c05]['format']?_[_0xc8be('0x70')](_0x311678[_0x9dacf[_0x3f1c05][_0xc8be('0x72')]],'%s',_0x330423):_0x330423;if(_0x9dacf[_0x3f1c05][_0xc8be('0x73')]){_0x419288[_0xc8be('0x67')](_0x330423);}_0x9dacf[_0x3f1c05]['orderBy']&&_0x419288[_0xc8be('0x3d')](_0x330423,_0x9dacf[_0x3f1c05]['orderBy']===_0xc8be('0x74')?![]:!![]);_0x419288[_0xc8be('0x68')](_0x330423,_0x9dacf[_0x3f1c05][_0xc8be('0x75')]||_0x330423);}if(_0x485220[_0xc8be('0x76')]){_0x485220[_0xc8be('0x76')]=JSON['parse'](_0x485220[_0xc8be('0x76')]);for(var _0x21cd12=0x0;_0x21cd12<_0x485220[_0xc8be('0x76')][_0xc8be('0x3b')];_0x21cd12+=0x1){if(_0x485220['joins'][_0x21cd12][_0xc8be('0x32')]&&_[_0xc8be('0x61')](_0x4c4964,_0x485220[_0xc8be('0x76')][_0x21cd12][_0xc8be('0x32')])&&_0x485220[_0xc8be('0x76')][_0x21cd12][_0xc8be('0x77')]&&_0x485220[_0xc8be('0x76')][_0x21cd12]['foreignTable']&&_0x485220[_0xc8be('0x76')][_0x21cd12]['foreignKey']){_0x419288[_0x485220[_0xc8be('0x76')][_0x21cd12]['type']](_0x485220[_0xc8be('0x76')][_0x21cd12][_0xc8be('0x78')],null,util[_0xc8be('0x72')](_0xc8be('0x79'),_0x485220[_0xc8be('0x6e')],_0x485220[_0xc8be('0x76')][_0x21cd12][_0xc8be('0x77')],_0x485220[_0xc8be('0x76')][_0x21cd12][_0xc8be('0x78')],_0x485220[_0xc8be('0x76')][_0x21cd12][_0xc8be('0x7a')]));}}}if(_0x485220[_0xc8be('0x7b')]){_0x485220['conditions']=JSON[_0xc8be('0x7c')](_0x485220['conditions']);_0x419288[_0xc8be('0x3f')](_0x43e1b8(_0x485220[_0xc8be('0x7b')][_0xc8be('0x67')]));}_0x108ec6=_0x419288[_0xc8be('0x7d')]();_0x419288['limit'](_0x5d3629);_0x419288[_0xc8be('0x20')](0x0);logger['debug'](_0xc8be('0x7e'),_0x419288[_0xc8be('0x7f')]());return dbH['sequelize'][_0xc8be('0x35')](_0x419288['toString'](),{'type':dbH['sequelize'][_0xc8be('0x80')][_0xc8be('0x81')]});}})[_0xc8be('0x26')](respondWithResult(_0x2fcafd,null))['catch'](handleError(_0x2fcafd,null));};function runReport(_0x688161,_0x3870fb,_0x1f2020){var _0x28dd19=_0x3870fb[_0xc8be('0x2d')];var _0x147cd7=0xa;var _0xa383b6=[_0xc8be('0x82'),'left_join',_0xc8be('0x83'),_0xc8be('0x58')];var _0x41fa9b={'SUM':_0xc8be('0x84'),'COUNT':_0xc8be('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc8be('0x5b'),'MIN':_0xc8be('0x85'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc8be('0x86'),'GROUP_CONCAT ASC':_0xc8be('0x5d'),'GROUP_CONCAT DESC':_0xc8be('0x5e')};var _0xc4b85b={'SEC_TO_TIME':_0xc8be('0x87'),'DATE':'DATE(%s)','HOUR':_0xc8be('0x88'),'ROUND':_0xc8be('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x53b3d2=function(_0x263803){return!_['includes']([_0xc8be('0x89'),'IS\x20NOT\x20NULL',_0xc8be('0x63'),'IS\x20NOT\x20EMPTY'],_0x263803);};var _0x6fc3d3=function(_0x3fced6){if(!_0x3fced6||!_0x3fced6['rules']['length']){return'';}for(var _0x593dd0='(',_0x20fd0b=0x0;_0x20fd0b<_0x3fced6['rules'][_0xc8be('0x3b')];_0x20fd0b+=0x1){_0x20fd0b>0x0&&(_0x593dd0+='\x20'+_0x3fced6[_0xc8be('0x66')]+'\x20');_0x593dd0+=_0x3fced6['rules'][_0x20fd0b][_0xc8be('0x67')]?_0x6fc3d3(_0x3fced6[_0xc8be('0x65')][_0x20fd0b][_0xc8be('0x67')]):_0x3fced6[_0xc8be('0x65')][_0x20fd0b][_0xc8be('0x68')]+'\x20'+_0x3fced6[_0xc8be('0x65')][_0x20fd0b][_0xc8be('0x69')]+(_0x53b3d2(_0x3fced6[_0xc8be('0x65')][_0x20fd0b][_0xc8be('0x69')])?'\x20'+_0x3fced6[_0xc8be('0x65')][_0x20fd0b]['value']:'');}return _0x593dd0+')';};var _0x2bb7f9={'where':{'id':_0x688161['id']}},_0x32b758,_0x1a9162,_0x33bdcf,_0x5a69ad,_0x596c3b;_0x2bb7f9=_[_0xc8be('0x44')]({},_0x2bb7f9,_0x1f2020);return db[_0xc8be('0x2f')][_0xc8be('0x55')](_0x2bb7f9)[_0xc8be('0x26')](function(_0x3c7d22){if(_0x3c7d22){_0x32b758=_0x3c7d22;return _0x3c7d22[_0xc8be('0x6a')]();}return null;})[_0xc8be('0x26')](function(_0x34448e){if(_0x34448e){if(!_0x34448e['length']){throw new db['Sequelize'][(_0xc8be('0x6c'))](_0xc8be('0x8a'),0x193);}_0x1a9162=_0x34448e;return db['AnalyticMetric'][_0xc8be('0x47')]({'raw':!![]});}return null;})[_0xc8be('0x26')](function(_0x3ce586){if(_0x3ce586){_0x33bdcf=_[_0xc8be('0x8b')](_0x3ce586,'id');var _0x2c5407;var _0x4e5272=squel['select']();_0x4e5272[_0xc8be('0x8c')](_0x32b758[_0xc8be('0x6e')]);for(var _0x470c99=0x0;_0x470c99<_0x1a9162[_0xc8be('0x3b')];_0x470c99+=0x1){_0x2c5407=_0x1a9162[_0x470c99]['MetricId']?_0x33bdcf[_0x1a9162[_0x470c99][_0xc8be('0x6f')]][_0xc8be('0x8d')]:_0x1a9162[_0x470c99]['field'];_0x2c5407=_0x1a9162[_0x470c99][_0xc8be('0x71')]?_[_0xc8be('0x70')](_0x41fa9b[_0x1a9162[_0x470c99]['function']],'%s',_0x2c5407):_0x2c5407;_0x2c5407=_0x1a9162[_0x470c99]['format']?_[_0xc8be('0x70')](_0xc4b85b[_0x1a9162[_0x470c99]['format']],'%s',_0x2c5407):_0x2c5407;if(_0x1a9162[_0x470c99]['groupBy']){_0x4e5272['group'](_0x2c5407);}_0x1a9162[_0x470c99][_0xc8be('0x8e')]&&_0x4e5272[_0xc8be('0x3d')](_0x2c5407,_0x1a9162[_0x470c99][_0xc8be('0x8e')]==='DESC'?![]:!![]);_0x4e5272[_0xc8be('0x68')](_0x2c5407,_0x1a9162[_0x470c99][_0xc8be('0x75')]||_0x2c5407);}if(_0x32b758['joins']){_0x32b758[_0xc8be('0x76')]=JSON[_0xc8be('0x7c')](_0x32b758['joins']);for(var _0x55beaa=0x0;_0x55beaa<_0x32b758['joins'][_0xc8be('0x3b')];_0x55beaa+=0x1){if(_0x32b758[_0xc8be('0x76')][_0x55beaa]['type']&&_[_0xc8be('0x61')](_0xa383b6,_0x32b758[_0xc8be('0x76')][_0x55beaa]['type'])&&_0x32b758[_0xc8be('0x76')][_0x55beaa]['parentKey']&&_0x32b758[_0xc8be('0x76')][_0x55beaa]['foreignTable']&&_0x32b758[_0xc8be('0x76')][_0x55beaa][_0xc8be('0x7a')]){_0x4e5272[_0x32b758[_0xc8be('0x76')][_0x55beaa][_0xc8be('0x32')]](_0x32b758[_0xc8be('0x76')][_0x55beaa][_0xc8be('0x78')],null,util['format'](_0xc8be('0x79'),_0x32b758['table'],_0x32b758[_0xc8be('0x76')][_0x55beaa]['parentKey'],_0x32b758[_0xc8be('0x76')][_0x55beaa][_0xc8be('0x78')],_0x32b758[_0xc8be('0x76')][_0x55beaa][_0xc8be('0x7a')]));}}}if(_0x32b758[_0xc8be('0x7b')]){_0x32b758[_0xc8be('0x7b')]=JSON['parse'](_0x32b758[_0xc8be('0x7b')]);_0x4e5272[_0xc8be('0x3f')](_0x6fc3d3(_0x32b758[_0xc8be('0x7b')][_0xc8be('0x67')]));}_0x596c3b=_0x4e5272[_0xc8be('0x7d')]();_0x4e5272[_0xc8be('0x1d')](_0x147cd7);_0x4e5272[_0xc8be('0x20')](0x0);return;}})['then'](function(){if(_0x3870fb[_0xc8be('0x8f')]===_0xc8be('0x90')){return null;}var _0x548685=_[_0xc8be('0x44')](_0x3870fb,{'name':_0x3870fb[_0xc8be('0x91')]||_0x3870fb[_0xc8be('0x2d')]||_0x32b758['name'],'basename':_0x28dd19,'savename':util['format'](_0xc8be('0x92'),_0x3870fb[_0xc8be('0x2d')]||_0x32b758[_0xc8be('0x2d')],require(_0xc8be('0x93'))[_0xc8be('0x94')](0x4),_0x3870fb[_0xc8be('0x8f')]||_0xc8be('0x95')),'reportId':_0x32b758['id'],'reportType':_0xc8be('0x96')});return db[_0xc8be('0x97')][_0xc8be('0x4c')](_0x548685,{'raw':!![]});})['then'](function(_0x34cdfe){if(_0x32b758[_0xc8be('0x6e')]==='cdr'){_0x596c3b[_0xc8be('0x3f')](_0x32b758[_0xc8be('0x6e')]+_0xc8be('0x98'),_0x3870fb[_0xc8be('0x99')],_0x3870fb[_0xc8be('0x9a')]);}else{_0x596c3b[_0xc8be('0x3f')](_0x32b758[_0xc8be('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3870fb[_0xc8be('0x99')],_0x3870fb[_0xc8be('0x9a')]);}if(_0x34cdfe){logger[_0xc8be('0x9b')](_0xc8be('0x9c'),_0x596c3b['toString']());require('child_process')['fork'](path[_0xc8be('0x82')](__dirname,'../../components/export/',_0x34cdfe['output']),[_0x34cdfe['id'],_0x596c3b['toString'](),path[_0xc8be('0x82')](__dirname,'../../files/reports',_0x34cdfe[_0xc8be('0x9d')]),_0x28dd19]);return _0x34cdfe;}else{var _0x473864=squel[_0xc8be('0x9e')]();_0x473864[_0xc8be('0x8c')]('('+_0x596c3b[_0xc8be('0x7f')]()+')',_0xc8be('0x9f'));_0x473864[_0xc8be('0x68')](_0xc8be('0xa0'),_0xc8be('0x1f'));_0x596c3b[_0xc8be('0x1d')](_0x3870fb['limit']||_0x147cd7);_0x596c3b['offset'](_0x3870fb[_0xc8be('0x20')]||0x0);return dbH['sequelize'][_0xc8be('0x35')](_0x473864[_0xc8be('0x7f')](),{'type':dbH['sequelize'][_0xc8be('0x80')][_0xc8be('0x81')]})[_0xc8be('0x26')](function(_0x5e162c){if(!_0x5e162c['length']){_0x5a69ad=0x0;}else{_0x5a69ad=_0x5e162c[0x0][_0xc8be('0x1f')]||0x0;}return dbH[_0xc8be('0xa1')][_0xc8be('0x35')](_0x596c3b[_0xc8be('0x7f')](),{'type':dbH[_0xc8be('0xa1')][_0xc8be('0x80')][_0xc8be('0x81')]});})[_0xc8be('0x26')](function(_0x5d19fb){return{'rows':_0x5d19fb||[],'count':_0x5a69ad};});}});}exports[_0xc8be('0xa2')]=function(_0x135519,_0x39df69){return runReport(_0x135519['params'],_0x135519['query'],_0x135519['options'])[_0xc8be('0x26')](respondWithResult(_0x39df69,null))[_0xc8be('0x49')](handleError(_0x39df69,null));};exports['runReport']=runReport;exports[_0xc8be('0x35')]=function(_0x20eaeb,_0x5459a8){var _0x2832c3=0xa;var _0x20bea8=[_0xc8be('0x82'),_0xc8be('0x57'),_0xc8be('0x83'),_0xc8be('0x58')];var _0x58ed5f={'SUM':_0xc8be('0x84'),'COUNT':_0xc8be('0x59'),'COUNT DISTINCT':_0xc8be('0x5a'),'MAX':_0xc8be('0x5b'),'MIN':_0xc8be('0x85'),'AVG':_0xc8be('0x5c'),'GROUP_CONCAT':_0xc8be('0x86'),'GROUP_CONCAT ASC':_0xc8be('0x5d'),'GROUP_CONCAT DESC':_0xc8be('0x5e')};var _0x4b7ae5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc8be('0xa3'),'HOUR':'HOUR(%s)','ROUND':_0xc8be('0x5f'),'UNIX_TIMESTAMP':_0xc8be('0x60')};var _0x3738fb=function(_0x2d2f9e){return!_['includes']([_0xc8be('0x89'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2d2f9e);};var _0xb3f27a=function(_0x2f3c8c){if(!_0x2f3c8c||!_0x2f3c8c[_0xc8be('0x65')]['length']){return'';}for(var _0x1cbc3e='(',_0x494b15=0x0;_0x494b15<_0x2f3c8c[_0xc8be('0x65')][_0xc8be('0x3b')];_0x494b15+=0x1){_0x494b15>0x0&&(_0x1cbc3e+='\x20'+_0x2f3c8c[_0xc8be('0x66')]+'\x20');_0x1cbc3e+=_0x2f3c8c[_0xc8be('0x65')][_0x494b15]['group']?_0xb3f27a(_0x2f3c8c[_0xc8be('0x65')][_0x494b15][_0xc8be('0x67')]):_0x2f3c8c[_0xc8be('0x65')][_0x494b15][_0xc8be('0x68')]+'\x20'+_0x2f3c8c[_0xc8be('0x65')][_0x494b15]['condition']+(_0x3738fb(_0x2f3c8c[_0xc8be('0x65')][_0x494b15][_0xc8be('0x69')])?'\x20'+_0x2f3c8c[_0xc8be('0x65')][_0x494b15]['value']:'');}return _0x1cbc3e+')';};var _0x4d9b54={'where':{'id':_0x20eaeb[_0xc8be('0x4a')]['id']}},_0x2d16bc,_0xf1d11c,_0x383f81,_0xd992b1,_0x152bf1;_0x4d9b54=_[_0xc8be('0x44')]({},_0x4d9b54,_0x20eaeb[_0xc8be('0x45')]);return db['AnalyticCustomReport'][_0xc8be('0x55')](_0x4d9b54)[_0xc8be('0x26')](function(_0x2db12c){if(_0x2db12c){_0x2d16bc=_0x2db12c;return _0x2db12c[_0xc8be('0x6a')]();}return null;})[_0xc8be('0x26')](function(_0x512a8c){if(_0x512a8c){if(!_0x512a8c[_0xc8be('0x3b')]){throw new db[(_0xc8be('0x6b'))][(_0xc8be('0x6c'))](_0xc8be('0x8a'),0x193);}_0xf1d11c=_0x512a8c;return db[_0xc8be('0x6d')][_0xc8be('0x47')]({'raw':!![]});}return null;})[_0xc8be('0x26')](function(_0x24842c){if(_0x24842c){_0x383f81=_[_0xc8be('0x8b')](_0x24842c,'id');var _0x3fe10e;var _0x2a88c9=squel[_0xc8be('0x9e')]();_0x2a88c9['from'](_0x2d16bc[_0xc8be('0x6e')]);for(var _0x1e5e20=0x0;_0x1e5e20<_0xf1d11c[_0xc8be('0x3b')];_0x1e5e20+=0x1){_0x3fe10e=_0xf1d11c[_0x1e5e20]['MetricId']?_0x383f81[_0xf1d11c[_0x1e5e20][_0xc8be('0x6f')]][_0xc8be('0x8d')]:_0xf1d11c[_0x1e5e20][_0xc8be('0x68')];_0x3fe10e=_0xf1d11c[_0x1e5e20][_0xc8be('0x71')]?_[_0xc8be('0x70')](_0x58ed5f[_0xf1d11c[_0x1e5e20][_0xc8be('0x71')]],'%s',_0x3fe10e):_0x3fe10e;_0x3fe10e=_0xf1d11c[_0x1e5e20][_0xc8be('0x72')]?_[_0xc8be('0x70')](_0x4b7ae5[_0xf1d11c[_0x1e5e20]['format']],'%s',_0x3fe10e):_0x3fe10e;if(_0xf1d11c[_0x1e5e20][_0xc8be('0x73')]){_0x2a88c9[_0xc8be('0x67')](_0x3fe10e);}_0xf1d11c[_0x1e5e20]['orderBy']&&_0x2a88c9[_0xc8be('0x3d')](_0x3fe10e,_0xf1d11c[_0x1e5e20][_0xc8be('0x8e')]===_0xc8be('0x74')?![]:!![]);_0x2a88c9[_0xc8be('0x68')](_0x3fe10e,_0xf1d11c[_0x1e5e20]['alias']||_0x3fe10e);}if(_0x2d16bc[_0xc8be('0x76')]){_0x2d16bc[_0xc8be('0x76')]=JSON[_0xc8be('0x7c')](_0x2d16bc[_0xc8be('0x76')]);for(var _0x39f3fd=0x0;_0x39f3fd<_0x2d16bc['joins'][_0xc8be('0x3b')];_0x39f3fd+=0x1){if(_0x2d16bc['joins'][_0x39f3fd]['type']&&_[_0xc8be('0x61')](_0x20bea8,_0x2d16bc[_0xc8be('0x76')][_0x39f3fd][_0xc8be('0x32')])&&_0x2d16bc['joins'][_0x39f3fd][_0xc8be('0x77')]&&_0x2d16bc[_0xc8be('0x76')][_0x39f3fd][_0xc8be('0x78')]&&_0x2d16bc['joins'][_0x39f3fd][_0xc8be('0x7a')]){_0x2a88c9[_0x2d16bc['joins'][_0x39f3fd][_0xc8be('0x32')]](_0x2d16bc['joins'][_0x39f3fd]['foreignTable'],null,util[_0xc8be('0x72')](_0xc8be('0x79'),_0x2d16bc['table'],_0x2d16bc[_0xc8be('0x76')][_0x39f3fd]['parentKey'],_0x2d16bc[_0xc8be('0x76')][_0x39f3fd][_0xc8be('0x78')],_0x2d16bc[_0xc8be('0x76')][_0x39f3fd][_0xc8be('0x7a')]));}}}if(_0x2d16bc[_0xc8be('0x7b')]){_0x2d16bc['conditions']=JSON['parse'](_0x2d16bc[_0xc8be('0x7b')]);_0x2a88c9[_0xc8be('0x3f')](_0xb3f27a(_0x2d16bc[_0xc8be('0x7b')][_0xc8be('0x67')]));}_0x152bf1=_0x2a88c9[_0xc8be('0x7d')]();_0x2a88c9['limit'](_0x2832c3);_0x2a88c9[_0xc8be('0x20')](0x0);logger['debug'](_0xc8be('0x7e'),_0x2a88c9['toString']());return dbH['sequelize'][_0xc8be('0x35')](_0x2a88c9[_0xc8be('0x7f')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0xc8be('0x26')](function(){return{'sql':_0x152bf1[_0xc8be('0x7f')]()};})[_0xc8be('0x26')](respondWithResult(_0x5459a8,null))[_0xc8be('0x49')](handleError(_0x5459a8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index cdf6e96..597cd9b 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 _0xbb3d=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2cc74b,_0x29ab49){var _0x44213c=function(_0x38cf75){while(--_0x38cf75){_0x2cc74b['push'](_0x2cc74b['shift']());}};_0x44213c(++_0x29ab49);}(_0xbb3d,0x132));var _0xdbb3=function(_0x4dac30,_0x3b1e61){_0x4dac30=_0x4dac30-0x0;var _0x4ae741=_0xbb3d[_0x4dac30];return _0x4ae741;};'use strict';var _=require(_0xdbb3('0x0'));var util=require('util');var logger=require(_0xdbb3('0x1'))(_0xdbb3('0x2'));var moment=require(_0xdbb3('0x3'));var BPromise=require(_0xdbb3('0x4'));var rp=require(_0xdbb3('0x5'));var fs=require('fs');var path=require(_0xdbb3('0x6'));var rimraf=require(_0xdbb3('0x7'));var config=require('../../config/environment');var attributes=require(_0xdbb3('0x8'));module[_0xdbb3('0x9')]=function(_0x3f212e,_0xb6a001){return _0x3f212e[_0xdbb3('0xa')](_0xdbb3('0xb'),attributes,{'tableName':_0xdbb3('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f78=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4c028a,_0x374103){var _0xf118a7=function(_0x3ab377){while(--_0x3ab377){_0x4c028a['push'](_0x4c028a['shift']());}};_0xf118a7(++_0x374103);}(_0x9f78,0x97));var _0x89f7=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x9f78[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0x89f7('0x0'));var util=require('util');var logger=require(_0x89f7('0x1'))(_0x89f7('0x2'));var moment=require(_0x89f7('0x3'));var BPromise=require(_0x89f7('0x4'));var rp=require(_0x89f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89f7('0x6'));var config=require(_0x89f7('0x7'));var attributes=require(_0x89f7('0x8'));module[_0x89f7('0x9')]=function(_0x13bdbf,_0x33c68e){return _0x13bdbf[_0x89f7('0xa')](_0x89f7('0xb'),attributes,{'tableName':_0x89f7('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 2fdafb0..10c1688 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 _0xb63f=['http','request','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x504b79,_0x4115b0){var _0x10f21a=function(_0x36dcb9){while(--_0x36dcb9){_0x504b79['push'](_0x504b79['shift']());}};_0x10f21a(++_0x4115b0);}(_0xb63f,0xb5));var _0xfb63=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0xb63f[_0x27a3cb];return _0x54ff38;};'use strict';var _=require(_0xfb63('0x0'));var util=require(_0xfb63('0x1'));var moment=require(_0xfb63('0x2'));var BPromise=require(_0xfb63('0x3'));var rs=require(_0xfb63('0x4'));var fs=require('fs');var Redis=require(_0xfb63('0x5'));var db=require(_0xfb63('0x6'))['db'];var utils=require(_0xfb63('0x7'));var logger=require('../../config/logger')(_0xfb63('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb63('0x9'));var client=jayson[_0xfb63('0xa')][_0xfb63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f37e4,_0x8b59fa,_0x19b167){return new BPromise(function(_0x2f9e19,_0x2ae4ba){return client[_0xfb63('0xc')](_0x1f37e4,_0x19b167)[_0xfb63('0xd')](function(_0x4590e2){logger[_0xfb63('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8b59fa,'request\x20sent');logger[_0xfb63('0xf')](_0xfb63('0x10'),_0x8b59fa,_0xfb63('0x11'),JSON[_0xfb63('0x12')](_0x4590e2));if(_0x4590e2[_0xfb63('0x13')]){if(_0x4590e2['error'][_0xfb63('0x14')]===0x1f4){logger[_0xfb63('0x13')](_0xfb63('0x15'),_0x8b59fa,_0x4590e2[_0xfb63('0x13')][_0xfb63('0x16')]);return _0x2ae4ba(_0x4590e2[_0xfb63('0x13')][_0xfb63('0x16')]);}logger[_0xfb63('0x13')](_0xfb63('0x15'),_0x8b59fa,_0x4590e2['error']['message']);return _0x2f9e19(_0x4590e2[_0xfb63('0x13')][_0xfb63('0x16')]);}else{logger[_0xfb63('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8b59fa,_0xfb63('0x11'));_0x2f9e19(_0x4590e2['result']['message']);}})[_0xfb63('0x17')](function(_0x26e7b3){logger[_0xfb63('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x8b59fa,_0x26e7b3);_0x2ae4ba(_0x26e7b3);});});}
\ No newline at end of file
+var _0x4cda=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','moment'];(function(_0x3ee91e,_0x466a5a){var _0x239405=function(_0x3f2d09){while(--_0x3f2d09){_0x3ee91e['push'](_0x3ee91e['shift']());}};_0x239405(++_0x466a5a);}(_0x4cda,0x86));var _0xa4cd=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4cda[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xa4cd('0x0'));var util=require('util');var moment=require(_0xa4cd('0x1'));var BPromise=require(_0xa4cd('0x2'));var rs=require(_0xa4cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa4cd('0x4'));var logger=require(_0xa4cd('0x5'))(_0xa4cd('0x6'));var config=require(_0xa4cd('0x7'));var jayson=require(_0xa4cd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30c845,_0x569074,_0x46a1fe){return new BPromise(function(_0x2663fc,_0x5aea0c){return client[_0xa4cd('0x9')](_0x30c845,_0x46a1fe)['then'](function(_0x9cfc8f){logger[_0xa4cd('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x569074,_0xa4cd('0xb'));logger[_0xa4cd('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x569074,'request\x20sent',JSON['stringify'](_0x9cfc8f));if(_0x9cfc8f['error']){if(_0x9cfc8f[_0xa4cd('0xd')]['code']===0x1f4){logger[_0xa4cd('0xd')](_0xa4cd('0xe'),_0x569074,_0x9cfc8f[_0xa4cd('0xd')][_0xa4cd('0xf')]);return _0x5aea0c(_0x9cfc8f['error'][_0xa4cd('0xf')]);}logger['error'](_0xa4cd('0xe'),_0x569074,_0x9cfc8f['error'][_0xa4cd('0xf')]);return _0x2663fc(_0x9cfc8f['error']['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x569074,'request\x20sent');_0x2663fc(_0x9cfc8f[_0xa4cd('0x10')]['message']);}})['catch'](function(_0x2c3f8d){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x569074,_0x2c3f8d);_0x5aea0c(_0x2c3f8d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 1181008..6205bc1 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 _0x7383=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3cc69f,_0x7eb3f3){var _0x3f8719=function(_0x893a0f){while(--_0x893a0f){_0x3cc69f['push'](_0x3cc69f['shift']());}};_0x3f8719(++_0x7eb3f3);}(_0x7383,0xb1));var _0x3738=function(_0x3cd41d,_0x1bc2ec){_0x3cd41d=_0x3cd41d-0x0;var _0x535d9e=_0x7383[_0x3cd41d];return _0x535d9e;};'use strict';var multer=require(_0x3738('0x0'));var util=require(_0x3738('0x1'));var path=require(_0x3738('0x2'));var timeout=require(_0x3738('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3738('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3738('0x5'));var config=require(_0x3738('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x3738('0x7')]('/',auth[_0x3738('0x8')](),controller[_0x3738('0x9')]);router[_0x3738('0x7')](_0x3738('0xa'),auth[_0x3738('0x8')](),controller[_0x3738('0xb')]);router[_0x3738('0x7')](_0x3738('0xc'),auth['isAuthenticated'](),controller[_0x3738('0xd')]);router['get'](_0x3738('0xe'),auth[_0x3738('0x8')](),controller['run']);router[_0x3738('0x7')](_0x3738('0xf'),auth[_0x3738('0x8')](),controller[_0x3738('0x10')]);router[_0x3738('0x11')]('/',auth[_0x3738('0x8')](),controller[_0x3738('0x12')]);router[_0x3738('0x13')](_0x3738('0xa'),auth['isAuthenticated'](),controller[_0x3738('0x14')]);router[_0x3738('0x15')](_0x3738('0xa'),auth[_0x3738('0x8')](),controller[_0x3738('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xca52=['index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xca52,0x1be));var _0x2ca5=function(_0x2c2e25,_0x5a8652){_0x2c2e25=_0x2c2e25-0x0;var _0x5aadd7=_0xca52[_0x2c2e25];return _0x5aadd7;};'use strict';var multer=require('multer');var util=require(_0x2ca5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2ca5('0x1'));var router=express[_0x2ca5('0x2')]();var fs_extra=require(_0x2ca5('0x3'));var auth=require(_0x2ca5('0x4'));var interaction=require(_0x2ca5('0x5'));var config=require(_0x2ca5('0x6'));var controller=require(_0x2ca5('0x7'));router[_0x2ca5('0x8')]('/',auth[_0x2ca5('0x9')](),controller[_0x2ca5('0xa')]);router[_0x2ca5('0x8')](_0x2ca5('0xb'),auth['isAuthenticated'](),controller[_0x2ca5('0xc')]);router[_0x2ca5('0x8')](_0x2ca5('0xd'),auth[_0x2ca5('0x9')](),controller[_0x2ca5('0xe')]);router[_0x2ca5('0x8')](_0x2ca5('0xf'),auth[_0x2ca5('0x9')](),controller[_0x2ca5('0x10')]);router[_0x2ca5('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0x2ca5('0x11')]);router[_0x2ca5('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2ca5('0x13')](_0x2ca5('0xb'),auth['isAuthenticated'](),controller[_0x2ca5('0x14')]);router[_0x2ca5('0x15')](_0x2ca5('0xb'),auth[_0x2ca5('0x9')](),controller[_0x2ca5('0x16')]);module[_0x2ca5('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 87e375e..9ffd8ef 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 _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x8d6ae0,_0x34531a){var _0x502eef=function(_0x1b5987){while(--_0x1b5987){_0x8d6ae0['push'](_0x8d6ae0['shift']());}};_0x502eef(++_0x34531a);}(_0x687b,0x14a));var _0xb687=function(_0x564523,_0x5db1c8){_0x564523=_0x564523-0x0;var _0x404d2a=_0x687b[_0x564523];return _0x404d2a;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}};
\ No newline at end of file
+var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x1f2359,_0x628c12){var _0x2eeba8=function(_0x2624bf){while(--_0x2624bf){_0x1f2359['push'](_0x1f2359['shift']());}};_0x2eeba8(++_0x628c12);}(_0x5d17,0x114));var _0x75d1=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0x5d17[_0x15af0f];return _0x2bd1cb;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4f5e919..d2385e8 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 _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\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','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4193c6,_0x191424){_0x4193c6=_0x4193c6-0x0;var _0xf64d0a=_0xdc97[_0x4193c6];return _0xf64d0a;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));};
\ No newline at end of file
+var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x5d3afa,_0x584768){var _0x230dd9=function(_0x5ca224){while(--_0x5ca224){_0x5d3afa['push'](_0x5d3afa['shift']());}};_0x230dd9(++_0x584768);}(_0x53ec,0x192));var _0xc53e=function(_0x3fe440,_0x18d0cb){_0x3fe440=_0x3fe440-0x0;var _0x30cf95=_0x53ec[_0x3fe440];return _0x30cf95;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 4971dff..d609720 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 _0x5612=['define','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x5612,0x1db));var _0x2561=function(_0xe435e3,_0x390a8c){_0xe435e3=_0xe435e3-0x0;var _0x11b08b=_0x5612[_0xe435e3];return _0x11b08b;};'use strict';var _=require(_0x2561('0x0'));var util=require('util');var logger=require(_0x2561('0x1'))(_0x2561('0x2'));var moment=require(_0x2561('0x3'));var BPromise=require(_0x2561('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2561('0x5'));var rimraf=require(_0x2561('0x6'));var config=require(_0x2561('0x7'));var attributes=require(_0x2561('0x8'));module['exports']=function(_0x2a4078,_0x302100){return _0x2a4078[_0x2561('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x2561('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa721=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','AnalyticDefaultReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa721,0xdc));var _0x1a72=function(_0x479af1,_0x17d64b){_0x479af1=_0x479af1-0x0;var _0x43b150=_0xa721[_0x479af1];return _0x43b150;};'use strict';var _=require('lodash');var util=require(_0x1a72('0x0'));var logger=require(_0x1a72('0x1'))(_0x1a72('0x2'));var moment=require(_0x1a72('0x3'));var BPromise=require(_0x1a72('0x4'));var rp=require(_0x1a72('0x5'));var fs=require('fs');var path=require(_0x1a72('0x6'));var rimraf=require(_0x1a72('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a72('0x8'));module['exports']=function(_0x136bf2,_0x3e25c3){return _0x136bf2['define'](_0x1a72('0x9'),attributes,{'tableName':'analytics_default_reports','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 8ad4e69..60b067e 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 _0xa1d7=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0xa1d7,0x1a0));var _0x7a1d=function(_0x359d3e,_0x9d9e5b){_0x359d3e=_0x359d3e-0x0;var _0x533931=_0xa1d7[_0x359d3e];return _0x533931;};'use strict';var _=require(_0x7a1d('0x0'));var util=require(_0x7a1d('0x1'));var moment=require(_0x7a1d('0x2'));var BPromise=require(_0x7a1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a1d('0x4'));var db=require(_0x7a1d('0x5'))['db'];var utils=require(_0x7a1d('0x6'));var logger=require(_0x7a1d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a1d('0x8'));var client=jayson[_0x7a1d('0x9')][_0x7a1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57d4b4,_0x4789d8,_0x428575){return new BPromise(function(_0xb47950,_0x415dc2){return client[_0x7a1d('0xb')](_0x57d4b4,_0x428575)['then'](function(_0x3dc372){logger[_0x7a1d('0xc')](_0x7a1d('0xd'),_0x4789d8,_0x7a1d('0xe'));logger[_0x7a1d('0xf')](_0x7a1d('0x10'),_0x4789d8,_0x7a1d('0xe'),JSON['stringify'](_0x3dc372));if(_0x3dc372[_0x7a1d('0x11')]){if(_0x3dc372[_0x7a1d('0x11')][_0x7a1d('0x12')]===0x1f4){logger[_0x7a1d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4789d8,_0x3dc372[_0x7a1d('0x11')]['message']);return _0x415dc2(_0x3dc372[_0x7a1d('0x11')]['message']);}logger[_0x7a1d('0x11')](_0x7a1d('0xd'),_0x4789d8,_0x3dc372[_0x7a1d('0x11')]['message']);return _0xb47950(_0x3dc372['error'][_0x7a1d('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4789d8,_0x7a1d('0xe'));_0xb47950(_0x3dc372[_0x7a1d('0x14')][_0x7a1d('0x13')]);}})[_0x7a1d('0x15')](function(_0x4e13d6){logger[_0x7a1d('0x11')](_0x7a1d('0xd'),_0x4789d8,_0x4e13d6);_0x415dc2(_0x4e13d6);});});}
\ No newline at end of file
+var _0x46a9=['info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x8e2ff7,_0x38bad8){var _0x47b333=function(_0x1df3ff){while(--_0x1df3ff){_0x8e2ff7['push'](_0x8e2ff7['shift']());}};_0x47b333(++_0x38bad8);}(_0x46a9,0xd0));var _0x946a=function(_0x47ace6,_0x107f47){_0x47ace6=_0x47ace6-0x0;var _0x5060d7=_0x46a9[_0x47ace6];return _0x5060d7;};'use strict';var _=require(_0x946a('0x0'));var util=require(_0x946a('0x1'));var moment=require(_0x946a('0x2'));var BPromise=require(_0x946a('0x3'));var rs=require(_0x946a('0x4'));var fs=require('fs');var Redis=require(_0x946a('0x5'));var db=require(_0x946a('0x6'))['db'];var utils=require(_0x946a('0x7'));var logger=require('../../config/logger')(_0x946a('0x8'));var config=require(_0x946a('0x9'));var jayson=require(_0x946a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1babd5,_0x44de83,_0x126b00){return new BPromise(function(_0x34f2b9,_0xf4095d){return client[_0x946a('0xb')](_0x1babd5,_0x126b00)['then'](function(_0xe45053){logger[_0x946a('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x44de83,_0x946a('0xd'));logger[_0x946a('0xe')](_0x946a('0xf'),_0x44de83,_0x946a('0xd'),JSON[_0x946a('0x10')](_0xe45053));if(_0xe45053['error']){if(_0xe45053[_0x946a('0x11')][_0x946a('0x12')]===0x1f4){logger['error'](_0x946a('0x13'),_0x44de83,_0xe45053[_0x946a('0x11')][_0x946a('0x14')]);return _0xf4095d(_0xe45053[_0x946a('0x11')][_0x946a('0x14')]);}logger[_0x946a('0x11')](_0x946a('0x13'),_0x44de83,_0xe45053[_0x946a('0x11')][_0x946a('0x14')]);return _0x34f2b9(_0xe45053[_0x946a('0x11')][_0x946a('0x14')]);}else{logger[_0x946a('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x44de83,_0x946a('0xd'));_0x34f2b9(_0xe45053[_0x946a('0x15')]['message']);}})['catch'](function(_0x5eedac){logger['error'](_0x946a('0x13'),_0x44de83,_0x5eedac);_0xf4095d(_0x5eedac);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3f91a8a..5a67d13 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 _0x0ee6=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','update','destroy','exports','multer','util'];(function(_0x17a5d2,_0x90eb17){var _0x182b7e=function(_0x5e6076){while(--_0x5e6076){_0x17a5d2['push'](_0x17a5d2['shift']());}};_0x182b7e(++_0x90eb17);}(_0x0ee6,0x106));var _0x60ee=function(_0x12939e,_0x46d77a){_0x12939e=_0x12939e-0x0;var _0x3a6764=_0x0ee6[_0x12939e];return _0x3a6764;};'use strict';var multer=require(_0x60ee('0x0'));var util=require(_0x60ee('0x1'));var path=require('path');var timeout=require(_0x60ee('0x2'));var express=require(_0x60ee('0x3'));var router=express[_0x60ee('0x4')]();var fs_extra=require(_0x60ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x60ee('0x6'));var config=require(_0x60ee('0x7'));var controller=require(_0x60ee('0x8'));router[_0x60ee('0x9')]('/',auth[_0x60ee('0xa')](),controller['index']);router['get'](_0x60ee('0xb'),auth[_0x60ee('0xa')](),controller[_0x60ee('0xc')]);router[_0x60ee('0x9')](_0x60ee('0xd'),auth[_0x60ee('0xa')](),controller[_0x60ee('0xe')]);router[_0x60ee('0x9')](_0x60ee('0xf'),auth[_0x60ee('0xa')](),controller[_0x60ee('0x10')]);router[_0x60ee('0x9')](_0x60ee('0x11'),auth[_0x60ee('0xa')](),controller['query']);router[_0x60ee('0x12')]('/',auth[_0x60ee('0xa')](),controller['create']);router['put'](_0x60ee('0xb'),auth[_0x60ee('0xa')](),controller[_0x60ee('0x13')]);router['delete']('/:id',auth[_0x60ee('0xa')](),controller[_0x60ee('0x14')]);module[_0x60ee('0x15')]=router;
\ No newline at end of file
+var _0xb1ef=['./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f4c53,_0x58ba7b){var _0x568ff1=function(_0x1b6013){while(--_0x1b6013){_0x4f4c53['push'](_0x4f4c53['shift']());}};_0x568ff1(++_0x58ba7b);}(_0xb1ef,0x93));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var path=require('path');var timeout=require(_0xfb1e('0x2'));var express=require(_0xfb1e('0x3'));var router=express[_0xfb1e('0x4')]();var fs_extra=require(_0xfb1e('0x5'));var auth=require(_0xfb1e('0x6'));var interaction=require(_0xfb1e('0x7'));var config=require(_0xfb1e('0x8'));var controller=require(_0xfb1e('0x9'));router['get']('/',auth[_0xfb1e('0xa')](),controller[_0xfb1e('0xb')]);router[_0xfb1e('0xc')](_0xfb1e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xfb1e('0xc')](_0xfb1e('0xe'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0xf')]);router[_0xfb1e('0xc')](_0xfb1e('0x10'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x11')]);router['get'](_0xfb1e('0x12'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x13')]);router[_0xfb1e('0x14')]('/',auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x15')]);router[_0xfb1e('0x16')]('/:id',auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x17')]);router['delete'](_0xfb1e('0xd'),auth[_0xfb1e('0xa')](),controller[_0xfb1e('0x18')]);module[_0xfb1e('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 26a7443..f8d5c70 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 _0xf33d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x453002,_0x577cda){var _0xf82e62=function(_0x4435a3){while(--_0x4435a3){_0x453002['push'](_0x453002['shift']());}};_0xf82e62(++_0x577cda);}(_0xf33d,0x198));var _0xdf33=function(_0x475703,_0x5a274d){_0x475703=_0x475703-0x0;var _0x3ddf84=_0xf33d[_0x475703];return _0x3ddf84;};'use strict';var Sequelize=require(_0xdf33('0x0'));var moment=require(_0xdf33('0x1'));module['exports']={'name':{'type':Sequelize[_0xdf33('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xdf33('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xdf33('0x3')](_0xdf33('0x4'),_0xdf33('0x5'),_0xdf33('0x6')),'allowNull':![],'defaultValue':_0xdf33('0x4')},'savename':{'type':Sequelize[_0xdf33('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xdf33('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xdf33('0x8')},'type':{'type':Sequelize[_0xdf33('0x3')](_0xdf33('0x9'),_0xdf33('0xa')),'allowNull':![],'defaultValue':_0xdf33('0x9')},'reportId':{'type':Sequelize[_0xdf33('0xb')](0xb)[_0xdf33('0xc')]},'reportType':{'type':Sequelize[_0xdf33('0x2')]}};
\ No newline at end of file
+var _0x0274=['manual','scheduled','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x3aaab6,_0x1db2aa){var _0x343aa7=function(_0x4ac7bc){while(--_0x4ac7bc){_0x3aaab6['push'](_0x3aaab6['shift']());}};_0x343aa7(++_0x1db2aa);}(_0x0274,0xf3));var _0x4027=function(_0x3dc254,_0x4eb6fd){_0x3dc254=_0x3dc254-0x0;var _0x29dcb2=_0x0274[_0x3dc254];return _0x29dcb2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4027('0x0'));module[_0x4027('0x1')]={'name':{'type':Sequelize[_0x4027('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x4027('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x4027('0x3')](_0x4027('0x4'),_0x4027('0x5'),_0x4027('0x6')),'allowNull':![],'defaultValue':_0x4027('0x4')},'savename':{'type':Sequelize[_0x4027('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4027('0x7')]},'endDate':{'type':Sequelize[_0x4027('0x7')]},'status':{'type':Sequelize[_0x4027('0x2')],'defaultValue':_0x4027('0x8')},'type':{'type':Sequelize['ENUM'](_0x4027('0x9'),_0x4027('0xa')),'allowNull':![],'defaultValue':_0x4027('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x4027('0xb')]},'reportType':{'type':Sequelize[_0x4027('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2badef0..2ad81f5 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 _0x9542=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','name','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','exists','format','%s.%s','output','toLowerCase','zip-dir','fast-json-patch'];(function(_0x4b1cd2,_0x25de86){var _0x44a70c=function(_0x56602c){while(--_0x56602c){_0x4b1cd2['push'](_0x4b1cd2['shift']());}};_0x44a70c(++_0x25de86);}(_0x9542,0x11e));var _0x2954=function(_0x345e23,_0x1fdbb7){_0x345e23=_0x345e23-0x0;var _0x46ae83=_0x9542[_0x345e23];return _0x46ae83;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2954('0x0'));var jsonpatch=require(_0x2954('0x1'));var rp=require(_0x2954('0x2'));var moment=require(_0x2954('0x3'));var BPromise=require(_0x2954('0x4'));var Mustache=require(_0x2954('0x5'));var util=require(_0x2954('0x6'));var path=require(_0x2954('0x7'));var sox=require(_0x2954('0x8'));var csv=require(_0x2954('0x9'));var ejs=require(_0x2954('0xa'));var fs=require('fs');var fs_extra=require(_0x2954('0xb'));var _=require('lodash');var squel=require(_0x2954('0xc'));var crypto=require(_0x2954('0xd'));var jsforce=require(_0x2954('0xe'));var deskjs=require(_0x2954('0xf'));var toCsv=require(_0x2954('0x9'));var querystring=require(_0x2954('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2954('0x11'));var qs=require(_0x2954('0x12'));var as=require(_0x2954('0x13'));var hardwareService=require(_0x2954('0x14'));var logger=require(_0x2954('0x15'))('api');var utils=require(_0x2954('0x16'));var config=require(_0x2954('0x17'));var licenseUtil=require(_0x2954('0x18'));var db=require(_0x2954('0x19'))['db'];function respondWithStatusCode(_0x45c3d9,_0x9d0207){_0x9d0207=_0x9d0207||0xcc;return function(_0x2ed60b){if(_0x2ed60b){return _0x45c3d9['sendStatus'](_0x9d0207);}return _0x45c3d9['status'](_0x9d0207)['end']();};}function respondWithResult(_0x1f0daf,_0x12e955){_0x12e955=_0x12e955||0xc8;return function(_0x3a5f39){if(_0x3a5f39){return _0x1f0daf[_0x2954('0x1a')](_0x12e955)[_0x2954('0x1b')](_0x3a5f39);}};}function respondWithFilteredResult(_0x38b022,_0x264809){return function(_0x38759c){if(_0x38759c){var _0x353225=typeof _0x264809[_0x2954('0x1c')]==='undefined'&&typeof _0x264809[_0x2954('0x1d')]==='undefined';var _0x3c1562=_0x38759c[_0x2954('0x1e')];var _0x513ed7=_0x353225?0x0:_0x264809[_0x2954('0x1c')];var _0x4e8c92=_0x353225?_0x38759c[_0x2954('0x1e')]:_0x264809[_0x2954('0x1c')]+_0x264809['limit'];var _0x1d0d10;if(_0x4e8c92>=_0x3c1562){_0x4e8c92=_0x3c1562;_0x1d0d10=0xc8;}else{_0x1d0d10=0xce;}_0x38b022['status'](_0x1d0d10);return _0x38b022[_0x2954('0x1f')](_0x2954('0x20'),_0x513ed7+'-'+_0x4e8c92+'/'+_0x3c1562)['json'](_0x38759c);}return null;};}function patchUpdates(_0x2515e5){return function(_0x317cb2){try{jsonpatch[_0x2954('0x21')](_0x317cb2,_0x2515e5,!![]);}catch(_0x283e1f){return BPromise[_0x2954('0x22')](_0x283e1f);}return _0x317cb2[_0x2954('0x23')]();};}function saveUpdates(_0x45fb53,_0x28bf99){return function(_0x137599){if(_0x137599){return _0x137599['update'](_0x45fb53)[_0x2954('0x24')](function(_0x3350fa){return _0x3350fa;});}return null;};}function removeEntity(_0x1ac966,_0x565876){return function(_0xfdadb2){if(_0xfdadb2){return _0xfdadb2[_0x2954('0x25')]()['then'](function(){var _0x23fd16=_0xfdadb2[_0x2954('0x26')]({'plain':!![]});var _0x96538a=_0x2954('0x27');return db[_0x2954('0x28')]['destroy']({'where':{'type':_0x96538a,'resourceId':_0x23fd16['id']}})[_0x2954('0x24')](function(){return _0xfdadb2;});})[_0x2954('0x24')](function(){_0x1ac966[_0x2954('0x1a')](0xcc)[_0x2954('0x29')]();});}};}function handleEntityNotFound(_0x3c1547,_0x15f219){return function(_0x162c9f){if(!_0x162c9f){_0x3c1547[_0x2954('0x2a')](0x194);}return _0x162c9f;};}function handleError(_0x3474f4,_0x406ab9){_0x406ab9=_0x406ab9||0x1f4;return function(_0x6dad7){logger[_0x2954('0x2b')](_0x6dad7['stack']);if(_0x6dad7[_0x2954('0x2c')]){delete _0x6dad7['name'];}_0x3474f4[_0x2954('0x1a')](_0x406ab9)['send'](_0x6dad7);};}exports[_0x2954('0x2d')]=function(_0x2cb23e,_0x3e7994){var _0x2e85fe={},_0x48d7a7={},_0x3a611c={'count':0x0,'rows':[]};var _0xd51d33=_[_0x2954('0x2e')](db['AnalyticExtractedReport']['rawAttributes'],function(_0xa2f84c){return{'name':_0xa2f84c[_0x2954('0x2f')],'type':_0xa2f84c['type'][_0x2954('0x30')]};});_0x48d7a7[_0x2954('0x31')]=_[_0x2954('0x2e')](_0xd51d33,'name');_0x48d7a7[_0x2954('0x32')]=_[_0x2954('0x33')](_0x2cb23e[_0x2954('0x32')]);_0x48d7a7[_0x2954('0x34')]=_[_0x2954('0x35')](_0x48d7a7[_0x2954('0x31')],_0x48d7a7[_0x2954('0x32')]);_0x2e85fe[_0x2954('0x36')]=_['intersection'](_0x48d7a7[_0x2954('0x31')],qs[_0x2954('0x37')](_0x2cb23e[_0x2954('0x32')][_0x2954('0x37')]));_0x2e85fe[_0x2954('0x36')]=_0x2e85fe[_0x2954('0x36')][_0x2954('0x38')]?_0x2e85fe[_0x2954('0x36')]:_0x48d7a7[_0x2954('0x31')];if(!_0x2cb23e[_0x2954('0x32')][_0x2954('0x39')](_0x2954('0x3a'))){_0x2e85fe[_0x2954('0x1d')]=qs[_0x2954('0x1d')](_0x2cb23e[_0x2954('0x32')][_0x2954('0x1d')]);_0x2e85fe[_0x2954('0x1c')]=qs[_0x2954('0x1c')](_0x2cb23e[_0x2954('0x32')][_0x2954('0x1c')]);}_0x2e85fe[_0x2954('0x3b')]=qs[_0x2954('0x3c')](_0x2cb23e[_0x2954('0x32')]['sort']);_0x2e85fe[_0x2954('0x3d')]=qs[_0x2954('0x34')](_['pick'](_0x2cb23e[_0x2954('0x32')],_0x48d7a7[_0x2954('0x34')]),_0xd51d33);if(_0x2cb23e[_0x2954('0x32')][_0x2954('0x3e')]){_0x2e85fe[_0x2954('0x3d')]=_[_0x2954('0x3f')](_0x2e85fe['where'],{'$or':_['map'](_0xd51d33,function(_0x470d4a){if(_0x470d4a[_0x2954('0x40')]!=='VIRTUAL'){var _0x3ea6ea={};_0x3ea6ea[_0x470d4a[_0x2954('0x2c')]]={'$like':'%'+_0x2cb23e['query'][_0x2954('0x3e')]+'%'};return _0x3ea6ea;}})});}_0x2e85fe=_[_0x2954('0x3f')]({},_0x2e85fe,_0x2cb23e[_0x2954('0x41')]);var _0x489fd8={'where':_0x2e85fe[_0x2954('0x3d')]};return db[_0x2954('0x42')][_0x2954('0x1e')](_0x489fd8)['then'](function(_0x3f4857){_0x3a611c[_0x2954('0x1e')]=_0x3f4857;if(_0x2cb23e['query'][_0x2954('0x43')]){_0x2e85fe[_0x2954('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x2954('0x45')](_0x2e85fe);})[_0x2954('0x24')](function(_0x109ddf){_0x3a611c[_0x2954('0x46')]=_0x109ddf;return _0x3a611c;})[_0x2954('0x24')](respondWithFilteredResult(_0x3e7994,_0x2e85fe))[_0x2954('0x47')](handleError(_0x3e7994,null));};exports[_0x2954('0x48')]=function(_0x51dca6,_0x3bc272){var _0x3aa099={'raw':!![],'where':{'id':_0x51dca6['params']['id']}},_0x36306c={};_0x36306c[_0x2954('0x31')]=_[_0x2954('0x33')](db[_0x2954('0x42')][_0x2954('0x49')]);_0x36306c[_0x2954('0x32')]=_[_0x2954('0x33')](_0x51dca6[_0x2954('0x32')]);_0x36306c[_0x2954('0x34')]=_['intersection'](_0x36306c[_0x2954('0x31')],_0x36306c[_0x2954('0x32')]);_0x3aa099[_0x2954('0x36')]=_[_0x2954('0x35')](_0x36306c[_0x2954('0x31')],qs[_0x2954('0x37')](_0x51dca6[_0x2954('0x32')]['fields']));_0x3aa099['attributes']=_0x3aa099['attributes'][_0x2954('0x38')]?_0x3aa099[_0x2954('0x36')]:_0x36306c[_0x2954('0x31')];if(_0x51dca6[_0x2954('0x32')]['includeAll']){_0x3aa099[_0x2954('0x44')]=[{'all':!![]}];}_0x3aa099=_[_0x2954('0x3f')]({},_0x3aa099,_0x51dca6[_0x2954('0x41')]);return db['AnalyticExtractedReport'][_0x2954('0x4a')](_0x3aa099)[_0x2954('0x24')](handleEntityNotFound(_0x3bc272,null))[_0x2954('0x24')](respondWithResult(_0x3bc272,null))[_0x2954('0x47')](handleError(_0x3bc272,null));};exports[_0x2954('0x4b')]=function(_0x468662,_0x51eaa7){return db[_0x2954('0x42')][_0x2954('0x4b')](_0x468662[_0x2954('0x4c')],{})[_0x2954('0x24')](function(_0x36de21){var _0x570760=_0x468662[_0x2954('0x4d')][_0x2954('0x26')]({'plain':!![]});if(!_0x570760)throw new Error(_0x2954('0x4e'));if(_0x570760['role']===_0x2954('0x4d')){var _0x2eebbd=_0x36de21[_0x2954('0x26')]({'plain':!![]});var _0x49d50f=_0x2954('0x27');return db[_0x2954('0x4f')]['find']({'where':{'name':_0x49d50f,'userProfileId':_0x570760[_0x2954('0x50')]},'raw':!![]})[_0x2954('0x24')](function(_0x4498b7){if(_0x4498b7&&_0x4498b7[_0x2954('0x51')]===0x0){return db[_0x2954('0x28')]['create']({'name':_0x2eebbd[_0x2954('0x2c')],'resourceId':_0x2eebbd['id'],'type':_0x4498b7[_0x2954('0x2c')],'sectionId':_0x4498b7['id']},{})[_0x2954('0x24')](function(){return _0x36de21;});}else{return _0x36de21;}})[_0x2954('0x47')](function(_0x146a34){logger[_0x2954('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x146a34);throw _0x146a34;});}return _0x36de21;})['then'](respondWithResult(_0x51eaa7,0xc9))['catch'](handleError(_0x51eaa7,null));};exports['update']=function(_0x131e4,_0x37e977){if(_0x131e4[_0x2954('0x4c')]['id']){delete _0x131e4[_0x2954('0x4c')]['id'];}return db[_0x2954('0x42')][_0x2954('0x4a')]({'where':{'id':_0x131e4[_0x2954('0x52')]['id']}})[_0x2954('0x24')](handleEntityNotFound(_0x37e977,null))['then'](saveUpdates(_0x131e4['body'],null))[_0x2954('0x24')](respondWithResult(_0x37e977,null))['catch'](handleError(_0x37e977,null));};exports[_0x2954('0x25')]=function(_0x954683,_0xb3915e){return db[_0x2954('0x42')][_0x2954('0x4a')]({'where':{'id':_0x954683['params']['id']}})[_0x2954('0x24')](handleEntityNotFound(_0xb3915e,null))[_0x2954('0x24')](removeEntity(_0xb3915e,null))[_0x2954('0x47')](handleError(_0xb3915e,null));};exports[_0x2954('0x53')]=function(_0x4b4ce5,_0x149747,_0x31889e){return db['AnalyticExtractedReport'][_0x2954('0x4a')]({'where':{'id':_0x4b4ce5[_0x2954('0x52')]['id']},'attributes':['name',_0x2954('0x54'),_0x2954('0x55'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x149747,null))[_0x2954('0x24')](function(_0x4a7741){if(_0x4a7741){if(!fs[_0x2954('0x56')](path[_0x2954('0x57')](config[_0x2954('0x58')],_0x2954('0x59'),_0x4a7741[_0x2954('0x55')]))){throw new db[(_0x2954('0x5a'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x4b4ce5[_0x2954('0x32')][_0x2954('0x5b')]){return _0x149747[_0x2954('0x2a')](0xc8);}return _0x149747[_0x2954('0x53')](path[_0x2954('0x57')](config[_0x2954('0x58')],_0x2954('0x59'),_0x4a7741[_0x2954('0x55')]),util[_0x2954('0x5c')](_0x2954('0x5d'),_0x4a7741[_0x2954('0x54')]||_0x4a7741[_0x2954('0x2c')],_0x4a7741[_0x2954('0x5e')][_0x2954('0x5f')]()));}})[_0x2954('0x47')](handleError(_0x149747,null));};
\ No newline at end of file
+var _0x142c=['existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','params','find','catch','create','body','user','role','ExtractedReports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','output'];(function(_0x6e4a9e,_0x506af2){var _0xbd0fb1=function(_0xf49152){while(--_0xf49152){_0x6e4a9e['push'](_0x6e4a9e['shift']());}};_0xbd0fb1(++_0x506af2);}(_0x142c,0x67));var _0xc142=function(_0x28c3ba,_0xe1ea2d){_0x28c3ba=_0x28c3ba-0x0;var _0x10b950=_0x142c[_0x28c3ba];return _0x10b950;};'use strict';var emlformat=require(_0xc142('0x0'));var rimraf=require(_0xc142('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc142('0x2'));var rp=require(_0xc142('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc142('0x4'));var util=require('util');var path=require(_0xc142('0x5'));var sox=require(_0xc142('0x6'));var csv=require('to-csv');var ejs=require(_0xc142('0x7'));var fs=require('fs');var fs_extra=require(_0xc142('0x8'));var _=require('lodash');var squel=require(_0xc142('0x9'));var crypto=require(_0xc142('0xa'));var jsforce=require(_0xc142('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc142('0xc'));var querystring=require(_0xc142('0xd'));var Papa=require(_0xc142('0xe'));var Redis=require(_0xc142('0xf'));var authService=require(_0xc142('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc142('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc142('0x12'))(_0xc142('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc142('0x14'));var db=require(_0xc142('0x15'))['db'];function respondWithStatusCode(_0x81e126,_0x597c3e){_0x597c3e=_0x597c3e||0xcc;return function(_0xdaf6f6){if(_0xdaf6f6){return _0x81e126[_0xc142('0x16')](_0x597c3e);}return _0x81e126['status'](_0x597c3e)['end']();};}function respondWithResult(_0x3ce5bb,_0x23ed1f){_0x23ed1f=_0x23ed1f||0xc8;return function(_0xd8a04e){if(_0xd8a04e){return _0x3ce5bb[_0xc142('0x17')](_0x23ed1f)['json'](_0xd8a04e);}};}function respondWithFilteredResult(_0x29f8d3,_0x52ad72){return function(_0x509761){if(_0x509761){var _0x21610d=typeof _0x52ad72['offset']==='undefined'&&typeof _0x52ad72[_0xc142('0x18')]===_0xc142('0x19');var _0x511642=_0x509761[_0xc142('0x1a')];var _0x30f284=_0x21610d?0x0:_0x52ad72[_0xc142('0x1b')];var _0x39145e=_0x21610d?_0x509761[_0xc142('0x1a')]:_0x52ad72['offset']+_0x52ad72[_0xc142('0x18')];var _0x324fe4;if(_0x39145e>=_0x511642){_0x39145e=_0x511642;_0x324fe4=0xc8;}else{_0x324fe4=0xce;}_0x29f8d3[_0xc142('0x17')](_0x324fe4);return _0x29f8d3['set'](_0xc142('0x1c'),_0x30f284+'-'+_0x39145e+'/'+_0x511642)[_0xc142('0x1d')](_0x509761);}return null;};}function patchUpdates(_0x44e3a2){return function(_0x105a6f){try{jsonpatch[_0xc142('0x1e')](_0x105a6f,_0x44e3a2,!![]);}catch(_0x3358a8){return BPromise['reject'](_0x3358a8);}return _0x105a6f[_0xc142('0x1f')]();};}function saveUpdates(_0x3a97dd,_0x14ee89){return function(_0x13ed83){if(_0x13ed83){return _0x13ed83[_0xc142('0x20')](_0x3a97dd)[_0xc142('0x21')](function(_0x192272){return _0x192272;});}return null;};}function removeEntity(_0x2846f7,_0x2d421b){return function(_0x1e0ce7){if(_0x1e0ce7){return _0x1e0ce7[_0xc142('0x22')]()[_0xc142('0x21')](function(){var _0x56d37a=_0x1e0ce7[_0xc142('0x23')]({'plain':!![]});var _0x1c62d6='ExtractedReports';return db[_0xc142('0x24')][_0xc142('0x22')]({'where':{'type':_0x1c62d6,'resourceId':_0x56d37a['id']}})['then'](function(){return _0x1e0ce7;});})[_0xc142('0x21')](function(){_0x2846f7[_0xc142('0x17')](0xcc)[_0xc142('0x25')]();});}};}function handleEntityNotFound(_0x2d1121,_0x327213){return function(_0x22fbc3){if(!_0x22fbc3){_0x2d1121['sendStatus'](0x194);}return _0x22fbc3;};}function handleError(_0x364fe6,_0x5b9a0f){_0x5b9a0f=_0x5b9a0f||0x1f4;return function(_0x3deaf2){logger[_0xc142('0x26')](_0x3deaf2[_0xc142('0x27')]);if(_0x3deaf2['name']){delete _0x3deaf2[_0xc142('0x28')];}_0x364fe6['status'](_0x5b9a0f)['send'](_0x3deaf2);};}exports['index']=function(_0x439656,_0x419ab9){var _0x3da49e={},_0x322d2b={},_0x3ae49b={'count':0x0,'rows':[]};var _0x47555a=_['map'](db['AnalyticExtractedReport'][_0xc142('0x29')],function(_0x390b05){return{'name':_0x390b05[_0xc142('0x2a')],'type':_0x390b05[_0xc142('0x2b')]['key']};});_0x322d2b[_0xc142('0x2c')]=_[_0xc142('0x2d')](_0x47555a,_0xc142('0x28'));_0x322d2b[_0xc142('0x2e')]=_[_0xc142('0x2f')](_0x439656['query']);_0x322d2b[_0xc142('0x30')]=_[_0xc142('0x31')](_0x322d2b['model'],_0x322d2b[_0xc142('0x2e')]);_0x3da49e[_0xc142('0x32')]=_[_0xc142('0x31')](_0x322d2b['model'],qs[_0xc142('0x33')](_0x439656[_0xc142('0x2e')][_0xc142('0x33')]));_0x3da49e[_0xc142('0x32')]=_0x3da49e[_0xc142('0x32')][_0xc142('0x34')]?_0x3da49e['attributes']:_0x322d2b['model'];if(!_0x439656[_0xc142('0x2e')][_0xc142('0x35')](_0xc142('0x36'))){_0x3da49e[_0xc142('0x18')]=qs['limit'](_0x439656[_0xc142('0x2e')][_0xc142('0x18')]);_0x3da49e[_0xc142('0x1b')]=qs['offset'](_0x439656[_0xc142('0x2e')][_0xc142('0x1b')]);}_0x3da49e[_0xc142('0x37')]=qs['sort'](_0x439656[_0xc142('0x2e')][_0xc142('0x38')]);_0x3da49e[_0xc142('0x39')]=qs[_0xc142('0x30')](_[_0xc142('0x3a')](_0x439656[_0xc142('0x2e')],_0x322d2b[_0xc142('0x30')]),_0x47555a);if(_0x439656[_0xc142('0x2e')][_0xc142('0x3b')]){_0x3da49e[_0xc142('0x39')]=_[_0xc142('0x3c')](_0x3da49e[_0xc142('0x39')],{'$or':_[_0xc142('0x2d')](_0x47555a,function(_0x37d99d){if(_0x37d99d[_0xc142('0x2b')]!==_0xc142('0x3d')){var _0x2369c6={};_0x2369c6[_0x37d99d['name']]={'$like':'%'+_0x439656['query'][_0xc142('0x3b')]+'%'};return _0x2369c6;}})});}_0x3da49e=_['merge']({},_0x3da49e,_0x439656[_0xc142('0x3e')]);var _0x3c3183={'where':_0x3da49e[_0xc142('0x39')]};return db[_0xc142('0x3f')][_0xc142('0x1a')](_0x3c3183)['then'](function(_0x511763){_0x3ae49b[_0xc142('0x1a')]=_0x511763;if(_0x439656['query'][_0xc142('0x40')]){_0x3da49e[_0xc142('0x41')]=[{'all':!![]}];}return db[_0xc142('0x3f')][_0xc142('0x42')](_0x3da49e);})[_0xc142('0x21')](function(_0x1f871f){_0x3ae49b[_0xc142('0x43')]=_0x1f871f;return _0x3ae49b;})['then'](respondWithFilteredResult(_0x419ab9,_0x3da49e))['catch'](handleError(_0x419ab9,null));};exports['show']=function(_0x1d63a1,_0x41d455){var _0x1aa7eb={'raw':!![],'where':{'id':_0x1d63a1[_0xc142('0x44')]['id']}},_0x2fcc38={};_0x2fcc38[_0xc142('0x2c')]=_[_0xc142('0x2f')](db[_0xc142('0x3f')][_0xc142('0x29')]);_0x2fcc38[_0xc142('0x2e')]=_['keys'](_0x1d63a1[_0xc142('0x2e')]);_0x2fcc38[_0xc142('0x30')]=_[_0xc142('0x31')](_0x2fcc38[_0xc142('0x2c')],_0x2fcc38[_0xc142('0x2e')]);_0x1aa7eb[_0xc142('0x32')]=_[_0xc142('0x31')](_0x2fcc38['model'],qs[_0xc142('0x33')](_0x1d63a1[_0xc142('0x2e')][_0xc142('0x33')]));_0x1aa7eb[_0xc142('0x32')]=_0x1aa7eb['attributes'][_0xc142('0x34')]?_0x1aa7eb[_0xc142('0x32')]:_0x2fcc38[_0xc142('0x2c')];if(_0x1d63a1['query'][_0xc142('0x40')]){_0x1aa7eb['include']=[{'all':!![]}];}_0x1aa7eb=_[_0xc142('0x3c')]({},_0x1aa7eb,_0x1d63a1[_0xc142('0x3e')]);return db[_0xc142('0x3f')][_0xc142('0x45')](_0x1aa7eb)[_0xc142('0x21')](handleEntityNotFound(_0x41d455,null))[_0xc142('0x21')](respondWithResult(_0x41d455,null))[_0xc142('0x46')](handleError(_0x41d455,null));};exports[_0xc142('0x47')]=function(_0x422e52,_0x472072){return db[_0xc142('0x3f')][_0xc142('0x47')](_0x422e52[_0xc142('0x48')],{})['then'](function(_0x293e09){var _0x458036=_0x422e52[_0xc142('0x49')][_0xc142('0x23')]({'plain':!![]});if(!_0x458036)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x458036[_0xc142('0x4a')]===_0xc142('0x49')){var _0x2bd9b1=_0x293e09[_0xc142('0x23')]({'plain':!![]});var _0x5959ba=_0xc142('0x4b');return db['UserProfileSection'][_0xc142('0x45')]({'where':{'name':_0x5959ba,'userProfileId':_0x458036['userProfileId']},'raw':!![]})['then'](function(_0x2377cb){if(_0x2377cb&&_0x2377cb[_0xc142('0x4c')]===0x0){return db[_0xc142('0x24')][_0xc142('0x47')]({'name':_0x2bd9b1[_0xc142('0x28')],'resourceId':_0x2bd9b1['id'],'type':_0x2377cb['name'],'sectionId':_0x2377cb['id']},{})[_0xc142('0x21')](function(){return _0x293e09;});}else{return _0x293e09;}})['catch'](function(_0x2fb763){logger[_0xc142('0x26')](_0xc142('0x4d'),_0x2fb763);throw _0x2fb763;});}return _0x293e09;})[_0xc142('0x21')](respondWithResult(_0x472072,0xc9))[_0xc142('0x46')](handleError(_0x472072,null));};exports[_0xc142('0x20')]=function(_0x28aa16,_0x1abb53){if(_0x28aa16[_0xc142('0x48')]['id']){delete _0x28aa16['body']['id'];}return db[_0xc142('0x3f')]['find']({'where':{'id':_0x28aa16[_0xc142('0x44')]['id']}})[_0xc142('0x21')](handleEntityNotFound(_0x1abb53,null))['then'](saveUpdates(_0x28aa16[_0xc142('0x48')],null))['then'](respondWithResult(_0x1abb53,null))[_0xc142('0x46')](handleError(_0x1abb53,null));};exports[_0xc142('0x22')]=function(_0x4ed10f,_0x2d78ec){return db[_0xc142('0x3f')][_0xc142('0x45')]({'where':{'id':_0x4ed10f[_0xc142('0x44')]['id']}})[_0xc142('0x21')](handleEntityNotFound(_0x2d78ec,null))['then'](removeEntity(_0x2d78ec,null))['catch'](handleError(_0x2d78ec,null));};exports['download']=function(_0x42f579,_0x23692b,_0x490747){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x42f579['params']['id']},'attributes':[_0xc142('0x28'),'basename','savename',_0xc142('0x4e')],'raw':!![]})[_0xc142('0x21')](handleEntityNotFound(_0x23692b,null))['then'](function(_0x3674d7){if(_0x3674d7){if(!fs[_0xc142('0x4f')](path[_0xc142('0x50')](config[_0xc142('0x51')],_0xc142('0x52'),_0x3674d7[_0xc142('0x53')]))){throw new db[(_0xc142('0x54'))][(_0xc142('0x55'))](_0xc142('0x56'));}if(_0x42f579[_0xc142('0x2e')]['exists']){return _0x23692b[_0xc142('0x16')](0xc8);}return _0x23692b[_0xc142('0x57')](path[_0xc142('0x50')](config[_0xc142('0x51')],_0xc142('0x52'),_0x3674d7['savename']),util[_0xc142('0x58')](_0xc142('0x59'),_0x3674d7['basename']||_0x3674d7[_0xc142('0x28')],_0x3674d7['output'][_0xc142('0x5a')]()));}})[_0xc142('0x46')](handleError(_0x23692b,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index cf06400..c60a1fa 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 _0x2334=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x43a108,_0x5d559c){var _0x27838c=function(_0x187114){while(--_0x187114){_0x43a108['push'](_0x43a108['shift']());}};_0x27838c(++_0x5d559c);}(_0x2334,0x1e6));var _0x4233=function(_0x2cfb2b,_0x30c0f1){_0x2cfb2b=_0x2cfb2b-0x0;var _0x403a5c=_0x2334[_0x2cfb2b];return _0x403a5c;};'use strict';var _=require(_0x4233('0x0'));var util=require(_0x4233('0x1'));var logger=require(_0x4233('0x2'))(_0x4233('0x3'));var moment=require('moment');var BPromise=require(_0x4233('0x4'));var rp=require(_0x4233('0x5'));var fs=require('fs');var path=require(_0x4233('0x6'));var rimraf=require(_0x4233('0x7'));var config=require(_0x4233('0x8'));var attributes=require(_0x4233('0x9'));module[_0x4233('0xa')]=function(_0x1bff29,_0x12d09d){return _0x1bff29[_0x4233('0xb')](_0x4233('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf951=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x9ccc17,_0x1d087c){var _0x46e989=function(_0x302510){while(--_0x302510){_0x9ccc17['push'](_0x9ccc17['shift']());}};_0x46e989(++_0x1d087c);}(_0xf951,0x192));var _0x1f95=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xf951[_0x420f2a];return _0x28f802;};'use strict';var _=require(_0x1f95('0x0'));var util=require(_0x1f95('0x1'));var logger=require(_0x1f95('0x2'))('api');var moment=require(_0x1f95('0x3'));var BPromise=require(_0x1f95('0x4'));var rp=require(_0x1f95('0x5'));var fs=require('fs');var path=require(_0x1f95('0x6'));var rimraf=require(_0x1f95('0x7'));var config=require(_0x1f95('0x8'));var attributes=require(_0x1f95('0x9'));module[_0x1f95('0xa')]=function(_0x544067,_0xd5500b){return _0x544067['define']('AnalyticExtractedReport',attributes,{'tableName':_0x1f95('0xb'),'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 eeed9a8..3444f4d 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 _0x671e=['../../config/logger','rpc','jayson/promise','client','request','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','AnalyticExtractedReport,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x5024c7,_0xd560bd){var _0xf2f316=function(_0x4d7748){while(--_0x4d7748){_0x5024c7['push'](_0x5024c7['shift']());}};_0xf2f316(++_0xd560bd);}(_0x671e,0xd6));var _0xe671=function(_0x2d7b60,_0x1a0fbe){_0x2d7b60=_0x2d7b60-0x0;var _0x36b9e1=_0x671e[_0x2d7b60];return _0x36b9e1;};'use strict';var _=require(_0xe671('0x0'));var util=require(_0xe671('0x1'));var moment=require(_0xe671('0x2'));var BPromise=require('bluebird');var rs=require(_0xe671('0x3'));var fs=require('fs');var Redis=require(_0xe671('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe671('0x5'));var logger=require(_0xe671('0x6'))(_0xe671('0x7'));var config=require('../../config/environment');var jayson=require(_0xe671('0x8'));var client=jayson[_0xe671('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b847,_0x7ec84b,_0xda7edc){return new BPromise(function(_0x4033d9,_0x48f194){return client[_0xe671('0xa')](_0x27b847,_0xda7edc)[_0xe671('0xb')](function(_0x3f9985){logger[_0xe671('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x7ec84b,'request\x20sent');logger[_0xe671('0xd')](_0xe671('0xe'),_0x7ec84b,_0xe671('0xf'),JSON['stringify'](_0x3f9985));if(_0x3f9985[_0xe671('0x10')]){if(_0x3f9985[_0xe671('0x10')][_0xe671('0x11')]===0x1f4){logger[_0xe671('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x7ec84b,_0x3f9985[_0xe671('0x10')]['message']);return _0x48f194(_0x3f9985[_0xe671('0x10')]['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x7ec84b,_0x3f9985['error'][_0xe671('0x12')]);return _0x4033d9(_0x3f9985[_0xe671('0x10')][_0xe671('0x12')]);}else{logger[_0xe671('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x7ec84b,_0xe671('0xf'));_0x4033d9(_0x3f9985[_0xe671('0x13')][_0xe671('0x12')]);}})[_0xe671('0x14')](function(_0x381dd6){logger['error'](_0xe671('0x15'),_0x7ec84b,_0x381dd6);_0x48f194(_0x381dd6);});});}
\ No newline at end of file
+var _0x81e8=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch'];(function(_0x2a5bb7,_0x3a0bf3){var _0x503330=function(_0x61d76b){while(--_0x61d76b){_0x2a5bb7['push'](_0x2a5bb7['shift']());}};_0x503330(++_0x3a0bf3);}(_0x81e8,0x168));var _0x881e=function(_0x2340be,_0x2b92fd){_0x2340be=_0x2340be-0x0;var _0x278704=_0x81e8[_0x2340be];return _0x278704;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x881e('0x0'));var BPromise=require(_0x881e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x881e('0x2'));var db=require(_0x881e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x881e('0x4'))('rpc');var config=require(_0x881e('0x5'));var jayson=require(_0x881e('0x6'));var client=jayson[_0x881e('0x7')][_0x881e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x318dcd,_0x474273,_0x950463){return new BPromise(function(_0xd3fd39,_0x515686){return client[_0x881e('0x9')](_0x318dcd,_0x950463)[_0x881e('0xa')](function(_0xfae24d){logger[_0x881e('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x474273,_0x881e('0xc'));logger[_0x881e('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x474273,_0x881e('0xc'),JSON[_0x881e('0xe')](_0xfae24d));if(_0xfae24d[_0x881e('0xf')]){if(_0xfae24d[_0x881e('0xf')]['code']===0x1f4){logger['error'](_0x881e('0x10'),_0x474273,_0xfae24d[_0x881e('0xf')]['message']);return _0x515686(_0xfae24d['error'][_0x881e('0x11')]);}logger[_0x881e('0xf')](_0x881e('0x10'),_0x474273,_0xfae24d[_0x881e('0xf')][_0x881e('0x11')]);return _0xd3fd39(_0xfae24d[_0x881e('0xf')]['message']);}else{logger[_0x881e('0xb')](_0x881e('0x10'),_0x474273,_0x881e('0xc'));_0xd3fd39(_0xfae24d[_0x881e('0x12')]['message']);}})[_0x881e('0x13')](function(_0xd9734b){logger[_0x881e('0xf')](_0x881e('0x10'),_0x474273,_0xd9734b);_0x515686(_0xd9734b);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2a5fb75..55bef8d 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 _0x40c3=['delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','download','post','put','update'];(function(_0x236c6f,_0x49d2de){var _0x1228ca=function(_0x174b40){while(--_0x174b40){_0x236c6f['push'](_0x236c6f['shift']());}};_0x1228ca(++_0x49d2de);}(_0x40c3,0xfe));var _0x340c=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x40c3[_0x174ef5];return _0x1cc379;};'use strict';var multer=require('multer');var util=require(_0x340c('0x0'));var path=require(_0x340c('0x1'));var timeout=require('connect-timeout');var express=require(_0x340c('0x2'));var router=express[_0x340c('0x3')]();var fs_extra=require(_0x340c('0x4'));var auth=require(_0x340c('0x5'));var interaction=require(_0x340c('0x6'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x340c('0x7')]('/',auth[_0x340c('0x8')](),controller[_0x340c('0x9')]);router[_0x340c('0x7')](_0x340c('0xa'),auth[_0x340c('0x8')](),controller[_0x340c('0xb')]);router['get']('/:id/download',auth[_0x340c('0x8')](),controller[_0x340c('0xc')]);router[_0x340c('0xd')]('/',auth[_0x340c('0x8')](),controller['create']);router[_0x340c('0xe')](_0x340c('0xa'),auth[_0x340c('0x8')](),controller[_0x340c('0xf')]);router[_0x340c('0x10')](_0x340c('0xa'),auth[_0x340c('0x8')](),controller['destroy']);module[_0x340c('0x11')]=router;
\ No newline at end of file
+var _0x483d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','/:id/download','isAuthenticated','post','create'];(function(_0x1b46ae,_0x3e272a){var _0x3323d9=function(_0x162cb7){while(--_0x162cb7){_0x1b46ae['push'](_0x1b46ae['shift']());}};_0x3323d9(++_0x3e272a);}(_0x483d,0xc1));var _0xd483=function(_0x2b4cb4,_0x18a0ad){_0x2b4cb4=_0x2b4cb4-0x0;var _0x112fb6=_0x483d[_0x2b4cb4];return _0x112fb6;};'use strict';var multer=require(_0xd483('0x0'));var util=require(_0xd483('0x1'));var path=require(_0xd483('0x2'));var timeout=require(_0xd483('0x3'));var express=require(_0xd483('0x4'));var router=express[_0xd483('0x5')]();var fs_extra=require(_0xd483('0x6'));var auth=require(_0xd483('0x7'));var interaction=require(_0xd483('0x8'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0xd483('0x9')]('/',auth['isAuthenticated'](),controller[_0xd483('0xa')]);router['get'](_0xd483('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd483('0x9')](_0xd483('0xc'),auth[_0xd483('0xd')](),controller['download']);router[_0xd483('0xe')]('/',auth[_0xd483('0xd')](),controller[_0xd483('0xf')]);router[_0xd483('0x10')](_0xd483('0xb'),auth[_0xd483('0xd')](),controller[_0xd483('0x11')]);router[_0xd483('0x12')](_0xd483('0xb'),auth[_0xd483('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 055d375..4190442 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 _0x7f85=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x384e27,_0x21ca5b){var _0x2ccfc5=function(_0x57bde7){while(--_0x57bde7){_0x384e27['push'](_0x384e27['shift']());}};_0x2ccfc5(++_0x21ca5b);}(_0x7f85,0x174));var _0x57f8=function(_0x3bd608,_0x4983d3){_0x3bd608=_0x3bd608-0x0;var _0x538339=_0x7f85[_0x3bd608];return _0x538339;};'use strict';var Sequelize=require(_0x57f8('0x0'));module[_0x57f8('0x1')]={'field':{'type':Sequelize[_0x57f8('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x57f8('0x3')]},'format':{'type':Sequelize[_0x57f8('0x3')]},'groupBy':{'type':Sequelize[_0x57f8('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x57f8('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xac53=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xac53,0xef));var _0x3ac5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac53[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3ac5('0x0'));module[_0x3ac5('0x1')]={'field':{'type':Sequelize[_0x3ac5('0x2')]},'alias':{'type':Sequelize[_0x3ac5('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x3ac5('0x3')]},'groupBy':{'type':Sequelize[_0x3ac5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x3ac5('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 4903e95..d81f93e 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 _0x0a1c=['fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','bulkCreate','body','update','params','destroy','ids','addFields','findOne','sequelize','transaction','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes'];(function(_0x4a1385,_0x368d60){var _0xf4e8c2=function(_0x358911){while(--_0x358911){_0x4a1385['push'](_0x4a1385['shift']());}};_0xf4e8c2(++_0x368d60);}(_0x0a1c,0x7a));var _0xc0a1=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x0a1c[_0x2307fa];return _0x496486;};'use strict';var emlformat=require(_0xc0a1('0x0'));var rimraf=require(_0xc0a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc0a1('0x2'));var moment=require(_0xc0a1('0x3'));var BPromise=require(_0xc0a1('0x4'));var Mustache=require(_0xc0a1('0x5'));var util=require('util');var path=require(_0xc0a1('0x6'));var sox=require(_0xc0a1('0x7'));var csv=require(_0xc0a1('0x8'));var ejs=require(_0xc0a1('0x9'));var fs=require('fs');var fs_extra=require(_0xc0a1('0xa'));var _=require(_0xc0a1('0xb'));var squel=require(_0xc0a1('0xc'));var crypto=require('crypto');var jsforce=require(_0xc0a1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc0a1('0x8'));var querystring=require(_0xc0a1('0xe'));var Papa=require('papaparse');var Redis=require(_0xc0a1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc0a1('0x10'));var as=require(_0xc0a1('0x11'));var hardwareService=require(_0xc0a1('0x12'));var logger=require('../../config/logger')(_0xc0a1('0x13'));var utils=require(_0xc0a1('0x14'));var config=require(_0xc0a1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0a1('0x16'))['db'];function respondWithStatusCode(_0x3fbaa4,_0x224c49){_0x224c49=_0x224c49||0xcc;return function(_0x430272){if(_0x430272){return _0x3fbaa4[_0xc0a1('0x17')](_0x224c49);}return _0x3fbaa4[_0xc0a1('0x18')](_0x224c49)[_0xc0a1('0x19')]();};}function respondWithResult(_0x4e612f,_0x22d02c){_0x22d02c=_0x22d02c||0xc8;return function(_0x446d76){if(_0x446d76){return _0x4e612f[_0xc0a1('0x18')](_0x22d02c)['json'](_0x446d76);}};}function respondWithFilteredResult(_0x1b3d3a,_0x6545e){return function(_0x1acf75){if(_0x1acf75){var _0x54acc5=typeof _0x6545e[_0xc0a1('0x1a')]===_0xc0a1('0x1b')&&typeof _0x6545e[_0xc0a1('0x1c')]==='undefined';var _0x38e063=_0x1acf75[_0xc0a1('0x1d')];var _0x176850=_0x54acc5?0x0:_0x6545e[_0xc0a1('0x1a')];var _0x33a91f=_0x54acc5?_0x1acf75[_0xc0a1('0x1d')]:_0x6545e['offset']+_0x6545e[_0xc0a1('0x1c')];var _0x35c55e;if(_0x33a91f>=_0x38e063){_0x33a91f=_0x38e063;_0x35c55e=0xc8;}else{_0x35c55e=0xce;}_0x1b3d3a[_0xc0a1('0x18')](_0x35c55e);return _0x1b3d3a[_0xc0a1('0x1e')]('Content-Range',_0x176850+'-'+_0x33a91f+'/'+_0x38e063)[_0xc0a1('0x1f')](_0x1acf75);}return null;};}function patchUpdates(_0x117259){return function(_0xb11365){try{jsonpatch[_0xc0a1('0x20')](_0xb11365,_0x117259,!![]);}catch(_0x5904ee){return BPromise[_0xc0a1('0x21')](_0x5904ee);}return _0xb11365[_0xc0a1('0x22')]();};}function saveUpdates(_0x221a35,_0xb46e0e){return function(_0x56cb73){if(_0x56cb73){return _0x56cb73['update'](_0x221a35)[_0xc0a1('0x23')](function(_0x26848c){return _0x26848c;});}return null;};}function removeEntity(_0x32e785,_0x1e19d5){return function(_0x3e75c8){if(_0x3e75c8){return _0x3e75c8['destroy']()['then'](function(){_0x32e785[_0xc0a1('0x18')](0xcc)[_0xc0a1('0x19')]();});}};}function handleEntityNotFound(_0x549197,_0x42d761){return function(_0xea0f0d){if(!_0xea0f0d){_0x549197[_0xc0a1('0x17')](0x194);}return _0xea0f0d;};}function handleError(_0x1ecb37,_0x11cbeb){_0x11cbeb=_0x11cbeb||0x1f4;return function(_0x47f927){logger[_0xc0a1('0x24')](_0x47f927[_0xc0a1('0x25')]);if(_0x47f927[_0xc0a1('0x26')]){delete _0x47f927[_0xc0a1('0x26')];}_0x1ecb37['status'](_0x11cbeb)[_0xc0a1('0x27')](_0x47f927);};}exports[_0xc0a1('0x28')]=function(_0x5bdd7e,_0x1649ac){var _0x195502={},_0x5249c0={},_0x409de2={'count':0x0,'rows':[]};var _0x5df710=_[_0xc0a1('0x29')](db[_0xc0a1('0x2a')][_0xc0a1('0x2b')],function(_0x401f5d){return{'name':_0x401f5d[_0xc0a1('0x2c')],'type':_0x401f5d['type'][_0xc0a1('0x2d')]};});_0x5249c0[_0xc0a1('0x2e')]=_[_0xc0a1('0x29')](_0x5df710,'name');_0x5249c0['query']=_[_0xc0a1('0x2f')](_0x5bdd7e[_0xc0a1('0x30')]);_0x5249c0['filters']=_[_0xc0a1('0x31')](_0x5249c0[_0xc0a1('0x2e')],_0x5249c0[_0xc0a1('0x30')]);_0x195502[_0xc0a1('0x32')]=_['intersection'](_0x5249c0[_0xc0a1('0x2e')],qs[_0xc0a1('0x33')](_0x5bdd7e[_0xc0a1('0x30')][_0xc0a1('0x33')]));_0x195502[_0xc0a1('0x32')]=_0x195502[_0xc0a1('0x32')][_0xc0a1('0x34')]?_0x195502[_0xc0a1('0x32')]:_0x5249c0[_0xc0a1('0x2e')];if(!_0x5bdd7e[_0xc0a1('0x30')][_0xc0a1('0x35')](_0xc0a1('0x36'))){_0x195502[_0xc0a1('0x1c')]=qs[_0xc0a1('0x1c')](_0x5bdd7e['query']['limit']);_0x195502[_0xc0a1('0x1a')]=qs[_0xc0a1('0x1a')](_0x5bdd7e[_0xc0a1('0x30')]['offset']);}_0x195502[_0xc0a1('0x37')]=qs[_0xc0a1('0x38')](_0x5bdd7e[_0xc0a1('0x30')]['sort']);_0x195502[_0xc0a1('0x39')]=qs[_0xc0a1('0x3a')](_[_0xc0a1('0x3b')](_0x5bdd7e[_0xc0a1('0x30')],_0x5249c0['filters']),_0x5df710);if(_0x5bdd7e[_0xc0a1('0x30')][_0xc0a1('0x3c')]){_0x195502[_0xc0a1('0x39')]=_[_0xc0a1('0x3d')](_0x195502[_0xc0a1('0x39')],{'$or':_[_0xc0a1('0x29')](_0x5df710,function(_0x39b974){if(_0x39b974[_0xc0a1('0x3e')]!==_0xc0a1('0x3f')){var _0x42119d={};_0x42119d[_0x39b974[_0xc0a1('0x26')]]={'$like':'%'+_0x5bdd7e[_0xc0a1('0x30')]['filter']+'%'};return _0x42119d;}})});}_0x195502=_[_0xc0a1('0x3d')]({},_0x195502,_0x5bdd7e[_0xc0a1('0x40')]);var _0x5d94ce={'where':_0x195502[_0xc0a1('0x39')]};return db['AnalyticFieldReport'][_0xc0a1('0x1d')](_0x5d94ce)[_0xc0a1('0x23')](function(_0xc50e76){_0x409de2['count']=_0xc50e76;if(_0x5bdd7e[_0xc0a1('0x30')][_0xc0a1('0x41')]){_0x195502['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc0a1('0x42')](_0x195502);})[_0xc0a1('0x23')](function(_0x12c4de){_0x409de2[_0xc0a1('0x43')]=_0x12c4de;return _0x409de2;})['then'](respondWithFilteredResult(_0x1649ac,_0x195502))[_0xc0a1('0x44')](handleError(_0x1649ac,null));};exports[_0xc0a1('0x45')]=function(_0x5d565d,_0xa6f31d){var _0x12856d={'raw':![],'where':{'id':_0x5d565d['params']['id']}},_0x3ce3c7={};_0x3ce3c7[_0xc0a1('0x2e')]=_[_0xc0a1('0x2f')](db['AnalyticFieldReport']['rawAttributes']);_0x3ce3c7[_0xc0a1('0x30')]=_[_0xc0a1('0x2f')](_0x5d565d[_0xc0a1('0x30')]);_0x3ce3c7['filters']=_[_0xc0a1('0x31')](_0x3ce3c7['model'],_0x3ce3c7['query']);_0x12856d['attributes']=_[_0xc0a1('0x31')](_0x3ce3c7[_0xc0a1('0x2e')],qs[_0xc0a1('0x33')](_0x5d565d[_0xc0a1('0x30')][_0xc0a1('0x33')]));_0x12856d['attributes']=_0x12856d[_0xc0a1('0x32')][_0xc0a1('0x34')]?_0x12856d[_0xc0a1('0x32')]:_0x3ce3c7[_0xc0a1('0x2e')];if(_0x5d565d[_0xc0a1('0x30')][_0xc0a1('0x41')]){_0x12856d[_0xc0a1('0x46')]=[{'all':!![]}];}_0x12856d=_[_0xc0a1('0x3d')]({},_0x12856d,_0x5d565d[_0xc0a1('0x40')]);return db[_0xc0a1('0x2a')][_0xc0a1('0x47')](_0x12856d)[_0xc0a1('0x23')](handleEntityNotFound(_0xa6f31d,null))[_0xc0a1('0x23')](respondWithResult(_0xa6f31d,null))[_0xc0a1('0x44')](handleError(_0xa6f31d,null));};exports[_0xc0a1('0x48')]=function(_0x1b4a40,_0x3ca1e5){return db[_0xc0a1('0x2a')][_0xc0a1('0x48')](_0x1b4a40['body'],{})['then'](respondWithResult(_0x3ca1e5,0xc9))['catch'](handleError(_0x3ca1e5,null));};exports[_0xc0a1('0x49')]=function(_0xc874d3,_0x596d3a){return db[_0xc0a1('0x2a')]['bulkCreate'](_0xc874d3[_0xc0a1('0x4a')],{'raw':![],'individualHooks':!![]})[_0xc0a1('0x23')](respondWithResult(_0x596d3a,0xc9))[_0xc0a1('0x44')](handleError(_0x596d3a,null));};exports[_0xc0a1('0x4b')]=function(_0x55d06b,_0x5ca4ee){if(_0x55d06b[_0xc0a1('0x4a')]['id']){delete _0x55d06b[_0xc0a1('0x4a')]['id'];}return db[_0xc0a1('0x2a')][_0xc0a1('0x47')]({'where':{'id':_0x55d06b[_0xc0a1('0x4c')]['id']}})[_0xc0a1('0x23')](handleEntityNotFound(_0x5ca4ee,null))[_0xc0a1('0x23')](saveUpdates(_0x55d06b['body'],null))['then'](respondWithResult(_0x5ca4ee,null))[_0xc0a1('0x44')](handleError(_0x5ca4ee,null));};exports['destroy']=function(_0x2d94f3,_0x2bf4f5){return db[_0xc0a1('0x2a')][_0xc0a1('0x47')]({'where':{'id':_0x2d94f3['params']['id']}})[_0xc0a1('0x23')](handleEntityNotFound(_0x2bf4f5,null))[_0xc0a1('0x23')](removeEntity(_0x2bf4f5,null))[_0xc0a1('0x44')](handleError(_0x2bf4f5,null));};exports['bulkDestroy']=function(_0x2f8ea7,_0x31d2f3){return db[_0xc0a1('0x2a')][_0xc0a1('0x4d')]({'where':{'id':_0x2f8ea7[_0xc0a1('0x30')][_0xc0a1('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xc0a1('0x23')](respondWithResult(_0x31d2f3,0xcc))[_0xc0a1('0x44')](handleError(_0x31d2f3,null));};exports[_0xc0a1('0x4f')]=function(_0x24132d,_0x56c3d1,_0x56aab3){return db['AnalyticCustomReport'][_0xc0a1('0x50')]({'where':{'id':_0x24132d[_0xc0a1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x56c3d1,null))[_0xc0a1('0x23')](function(_0x1d8dcb){if(_0x1d8dcb){return db[_0xc0a1('0x51')][_0xc0a1('0x52')](function(_0x440d95){return db[_0xc0a1('0x2a')][_0xc0a1('0x4d')]({'where':{'CustomReportId':_0x24132d['params']['id']},'transaction':_0x440d95})['then'](function(_0xcd6ab4){var _0x40b9d4=_[_0xc0a1('0x29')](_0x24132d[_0xc0a1('0x4a')],function(_0x5dfb9e){delete _0x5dfb9e['id'];_0x5dfb9e['CustomReportId']=_0x24132d[_0xc0a1('0x4c')]['id'];return _0x5dfb9e;});return db[_0xc0a1('0x2a')][_0xc0a1('0x49')](_0x40b9d4,{'transaction':_0x440d95});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x24132d[_0xc0a1('0x4c')]['id']}});});}})[_0xc0a1('0x23')](respondWithResult(_0x56c3d1,null))['catch'](handleError(_0x56c3d1,null));};
\ No newline at end of file
+var _0x2128=['params','merge','find','create','bulkCreate','body','bulkDestroy','addFields','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','ejs','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','AnalyticFieldReport','includeAll','include','catch','show'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x2128,0x1e3));var _0x8212=function(_0x4f918e,_0xcd500e){_0x4f918e=_0x4f918e-0x0;var _0x15ee0c=_0x2128[_0x4f918e];return _0x15ee0c;};'use strict';var emlformat=require(_0x8212('0x0'));var rimraf=require(_0x8212('0x1'));var zipdir=require(_0x8212('0x2'));var jsonpatch=require(_0x8212('0x3'));var rp=require(_0x8212('0x4'));var moment=require('moment');var BPromise=require(_0x8212('0x5'));var Mustache=require('mustache');var util=require(_0x8212('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8212('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8212('0x8'));var squel=require(_0x8212('0x9'));var crypto=require(_0x8212('0xa'));var jsforce=require(_0x8212('0xb'));var deskjs=require(_0x8212('0xc'));var toCsv=require(_0x8212('0xd'));var querystring=require(_0x8212('0xe'));var Papa=require('papaparse');var Redis=require(_0x8212('0xf'));var authService=require(_0x8212('0x10'));var qs=require(_0x8212('0x11'));var as=require(_0x8212('0x12'));var hardwareService=require(_0x8212('0x13'));var logger=require(_0x8212('0x14'))(_0x8212('0x15'));var utils=require(_0x8212('0x16'));var config=require(_0x8212('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8212('0x18'))['db'];function respondWithStatusCode(_0x3385c1,_0x4f74ca){_0x4f74ca=_0x4f74ca||0xcc;return function(_0x5757b5){if(_0x5757b5){return _0x3385c1[_0x8212('0x19')](_0x4f74ca);}return _0x3385c1[_0x8212('0x1a')](_0x4f74ca)[_0x8212('0x1b')]();};}function respondWithResult(_0x395904,_0x14c17a){_0x14c17a=_0x14c17a||0xc8;return function(_0xffb143){if(_0xffb143){return _0x395904['status'](_0x14c17a)[_0x8212('0x1c')](_0xffb143);}};}function respondWithFilteredResult(_0x2ce1ca,_0x5f3a49){return function(_0x58f542){if(_0x58f542){var _0x2ce07c=typeof _0x5f3a49[_0x8212('0x1d')]===_0x8212('0x1e')&&typeof _0x5f3a49['limit']==='undefined';var _0x413e81=_0x58f542['count'];var _0x3e65c3=_0x2ce07c?0x0:_0x5f3a49[_0x8212('0x1d')];var _0x274101=_0x2ce07c?_0x58f542[_0x8212('0x1f')]:_0x5f3a49[_0x8212('0x1d')]+_0x5f3a49['limit'];var _0x19eedf;if(_0x274101>=_0x413e81){_0x274101=_0x413e81;_0x19eedf=0xc8;}else{_0x19eedf=0xce;}_0x2ce1ca[_0x8212('0x1a')](_0x19eedf);return _0x2ce1ca[_0x8212('0x20')](_0x8212('0x21'),_0x3e65c3+'-'+_0x274101+'/'+_0x413e81)[_0x8212('0x1c')](_0x58f542);}return null;};}function patchUpdates(_0x3aa93c){return function(_0x14dd8a){try{jsonpatch[_0x8212('0x22')](_0x14dd8a,_0x3aa93c,!![]);}catch(_0x203cca){return BPromise[_0x8212('0x23')](_0x203cca);}return _0x14dd8a[_0x8212('0x24')]();};}function saveUpdates(_0x264933,_0x2c5587){return function(_0x137dd8){if(_0x137dd8){return _0x137dd8[_0x8212('0x25')](_0x264933)['then'](function(_0x54c056){return _0x54c056;});}return null;};}function removeEntity(_0x55be1d,_0x53daa4){return function(_0x4a6056){if(_0x4a6056){return _0x4a6056[_0x8212('0x26')]()[_0x8212('0x27')](function(){_0x55be1d[_0x8212('0x1a')](0xcc)[_0x8212('0x1b')]();});}};}function handleEntityNotFound(_0x332124,_0x5ba21d){return function(_0x3978da){if(!_0x3978da){_0x332124[_0x8212('0x19')](0x194);}return _0x3978da;};}function handleError(_0x431139,_0xfa3216){_0xfa3216=_0xfa3216||0x1f4;return function(_0x578055){logger[_0x8212('0x28')](_0x578055[_0x8212('0x29')]);if(_0x578055[_0x8212('0x2a')]){delete _0x578055['name'];}_0x431139[_0x8212('0x1a')](_0xfa3216)['send'](_0x578055);};}exports[_0x8212('0x2b')]=function(_0x51450d,_0x55ce2c){var _0x4e8a2={},_0x1222ed={},_0xd2d53f={'count':0x0,'rows':[]};var _0x478c12=_[_0x8212('0x2c')](db['AnalyticFieldReport'][_0x8212('0x2d')],function(_0x1172f4){return{'name':_0x1172f4[_0x8212('0x2e')],'type':_0x1172f4[_0x8212('0x2f')]['key']};});_0x1222ed[_0x8212('0x30')]=_[_0x8212('0x2c')](_0x478c12,'name');_0x1222ed[_0x8212('0x31')]=_[_0x8212('0x32')](_0x51450d[_0x8212('0x31')]);_0x1222ed[_0x8212('0x33')]=_[_0x8212('0x34')](_0x1222ed[_0x8212('0x30')],_0x1222ed[_0x8212('0x31')]);_0x4e8a2['attributes']=_[_0x8212('0x34')](_0x1222ed[_0x8212('0x30')],qs[_0x8212('0x35')](_0x51450d[_0x8212('0x31')][_0x8212('0x35')]));_0x4e8a2[_0x8212('0x36')]=_0x4e8a2[_0x8212('0x36')][_0x8212('0x37')]?_0x4e8a2[_0x8212('0x36')]:_0x1222ed[_0x8212('0x30')];if(!_0x51450d['query'][_0x8212('0x38')](_0x8212('0x39'))){_0x4e8a2[_0x8212('0x3a')]=qs[_0x8212('0x3a')](_0x51450d[_0x8212('0x31')]['limit']);_0x4e8a2['offset']=qs[_0x8212('0x1d')](_0x51450d[_0x8212('0x31')]['offset']);}_0x4e8a2[_0x8212('0x3b')]=qs[_0x8212('0x3c')](_0x51450d[_0x8212('0x31')][_0x8212('0x3c')]);_0x4e8a2[_0x8212('0x3d')]=qs[_0x8212('0x33')](_[_0x8212('0x3e')](_0x51450d[_0x8212('0x31')],_0x1222ed[_0x8212('0x33')]),_0x478c12);if(_0x51450d[_0x8212('0x31')][_0x8212('0x3f')]){_0x4e8a2[_0x8212('0x3d')]=_['merge'](_0x4e8a2['where'],{'$or':_[_0x8212('0x2c')](_0x478c12,function(_0x1cc23f){if(_0x1cc23f[_0x8212('0x2f')]!=='VIRTUAL'){var _0x255662={};_0x255662[_0x1cc23f[_0x8212('0x2a')]]={'$like':'%'+_0x51450d[_0x8212('0x31')][_0x8212('0x3f')]+'%'};return _0x255662;}})});}_0x4e8a2=_['merge']({},_0x4e8a2,_0x51450d[_0x8212('0x40')]);var _0x4d1520={'where':_0x4e8a2[_0x8212('0x3d')]};return db[_0x8212('0x41')][_0x8212('0x1f')](_0x4d1520)[_0x8212('0x27')](function(_0x4832d9){_0xd2d53f[_0x8212('0x1f')]=_0x4832d9;if(_0x51450d[_0x8212('0x31')][_0x8212('0x42')]){_0x4e8a2[_0x8212('0x43')]=[{'all':!![]}];}return db[_0x8212('0x41')]['findAll'](_0x4e8a2);})['then'](function(_0x3a9182){_0xd2d53f['rows']=_0x3a9182;return _0xd2d53f;})[_0x8212('0x27')](respondWithFilteredResult(_0x55ce2c,_0x4e8a2))[_0x8212('0x44')](handleError(_0x55ce2c,null));};exports[_0x8212('0x45')]=function(_0x43c3b9,_0x45e9d5){var _0x1a5cd1={'raw':![],'where':{'id':_0x43c3b9[_0x8212('0x46')]['id']}},_0x5ac481={};_0x5ac481['model']=_[_0x8212('0x32')](db[_0x8212('0x41')][_0x8212('0x2d')]);_0x5ac481[_0x8212('0x31')]=_[_0x8212('0x32')](_0x43c3b9[_0x8212('0x31')]);_0x5ac481[_0x8212('0x33')]=_[_0x8212('0x34')](_0x5ac481['model'],_0x5ac481[_0x8212('0x31')]);_0x1a5cd1[_0x8212('0x36')]=_[_0x8212('0x34')](_0x5ac481[_0x8212('0x30')],qs['fields'](_0x43c3b9['query'][_0x8212('0x35')]));_0x1a5cd1[_0x8212('0x36')]=_0x1a5cd1[_0x8212('0x36')][_0x8212('0x37')]?_0x1a5cd1[_0x8212('0x36')]:_0x5ac481[_0x8212('0x30')];if(_0x43c3b9[_0x8212('0x31')][_0x8212('0x42')]){_0x1a5cd1[_0x8212('0x43')]=[{'all':!![]}];}_0x1a5cd1=_[_0x8212('0x47')]({},_0x1a5cd1,_0x43c3b9[_0x8212('0x40')]);return db['AnalyticFieldReport'][_0x8212('0x48')](_0x1a5cd1)[_0x8212('0x27')](handleEntityNotFound(_0x45e9d5,null))[_0x8212('0x27')](respondWithResult(_0x45e9d5,null))[_0x8212('0x44')](handleError(_0x45e9d5,null));};exports[_0x8212('0x49')]=function(_0x2a4f18,_0x23127b){return db['AnalyticFieldReport'][_0x8212('0x49')](_0x2a4f18['body'],{})[_0x8212('0x27')](respondWithResult(_0x23127b,0xc9))['catch'](handleError(_0x23127b,null));};exports['bulkCreate']=function(_0x112a53,_0x34b1ac){return db['AnalyticFieldReport'][_0x8212('0x4a')](_0x112a53[_0x8212('0x4b')],{'raw':![],'individualHooks':!![]})[_0x8212('0x27')](respondWithResult(_0x34b1ac,0xc9))['catch'](handleError(_0x34b1ac,null));};exports[_0x8212('0x25')]=function(_0x353f66,_0x204be8){if(_0x353f66[_0x8212('0x4b')]['id']){delete _0x353f66[_0x8212('0x4b')]['id'];}return db['AnalyticFieldReport'][_0x8212('0x48')]({'where':{'id':_0x353f66['params']['id']}})[_0x8212('0x27')](handleEntityNotFound(_0x204be8,null))[_0x8212('0x27')](saveUpdates(_0x353f66[_0x8212('0x4b')],null))[_0x8212('0x27')](respondWithResult(_0x204be8,null))[_0x8212('0x44')](handleError(_0x204be8,null));};exports[_0x8212('0x26')]=function(_0x8d5b10,_0x59650e){return db[_0x8212('0x41')][_0x8212('0x48')]({'where':{'id':_0x8d5b10[_0x8212('0x46')]['id']}})[_0x8212('0x27')](handleEntityNotFound(_0x59650e,null))[_0x8212('0x27')](removeEntity(_0x59650e,null))[_0x8212('0x44')](handleError(_0x59650e,null));};exports[_0x8212('0x4c')]=function(_0x3c8ff6,_0x3a3ca4){return db[_0x8212('0x41')][_0x8212('0x26')]({'where':{'id':_0x3c8ff6[_0x8212('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x8212('0x27')](respondWithResult(_0x3a3ca4,0xcc))['catch'](handleError(_0x3a3ca4,null));};exports[_0x8212('0x4d')]=function(_0x4c01c6,_0x2a81b2,_0x5dc879){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4c01c6[_0x8212('0x46')]['id']}})[_0x8212('0x27')](handleEntityNotFound(_0x2a81b2,null))[_0x8212('0x27')](function(_0x37a897){if(_0x37a897){return db[_0x8212('0x4e')]['transaction'](function(_0x2137d4){return db['AnalyticFieldReport'][_0x8212('0x26')]({'where':{'CustomReportId':_0x4c01c6[_0x8212('0x46')]['id']},'transaction':_0x2137d4})[_0x8212('0x27')](function(_0x1c5360){var _0x4620f0=_[_0x8212('0x2c')](_0x4c01c6[_0x8212('0x4b')],function(_0x3a31c3){delete _0x3a31c3['id'];_0x3a31c3['CustomReportId']=_0x4c01c6['params']['id'];return _0x3a31c3;});return db[_0x8212('0x41')][_0x8212('0x4a')](_0x4620f0,{'transaction':_0x2137d4});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x4c01c6[_0x8212('0x46')]['id']}});});}})[_0x8212('0x27')](respondWithResult(_0x2a81b2,null))[_0x8212('0x44')](handleError(_0x2a81b2,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 5574dd4..278c88f 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 _0x4c69=['exports','define','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4c69,0x13b));var _0x94c6=function(_0x2efcd4,_0x3d9689){_0x2efcd4=_0x2efcd4-0x0;var _0x5c5848=_0x4c69[_0x2efcd4];return _0x5c5848;};'use strict';var _=require('lodash');var util=require(_0x94c6('0x0'));var logger=require(_0x94c6('0x1'))(_0x94c6('0x2'));var moment=require(_0x94c6('0x3'));var BPromise=require(_0x94c6('0x4'));var rp=require(_0x94c6('0x5'));var fs=require('fs');var path=require(_0x94c6('0x6'));var rimraf=require(_0x94c6('0x7'));var config=require(_0x94c6('0x8'));var attributes=require(_0x94c6('0x9'));module[_0x94c6('0xa')]=function(_0x1fd01d,_0x38a523){return _0x1fd01d[_0x94c6('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x94c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd887=['request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird'];(function(_0x4ef6f3,_0xac58f1){var _0x82f917=function(_0x2a1a3b){while(--_0x2a1a3b){_0x4ef6f3['push'](_0x4ef6f3['shift']());}};_0x82f917(++_0xac58f1);}(_0xd887,0xcd));var _0x7d88=function(_0x5f0e14,_0x373cbb){_0x5f0e14=_0x5f0e14-0x0;var _0x3ed494=_0xd887[_0x5f0e14];return _0x3ed494;};'use strict';var _=require(_0x7d88('0x0'));var util=require(_0x7d88('0x1'));var logger=require(_0x7d88('0x2'))(_0x7d88('0x3'));var moment=require('moment');var BPromise=require(_0x7d88('0x4'));var rp=require(_0x7d88('0x5'));var fs=require('fs');var path=require(_0x7d88('0x6'));var rimraf=require(_0x7d88('0x7'));var config=require(_0x7d88('0x8'));var attributes=require(_0x7d88('0x9'));module[_0x7d88('0xa')]=function(_0x2a6753,_0x464b67){return _0x2a6753[_0x7d88('0xb')](_0x7d88('0xc'),attributes,{'tableName':_0x7d88('0xd'),'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 4d8905e..d5bca05 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 _0x67ca=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67ca,0x1cc));var _0xa67c=function(_0x559cf1,_0x195290){_0x559cf1=_0x559cf1-0x0;var _0x5a3eaa=_0x67ca[_0x559cf1];return _0x5a3eaa;};'use strict';var _=require(_0xa67c('0x0'));var util=require(_0xa67c('0x1'));var moment=require(_0xa67c('0x2'));var BPromise=require(_0xa67c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa67c('0x4'));var db=require(_0xa67c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa67c('0x6'))(_0xa67c('0x7'));var config=require('../../config/environment');var jayson=require(_0xa67c('0x8'));var client=jayson[_0xa67c('0x9')][_0xa67c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e274,_0x50a638,_0x2bc140){return new BPromise(function(_0x3bcc41,_0x3d9fab){return client[_0xa67c('0xb')](_0x19e274,_0x2bc140)[_0xa67c('0xc')](function(_0x3fff8b){logger[_0xa67c('0xd')](_0xa67c('0xe'),_0x50a638,'request\x20sent');logger[_0xa67c('0xf')](_0xa67c('0x10'),_0x50a638,_0xa67c('0x11'),JSON[_0xa67c('0x12')](_0x3fff8b));if(_0x3fff8b[_0xa67c('0x13')]){if(_0x3fff8b[_0xa67c('0x13')][_0xa67c('0x14')]===0x1f4){logger[_0xa67c('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x50a638,_0x3fff8b[_0xa67c('0x13')][_0xa67c('0x15')]);return _0x3d9fab(_0x3fff8b[_0xa67c('0x13')]['message']);}logger[_0xa67c('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x50a638,_0x3fff8b['error']['message']);return _0x3bcc41(_0x3fff8b[_0xa67c('0x13')][_0xa67c('0x15')]);}else{logger[_0xa67c('0xd')](_0xa67c('0xe'),_0x50a638,_0xa67c('0x11'));_0x3bcc41(_0x3fff8b[_0xa67c('0x16')][_0xa67c('0x15')]);}})['catch'](function(_0x3e86e5){logger['error'](_0xa67c('0xe'),_0x50a638,_0x3e86e5);_0x3d9fab(_0x3e86e5);});});}
\ No newline at end of file
+var _0x9394=['http','request','then','request\x20sent','debug','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../config/environment'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x9394,0x74));var _0x4939=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x9394[_0x1073ad];return _0x528474;};'use strict';var _=require('lodash');var util=require(_0x4939('0x0'));var moment=require('moment');var BPromise=require(_0x4939('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4939('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4939('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4939('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x124278,_0x45b8a6,_0x3e6ba5){return new BPromise(function(_0x26459e,_0x410b67){return client[_0x4939('0x5')](_0x124278,_0x3e6ba5)[_0x4939('0x6')](function(_0x136aba){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x45b8a6,_0x4939('0x7'));logger[_0x4939('0x8')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x45b8a6,_0x4939('0x7'),JSON['stringify'](_0x136aba));if(_0x136aba['error']){if(_0x136aba[_0x4939('0x9')][_0x4939('0xa')]===0x1f4){logger[_0x4939('0x9')](_0x4939('0xb'),_0x45b8a6,_0x136aba['error'][_0x4939('0xc')]);return _0x410b67(_0x136aba[_0x4939('0x9')][_0x4939('0xc')]);}logger[_0x4939('0x9')](_0x4939('0xb'),_0x45b8a6,_0x136aba[_0x4939('0x9')]['message']);return _0x26459e(_0x136aba[_0x4939('0x9')][_0x4939('0xc')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x45b8a6,_0x4939('0x7'));_0x26459e(_0x136aba[_0x4939('0xd')]['message']);}})[_0x4939('0xe')](function(_0x590f92){logger[_0x4939('0x9')](_0x4939('0xb'),_0x45b8a6,_0x590f92);_0x410b67(_0x590f92);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 6cbd0ab..a79ad54 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(_0x37438c,_0x122afd){var _0x1a5190=function(_0x3fc6f4){while(--_0x3fc6f4){_0x37438c['push'](_0x37438c['shift']());}};_0x1a5190(++_0x122afd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x3fa107,_0x5d443c){var _0x1b5b37=function(_0x4df7b2){while(--_0x4df7b2){_0x3fa107['push'](_0x3fa107['shift']());}};_0x1b5b37(++_0x5d443c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 3edb9b6..d1dc8e5 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 _0x608a=['exports','STRING','TEXT'];(function(_0x9d2852,_0x352f85){var _0x22e86d=function(_0x1ec97b){while(--_0x1ec97b){_0x9d2852['push'](_0x9d2852['shift']());}};_0x22e86d(++_0x352f85);}(_0x608a,0xff));var _0xa608=function(_0x3952e2,_0x1e7975){_0x3952e2=_0x3952e2-0x0;var _0x5b8f5d=_0x608a[_0x3952e2];return _0x5b8f5d;};'use strict';var Sequelize=require('sequelize');module[_0xa608('0x0')]={'name':{'type':Sequelize[_0xa608('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa608('0x1')]},'metric':{'type':Sequelize[_0xa608('0x2')]},'description':{'type':Sequelize[_0xa608('0x1')]}};
\ No newline at end of file
+var _0xa74f=['STRING','TEXT'];(function(_0x4adfba,_0x3bb57e){var _0x2bbb97=function(_0x5a8d7a){while(--_0x5a8d7a){_0x4adfba['push'](_0x4adfba['shift']());}};_0x2bbb97(++_0x3bb57e);}(_0xa74f,0x9a));var _0xfa74=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0xa74f[_0xbe40ad];return _0x50fac9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfa74('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfa74('0x1')]},'description':{'type':Sequelize[_0xfa74('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index cb1d5f6..1f26f08 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x58a292,_0x147f41){var _0x986e54=function(_0x3bfccb){while(--_0x3bfccb){_0x58a292['push'](_0x58a292['shift']());}};_0x986e54(++_0x147f41);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1edf67,_0x192956){var _0x48ce6f=function(_0x273b05){while(--_0x273b05){_0x1edf67['push'](_0x1edf67['shift']());}};_0x48ce6f(++_0x192956);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0xf2ca[_0xe51596];return _0x22c705;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index c8b21ea..3ce0394 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 _0xd072=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd072,0x132));var _0x2d07=function(_0x5ca144,_0x4326fb){_0x5ca144=_0x5ca144-0x0;var _0x198104=_0xd072[_0x5ca144];return _0x198104;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var logger=require(_0x2d07('0x2'))(_0x2d07('0x3'));var moment=require(_0x2d07('0x4'));var BPromise=require(_0x2d07('0x5'));var rp=require(_0x2d07('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d07('0x7'));var config=require(_0x2d07('0x8'));var attributes=require(_0x2d07('0x9'));module[_0x2d07('0xa')]=function(_0x34731c,_0x51aae0){return _0x34731c[_0x2d07('0xb')](_0x2d07('0xc'),attributes,{'tableName':_0x2d07('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a9a=['define','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x536068,_0x3de52c){var _0x4a5db2=function(_0x1a8091){while(--_0x1a8091){_0x536068['push'](_0x536068['shift']());}};_0x4a5db2(++_0x3de52c);}(_0x2a9a,0x64));var _0xa2a9=function(_0x5dbf5b,_0x52706b){_0x5dbf5b=_0x5dbf5b-0x0;var _0x3b395b=_0x2a9a[_0x5dbf5b];return _0x3b395b;};'use strict';var _=require(_0xa2a9('0x0'));var util=require('util');var logger=require(_0xa2a9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa2a9('0x2'));var rp=require(_0xa2a9('0x3'));var fs=require('fs');var path=require(_0xa2a9('0x4'));var rimraf=require(_0xa2a9('0x5'));var config=require(_0xa2a9('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xa2a9('0x7')]=function(_0x2c31a4,_0x37648b){return _0x2c31a4[_0xa2a9('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 d8967e3..7721e61 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 _0xc4d9=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x16f0e8,_0x25b381){var _0x418a8f=function(_0x3192c8){while(--_0x3192c8){_0x16f0e8['push'](_0x16f0e8['shift']());}};_0x418a8f(++_0x25b381);}(_0xc4d9,0x1d6));var _0x9c4d=function(_0x3b94dd,_0x4dff75){_0x3b94dd=_0x3b94dd-0x0;var _0x439ae0=_0xc4d9[_0x3b94dd];return _0x439ae0;};'use strict';var _=require(_0x9c4d('0x0'));var util=require('util');var moment=require(_0x9c4d('0x1'));var BPromise=require(_0x9c4d('0x2'));var rs=require(_0x9c4d('0x3'));var fs=require('fs');var Redis=require(_0x9c4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c4d('0x5'));var logger=require('../../config/logger')(_0x9c4d('0x6'));var config=require(_0x9c4d('0x7'));var jayson=require(_0x9c4d('0x8'));var client=jayson[_0x9c4d('0x9')][_0x9c4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431687,_0x3bd9c8,_0x542b8b){return new BPromise(function(_0x4ed463,_0x5e540d){return client['request'](_0x431687,_0x542b8b)[_0x9c4d('0xb')](function(_0x1dbbf7){logger[_0x9c4d('0xc')](_0x9c4d('0xd'),_0x3bd9c8,'request\x20sent');logger[_0x9c4d('0xe')](_0x9c4d('0xf'),_0x3bd9c8,_0x9c4d('0x10'),JSON[_0x9c4d('0x11')](_0x1dbbf7));if(_0x1dbbf7[_0x9c4d('0x12')]){if(_0x1dbbf7[_0x9c4d('0x12')]['code']===0x1f4){logger['error'](_0x9c4d('0xd'),_0x3bd9c8,_0x1dbbf7[_0x9c4d('0x12')]['message']);return _0x5e540d(_0x1dbbf7[_0x9c4d('0x12')]['message']);}logger[_0x9c4d('0x12')](_0x9c4d('0xd'),_0x3bd9c8,_0x1dbbf7[_0x9c4d('0x12')][_0x9c4d('0x13')]);return _0x4ed463(_0x1dbbf7[_0x9c4d('0x12')]['message']);}else{logger[_0x9c4d('0xc')](_0x9c4d('0xd'),_0x3bd9c8,_0x9c4d('0x10'));_0x4ed463(_0x1dbbf7[_0x9c4d('0x14')][_0x9c4d('0x13')]);}})[_0x9c4d('0x15')](function(_0x55e051){logger[_0x9c4d('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3bd9c8,_0x55e051);_0x5e540d(_0x55e051);});});}
\ No newline at end of file
+var _0x3eb1=['debug','stringify','error','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x1d7c83,_0x2d8f2d){var _0x283ef2=function(_0x68da53){while(--_0x68da53){_0x1d7c83['push'](_0x1d7c83['shift']());}};_0x283ef2(++_0x2d8f2d);}(_0x3eb1,0x1b9));var _0x13eb=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x3eb1[_0x2e04ef];return _0x5722b0;};'use strict';var _=require('lodash');var util=require(_0x13eb('0x0'));var moment=require('moment');var BPromise=require(_0x13eb('0x1'));var rs=require(_0x13eb('0x2'));var fs=require('fs');var Redis=require(_0x13eb('0x3'));var db=require(_0x13eb('0x4'))['db'];var utils=require(_0x13eb('0x5'));var logger=require(_0x13eb('0x6'))(_0x13eb('0x7'));var config=require(_0x13eb('0x8'));var jayson=require(_0x13eb('0x9'));var client=jayson['client'][_0x13eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5463e0,_0x46d68a,_0x36bb2d){return new BPromise(function(_0x425fc4,_0x44836d){return client['request'](_0x5463e0,_0x36bb2d)[_0x13eb('0xb')](function(_0x1be678){logger[_0x13eb('0xc')](_0x13eb('0xd'),_0x46d68a,_0x13eb('0xe'));logger[_0x13eb('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x46d68a,_0x13eb('0xe'),JSON[_0x13eb('0x10')](_0x1be678));if(_0x1be678[_0x13eb('0x11')]){if(_0x1be678[_0x13eb('0x11')]['code']===0x1f4){logger[_0x13eb('0x11')](_0x13eb('0xd'),_0x46d68a,_0x1be678[_0x13eb('0x11')][_0x13eb('0x12')]);return _0x44836d(_0x1be678[_0x13eb('0x11')][_0x13eb('0x12')]);}logger['error'](_0x13eb('0xd'),_0x46d68a,_0x1be678[_0x13eb('0x11')][_0x13eb('0x12')]);return _0x425fc4(_0x1be678[_0x13eb('0x11')][_0x13eb('0x12')]);}else{logger[_0x13eb('0xc')](_0x13eb('0xd'),_0x46d68a,_0x13eb('0xe'));_0x425fc4(_0x1be678['result'][_0x13eb('0x12')]);}})['catch'](function(_0x69db0){logger[_0x13eb('0x11')](_0x13eb('0xd'),_0x46d68a,_0x69db0);_0x44836d(_0x69db0);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 15bb0d7..cdc262b 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 _0xf2ca=['/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','put','update','delete'];(function(_0x8da1a3,_0xbf8497){var _0x11237b=function(_0x24477b){while(--_0x24477b){_0x8da1a3['push'](_0x8da1a3['shift']());}};_0x11237b(++_0xbf8497);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5a5c11,_0x358f6b){_0x5a5c11=_0x5a5c11-0x0;var _0x5d6ba7=_0xf2ca[_0x5a5c11];return _0x5d6ba7;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./analyticMetric.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/:id',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xa')](),controller['create']);router[_0xaf2c('0xd')]('/:id',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xe')]);router[_0xaf2c('0xf')](_0xaf2c('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xaf2c('0x11')]=router;
\ No newline at end of file
+var _0xe548=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','./analyticMetric.controller','isAuthenticated','get','/:id','show','post','create'];(function(_0x5eefbb,_0x5da8f4){var _0x52056f=function(_0x1ce15c){while(--_0x1ce15c){_0x5eefbb['push'](_0x5eefbb['shift']());}};_0x52056f(++_0x5da8f4);}(_0xe548,0x184));var _0x8e54=function(_0x16e5d1,_0x9cf085){_0x16e5d1=_0x16e5d1-0x0;var _0x3f72e6=_0xe548[_0x16e5d1];return _0x3f72e6;};'use strict';var multer=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var path=require(_0x8e54('0x2'));var timeout=require(_0x8e54('0x3'));var express=require(_0x8e54('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('../../config/environment');var controller=require(_0x8e54('0x5'));router['get']('/',auth[_0x8e54('0x6')](),controller['index']);router[_0x8e54('0x7')](_0x8e54('0x8'),auth[_0x8e54('0x6')](),controller[_0x8e54('0x9')]);router[_0x8e54('0xa')]('/',auth[_0x8e54('0x6')](),controller[_0x8e54('0xb')]);router['put'](_0x8e54('0x8'),auth[_0x8e54('0x6')](),controller[_0x8e54('0xc')]);router[_0x8e54('0xd')](_0x8e54('0x8'),auth['isAuthenticated'](),controller[_0x8e54('0xe')]);module[_0x8e54('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index cced493..a2efd01 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 _0x6452=['sequelize','exports'];(function(_0x4a8b5b,_0x523af7){var _0x58566d=function(_0x372f06){while(--_0x372f06){_0x4a8b5b['push'](_0x4a8b5b['shift']());}};_0x58566d(++_0x523af7);}(_0x6452,0x12e));var _0x2645=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0x6452[_0x53f964];return _0x17be6c;};'use strict';var Sequelize=require(_0x2645('0x0'));module[_0x2645('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xde35=['TEXT','sequelize','exports'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xde35,0x17b));var _0x5de3=function(_0x439dcc,_0x49dfb1){_0x439dcc=_0x439dcc-0x0;var _0xf5e34b=_0xde35[_0x439dcc];return _0xf5e34b;};'use strict';var Sequelize=require(_0x5de3('0x0'));module[_0x5de3('0x1')]={'tree':{'type':Sequelize[_0x5de3('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 764f198..c031a65 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 _0xdcb2=['name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','then','destroy','error'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xdcb2,0x68));var _0x2dcb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdcb2[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x2dcb('0x0'));var rimraf=require(_0x2dcb('0x1'));var zipdir=require(_0x2dcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2dcb('0x3'));var moment=require(_0x2dcb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2dcb('0x5'));var util=require(_0x2dcb('0x6'));var path=require('path');var sox=require(_0x2dcb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2dcb('0x8'));var squel=require('squel');var crypto=require(_0x2dcb('0x9'));var jsforce=require(_0x2dcb('0xa'));var deskjs=require(_0x2dcb('0xb'));var toCsv=require(_0x2dcb('0xc'));var querystring=require(_0x2dcb('0xd'));var Papa=require(_0x2dcb('0xe'));var Redis=require(_0x2dcb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2dcb('0x10'));var as=require(_0x2dcb('0x11'));var hardwareService=require(_0x2dcb('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2dcb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2dcb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a2559,_0x57024b){_0x57024b=_0x57024b||0xcc;return function(_0x109919){if(_0x109919){return _0x3a2559[_0x2dcb('0x15')](_0x57024b);}return _0x3a2559['status'](_0x57024b)[_0x2dcb('0x16')]();};}function respondWithResult(_0x3e5c90,_0x3507fe){_0x3507fe=_0x3507fe||0xc8;return function(_0x1273ec){if(_0x1273ec){return _0x3e5c90['status'](_0x3507fe)[_0x2dcb('0x17')](_0x1273ec);}};}function respondWithFilteredResult(_0x42a2c1,_0x565c6b){return function(_0x54c543){if(_0x54c543){var _0x3e2bae=typeof _0x565c6b[_0x2dcb('0x18')]===_0x2dcb('0x19')&&typeof _0x565c6b[_0x2dcb('0x1a')]===_0x2dcb('0x19');var _0x3b044c=_0x54c543[_0x2dcb('0x1b')];var _0x329578=_0x3e2bae?0x0:_0x565c6b['offset'];var _0x496bb2=_0x3e2bae?_0x54c543[_0x2dcb('0x1b')]:_0x565c6b['offset']+_0x565c6b[_0x2dcb('0x1a')];var _0x1a7b52;if(_0x496bb2>=_0x3b044c){_0x496bb2=_0x3b044c;_0x1a7b52=0xc8;}else{_0x1a7b52=0xce;}_0x42a2c1[_0x2dcb('0x1c')](_0x1a7b52);return _0x42a2c1[_0x2dcb('0x1d')]('Content-Range',_0x329578+'-'+_0x496bb2+'/'+_0x3b044c)['json'](_0x54c543);}return null;};}function patchUpdates(_0x2ddec4){return function(_0x4a9b5a){try{jsonpatch[_0x2dcb('0x1e')](_0x4a9b5a,_0x2ddec4,!![]);}catch(_0x4c176f){return BPromise['reject'](_0x4c176f);}return _0x4a9b5a[_0x2dcb('0x1f')]();};}function saveUpdates(_0x41f413,_0xcf23ff){return function(_0x1958be){if(_0x1958be){return _0x1958be[_0x2dcb('0x20')](_0x41f413)[_0x2dcb('0x21')](function(_0x34fd0a){return _0x34fd0a;});}return null;};}function removeEntity(_0x7cf8bc,_0xab5906){return function(_0x2bd648){if(_0x2bd648){return _0x2bd648[_0x2dcb('0x22')]()['then'](function(){_0x7cf8bc[_0x2dcb('0x1c')](0xcc)[_0x2dcb('0x16')]();});}};}function handleEntityNotFound(_0x4fa037,_0x1fe23a){return function(_0x36fd21){if(!_0x36fd21){_0x4fa037['sendStatus'](0x194);}return _0x36fd21;};}function handleError(_0x2e36f8,_0x2d1e80){_0x2d1e80=_0x2d1e80||0x1f4;return function(_0x18bd22){logger[_0x2dcb('0x23')](_0x18bd22['stack']);if(_0x18bd22[_0x2dcb('0x24')]){delete _0x18bd22[_0x2dcb('0x24')];}_0x2e36f8[_0x2dcb('0x1c')](_0x2d1e80)[_0x2dcb('0x25')](_0x18bd22);};}exports['index']=function(_0x31b5db,_0xce46d9){var _0x3dacac={},_0x4b276d={},_0x5ec161={'count':0x0,'rows':[]};var _0x871f2c=_[_0x2dcb('0x26')](db['AnalyticTreeReport'][_0x2dcb('0x27')],function(_0x6de47b){return{'name':_0x6de47b[_0x2dcb('0x28')],'type':_0x6de47b[_0x2dcb('0x29')][_0x2dcb('0x2a')]};});_0x4b276d[_0x2dcb('0x2b')]=_[_0x2dcb('0x26')](_0x871f2c,_0x2dcb('0x24'));_0x4b276d[_0x2dcb('0x2c')]=_[_0x2dcb('0x2d')](_0x31b5db[_0x2dcb('0x2c')]);_0x4b276d['filters']=_[_0x2dcb('0x2e')](_0x4b276d[_0x2dcb('0x2b')],_0x4b276d[_0x2dcb('0x2c')]);_0x3dacac['attributes']=_[_0x2dcb('0x2e')](_0x4b276d[_0x2dcb('0x2b')],qs[_0x2dcb('0x2f')](_0x31b5db[_0x2dcb('0x2c')][_0x2dcb('0x2f')]));_0x3dacac[_0x2dcb('0x30')]=_0x3dacac['attributes']['length']?_0x3dacac[_0x2dcb('0x30')]:_0x4b276d['model'];if(!_0x31b5db[_0x2dcb('0x2c')][_0x2dcb('0x31')]('nolimit')){_0x3dacac['limit']=qs[_0x2dcb('0x1a')](_0x31b5db[_0x2dcb('0x2c')]['limit']);_0x3dacac[_0x2dcb('0x18')]=qs[_0x2dcb('0x18')](_0x31b5db[_0x2dcb('0x2c')]['offset']);}_0x3dacac[_0x2dcb('0x32')]=qs['sort'](_0x31b5db['query'][_0x2dcb('0x33')]);_0x3dacac[_0x2dcb('0x34')]=qs[_0x2dcb('0x35')](_[_0x2dcb('0x36')](_0x31b5db[_0x2dcb('0x2c')],_0x4b276d[_0x2dcb('0x35')]),_0x871f2c);if(_0x31b5db[_0x2dcb('0x2c')][_0x2dcb('0x37')]){_0x3dacac[_0x2dcb('0x34')]=_[_0x2dcb('0x38')](_0x3dacac['where'],{'$or':_[_0x2dcb('0x26')](_0x871f2c,function(_0x46ed22){if(_0x46ed22[_0x2dcb('0x29')]!==_0x2dcb('0x39')){var _0x12c32b={};_0x12c32b[_0x46ed22[_0x2dcb('0x24')]]={'$like':'%'+_0x31b5db[_0x2dcb('0x2c')][_0x2dcb('0x37')]+'%'};return _0x12c32b;}})});}_0x3dacac=_[_0x2dcb('0x38')]({},_0x3dacac,_0x31b5db[_0x2dcb('0x3a')]);var _0x4ddc12={'where':_0x3dacac[_0x2dcb('0x34')]};return db[_0x2dcb('0x3b')][_0x2dcb('0x1b')](_0x4ddc12)[_0x2dcb('0x21')](function(_0x19f5b9){_0x5ec161[_0x2dcb('0x1b')]=_0x19f5b9;if(_0x31b5db[_0x2dcb('0x2c')][_0x2dcb('0x3c')]){_0x3dacac[_0x2dcb('0x3d')]=[{'all':!![]}];}return db[_0x2dcb('0x3b')][_0x2dcb('0x3e')](_0x3dacac);})['then'](function(_0x13e298){_0x5ec161[_0x2dcb('0x3f')]=_0x13e298;return _0x5ec161;})[_0x2dcb('0x21')](respondWithFilteredResult(_0xce46d9,_0x3dacac))[_0x2dcb('0x40')](handleError(_0xce46d9,null));};exports['show']=function(_0x19ea51,_0x345a27){var _0x4f5ed6={'raw':!![],'where':{'id':_0x19ea51[_0x2dcb('0x41')]['id']}},_0x21a036={};_0x21a036[_0x2dcb('0x2b')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x21a036[_0x2dcb('0x2c')]=_[_0x2dcb('0x2d')](_0x19ea51[_0x2dcb('0x2c')]);_0x21a036[_0x2dcb('0x35')]=_[_0x2dcb('0x2e')](_0x21a036[_0x2dcb('0x2b')],_0x21a036[_0x2dcb('0x2c')]);_0x4f5ed6[_0x2dcb('0x30')]=_[_0x2dcb('0x2e')](_0x21a036[_0x2dcb('0x2b')],qs[_0x2dcb('0x2f')](_0x19ea51['query']['fields']));_0x4f5ed6[_0x2dcb('0x30')]=_0x4f5ed6['attributes'][_0x2dcb('0x42')]?_0x4f5ed6[_0x2dcb('0x30')]:_0x21a036[_0x2dcb('0x2b')];if(_0x19ea51[_0x2dcb('0x2c')][_0x2dcb('0x3c')]){_0x4f5ed6[_0x2dcb('0x3d')]=[{'all':!![]}];}_0x4f5ed6=_[_0x2dcb('0x38')]({},_0x4f5ed6,_0x19ea51[_0x2dcb('0x3a')]);return db[_0x2dcb('0x3b')][_0x2dcb('0x43')](_0x4f5ed6)[_0x2dcb('0x21')](handleEntityNotFound(_0x345a27,null))['then'](respondWithResult(_0x345a27,null))[_0x2dcb('0x40')](handleError(_0x345a27,null));};exports[_0x2dcb('0x44')]=function(_0x4f996f,_0x3b3fe2){return db[_0x2dcb('0x3b')][_0x2dcb('0x44')](_0x4f996f[_0x2dcb('0x45')],{})['then'](respondWithResult(_0x3b3fe2,0xc9))[_0x2dcb('0x40')](handleError(_0x3b3fe2,null));};exports[_0x2dcb('0x20')]=function(_0x3c7089,_0xf73df6){if(_0x3c7089[_0x2dcb('0x45')]['id']){delete _0x3c7089['body']['id'];}return db[_0x2dcb('0x3b')][_0x2dcb('0x43')]({'where':{'id':_0x3c7089[_0x2dcb('0x41')]['id']}})[_0x2dcb('0x21')](handleEntityNotFound(_0xf73df6,null))[_0x2dcb('0x21')](saveUpdates(_0x3c7089['body'],null))[_0x2dcb('0x21')](respondWithResult(_0xf73df6,null))[_0x2dcb('0x40')](handleError(_0xf73df6,null));};exports[_0x2dcb('0x22')]=function(_0x1ae8fa,_0x33a3ea){return db[_0x2dcb('0x3b')]['find']({'where':{'id':_0x1ae8fa[_0x2dcb('0x41')]['id']}})[_0x2dcb('0x21')](handleEntityNotFound(_0x33a3ea,null))['then'](removeEntity(_0x33a3ea,null))['catch'](handleError(_0x33a3ea,null));};
\ No newline at end of file
+var _0xb134=['rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','options','includeAll','include','findAll','catch','show','params','keys','merge','find','create','update','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','AnalyticTreeReport'];(function(_0x856f37,_0x51476a){var _0x5ee158=function(_0x4ef3d9){while(--_0x4ef3d9){_0x856f37['push'](_0x856f37['shift']());}};_0x5ee158(++_0x51476a);}(_0xb134,0xb1));var _0x4b13=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0xb134[_0x2c3a8f];return _0x189412;};'use strict';var emlformat=require(_0x4b13('0x0'));var rimraf=require(_0x4b13('0x1'));var zipdir=require(_0x4b13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b13('0x3'));var moment=require(_0x4b13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4b13('0x5'));var util=require(_0x4b13('0x6'));var path=require(_0x4b13('0x7'));var sox=require(_0x4b13('0x8'));var csv=require(_0x4b13('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b13('0xa'));var _=require('lodash');var squel=require(_0x4b13('0xb'));var crypto=require('crypto');var jsforce=require(_0x4b13('0xc'));var deskjs=require(_0x4b13('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4b13('0xe'));var Papa=require(_0x4b13('0xf'));var Redis=require(_0x4b13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4b13('0x11'));var as=require(_0x4b13('0x12'));var hardwareService=require(_0x4b13('0x13'));var logger=require(_0x4b13('0x14'))(_0x4b13('0x15'));var utils=require(_0x4b13('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4b13('0x17'));var db=require(_0x4b13('0x18'))['db'];function respondWithStatusCode(_0x10e723,_0x297b4e){_0x297b4e=_0x297b4e||0xcc;return function(_0x53b8e0){if(_0x53b8e0){return _0x10e723['sendStatus'](_0x297b4e);}return _0x10e723[_0x4b13('0x19')](_0x297b4e)['end']();};}function respondWithResult(_0x4eb5c7,_0x2c2617){_0x2c2617=_0x2c2617||0xc8;return function(_0x10360b){if(_0x10360b){return _0x4eb5c7[_0x4b13('0x19')](_0x2c2617)[_0x4b13('0x1a')](_0x10360b);}};}function respondWithFilteredResult(_0x2cdafb,_0x18d0a4){return function(_0x496a35){if(_0x496a35){var _0x2abd8a=typeof _0x18d0a4[_0x4b13('0x1b')]==='undefined'&&typeof _0x18d0a4['limit']===_0x4b13('0x1c');var _0x50d3e3=_0x496a35[_0x4b13('0x1d')];var _0x5b240a=_0x2abd8a?0x0:_0x18d0a4[_0x4b13('0x1b')];var _0x3bb8da=_0x2abd8a?_0x496a35[_0x4b13('0x1d')]:_0x18d0a4[_0x4b13('0x1b')]+_0x18d0a4[_0x4b13('0x1e')];var _0x47028f;if(_0x3bb8da>=_0x50d3e3){_0x3bb8da=_0x50d3e3;_0x47028f=0xc8;}else{_0x47028f=0xce;}_0x2cdafb[_0x4b13('0x19')](_0x47028f);return _0x2cdafb[_0x4b13('0x1f')]('Content-Range',_0x5b240a+'-'+_0x3bb8da+'/'+_0x50d3e3)['json'](_0x496a35);}return null;};}function patchUpdates(_0x2dd3b0){return function(_0x2f00eb){try{jsonpatch[_0x4b13('0x20')](_0x2f00eb,_0x2dd3b0,!![]);}catch(_0x51e18e){return BPromise[_0x4b13('0x21')](_0x51e18e);}return _0x2f00eb[_0x4b13('0x22')]();};}function saveUpdates(_0x567d60,_0x1a9cd0){return function(_0x1a2448){if(_0x1a2448){return _0x1a2448['update'](_0x567d60)[_0x4b13('0x23')](function(_0x552987){return _0x552987;});}return null;};}function removeEntity(_0x3f75af,_0x1e212f){return function(_0x4290c4){if(_0x4290c4){return _0x4290c4[_0x4b13('0x24')]()[_0x4b13('0x23')](function(){_0x3f75af[_0x4b13('0x19')](0xcc)[_0x4b13('0x25')]();});}};}function handleEntityNotFound(_0xdbc295,_0x49ddf4){return function(_0x4b99f3){if(!_0x4b99f3){_0xdbc295['sendStatus'](0x194);}return _0x4b99f3;};}function handleError(_0x209fae,_0x2adf7c){_0x2adf7c=_0x2adf7c||0x1f4;return function(_0x42d101){logger[_0x4b13('0x26')](_0x42d101[_0x4b13('0x27')]);if(_0x42d101[_0x4b13('0x28')]){delete _0x42d101['name'];}_0x209fae[_0x4b13('0x19')](_0x2adf7c)[_0x4b13('0x29')](_0x42d101);};}exports[_0x4b13('0x2a')]=function(_0x289ec1,_0x493427){var _0x437884={},_0x5544f5={},_0x218b10={'count':0x0,'rows':[]};var _0x15e386=_[_0x4b13('0x2b')](db[_0x4b13('0x2c')][_0x4b13('0x2d')],function(_0x5783c8){return{'name':_0x5783c8[_0x4b13('0x2e')],'type':_0x5783c8[_0x4b13('0x2f')][_0x4b13('0x30')]};});_0x5544f5[_0x4b13('0x31')]=_['map'](_0x15e386,_0x4b13('0x28'));_0x5544f5[_0x4b13('0x32')]=_['keys'](_0x289ec1[_0x4b13('0x32')]);_0x5544f5[_0x4b13('0x33')]=_['intersection'](_0x5544f5[_0x4b13('0x31')],_0x5544f5[_0x4b13('0x32')]);_0x437884[_0x4b13('0x34')]=_[_0x4b13('0x35')](_0x5544f5[_0x4b13('0x31')],qs['fields'](_0x289ec1[_0x4b13('0x32')][_0x4b13('0x36')]));_0x437884[_0x4b13('0x34')]=_0x437884[_0x4b13('0x34')][_0x4b13('0x37')]?_0x437884['attributes']:_0x5544f5[_0x4b13('0x31')];if(!_0x289ec1['query'][_0x4b13('0x38')]('nolimit')){_0x437884[_0x4b13('0x1e')]=qs[_0x4b13('0x1e')](_0x289ec1[_0x4b13('0x32')][_0x4b13('0x1e')]);_0x437884[_0x4b13('0x1b')]=qs['offset'](_0x289ec1[_0x4b13('0x32')][_0x4b13('0x1b')]);}_0x437884[_0x4b13('0x39')]=qs[_0x4b13('0x3a')](_0x289ec1[_0x4b13('0x32')][_0x4b13('0x3a')]);_0x437884['where']=qs['filters'](_['pick'](_0x289ec1[_0x4b13('0x32')],_0x5544f5[_0x4b13('0x33')]),_0x15e386);if(_0x289ec1['query'][_0x4b13('0x3b')]){_0x437884[_0x4b13('0x3c')]=_['merge'](_0x437884[_0x4b13('0x3c')],{'$or':_[_0x4b13('0x2b')](_0x15e386,function(_0x1aba72){if(_0x1aba72[_0x4b13('0x2f')]!=='VIRTUAL'){var _0x48d032={};_0x48d032[_0x1aba72[_0x4b13('0x28')]]={'$like':'%'+_0x289ec1[_0x4b13('0x32')][_0x4b13('0x3b')]+'%'};return _0x48d032;}})});}_0x437884=_['merge']({},_0x437884,_0x289ec1[_0x4b13('0x3d')]);var _0x9556a4={'where':_0x437884[_0x4b13('0x3c')]};return db['AnalyticTreeReport'][_0x4b13('0x1d')](_0x9556a4)['then'](function(_0x24f5a1){_0x218b10['count']=_0x24f5a1;if(_0x289ec1['query'][_0x4b13('0x3e')]){_0x437884[_0x4b13('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x4b13('0x40')](_0x437884);})[_0x4b13('0x23')](function(_0xb0e781){_0x218b10['rows']=_0xb0e781;return _0x218b10;})[_0x4b13('0x23')](respondWithFilteredResult(_0x493427,_0x437884))[_0x4b13('0x41')](handleError(_0x493427,null));};exports[_0x4b13('0x42')]=function(_0x46eb3d,_0x1a75c6){var _0x3acba2={'raw':!![],'where':{'id':_0x46eb3d[_0x4b13('0x43')]['id']}},_0x111d96={};_0x111d96[_0x4b13('0x31')]=_[_0x4b13('0x44')](db['AnalyticTreeReport'][_0x4b13('0x2d')]);_0x111d96['query']=_[_0x4b13('0x44')](_0x46eb3d['query']);_0x111d96[_0x4b13('0x33')]=_[_0x4b13('0x35')](_0x111d96['model'],_0x111d96[_0x4b13('0x32')]);_0x3acba2[_0x4b13('0x34')]=_[_0x4b13('0x35')](_0x111d96['model'],qs[_0x4b13('0x36')](_0x46eb3d[_0x4b13('0x32')]['fields']));_0x3acba2[_0x4b13('0x34')]=_0x3acba2[_0x4b13('0x34')][_0x4b13('0x37')]?_0x3acba2['attributes']:_0x111d96['model'];if(_0x46eb3d[_0x4b13('0x32')][_0x4b13('0x3e')]){_0x3acba2[_0x4b13('0x3f')]=[{'all':!![]}];}_0x3acba2=_[_0x4b13('0x45')]({},_0x3acba2,_0x46eb3d[_0x4b13('0x3d')]);return db[_0x4b13('0x2c')][_0x4b13('0x46')](_0x3acba2)['then'](handleEntityNotFound(_0x1a75c6,null))[_0x4b13('0x23')](respondWithResult(_0x1a75c6,null))[_0x4b13('0x41')](handleError(_0x1a75c6,null));};exports['create']=function(_0x83a317,_0x116549){return db[_0x4b13('0x2c')][_0x4b13('0x47')](_0x83a317['body'],{})['then'](respondWithResult(_0x116549,0xc9))[_0x4b13('0x41')](handleError(_0x116549,null));};exports[_0x4b13('0x48')]=function(_0x36a9aa,_0x26634a){if(_0x36a9aa[_0x4b13('0x49')]['id']){delete _0x36a9aa[_0x4b13('0x49')]['id'];}return db[_0x4b13('0x2c')][_0x4b13('0x46')]({'where':{'id':_0x36a9aa[_0x4b13('0x43')]['id']}})[_0x4b13('0x23')](handleEntityNotFound(_0x26634a,null))[_0x4b13('0x23')](saveUpdates(_0x36a9aa['body'],null))['then'](respondWithResult(_0x26634a,null))[_0x4b13('0x41')](handleError(_0x26634a,null));};exports[_0x4b13('0x24')]=function(_0x14ca42,_0x3011b0){return db[_0x4b13('0x2c')][_0x4b13('0x46')]({'where':{'id':_0x14ca42[_0x4b13('0x43')]['id']}})[_0x4b13('0x23')](handleEntityNotFound(_0x3011b0,null))[_0x4b13('0x23')](removeEntity(_0x3011b0,null))[_0x4b13('0x41')](handleError(_0x3011b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 21c7472..79af4c5 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 _0x0345=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','util','../../config/logger','api','moment','bluebird','path'];(function(_0x169e4a,_0x350d6b){var _0x1de1f7=function(_0x5f220e){while(--_0x5f220e){_0x169e4a['push'](_0x169e4a['shift']());}};_0x1de1f7(++_0x350d6b);}(_0x0345,0x9a));var _0x5034=function(_0x25ae0d,_0x437699){_0x25ae0d=_0x25ae0d-0x0;var _0x35a2df=_0x0345[_0x25ae0d];return _0x35a2df;};'use strict';var _=require('lodash');var util=require(_0x5034('0x0'));var logger=require(_0x5034('0x1'))(_0x5034('0x2'));var moment=require(_0x5034('0x3'));var BPromise=require(_0x5034('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5034('0x5'));var rimraf=require(_0x5034('0x6'));var config=require(_0x5034('0x7'));var attributes=require(_0x5034('0x8'));module[_0x5034('0x9')]=function(_0x1fd1da,_0x4f482a){return _0x1fd1da['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99a1=['../../config/logger','moment','bluebird','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x494223,_0x2c1f71){var _0xdaf98=function(_0x1f790e){while(--_0x1f790e){_0x494223['push'](_0x494223['shift']());}};_0xdaf98(++_0x2c1f71);}(_0x99a1,0x172));var _0x199a=function(_0x4ae97e,_0x508e0f){_0x4ae97e=_0x4ae97e-0x0;var _0x1b546a=_0x99a1[_0x4ae97e];return _0x1b546a;};'use strict';var _=require(_0x199a('0x0'));var util=require(_0x199a('0x1'));var logger=require(_0x199a('0x2'))('api');var moment=require(_0x199a('0x3'));var BPromise=require(_0x199a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x199a('0x5'));var rimraf=require('rimraf');var config=require(_0x199a('0x6'));var attributes=require(_0x199a('0x7'));module[_0x199a('0x8')]=function(_0x2b7040,_0x405e5d){return _0x2b7040[_0x199a('0x9')](_0x199a('0xa'),attributes,{'tableName':_0x199a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 1495e74..1d9dcb4 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x5e3650,_0x32c428){_0x5e3650=_0x5e3650-0x0;var _0x3d7d62=_0x7a54[_0x5e3650];return _0x3d7d62;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x212604,_0x44fce5){var _0x50f47f=function(_0x4ca2ab){while(--_0x4ca2ab){_0x212604['push'](_0x212604['shift']());}};_0x50f47f(++_0x44fce5);}(_0xdb28,0x106));var _0x8db2=function(_0x2c1245,_0x3ecf01){_0x2c1245=_0x2c1245-0x0;var _0x33d0de=_0xdb28[_0x2c1245];return _0x33d0de;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 7e5c3d0..3016f2a 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 _0x2ef3=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','show','post','create','/:id','update','destroy','exports','util','connect-timeout','../../components/auth/service'];(function(_0x274394,_0x6fd912){var _0x2a2773=function(_0x2ab84c){while(--_0x2ab84c){_0x274394['push'](_0x274394['shift']());}};_0x2a2773(++_0x6fd912);}(_0x2ef3,0xdd));var _0x32ef=function(_0x35549f,_0x3c2772){_0x35549f=_0x35549f-0x0;var _0x4d55d0=_0x2ef3[_0x35549f];return _0x4d55d0;};'use strict';var multer=require('multer');var util=require(_0x32ef('0x0'));var path=require('path');var timeout=require(_0x32ef('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x2'));var interaction=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));var controller=require(_0x32ef('0x5'));router['get']('/',auth[_0x32ef('0x6')](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x32ef('0x9')]);router[_0x32ef('0xa')]('/',auth['isAuthenticated'](),controller[_0x32ef('0xb')]);router['put'](_0x32ef('0xc'),auth[_0x32ef('0x6')](),controller[_0x32ef('0xd')]);router['delete'](_0x32ef('0xc'),auth[_0x32ef('0x6')](),controller[_0x32ef('0xe')]);module[_0x32ef('0xf')]=router;
\ No newline at end of file
+var _0x97d5=['Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x57a9d6,_0x244a86){var _0x403639=function(_0x3f16ed){while(--_0x3f16ed){_0x57a9d6['push'](_0x57a9d6['shift']());}};_0x403639(++_0x244a86);}(_0x97d5,0x19c));var _0x597d=function(_0x537719,_0x5b6014){_0x537719=_0x537719-0x0;var _0x351486=_0x97d5[_0x537719];return _0x351486;};'use strict';var multer=require('multer');var util=require(_0x597d('0x0'));var path=require(_0x597d('0x1'));var timeout=require(_0x597d('0x2'));var express=require(_0x597d('0x3'));var router=express[_0x597d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x597d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x597d('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x597d('0x7')]('/',auth['isAuthenticated'](),controller[_0x597d('0x8')]);router['get']('/:id',auth[_0x597d('0x9')](),controller['show']);router[_0x597d('0xa')]('/',auth[_0x597d('0x9')](),controller[_0x597d('0xb')]);router[_0x597d('0xc')]('/:id',auth[_0x597d('0x9')](),controller[_0x597d('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x597d('0xe')]);module[_0x597d('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f7b8250..79ad735 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 _0xe920=['STRING','sequelize','exports'];(function(_0x3d33b3,_0x6b936c){var _0x126090=function(_0x2fa252){while(--_0x2fa252){_0x3d33b3['push'](_0x3d33b3['shift']());}};_0x126090(++_0x6b936c);}(_0xe920,0xbe));var _0x0e92=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0xe920[_0x523adf];return _0x283870;};'use strict';var Sequelize=require(_0x0e92('0x0'));module[_0x0e92('0x1')]={'name':{'type':Sequelize[_0x0e92('0x2')]},'basename':{'type':Sequelize[_0x0e92('0x2')]},'type':{'type':Sequelize[_0x0e92('0x2')]}};
\ No newline at end of file
+var _0x0f69=['STRING'];(function(_0x5d5d2b,_0x40d997){var _0x32d20c=function(_0x380483){while(--_0x380483){_0x5d5d2b['push'](_0x5d5d2b['shift']());}};_0x32d20c(++_0x40d997);}(_0x0f69,0x173));var _0x90f6=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0f69[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x90f6('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x90f6('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 08d6ba9..e09ec63 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 _0x9ab4=['then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','find','catch','clone','params','get','createdAt','omit','updatedAt','create','body','update','file','originalname','mimetype','server/files/attachments/','join','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject'];(function(_0x20b5a5,_0x56b921){var _0x15d417=function(_0x5dfc0b){while(--_0x5dfc0b){_0x20b5a5['push'](_0x20b5a5['shift']());}};_0x15d417(++_0x56b921);}(_0x9ab4,0x127));var _0x49ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9ab4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x49ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49ab('0x1'));var jsonpatch=require(_0x49ab('0x2'));var rp=require(_0x49ab('0x3'));var moment=require(_0x49ab('0x4'));var BPromise=require(_0x49ab('0x5'));var Mustache=require('mustache');var util=require(_0x49ab('0x6'));var path=require(_0x49ab('0x7'));var sox=require(_0x49ab('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49ab('0x9'));var _=require('lodash');var squel=require(_0x49ab('0xa'));var crypto=require(_0x49ab('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x49ab('0xc'));var querystring=require(_0x49ab('0xd'));var Papa=require(_0x49ab('0xe'));var Redis=require(_0x49ab('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x49ab('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49ab('0x11'));var logger=require(_0x49ab('0x12'))('api');var utils=require(_0x49ab('0x13'));var config=require(_0x49ab('0x14'));var licenseUtil=require(_0x49ab('0x15'));var db=require(_0x49ab('0x16'))['db'];function respondWithStatusCode(_0x269a60,_0x45cfda){_0x45cfda=_0x45cfda||0xcc;return function(_0x56d32b){if(_0x56d32b){return _0x269a60[_0x49ab('0x17')](_0x45cfda);}return _0x269a60[_0x49ab('0x18')](_0x45cfda)[_0x49ab('0x19')]();};}function respondWithResult(_0x2173f7,_0x445f28){_0x445f28=_0x445f28||0xc8;return function(_0x52d668){if(_0x52d668){return _0x2173f7[_0x49ab('0x18')](_0x445f28)[_0x49ab('0x1a')](_0x52d668);}};}function respondWithFilteredResult(_0xaed587,_0x24ccd3){return function(_0x1c269a){if(_0x1c269a){var _0x51f952=typeof _0x24ccd3[_0x49ab('0x1b')]===_0x49ab('0x1c')&&typeof _0x24ccd3['limit']==='undefined';var _0x1d2c90=_0x1c269a[_0x49ab('0x1d')];var _0x2e35df=_0x51f952?0x0:_0x24ccd3[_0x49ab('0x1b')];var _0x14b224=_0x51f952?_0x1c269a[_0x49ab('0x1d')]:_0x24ccd3[_0x49ab('0x1b')]+_0x24ccd3['limit'];var _0x18a835;if(_0x14b224>=_0x1d2c90){_0x14b224=_0x1d2c90;_0x18a835=0xc8;}else{_0x18a835=0xce;}_0xaed587[_0x49ab('0x18')](_0x18a835);return _0xaed587['set'](_0x49ab('0x1e'),_0x2e35df+'-'+_0x14b224+'/'+_0x1d2c90)[_0x49ab('0x1a')](_0x1c269a);}return null;};}function patchUpdates(_0xf3fba){return function(_0xdca87c){try{jsonpatch[_0x49ab('0x1f')](_0xdca87c,_0xf3fba,!![]);}catch(_0xd10eb2){return BPromise[_0x49ab('0x20')](_0xd10eb2);}return _0xdca87c['save']();};}function saveUpdates(_0x57e219,_0x3bc31c){return function(_0x53dd63){if(_0x53dd63){return _0x53dd63['update'](_0x57e219)[_0x49ab('0x21')](function(_0x10fbf3){return _0x10fbf3;});}return null;};}function removeEntity(_0x5c4db0,_0x3757b3){return function(_0x5c8b32){if(_0x5c8b32){return _0x5c8b32[_0x49ab('0x22')]()['then'](function(){_0x5c4db0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ee67,_0x191322){return function(_0x9fb8dc){if(!_0x9fb8dc){_0x25ee67['sendStatus'](0x194);}return _0x9fb8dc;};}function handleError(_0x153160,_0x24bed6){_0x24bed6=_0x24bed6||0x1f4;return function(_0x551668){logger[_0x49ab('0x23')](_0x551668[_0x49ab('0x24')]);if(_0x551668[_0x49ab('0x25')]){delete _0x551668[_0x49ab('0x25')];}_0x153160[_0x49ab('0x18')](_0x24bed6)[_0x49ab('0x26')](_0x551668);};}exports[_0x49ab('0x27')]=function(_0x38e5eb,_0x5d09e9){var _0x278202={},_0x328717={},_0x4c907f={'count':0x0,'rows':[]};var _0x4bc6a4=_['map'](db[_0x49ab('0x28')][_0x49ab('0x29')],function(_0x525a0b){return{'name':_0x525a0b[_0x49ab('0x2a')],'type':_0x525a0b[_0x49ab('0x2b')]['key']};});_0x328717[_0x49ab('0x2c')]=_[_0x49ab('0x2d')](_0x4bc6a4,_0x49ab('0x25'));_0x328717[_0x49ab('0x2e')]=_[_0x49ab('0x2f')](_0x38e5eb[_0x49ab('0x2e')]);_0x328717[_0x49ab('0x30')]=_[_0x49ab('0x31')](_0x328717[_0x49ab('0x2c')],_0x328717[_0x49ab('0x2e')]);_0x278202[_0x49ab('0x32')]=_[_0x49ab('0x31')](_0x328717[_0x49ab('0x2c')],qs[_0x49ab('0x33')](_0x38e5eb[_0x49ab('0x2e')]['fields']));_0x278202[_0x49ab('0x32')]=_0x278202[_0x49ab('0x32')][_0x49ab('0x34')]?_0x278202[_0x49ab('0x32')]:_0x328717[_0x49ab('0x2c')];if(!_0x38e5eb[_0x49ab('0x2e')][_0x49ab('0x35')]('nolimit')){_0x278202[_0x49ab('0x36')]=qs[_0x49ab('0x36')](_0x38e5eb[_0x49ab('0x2e')][_0x49ab('0x36')]);_0x278202[_0x49ab('0x1b')]=qs[_0x49ab('0x1b')](_0x38e5eb[_0x49ab('0x2e')]['offset']);}_0x278202['order']=qs[_0x49ab('0x37')](_0x38e5eb[_0x49ab('0x2e')][_0x49ab('0x37')]);_0x278202[_0x49ab('0x38')]=qs['filters'](_[_0x49ab('0x39')](_0x38e5eb['query'],_0x328717[_0x49ab('0x30')]),_0x4bc6a4);if(_0x38e5eb[_0x49ab('0x2e')][_0x49ab('0x3a')]){_0x278202[_0x49ab('0x38')]=_[_0x49ab('0x3b')](_0x278202[_0x49ab('0x38')],{'$or':_[_0x49ab('0x2d')](_0x4bc6a4,function(_0x558c86){if(_0x558c86[_0x49ab('0x2b')]!==_0x49ab('0x3c')){var _0xb89a84={};_0xb89a84[_0x558c86[_0x49ab('0x25')]]={'$like':'%'+_0x38e5eb['query'][_0x49ab('0x3a')]+'%'};return _0xb89a84;}})});}_0x278202=_[_0x49ab('0x3b')]({},_0x278202,_0x38e5eb[_0x49ab('0x3d')]);var _0x179b45={'where':_0x278202[_0x49ab('0x38')]};return db[_0x49ab('0x28')][_0x49ab('0x1d')](_0x179b45)[_0x49ab('0x21')](function(_0x4b2b3f){_0x4c907f['count']=_0x4b2b3f;if(_0x38e5eb[_0x49ab('0x2e')][_0x49ab('0x3e')]){_0x278202[_0x49ab('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x49ab('0x40')](_0x278202);})[_0x49ab('0x21')](function(_0x4bd001){_0x4c907f['rows']=_0x4bd001;return _0x4c907f;})[_0x49ab('0x21')](respondWithFilteredResult(_0x5d09e9,_0x278202))['catch'](handleError(_0x5d09e9,null));};exports['show']=function(_0x45e98a,_0x4f6205){var _0x824f21={'raw':!![],'where':{'id':_0x45e98a['params']['id']}},_0x32ae5b={};_0x32ae5b['model']=_[_0x49ab('0x2f')](db[_0x49ab('0x28')][_0x49ab('0x29')]);_0x32ae5b[_0x49ab('0x2e')]=_[_0x49ab('0x2f')](_0x45e98a['query']);_0x32ae5b[_0x49ab('0x30')]=_['intersection'](_0x32ae5b[_0x49ab('0x2c')],_0x32ae5b[_0x49ab('0x2e')]);_0x824f21[_0x49ab('0x32')]=_[_0x49ab('0x31')](_0x32ae5b[_0x49ab('0x2c')],qs[_0x49ab('0x33')](_0x45e98a[_0x49ab('0x2e')][_0x49ab('0x33')]));_0x824f21[_0x49ab('0x32')]=_0x824f21[_0x49ab('0x32')]['length']?_0x824f21[_0x49ab('0x32')]:_0x32ae5b[_0x49ab('0x2c')];if(_0x45e98a[_0x49ab('0x2e')][_0x49ab('0x3e')]){_0x824f21[_0x49ab('0x3f')]=[{'all':!![]}];}_0x824f21=_['merge']({},_0x824f21,_0x45e98a['options']);return db[_0x49ab('0x28')][_0x49ab('0x41')](_0x824f21)[_0x49ab('0x21')](handleEntityNotFound(_0x4f6205,null))[_0x49ab('0x21')](respondWithResult(_0x4f6205,null))[_0x49ab('0x42')](handleError(_0x4f6205,null));};exports[_0x49ab('0x43')]=function(_0x59952d,_0x15c975){var _0x446adf={'where':{'id':_0x59952d[_0x49ab('0x44')]['id']}},_0x287dc4={};_0x287dc4['model']=_[_0x49ab('0x2f')](db[_0x49ab('0x28')][_0x49ab('0x29')]);_0x446adf[_0x49ab('0x32')]=_[_0x49ab('0x31')](_0x287dc4[_0x49ab('0x2c')],qs[_0x49ab('0x33')](_0x59952d['query']['fields']));_0x446adf[_0x49ab('0x32')]=_0x446adf[_0x49ab('0x32')][_0x49ab('0x34')]?_0x446adf['attributes']:_0x287dc4['model'];if(_0x59952d[_0x49ab('0x2e')][_0x49ab('0x3e')]){_0x446adf[_0x49ab('0x3f')]=[{'all':!![]}];}_0x446adf=_[_0x49ab('0x3b')]({},_0x446adf,_0x59952d['options']);return db[_0x49ab('0x28')][_0x49ab('0x41')](_0x446adf)[_0x49ab('0x21')](handleEntityNotFound(_0x15c975,null))[_0x49ab('0x21')](function(_0xe023e6){if(_0xe023e6){var _0x578890=_0xe023e6[_0x49ab('0x45')]({'plain':!![]});_0x578890=qs['omit'](_0x578890,['id',_0x49ab('0x46'),'updatedAt']);_0x59952d['body']=_[_0x49ab('0x47')](_0x59952d['body'],['id',_0x49ab('0x46'),_0x49ab('0x48')]);return db[_0x49ab('0x28')][_0x49ab('0x49')](_[_0x49ab('0x3b')](_0x578890,_0x59952d[_0x49ab('0x4a')]),{'include':_0x59952d[_0x49ab('0x2e')][_0x49ab('0x3e')]?[{'all':!![]}]:undefined});}})[_0x49ab('0x21')](respondWithResult(_0x15c975,0xc9))['catch'](handleError(_0x15c975,null));};exports[_0x49ab('0x4b')]=function(_0xb9bc98,_0x1534d3){if(_0xb9bc98['body']['id']){delete _0xb9bc98[_0x49ab('0x4a')]['id'];}return db[_0x49ab('0x28')][_0x49ab('0x41')]({'where':{'id':_0xb9bc98[_0x49ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x1534d3,null))[_0x49ab('0x21')](saveUpdates(_0xb9bc98[_0x49ab('0x4a')],null))[_0x49ab('0x21')](respondWithResult(_0x1534d3,null))[_0x49ab('0x42')](handleError(_0x1534d3,null));};exports[_0x49ab('0x22')]=function(_0x346562,_0x2b3dc4){return db['Attachment'][_0x49ab('0x41')]({'where':{'id':_0x346562[_0x49ab('0x44')]['id']}})[_0x49ab('0x21')](handleEntityNotFound(_0x2b3dc4,null))['then'](removeEntity(_0x2b3dc4,null))[_0x49ab('0x42')](handleError(_0x2b3dc4,null));};exports[_0x49ab('0x49')]=function(_0x111b06,_0x2f853a,_0x3bafeb){_0x111b06['body'][_0x49ab('0x25')]=_0x111b06[_0x49ab('0x4c')][_0x49ab('0x4d')];_0x111b06[_0x49ab('0x4a')]['basename']=_0x111b06['file']['filename'];_0x111b06[_0x49ab('0x4a')]['type']=_0x111b06[_0x49ab('0x4c')][_0x49ab('0x4e')];return db[_0x49ab('0x28')][_0x49ab('0x49')](_0x111b06[_0x49ab('0x4a')])[_0x49ab('0x21')](respondWithResult(_0x2f853a,0xc9))[_0x49ab('0x42')](handleError(_0x2f853a,null));};exports['download']=function(_0x2fc455,_0x344a5b,_0x216ab6){return db['Attachment']['findOne']({'where':{'id':_0x2fc455['params']['id']},'raw':!![]})[_0x49ab('0x21')](handleEntityNotFound(_0x344a5b,null))[_0x49ab('0x21')](function(_0x3c52a8){if(_0x3c52a8){var _0x2a6e1b=_0x3c52a8['ChatOfflineMessageId']!==null;var _0x566124=path['join'](config['root'],_0x49ab('0x4f'));if(_0x2a6e1b){_0x566124=path[_0x49ab('0x50')](_0x566124,'offline-chat/');}var _0x1b253d=path['join'](_0x566124,_0x3c52a8['basename']);return _0x344a5b[_0x49ab('0x51')](_0x1b253d);}})[_0x49ab('0x42')](handleError(_0x344a5b,null));};
\ No newline at end of file
+var _0x3248=['lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','Attachment','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','clone','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x5c0827,_0x139440){var _0x3f0951=function(_0x574488){while(--_0x574488){_0x5c0827['push'](_0x5c0827['shift']());}};_0x3f0951(++_0x139440);}(_0x3248,0x165));var _0x8324=function(_0x40e78d,_0x3e74a6){_0x40e78d=_0x40e78d-0x0;var _0x5b4577=_0x3248[_0x40e78d];return _0x5b4577;};'use strict';var emlformat=require(_0x8324('0x0'));var rimraf=require(_0x8324('0x1'));var zipdir=require(_0x8324('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8324('0x3'));var moment=require('moment');var BPromise=require(_0x8324('0x4'));var Mustache=require(_0x8324('0x5'));var util=require(_0x8324('0x6'));var path=require(_0x8324('0x7'));var sox=require(_0x8324('0x8'));var csv=require('to-csv');var ejs=require(_0x8324('0x9'));var fs=require('fs');var fs_extra=require(_0x8324('0xa'));var _=require(_0x8324('0xb'));var squel=require(_0x8324('0xc'));var crypto=require('crypto');var jsforce=require(_0x8324('0xd'));var deskjs=require(_0x8324('0xe'));var toCsv=require(_0x8324('0xf'));var querystring=require(_0x8324('0x10'));var Papa=require(_0x8324('0x11'));var Redis=require(_0x8324('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8324('0x13'));var as=require(_0x8324('0x14'));var hardwareService=require(_0x8324('0x15'));var logger=require('../../config/logger')(_0x8324('0x16'));var utils=require(_0x8324('0x17'));var config=require(_0x8324('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120218,_0x521d0e){_0x521d0e=_0x521d0e||0xcc;return function(_0x113ee7){if(_0x113ee7){return _0x120218[_0x8324('0x19')](_0x521d0e);}return _0x120218[_0x8324('0x1a')](_0x521d0e)[_0x8324('0x1b')]();};}function respondWithResult(_0x1d81f4,_0x574b1c){_0x574b1c=_0x574b1c||0xc8;return function(_0x54f071){if(_0x54f071){return _0x1d81f4[_0x8324('0x1a')](_0x574b1c)[_0x8324('0x1c')](_0x54f071);}};}function respondWithFilteredResult(_0x38e146,_0x5166a1){return function(_0x3d8452){if(_0x3d8452){var _0x4fd389=typeof _0x5166a1[_0x8324('0x1d')]===_0x8324('0x1e')&&typeof _0x5166a1[_0x8324('0x1f')]==='undefined';var _0x4e5af9=_0x3d8452[_0x8324('0x20')];var _0x4cdccb=_0x4fd389?0x0:_0x5166a1[_0x8324('0x1d')];var _0xd51031=_0x4fd389?_0x3d8452[_0x8324('0x20')]:_0x5166a1[_0x8324('0x1d')]+_0x5166a1[_0x8324('0x1f')];var _0x4d86f3;if(_0xd51031>=_0x4e5af9){_0xd51031=_0x4e5af9;_0x4d86f3=0xc8;}else{_0x4d86f3=0xce;}_0x38e146['status'](_0x4d86f3);return _0x38e146[_0x8324('0x21')](_0x8324('0x22'),_0x4cdccb+'-'+_0xd51031+'/'+_0x4e5af9)[_0x8324('0x1c')](_0x3d8452);}return null;};}function patchUpdates(_0x306db7){return function(_0x342275){try{jsonpatch[_0x8324('0x23')](_0x342275,_0x306db7,!![]);}catch(_0x3655a3){return BPromise[_0x8324('0x24')](_0x3655a3);}return _0x342275[_0x8324('0x25')]();};}function saveUpdates(_0xab73b1,_0x3887db){return function(_0x4f7a90){if(_0x4f7a90){return _0x4f7a90[_0x8324('0x26')](_0xab73b1)[_0x8324('0x27')](function(_0x4b3dd5){return _0x4b3dd5;});}return null;};}function removeEntity(_0x2b7f3c,_0x313c28){return function(_0x57f6a0){if(_0x57f6a0){return _0x57f6a0[_0x8324('0x28')]()[_0x8324('0x27')](function(){_0x2b7f3c[_0x8324('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34642c,_0x443dd7){return function(_0x4f2901){if(!_0x4f2901){_0x34642c[_0x8324('0x19')](0x194);}return _0x4f2901;};}function handleError(_0x2638aa,_0xc20f85){_0xc20f85=_0xc20f85||0x1f4;return function(_0x2c4c6d){logger['error'](_0x2c4c6d['stack']);if(_0x2c4c6d[_0x8324('0x29')]){delete _0x2c4c6d[_0x8324('0x29')];}_0x2638aa[_0x8324('0x1a')](_0xc20f85)[_0x8324('0x2a')](_0x2c4c6d);};}exports[_0x8324('0x2b')]=function(_0x2ab76c,_0x1c64d0){var _0x29e959={},_0x398744={},_0xcc2bcb={'count':0x0,'rows':[]};var _0x3decbf=_[_0x8324('0x2c')](db[_0x8324('0x2d')][_0x8324('0x2e')],function(_0x4c5293){return{'name':_0x4c5293[_0x8324('0x2f')],'type':_0x4c5293[_0x8324('0x30')]['key']};});_0x398744['model']=_[_0x8324('0x2c')](_0x3decbf,_0x8324('0x29'));_0x398744[_0x8324('0x31')]=_[_0x8324('0x32')](_0x2ab76c[_0x8324('0x31')]);_0x398744[_0x8324('0x33')]=_[_0x8324('0x34')](_0x398744[_0x8324('0x35')],_0x398744['query']);_0x29e959[_0x8324('0x36')]=_[_0x8324('0x34')](_0x398744[_0x8324('0x35')],qs[_0x8324('0x37')](_0x2ab76c['query'][_0x8324('0x37')]));_0x29e959['attributes']=_0x29e959[_0x8324('0x36')][_0x8324('0x38')]?_0x29e959['attributes']:_0x398744[_0x8324('0x35')];if(!_0x2ab76c[_0x8324('0x31')][_0x8324('0x39')](_0x8324('0x3a'))){_0x29e959['limit']=qs[_0x8324('0x1f')](_0x2ab76c['query'][_0x8324('0x1f')]);_0x29e959['offset']=qs[_0x8324('0x1d')](_0x2ab76c[_0x8324('0x31')][_0x8324('0x1d')]);}_0x29e959[_0x8324('0x3b')]=qs[_0x8324('0x3c')](_0x2ab76c[_0x8324('0x31')][_0x8324('0x3c')]);_0x29e959['where']=qs[_0x8324('0x33')](_[_0x8324('0x3d')](_0x2ab76c['query'],_0x398744[_0x8324('0x33')]),_0x3decbf);if(_0x2ab76c[_0x8324('0x31')][_0x8324('0x3e')]){_0x29e959[_0x8324('0x3f')]=_[_0x8324('0x40')](_0x29e959[_0x8324('0x3f')],{'$or':_['map'](_0x3decbf,function(_0x4d1b05){if(_0x4d1b05[_0x8324('0x30')]!==_0x8324('0x41')){var _0x3436c4={};_0x3436c4[_0x4d1b05[_0x8324('0x29')]]={'$like':'%'+_0x2ab76c[_0x8324('0x31')]['filter']+'%'};return _0x3436c4;}})});}_0x29e959=_[_0x8324('0x40')]({},_0x29e959,_0x2ab76c[_0x8324('0x42')]);var _0x3a81e7={'where':_0x29e959[_0x8324('0x3f')]};return db['Attachment'][_0x8324('0x20')](_0x3a81e7)[_0x8324('0x27')](function(_0x178e10){_0xcc2bcb[_0x8324('0x20')]=_0x178e10;if(_0x2ab76c[_0x8324('0x31')][_0x8324('0x43')]){_0x29e959['include']=[{'all':!![]}];}return db[_0x8324('0x2d')][_0x8324('0x44')](_0x29e959);})[_0x8324('0x27')](function(_0x172949){_0xcc2bcb[_0x8324('0x45')]=_0x172949;return _0xcc2bcb;})[_0x8324('0x27')](respondWithFilteredResult(_0x1c64d0,_0x29e959))[_0x8324('0x46')](handleError(_0x1c64d0,null));};exports[_0x8324('0x47')]=function(_0x549d86,_0x10f39b){var _0x1f936e={'raw':!![],'where':{'id':_0x549d86[_0x8324('0x48')]['id']}},_0x247d1b={};_0x247d1b[_0x8324('0x35')]=_[_0x8324('0x32')](db[_0x8324('0x2d')][_0x8324('0x2e')]);_0x247d1b[_0x8324('0x31')]=_[_0x8324('0x32')](_0x549d86[_0x8324('0x31')]);_0x247d1b['filters']=_['intersection'](_0x247d1b[_0x8324('0x35')],_0x247d1b[_0x8324('0x31')]);_0x1f936e['attributes']=_[_0x8324('0x34')](_0x247d1b[_0x8324('0x35')],qs['fields'](_0x549d86[_0x8324('0x31')][_0x8324('0x37')]));_0x1f936e[_0x8324('0x36')]=_0x1f936e['attributes'][_0x8324('0x38')]?_0x1f936e[_0x8324('0x36')]:_0x247d1b['model'];if(_0x549d86['query'][_0x8324('0x43')]){_0x1f936e[_0x8324('0x49')]=[{'all':!![]}];}_0x1f936e=_['merge']({},_0x1f936e,_0x549d86[_0x8324('0x42')]);return db['Attachment'][_0x8324('0x4a')](_0x1f936e)[_0x8324('0x27')](handleEntityNotFound(_0x10f39b,null))[_0x8324('0x27')](respondWithResult(_0x10f39b,null))[_0x8324('0x46')](handleError(_0x10f39b,null));};exports[_0x8324('0x4b')]=function(_0x25fc77,_0x391b81){var _0x5706aa={'where':{'id':_0x25fc77['params']['id']}},_0x5d5a4f={};_0x5d5a4f[_0x8324('0x35')]=_['keys'](db['Attachment']['rawAttributes']);_0x5706aa['attributes']=_[_0x8324('0x34')](_0x5d5a4f[_0x8324('0x35')],qs['fields'](_0x25fc77['query'][_0x8324('0x37')]));_0x5706aa[_0x8324('0x36')]=_0x5706aa[_0x8324('0x36')][_0x8324('0x38')]?_0x5706aa['attributes']:_0x5d5a4f[_0x8324('0x35')];if(_0x25fc77[_0x8324('0x31')]['includeAll']){_0x5706aa[_0x8324('0x49')]=[{'all':!![]}];}_0x5706aa=_[_0x8324('0x40')]({},_0x5706aa,_0x25fc77[_0x8324('0x42')]);return db['Attachment']['find'](_0x5706aa)[_0x8324('0x27')](handleEntityNotFound(_0x391b81,null))[_0x8324('0x27')](function(_0x298208){if(_0x298208){var _0x312bcd=_0x298208['get']({'plain':!![]});_0x312bcd=qs['omit'](_0x312bcd,['id',_0x8324('0x4c'),_0x8324('0x4d')]);_0x25fc77[_0x8324('0x4e')]=_[_0x8324('0x4f')](_0x25fc77[_0x8324('0x4e')],['id',_0x8324('0x4c'),_0x8324('0x4d')]);return db[_0x8324('0x2d')]['create'](_[_0x8324('0x40')](_0x312bcd,_0x25fc77[_0x8324('0x4e')]),{'include':_0x25fc77[_0x8324('0x31')][_0x8324('0x43')]?[{'all':!![]}]:undefined});}})[_0x8324('0x27')](respondWithResult(_0x391b81,0xc9))[_0x8324('0x46')](handleError(_0x391b81,null));};exports[_0x8324('0x26')]=function(_0x5c2f17,_0x104133){if(_0x5c2f17[_0x8324('0x4e')]['id']){delete _0x5c2f17['body']['id'];}return db['Attachment'][_0x8324('0x4a')]({'where':{'id':_0x5c2f17[_0x8324('0x48')]['id']}})['then'](handleEntityNotFound(_0x104133,null))[_0x8324('0x27')](saveUpdates(_0x5c2f17[_0x8324('0x4e')],null))[_0x8324('0x27')](respondWithResult(_0x104133,null))[_0x8324('0x46')](handleError(_0x104133,null));};exports[_0x8324('0x28')]=function(_0xf3d800,_0x1f18da){return db['Attachment'][_0x8324('0x4a')]({'where':{'id':_0xf3d800[_0x8324('0x48')]['id']}})[_0x8324('0x27')](handleEntityNotFound(_0x1f18da,null))[_0x8324('0x27')](removeEntity(_0x1f18da,null))['catch'](handleError(_0x1f18da,null));};exports[_0x8324('0x50')]=function(_0x714e84,_0x46a4bc,_0x41ffb8){_0x714e84[_0x8324('0x4e')]['name']=_0x714e84[_0x8324('0x51')][_0x8324('0x52')];_0x714e84[_0x8324('0x4e')][_0x8324('0x53')]=_0x714e84[_0x8324('0x51')][_0x8324('0x54')];_0x714e84['body']['type']=_0x714e84[_0x8324('0x51')]['mimetype'];return db[_0x8324('0x2d')][_0x8324('0x50')](_0x714e84['body'])[_0x8324('0x27')](respondWithResult(_0x46a4bc,0xc9))[_0x8324('0x46')](handleError(_0x46a4bc,null));};exports[_0x8324('0x55')]=function(_0x17034c,_0x4e3798,_0x442f60){return db[_0x8324('0x2d')][_0x8324('0x56')]({'where':{'id':_0x17034c[_0x8324('0x48')]['id']},'raw':!![]})[_0x8324('0x27')](handleEntityNotFound(_0x4e3798,null))[_0x8324('0x27')](function(_0x23e374){if(_0x23e374){var _0x3490df=_0x23e374[_0x8324('0x57')]!==null;var _0x462cb9=path[_0x8324('0x58')](config[_0x8324('0x59')],_0x8324('0x5a'));if(_0x3490df){_0x462cb9=path['join'](_0x462cb9,_0x8324('0x5b'));}var _0x5bc255=path[_0x8324('0x58')](_0x462cb9,_0x23e374['basename']);return _0x4e3798[_0x8324('0x55')](_0x5bc255);}})[_0x8324('0x46')](handleError(_0x4e3798,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index dcff5e9..3f69152 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 _0x9efc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','attachments','lodash','util','../../config/logger'];(function(_0xa45c45,_0x2de75d){var _0x5ab426=function(_0x310b5e){while(--_0x310b5e){_0xa45c45['push'](_0xa45c45['shift']());}};_0x5ab426(++_0x2de75d);}(_0x9efc,0x97));var _0xc9ef=function(_0x45c5f9,_0x1ad8c9){_0x45c5f9=_0x45c5f9-0x0;var _0x22cc60=_0x9efc[_0x45c5f9];return _0x22cc60;};'use strict';var _=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var logger=require(_0xc9ef('0x2'))(_0xc9ef('0x3'));var moment=require(_0xc9ef('0x4'));var BPromise=require(_0xc9ef('0x5'));var rp=require(_0xc9ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9ef('0x7'));var config=require(_0xc9ef('0x8'));var attributes=require(_0xc9ef('0x9'));module['exports']=function(_0x45f0ad,_0x560298){return _0x45f0ad['define']('Attachment',attributes,{'tableName':_0xc9ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbe3=['../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xfbe3,0xa1));var _0x3fbe=function(_0x2e7522,_0x5b1548){_0x2e7522=_0x2e7522-0x0;var _0x200019=_0xfbe3[_0x2e7522];return _0x200019;};'use strict';var _=require(_0x3fbe('0x0'));var util=require('util');var logger=require(_0x3fbe('0x1'))(_0x3fbe('0x2'));var moment=require(_0x3fbe('0x3'));var BPromise=require(_0x3fbe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fbe('0x5'));var rimraf=require(_0x3fbe('0x6'));var config=require(_0x3fbe('0x7'));var attributes=require(_0x3fbe('0x8'));module['exports']=function(_0x507f81,_0x4d0fab){return _0x507f81[_0x3fbe('0x9')](_0x3fbe('0xa'),attributes,{'tableName':_0x3fbe('0xb'),'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 d38b650..27aae84 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 _0xfaa4=['http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xe3b50f,_0x2d8aa2){var _0xfb095d=function(_0x3a2e92){while(--_0x3a2e92){_0xe3b50f['push'](_0xe3b50f['shift']());}};_0xfb095d(++_0x2d8aa2);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x47f56f,_0x32a463){_0x47f56f=_0x47f56f-0x0;var _0x4b285d=_0xfaa4[_0x47f56f];return _0x4b285d;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var moment=require(_0x4faa('0x2'));var BPromise=require(_0x4faa('0x3'));var rs=require(_0x4faa('0x4'));var fs=require('fs');var Redis=require(_0x4faa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4faa('0x6'));var logger=require(_0x4faa('0x7'))(_0x4faa('0x8'));var config=require(_0x4faa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4faa('0xa')][_0x4faa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa46a7d,_0x504f83,_0x528871){return new BPromise(function(_0x5d476f,_0x159843){return client[_0x4faa('0xc')](_0xa46a7d,_0x528871)[_0x4faa('0xd')](function(_0x4dd4d4){logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,_0x4faa('0x10'));logger[_0x4faa('0x11')](_0x4faa('0x12'),_0x504f83,'request\x20sent',JSON['stringify'](_0x4dd4d4));if(_0x4dd4d4[_0x4faa('0x13')]){if(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x14')]===0x1f4){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x159843(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);}logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x5d476f(_0x4dd4d4['error'][_0x4faa('0x15')]);}else{logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,'request\x20sent');_0x5d476f(_0x4dd4d4[_0x4faa('0x16')][_0x4faa('0x15')]);}})[_0x4faa('0x17')](function(_0x536a2b){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x536a2b);_0x159843(_0x536a2b);});});}exports['CreateAttachment']=function(_0x5d8c8a){var _0x5444d9=this;return new Promise(function(_0x33592d,_0x361cdc){return db[_0x4faa('0x18')][_0x4faa('0x19')](_0x5d8c8a['body'],{'raw':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![]})[_0x4faa('0xd')](function(_0x492417){logger[_0x4faa('0xe')]('CreateAttachment',_0x5d8c8a);logger['debug'](_0x4faa('0x1c'),_0x5d8c8a,JSON['stringify'](_0x492417));_0x33592d(_0x492417);})['catch'](function(_0x14683b){logger[_0x4faa('0x13')](_0x4faa('0x1c'),_0x14683b[_0x4faa('0x15')],_0x5d8c8a);_0x361cdc(_0x5444d9[_0x4faa('0x13')](0x1f4,_0x14683b[_0x4faa('0x15')]));});});};
\ No newline at end of file
+var _0xf46a=['http','then','request\x20sent','debug','stringify','error','code','Attachment,\x20%s,\x20%s','message','info','Attachment','create','options','CreateAttachment','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xb5a881,_0x101dd8){var _0x1979ce=function(_0xcf7a83){while(--_0xcf7a83){_0xb5a881['push'](_0xb5a881['shift']());}};_0x1979ce(++_0x101dd8);}(_0xf46a,0xa4));var _0xaf46=function(_0x3ebb6d,_0x38c763){_0x3ebb6d=_0x3ebb6d-0x0;var _0x4b1351=_0xf46a[_0x3ebb6d];return _0x4b1351;};'use strict';var _=require(_0xaf46('0x0'));var util=require('util');var moment=require(_0xaf46('0x1'));var BPromise=require(_0xaf46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf46('0x3'));var db=require(_0xaf46('0x4'))['db'];var utils=require(_0xaf46('0x5'));var logger=require(_0xaf46('0x6'))(_0xaf46('0x7'));var config=require(_0xaf46('0x8'));var jayson=require(_0xaf46('0x9'));var client=jayson[_0xaf46('0xa')][_0xaf46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e9887,_0x4f76cc,_0xa4a618){return new BPromise(function(_0x105943,_0x328d92){return client['request'](_0x9e9887,_0xa4a618)[_0xaf46('0xc')](function(_0x4e67c0){logger['info']('Attachment,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'));logger[_0xaf46('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'),JSON[_0xaf46('0xf')](_0x4e67c0));if(_0x4e67c0[_0xaf46('0x10')]){if(_0x4e67c0['error'][_0xaf46('0x11')]===0x1f4){logger['error'](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0['error'][_0xaf46('0x13')]);return _0x328d92(_0x4e67c0['error'][_0xaf46('0x13')]);}logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);return _0x105943(_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);}else{logger[_0xaf46('0x14')]('Attachment,\x20%s,\x20%s',_0x4f76cc,'request\x20sent');_0x105943(_0x4e67c0['result'][_0xaf46('0x13')]);}})['catch'](function(_0x498720){logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x498720);_0x328d92(_0x498720);});});}exports['CreateAttachment']=function(_0x128ad8){var _0x3a26f1=this;return new Promise(function(_0x224413,_0xd1b9ce){return db[_0xaf46('0x15')][_0xaf46('0x16')](_0x128ad8['body'],{'raw':_0x128ad8[_0xaf46('0x17')]?_0x128ad8[_0xaf46('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf46('0xc')](function(_0x4459d5){logger['info']('CreateAttachment',_0x128ad8);logger['debug'](_0xaf46('0x18'),_0x128ad8,JSON[_0xaf46('0xf')](_0x4459d5));_0x224413(_0x4459d5);})['catch'](function(_0x183cb6){logger['error'](_0xaf46('0x18'),_0x183cb6[_0xaf46('0x13')],_0x128ad8);_0xd1b9ce(_0x3a26f1[_0xaf46('0x10')](0x1f4,_0x183cb6[_0xaf46('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 89cdfa7..9038913 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x35907a,_0x6ef545){var _0x49b1d6=function(_0x2d5c4d){while(--_0x2d5c4d){_0x35907a['push'](_0x35907a['shift']());}};_0x49b1d6(++_0x6ef545);}(_0x5f2f,0x73));var _0xf5f2=function(_0x579873,_0x4865a9){_0x579873=_0x579873-0x0;var _0x222961=_0x5f2f[_0x579873];return _0x222961;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x0b0e,0x187));var _0xe0b0=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x0b0e[_0x483d8b];return _0x6500f1;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index d9ea48a..d630fca 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 _0x9509=['online','user','agent','then','blocked','blockedAt','add','minutes','getLicense','status','send','message','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','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','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt'];(function(_0x23aa0f,_0x51c827){var _0x3749bd=function(_0x5ea1c8){while(--_0x5ea1c8){_0x23aa0f['push'](_0x23aa0f['shift']());}};_0x3749bd(++_0x51c827);}(_0x9509,0x1bb));var _0x9950=function(_0x5c1a8d,_0x2fee45){_0x5c1a8d=_0x5c1a8d-0x0;var _0xda1a1e=_0x9509[_0x5c1a8d];return _0xda1a1e;};'use strict';var passport=require(_0x9950('0x0'));var LocalStrategy=require('passport-local')[_0x9950('0x1')];var moment=require(_0x9950('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x9950('0x3'));var util=require(_0x9950('0x4'));var db=require(_0x9950('0x5'))['db'];var authService=require(_0x9950('0x6'));var utils=require(_0x9950('0x7'));var config=require(_0x9950('0x8'));var logger=require('../../config/logger')(_0x9950('0x9'));function isActiveDirectoryConfigured(_0x1b6ee9){var _0x4cdcf5=![];if(typeof _0x1b6ee9[_0x9950('0xa')]!==_0x9950('0xb')){_0x4cdcf5=_0x1b6ee9[_0x9950('0xa')][_0x9950('0xc')]&&_0x1b6ee9['activedirectory']['url']&&_0x1b6ee9[_0x9950('0xa')][_0x9950('0xd')];}return _0x4cdcf5;}function adAuthenticate(_0x22cd05,_0x3a8c45,_0x2ec994){return new BPromise(function(_0x80ea7,_0x1e151d){try{var _0xf3636f=new ActiveDirectory(_0x22cd05);_0xf3636f['authenticate'](_0x3a8c45,_0x2ec994,function(_0x448255,_0x118033){if(_0x448255){logger[_0x9950('0xe')](_0x9950('0xf'),_0x3a8c45,util['inspect'](_0x448255,{'showHidden':![],'depth':null}));_0x1e151d(_0x9950('0x10'));}else if(!_0x118033){logger[_0x9950('0xe')](_0x9950('0x11'),_0x3a8c45);_0x1e151d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x80ea7(_0x118033);}});}catch(_0x156db9){_0x1e151d(_0x156db9);}});}function ActiveDirectoryAuthenticate(_0x1cd65e,_0x2ea1cb,_0x571ec3,_0x51c90c){var _0x59afdc,_0x24e736;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x9950('0x12'),_0x2ea1cb);return _0x51c90c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x9950('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x9950('0x14'),_0x9950('0x15')],'raw':!![]})['then'](function(_0x4d3eb5){_0x59afdc=_0x4d3eb5;if(!_0x59afdc[_0x9950('0x14')]){logger[_0x9950('0xe')](_0x9950('0x16'),_0x2ea1cb);throw new Error(_0x9950('0x10'));}return _0x1cd65e[_0x9950('0x17')]({'attributes':['id',_0x9950('0x18'),_0x9950('0x19'),_0x9950('0x1a'),'role','disabled','blocked','blockedAt',_0x9950('0x1b')],'where':{'name':_0x2ea1cb,'role':{'$or':['admin',_0x9950('0x1c'),_0x9950('0x1d')]},'adSsoEnabled':!![]}});})[_0x9950('0x1e')](function(_0x2f1cdf){if(!_0x2f1cdf||_0x2f1cdf&&_0x2f1cdf[_0x9950('0x18')]!==_0x2ea1cb){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x24e736=_0x2f1cdf;var _0x392421=_0x24e736[_0x9950('0x18')]+'@'+config[_0x9950('0xa')]['domain'];return adAuthenticate(config[_0x9950('0xa')],_0x392421,_0x571ec3);})['then'](function(_0x5f1800){if(_0x24e736['disabled']){throw new Error(_0x9950('0x10'));}if(_0x59afdc[_0x9950('0x15')]>0x0){if(_0x24e736[_0x9950('0x1f')]){if(moment(_0x24e736[_0x9950('0x20')])[_0x9950('0x21')](_0x59afdc[_0x9950('0x15')],_0x9950('0x22'))>moment()){throw new Error(_0x9950('0x10'));}return utils['clearBlockUser'](_0x24e736,0x0,![],null)[_0x9950('0x1e')](function(){return utils[_0x9950('0x23')](_0x24e736);})[_0x9950('0x1e')](function(){return _0x51c90c(null,_0x24e736);});}else{return utils[_0x9950('0x23')](_0x24e736)[_0x9950('0x1e')](function(){return _0x51c90c(null,_0x24e736);});}}else{return utils[_0x9950('0x23')](_0x24e736)[_0x9950('0x1e')](function(){return _0x51c90c(null,_0x24e736);});}})['catch'](function(_0x1e47bc){return _0x51c90c(null,![],_0x1e47bc);});}function handleError(_0x11c4a4,_0x5a982f,_0x3df1f0){return _0x11c4a4[_0x9950('0x24')](_0x5a982f||0x1f4)[_0x9950('0x25')]({'message':_0x3df1f0?_0x3df1f0[_0x9950('0x26')]||_0x3df1f0:''});}exports['login']=function(_0x3ffbd8,_0x159189,_0x4a673d){passport[_0x9950('0x27')](_0x9950('0x28'),function(_0x428a22,_0x1e3b7f,_0x5b0f1d){var _0x2db60f=_0x428a22||_0x5b0f1d;if(_0x2db60f){return handleError(_0x159189,0x191,_0x2db60f);}if(!_0x1e3b7f){return handleError(_0x159189,0x194,{'message':_0x9950('0x29')});}else{var _0x31222={'payload':{'id':_0x1e3b7f['id'],'role':_0x1e3b7f[_0x9950('0x2a')]},'options':{'expiresIn':0x15180}};return authService[_0x9950('0x2b')](_0x31222)[_0x9950('0x1e')](function(_0x3c7f73){_0x159189[_0x9950('0x2c')]({'id':_0x1e3b7f['id'],'token':_0x3c7f73,'statusCall':'','isAlreadyLogged':_0x1e3b7f[_0x9950('0x1b')]});});}})(_0x3ffbd8,_0x159189,_0x4a673d);};passport[_0x9950('0x2d')]('ad-login',new LocalStrategy({'usernameField':_0x9950('0x18'),'passwordField':_0x9950('0x19')},function(_0x13fd5e,_0x236ff8,_0xeea1b2){return ActiveDirectoryAuthenticate(db[_0x9950('0x2e')],_0x13fd5e,_0x236ff8,_0xeea1b2);}));
\ No newline at end of file
+var _0x1b21=['blockedAt','agent','domain','add','clearBlockUser','getLicense','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','use','password','User','passport','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','blocked'];(function(_0x17e319,_0x347c53){var _0xd6ba0f=function(_0x487e6b){while(--_0x487e6b){_0x17e319['push'](_0x17e319['shift']());}};_0xd6ba0f(++_0x347c53);}(_0x1b21,0x14e));var _0x11b2=function(_0xd6c062,_0x51fbea){_0xd6c062=_0xd6c062-0x0;var _0x38ce9c=_0x1b21[_0xd6c062];return _0x38ce9c;};'use strict';var passport=require(_0x11b2('0x0'));var LocalStrategy=require('passport-local')[_0x11b2('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x11b2('0x2'));var BPromise=require(_0x11b2('0x3'));var util=require(_0x11b2('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x11b2('0x5'));var utils=require('../../config/utils');var config=require(_0x11b2('0x6'));var logger=require('../../config/logger')(_0x11b2('0x7'));function isActiveDirectoryConfigured(_0x1d7810){var _0x4ab51d=![];if(typeof _0x1d7810[_0x11b2('0x8')]!==_0x11b2('0x9')){_0x4ab51d=_0x1d7810['activedirectory'][_0x11b2('0xa')]&&_0x1d7810[_0x11b2('0x8')][_0x11b2('0xb')]&&_0x1d7810[_0x11b2('0x8')]['domain'];}return _0x4ab51d;}function adAuthenticate(_0x2a9f1c,_0x3d3faa,_0x3cba72){return new BPromise(function(_0x572381,_0x5e312b){try{var _0x4799a5=new ActiveDirectory(_0x2a9f1c);_0x4799a5[_0x11b2('0xc')](_0x3d3faa,_0x3cba72,function(_0xcf2c7,_0xae2573){if(_0xcf2c7){logger[_0x11b2('0xd')](_0x11b2('0xe'),_0x3d3faa,util[_0x11b2('0xf')](_0xcf2c7,{'showHidden':![],'depth':null}));_0x5e312b(_0x11b2('0x10'));}else if(!_0xae2573){logger[_0x11b2('0xd')](_0x11b2('0x11'),_0x3d3faa);_0x5e312b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x572381(_0xae2573);}});}catch(_0x2c4316){_0x5e312b(_0x2c4316);}});}function ActiveDirectoryAuthenticate(_0x4e2d36,_0x41a981,_0x3fd4d0,_0x571927){var _0x2153c8,_0x183e9b;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x41a981);return _0x571927(null,![],{'message':_0x11b2('0x10')});}return db[_0x11b2('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x11b2('0x13'),_0x11b2('0x14')],'raw':!![]})[_0x11b2('0x15')](function(_0x137f88){_0x2153c8=_0x137f88;if(!_0x2153c8[_0x11b2('0x13')]){logger[_0x11b2('0xd')](_0x11b2('0x16'),_0x41a981);throw new Error(_0x11b2('0x10'));}return _0x4e2d36[_0x11b2('0x17')]({'attributes':['id',_0x11b2('0x18'),'password','salt','role','disabled',_0x11b2('0x19'),_0x11b2('0x1a'),'online'],'where':{'name':_0x41a981,'role':{'$or':['admin','user',_0x11b2('0x1b')]},'adSsoEnabled':!![]}});})[_0x11b2('0x15')](function(_0x49ef99){if(!_0x49ef99||_0x49ef99&&_0x49ef99[_0x11b2('0x18')]!==_0x41a981){throw new Error(_0x11b2('0x10'));}_0x183e9b=_0x49ef99;var _0x59dd9d=_0x183e9b[_0x11b2('0x18')]+'@'+config[_0x11b2('0x8')][_0x11b2('0x1c')];return adAuthenticate(config[_0x11b2('0x8')],_0x59dd9d,_0x3fd4d0);})[_0x11b2('0x15')](function(_0x4321e2){if(_0x183e9b['disabled']){throw new Error(_0x11b2('0x10'));}if(_0x2153c8[_0x11b2('0x14')]>0x0){if(_0x183e9b[_0x11b2('0x19')]){if(moment(_0x183e9b['blockedAt'])[_0x11b2('0x1d')](_0x2153c8['blockDuration'],'minutes')>moment()){throw new Error(_0x11b2('0x10'));}return utils[_0x11b2('0x1e')](_0x183e9b,0x0,![],null)[_0x11b2('0x15')](function(){return utils[_0x11b2('0x1f')](_0x183e9b);})[_0x11b2('0x15')](function(){return _0x571927(null,_0x183e9b);});}else{return utils['getLicense'](_0x183e9b)[_0x11b2('0x15')](function(){return _0x571927(null,_0x183e9b);});}}else{return utils[_0x11b2('0x1f')](_0x183e9b)[_0x11b2('0x15')](function(){return _0x571927(null,_0x183e9b);});}})['catch'](function(_0x460703){return _0x571927(null,![],_0x460703);});}function handleError(_0x2458ee,_0x29d015,_0x40b55e){return _0x2458ee['status'](_0x29d015||0x1f4)['send']({'message':_0x40b55e?_0x40b55e['message']||_0x40b55e:''});}exports[_0x11b2('0x20')]=function(_0x2feb6c,_0x48136d,_0x4700aa){passport[_0x11b2('0xc')](_0x11b2('0x21'),function(_0xab7a0a,_0x544022,_0x2eea65){var _0x22e0e8=_0xab7a0a||_0x2eea65;if(_0x22e0e8){return handleError(_0x48136d,0x191,_0x22e0e8);}if(!_0x544022){return handleError(_0x48136d,0x194,{'message':_0x11b2('0x22')});}else{var _0x2f645e={'payload':{'id':_0x544022['id'],'role':_0x544022[_0x11b2('0x23')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2f645e)[_0x11b2('0x15')](function(_0x38b922){_0x48136d[_0x11b2('0x24')]({'id':_0x544022['id'],'token':_0x38b922,'statusCall':'','isAlreadyLogged':_0x544022['online']});});}})(_0x2feb6c,_0x48136d,_0x4700aa);};passport[_0x11b2('0x25')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x11b2('0x26')},function(_0x2d566a,_0x242996,_0x3994ef){return ActiveDirectoryAuthenticate(db[_0x11b2('0x27')],_0x2d566a,_0x242996,_0x3994ef);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index ceec8eb..802fd26 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 _0xde16=['post','exports','express','./authActiveDirectory.controller'];(function(_0x165eb7,_0x39ec5c){var _0x3a5082=function(_0x4b1223){while(--_0x4b1223){_0x165eb7['push'](_0x165eb7['shift']());}};_0x3a5082(++_0x39ec5c);}(_0xde16,0x18e));var _0x6de1=function(_0x41195b,_0x5087e1){_0x41195b=_0x41195b-0x0;var _0x53360c=_0xde16[_0x41195b];return _0x53360c;};'use strict';var express=require(_0x6de1('0x0'));var router=express['Router']();var controller=require(_0x6de1('0x1'));router[_0x6de1('0x2')]('/',controller['login']);module[_0x6de1('0x3')]=router;
\ No newline at end of file
+var _0xd7ad=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0xd1213b,_0x2a06e5){var _0x55bc1e=function(_0x12f618){while(--_0x12f618){_0xd1213b['push'](_0xd1213b['shift']());}};_0x55bc1e(++_0x2a06e5);}(_0xd7ad,0x90));var _0xdd7a=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xd7ad[_0x125ff8];return _0x2d9ef;};'use strict';var express=require('express');var router=express[_0xdd7a('0x0')]();var controller=require(_0xdd7a('0x1'));router[_0xdd7a('0x2')]('/',controller[_0xdd7a('0x3')]);module[_0xdd7a('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index d9f20b8..502a25d 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(_0x57ae10,_0x5e1089){var _0x5b58dd=function(_0x1c75bf){while(--_0x1c75bf){_0x57ae10['push'](_0x57ae10['shift']());}};_0x5b58dd(++_0x5e1089);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x94b021,_0x3e419c){var _0xfde528=function(_0x21be48){while(--_0x21be48){_0x94b021['push'](_0x94b021['shift']());}};_0xfde528(++_0x3e419c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 687c25f..33da97c 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 _0x64c4=['./authGoogle.controller','../user/user.controller.js','get','login','callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x17b693,_0x137279){var _0x354af3=function(_0x3cc527){while(--_0x3cc527){_0x17b693['push'](_0x17b693['shift']());}};_0x354af3(++_0x137279);}(_0x64c4,0x13a));var _0x464c=function(_0x449c41,_0x30c2bd){_0x449c41=_0x449c41-0x0;var _0x4a8a78=_0x64c4[_0x449c41];return _0x4a8a78;};'use strict';var express=require('express');var passport=require(_0x464c('0x0'));var router=express['Router']();var controller=require(_0x464c('0x1'));var userController=require(_0x464c('0x2'));var authService=require('../../components/auth/service');router[_0x464c('0x3')]('/',controller[_0x464c('0x4')]);router[_0x464c('0x3')]('/callback',controller[_0x464c('0x5')],authService[_0x464c('0x6')],userController[_0x464c('0x4')],authService[_0x464c('0x7')]);module[_0x464c('0x8')]=router;
\ No newline at end of file
+var _0xc94a=['express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','setTokenCookie'];(function(_0x4e8875,_0x1e44f2){var _0x257b43=function(_0x978de){while(--_0x978de){_0x4e8875['push'](_0x4e8875['shift']());}};_0x257b43(++_0x1e44f2);}(_0xc94a,0x14a));var _0xac94=function(_0x3cb539,_0x244bb7){_0x3cb539=_0x3cb539-0x0;var _0x2f748f=_0xc94a[_0x3cb539];return _0x2f748f;};'use strict';var express=require(_0xac94('0x0'));var passport=require(_0xac94('0x1'));var router=express['Router']();var controller=require(_0xac94('0x2'));var userController=require(_0xac94('0x3'));var authService=require(_0xac94('0x4'));router['get']('/',controller[_0xac94('0x5')]);router[_0xac94('0x6')](_0xac94('0x7'),controller[_0xac94('0x8')],authService['isMiddleware'],userController['login'],authService[_0xac94('0x9')]);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 db7f06a..d18eb80 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 _0x1600=['send','reset','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','email','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x33a7b9,_0x21efd5){var _0x177aea=function(_0x3c0c8f){while(--_0x3c0c8f){_0x33a7b9['push'](_0x33a7b9['shift']());}};_0x177aea(++_0x21efd5);}(_0x1600,0x1a8));var _0x0160=function(_0x1c8a26,_0x5562c8){_0x1c8a26=_0x1c8a26-0x0;var _0x59c1e5=_0x1600[_0x1c8a26];return _0x59c1e5;};'use strict';var util=require(_0x0160('0x0'));var passport=require(_0x0160('0x1'));var LocalStrategy=require(_0x0160('0x2'))[_0x0160('0x3')];var jayson=require(_0x0160('0x4'));var _=require('lodash');var rs=require(_0x0160('0x5'));var moment=require('moment');var db=require(_0x0160('0x6'))['db'];var authService=require(_0x0160('0x7'));var utils=require(_0x0160('0x8'));var client=jayson['client'][_0x0160('0x9')]({'port':0x232b});function localAuthenticate(_0x1431b2,_0x5e56ba,_0x4e1dd2,_0x10377d){var _0x2d7f2f,_0x108100;return db['Setting'][_0x0160('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0160('0xb')],'raw':!![]})[_0x0160('0xc')](function(_0x546f52){_0x2d7f2f=_0x546f52;return _0x1431b2[_0x0160('0xa')]({'attributes':['id',_0x0160('0xd'),_0x0160('0xe'),_0x0160('0xf'),_0x0160('0x10'),'disabled',_0x0160('0x11'),_0x0160('0x12'),_0x0160('0x13')],'where':{'name':_0x5e56ba,'role':{'$or':[_0x0160('0x14'),_0x0160('0x15'),_0x0160('0x16')]}}});})[_0x0160('0xc')](function(_0x5c0162){if(!_0x5c0162||_0x5c0162&&_0x5c0162[_0x0160('0xd')]!==_0x5e56ba){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x108100=_0x5c0162;return _0x108100;}})['then'](function(){_0x108100[_0x0160('0x17')](_0x4e1dd2,function(_0x1b7550,_0x24e7e8){var _0x4f2b22=_0x108100['loginAttempts']+0x1;if(_0x1b7550){return _0x10377d(_0x1b7550);}else if(!_0x24e7e8){if(_0x108100[_0x0160('0x18')]){return _0x10377d(null,![],{'message':_0x0160('0x19')});}else if(_0x2d7f2f[_0x0160('0x1a')]>0x0){if(_0x108100['blocked']){if(_0x2d7f2f[_0x0160('0xb')]>0x0){if(moment(_0x108100[_0x0160('0x12')])['add'](_0x2d7f2f[_0x0160('0xb')],_0x0160('0x1b'))>moment()){return _0x10377d(null,![],{'message':_0x0160('0x19')});}else{return utils['clearBlockUser'](_0x108100,_0x4f2b22,![],null)[_0x0160('0xc')](function(){return _0x10377d(null,![],{'message':_0x0160('0x19')});});}}else{return _0x10377d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4f2b22>=_0x2d7f2f[_0x0160('0x1a')]){return utils['clearBlockUser'](_0x108100,0x0,!![],moment())[_0x0160('0xc')](function(){return _0x10377d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0160('0x1c')](_0x108100,_0x4f2b22,![],null)[_0x0160('0xc')](function(){return _0x10377d(null,![],{'message':_0x0160('0x19')});});}}}else{return _0x10377d(null,![],{'message':_0x0160('0x19')});}}else{if(_0x108100[_0x0160('0x18')]){return _0x10377d(null,![],{'message':_0x0160('0x19')});}else if(_0x2d7f2f[_0x0160('0x1a')]>0x0){if(_0x108100['blocked']){if(_0x2d7f2f['blockDuration']>0x0){if(moment(_0x108100[_0x0160('0x12')])[_0x0160('0x1d')](_0x2d7f2f[_0x0160('0xb')],_0x0160('0x1b'))>moment()){return _0x10377d(null,![],{'message':_0x0160('0x19')});}else{return utils['clearBlockUser'](_0x108100,0x0,![],null)[_0x0160('0xc')](function(){return utils[_0x0160('0x1e')](_0x108100);})[_0x0160('0xc')](function(){return _0x10377d(null,_0x108100);});}}else{return _0x10377d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x108100,0x0,![],null)[_0x0160('0xc')](function(){return utils[_0x0160('0x1e')](_0x108100);})[_0x0160('0xc')](function(){return _0x10377d(null,_0x108100);})[_0x0160('0x1f')](function(_0x590dab){return _0x10377d(null,![],_0x590dab);});}}else{if(_0x108100['blocked']){return _0x10377d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0160('0x1e')](_0x108100)[_0x0160('0xc')](function(){return _0x10377d(null,_0x108100);});}}}});})['catch'](function(_0x2e1ff4){return _0x10377d(null,![],_0x2e1ff4);});}function sendServiceMail(_0x325957){return db[_0x0160('0x20')][_0x0160('0x21')]({'where':{'service':!![]},'attributes':['id',_0x0160('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x0160('0x22'),'include':[{'model':db[_0x0160('0x23')],'as':_0x0160('0x23')}]}]})[_0x0160('0xc')](function(_0x41bd35){if(!_0x41bd35){throw new Error(_0x0160('0x24'));}var _0x3fa10b=_0x41bd35['getSmtpOptions']();var _0x38419e={'account':_0x3fa10b,'message':_[_0x0160('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x41bd35['name'],_0x41bd35['email']||_0x41bd35[_0x0160('0x22')]['user'])},_0x325957)};return client['request'](_0x0160('0x26'),_0x38419e);})[_0x0160('0xc')](function(_0x583579){if(_0x583579['error']){throw new Error(util[_0x0160('0x27')](_0x0160('0x28'),_0x583579[_0x0160('0x29')][_0x0160('0x2a')]||JSON['stringify'](_0x583579[_0x0160('0x29')])));}return!![];});}function handleError(_0xbf5959,_0xc53323,_0x14851c){return _0xbf5959[_0x0160('0x2b')](_0xc53323||0x1f4)['send']({'message':_0x14851c?_0x14851c['message']||_0x14851c:''});}exports[_0x0160('0x2c')]=function(_0x299958,_0x7d7da4,_0xc09e3e){passport[_0x0160('0x17')](_0x0160('0x2d'),function(_0x57d0fb,_0x5d17ce,_0x4b57f8){var _0x21ba9d=_0x57d0fb||_0x4b57f8;if(_0x21ba9d){return handleError(_0x7d7da4,0x191,_0x21ba9d);}if(!_0x5d17ce){return handleError(_0x7d7da4,0x194,{'message':_0x0160('0x2e')});}else{var _0x16672f={'payload':{'id':_0x5d17ce['id'],'role':_0x5d17ce[_0x0160('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x0160('0x2f')](_0x16672f)[_0x0160('0xc')](function(_0x275162){_0x7d7da4[_0x0160('0x30')]({'id':_0x5d17ce['id'],'token':_0x275162,'statusCall':'','isAlreadyLogged':_0x5d17ce['online']});});}})(_0x299958,_0x7d7da4,_0xc09e3e);};exports[_0x0160('0x31')]=function(_0x5ef1da,_0x3243e1){if(!_0x5ef1da[_0x0160('0x32')][_0x0160('0x33')]){return handleError(_0x3243e1,0x1f4,{'message':_0x0160('0x34')});}var _0x2cea11=rs[_0x0160('0x35')]();_0x5ef1da[_0x0160('0x32')]['email']=_0x5ef1da[_0x0160('0x32')][_0x0160('0x33')][_0x0160('0x36')]()[_0x0160('0x37')]();var _0x30cc45;return db[_0x0160('0x38')][_0x0160('0xa')]({'where':{'id':0x1},'attributes':[_0x0160('0x1a'),'blockDuration'],'raw':!![]})[_0x0160('0xc')](function(_0x14b314){_0x30cc45=_0x14b314;return db[_0x0160('0x39')][_0x0160('0x21')]({'where':{'email':_0x5ef1da[_0x0160('0x32')][_0x0160('0x33')]}});})[_0x0160('0xc')](function(_0x511bae){if(!_0x511bae){throw new Error(_0x0160('0x3a'));}if(_0x511bae[_0x0160('0x18')]){throw new Error(_0x0160('0x3b'));}if(_0x511bae['blocked']){if(moment(_0x511bae['blockedAt'])[_0x0160('0x1d')](_0x30cc45[_0x0160('0xb')],_0x0160('0x1b'))>moment()){throw new Error(_0x0160('0x3c'));}else{_0x511bae[_0x0160('0x11')]=![];_0x511bae['blockedAt']=null;}}_0x511bae['resetPasswordToken']=_0x2cea11;_0x511bae[_0x0160('0x3d')]=Date['now']()+0x36ee80;return _0x511bae['save']();})[_0x0160('0xc')](function(){return sendServiceMail({'to':_0x5ef1da[_0x0160('0x32')][_0x0160('0x33')],'subject':_0x0160('0x3e'),'text':_0x0160('0x3f')+_0x0160('0x40')+'https://'+_0x5ef1da[_0x0160('0x41')][_0x0160('0x42')]+'/reset/'+_0x2cea11+'\x0a\x0a'+_0x0160('0x43')});})[_0x0160('0xc')](function(){_0x3243e1[_0x0160('0x2b')](0xc8)[_0x0160('0x44')]({'message':'Reset\x20Email\x20sent!'});})[_0x0160('0x1f')](function(_0x2b0b2a){return handleError(_0x3243e1,0x1f4,_0x2b0b2a);});};exports[_0x0160('0x45')]=function(_0x49ec85,_0x31220d){return db[_0x0160('0x39')][_0x0160('0x21')]({'where':{'resetPasswordToken':_0x49ec85['params'][_0x0160('0x46')],'resetPasswordExpires':{'$gt':Date[_0x0160('0x47')]()}}})[_0x0160('0xc')](function(_0x15cde7){if(!_0x15cde7){throw new Error(_0x0160('0x48'));}return db[_0x0160('0x38')]['findOne']({'attributes':['id',_0x0160('0x49'),'enforcePasswordHistory',_0x0160('0x4a')]})[_0x0160('0xc')](function(_0x20a7fa){if(_0x20a7fa['securePassword'])authService[_0x0160('0x4b')](_0x49ec85[_0x0160('0x32')]['password']);if(!_0x20a7fa[_0x0160('0x4c')]||!_0x15cde7[_0x0160('0x4d')])return _0x15cde7;authService[_0x0160('0x4e')](_0x49ec85[_0x0160('0x32')][_0x0160('0xe')],_0x15cde7[_0x0160('0x4d')],_0x20a7fa[_0x0160('0x4a')]);return _0x15cde7;})[_0x0160('0xc')](function(){_0x15cde7['password']=_0x49ec85[_0x0160('0x32')]['password'];_0x15cde7['resetPasswordToken']=null;_0x15cde7[_0x0160('0x3d')]=null;return _0x15cde7[_0x0160('0x4f')]();});})[_0x0160('0xc')](function(){_0x31220d[_0x0160('0x2b')](0xc8)[_0x0160('0x44')]({'message':_0x0160('0x50')});})[_0x0160('0x1f')](function(_0x4ef17a){return handleError(_0x31220d,0x1f4,_0x4ef17a);});};passport[_0x0160('0x51')](_0x0160('0x2d'),new LocalStrategy({'usernameField':_0x0160('0xd'),'passwordField':_0x0160('0xe')},function(_0x162d74,_0x595a12,_0x5a8f06){return localAuthenticate(db[_0x0160('0x39')],_0x162d74,_0x595a12,_0x5a8f06);}));
\ No newline at end of file
+var _0x1c03=['loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','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','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt'];(function(_0x4060bb,_0x2e0569){var _0x1c7d5e=function(_0x523d38){while(--_0x523d38){_0x4060bb['push'](_0x4060bb['shift']());}};_0x1c7d5e(++_0x2e0569);}(_0x1c03,0x13e));var _0x31c0=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x1c03[_0x4314d7];return _0x5c599b;};'use strict';var util=require(_0x31c0('0x0'));var passport=require(_0x31c0('0x1'));var LocalStrategy=require(_0x31c0('0x2'))[_0x31c0('0x3')];var jayson=require('jayson/promise');var _=require(_0x31c0('0x4'));var rs=require(_0x31c0('0x5'));var moment=require(_0x31c0('0x6'));var db=require(_0x31c0('0x7'))['db'];var authService=require(_0x31c0('0x8'));var utils=require(_0x31c0('0x9'));var client=jayson['client'][_0x31c0('0xa')]({'port':0x232b});function localAuthenticate(_0x52061d,_0xe7223c,_0x27abed,_0x5a93fb){var _0x5e9dd4,_0x502218;return db[_0x31c0('0xb')][_0x31c0('0xc')]({'where':{'id':0x1},'attributes':[_0x31c0('0xd'),'blockDuration'],'raw':!![]})[_0x31c0('0xe')](function(_0x43a273){_0x5e9dd4=_0x43a273;return _0x52061d['findOne']({'attributes':['id',_0x31c0('0xf'),_0x31c0('0x10'),_0x31c0('0x11'),_0x31c0('0x12'),_0x31c0('0x13'),_0x31c0('0x14'),_0x31c0('0x15'),_0x31c0('0x16')],'where':{'name':_0xe7223c,'role':{'$or':[_0x31c0('0x17'),_0x31c0('0x18'),'agent']}}});})[_0x31c0('0xe')](function(_0x471c0c){if(!_0x471c0c||_0x471c0c&&_0x471c0c[_0x31c0('0xf')]!==_0xe7223c){throw new Error(_0x31c0('0x19'));}else{_0x502218=_0x471c0c;return _0x502218;}})[_0x31c0('0xe')](function(){_0x502218[_0x31c0('0x1a')](_0x27abed,function(_0x5693d6,_0xe60635){var _0x57ea30=_0x502218[_0x31c0('0x16')]+0x1;if(_0x5693d6){return _0x5a93fb(_0x5693d6);}else if(!_0xe60635){if(_0x502218['disabled']){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}else if(_0x5e9dd4['allowedLoginAttempts']>0x0){if(_0x502218['blocked']){if(_0x5e9dd4[_0x31c0('0x1b')]>0x0){if(moment(_0x502218[_0x31c0('0x15')])[_0x31c0('0x1c')](_0x5e9dd4[_0x31c0('0x1b')],_0x31c0('0x1d'))>moment()){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}else{return utils['clearBlockUser'](_0x502218,_0x57ea30,![],null)[_0x31c0('0xe')](function(){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});});}}else{return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}}else{if(_0x57ea30>=_0x5e9dd4[_0x31c0('0xd')]){return utils[_0x31c0('0x1e')](_0x502218,0x0,!![],moment())['then'](function(){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});});}else{return utils[_0x31c0('0x1e')](_0x502218,_0x57ea30,![],null)[_0x31c0('0xe')](function(){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});});}}}else{return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}}else{if(_0x502218['disabled']){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}else if(_0x5e9dd4[_0x31c0('0xd')]>0x0){if(_0x502218[_0x31c0('0x14')]){if(_0x5e9dd4[_0x31c0('0x1b')]>0x0){if(moment(_0x502218[_0x31c0('0x15')])['add'](_0x5e9dd4[_0x31c0('0x1b')],_0x31c0('0x1d'))>moment()){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}else{return utils[_0x31c0('0x1e')](_0x502218,0x0,![],null)['then'](function(){return utils['getLicense'](_0x502218);})['then'](function(){return _0x5a93fb(null,_0x502218);});}}else{return _0x5a93fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x31c0('0x1e')](_0x502218,0x0,![],null)[_0x31c0('0xe')](function(){return utils[_0x31c0('0x1f')](_0x502218);})[_0x31c0('0xe')](function(){return _0x5a93fb(null,_0x502218);})[_0x31c0('0x20')](function(_0x432361){return _0x5a93fb(null,![],_0x432361);});}}else{if(_0x502218[_0x31c0('0x14')]){return _0x5a93fb(null,![],{'message':_0x31c0('0x19')});}else{return utils[_0x31c0('0x1f')](_0x502218)[_0x31c0('0xe')](function(){return _0x5a93fb(null,_0x502218);});}}}});})['catch'](function(_0x5e50cd){return _0x5a93fb(null,![],_0x5e50cd);});}function sendServiceMail(_0x659378){return db[_0x31c0('0x21')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x31c0('0x22')],'include':[{'model':db[_0x31c0('0x23')],'as':'Smtp','include':[{'model':db[_0x31c0('0x24')],'as':_0x31c0('0x24')}]}]})[_0x31c0('0xe')](function(_0x3363f8){if(!_0x3363f8){throw new Error(_0x31c0('0x25'));}var _0x3bafe7=_0x3363f8['getSmtpOptions']();var _0x2684e1={'account':_0x3bafe7,'message':_[_0x31c0('0x26')]({'from':util[_0x31c0('0x27')](_0x31c0('0x28'),_0x3363f8[_0x31c0('0xf')],_0x3363f8['email']||_0x3363f8[_0x31c0('0x29')][_0x31c0('0x18')])},_0x659378)};return client[_0x31c0('0x2a')](_0x31c0('0x2b'),_0x2684e1);})[_0x31c0('0xe')](function(_0xb3d7e9){if(_0xb3d7e9[_0x31c0('0x2c')]){throw new Error(util[_0x31c0('0x27')](_0x31c0('0x2d'),_0xb3d7e9['error'][_0x31c0('0x2e')]||JSON[_0x31c0('0x2f')](_0xb3d7e9[_0x31c0('0x2c')])));}return!![];});}function handleError(_0x4581b7,_0xabb9b3,_0x58db4b){return _0x4581b7[_0x31c0('0x30')](_0xabb9b3||0x1f4)[_0x31c0('0x31')]({'message':_0x58db4b?_0x58db4b[_0x31c0('0x2e')]||_0x58db4b:''});}exports[_0x31c0('0x32')]=function(_0x505a12,_0x20e4cc,_0x59513e){passport[_0x31c0('0x1a')](_0x31c0('0x33'),function(_0x49ec60,_0x45e981,_0x17df1d){var _0x396418=_0x49ec60||_0x17df1d;if(_0x396418){return handleError(_0x20e4cc,0x191,_0x396418);}if(!_0x45e981){return handleError(_0x20e4cc,0x194,{'message':_0x31c0('0x34')});}else{var _0x1199f8={'payload':{'id':_0x45e981['id'],'role':_0x45e981[_0x31c0('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x31c0('0x35')](_0x1199f8)[_0x31c0('0xe')](function(_0x5b9eaa){_0x20e4cc[_0x31c0('0x36')]({'id':_0x45e981['id'],'token':_0x5b9eaa,'statusCall':'','isAlreadyLogged':_0x45e981[_0x31c0('0x37')]});});}})(_0x505a12,_0x20e4cc,_0x59513e);};exports[_0x31c0('0x38')]=function(_0x4a7317,_0x336b42){if(!_0x4a7317['body']['email']){return handleError(_0x336b42,0x1f4,{'message':_0x31c0('0x39')});}var _0x57a41b=rs[_0x31c0('0x3a')]();_0x4a7317[_0x31c0('0x3b')][_0x31c0('0x22')]=_0x4a7317['body'][_0x31c0('0x22')][_0x31c0('0x3c')]()[_0x31c0('0x3d')]();var _0xcedd85;return db[_0x31c0('0xb')][_0x31c0('0xc')]({'where':{'id':0x1},'attributes':[_0x31c0('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x1a2cb4){_0xcedd85=_0x1a2cb4;return db[_0x31c0('0x3e')][_0x31c0('0x3f')]({'where':{'email':_0x4a7317[_0x31c0('0x3b')][_0x31c0('0x22')]}});})['then'](function(_0xd39f1a){if(!_0xd39f1a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xd39f1a[_0x31c0('0x13')]){throw new Error(_0x31c0('0x40'));}if(_0xd39f1a[_0x31c0('0x14')]){if(moment(_0xd39f1a[_0x31c0('0x15')])['add'](_0xcedd85['blockDuration'],_0x31c0('0x1d'))>moment()){throw new Error(_0x31c0('0x41'));}else{_0xd39f1a[_0x31c0('0x14')]=![];_0xd39f1a[_0x31c0('0x15')]=null;}}_0xd39f1a[_0x31c0('0x42')]=_0x57a41b;_0xd39f1a['resetPasswordExpires']=Date[_0x31c0('0x43')]()+0x36ee80;return _0xd39f1a[_0x31c0('0x44')]();})[_0x31c0('0xe')](function(){return sendServiceMail({'to':_0x4a7317[_0x31c0('0x3b')][_0x31c0('0x22')],'subject':_0x31c0('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x31c0('0x46')+_0x31c0('0x47')+_0x4a7317[_0x31c0('0x48')][_0x31c0('0x49')]+_0x31c0('0x4a')+_0x57a41b+'\x0a\x0a'+_0x31c0('0x4b')});})['then'](function(){_0x336b42[_0x31c0('0x30')](0xc8)[_0x31c0('0x31')]({'message':_0x31c0('0x4c')});})[_0x31c0('0x20')](function(_0x4251b0){return handleError(_0x336b42,0x1f4,_0x4251b0);});};exports['reset']=function(_0x3491d8,_0x34c743){return db[_0x31c0('0x3e')][_0x31c0('0x3f')]({'where':{'resetPasswordToken':_0x3491d8['params'][_0x31c0('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x31c0('0x43')]()}}})[_0x31c0('0xe')](function(_0x252e4a){if(!_0x252e4a){throw new Error(_0x31c0('0x4e'));}return db[_0x31c0('0xb')][_0x31c0('0xc')]({'attributes':['id',_0x31c0('0x4f'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0xf863c9){if(_0xf863c9[_0x31c0('0x4f')])authService['validatePasswordPattern'](_0x3491d8[_0x31c0('0x3b')]['password']);if(!_0xf863c9['enforcePasswordHistory']||!_0x252e4a[_0x31c0('0x50')])return _0x252e4a;authService[_0x31c0('0x51')](_0x3491d8['body'][_0x31c0('0x10')],_0x252e4a[_0x31c0('0x50')],_0xf863c9[_0x31c0('0x52')]);return _0x252e4a;})[_0x31c0('0xe')](function(){_0x252e4a[_0x31c0('0x10')]=_0x3491d8[_0x31c0('0x3b')]['password'];_0x252e4a[_0x31c0('0x42')]=null;_0x252e4a['resetPasswordExpires']=null;return _0x252e4a['save']();});})[_0x31c0('0xe')](function(){_0x34c743[_0x31c0('0x30')](0xc8)[_0x31c0('0x31')]({'message':_0x31c0('0x53')});})[_0x31c0('0x20')](function(_0x1b2511){return handleError(_0x34c743,0x1f4,_0x1b2511);});};passport[_0x31c0('0x54')](_0x31c0('0x33'),new LocalStrategy({'usernameField':_0x31c0('0xf'),'passwordField':_0x31c0('0x10')},function(_0x50ed13,_0x420555,_0x42c7cd){return localAuthenticate(db[_0x31c0('0x3e')],_0x50ed13,_0x420555,_0x42c7cd);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index cd7522e..ba6c69f 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 _0xf2a2=['reset','exports','Router','./authLocal.controller','login','post','/forgot'];(function(_0x25eb1c,_0x479599){var _0x2a3b73=function(_0x3c61a6){while(--_0x3c61a6){_0x25eb1c['push'](_0x25eb1c['shift']());}};_0x2a3b73(++_0x479599);}(_0xf2a2,0x183));var _0x2f2a=function(_0x5e3415,_0x14a028){_0x5e3415=_0x5e3415-0x0;var _0x39a0b4=_0xf2a2[_0x5e3415];return _0x39a0b4;};'use strict';var express=require('express');var router=express[_0x2f2a('0x0')]();var controller=require(_0x2f2a('0x1'));router['post']('/',controller[_0x2f2a('0x2')]);router[_0x2f2a('0x3')](_0x2f2a('0x4'),controller['forgot']);router[_0x2f2a('0x3')]('/reset/:token',controller[_0x2f2a('0x5')]);module[_0x2f2a('0x6')]=router;
\ No newline at end of file
+var _0x8cc7=['/forgot','forgot','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8cc7,0x104));var _0x78cc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8cc7[_0xbca1b1];return _0x4e1686;};'use strict';var express=require('express');var router=express[_0x78cc('0x0')]();var controller=require(_0x78cc('0x1'));router[_0x78cc('0x2')]('/',controller[_0x78cc('0x3')]);router[_0x78cc('0x2')](_0x78cc('0x4'),controller[_0x78cc('0x5')]);router['post']('/reset/:token',controller[_0x78cc('0x6')]);module[_0x78cc('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9627ff4..50b6b2f 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 _0x94b3=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x572c32,_0x13ef5e){var _0x4ad5d9=function(_0xa4768a){while(--_0xa4768a){_0x572c32['push'](_0x572c32['shift']());}};_0x4ad5d9(++_0x13ef5e);}(_0x94b3,0x107));var _0x394b=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x94b3[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0x394b('0x0'));module['exports']={'name':{'type':Sequelize[_0x394b('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x394b('0x1')]},'status':{'type':Sequelize[_0x394b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x394b('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xc0a9=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3fe7ff,_0x3b3b48){var _0x12600d=function(_0x1e4485){while(--_0x1e4485){_0x3fe7ff['push'](_0x3fe7ff['shift']());}};_0x12600d(++_0x3b3b48);}(_0xc0a9,0x1c3));var _0x9c0a=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xc0a9[_0x1a7846];return _0x48049;};'use strict';var Sequelize=require(_0x9c0a('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c0a('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x9c0a('0x1')]},'description':{'type':Sequelize[_0x9c0a('0x1')]},'status':{'type':Sequelize[_0x9c0a('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9c0a('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 09963ec..23b4bf9 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 _0xc370=['findOne','Action','getActions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','send','index','map','Automation','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','addConditions','Condition','ids','omit','getConditions','pick','addActions'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0xc370,0x144));var _0x0c37=function(_0x37aa08,_0xb5e492){_0x37aa08=_0x37aa08-0x0;var _0x9f44dc=_0xc370[_0x37aa08];return _0x9f44dc;};'use strict';var emlformat=require(_0x0c37('0x0'));var rimraf=require(_0x0c37('0x1'));var zipdir=require(_0x0c37('0x2'));var jsonpatch=require(_0x0c37('0x3'));var rp=require('request-promise');var moment=require(_0x0c37('0x4'));var BPromise=require(_0x0c37('0x5'));var Mustache=require(_0x0c37('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0c37('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c37('0x8'));var squel=require(_0x0c37('0x9'));var crypto=require(_0x0c37('0xa'));var jsforce=require(_0x0c37('0xb'));var deskjs=require(_0x0c37('0xc'));var toCsv=require(_0x0c37('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c37('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0c37('0xf'));var hardwareService=require(_0x0c37('0x10'));var logger=require(_0x0c37('0x11'))(_0x0c37('0x12'));var utils=require(_0x0c37('0x13'));var config=require(_0x0c37('0x14'));var licenseUtil=require(_0x0c37('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18c00e,_0x4cc52a){_0x4cc52a=_0x4cc52a||0xcc;return function(_0x16d770){if(_0x16d770){return _0x18c00e[_0x0c37('0x16')](_0x4cc52a);}return _0x18c00e[_0x0c37('0x17')](_0x4cc52a)[_0x0c37('0x18')]();};}function respondWithResult(_0x490199,_0x75e9a3){_0x75e9a3=_0x75e9a3||0xc8;return function(_0xb18414){if(_0xb18414){return _0x490199[_0x0c37('0x17')](_0x75e9a3)['json'](_0xb18414);}};}function respondWithFilteredResult(_0x397937,_0x48625d){return function(_0x701da8){if(_0x701da8){var _0x3c8ff4=typeof _0x48625d['offset']===_0x0c37('0x19')&&typeof _0x48625d[_0x0c37('0x1a')]===_0x0c37('0x19');var _0x14b395=_0x701da8[_0x0c37('0x1b')];var _0x2f9153=_0x3c8ff4?0x0:_0x48625d[_0x0c37('0x1c')];var _0x54df83=_0x3c8ff4?_0x701da8[_0x0c37('0x1b')]:_0x48625d[_0x0c37('0x1c')]+_0x48625d[_0x0c37('0x1a')];var _0x53216d;if(_0x54df83>=_0x14b395){_0x54df83=_0x14b395;_0x53216d=0xc8;}else{_0x53216d=0xce;}_0x397937[_0x0c37('0x17')](_0x53216d);return _0x397937[_0x0c37('0x1d')](_0x0c37('0x1e'),_0x2f9153+'-'+_0x54df83+'/'+_0x14b395)['json'](_0x701da8);}return null;};}function patchUpdates(_0x414bff){return function(_0x67b2b1){try{jsonpatch['apply'](_0x67b2b1,_0x414bff,!![]);}catch(_0x28cc89){return BPromise[_0x0c37('0x1f')](_0x28cc89);}return _0x67b2b1[_0x0c37('0x20')]();};}function saveUpdates(_0x331465,_0x2c634c){return function(_0x59005b){if(_0x59005b){return _0x59005b[_0x0c37('0x21')](_0x331465)[_0x0c37('0x22')](function(_0x32f610){return _0x32f610;});}return null;};}function removeEntity(_0x2f1703,_0x3be96d){return function(_0x21b143){if(_0x21b143){return _0x21b143[_0x0c37('0x23')]()[_0x0c37('0x22')](function(){_0x2f1703[_0x0c37('0x17')](0xcc)[_0x0c37('0x18')]();});}};}function handleEntityNotFound(_0x43ad23,_0x2f1e32){return function(_0x5e4012){if(!_0x5e4012){_0x43ad23[_0x0c37('0x16')](0x194);}return _0x5e4012;};}function handleError(_0x17fffe,_0x4b497d){_0x4b497d=_0x4b497d||0x1f4;return function(_0x385607){logger['error'](_0x385607[_0x0c37('0x24')]);if(_0x385607['name']){delete _0x385607['name'];}_0x17fffe[_0x0c37('0x17')](_0x4b497d)[_0x0c37('0x25')](_0x385607);};}exports[_0x0c37('0x26')]=function(_0x459c1e,_0x45be12){var _0x14c9e2={},_0x18af06={},_0x2ad0c3={'count':0x0,'rows':[]};var _0x25fa3a=_[_0x0c37('0x27')](db[_0x0c37('0x28')]['rawAttributes'],function(_0x5c4c63){return{'name':_0x5c4c63['fieldName'],'type':_0x5c4c63['type']['key']};});_0x18af06[_0x0c37('0x29')]=_['map'](_0x25fa3a,_0x0c37('0x2a'));_0x18af06[_0x0c37('0x2b')]=_[_0x0c37('0x2c')](_0x459c1e['query']);_0x18af06[_0x0c37('0x2d')]=_[_0x0c37('0x2e')](_0x18af06['model'],_0x18af06[_0x0c37('0x2b')]);_0x14c9e2[_0x0c37('0x2f')]=_['intersection'](_0x18af06[_0x0c37('0x29')],qs[_0x0c37('0x30')](_0x459c1e[_0x0c37('0x2b')][_0x0c37('0x30')]));_0x14c9e2['attributes']=_0x14c9e2[_0x0c37('0x2f')][_0x0c37('0x31')]?_0x14c9e2[_0x0c37('0x2f')]:_0x18af06[_0x0c37('0x29')];if(!_0x459c1e[_0x0c37('0x2b')][_0x0c37('0x32')]('nolimit')){_0x14c9e2[_0x0c37('0x1a')]=qs[_0x0c37('0x1a')](_0x459c1e[_0x0c37('0x2b')][_0x0c37('0x1a')]);_0x14c9e2['offset']=qs[_0x0c37('0x1c')](_0x459c1e['query'][_0x0c37('0x1c')]);}_0x14c9e2['order']=qs[_0x0c37('0x33')](_0x459c1e[_0x0c37('0x2b')]['sort']);_0x14c9e2[_0x0c37('0x34')]=qs[_0x0c37('0x2d')](_['pick'](_0x459c1e[_0x0c37('0x2b')],_0x18af06[_0x0c37('0x2d')]),_0x25fa3a);if(_0x459c1e['query'][_0x0c37('0x35')]){_0x14c9e2[_0x0c37('0x34')]=_[_0x0c37('0x36')](_0x14c9e2[_0x0c37('0x34')],{'$or':_['map'](_0x25fa3a,function(_0x30f520){if(_0x30f520[_0x0c37('0x37')]!==_0x0c37('0x38')){var _0x324db9={};_0x324db9[_0x30f520['name']]={'$like':'%'+_0x459c1e[_0x0c37('0x2b')][_0x0c37('0x35')]+'%'};return _0x324db9;}})});}_0x14c9e2=_[_0x0c37('0x36')]({},_0x14c9e2,_0x459c1e[_0x0c37('0x39')]);var _0x9d941d={'where':_0x14c9e2[_0x0c37('0x34')]};return db['Automation'][_0x0c37('0x1b')](_0x9d941d)[_0x0c37('0x22')](function(_0x2a96d6){_0x2ad0c3[_0x0c37('0x1b')]=_0x2a96d6;if(_0x459c1e[_0x0c37('0x2b')][_0x0c37('0x3a')]){_0x14c9e2[_0x0c37('0x3b')]=[{'all':!![]}];}return db['Automation'][_0x0c37('0x3c')](_0x14c9e2);})[_0x0c37('0x22')](function(_0x47658d){_0x2ad0c3[_0x0c37('0x3d')]=_0x47658d;return _0x2ad0c3;})[_0x0c37('0x22')](respondWithFilteredResult(_0x45be12,_0x14c9e2))[_0x0c37('0x3e')](handleError(_0x45be12,null));};exports[_0x0c37('0x3f')]=function(_0x2803ab,_0x36e390){var _0x380324={'raw':![],'where':{'id':_0x2803ab[_0x0c37('0x40')]['id']}},_0x150f45={};_0x150f45[_0x0c37('0x29')]=_[_0x0c37('0x2c')](db[_0x0c37('0x28')][_0x0c37('0x41')]);_0x150f45[_0x0c37('0x2b')]=_[_0x0c37('0x2c')](_0x2803ab[_0x0c37('0x2b')]);_0x150f45[_0x0c37('0x2d')]=_[_0x0c37('0x2e')](_0x150f45[_0x0c37('0x29')],_0x150f45[_0x0c37('0x2b')]);_0x380324[_0x0c37('0x2f')]=_['intersection'](_0x150f45[_0x0c37('0x29')],qs[_0x0c37('0x30')](_0x2803ab[_0x0c37('0x2b')][_0x0c37('0x30')]));_0x380324['attributes']=_0x380324[_0x0c37('0x2f')]['length']?_0x380324[_0x0c37('0x2f')]:_0x150f45[_0x0c37('0x29')];if(_0x2803ab[_0x0c37('0x2b')][_0x0c37('0x3a')]){_0x380324[_0x0c37('0x3b')]=[{'all':!![]}];}_0x380324=_['merge']({},_0x380324,_0x2803ab['options']);return db[_0x0c37('0x28')][_0x0c37('0x42')](_0x380324)[_0x0c37('0x22')](handleEntityNotFound(_0x36e390,null))[_0x0c37('0x22')](respondWithResult(_0x36e390,null))[_0x0c37('0x3e')](handleError(_0x36e390,null));};exports[_0x0c37('0x43')]=function(_0x1a6d9f,_0x2cd361){return db[_0x0c37('0x28')][_0x0c37('0x43')](_0x1a6d9f['body'],{})['then'](respondWithResult(_0x2cd361,0xc9))[_0x0c37('0x3e')](handleError(_0x2cd361,null));};exports[_0x0c37('0x21')]=function(_0x1f07d4,_0x46bbcd){if(_0x1f07d4[_0x0c37('0x44')]['id']){delete _0x1f07d4[_0x0c37('0x44')]['id'];}return db['Automation'][_0x0c37('0x42')]({'where':{'id':_0x1f07d4[_0x0c37('0x40')]['id']}})['then'](handleEntityNotFound(_0x46bbcd,null))[_0x0c37('0x22')](saveUpdates(_0x1f07d4[_0x0c37('0x44')],null))['then'](respondWithResult(_0x46bbcd,null))[_0x0c37('0x3e')](handleError(_0x46bbcd,null));};exports['destroy']=function(_0x2ae5c1,_0x5674d9){return db[_0x0c37('0x28')][_0x0c37('0x42')]({'where':{'id':_0x2ae5c1[_0x0c37('0x40')]['id']}})[_0x0c37('0x22')](handleEntityNotFound(_0x5674d9,null))[_0x0c37('0x22')](removeEntity(_0x5674d9,null))[_0x0c37('0x3e')](handleError(_0x5674d9,null));};exports[_0x0c37('0x45')]=function(_0x44a263,_0x94598b,_0xb37b2a){return db[_0x0c37('0x46')][_0x0c37('0x42')]({'where':{'id':_0x44a263[_0x0c37('0x40')]['id']}})[_0x0c37('0x22')](handleEntityNotFound(_0x94598b,null))['then'](function(_0x32d7f0){if(_0x32d7f0){return _0x32d7f0[_0x0c37('0x45')](_0x44a263[_0x0c37('0x44')][_0x0c37('0x47')],_[_0x0c37('0x48')](_0x44a263[_0x0c37('0x44')],[_0x0c37('0x47'),'id'])||{});}})[_0x0c37('0x22')](respondWithResult(_0x94598b,null))[_0x0c37('0x3e')](handleError(_0x94598b,null));};exports[_0x0c37('0x49')]=function(_0x5cdbf3,_0x2c8c86,_0x555b6e){var _0x41190c={};var _0x3e1ecb={};var _0x2eb984;var _0x3ca4b7;return db['Automation']['findOne']({'where':{'id':_0x5cdbf3[_0x0c37('0x40')]['id']}})['then'](handleEntityNotFound(_0x2c8c86,null))['then'](function(_0x586948){if(_0x586948){_0x2eb984=_0x586948;_0x3e1ecb[_0x0c37('0x29')]=_[_0x0c37('0x2c')](db['Condition']['rawAttributes']);_0x3e1ecb[_0x0c37('0x2b')]=_[_0x0c37('0x2c')](_0x5cdbf3[_0x0c37('0x2b')]);_0x3e1ecb[_0x0c37('0x2d')]=_[_0x0c37('0x2e')](_0x3e1ecb[_0x0c37('0x29')],_0x3e1ecb[_0x0c37('0x2b')]);_0x41190c['attributes']=_['intersection'](_0x3e1ecb['model'],qs[_0x0c37('0x30')](_0x5cdbf3['query'][_0x0c37('0x30')]));_0x41190c[_0x0c37('0x2f')]=_0x41190c[_0x0c37('0x2f')][_0x0c37('0x31')]?_0x41190c[_0x0c37('0x2f')]:_0x3e1ecb[_0x0c37('0x29')];_0x41190c['order']=qs[_0x0c37('0x33')](_0x5cdbf3[_0x0c37('0x2b')][_0x0c37('0x33')]);_0x41190c[_0x0c37('0x34')]=qs['filters'](_[_0x0c37('0x4a')](_0x5cdbf3[_0x0c37('0x2b')],_0x3e1ecb[_0x0c37('0x2d')]));if(_0x5cdbf3[_0x0c37('0x2b')][_0x0c37('0x35')]){_0x41190c[_0x0c37('0x34')]=_['merge'](_0x41190c['where'],{'$or':_['map'](_0x41190c['attributes'],function(_0x13dd92){var _0x4474f4={};_0x4474f4[_0x13dd92]={'$like':'%'+_0x5cdbf3[_0x0c37('0x2b')][_0x0c37('0x35')]+'%'};return _0x4474f4;})});}_0x41190c=_[_0x0c37('0x36')]({},_0x41190c,_0x5cdbf3['options']);return _0x2eb984[_0x0c37('0x49')](_0x41190c);}})[_0x0c37('0x22')](function(_0x492a19){if(_0x492a19){_0x3ca4b7=_0x492a19['length'];if(!_0x5cdbf3[_0x0c37('0x2b')][_0x0c37('0x32')]('nolimit')){_0x41190c[_0x0c37('0x1a')]=qs['limit'](_0x5cdbf3['query'][_0x0c37('0x1a')]);_0x41190c[_0x0c37('0x1c')]=qs['offset'](_0x5cdbf3[_0x0c37('0x2b')][_0x0c37('0x1c')]);}return _0x2eb984[_0x0c37('0x49')](_0x41190c);}})[_0x0c37('0x22')](function(_0x14c99e){if(_0x14c99e){return _0x14c99e?{'count':_0x3ca4b7,'rows':_0x14c99e}:null;}})[_0x0c37('0x22')](respondWithResult(_0x2c8c86,null))[_0x0c37('0x3e')](handleError(_0x2c8c86,null));};exports[_0x0c37('0x4b')]=function(_0x2c7cae,_0x14dab1,_0x51622d){return db['Action']['find']({'where':{'id':_0x2c7cae['params']['id']}})[_0x0c37('0x22')](handleEntityNotFound(_0x14dab1,null))[_0x0c37('0x22')](function(_0x59bd7e){if(_0x59bd7e){return _0x59bd7e[_0x0c37('0x4b')](_0x2c7cae[_0x0c37('0x44')]['ids'],_[_0x0c37('0x48')](_0x2c7cae[_0x0c37('0x44')],[_0x0c37('0x47'),'id'])||{});}})['then'](respondWithResult(_0x14dab1,null))[_0x0c37('0x3e')](handleError(_0x14dab1,null));};exports['getActions']=function(_0x53cf65,_0x40fb98,_0x5e8309){var _0x5b8ced={};var _0x47853b={};var _0x397f0a;var _0x28d34b;return db['Automation'][_0x0c37('0x4c')]({'where':{'id':_0x53cf65[_0x0c37('0x40')]['id']}})[_0x0c37('0x22')](handleEntityNotFound(_0x40fb98,null))['then'](function(_0x12e060){if(_0x12e060){_0x397f0a=_0x12e060;_0x47853b[_0x0c37('0x29')]=_['keys'](db[_0x0c37('0x4d')][_0x0c37('0x41')]);_0x47853b['query']=_[_0x0c37('0x2c')](_0x53cf65[_0x0c37('0x2b')]);_0x47853b[_0x0c37('0x2d')]=_[_0x0c37('0x2e')](_0x47853b[_0x0c37('0x29')],_0x47853b[_0x0c37('0x2b')]);_0x5b8ced[_0x0c37('0x2f')]=_[_0x0c37('0x2e')](_0x47853b[_0x0c37('0x29')],qs['fields'](_0x53cf65['query']['fields']));_0x5b8ced[_0x0c37('0x2f')]=_0x5b8ced[_0x0c37('0x2f')][_0x0c37('0x31')]?_0x5b8ced['attributes']:_0x47853b[_0x0c37('0x29')];_0x5b8ced['order']=qs[_0x0c37('0x33')](_0x53cf65[_0x0c37('0x2b')][_0x0c37('0x33')]);_0x5b8ced[_0x0c37('0x34')]=qs[_0x0c37('0x2d')](_[_0x0c37('0x4a')](_0x53cf65[_0x0c37('0x2b')],_0x47853b[_0x0c37('0x2d')]));if(_0x53cf65[_0x0c37('0x2b')][_0x0c37('0x35')]){_0x5b8ced[_0x0c37('0x34')]=_[_0x0c37('0x36')](_0x5b8ced[_0x0c37('0x34')],{'$or':_[_0x0c37('0x27')](_0x5b8ced[_0x0c37('0x2f')],function(_0x316a6d){var _0x24614a={};_0x24614a[_0x316a6d]={'$like':'%'+_0x53cf65[_0x0c37('0x2b')]['filter']+'%'};return _0x24614a;})});}_0x5b8ced=_[_0x0c37('0x36')]({},_0x5b8ced,_0x53cf65[_0x0c37('0x39')]);return _0x397f0a[_0x0c37('0x4e')](_0x5b8ced);}})['then'](function(_0x39bda8){if(_0x39bda8){_0x28d34b=_0x39bda8[_0x0c37('0x31')];if(!_0x53cf65[_0x0c37('0x2b')][_0x0c37('0x32')](_0x0c37('0x4f'))){_0x5b8ced[_0x0c37('0x1a')]=qs[_0x0c37('0x1a')](_0x53cf65['query'][_0x0c37('0x1a')]);_0x5b8ced[_0x0c37('0x1c')]=qs[_0x0c37('0x1c')](_0x53cf65['query'][_0x0c37('0x1c')]);}return _0x397f0a['getActions'](_0x5b8ced);}})[_0x0c37('0x22')](function(_0x41e1ea){if(_0x41e1ea){return _0x41e1ea?{'count':_0x28d34b,'rows':_0x41e1ea}:null;}})[_0x0c37('0x22')](respondWithResult(_0x40fb98,null))[_0x0c37('0x3e')](handleError(_0x40fb98,null));};
\ No newline at end of file
+var _0xe88a=['papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','stack','name','send','index','Automation','fieldName','type','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','map','VIRTUAL','filter','options','includeAll','include','rows','rawAttributes','find','catch','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv'];(function(_0x552c10,_0x5ce987){var _0x3242d2=function(_0x49b922){while(--_0x49b922){_0x552c10['push'](_0x552c10['shift']());}};_0x3242d2(++_0x5ce987);}(_0xe88a,0x128));var _0xae88=function(_0x4a01e9,_0x595c4d){_0x4a01e9=_0x4a01e9-0x0;var _0x362b9c=_0xe88a[_0x4a01e9];return _0x362b9c;};'use strict';var emlformat=require(_0xae88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae88('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae88('0x2'));var moment=require(_0xae88('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xae88('0x4'));var util=require('util');var path=require(_0xae88('0x5'));var sox=require(_0xae88('0x6'));var csv=require('to-csv');var ejs=require(_0xae88('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae88('0x8'));var squel=require(_0xae88('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xae88('0xa'));var toCsv=require(_0xae88('0xb'));var querystring=require('querystring');var Papa=require(_0xae88('0xc'));var Redis=require(_0xae88('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae88('0xe'));var logger=require('../../config/logger')(_0xae88('0xf'));var utils=require(_0xae88('0x10'));var config=require(_0xae88('0x11'));var licenseUtil=require(_0xae88('0x12'));var db=require(_0xae88('0x13'))['db'];function respondWithStatusCode(_0x388a58,_0x3cf8a3){_0x3cf8a3=_0x3cf8a3||0xcc;return function(_0xfdd6d3){if(_0xfdd6d3){return _0x388a58[_0xae88('0x14')](_0x3cf8a3);}return _0x388a58[_0xae88('0x15')](_0x3cf8a3)[_0xae88('0x16')]();};}function respondWithResult(_0x4220f8,_0x4cca50){_0x4cca50=_0x4cca50||0xc8;return function(_0x131140){if(_0x131140){return _0x4220f8[_0xae88('0x15')](_0x4cca50)[_0xae88('0x17')](_0x131140);}};}function respondWithFilteredResult(_0x57f7c4,_0x3a6165){return function(_0x438fd8){if(_0x438fd8){var _0x5f4054=typeof _0x3a6165[_0xae88('0x18')]==='undefined'&&typeof _0x3a6165[_0xae88('0x19')]===_0xae88('0x1a');var _0x40e154=_0x438fd8[_0xae88('0x1b')];var _0x94aae4=_0x5f4054?0x0:_0x3a6165[_0xae88('0x18')];var _0x59e535=_0x5f4054?_0x438fd8[_0xae88('0x1b')]:_0x3a6165[_0xae88('0x18')]+_0x3a6165[_0xae88('0x19')];var _0x10d149;if(_0x59e535>=_0x40e154){_0x59e535=_0x40e154;_0x10d149=0xc8;}else{_0x10d149=0xce;}_0x57f7c4[_0xae88('0x15')](_0x10d149);return _0x57f7c4[_0xae88('0x1c')](_0xae88('0x1d'),_0x94aae4+'-'+_0x59e535+'/'+_0x40e154)[_0xae88('0x17')](_0x438fd8);}return null;};}function patchUpdates(_0x2775f0){return function(_0x30b440){try{jsonpatch['apply'](_0x30b440,_0x2775f0,!![]);}catch(_0xc7f9c4){return BPromise['reject'](_0xc7f9c4);}return _0x30b440['save']();};}function saveUpdates(_0x13df66,_0xc9217f){return function(_0x5682b4){if(_0x5682b4){return _0x5682b4[_0xae88('0x1e')](_0x13df66)['then'](function(_0x22e6af){return _0x22e6af;});}return null;};}function removeEntity(_0x24f97f,_0x2d78ac){return function(_0x457f25){if(_0x457f25){return _0x457f25[_0xae88('0x1f')]()[_0xae88('0x20')](function(){_0x24f97f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3be1e8,_0x11aecb){return function(_0x539dd8){if(!_0x539dd8){_0x3be1e8[_0xae88('0x14')](0x194);}return _0x539dd8;};}function handleError(_0x10b5f4,_0x4e6cd0){_0x4e6cd0=_0x4e6cd0||0x1f4;return function(_0x3f82c){logger['error'](_0x3f82c[_0xae88('0x21')]);if(_0x3f82c[_0xae88('0x22')]){delete _0x3f82c[_0xae88('0x22')];}_0x10b5f4[_0xae88('0x15')](_0x4e6cd0)[_0xae88('0x23')](_0x3f82c);};}exports[_0xae88('0x24')]=function(_0x16636f,_0x9d0416){var _0x1aea5b={},_0x531644={},_0xc95593={'count':0x0,'rows':[]};var _0x4dadcb=_['map'](db[_0xae88('0x25')]['rawAttributes'],function(_0x4d21b9){return{'name':_0x4d21b9[_0xae88('0x26')],'type':_0x4d21b9[_0xae88('0x27')]['key']};});_0x531644['model']=_['map'](_0x4dadcb,'name');_0x531644[_0xae88('0x28')]=_[_0xae88('0x29')](_0x16636f[_0xae88('0x28')]);_0x531644['filters']=_['intersection'](_0x531644[_0xae88('0x2a')],_0x531644['query']);_0x1aea5b[_0xae88('0x2b')]=_[_0xae88('0x2c')](_0x531644[_0xae88('0x2a')],qs[_0xae88('0x2d')](_0x16636f[_0xae88('0x28')][_0xae88('0x2d')]));_0x1aea5b['attributes']=_0x1aea5b[_0xae88('0x2b')][_0xae88('0x2e')]?_0x1aea5b[_0xae88('0x2b')]:_0x531644[_0xae88('0x2a')];if(!_0x16636f[_0xae88('0x28')][_0xae88('0x2f')]('nolimit')){_0x1aea5b['limit']=qs[_0xae88('0x19')](_0x16636f[_0xae88('0x28')][_0xae88('0x19')]);_0x1aea5b[_0xae88('0x18')]=qs[_0xae88('0x18')](_0x16636f[_0xae88('0x28')][_0xae88('0x18')]);}_0x1aea5b[_0xae88('0x30')]=qs['sort'](_0x16636f[_0xae88('0x28')][_0xae88('0x31')]);_0x1aea5b[_0xae88('0x32')]=qs['filters'](_[_0xae88('0x33')](_0x16636f[_0xae88('0x28')],_0x531644[_0xae88('0x34')]),_0x4dadcb);if(_0x16636f[_0xae88('0x28')]['filter']){_0x1aea5b[_0xae88('0x32')]=_[_0xae88('0x35')](_0x1aea5b[_0xae88('0x32')],{'$or':_[_0xae88('0x36')](_0x4dadcb,function(_0x5493ee){if(_0x5493ee[_0xae88('0x27')]!==_0xae88('0x37')){var _0x32e308={};_0x32e308[_0x5493ee[_0xae88('0x22')]]={'$like':'%'+_0x16636f['query'][_0xae88('0x38')]+'%'};return _0x32e308;}})});}_0x1aea5b=_[_0xae88('0x35')]({},_0x1aea5b,_0x16636f[_0xae88('0x39')]);var _0x316d02={'where':_0x1aea5b[_0xae88('0x32')]};return db[_0xae88('0x25')][_0xae88('0x1b')](_0x316d02)['then'](function(_0x496c72){_0xc95593[_0xae88('0x1b')]=_0x496c72;if(_0x16636f['query'][_0xae88('0x3a')]){_0x1aea5b[_0xae88('0x3b')]=[{'all':!![]}];}return db[_0xae88('0x25')]['findAll'](_0x1aea5b);})[_0xae88('0x20')](function(_0x4879e5){_0xc95593[_0xae88('0x3c')]=_0x4879e5;return _0xc95593;})[_0xae88('0x20')](respondWithFilteredResult(_0x9d0416,_0x1aea5b))['catch'](handleError(_0x9d0416,null));};exports['show']=function(_0xdbc575,_0x2caafe){var _0x5cc1c1={'raw':![],'where':{'id':_0xdbc575['params']['id']}},_0x308d76={};_0x308d76[_0xae88('0x2a')]=_[_0xae88('0x29')](db[_0xae88('0x25')][_0xae88('0x3d')]);_0x308d76['query']=_[_0xae88('0x29')](_0xdbc575['query']);_0x308d76[_0xae88('0x34')]=_[_0xae88('0x2c')](_0x308d76[_0xae88('0x2a')],_0x308d76[_0xae88('0x28')]);_0x5cc1c1[_0xae88('0x2b')]=_[_0xae88('0x2c')](_0x308d76[_0xae88('0x2a')],qs[_0xae88('0x2d')](_0xdbc575['query']['fields']));_0x5cc1c1[_0xae88('0x2b')]=_0x5cc1c1[_0xae88('0x2b')][_0xae88('0x2e')]?_0x5cc1c1[_0xae88('0x2b')]:_0x308d76[_0xae88('0x2a')];if(_0xdbc575[_0xae88('0x28')][_0xae88('0x3a')]){_0x5cc1c1[_0xae88('0x3b')]=[{'all':!![]}];}_0x5cc1c1=_[_0xae88('0x35')]({},_0x5cc1c1,_0xdbc575[_0xae88('0x39')]);return db[_0xae88('0x25')][_0xae88('0x3e')](_0x5cc1c1)[_0xae88('0x20')](handleEntityNotFound(_0x2caafe,null))['then'](respondWithResult(_0x2caafe,null))[_0xae88('0x3f')](handleError(_0x2caafe,null));};exports[_0xae88('0x40')]=function(_0x1ad7b5,_0x3cf614){return db[_0xae88('0x25')][_0xae88('0x40')](_0x1ad7b5[_0xae88('0x41')],{})[_0xae88('0x20')](respondWithResult(_0x3cf614,0xc9))[_0xae88('0x3f')](handleError(_0x3cf614,null));};exports['update']=function(_0x4afdc6,_0x5262a1){if(_0x4afdc6['body']['id']){delete _0x4afdc6[_0xae88('0x41')]['id'];}return db[_0xae88('0x25')][_0xae88('0x3e')]({'where':{'id':_0x4afdc6[_0xae88('0x42')]['id']}})['then'](handleEntityNotFound(_0x5262a1,null))[_0xae88('0x20')](saveUpdates(_0x4afdc6[_0xae88('0x41')],null))[_0xae88('0x20')](respondWithResult(_0x5262a1,null))[_0xae88('0x3f')](handleError(_0x5262a1,null));};exports[_0xae88('0x1f')]=function(_0x1e4682,_0x1d6a83){return db[_0xae88('0x25')]['find']({'where':{'id':_0x1e4682['params']['id']}})['then'](handleEntityNotFound(_0x1d6a83,null))[_0xae88('0x20')](removeEntity(_0x1d6a83,null))['catch'](handleError(_0x1d6a83,null));};exports[_0xae88('0x43')]=function(_0x62c530,_0xc72a3f,_0x1489a4){return db[_0xae88('0x44')][_0xae88('0x3e')]({'where':{'id':_0x62c530[_0xae88('0x42')]['id']}})['then'](handleEntityNotFound(_0xc72a3f,null))[_0xae88('0x20')](function(_0x1137ba){if(_0x1137ba){return _0x1137ba[_0xae88('0x43')](_0x62c530[_0xae88('0x41')][_0xae88('0x45')],_[_0xae88('0x46')](_0x62c530['body'],['ids','id'])||{});}})[_0xae88('0x20')](respondWithResult(_0xc72a3f,null))['catch'](handleError(_0xc72a3f,null));};exports[_0xae88('0x47')]=function(_0x578320,_0x54dab2,_0x2103cd){var _0x3cec0a={};var _0x47def1={};var _0x54a9a8;var _0x1ff8aa;return db[_0xae88('0x25')][_0xae88('0x48')]({'where':{'id':_0x578320[_0xae88('0x42')]['id']}})[_0xae88('0x20')](handleEntityNotFound(_0x54dab2,null))[_0xae88('0x20')](function(_0x48c37c){if(_0x48c37c){_0x54a9a8=_0x48c37c;_0x47def1[_0xae88('0x2a')]=_[_0xae88('0x29')](db[_0xae88('0x44')][_0xae88('0x3d')]);_0x47def1[_0xae88('0x28')]=_['keys'](_0x578320[_0xae88('0x28')]);_0x47def1[_0xae88('0x34')]=_['intersection'](_0x47def1[_0xae88('0x2a')],_0x47def1[_0xae88('0x28')]);_0x3cec0a[_0xae88('0x2b')]=_[_0xae88('0x2c')](_0x47def1[_0xae88('0x2a')],qs['fields'](_0x578320[_0xae88('0x28')][_0xae88('0x2d')]));_0x3cec0a[_0xae88('0x2b')]=_0x3cec0a[_0xae88('0x2b')][_0xae88('0x2e')]?_0x3cec0a['attributes']:_0x47def1['model'];_0x3cec0a[_0xae88('0x30')]=qs[_0xae88('0x31')](_0x578320['query']['sort']);_0x3cec0a[_0xae88('0x32')]=qs[_0xae88('0x34')](_['pick'](_0x578320[_0xae88('0x28')],_0x47def1[_0xae88('0x34')]));if(_0x578320[_0xae88('0x28')]['filter']){_0x3cec0a[_0xae88('0x32')]=_['merge'](_0x3cec0a[_0xae88('0x32')],{'$or':_[_0xae88('0x36')](_0x3cec0a[_0xae88('0x2b')],function(_0x5134eb){var _0x523a9f={};_0x523a9f[_0x5134eb]={'$like':'%'+_0x578320['query'][_0xae88('0x38')]+'%'};return _0x523a9f;})});}_0x3cec0a=_[_0xae88('0x35')]({},_0x3cec0a,_0x578320[_0xae88('0x39')]);return _0x54a9a8[_0xae88('0x47')](_0x3cec0a);}})[_0xae88('0x20')](function(_0x32f7c5){if(_0x32f7c5){_0x1ff8aa=_0x32f7c5[_0xae88('0x2e')];if(!_0x578320[_0xae88('0x28')][_0xae88('0x2f')](_0xae88('0x49'))){_0x3cec0a[_0xae88('0x19')]=qs[_0xae88('0x19')](_0x578320['query'][_0xae88('0x19')]);_0x3cec0a[_0xae88('0x18')]=qs[_0xae88('0x18')](_0x578320[_0xae88('0x28')]['offset']);}return _0x54a9a8[_0xae88('0x47')](_0x3cec0a);}})[_0xae88('0x20')](function(_0x5deb54){if(_0x5deb54){return _0x5deb54?{'count':_0x1ff8aa,'rows':_0x5deb54}:null;}})[_0xae88('0x20')](respondWithResult(_0x54dab2,null))[_0xae88('0x3f')](handleError(_0x54dab2,null));};exports['addActions']=function(_0x4afafb,_0xb7748c,_0x225fcf){return db[_0xae88('0x4a')]['find']({'where':{'id':_0x4afafb['params']['id']}})[_0xae88('0x20')](handleEntityNotFound(_0xb7748c,null))[_0xae88('0x20')](function(_0x530886){if(_0x530886){return _0x530886[_0xae88('0x4b')](_0x4afafb[_0xae88('0x41')][_0xae88('0x45')],_[_0xae88('0x46')](_0x4afafb[_0xae88('0x41')],['ids','id'])||{});}})[_0xae88('0x20')](respondWithResult(_0xb7748c,null))[_0xae88('0x3f')](handleError(_0xb7748c,null));};exports[_0xae88('0x4c')]=function(_0x53e7b7,_0x5b6269,_0x2816c6){var _0x22ec57={};var _0x2cc181={};var _0x5783a9;var _0x1c0d48;return db[_0xae88('0x25')][_0xae88('0x48')]({'where':{'id':_0x53e7b7[_0xae88('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b6269,null))['then'](function(_0x39ec0b){if(_0x39ec0b){_0x5783a9=_0x39ec0b;_0x2cc181[_0xae88('0x2a')]=_[_0xae88('0x29')](db[_0xae88('0x4a')][_0xae88('0x3d')]);_0x2cc181['query']=_[_0xae88('0x29')](_0x53e7b7[_0xae88('0x28')]);_0x2cc181[_0xae88('0x34')]=_[_0xae88('0x2c')](_0x2cc181[_0xae88('0x2a')],_0x2cc181[_0xae88('0x28')]);_0x22ec57[_0xae88('0x2b')]=_['intersection'](_0x2cc181[_0xae88('0x2a')],qs[_0xae88('0x2d')](_0x53e7b7[_0xae88('0x28')][_0xae88('0x2d')]));_0x22ec57[_0xae88('0x2b')]=_0x22ec57['attributes'][_0xae88('0x2e')]?_0x22ec57[_0xae88('0x2b')]:_0x2cc181['model'];_0x22ec57[_0xae88('0x30')]=qs[_0xae88('0x31')](_0x53e7b7[_0xae88('0x28')]['sort']);_0x22ec57[_0xae88('0x32')]=qs[_0xae88('0x34')](_[_0xae88('0x33')](_0x53e7b7[_0xae88('0x28')],_0x2cc181[_0xae88('0x34')]));if(_0x53e7b7['query'][_0xae88('0x38')]){_0x22ec57[_0xae88('0x32')]=_[_0xae88('0x35')](_0x22ec57[_0xae88('0x32')],{'$or':_['map'](_0x22ec57[_0xae88('0x2b')],function(_0x4d64c5){var _0xde26c2={};_0xde26c2[_0x4d64c5]={'$like':'%'+_0x53e7b7[_0xae88('0x28')][_0xae88('0x38')]+'%'};return _0xde26c2;})});}_0x22ec57=_[_0xae88('0x35')]({},_0x22ec57,_0x53e7b7['options']);return _0x5783a9[_0xae88('0x4c')](_0x22ec57);}})[_0xae88('0x20')](function(_0x8d0be3){if(_0x8d0be3){_0x1c0d48=_0x8d0be3[_0xae88('0x2e')];if(!_0x53e7b7[_0xae88('0x28')]['hasOwnProperty'](_0xae88('0x49'))){_0x22ec57['limit']=qs[_0xae88('0x19')](_0x53e7b7[_0xae88('0x28')][_0xae88('0x19')]);_0x22ec57[_0xae88('0x18')]=qs[_0xae88('0x18')](_0x53e7b7[_0xae88('0x28')]['offset']);}return _0x5783a9[_0xae88('0x4c')](_0x22ec57);}})[_0xae88('0x20')](function(_0x1a8cbe){if(_0x1a8cbe){return _0x1a8cbe?{'count':_0x1c0d48,'rows':_0x1a8cbe}:null;}})[_0xae88('0x20')](respondWithResult(_0x5b6269,null))[_0xae88('0x3f')](handleError(_0x5b6269,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6350c1f..0e5cc27 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 _0xe9dc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports','tools_automations'];(function(_0x5680d6,_0x17e6a5){var _0x163574=function(_0xcaff76){while(--_0xcaff76){_0x5680d6['push'](_0x5680d6['shift']());}};_0x163574(++_0x17e6a5);}(_0xe9dc,0xc8));var _0xce9d=function(_0x563c35,_0x207732){_0x563c35=_0x563c35-0x0;var _0x2d746e=_0xe9dc[_0x563c35];return _0x2d746e;};'use strict';var _=require(_0xce9d('0x0'));var util=require('util');var logger=require(_0xce9d('0x1'))('api');var moment=require(_0xce9d('0x2'));var BPromise=require(_0xce9d('0x3'));var rp=require(_0xce9d('0x4'));var fs=require('fs');var path=require(_0xce9d('0x5'));var rimraf=require(_0xce9d('0x6'));var config=require('../../config/environment');var attributes=require(_0xce9d('0x7'));module[_0xce9d('0x8')]=function(_0x54e9ac,_0x22b63e){return _0x54e9ac['define']('Automation',attributes,{'tableName':_0xce9d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b81=['request-promise','path','rimraf','../../config/environment','define','Automation','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3a3a79,_0x13a8d8){var _0x1dc3e2=function(_0x1f1468){while(--_0x1f1468){_0x3a3a79['push'](_0x3a3a79['shift']());}};_0x1dc3e2(++_0x13a8d8);}(_0x4b81,0x171));var _0x14b8=function(_0x48e80b,_0x1e3ff6){_0x48e80b=_0x48e80b-0x0;var _0xce688f=_0x4b81[_0x48e80b];return _0xce688f;};'use strict';var _=require(_0x14b8('0x0'));var util=require(_0x14b8('0x1'));var logger=require(_0x14b8('0x2'))('api');var moment=require(_0x14b8('0x3'));var BPromise=require(_0x14b8('0x4'));var rp=require(_0x14b8('0x5'));var fs=require('fs');var path=require(_0x14b8('0x6'));var rimraf=require(_0x14b8('0x7'));var config=require(_0x14b8('0x8'));var attributes=require('./automation.attributes');module['exports']=function(_0x20b1cf,_0x4660b1){return _0x20b1cf[_0x14b8('0x9')](_0x14b8('0xa'),attributes,{'tableName':'tools_automations','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 442671f..57fb629 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 _0x1aab=['Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1aab,0x122));var _0xb1aa=function(_0x1ea76c,_0x4c3e11){_0x1ea76c=_0x1ea76c-0x0;var _0xe2ae67=_0x1aab[_0x1ea76c];return _0xe2ae67;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277448,_0x13a350,_0x283ad6){return new BPromise(function(_0x3415f7,_0x405387){return client[_0xb1aa('0xa')](_0x277448,_0x283ad6)['then'](function(_0x12067d){logger[_0xb1aa('0xb')]('Automation,\x20%s,\x20%s',_0x13a350,_0xb1aa('0xc'));logger[_0xb1aa('0xd')](_0xb1aa('0xe'),_0x13a350,_0xb1aa('0xc'),JSON[_0xb1aa('0xf')](_0x12067d));if(_0x12067d[_0xb1aa('0x10')]){if(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x11')]===0x1f4){logger[_0xb1aa('0x10')](_0xb1aa('0x12'),_0x13a350,_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);return _0x405387(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);}logger[_0xb1aa('0x10')]('Automation,\x20%s,\x20%s',_0x13a350,_0x12067d['error'][_0xb1aa('0x13')]);return _0x3415f7(_0x12067d['error'][_0xb1aa('0x13')]);}else{logger['info'](_0xb1aa('0x12'),_0x13a350,'request\x20sent');_0x3415f7(_0x12067d[_0xb1aa('0x14')]['message']);}})[_0xb1aa('0x15')](function(_0x408bf8){logger['error'](_0xb1aa('0x12'),_0x13a350,_0x408bf8);_0x405387(_0x408bf8);});});}
\ No newline at end of file
+var _0x32f4=['info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x190e94,_0x117fc1){var _0x3012a0=function(_0x500c69){while(--_0x500c69){_0x190e94['push'](_0x190e94['shift']());}};_0x3012a0(++_0x117fc1);}(_0x32f4,0x154));var _0x432f=function(_0x5eda13,_0x1c8307){_0x5eda13=_0x5eda13-0x0;var _0x501325=_0x32f4[_0x5eda13];return _0x501325;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('Automation,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index f3defd9..f2f2f49 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 _0x79a8=['delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','addConditions','addActions','put','update'];(function(_0x5573a0,_0x138a81){var _0x979e79=function(_0x29f34b){while(--_0x29f34b){_0x5573a0['push'](_0x5573a0['shift']());}};_0x979e79(++_0x138a81);}(_0x79a8,0x1d0));var _0x879a=function(_0x187e82,_0x5254eb){_0x187e82=_0x187e82-0x0;var _0x58625e=_0x79a8[_0x187e82];return _0x58625e;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var fs_extra=require(_0x879a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var controller=require(_0x879a('0x7'));router[_0x879a('0x8')]('/',auth[_0x879a('0x9')](),controller[_0x879a('0xa')]);router[_0x879a('0x8')](_0x879a('0xb'),auth['isAuthenticated'](),controller[_0x879a('0xc')]);router['get'](_0x879a('0xd'),auth[_0x879a('0x9')](),controller['getConditions']);router[_0x879a('0x8')](_0x879a('0xe'),auth[_0x879a('0x9')](),controller['getActions']);router[_0x879a('0xf')]('/',auth[_0x879a('0x9')](),controller['create']);router['post'](_0x879a('0xd'),auth[_0x879a('0x9')](),controller[_0x879a('0x10')]);router[_0x879a('0xf')]('/:id/actions',auth[_0x879a('0x9')](),controller[_0x879a('0x11')]);router[_0x879a('0x12')](_0x879a('0xb'),auth[_0x879a('0x9')](),controller[_0x879a('0x13')]);router[_0x879a('0x14')](_0x879a('0xb'),auth[_0x879a('0x9')](),controller[_0x879a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x26c2=['addConditions','addActions','put','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','create','post'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x26c2,0x130));var _0x226c=function(_0x2b24e0,_0x15173c){_0x2b24e0=_0x2b24e0-0x0;var _0x3f095d=_0x26c2[_0x2b24e0];return _0x3f095d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x226c('0x0'));var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var controller=require('./automation.controller');router[_0x226c('0x6')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0x8')]);router[_0x226c('0x6')](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router[_0x226c('0x6')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0xc')]);router['get'](_0x226c('0xd'),auth[_0x226c('0x7')](),controller['getActions']);router['post']('/',auth[_0x226c('0x7')](),controller[_0x226c('0xe')]);router[_0x226c('0xf')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0x10')]);router[_0x226c('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x226c('0x11')]);router[_0x226c('0x12')](_0x226c('0x9'),auth[_0x226c('0x7')](),controller['update']);router['delete'](_0x226c('0x9'),auth[_0x226c('0x7')](),controller[_0x226c('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 24ad794..d872692 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 _0x87b0=['#AMD\x20Min\x20Word\x20Length','#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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x5389b9,_0x56f74e){var _0xc1d58=function(_0x34ba52){while(--_0x34ba52){_0x5389b9['push'](_0x5389b9['shift']());}};_0xc1d58(++_0x56f74e);}(_0x87b0,0x101));var _0x087b=function(_0x4c92db,_0x3da920){_0x4c92db=_0x4c92db-0x0;var _0x4f2019=_0x87b0[_0x4c92db];return _0x4f2019;};'use strict';var Sequelize=require(_0x087b('0x0'));module[_0x087b('0x1')]={'name':{'type':Sequelize[_0x087b('0x2')],'unique':_0x087b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x087b('0x4')](_0x087b('0x5')),'allowNull':![],'defaultValue':_0x087b('0x5')},'description':{'type':Sequelize[_0x087b('0x2')]},'active':{'type':Sequelize[_0x087b('0x6')],'defaultValue':0x0,'comment':_0x087b('0x7')},'limitCalls':{'type':Sequelize[_0x087b('0x8')](0x4)[_0x087b('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x087b('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x087b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x087b('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x087b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x087b('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x087b('0x8')](0x3)[_0x087b('0x9')],'defaultValue':0x3,'comment':_0x087b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x087b('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x087b('0x4')](_0x087b('0x11'),_0x087b('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x087b('0x6')],'defaultValue':0x0,'comment':_0x087b('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x087b('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x087b('0x8')](0x9)[_0x087b('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x087b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x087b('0x8')](0x9)[_0x087b('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x087b('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x087b('0x8')](0x9)[_0x087b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x087b('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x087b('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x087b('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x087b('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x087b('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x087b('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x087b('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x087b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x087b('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x087b('0x1b'),_0x087b('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x087b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x087b('0x8')](0x3)[_0x087b('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x087b('0x1d')},'dialCutDigit':{'type':Sequelize[_0x087b('0x8')](0x3)[_0x087b('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x087b('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x087b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x087b('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x087b('0x8')](0x3)[_0x087b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x087b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x087b('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x087b('0x8')](0x3)[_0x087b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x087b('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x087b('0x8')](0x3)[_0x087b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x087b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x087b('0x8')](0x5)[_0x087b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x087b('0x27')}};
\ No newline at end of file
+var _0x80ff=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','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','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x80ff,0x1e4));var _0xf80f=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x80ff[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0xf80f('0x0'));module[_0xf80f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf80f('0x2')](_0xf80f('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf80f('0x4')]},'active':{'type':Sequelize[_0xf80f('0x5')],'defaultValue':0x0,'comment':_0xf80f('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf80f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf80f('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf80f('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf80f('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf80f('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf80f('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf80f('0x10')},'dialTimezone':{'type':Sequelize[_0xf80f('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf80f('0x4')],'defaultValue':_0xf80f('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xf80f('0x2')](_0xf80f('0x12'),_0xf80f('0x13'),'onlyIfOpen'),'defaultValue':_0xf80f('0x12')},'dialAMDActive':{'type':Sequelize[_0xf80f('0x5')],'defaultValue':0x0,'comment':_0xf80f('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf80f('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf80f('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xf80f('0x9')](0x9)[_0xf80f('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf80f('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf80f('0x9')](0x9)[_0xf80f('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf80f('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf80f('0x9')](0x9)[_0xf80f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf80f('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xf80f('0x9')](0x9)[_0xf80f('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf80f('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf80f('0x9')](0x9)[_0xf80f('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf80f('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf80f('0x9')](0x9)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf80f('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf80f('0x9')](0x5)[_0xf80f('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf80f('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf80f('0x2')](_0xf80f('0x1c'),_0xf80f('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xf80f('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf80f('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf80f('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf80f('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf80f('0x9')](0x3)[_0xf80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf80f('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf80f('0x9')](0x5)[_0xf80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf80f('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index fd93979..6bdb749 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 _0x6f54=['CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','insert','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Campaign','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks'];(function(_0x23c02b,_0x411b4d){var _0x25efc5=function(_0x50e9e4){while(--_0x50e9e4){_0x23c02b['push'](_0x23c02b['shift']());}};_0x25efc5(++_0x411b4d);}(_0x6f54,0xcf));var _0x46f5=function(_0x34395d,_0x45b7f0){_0x34395d=_0x34395d-0x0;var _0x327e89=_0x6f54[_0x34395d];return _0x327e89;};'use strict';var emlformat=require(_0x46f5('0x0'));var rimraf=require(_0x46f5('0x1'));var zipdir=require(_0x46f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x46f5('0x3'));var BPromise=require(_0x46f5('0x4'));var Mustache=require(_0x46f5('0x5'));var util=require(_0x46f5('0x6'));var path=require('path');var sox=require(_0x46f5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f5('0x8'));var _=require('lodash');var squel=require(_0x46f5('0x9'));var crypto=require(_0x46f5('0xa'));var jsforce=require(_0x46f5('0xb'));var deskjs=require(_0x46f5('0xc'));var toCsv=require(_0x46f5('0xd'));var querystring=require(_0x46f5('0xe'));var Papa=require(_0x46f5('0xf'));var Redis=require(_0x46f5('0x10'));var authService=require(_0x46f5('0x11'));var qs=require(_0x46f5('0x12'));var as=require(_0x46f5('0x13'));var hardwareService=require(_0x46f5('0x14'));var logger=require(_0x46f5('0x15'))(_0x46f5('0x16'));var utils=require('../../config/utils');var config=require(_0x46f5('0x17'));var licenseUtil=require(_0x46f5('0x18'));var db=require(_0x46f5('0x19'))['db'];function respondWithStatusCode(_0x5c6df5,_0x138e02){_0x138e02=_0x138e02||0xcc;return function(_0x9741d5){if(_0x9741d5){return _0x5c6df5['sendStatus'](_0x138e02);}return _0x5c6df5[_0x46f5('0x1a')](_0x138e02)[_0x46f5('0x1b')]();};}function respondWithResult(_0x1b1d34,_0x1190fc){_0x1190fc=_0x1190fc||0xc8;return function(_0x51a90a){if(_0x51a90a){return _0x1b1d34['status'](_0x1190fc)[_0x46f5('0x1c')](_0x51a90a);}};}function respondWithFilteredResult(_0x40a47e,_0x52674d){return function(_0xd57cc6){if(_0xd57cc6){var _0x3960e6=typeof _0x52674d[_0x46f5('0x1d')]===_0x46f5('0x1e')&&typeof _0x52674d[_0x46f5('0x1f')]===_0x46f5('0x1e');var _0x1adbb1=_0xd57cc6[_0x46f5('0x20')];var _0x551ee0=_0x3960e6?0x0:_0x52674d[_0x46f5('0x1d')];var _0x1b910b=_0x3960e6?_0xd57cc6[_0x46f5('0x20')]:_0x52674d[_0x46f5('0x1d')]+_0x52674d['limit'];var _0x389831;if(_0x1b910b>=_0x1adbb1){_0x1b910b=_0x1adbb1;_0x389831=0xc8;}else{_0x389831=0xce;}_0x40a47e[_0x46f5('0x1a')](_0x389831);return _0x40a47e[_0x46f5('0x21')](_0x46f5('0x22'),_0x551ee0+'-'+_0x1b910b+'/'+_0x1adbb1)[_0x46f5('0x1c')](_0xd57cc6);}return null;};}function patchUpdates(_0x425a2e){return function(_0x58195a){try{jsonpatch[_0x46f5('0x23')](_0x58195a,_0x425a2e,!![]);}catch(_0x3ed408){return BPromise[_0x46f5('0x24')](_0x3ed408);}return _0x58195a[_0x46f5('0x25')]();};}function saveUpdates(_0x49556c,_0x5d52bf){return function(_0x362033){if(_0x362033){return _0x362033[_0x46f5('0x26')](_0x49556c)[_0x46f5('0x27')](function(_0x2a004d){return _0x2a004d;});}return null;};}function removeEntity(_0x52e610,_0x4c6e30){return function(_0x2993f6){if(_0x2993f6){return _0x2993f6['destroy']()[_0x46f5('0x27')](function(){var _0xc096c6=_0x2993f6['get']({'plain':!![]});var _0x3aa949=_0x46f5('0x28');return db[_0x46f5('0x29')][_0x46f5('0x2a')]({'where':{'type':_0x3aa949,'resourceId':_0xc096c6['id']}})['then'](function(){return _0x2993f6;});})['then'](function(){_0x52e610[_0x46f5('0x1a')](0xcc)[_0x46f5('0x1b')]();});}};}function handleEntityNotFound(_0x4b2769,_0x4a2fe1){return function(_0x3156d5){if(!_0x3156d5){_0x4b2769[_0x46f5('0x2b')](0x194);}return _0x3156d5;};}function handleError(_0x6f3b1d,_0x548310){_0x548310=_0x548310||0x1f4;return function(_0x48b761){logger['error'](_0x48b761[_0x46f5('0x2c')]);if(_0x48b761[_0x46f5('0x2d')]){delete _0x48b761[_0x46f5('0x2d')];}_0x6f3b1d['status'](_0x548310)[_0x46f5('0x2e')](_0x48b761);};}exports[_0x46f5('0x2f')]=function(_0x47aab6,_0x48281a){var _0x36a4bb={},_0x456c02={},_0x1c8f58={'count':0x0,'rows':[]};var _0x317af7=_[_0x46f5('0x30')](db['Campaign'][_0x46f5('0x31')],function(_0x413360){return{'name':_0x413360[_0x46f5('0x32')],'type':_0x413360['type']['key']};});_0x456c02['model']=_[_0x46f5('0x30')](_0x317af7,_0x46f5('0x2d'));_0x456c02[_0x46f5('0x33')]=_['keys'](_0x47aab6[_0x46f5('0x33')]);_0x456c02[_0x46f5('0x34')]=_['intersection'](_0x456c02[_0x46f5('0x35')],_0x456c02[_0x46f5('0x33')]);_0x36a4bb[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x456c02['model'],qs[_0x46f5('0x38')](_0x47aab6['query'][_0x46f5('0x38')]));_0x36a4bb['attributes']=_0x36a4bb[_0x46f5('0x36')][_0x46f5('0x39')]?_0x36a4bb[_0x46f5('0x36')]:_0x456c02['model'];if(!_0x47aab6[_0x46f5('0x33')][_0x46f5('0x3a')](_0x46f5('0x3b'))){_0x36a4bb[_0x46f5('0x1f')]=qs[_0x46f5('0x1f')](_0x47aab6['query'][_0x46f5('0x1f')]);_0x36a4bb[_0x46f5('0x1d')]=qs[_0x46f5('0x1d')](_0x47aab6[_0x46f5('0x33')]['offset']);}_0x36a4bb[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x47aab6[_0x46f5('0x33')]['sort']);_0x36a4bb[_0x46f5('0x3e')]=qs[_0x46f5('0x34')](_[_0x46f5('0x3f')](_0x47aab6[_0x46f5('0x33')],_0x456c02[_0x46f5('0x34')]),_0x317af7);if(_0x47aab6['query'][_0x46f5('0x40')]){_0x36a4bb[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x36a4bb[_0x46f5('0x3e')],{'$or':_[_0x46f5('0x30')](_0x317af7,function(_0x3a5980){if(_0x3a5980[_0x46f5('0x42')]!==_0x46f5('0x43')){var _0x4a31d0={};_0x4a31d0[_0x3a5980[_0x46f5('0x2d')]]={'$like':'%'+_0x47aab6[_0x46f5('0x33')]['filter']+'%'};return _0x4a31d0;}})});}_0x36a4bb=_[_0x46f5('0x41')]({},_0x36a4bb,_0x47aab6[_0x46f5('0x44')]);var _0xe79100={'where':_0x36a4bb[_0x46f5('0x3e')]};return db[_0x46f5('0x45')][_0x46f5('0x20')](_0xe79100)['then'](function(_0x29c47d){_0x1c8f58['count']=_0x29c47d;if(_0x47aab6[_0x46f5('0x33')]['includeAll']){_0x36a4bb[_0x46f5('0x46')]=[{'all':!![]}];}return db[_0x46f5('0x45')][_0x46f5('0x47')](_0x36a4bb);})[_0x46f5('0x27')](function(_0x53cb12){_0x1c8f58[_0x46f5('0x48')]=_0x53cb12;return _0x1c8f58;})[_0x46f5('0x27')](respondWithFilteredResult(_0x48281a,_0x36a4bb))[_0x46f5('0x49')](handleError(_0x48281a,null));};exports[_0x46f5('0x4a')]=function(_0x9f4676,_0x51c34e){var _0x20c69e={'raw':![],'where':{'id':_0x9f4676[_0x46f5('0x4b')]['id']}},_0x1a8f57={};_0x1a8f57['model']=_['keys'](db['Campaign'][_0x46f5('0x31')]);_0x1a8f57[_0x46f5('0x33')]=_[_0x46f5('0x4c')](_0x9f4676[_0x46f5('0x33')]);_0x1a8f57[_0x46f5('0x34')]=_[_0x46f5('0x37')](_0x1a8f57[_0x46f5('0x35')],_0x1a8f57[_0x46f5('0x33')]);_0x20c69e[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x1a8f57['model'],qs[_0x46f5('0x38')](_0x9f4676['query'][_0x46f5('0x38')]));_0x20c69e['attributes']=_0x20c69e['attributes'][_0x46f5('0x39')]?_0x20c69e[_0x46f5('0x36')]:_0x1a8f57[_0x46f5('0x35')];if(_0x9f4676['query'][_0x46f5('0x4d')]){_0x20c69e[_0x46f5('0x46')]=[{'all':!![]}];}_0x20c69e=_[_0x46f5('0x41')]({},_0x20c69e,_0x9f4676[_0x46f5('0x44')]);return db['Campaign'][_0x46f5('0x4e')](_0x20c69e)[_0x46f5('0x27')](handleEntityNotFound(_0x51c34e,null))[_0x46f5('0x27')](respondWithResult(_0x51c34e,null))['catch'](handleError(_0x51c34e,null));};exports[_0x46f5('0x4f')]=function(_0x236409,_0x276192){return db[_0x46f5('0x45')][_0x46f5('0x4f')](_0x236409[_0x46f5('0x50')],{})[_0x46f5('0x27')](function(_0x1216de){var _0x15594e=_0x236409[_0x46f5('0x51')]['get']({'plain':!![]});if(!_0x15594e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15594e[_0x46f5('0x52')]==='user'){var _0xbd2189=_0x1216de[_0x46f5('0x53')]({'plain':!![]});var _0x5305e9=_0x46f5('0x28');return db[_0x46f5('0x54')][_0x46f5('0x4e')]({'where':{'name':_0x5305e9,'userProfileId':_0x15594e[_0x46f5('0x55')]},'raw':!![]})[_0x46f5('0x27')](function(_0x302d29){if(_0x302d29&&_0x302d29['autoAssociation']===0x0){return db[_0x46f5('0x29')][_0x46f5('0x4f')]({'name':_0xbd2189[_0x46f5('0x2d')],'resourceId':_0xbd2189['id'],'type':_0x302d29[_0x46f5('0x2d')],'sectionId':_0x302d29['id']},{})[_0x46f5('0x27')](function(){return _0x1216de;});}else{return _0x1216de;}})[_0x46f5('0x49')](function(_0x5e26c6){logger['error'](_0x46f5('0x56'),_0x5e26c6);throw _0x5e26c6;});}return _0x1216de;})[_0x46f5('0x27')](respondWithResult(_0x276192,0xc9))[_0x46f5('0x49')](handleError(_0x276192,null));};exports['clone']=function(_0x4e3932,_0xf21b38){var _0x518a81={'where':{'id':_0x4e3932[_0x46f5('0x4b')]['id']}},_0x376006={};_0x376006[_0x46f5('0x35')]=_[_0x46f5('0x4c')](db[_0x46f5('0x45')]['rawAttributes']);_0x518a81[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x376006['model'],qs[_0x46f5('0x38')](_0x4e3932[_0x46f5('0x33')][_0x46f5('0x38')]));_0x518a81[_0x46f5('0x36')]=_0x518a81['attributes'][_0x46f5('0x39')]?_0x518a81[_0x46f5('0x36')]:_0x376006[_0x46f5('0x35')];if(_0x4e3932[_0x46f5('0x33')][_0x46f5('0x4d')]){_0x518a81[_0x46f5('0x46')]=[{'all':!![]}];}_0x518a81=_[_0x46f5('0x41')]({},_0x518a81,_0x4e3932['options']);return db[_0x46f5('0x45')]['find'](_0x518a81)['then'](handleEntityNotFound(_0xf21b38,null))['then'](function(_0x3c1c1a){if(_0x3c1c1a){var _0xcbe605=_0x3c1c1a['get']({'plain':!![]});_0xcbe605=qs[_0x46f5('0x57')](_0xcbe605,['id','createdAt',_0x46f5('0x58')]);_0x4e3932['body']=_[_0x46f5('0x57')](_0x4e3932[_0x46f5('0x50')],['id',_0x46f5('0x59'),_0x46f5('0x58')]);return db[_0x46f5('0x45')]['create'](_[_0x46f5('0x41')](_0xcbe605,_0x4e3932['body']),{'include':_0x4e3932[_0x46f5('0x33')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1ea05e){var _0x513ee2=_0x4e3932['user'][_0x46f5('0x53')]({'plain':!![]});if(!_0x513ee2)throw new Error(_0x46f5('0x5a'));if(_0x513ee2['role']==='user'){var _0x59b3bc=_0x1ea05e[_0x46f5('0x53')]({'plain':!![]});var _0x1487dd=_0x46f5('0x28');return db[_0x46f5('0x54')][_0x46f5('0x4e')]({'where':{'name':_0x1487dd,'userProfileId':_0x513ee2[_0x46f5('0x55')]},'raw':!![]})['then'](function(_0x12964b){if(_0x12964b&&_0x12964b[_0x46f5('0x5b')]===0x0){return db[_0x46f5('0x29')][_0x46f5('0x4f')]({'name':_0x59b3bc['name'],'resourceId':_0x59b3bc['id'],'type':_0x12964b[_0x46f5('0x2d')],'sectionId':_0x12964b['id']},{})['then'](function(){return _0x1ea05e;});}else{return _0x1ea05e;}})[_0x46f5('0x49')](function(_0x2054e1){logger[_0x46f5('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2054e1);throw _0x2054e1;});}return _0x1ea05e;});}})[_0x46f5('0x27')](respondWithResult(_0xf21b38,0xc9))['catch'](handleError(_0xf21b38,null));};exports['update']=function(_0x1e0bbb,_0x54e179){if(_0x1e0bbb[_0x46f5('0x50')]['id']){delete _0x1e0bbb[_0x46f5('0x50')]['id'];}return db['Campaign'][_0x46f5('0x4e')]({'where':{'id':_0x1e0bbb[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x54e179,null))[_0x46f5('0x27')](saveUpdates(_0x1e0bbb[_0x46f5('0x50')],null))[_0x46f5('0x27')](respondWithResult(_0x54e179,null))[_0x46f5('0x49')](handleError(_0x54e179,null));};exports[_0x46f5('0x2a')]=function(_0x46acb3,_0xbe7698){return db[_0x46f5('0x45')][_0x46f5('0x4e')]({'where':{'id':_0x46acb3['params']['id']}})['then'](handleEntityNotFound(_0xbe7698,null))[_0x46f5('0x27')](removeEntity(_0xbe7698,null))['catch'](handleError(_0xbe7698,null));};exports[_0x46f5('0x5d')]=function(_0x24108a,_0x3bb638,_0xf370f8){var _0x58ef6d={'raw':!![],'where':{}};var _0x5286ff={};var _0x3629f7={'count':0x0,'rows':[]};return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x24108a[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x3bb638,null))['then'](function(_0x490b25){if(_0x490b25){_0x5286ff['model']=_[_0x46f5('0x4c')](db[_0x46f5('0x5f')][_0x46f5('0x31')]);_0x5286ff[_0x46f5('0x33')]=_[_0x46f5('0x4c')](_0x24108a[_0x46f5('0x33')]);_0x5286ff['filters']=_['intersection'](_0x5286ff['model'],_0x5286ff[_0x46f5('0x33')]);_0x58ef6d[_0x46f5('0x36')]=_['intersection'](_0x5286ff['model'],qs['fields'](_0x24108a['query'][_0x46f5('0x38')]));_0x58ef6d[_0x46f5('0x36')]=_0x58ef6d[_0x46f5('0x36')][_0x46f5('0x39')]?_0x58ef6d[_0x46f5('0x36')]:_0x5286ff[_0x46f5('0x35')];if(!_0x24108a[_0x46f5('0x33')][_0x46f5('0x3a')](_0x46f5('0x3b'))){_0x58ef6d[_0x46f5('0x1f')]=qs['limit'](_0x24108a[_0x46f5('0x33')]['limit']);_0x58ef6d[_0x46f5('0x1d')]=qs[_0x46f5('0x1d')](_0x24108a[_0x46f5('0x33')]['offset']);}_0x58ef6d['order']=qs[_0x46f5('0x3d')](_0x24108a[_0x46f5('0x33')]['sort']);_0x58ef6d['where']=qs[_0x46f5('0x34')](_[_0x46f5('0x3f')](_0x24108a[_0x46f5('0x33')],_0x5286ff[_0x46f5('0x34')]));_0x58ef6d['where'][_0x46f5('0x60')]=_0x490b25['id'];if(_0x24108a[_0x46f5('0x33')][_0x46f5('0x40')]){_0x58ef6d[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x58ef6d[_0x46f5('0x3e')],{'$or':_[_0x46f5('0x30')](_0x58ef6d[_0x46f5('0x36')],function(_0x13853f){var _0x3d888c={};_0x3d888c[_0x13853f]={'$like':'%'+_0x24108a[_0x46f5('0x33')][_0x46f5('0x40')]+'%'};return _0x3d888c;})});}_0x58ef6d=_[_0x46f5('0x41')]({},_0x58ef6d,_0x24108a[_0x46f5('0x44')]);return db[_0x46f5('0x5f')][_0x46f5('0x20')]({'where':_0x58ef6d[_0x46f5('0x3e')]})[_0x46f5('0x27')](function(_0x159faa){_0x3629f7[_0x46f5('0x20')]=_0x159faa;if(_0x24108a[_0x46f5('0x33')][_0x46f5('0x4d')]){_0x58ef6d[_0x46f5('0x46')]=[{'all':!![]}];}return db[_0x46f5('0x5f')][_0x46f5('0x47')](_0x58ef6d);})[_0x46f5('0x27')](function(_0x5c3eef){_0x3629f7[_0x46f5('0x48')]=_0x5c3eef;return _0x3629f7;});}})[_0x46f5('0x27')](respondWithFilteredResult(_0x3bb638,_0x58ef6d))[_0x46f5('0x49')](handleError(_0x3bb638,null));};exports['getHopperHistories']=function(_0x2b4f7f,_0x4068df,_0x3fac1e){var _0x1a83ea={'raw':!![],'where':{}};var _0x27389d={};var _0x3c4467={'count':0x0,'rows':[]};return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x2b4f7f[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x4068df,null))['then'](function(_0x371ed2){if(_0x371ed2){_0x27389d['model']=_['keys'](db[_0x46f5('0x61')][_0x46f5('0x31')]);_0x27389d[_0x46f5('0x33')]=_['keys'](_0x2b4f7f[_0x46f5('0x33')]);_0x27389d['filters']=_[_0x46f5('0x37')](_0x27389d[_0x46f5('0x35')],_0x27389d[_0x46f5('0x33')]);_0x1a83ea[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x27389d['model'],qs[_0x46f5('0x38')](_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x38')]));_0x1a83ea[_0x46f5('0x36')]=_0x1a83ea[_0x46f5('0x36')][_0x46f5('0x39')]?_0x1a83ea['attributes']:_0x27389d[_0x46f5('0x35')];if(!_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x3a')](_0x46f5('0x3b'))){_0x1a83ea[_0x46f5('0x1f')]=qs[_0x46f5('0x1f')](_0x2b4f7f['query'][_0x46f5('0x1f')]);_0x1a83ea['offset']=qs[_0x46f5('0x1d')](_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x1d')]);}_0x1a83ea[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x2b4f7f['query'][_0x46f5('0x3d')]);_0x1a83ea['where']=qs['filters'](_[_0x46f5('0x3f')](_0x2b4f7f['query'],_0x27389d['filters']));_0x1a83ea[_0x46f5('0x3e')][_0x46f5('0x60')]=_0x371ed2['id'];if(_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x40')]){_0x1a83ea[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x1a83ea[_0x46f5('0x3e')],{'$or':_['map'](_0x1a83ea[_0x46f5('0x36')],function(_0x188fa5){var _0x14dc1e={};_0x14dc1e[_0x188fa5]={'$like':'%'+_0x2b4f7f[_0x46f5('0x33')][_0x46f5('0x40')]+'%'};return _0x14dc1e;})});}_0x1a83ea=_['merge']({},_0x1a83ea,_0x2b4f7f['options']);return db['CmHopperHistory'][_0x46f5('0x20')]({'where':_0x1a83ea[_0x46f5('0x3e')]})['then'](function(_0xabacc8){_0x3c4467['count']=_0xabacc8;if(_0x2b4f7f['query'][_0x46f5('0x4d')]){_0x1a83ea['include']=[{'all':!![]}];}return db[_0x46f5('0x61')]['findAll'](_0x1a83ea);})['then'](function(_0x23f81e){_0x3c4467[_0x46f5('0x48')]=_0x23f81e;return _0x3c4467;});}})[_0x46f5('0x27')](respondWithFilteredResult(_0x4068df,_0x1a83ea))['catch'](handleError(_0x4068df,null));};exports[_0x46f5('0x62')]=function(_0x210b96,_0x4fecb7,_0x54a32e){var _0x447e09={'raw':!![],'where':{}};var _0x4a14e7={};var _0x574bf4={'count':0x0,'rows':[]};return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x210b96[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x4fecb7,null))[_0x46f5('0x27')](function(_0x4230c1){if(_0x4230c1){_0x4a14e7[_0x46f5('0x35')]=_[_0x46f5('0x4c')](db[_0x46f5('0x63')]['rawAttributes']);_0x4a14e7[_0x46f5('0x33')]=_[_0x46f5('0x4c')](_0x210b96['query']);_0x4a14e7[_0x46f5('0x34')]=_['intersection'](_0x4a14e7[_0x46f5('0x35')],_0x4a14e7['query']);_0x447e09[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x4a14e7[_0x46f5('0x35')],qs[_0x46f5('0x38')](_0x210b96['query']['fields']));_0x447e09[_0x46f5('0x36')]=_0x447e09[_0x46f5('0x36')][_0x46f5('0x39')]?_0x447e09['attributes']:_0x4a14e7[_0x46f5('0x35')];if(!_0x210b96['query'][_0x46f5('0x3a')]('nolimit')){_0x447e09['limit']=qs['limit'](_0x210b96['query'][_0x46f5('0x1f')]);_0x447e09[_0x46f5('0x1d')]=qs[_0x46f5('0x1d')](_0x210b96['query']['offset']);}_0x447e09[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x210b96[_0x46f5('0x33')][_0x46f5('0x3d')]);_0x447e09[_0x46f5('0x3e')]=qs[_0x46f5('0x34')](_[_0x46f5('0x3f')](_0x210b96[_0x46f5('0x33')],_0x4a14e7[_0x46f5('0x34')]));_0x447e09['where']['CampaignId']=_0x4230c1['id'];if(_0x210b96[_0x46f5('0x33')][_0x46f5('0x40')]){_0x447e09[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x447e09[_0x46f5('0x3e')],{'$or':_[_0x46f5('0x30')](_0x447e09[_0x46f5('0x36')],function(_0x40cc78){var _0x1df111={};_0x1df111[_0x40cc78]={'$like':'%'+_0x210b96['query'][_0x46f5('0x40')]+'%'};return _0x1df111;})});}_0x447e09=_[_0x46f5('0x41')]({},_0x447e09,_0x210b96[_0x46f5('0x44')]);return db[_0x46f5('0x63')][_0x46f5('0x20')]({'where':_0x447e09[_0x46f5('0x3e')]})[_0x46f5('0x27')](function(_0x3f48f0){_0x574bf4['count']=_0x3f48f0;if(_0x210b96[_0x46f5('0x33')][_0x46f5('0x4d')]){_0x447e09[_0x46f5('0x46')]=[{'all':!![]}];}return db[_0x46f5('0x63')][_0x46f5('0x47')](_0x447e09);})[_0x46f5('0x27')](function(_0x5edb99){_0x574bf4[_0x46f5('0x48')]=_0x5edb99;return _0x574bf4;});}})['then'](respondWithFilteredResult(_0x4fecb7,_0x447e09))['catch'](handleError(_0x4fecb7,null));};exports[_0x46f5('0x64')]=function(_0x1d4b81,_0x508e17,_0x449847){var _0x5282a9={'raw':!![],'where':{}};var _0x3c5f8d={};var _0x249087={'count':0x0,'rows':[]};return db[_0x46f5('0x45')]['findOne']({'where':{'id':_0x1d4b81[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x508e17,null))[_0x46f5('0x27')](function(_0x2a9d1b){if(_0x2a9d1b){_0x3c5f8d[_0x46f5('0x35')]=_[_0x46f5('0x4c')](db[_0x46f5('0x65')][_0x46f5('0x31')]);_0x3c5f8d[_0x46f5('0x33')]=_['keys'](_0x1d4b81[_0x46f5('0x33')]);_0x3c5f8d['filters']=_['intersection'](_0x3c5f8d['model'],_0x3c5f8d['query']);_0x5282a9[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x3c5f8d[_0x46f5('0x35')],qs['fields'](_0x1d4b81['query'][_0x46f5('0x38')]));_0x5282a9[_0x46f5('0x36')]=_0x5282a9['attributes']['length']?_0x5282a9['attributes']:_0x3c5f8d['model'];if(!_0x1d4b81[_0x46f5('0x33')][_0x46f5('0x3a')]('nolimit')){_0x5282a9[_0x46f5('0x1f')]=qs[_0x46f5('0x1f')](_0x1d4b81['query'][_0x46f5('0x1f')]);_0x5282a9['offset']=qs['offset'](_0x1d4b81[_0x46f5('0x33')][_0x46f5('0x1d')]);}_0x5282a9[_0x46f5('0x3c')]=qs['sort'](_0x1d4b81[_0x46f5('0x33')][_0x46f5('0x3d')]);_0x5282a9[_0x46f5('0x3e')]=qs['filters'](_['pick'](_0x1d4b81['query'],_0x3c5f8d['filters']));_0x5282a9['where'][_0x46f5('0x60')]=_0x2a9d1b['id'];if(_0x1d4b81[_0x46f5('0x33')][_0x46f5('0x40')]){_0x5282a9[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0x5282a9[_0x46f5('0x3e')],{'$or':_['map'](_0x5282a9['attributes'],function(_0x5eef48){var _0x33679a={};_0x33679a[_0x5eef48]={'$like':'%'+_0x1d4b81['query']['filter']+'%'};return _0x33679a;})});}_0x5282a9=_[_0x46f5('0x41')]({},_0x5282a9,_0x1d4b81[_0x46f5('0x44')]);return db[_0x46f5('0x65')][_0x46f5('0x20')]({'where':_0x5282a9[_0x46f5('0x3e')]})[_0x46f5('0x27')](function(_0x53fd24){_0x249087[_0x46f5('0x20')]=_0x53fd24;if(_0x1d4b81['query'][_0x46f5('0x4d')]){_0x5282a9[_0x46f5('0x46')]=[{'all':!![]}];}return db[_0x46f5('0x65')][_0x46f5('0x47')](_0x5282a9);})[_0x46f5('0x27')](function(_0x3ea26e){_0x249087[_0x46f5('0x48')]=_0x3ea26e;return _0x249087;});}})['then'](respondWithFilteredResult(_0x508e17,_0x5282a9))[_0x46f5('0x49')](handleError(_0x508e17,null));};exports[_0x46f5('0x66')]=function(_0x3349f9,_0x49ac67,_0x2a7726){var _0x1b9907={};var _0x39b066={};var _0x37569b;var _0x2ac67f;return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x3349f9[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x49ac67,null))[_0x46f5('0x27')](function(_0x3e4a22){if(_0x3e4a22){_0x37569b=_0x3e4a22;_0x39b066[_0x46f5('0x35')]=_[_0x46f5('0x4c')](db['CmList'][_0x46f5('0x31')]);_0x39b066['query']=_[_0x46f5('0x4c')](_0x3349f9[_0x46f5('0x33')]);_0x39b066[_0x46f5('0x34')]=_['intersection'](_0x39b066['model'],_0x39b066[_0x46f5('0x33')]);_0x1b9907['attributes']=_[_0x46f5('0x37')](_0x39b066[_0x46f5('0x35')],qs[_0x46f5('0x38')](_0x3349f9[_0x46f5('0x33')]['fields']));_0x1b9907['attributes']=_0x1b9907[_0x46f5('0x36')]['length']?_0x1b9907[_0x46f5('0x36')]:_0x39b066[_0x46f5('0x35')];_0x1b9907[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x3349f9[_0x46f5('0x33')]['sort']);_0x1b9907[_0x46f5('0x3e')]=qs[_0x46f5('0x34')](_[_0x46f5('0x3f')](_0x3349f9[_0x46f5('0x33')],_0x39b066[_0x46f5('0x34')]));if(_0x3349f9['query'][_0x46f5('0x40')]){_0x1b9907['where']=_['merge'](_0x1b9907['where'],{'$or':_[_0x46f5('0x30')](_0x1b9907['attributes'],function(_0x33d63b){var _0x10bd78={};_0x10bd78[_0x33d63b]={'$like':'%'+_0x3349f9['query'][_0x46f5('0x40')]+'%'};return _0x10bd78;})});}_0x1b9907=_[_0x46f5('0x41')]({},_0x1b9907,_0x3349f9['options']);return _0x37569b['getLists'](_0x1b9907);}})['then'](function(_0x1bfe4e){if(_0x1bfe4e){_0x2ac67f=_0x1bfe4e[_0x46f5('0x39')];if(!_0x3349f9['query'][_0x46f5('0x3a')]('nolimit')){_0x1b9907[_0x46f5('0x1f')]=qs['limit'](_0x3349f9[_0x46f5('0x33')][_0x46f5('0x1f')]);_0x1b9907['offset']=qs[_0x46f5('0x1d')](_0x3349f9[_0x46f5('0x33')][_0x46f5('0x1d')]);}return _0x37569b[_0x46f5('0x66')](_0x1b9907);}})[_0x46f5('0x27')](function(_0x1fa566){if(_0x1fa566){return _0x1fa566?{'count':_0x2ac67f,'rows':_0x1fa566}:null;}})['then'](respondWithResult(_0x49ac67,null))[_0x46f5('0x49')](handleError(_0x49ac67,null));};exports[_0x46f5('0x67')]=function(_0x59fcda,_0x4b8cc0,_0x5195a0){var _0x1fbd73,_0x474e7c;var _0x945063=[];var _0xb9c66c=moment()[_0x46f5('0x68')](_0x46f5('0x69'));return db['Campaign'][_0x46f5('0x4e')]({'where':{'id':_0x59fcda[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x4b8cc0,null))[_0x46f5('0x27')](function(_0x32ddb9){if(_0x32ddb9){_0x474e7c=_0x32ddb9;return _0x32ddb9['addLists'](_0x59fcda[_0x46f5('0x50')][_0x46f5('0x6a')],_[_0x46f5('0x57')](_0x59fcda['body'],[_0x46f5('0x6a'),'id'])||{});}return null;})[_0x46f5('0x6b')](function(_0x263dd7){var _0x17e43e;var _0x5ed8bf;_0x1fbd73=_0x263dd7||[];var _0x21cbb8=[];if(_0x263dd7){for(var _0x26199b=0x0;_0x26199b<_0x263dd7[_0x46f5('0x39')];_0x26199b+=0x1){var _0x529103=_0x263dd7[_0x26199b][_0x46f5('0x53')]({'plain':!![]});_0x474e7c['dialCheckDuplicateType']=_0x59fcda[_0x46f5('0x50')][_0x46f5('0x6c')]?_0x59fcda['body'][_0x46f5('0x6c')]:_0x474e7c['dialCheckDuplicateType'];switch(_0x474e7c[_0x46f5('0x6c')]){case _0x46f5('0x6d'):_0x17e43e=squel['insert']()[_0x46f5('0x6e')]('cm_hopper')['fromQuery']([_0x46f5('0x6f'),_0x46f5('0x70'),_0x46f5('0x71'),_0x46f5('0x72'),'CampaignId',_0x46f5('0x59'),'updatedAt'],squel[_0x46f5('0x73')]()[_0x46f5('0x74')](_0x46f5('0x6f'),_0x46f5('0x6f'))['field'](_0x46f5('0x75'),_0x46f5('0x70'))['field']('id','ContactId')[_0x46f5('0x74')](_0x529103[_0x46f5('0x76')][_0x46f5('0x77')](),_0x46f5('0x72'))[_0x46f5('0x74')](_0x59fcda[_0x46f5('0x4b')]['id'][_0x46f5('0x77')](),_0x46f5('0x60'))[_0x46f5('0x74')]('\x27'+_0xb9c66c+'\x27','createdAt')['field']('\x27'+_0xb9c66c+'\x27',_0x46f5('0x58'))['from'](_0x46f5('0x78'))[_0x46f5('0x3e')]('deletedAt\x20IS\x20NULL')[_0x46f5('0x3e')](_0x46f5('0x79'),_0x529103[_0x46f5('0x76')][_0x46f5('0x77')]())[_0x46f5('0x3e')](_0x46f5('0x7a'))['where'](_0x46f5('0x7b'),squel[_0x46f5('0x73')]()[_0x46f5('0x74')](_0x46f5('0x7c'))[_0x46f5('0x7d')](_0x46f5('0x7e'))[_0x46f5('0x3e')]('CampaignId\x20=\x20?',_0x59fcda[_0x46f5('0x4b')]['id'][_0x46f5('0x77')]()))[_0x46f5('0x3e')](_0x46f5('0x7b'),squel[_0x46f5('0x73')]()[_0x46f5('0x74')](_0x46f5('0x7f'))['from'](_0x46f5('0x80'))[_0x46f5('0x3e')](_0x46f5('0x81'),_0x59fcda[_0x46f5('0x4b')]['id'][_0x46f5('0x77')]())))[_0x46f5('0x77')]();break;case _0x46f5('0x82'):_0x17e43e=squel['insert']()[_0x46f5('0x6e')]('cm_hopper')[_0x46f5('0x83')](['phone',_0x46f5('0x70'),_0x46f5('0x71'),_0x46f5('0x72'),_0x46f5('0x60'),_0x46f5('0x59'),'updatedAt'],squel[_0x46f5('0x73')]()['field'](_0x46f5('0x6f'),_0x46f5('0x6f'))['field'](_0x46f5('0x75'),_0x46f5('0x70'))[_0x46f5('0x74')]('id',_0x46f5('0x71'))[_0x46f5('0x74')](_0x529103[_0x46f5('0x76')][_0x46f5('0x77')](),_0x46f5('0x72'))[_0x46f5('0x74')](_0x59fcda[_0x46f5('0x4b')]['id'][_0x46f5('0x77')](),_0x46f5('0x60'))['field']('\x27'+_0xb9c66c+'\x27',_0x46f5('0x59'))['field']('\x27'+_0xb9c66c+'\x27','updatedAt')[_0x46f5('0x7d')](_0x46f5('0x78'))[_0x46f5('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x46f5('0x79'),_0x529103[_0x46f5('0x76')][_0x46f5('0x77')]())[_0x46f5('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x46f5('0x3e')](_0x46f5('0x7b'),squel[_0x46f5('0x73')]()['field'](_0x46f5('0x7f'))['from'](_0x46f5('0x80'))[_0x46f5('0x3e')]('CampaignId\x20=\x20?',_0x59fcda[_0x46f5('0x4b')]['id']['toString']())))['toString']();break;default:_0x17e43e=squel[_0x46f5('0x84')]()[_0x46f5('0x6e')](_0x46f5('0x80'))[_0x46f5('0x83')]([_0x46f5('0x6f'),_0x46f5('0x70'),_0x46f5('0x71'),_0x46f5('0x72'),_0x46f5('0x60'),_0x46f5('0x59'),'updatedAt'],squel[_0x46f5('0x73')]()[_0x46f5('0x74')](_0x46f5('0x6f'),_0x46f5('0x6f'))[_0x46f5('0x74')](_0x46f5('0x75'),'scheduledAt')[_0x46f5('0x74')]('id','ContactId')[_0x46f5('0x74')](_0x529103[_0x46f5('0x76')][_0x46f5('0x77')](),_0x46f5('0x72'))[_0x46f5('0x74')](_0x59fcda[_0x46f5('0x4b')]['id']['toString'](),'CampaignId')[_0x46f5('0x74')]('\x27'+_0xb9c66c+'\x27',_0x46f5('0x59'))[_0x46f5('0x74')]('\x27'+_0xb9c66c+'\x27','updatedAt')['from'](_0x46f5('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x46f5('0x3e')]('ListId\x20=\x20?',_0x529103[_0x46f5('0x76')][_0x46f5('0x77')]())[_0x46f5('0x3e')](_0x46f5('0x7a')))[_0x46f5('0x77')]();}_0x5ed8bf=squel[_0x46f5('0x84')]()[_0x46f5('0x6e')](_0x46f5('0x85'))[_0x46f5('0x83')]([_0x46f5('0x86'),_0x46f5('0x70'),'phone',_0x46f5('0x87'),'createdAt',_0x46f5('0x58')],squel[_0x46f5('0x73')]()[_0x46f5('0x74')](_0x46f5('0x88'),'id')[_0x46f5('0x74')](_0x46f5('0x75'),_0x46f5('0x70'))[_0x46f5('0x74')](_0x46f5('0x89'),_0x46f5('0x6f'))['field'](_0x46f5('0x8a'),_0x46f5('0x87'))[_0x46f5('0x74')]('\x27'+_0xb9c66c+'\x27','createdAt')[_0x46f5('0x74')]('\x27'+_0xb9c66c+'\x27',_0x46f5('0x58'))['from'](_0x46f5('0x8b'),'ci')[_0x46f5('0x8c')]('cm_hopper','h',_0x46f5('0x8d'))[_0x46f5('0x3e')](_0x46f5('0x8e'),_0x529103[_0x46f5('0x76')]['toString']())['where'](_0x46f5('0x8f'),_0x59fcda[_0x46f5('0x4b')]['id'][_0x46f5('0x77')]())[_0x46f5('0x3e')](_0x46f5('0x90'),_0xb9c66c))['toString']();_0x21cbb8[_0x46f5('0x91')](db['sequelize'][_0x46f5('0x33')](_0x17e43e));_0x945063[_0x46f5('0x91')](db[_0x46f5('0x92')]['query'](_0x5ed8bf));}return BPromise['all'](_0x21cbb8);}})[_0x46f5('0x27')](function(){return BPromise[_0x46f5('0x93')](_0x945063);})[_0x46f5('0x27')](function(){return _0x1fbd73;})['then'](respondWithResult(_0x4b8cc0,null))[_0x46f5('0x49')](handleError(_0x4b8cc0,null));};exports[_0x46f5('0x94')]=function(_0xeb05d8,_0x3eb947,_0xa132e){return db[_0x46f5('0x45')][_0x46f5('0x4e')]({'where':{'id':_0xeb05d8['params']['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x3eb947,null))['then'](function(_0x4ef723){if(_0x4ef723){return _0x4ef723[_0x46f5('0x94')](_0xeb05d8['query'][_0x46f5('0x6a')]);}})['then'](function(_0x415861){if(_0x415861){return db[_0x46f5('0x5f')]['destroy']({'where':{'ListId':_0xeb05d8[_0x46f5('0x33')][_0x46f5('0x6a')],'CampaignId':_0xeb05d8['params']['id']}})['then'](function(){return _0x415861;});}})[_0x46f5('0x27')](respondWithStatusCode(_0x3eb947,null))[_0x46f5('0x49')](handleError(_0x3eb947,null));};exports['getBlackLists']=function(_0x4fbc97,_0x345a93,_0x2109e4){var _0xd0aa3f={};var _0x562f6c={};var _0x4fb5dd;var _0x402313;return db[_0x46f5('0x45')][_0x46f5('0x5e')]({'where':{'id':_0x4fbc97[_0x46f5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x345a93,null))[_0x46f5('0x27')](function(_0x3e8951){if(_0x3e8951){_0x4fb5dd=_0x3e8951;_0x562f6c[_0x46f5('0x35')]=_[_0x46f5('0x4c')](db['CmList'][_0x46f5('0x31')]);_0x562f6c[_0x46f5('0x33')]=_['keys'](_0x4fbc97[_0x46f5('0x33')]);_0x562f6c[_0x46f5('0x34')]=_[_0x46f5('0x37')](_0x562f6c['model'],_0x562f6c['query']);_0xd0aa3f[_0x46f5('0x36')]=_[_0x46f5('0x37')](_0x562f6c['model'],qs[_0x46f5('0x38')](_0x4fbc97['query'][_0x46f5('0x38')]));_0xd0aa3f['attributes']=_0xd0aa3f['attributes'][_0x46f5('0x39')]?_0xd0aa3f[_0x46f5('0x36')]:_0x562f6c[_0x46f5('0x35')];_0xd0aa3f[_0x46f5('0x3c')]=qs[_0x46f5('0x3d')](_0x4fbc97[_0x46f5('0x33')][_0x46f5('0x3d')]);_0xd0aa3f[_0x46f5('0x3e')]=qs[_0x46f5('0x34')](_['pick'](_0x4fbc97[_0x46f5('0x33')],_0x562f6c[_0x46f5('0x34')]));if(_0x4fbc97['query'][_0x46f5('0x40')]){_0xd0aa3f[_0x46f5('0x3e')]=_[_0x46f5('0x41')](_0xd0aa3f[_0x46f5('0x3e')],{'$or':_['map'](_0xd0aa3f[_0x46f5('0x36')],function(_0x59fb14){var _0x2da486={};_0x2da486[_0x59fb14]={'$like':'%'+_0x4fbc97[_0x46f5('0x33')][_0x46f5('0x40')]+'%'};return _0x2da486;})});}_0xd0aa3f=_['merge']({},_0xd0aa3f,_0x4fbc97[_0x46f5('0x44')]);return _0x4fb5dd[_0x46f5('0x95')](_0xd0aa3f);}})['then'](function(_0x25025e){if(_0x25025e){_0x402313=_0x25025e[_0x46f5('0x39')];if(!_0x4fbc97[_0x46f5('0x33')]['hasOwnProperty'](_0x46f5('0x3b'))){_0xd0aa3f[_0x46f5('0x1f')]=qs[_0x46f5('0x1f')](_0x4fbc97[_0x46f5('0x33')]['limit']);_0xd0aa3f['offset']=qs[_0x46f5('0x1d')](_0x4fbc97[_0x46f5('0x33')][_0x46f5('0x1d')]);}return _0x4fb5dd[_0x46f5('0x95')](_0xd0aa3f);}})[_0x46f5('0x27')](function(_0x422bc6){if(_0x422bc6){return _0x422bc6?{'count':_0x402313,'rows':_0x422bc6}:null;}})['then'](respondWithResult(_0x345a93,null))[_0x46f5('0x49')](handleError(_0x345a93,null));};exports[_0x46f5('0x96')]=function(_0x1cefa2,_0x10c9b7,_0x4b173a){var _0xe50fd4,_0x4e36fc;var _0x3be685=[];var _0x593068=moment()[_0x46f5('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x46f5('0x45')]['find']({'where':{'id':_0x1cefa2['params']['id']}})[_0x46f5('0x27')](handleEntityNotFound(_0x10c9b7,null))[_0x46f5('0x27')](function(_0x4be102){if(_0x4be102){_0x4e36fc=_0x4be102;return _0x4be102[_0x46f5('0x96')](_0x1cefa2[_0x46f5('0x50')][_0x46f5('0x6a')],_[_0x46f5('0x57')](_0x1cefa2[_0x46f5('0x50')],[_0x46f5('0x6a'),'id'])||{});}return null;})[_0x46f5('0x6b')](function(_0x6594d0){var _0x5f8174;var _0x471a65;_0xe50fd4=_0x6594d0||[];var _0x411f5a=[];if(_0x6594d0){for(var _0x773bc7=0x0;_0x773bc7<_0x6594d0[_0x46f5('0x39')];_0x773bc7+=0x1){var _0x5e0df5=_0x6594d0[_0x773bc7][_0x46f5('0x53')]({'plain':!![]});_0x5f8174=squel['insert']()['into'](_0x46f5('0x97'))[_0x46f5('0x83')]([_0x46f5('0x6f'),_0x46f5('0x71'),_0x46f5('0x72'),_0x46f5('0x60'),_0x46f5('0x59'),_0x46f5('0x58')],squel[_0x46f5('0x73')]()[_0x46f5('0x74')]('phone',_0x46f5('0x6f'))[_0x46f5('0x74')]('id',_0x46f5('0x71'))[_0x46f5('0x74')](_0x5e0df5[_0x46f5('0x76')][_0x46f5('0x77')](),_0x46f5('0x72'))['field'](_0x1cefa2[_0x46f5('0x4b')]['id'][_0x46f5('0x77')](),_0x46f5('0x60'))[_0x46f5('0x74')](_0x46f5('0x75'),_0x46f5('0x59'))[_0x46f5('0x74')](_0x46f5('0x75'),'updatedAt')[_0x46f5('0x7d')]('cm_contacts')[_0x46f5('0x3e')](_0x46f5('0x98'))['where'](_0x46f5('0x79'),_0x5e0df5[_0x46f5('0x76')][_0x46f5('0x77')]())[_0x46f5('0x3e')](_0x46f5('0x7a')))[_0x46f5('0x77')]();_0x411f5a[_0x46f5('0x91')](db[_0x46f5('0x92')][_0x46f5('0x33')](_0x5f8174));}return BPromise['all'](_0x411f5a);}})[_0x46f5('0x27')](function(){return _0xe50fd4;})['then'](respondWithResult(_0x10c9b7,null))[_0x46f5('0x49')](handleError(_0x10c9b7,null));};exports[_0x46f5('0x99')]=function(_0x4b71e8,_0x1b5de7,_0x12f95d){return db[_0x46f5('0x45')][_0x46f5('0x4e')]({'where':{'id':_0x4b71e8[_0x46f5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b5de7,null))[_0x46f5('0x27')](function(_0x4be6ab){if(_0x4be6ab){return _0x4be6ab[_0x46f5('0x99')](_0x4b71e8[_0x46f5('0x33')]['ids']);}})[_0x46f5('0x27')](function(_0x1e67e6){if(_0x1e67e6){return db['CmHopperBlack'][_0x46f5('0x2a')]({'where':{'ListId':_0x4b71e8[_0x46f5('0x33')][_0x46f5('0x6a')],'CampaignId':_0x4b71e8[_0x46f5('0x4b')]['id']}})[_0x46f5('0x27')](function(){return _0x1e67e6;});}})[_0x46f5('0x27')](respondWithStatusCode(_0x1b5de7,null))['catch'](handleError(_0x1b5de7,null));};
\ No newline at end of file
+var _0x53aa=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','params','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper','insert','cm_hopper_additional_phones','cmHopperId','ci.OrderBY','OrderBy','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','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','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','Campaign','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x515472,_0x525e8c){var _0x2583d5=function(_0x51b54b){while(--_0x51b54b){_0x515472['push'](_0x515472['shift']());}};_0x2583d5(++_0x525e8c);}(_0x53aa,0x167));var _0xa53a=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x53aa[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0xa53a('0x0'));var rimraf=require(_0xa53a('0x1'));var zipdir=require(_0xa53a('0x2'));var jsonpatch=require(_0xa53a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa53a('0x4'));var Mustache=require('mustache');var util=require(_0xa53a('0x5'));var path=require(_0xa53a('0x6'));var sox=require(_0xa53a('0x7'));var csv=require(_0xa53a('0x8'));var ejs=require(_0xa53a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa53a('0xa'));var squel=require(_0xa53a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa53a('0xc'));var deskjs=require(_0xa53a('0xd'));var toCsv=require(_0xa53a('0x8'));var querystring=require('querystring');var Papa=require(_0xa53a('0xe'));var Redis=require('ioredis');var authService=require(_0xa53a('0xf'));var qs=require(_0xa53a('0x10'));var as=require(_0xa53a('0x11'));var hardwareService=require(_0xa53a('0x12'));var logger=require(_0xa53a('0x13'))(_0xa53a('0x14'));var utils=require(_0xa53a('0x15'));var config=require(_0xa53a('0x16'));var licenseUtil=require(_0xa53a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448fcb,_0x52cb14){_0x52cb14=_0x52cb14||0xcc;return function(_0x3d5a63){if(_0x3d5a63){return _0x448fcb[_0xa53a('0x18')](_0x52cb14);}return _0x448fcb[_0xa53a('0x19')](_0x52cb14)[_0xa53a('0x1a')]();};}function respondWithResult(_0x252c59,_0x333cdc){_0x333cdc=_0x333cdc||0xc8;return function(_0xebb4b7){if(_0xebb4b7){return _0x252c59[_0xa53a('0x19')](_0x333cdc)[_0xa53a('0x1b')](_0xebb4b7);}};}function respondWithFilteredResult(_0x1ce266,_0x2d1f21){return function(_0x427d66){if(_0x427d66){var _0x5c5a14=typeof _0x2d1f21[_0xa53a('0x1c')]===_0xa53a('0x1d')&&typeof _0x2d1f21['limit']===_0xa53a('0x1d');var _0x3f3869=_0x427d66[_0xa53a('0x1e')];var _0xf61650=_0x5c5a14?0x0:_0x2d1f21[_0xa53a('0x1c')];var _0x379a0b=_0x5c5a14?_0x427d66[_0xa53a('0x1e')]:_0x2d1f21[_0xa53a('0x1c')]+_0x2d1f21[_0xa53a('0x1f')];var _0x1e1401;if(_0x379a0b>=_0x3f3869){_0x379a0b=_0x3f3869;_0x1e1401=0xc8;}else{_0x1e1401=0xce;}_0x1ce266[_0xa53a('0x19')](_0x1e1401);return _0x1ce266[_0xa53a('0x20')](_0xa53a('0x21'),_0xf61650+'-'+_0x379a0b+'/'+_0x3f3869)[_0xa53a('0x1b')](_0x427d66);}return null;};}function patchUpdates(_0x584c4e){return function(_0x4527c8){try{jsonpatch[_0xa53a('0x22')](_0x4527c8,_0x584c4e,!![]);}catch(_0x478ff2){return BPromise[_0xa53a('0x23')](_0x478ff2);}return _0x4527c8['save']();};}function saveUpdates(_0x1a2a2a,_0x352f91){return function(_0xc5fe37){if(_0xc5fe37){return _0xc5fe37[_0xa53a('0x24')](_0x1a2a2a)[_0xa53a('0x25')](function(_0x324a24){return _0x324a24;});}return null;};}function removeEntity(_0x5cdb5c,_0x138a10){return function(_0x2cc210){if(_0x2cc210){return _0x2cc210['destroy']()[_0xa53a('0x25')](function(){var _0x3878e0=_0x2cc210[_0xa53a('0x26')]({'plain':!![]});var _0x1d9466=_0xa53a('0x27');return db[_0xa53a('0x28')][_0xa53a('0x29')]({'where':{'type':_0x1d9466,'resourceId':_0x3878e0['id']}})['then'](function(){return _0x2cc210;});})['then'](function(){_0x5cdb5c[_0xa53a('0x19')](0xcc)[_0xa53a('0x1a')]();});}};}function handleEntityNotFound(_0x512d96,_0x3d11a2){return function(_0xe10903){if(!_0xe10903){_0x512d96[_0xa53a('0x18')](0x194);}return _0xe10903;};}function handleError(_0x33565a,_0x2ffcb6){_0x2ffcb6=_0x2ffcb6||0x1f4;return function(_0x1e796b){logger['error'](_0x1e796b[_0xa53a('0x2a')]);if(_0x1e796b[_0xa53a('0x2b')]){delete _0x1e796b[_0xa53a('0x2b')];}_0x33565a['status'](_0x2ffcb6)['send'](_0x1e796b);};}exports[_0xa53a('0x2c')]=function(_0x37ef40,_0x1bb99d){var _0x4bd9b9={},_0x2d78eb={},_0xd60689={'count':0x0,'rows':[]};var _0x7e6177=_[_0xa53a('0x2d')](db['Campaign']['rawAttributes'],function(_0x2b7024){return{'name':_0x2b7024[_0xa53a('0x2e')],'type':_0x2b7024[_0xa53a('0x2f')][_0xa53a('0x30')]};});_0x2d78eb[_0xa53a('0x31')]=_[_0xa53a('0x2d')](_0x7e6177,_0xa53a('0x2b'));_0x2d78eb[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x37ef40['query']);_0x2d78eb[_0xa53a('0x34')]=_['intersection'](_0x2d78eb[_0xa53a('0x31')],_0x2d78eb[_0xa53a('0x32')]);_0x4bd9b9[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x2d78eb[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x37')]));_0x4bd9b9[_0xa53a('0x35')]=_0x4bd9b9['attributes'][_0xa53a('0x38')]?_0x4bd9b9['attributes']:_0x2d78eb['model'];if(!_0x37ef40[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x4bd9b9['limit']=qs[_0xa53a('0x1f')](_0x37ef40['query'][_0xa53a('0x1f')]);_0x4bd9b9[_0xa53a('0x1c')]=qs['offset'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x4bd9b9[_0xa53a('0x3b')]=qs['sort'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x4bd9b9['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x37ef40[_0xa53a('0x32')],_0x2d78eb[_0xa53a('0x34')]),_0x7e6177);if(_0x37ef40[_0xa53a('0x32')]['filter']){_0x4bd9b9[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x4bd9b9['where'],{'$or':_[_0xa53a('0x2d')](_0x7e6177,function(_0x11e623){if(_0x11e623[_0xa53a('0x2f')]!==_0xa53a('0x40')){var _0x4602b5={};_0x4602b5[_0x11e623[_0xa53a('0x2b')]]={'$like':'%'+_0x37ef40[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4602b5;}})});}_0x4bd9b9=_[_0xa53a('0x3f')]({},_0x4bd9b9,_0x37ef40[_0xa53a('0x42')]);var _0x50fd89={'where':_0x4bd9b9[_0xa53a('0x3e')]};return db['Campaign'][_0xa53a('0x1e')](_0x50fd89)[_0xa53a('0x25')](function(_0x4a9d5d){_0xd60689[_0xa53a('0x1e')]=_0x4a9d5d;if(_0x37ef40[_0xa53a('0x32')][_0xa53a('0x43')]){_0x4bd9b9[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x45')][_0xa53a('0x46')](_0x4bd9b9);})[_0xa53a('0x25')](function(_0x3fc9ea){_0xd60689[_0xa53a('0x47')]=_0x3fc9ea;return _0xd60689;})[_0xa53a('0x25')](respondWithFilteredResult(_0x1bb99d,_0x4bd9b9))[_0xa53a('0x48')](handleError(_0x1bb99d,null));};exports[_0xa53a('0x49')]=function(_0x4f5178,_0x1e4536){var _0x55ded6={'raw':![],'where':{'id':_0x4f5178['params']['id']}},_0x1dd82b={};_0x1dd82b[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x1dd82b[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x4f5178[_0xa53a('0x32')]);_0x1dd82b[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],_0x1dd82b[_0xa53a('0x32')]);_0x55ded6[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x4f5178['query']['fields']));_0x55ded6[_0xa53a('0x35')]=_0x55ded6[_0xa53a('0x35')][_0xa53a('0x38')]?_0x55ded6[_0xa53a('0x35')]:_0x1dd82b[_0xa53a('0x31')];if(_0x4f5178[_0xa53a('0x32')][_0xa53a('0x43')]){_0x55ded6[_0xa53a('0x44')]=[{'all':!![]}];}_0x55ded6=_[_0xa53a('0x3f')]({},_0x55ded6,_0x4f5178['options']);return db[_0xa53a('0x45')][_0xa53a('0x4b')](_0x55ded6)[_0xa53a('0x25')](handleEntityNotFound(_0x1e4536,null))[_0xa53a('0x25')](respondWithResult(_0x1e4536,null))[_0xa53a('0x48')](handleError(_0x1e4536,null));};exports['create']=function(_0xd16651,_0xec389b){return db[_0xa53a('0x45')][_0xa53a('0x4c')](_0xd16651[_0xa53a('0x4d')],{})[_0xa53a('0x25')](function(_0x30e30f){var _0x10b86b=_0xd16651[_0xa53a('0x4e')][_0xa53a('0x26')]({'plain':!![]});if(!_0x10b86b)throw new Error(_0xa53a('0x4f'));if(_0x10b86b[_0xa53a('0x50')]===_0xa53a('0x4e')){var _0x515f62=_0x30e30f[_0xa53a('0x26')]({'plain':!![]});var _0x5380bb=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x5380bb,'userProfileId':_0x10b86b[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x13acaf){if(_0x13acaf&&_0x13acaf[_0xa53a('0x53')]===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0x515f62[_0xa53a('0x2b')],'resourceId':_0x515f62['id'],'type':_0x13acaf[_0xa53a('0x2b')],'sectionId':_0x13acaf['id']},{})[_0xa53a('0x25')](function(){return _0x30e30f;});}else{return _0x30e30f;}})['catch'](function(_0x56a4ef){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x56a4ef);throw _0x56a4ef;});}return _0x30e30f;})[_0xa53a('0x25')](respondWithResult(_0xec389b,0xc9))['catch'](handleError(_0xec389b,null));};exports[_0xa53a('0x56')]=function(_0x1a9449,_0x36b9c){var _0x2416f3={'where':{'id':_0x1a9449['params']['id']}},_0x5709e9={};_0x5709e9[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x2416f3[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x5709e9[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x1a9449[_0xa53a('0x32')][_0xa53a('0x37')]));_0x2416f3['attributes']=_0x2416f3[_0xa53a('0x35')]['length']?_0x2416f3['attributes']:_0x5709e9[_0xa53a('0x31')];if(_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]){_0x2416f3['include']=[{'all':!![]}];}_0x2416f3=_[_0xa53a('0x3f')]({},_0x2416f3,_0x1a9449[_0xa53a('0x42')]);return db['Campaign'][_0xa53a('0x4b')](_0x2416f3)[_0xa53a('0x25')](handleEntityNotFound(_0x36b9c,null))[_0xa53a('0x25')](function(_0x4fbe3b){if(_0x4fbe3b){var _0x75f0e0=_0x4fbe3b[_0xa53a('0x26')]({'plain':!![]});_0x75f0e0=qs[_0xa53a('0x57')](_0x75f0e0,['id',_0xa53a('0x58'),_0xa53a('0x59')]);_0x1a9449['body']=_['omit'](_0x1a9449['body'],['id','createdAt','updatedAt']);return db[_0xa53a('0x45')][_0xa53a('0x4c')](_[_0xa53a('0x3f')](_0x75f0e0,_0x1a9449['body']),{'include':_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]?[{'all':!![]}]:undefined})[_0xa53a('0x25')](function(_0x5556da){var _0x306891=_0x1a9449['user']['get']({'plain':!![]});if(!_0x306891)throw new Error(_0xa53a('0x4f'));if(_0x306891['role']===_0xa53a('0x4e')){var _0xfa9984=_0x5556da[_0xa53a('0x26')]({'plain':!![]});var _0x35c243=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x35c243,'userProfileId':_0x306891[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x1439a4){if(_0x1439a4&&_0x1439a4['autoAssociation']===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0xfa9984[_0xa53a('0x2b')],'resourceId':_0xfa9984['id'],'type':_0x1439a4[_0xa53a('0x2b')],'sectionId':_0x1439a4['id']},{})[_0xa53a('0x25')](function(){return _0x5556da;});}else{return _0x5556da;}})[_0xa53a('0x48')](function(_0x5bd848){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x5bd848);throw _0x5bd848;});}return _0x5556da;});}})['then'](respondWithResult(_0x36b9c,0xc9))[_0xa53a('0x48')](handleError(_0x36b9c,null));};exports[_0xa53a('0x24')]=function(_0x530ca8,_0x4c7f47){if(_0x530ca8['body']['id']){delete _0x530ca8[_0xa53a('0x4d')]['id'];}return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x530ca8[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x4c7f47,null))['then'](saveUpdates(_0x530ca8[_0xa53a('0x4d')],null))[_0xa53a('0x25')](respondWithResult(_0x4c7f47,null))[_0xa53a('0x48')](handleError(_0x4c7f47,null));};exports[_0xa53a('0x29')]=function(_0x16ac88,_0x240a25){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x16ac88[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x240a25,null))['then'](removeEntity(_0x240a25,null))['catch'](handleError(_0x240a25,null));};exports[_0xa53a('0x5b')]=function(_0x25044f,_0x11f1c3,_0x3f16df){var _0x17f983={'raw':!![],'where':{}};var _0x229f8c={};var _0x4143f2={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x25044f[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x11f1c3,null))[_0xa53a('0x25')](function(_0x363ae1){if(_0x363ae1){_0x229f8c['model']=_[_0xa53a('0x33')](db[_0xa53a('0x5d')][_0xa53a('0x4a')]);_0x229f8c[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x25044f[_0xa53a('0x32')]);_0x229f8c[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x229f8c['model'],_0x229f8c['query']);_0x17f983[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x229f8c['model'],qs['fields'](_0x25044f[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17f983[_0xa53a('0x35')]=_0x17f983[_0xa53a('0x35')]['length']?_0x17f983[_0xa53a('0x35')]:_0x229f8c[_0xa53a('0x31')];if(!_0x25044f[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17f983[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1f')]);_0x17f983[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x17f983[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17f983[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x25044f[_0xa53a('0x32')],_0x229f8c[_0xa53a('0x34')]));_0x17f983[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x363ae1['id'];if(_0x25044f[_0xa53a('0x32')]['filter']){_0x17f983[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17f983['where'],{'$or':_[_0xa53a('0x2d')](_0x17f983[_0xa53a('0x35')],function(_0x3a7675){var _0x15976a={};_0x15976a[_0x3a7675]={'$like':'%'+_0x25044f['query'][_0xa53a('0x41')]+'%'};return _0x15976a;})});}_0x17f983=_[_0xa53a('0x3f')]({},_0x17f983,_0x25044f[_0xa53a('0x42')]);return db['CmHopper']['count']({'where':_0x17f983[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x343235){_0x4143f2['count']=_0x343235;if(_0x25044f[_0xa53a('0x32')][_0xa53a('0x43')]){_0x17f983[_0xa53a('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xa53a('0x46')](_0x17f983);})[_0xa53a('0x25')](function(_0x5da9ce){_0x4143f2[_0xa53a('0x47')]=_0x5da9ce;return _0x4143f2;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x11f1c3,_0x17f983))['catch'](handleError(_0x11f1c3,null));};exports[_0xa53a('0x5f')]=function(_0x27decf,_0xdec0eb,_0x77779){var _0x208d92={'raw':!![],'where':{}};var _0x324446={};var _0x916b0a={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x27decf[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0xdec0eb,null))[_0xa53a('0x25')](function(_0x2a3227){if(_0x2a3227){_0x324446[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x60')][_0xa53a('0x4a')]);_0x324446[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x27decf['query']);_0x324446['filters']=_[_0xa53a('0x36')](_0x324446['model'],_0x324446[_0xa53a('0x32')]);_0x208d92[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x324446[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x27decf[_0xa53a('0x32')]['fields']));_0x208d92[_0xa53a('0x35')]=_0x208d92['attributes'][_0xa53a('0x38')]?_0x208d92[_0xa53a('0x35')]:_0x324446[_0xa53a('0x31')];if(!_0x27decf[_0xa53a('0x32')][_0xa53a('0x39')]('nolimit')){_0x208d92[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x27decf[_0xa53a('0x32')]['limit']);_0x208d92[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x27decf[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x208d92[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x27decf[_0xa53a('0x32')]['sort']);_0x208d92[_0xa53a('0x3e')]=qs['filters'](_[_0xa53a('0x3d')](_0x27decf[_0xa53a('0x32')],_0x324446[_0xa53a('0x34')]));_0x208d92[_0xa53a('0x3e')]['CampaignId']=_0x2a3227['id'];if(_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]){_0x208d92[_0xa53a('0x3e')]=_['merge'](_0x208d92['where'],{'$or':_['map'](_0x208d92[_0xa53a('0x35')],function(_0x5004e8){var _0x31ec53={};_0x31ec53[_0x5004e8]={'$like':'%'+_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x31ec53;})});}_0x208d92=_[_0xa53a('0x3f')]({},_0x208d92,_0x27decf[_0xa53a('0x42')]);return db[_0xa53a('0x60')][_0xa53a('0x1e')]({'where':_0x208d92[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x2335ea){_0x916b0a['count']=_0x2335ea;if(_0x27decf['query']['includeAll']){_0x208d92[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x60')][_0xa53a('0x46')](_0x208d92);})['then'](function(_0x439134){_0x916b0a[_0xa53a('0x47')]=_0x439134;return _0x916b0a;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0xdec0eb,_0x208d92))[_0xa53a('0x48')](handleError(_0xdec0eb,null));};exports[_0xa53a('0x61')]=function(_0x2b1cb2,_0x131375,_0x17eddb){var _0xf317e7={'raw':!![],'where':{}};var _0x1c9cd3={};var _0x454358={'count':0x0,'rows':[]};return db['Campaign'][_0xa53a('0x5c')]({'where':{'id':_0x2b1cb2[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x131375,null))['then'](function(_0x34c13b){if(_0x34c13b){_0x1c9cd3[_0xa53a('0x31')]=_['keys'](db[_0xa53a('0x62')][_0xa53a('0x4a')]);_0x1c9cd3[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x2b1cb2[_0xa53a('0x32')]);_0x1c9cd3[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1c9cd3['model'],_0x1c9cd3[_0xa53a('0x32')]);_0xf317e7[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1c9cd3['model'],qs[_0xa53a('0x37')](_0x2b1cb2['query'][_0xa53a('0x37')]));_0xf317e7['attributes']=_0xf317e7[_0xa53a('0x35')][_0xa53a('0x38')]?_0xf317e7[_0xa53a('0x35')]:_0x1c9cd3[_0xa53a('0x31')];if(!_0x2b1cb2['query'][_0xa53a('0x39')]('nolimit')){_0xf317e7[_0xa53a('0x1f')]=qs['limit'](_0x2b1cb2[_0xa53a('0x32')]['limit']);_0xf317e7[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0xf317e7[_0xa53a('0x3b')]=qs['sort'](_0x2b1cb2['query'][_0xa53a('0x3c')]);_0xf317e7['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x2b1cb2[_0xa53a('0x32')],_0x1c9cd3[_0xa53a('0x34')]));_0xf317e7[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x34c13b['id'];if(_0x2b1cb2['query'][_0xa53a('0x41')]){_0xf317e7[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0xf317e7[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0xf317e7['attributes'],function(_0x25e9c9){var _0x4e3b51={};_0x4e3b51[_0x25e9c9]={'$like':'%'+_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4e3b51;})});}_0xf317e7=_['merge']({},_0xf317e7,_0x2b1cb2[_0xa53a('0x42')]);return db[_0xa53a('0x62')][_0xa53a('0x1e')]({'where':_0xf317e7[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x447fbb){_0x454358['count']=_0x447fbb;if(_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x43')]){_0xf317e7[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x62')]['findAll'](_0xf317e7);})[_0xa53a('0x25')](function(_0x17d295){_0x454358[_0xa53a('0x47')]=_0x17d295;return _0x454358;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x131375,_0xf317e7))['catch'](handleError(_0x131375,null));};exports[_0xa53a('0x63')]=function(_0x10fa08,_0x2de2e8,_0x16c3f4){var _0x3e0ce2={'raw':!![],'where':{}};var _0x941bad={};var _0x20871b={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x10fa08[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x2de2e8,null))[_0xa53a('0x25')](function(_0x3151bb){if(_0x3151bb){_0x941bad[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x64')][_0xa53a('0x4a')]);_0x941bad[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x10fa08[_0xa53a('0x32')]);_0x941bad[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x941bad[_0xa53a('0x31')],_0x941bad[_0xa53a('0x32')]);_0x3e0ce2[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x941bad[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x10fa08['query']['fields']));_0x3e0ce2[_0xa53a('0x35')]=_0x3e0ce2['attributes'][_0xa53a('0x38')]?_0x3e0ce2['attributes']:_0x941bad[_0xa53a('0x31')];if(!_0x10fa08[_0xa53a('0x32')]['hasOwnProperty']('nolimit')){_0x3e0ce2[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x10fa08['query'][_0xa53a('0x1f')]);_0x3e0ce2[_0xa53a('0x1c')]=qs['offset'](_0x10fa08[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x3e0ce2['order']=qs[_0xa53a('0x3c')](_0x10fa08[_0xa53a('0x32')]['sort']);_0x3e0ce2[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x10fa08[_0xa53a('0x32')],_0x941bad[_0xa53a('0x34')]));_0x3e0ce2['where'][_0xa53a('0x5e')]=_0x3151bb['id'];if(_0x10fa08[_0xa53a('0x32')]['filter']){_0x3e0ce2[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x3e0ce2[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0x3e0ce2[_0xa53a('0x35')],function(_0x32eebf){var _0x4911eb={};_0x4911eb[_0x32eebf]={'$like':'%'+_0x10fa08[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4911eb;})});}_0x3e0ce2=_[_0xa53a('0x3f')]({},_0x3e0ce2,_0x10fa08[_0xa53a('0x42')]);return db[_0xa53a('0x64')]['count']({'where':_0x3e0ce2[_0xa53a('0x3e')]})['then'](function(_0x34e770){_0x20871b['count']=_0x34e770;if(_0x10fa08[_0xa53a('0x32')][_0xa53a('0x43')]){_0x3e0ce2[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x64')][_0xa53a('0x46')](_0x3e0ce2);})[_0xa53a('0x25')](function(_0x443530){_0x20871b[_0xa53a('0x47')]=_0x443530;return _0x20871b;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x2de2e8,_0x3e0ce2))[_0xa53a('0x48')](handleError(_0x2de2e8,null));};exports[_0xa53a('0x65')]=function(_0x588aaa,_0x211888,_0x1a41f2){var _0x17ba41={};var _0x192edf={};var _0x5727ed;var _0x21ca42;return db[_0xa53a('0x45')]['findOne']({'where':{'id':_0x588aaa[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x211888,null))[_0xa53a('0x25')](function(_0x279a2a){if(_0x279a2a){_0x5727ed=_0x279a2a;_0x192edf[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x66')]['rawAttributes']);_0x192edf[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x588aaa[_0xa53a('0x32')]);_0x192edf[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x192edf[_0xa53a('0x31')],_0x192edf['query']);_0x17ba41[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x192edf[_0xa53a('0x31')],qs['fields'](_0x588aaa[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17ba41[_0xa53a('0x35')]=_0x17ba41[_0xa53a('0x35')][_0xa53a('0x38')]?_0x17ba41[_0xa53a('0x35')]:_0x192edf[_0xa53a('0x31')];_0x17ba41[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x588aaa[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17ba41[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x588aaa['query'],_0x192edf[_0xa53a('0x34')]));if(_0x588aaa[_0xa53a('0x32')][_0xa53a('0x41')]){_0x17ba41[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17ba41[_0xa53a('0x3e')],{'$or':_['map'](_0x17ba41[_0xa53a('0x35')],function(_0x20a11d){var _0x1a02a0={};_0x1a02a0[_0x20a11d]={'$like':'%'+_0x588aaa[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x1a02a0;})});}_0x17ba41=_[_0xa53a('0x3f')]({},_0x17ba41,_0x588aaa[_0xa53a('0x42')]);return _0x5727ed[_0xa53a('0x65')](_0x17ba41);}})[_0xa53a('0x25')](function(_0x35d9dc){if(_0x35d9dc){_0x21ca42=_0x35d9dc[_0xa53a('0x38')];if(!_0x588aaa[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17ba41[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x588aaa['query'][_0xa53a('0x1f')]);_0x17ba41['offset']=qs['offset'](_0x588aaa[_0xa53a('0x32')]['offset']);}return _0x5727ed['getLists'](_0x17ba41);}})[_0xa53a('0x25')](function(_0x2e02ca){if(_0x2e02ca){return _0x2e02ca?{'count':_0x21ca42,'rows':_0x2e02ca}:null;}})[_0xa53a('0x25')](respondWithResult(_0x211888,null))['catch'](handleError(_0x211888,null));};exports[_0xa53a('0x67')]=function(_0x51754e,_0x9f05cb,_0x15e837){var _0x132533,_0xadb0af;var _0x3bcca7=[];var _0x1218e7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa53a('0x45')]['find']({'where':{'id':_0x51754e[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x9f05cb,null))['then'](function(_0x3c238e){if(_0x3c238e){_0xadb0af=_0x3c238e;return _0x3c238e[_0xa53a('0x67')](_0x51754e[_0xa53a('0x4d')]['ids'],_['omit'](_0x51754e[_0xa53a('0x4d')],[_0xa53a('0x68'),'id'])||{});}return null;})[_0xa53a('0x69')](function(_0x24d470){var _0x406f0c;var _0x10685e;_0x132533=_0x24d470||[];var _0x2254d3=[];if(_0x24d470){for(var _0x582064=0x0;_0x582064<_0x24d470[_0xa53a('0x38')];_0x582064+=0x1){var _0x131d06=_0x24d470[_0x582064][_0xa53a('0x26')]({'plain':!![]});_0xadb0af[_0xa53a('0x6a')]=_0x51754e[_0xa53a('0x4d')][_0xa53a('0x6a')]?_0x51754e[_0xa53a('0x4d')][_0xa53a('0x6a')]:_0xadb0af[_0xa53a('0x6a')];switch(_0xadb0af[_0xa53a('0x6a')]){case _0xa53a('0x6b'):_0x406f0c=squel['insert']()[_0xa53a('0x6c')]('cm_hopper')[_0xa53a('0x6d')](['phone',_0xa53a('0x6e'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('phone','phone')[_0xa53a('0x72')](_0xa53a('0x73'),_0xa53a('0x6e'))['field']('id','ContactId')['field'](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))[_0xa53a('0x72')](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))['field']('\x27'+_0x1218e7+'\x27','createdAt')[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27','updatedAt')[_0xa53a('0x76')](_0xa53a('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0xa53a('0x3e')]('ListId\x20=\x20?',_0x131d06['CmListId'][_0xa53a('0x75')]())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0xa53a('0x76')](_0xa53a('0x78'))[_0xa53a('0x3e')](_0xa53a('0x79'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]()))['where'](_0xa53a('0x7a'),squel[_0xa53a('0x71')]()[_0xa53a('0x72')](_0xa53a('0x7b'))[_0xa53a('0x76')]('cm_hopper')[_0xa53a('0x3e')](_0xa53a('0x79'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]())))[_0xa53a('0x75')]();break;case _0xa53a('0x7c'):_0x406f0c=squel['insert']()[_0xa53a('0x6c')]('cm_hopper')[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6e'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel[_0xa53a('0x71')]()['field'](_0xa53a('0x7d'),'phone')[_0xa53a('0x72')](_0xa53a('0x73'),'scheduledAt')['field']('id',_0xa53a('0x6f'))['field'](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),'ListId')['field'](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27','createdAt')[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')]('cm_contacts')[_0xa53a('0x3e')](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')]())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xa53a('0x3e')](_0xa53a('0x7a'),squel[_0xa53a('0x71')]()['field'](_0xa53a('0x7b'))[_0xa53a('0x76')](_0xa53a('0x80'))['where'](_0xa53a('0x79'),_0x51754e['params']['id']['toString']())))[_0xa53a('0x75')]();break;default:_0x406f0c=squel[_0xa53a('0x81')]()[_0xa53a('0x6c')](_0xa53a('0x80'))[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6e'),'ContactId','ListId',_0xa53a('0x5e'),'createdAt',_0xa53a('0x59')],squel['select']()[_0xa53a('0x72')]('phone',_0xa53a('0x7d'))[_0xa53a('0x72')](_0xa53a('0x73'),'scheduledAt')['field']('id',_0xa53a('0x6f'))[_0xa53a('0x72')](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))['field'](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x58'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')](_0xa53a('0x77'))[_0xa53a('0x3e')](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x131d06[_0xa53a('0x74')]['toString']())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0xa53a('0x75')]();}_0x10685e=squel[_0xa53a('0x81')]()['into'](_0xa53a('0x82'))[_0xa53a('0x6d')]([_0xa53a('0x83'),_0xa53a('0x6e'),'phone','OrderBy',_0xa53a('0x58'),'updatedAt'],squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('h.id','id')[_0xa53a('0x72')](_0xa53a('0x73'),_0xa53a('0x6e'))[_0xa53a('0x72')]('ci.item',_0xa53a('0x7d'))[_0xa53a('0x72')](_0xa53a('0x84'),_0xa53a('0x85'))[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27',_0xa53a('0x58'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')]('cm_contact_has_items','ci')['join'](_0xa53a('0x80'),'h',_0xa53a('0x86'))['where'](_0xa53a('0x87'),_0x131d06[_0xa53a('0x74')]['toString']())['where'](_0xa53a('0x88'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]())[_0xa53a('0x3e')](_0xa53a('0x89'),_0x1218e7))[_0xa53a('0x75')]();_0x2254d3[_0xa53a('0x8a')](db[_0xa53a('0x8b')][_0xa53a('0x32')](_0x406f0c));_0x3bcca7[_0xa53a('0x8a')](db['sequelize'][_0xa53a('0x32')](_0x10685e));}return BPromise[_0xa53a('0x8c')](_0x2254d3);}})[_0xa53a('0x25')](function(){return BPromise[_0xa53a('0x8c')](_0x3bcca7);})['then'](function(){return _0x132533;})[_0xa53a('0x25')](respondWithResult(_0x9f05cb,null))[_0xa53a('0x48')](handleError(_0x9f05cb,null));};exports['removeLists']=function(_0x19f146,_0x48569e,_0x1f1790){return db['Campaign'][_0xa53a('0x4b')]({'where':{'id':_0x19f146[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x48569e,null))['then'](function(_0x3d0a22){if(_0x3d0a22){return _0x3d0a22[_0xa53a('0x8d')](_0x19f146[_0xa53a('0x32')]['ids']);}})[_0xa53a('0x25')](function(_0x456fdc){if(_0x456fdc){return db['CmHopper'][_0xa53a('0x29')]({'where':{'ListId':_0x19f146[_0xa53a('0x32')]['ids'],'CampaignId':_0x19f146[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](function(){return _0x456fdc;});}})[_0xa53a('0x25')](respondWithStatusCode(_0x48569e,null))[_0xa53a('0x48')](handleError(_0x48569e,null));};exports[_0xa53a('0x8e')]=function(_0x3cb79d,_0x226e59,_0x24dc87){var _0x15a860={};var _0x208e72={};var _0x2b5c2d;var _0x1aa738;return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x3cb79d[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x226e59,null))[_0xa53a('0x25')](function(_0x250e29){if(_0x250e29){_0x2b5c2d=_0x250e29;_0x208e72['model']=_[_0xa53a('0x33')](db[_0xa53a('0x66')]['rawAttributes']);_0x208e72['query']=_[_0xa53a('0x33')](_0x3cb79d[_0xa53a('0x32')]);_0x208e72[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x208e72['model'],_0x208e72[_0xa53a('0x32')]);_0x15a860[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x208e72[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x3cb79d[_0xa53a('0x32')]['fields']));_0x15a860[_0xa53a('0x35')]=_0x15a860[_0xa53a('0x35')][_0xa53a('0x38')]?_0x15a860[_0xa53a('0x35')]:_0x208e72[_0xa53a('0x31')];_0x15a860[_0xa53a('0x3b')]=qs['sort'](_0x3cb79d['query']['sort']);_0x15a860[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x3cb79d['query'],_0x208e72[_0xa53a('0x34')]));if(_0x3cb79d[_0xa53a('0x32')][_0xa53a('0x41')]){_0x15a860[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x15a860[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0x15a860[_0xa53a('0x35')],function(_0x1d007d){var _0x25b669={};_0x25b669[_0x1d007d]={'$like':'%'+_0x3cb79d['query'][_0xa53a('0x41')]+'%'};return _0x25b669;})});}_0x15a860=_[_0xa53a('0x3f')]({},_0x15a860,_0x3cb79d[_0xa53a('0x42')]);return _0x2b5c2d['getBlackLists'](_0x15a860);}})['then'](function(_0x16bf8b){if(_0x16bf8b){_0x1aa738=_0x16bf8b[_0xa53a('0x38')];if(!_0x3cb79d['query']['hasOwnProperty'](_0xa53a('0x3a'))){_0x15a860['limit']=qs[_0xa53a('0x1f')](_0x3cb79d['query'][_0xa53a('0x1f')]);_0x15a860[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x3cb79d[_0xa53a('0x32')]['offset']);}return _0x2b5c2d['getBlackLists'](_0x15a860);}})[_0xa53a('0x25')](function(_0x5d7e51){if(_0x5d7e51){return _0x5d7e51?{'count':_0x1aa738,'rows':_0x5d7e51}:null;}})[_0xa53a('0x25')](respondWithResult(_0x226e59,null))[_0xa53a('0x48')](handleError(_0x226e59,null));};exports[_0xa53a('0x8f')]=function(_0x367414,_0x2d7f1c,_0x50ee18){var _0x1bef52,_0x2d6cdd;var _0x457ebb=[];var _0x5c61c5=moment()[_0xa53a('0x90')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa53a('0x45')]['find']({'where':{'id':_0x367414[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x2d7f1c,null))[_0xa53a('0x25')](function(_0x5ee541){if(_0x5ee541){_0x2d6cdd=_0x5ee541;return _0x5ee541[_0xa53a('0x8f')](_0x367414[_0xa53a('0x4d')][_0xa53a('0x68')],_[_0xa53a('0x57')](_0x367414[_0xa53a('0x4d')],['ids','id'])||{});}return null;})[_0xa53a('0x69')](function(_0x340371){var _0x4d63de;var _0x599b17;_0x1bef52=_0x340371||[];var _0x4142f5=[];if(_0x340371){for(var _0x28dbf4=0x0;_0x28dbf4<_0x340371['length'];_0x28dbf4+=0x1){var _0x29a129=_0x340371[_0x28dbf4][_0xa53a('0x26')]({'plain':!![]});_0x4d63de=squel['insert']()[_0xa53a('0x6c')](_0xa53a('0x91'))[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel['select']()[_0xa53a('0x72')]('phone',_0xa53a('0x7d'))[_0xa53a('0x72')]('id','ContactId')[_0xa53a('0x72')](_0x29a129[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))[_0xa53a('0x72')](_0x367414[_0xa53a('0x5a')]['id']['toString'](),_0xa53a('0x5e'))[_0xa53a('0x72')](_0xa53a('0x73'),'createdAt')['field']('NOW()','updatedAt')[_0xa53a('0x76')](_0xa53a('0x77'))['where'](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x29a129[_0xa53a('0x74')][_0xa53a('0x75')]())[_0xa53a('0x3e')](_0xa53a('0x92')))[_0xa53a('0x75')]();_0x4142f5['push'](db[_0xa53a('0x8b')][_0xa53a('0x32')](_0x4d63de));}return BPromise[_0xa53a('0x8c')](_0x4142f5);}})['then'](function(){return _0x1bef52;})[_0xa53a('0x25')](respondWithResult(_0x2d7f1c,null))[_0xa53a('0x48')](handleError(_0x2d7f1c,null));};exports['removeBlackLists']=function(_0x1732fd,_0xb0a044,_0x4d3e55){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x1732fd[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb0a044,null))[_0xa53a('0x25')](function(_0x48f3c8){if(_0x48f3c8){return _0x48f3c8[_0xa53a('0x93')](_0x1732fd[_0xa53a('0x32')][_0xa53a('0x68')]);}})[_0xa53a('0x25')](function(_0x536871){if(_0x536871){return db[_0xa53a('0x64')]['destroy']({'where':{'ListId':_0x1732fd[_0xa53a('0x32')]['ids'],'CampaignId':_0x1732fd[_0xa53a('0x5a')]['id']}})['then'](function(){return _0x536871;});}})[_0xa53a('0x25')](respondWithStatusCode(_0xb0a044,null))[_0xa53a('0x48')](handleError(_0xb0a044,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 6c6542d..2e8581d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x592ad2,_0x55f950){var _0x4e0139=function(_0x138688){while(--_0x138688){_0x592ad2['push'](_0x592ad2['shift']());}};_0x4e0139(++_0x55f950);}(_0x7a54,0x106));var _0x47a5=function(_0x1eb93a,_0x27f136){_0x1eb93a=_0x1eb93a-0x0;var _0x33f1ad=_0x7a54[_0x1eb93a];return _0x33f1ad;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 8708704..72700ef 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 _0x2e31=['error','code','message','GetCampaign','Campaign','raw','options','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x178f22,_0x197f05){var _0x561380=function(_0x50fd69){while(--_0x50fd69){_0x178f22['push'](_0x178f22['shift']());}};_0x561380(++_0x197f05);}(_0x2e31,0x145));var _0x12e3=function(_0x180c15,_0x2bc8c6){_0x180c15=_0x180c15-0x0;var _0x255632=_0x2e31[_0x180c15];return _0x255632;};'use strict';var _=require(_0x12e3('0x0'));var util=require(_0x12e3('0x1'));var moment=require(_0x12e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x12e3('0x3'));var fs=require('fs');var Redis=require(_0x12e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12e3('0x5'))(_0x12e3('0x6'));var config=require(_0x12e3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12e3('0x8')][_0x12e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5aefcf,_0x5f056f,_0x37f287){return new BPromise(function(_0x403cc5,_0x31e2cf){return client[_0x12e3('0xa')](_0x5aefcf,_0x37f287)['then'](function(_0x438c7e){logger[_0x12e3('0xb')](_0x12e3('0xc'),_0x5f056f,'request\x20sent');logger['debug'](_0x12e3('0xd'),_0x5f056f,_0x12e3('0xe'),JSON[_0x12e3('0xf')](_0x438c7e));if(_0x438c7e[_0x12e3('0x10')]){if(_0x438c7e[_0x12e3('0x10')][_0x12e3('0x11')]===0x1f4){logger[_0x12e3('0x10')](_0x12e3('0xc'),_0x5f056f,_0x438c7e[_0x12e3('0x10')][_0x12e3('0x12')]);return _0x31e2cf(_0x438c7e[_0x12e3('0x10')][_0x12e3('0x12')]);}logger['error'](_0x12e3('0xc'),_0x5f056f,_0x438c7e[_0x12e3('0x10')][_0x12e3('0x12')]);return _0x403cc5(_0x438c7e['error'][_0x12e3('0x12')]);}else{logger[_0x12e3('0xb')]('Campaign,\x20%s,\x20%s',_0x5f056f,'request\x20sent');_0x403cc5(_0x438c7e['result'][_0x12e3('0x12')]);}})['catch'](function(_0x2f26b1){logger[_0x12e3('0x10')](_0x12e3('0xc'),_0x5f056f,_0x2f26b1);_0x31e2cf(_0x2f26b1);});});}exports[_0x12e3('0x13')]=function(_0x211c6a){var _0x2041e9=this;return new Promise(function(_0x5a63c8,_0x77ad03){return db[_0x12e3('0x14')]['findAll']({'raw':_0x211c6a['options']?_0x211c6a['options'][_0x12e3('0x15')]===undefined?!![]:![]:!![],'where':_0x211c6a['options']?_0x211c6a[_0x12e3('0x16')][_0x12e3('0x17')]||null:null,'attributes':_0x211c6a['options']?_0x211c6a['options'][_0x12e3('0x18')]||null:null,'limit':_0x211c6a[_0x12e3('0x16')]?_0x211c6a[_0x12e3('0x16')][_0x12e3('0x19')]||null:null,'include':_0x211c6a['options']?_0x211c6a['options'][_0x12e3('0x1a')]?_[_0x12e3('0x1b')](_0x211c6a[_0x12e3('0x16')][_0x12e3('0x1a')],function(_0x2cf78a){return{'model':db[_0x2cf78a['model']],'as':_0x2cf78a['as'],'attributes':_0x2cf78a[_0x12e3('0x18')],'include':_0x2cf78a[_0x12e3('0x1a')]?_[_0x12e3('0x1b')](_0x2cf78a[_0x12e3('0x1a')],function(_0x43a59f){return{'model':db[_0x43a59f[_0x12e3('0x1c')]],'as':_0x43a59f['as'],'attributes':_0x43a59f['attributes'],'include':_0x43a59f[_0x12e3('0x1a')]?_[_0x12e3('0x1b')](_0x43a59f[_0x12e3('0x1a')],function(_0x42765f){return{'model':db[_0x42765f['model']],'as':_0x42765f['as'],'attributes':_0x42765f[_0x12e3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x12e3('0x1d')](function(_0x2293ec){logger['info'](_0x12e3('0x13'),_0x211c6a);logger[_0x12e3('0x1e')](_0x12e3('0x13'),_0x211c6a,JSON[_0x12e3('0xf')](_0x2293ec));_0x5a63c8(_0x2293ec);})['catch'](function(_0x342ad2){logger[_0x12e3('0x10')](_0x12e3('0x13'),_0x342ad2['message'],_0x211c6a);_0x77ad03(_0x2041e9[_0x12e3('0x10')](0x1f4,_0x342ad2['message']));});});};
\ No newline at end of file
+var _0xe062=['request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','info','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xe062,0xd5));var _0x2e06=function(_0xac93e6,_0x387ad9){_0xac93e6=_0xac93e6-0x0;var _0x333dde=_0xe062[_0xac93e6];return _0x333dde;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var moment=require('moment');var BPromise=require(_0x2e06('0x2'));var rs=require(_0x2e06('0x3'));var fs=require('fs');var Redis=require(_0x2e06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e06('0x5'))(_0x2e06('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e06('0x7')][_0x2e06('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52bf0a,_0x5747de,_0x255317){return new BPromise(function(_0x31645b,_0x8ede0e){return client[_0x2e06('0x9')](_0x52bf0a,_0x255317)[_0x2e06('0xa')](function(_0x2a2ee4){logger['info']('Campaign,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));logger[_0x2e06('0xc')](_0x2e06('0xd'),_0x5747de,'request\x20sent',JSON[_0x2e06('0xe')](_0x2a2ee4));if(_0x2a2ee4[_0x2e06('0xf')]){if(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x10')]===0x1f4){logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')]['message']);return _0x8ede0e(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);return _0x31645b(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}else{logger[_0x2e06('0x13')]('Campaign,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));_0x31645b(_0x2a2ee4[_0x2e06('0x14')][_0x2e06('0x12')]);}})[_0x2e06('0x15')](function(_0x41d1fc){logger[_0x2e06('0xf')](_0x2e06('0x11'),_0x5747de,_0x41d1fc);_0x8ede0e(_0x41d1fc);});});}exports[_0x2e06('0x16')]=function(_0x1418e4){var _0x4fd048=this;return new Promise(function(_0x209942,_0x45052c){return db['Campaign'][_0x2e06('0x17')]({'raw':_0x1418e4[_0x2e06('0x18')]?_0x1418e4[_0x2e06('0x18')][_0x2e06('0x19')]===undefined?!![]:![]:!![],'where':_0x1418e4[_0x2e06('0x18')]?_0x1418e4[_0x2e06('0x18')][_0x2e06('0x1a')]||null:null,'attributes':_0x1418e4[_0x2e06('0x18')]?_0x1418e4[_0x2e06('0x18')][_0x2e06('0x1b')]||null:null,'limit':_0x1418e4[_0x2e06('0x18')]?_0x1418e4[_0x2e06('0x18')][_0x2e06('0x1c')]||null:null,'include':_0x1418e4[_0x2e06('0x18')]?_0x1418e4[_0x2e06('0x18')][_0x2e06('0x1d')]?_[_0x2e06('0x1e')](_0x1418e4[_0x2e06('0x18')]['include'],function(_0x21eea1){return{'model':db[_0x21eea1[_0x2e06('0x1f')]],'as':_0x21eea1['as'],'attributes':_0x21eea1[_0x2e06('0x1b')],'include':_0x21eea1[_0x2e06('0x1d')]?_[_0x2e06('0x1e')](_0x21eea1[_0x2e06('0x1d')],function(_0x73d502){return{'model':db[_0x73d502[_0x2e06('0x1f')]],'as':_0x73d502['as'],'attributes':_0x73d502[_0x2e06('0x1b')],'include':_0x73d502['include']?_[_0x2e06('0x1e')](_0x73d502[_0x2e06('0x1d')],function(_0xdcb6f8){return{'model':db[_0xdcb6f8[_0x2e06('0x1f')]],'as':_0xdcb6f8['as'],'attributes':_0xdcb6f8[_0x2e06('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x455bf3){logger['info'](_0x2e06('0x16'),_0x1418e4);logger[_0x2e06('0xc')]('GetCampaign',_0x1418e4,JSON[_0x2e06('0xe')](_0x455bf3));_0x209942(_0x455bf3);})[_0x2e06('0x15')](function(_0x3ff289){logger['error']('GetCampaign',_0x3ff289[_0x2e06('0x12')],_0x1418e4);_0x45052c(_0x4fd048[_0x2e06('0xf')](0x1f4,_0x3ff289[_0x2e06('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 11161b9..ff79a92 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 _0xfb10=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','post','create','/:id/clone','clone','/:id/blacklists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3f71aa,_0x49508b){var _0x37bfa1=function(_0x187906){while(--_0x187906){_0x3f71aa['push'](_0x3f71aa['shift']());}};_0x37bfa1(++_0x49508b);}(_0xfb10,0x13c));var _0x0fb1=function(_0xf74e23,_0x39108d){_0xf74e23=_0xf74e23-0x0;var _0xa43443=_0xfb10[_0xf74e23];return _0xa43443;};'use strict';var multer=require(_0x0fb1('0x0'));var util=require(_0x0fb1('0x1'));var path=require(_0x0fb1('0x2'));var timeout=require(_0x0fb1('0x3'));var express=require(_0x0fb1('0x4'));var router=express[_0x0fb1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0fb1('0x6'));var interaction=require(_0x0fb1('0x7'));var config=require(_0x0fb1('0x8'));var controller=require('./campaign.controller');router[_0x0fb1('0x9')]('/',auth[_0x0fb1('0xa')](),controller[_0x0fb1('0xb')]);router['get'](_0x0fb1('0xc'),auth[_0x0fb1('0xa')](),controller[_0x0fb1('0xd')]);router[_0x0fb1('0x9')]('/:id/hoppers',auth[_0x0fb1('0xa')](),controller[_0x0fb1('0xe')]);router['get'](_0x0fb1('0xf'),auth['isAuthenticated'](),controller[_0x0fb1('0x10')]);router[_0x0fb1('0x9')](_0x0fb1('0x11'),auth[_0x0fb1('0xa')](),controller[_0x0fb1('0x12')]);router['get'](_0x0fb1('0x13'),auth[_0x0fb1('0xa')](),controller['getHopperBlacks']);router[_0x0fb1('0x9')](_0x0fb1('0x14'),auth[_0x0fb1('0xa')](),controller[_0x0fb1('0x15')]);router[_0x0fb1('0x9')]('/:id/blacklists',auth[_0x0fb1('0xa')](),controller['getBlackLists']);router[_0x0fb1('0x16')]('/',auth[_0x0fb1('0xa')](),controller[_0x0fb1('0x17')]);router[_0x0fb1('0x16')](_0x0fb1('0x18'),auth[_0x0fb1('0xa')](),controller[_0x0fb1('0x19')]);router[_0x0fb1('0x16')]('/:id/lists',auth[_0x0fb1('0xa')](),controller['addLists']);router[_0x0fb1('0x16')](_0x0fb1('0x1a'),auth[_0x0fb1('0xa')](),controller['addBlackLists']);router[_0x0fb1('0x1b')](_0x0fb1('0xc'),auth['isAuthenticated'](),controller[_0x0fb1('0x1c')]);router[_0x0fb1('0x1d')]('/:id',auth[_0x0fb1('0xa')](),controller['destroy']);router[_0x0fb1('0x1d')](_0x0fb1('0x14'),auth[_0x0fb1('0xa')](),controller[_0x0fb1('0x1e')]);router['delete'](_0x0fb1('0x1a'),auth[_0x0fb1('0xa')](),controller[_0x0fb1('0x1f')]);module[_0x0fb1('0x20')]=router;
\ No newline at end of file
+var _0x8ff3=['clone','/:id/lists','addLists','addBlackLists','update','delete','destroy','removeLists','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','post'];(function(_0x4348b4,_0x2c2ccc){var _0xeb68d4=function(_0x1b4489){while(--_0x1b4489){_0x4348b4['push'](_0x4348b4['shift']());}};_0xeb68d4(++_0x2c2ccc);}(_0x8ff3,0x1bb));var _0x38ff=function(_0xea46d,_0x254082){_0xea46d=_0xea46d-0x0;var _0x1fa4c5=_0x8ff3[_0xea46d];return _0x1fa4c5;};'use strict';var multer=require('multer');var util=require(_0x38ff('0x0'));var path=require('path');var timeout=require(_0x38ff('0x1'));var express=require(_0x38ff('0x2'));var router=express[_0x38ff('0x3')]();var fs_extra=require(_0x38ff('0x4'));var auth=require(_0x38ff('0x5'));var interaction=require(_0x38ff('0x6'));var config=require(_0x38ff('0x7'));var controller=require('./campaign.controller');router[_0x38ff('0x8')]('/',auth[_0x38ff('0x9')](),controller[_0x38ff('0xa')]);router[_0x38ff('0x8')](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0xc')]);router[_0x38ff('0x8')](_0x38ff('0xd'),auth[_0x38ff('0x9')](),controller[_0x38ff('0xe')]);router[_0x38ff('0x8')](_0x38ff('0xf'),auth['isAuthenticated'](),controller[_0x38ff('0x10')]);router[_0x38ff('0x8')](_0x38ff('0x11'),auth[_0x38ff('0x9')](),controller['getHopperFinals']);router[_0x38ff('0x8')](_0x38ff('0x12'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x13')]);router[_0x38ff('0x8')]('/:id/lists',auth[_0x38ff('0x9')](),controller['getLists']);router[_0x38ff('0x8')](_0x38ff('0x14'),auth[_0x38ff('0x9')](),controller['getBlackLists']);router[_0x38ff('0x15')]('/',auth[_0x38ff('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x38ff('0x9')](),controller[_0x38ff('0x16')]);router[_0x38ff('0x15')](_0x38ff('0x17'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x18')]);router[_0x38ff('0x15')](_0x38ff('0x14'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x19')]);router['put'](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x1a')]);router[_0x38ff('0x1b')](_0x38ff('0xb'),auth[_0x38ff('0x9')](),controller[_0x38ff('0x1c')]);router[_0x38ff('0x1b')](_0x38ff('0x17'),auth['isAuthenticated'](),controller[_0x38ff('0x1d')]);router['delete'](_0x38ff('0x14'),auth[_0x38ff('0x9')](),controller['removeBlackLists']);module[_0x38ff('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 9c82dc4..96c498f 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 _0xc33b=['exports','STRING','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xc33b,0x18e));var _0xbc33=function(_0x298af3,_0x126792){_0x298af3=_0x298af3-0x0;var _0x12ab2d=_0xc33b[_0x298af3];return _0x12ab2d;};'use strict';var Sequelize=require(_0xbc33('0x0'));module[_0xbc33('0x1')]={'key':{'type':Sequelize[_0xbc33('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xbc33('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbc33('0x2')]},'name':{'type':Sequelize[_0xbc33('0x4')],'get':function(){return this[_0xbc33('0x5')](_0xbc33('0x6'));}}};
\ No newline at end of file
+var _0x02b5=['exports','STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x33f9bf,_0x2bb19f){var _0x563569=function(_0xaf83bf){while(--_0xaf83bf){_0x33f9bf['push'](_0x33f9bf['shift']());}};_0x563569(++_0x2bb19f);}(_0x02b5,0xd7));var _0x502b=function(_0x69f6e7,_0x26b73e){_0x69f6e7=_0x69f6e7-0x0;var _0x135a2d=_0x02b5[_0x69f6e7];return _0x135a2d;};'use strict';var Sequelize=require(_0x502b('0x0'));module[_0x502b('0x1')]={'key':{'type':Sequelize[_0x502b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x502b('0x3')],'length':_0x502b('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x502b('0x2')]},'name':{'type':Sequelize[_0x502b('0x5')],'get':function(){return this[_0x502b('0x6')](_0x502b('0x7'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index ac9fef7..23f1dd0 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 _0x2b1e=['filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','CannedAnswer','includeAll','rows','catch','show','params','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','get','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','jsforce','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','CannedAnswers','UserProfileResource','error','name','map','rawAttributes','type','model','keys'];(function(_0x36bd64,_0x588653){var _0x3da4c3=function(_0x18ddba){while(--_0x18ddba){_0x36bd64['push'](_0x36bd64['shift']());}};_0x3da4c3(++_0x588653);}(_0x2b1e,0xc3));var _0xe2b1=function(_0x11486a,_0x51bfa1){_0x11486a=_0x11486a-0x0;var _0x27ec65=_0x2b1e[_0x11486a];return _0x27ec65;};'use strict';var emlformat=require(_0xe2b1('0x0'));var rimraf=require(_0xe2b1('0x1'));var zipdir=require(_0xe2b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2b1('0x3'));var moment=require(_0xe2b1('0x4'));var BPromise=require(_0xe2b1('0x5'));var Mustache=require(_0xe2b1('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe2b1('0x7'));var csv=require('to-csv');var ejs=require(_0xe2b1('0x8'));var fs=require('fs');var fs_extra=require(_0xe2b1('0x9'));var _=require(_0xe2b1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe2b1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe2b1('0xc'));var querystring=require('querystring');var Papa=require(_0xe2b1('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2b1('0xe'));var hardwareService=require(_0xe2b1('0xf'));var logger=require(_0xe2b1('0x10'))(_0xe2b1('0x11'));var utils=require(_0xe2b1('0x12'));var config=require(_0xe2b1('0x13'));var licenseUtil=require(_0xe2b1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6d0e,_0x476775){_0x476775=_0x476775||0xcc;return function(_0x5b5232){if(_0x5b5232){return _0x4c6d0e[_0xe2b1('0x15')](_0x476775);}return _0x4c6d0e[_0xe2b1('0x16')](_0x476775)[_0xe2b1('0x17')]();};}function respondWithResult(_0x4a7ec1,_0x8db311){_0x8db311=_0x8db311||0xc8;return function(_0x279221){if(_0x279221){return _0x4a7ec1['status'](_0x8db311)[_0xe2b1('0x18')](_0x279221);}};}function respondWithFilteredResult(_0x136738,_0xfb5916){return function(_0x15f351){if(_0x15f351){var _0x540137=typeof _0xfb5916[_0xe2b1('0x19')]===_0xe2b1('0x1a')&&typeof _0xfb5916[_0xe2b1('0x1b')]===_0xe2b1('0x1a');var _0x2e02fb=_0x15f351[_0xe2b1('0x1c')];var _0x510c88=_0x540137?0x0:_0xfb5916[_0xe2b1('0x19')];var _0x40bfef=_0x540137?_0x15f351[_0xe2b1('0x1c')]:_0xfb5916['offset']+_0xfb5916[_0xe2b1('0x1b')];var _0x275793;if(_0x40bfef>=_0x2e02fb){_0x40bfef=_0x2e02fb;_0x275793=0xc8;}else{_0x275793=0xce;}_0x136738['status'](_0x275793);return _0x136738[_0xe2b1('0x1d')](_0xe2b1('0x1e'),_0x510c88+'-'+_0x40bfef+'/'+_0x2e02fb)[_0xe2b1('0x18')](_0x15f351);}return null;};}function patchUpdates(_0x32422d){return function(_0x381edc){try{jsonpatch[_0xe2b1('0x1f')](_0x381edc,_0x32422d,!![]);}catch(_0x188ff8){return BPromise[_0xe2b1('0x20')](_0x188ff8);}return _0x381edc[_0xe2b1('0x21')]();};}function saveUpdates(_0x2223c9,_0x446b6d){return function(_0x409189){if(_0x409189){return _0x409189['update'](_0x2223c9)['then'](function(_0x1f8955){return _0x1f8955;});}return null;};}function removeEntity(_0x123250,_0xaf7ea0){return function(_0x1d32f0){if(_0x1d32f0){return _0x1d32f0[_0xe2b1('0x22')]()[_0xe2b1('0x23')](function(){var _0x33fa4f=_0x1d32f0['get']({'plain':!![]});var _0x3a41dc=_0xe2b1('0x24');return db[_0xe2b1('0x25')]['destroy']({'where':{'type':_0x3a41dc,'resourceId':_0x33fa4f['id']}})['then'](function(){return _0x1d32f0;});})[_0xe2b1('0x23')](function(){_0x123250[_0xe2b1('0x16')](0xcc)[_0xe2b1('0x17')]();});}};}function handleEntityNotFound(_0x3bc2f6,_0x3f423f){return function(_0x10936f){if(!_0x10936f){_0x3bc2f6['sendStatus'](0x194);}return _0x10936f;};}function handleError(_0x4fba7d,_0x5195f3){_0x5195f3=_0x5195f3||0x1f4;return function(_0x1b0d26){logger[_0xe2b1('0x26')](_0x1b0d26['stack']);if(_0x1b0d26['name']){delete _0x1b0d26[_0xe2b1('0x27')];}_0x4fba7d['status'](_0x5195f3)['send'](_0x1b0d26);};}exports['index']=function(_0xf798a7,_0x1cbcf2){var _0x4ea145={},_0x4b3291={},_0x9a0e6c={'count':0x0,'rows':[]};var _0x5b47cc=_[_0xe2b1('0x28')](db['CannedAnswer'][_0xe2b1('0x29')],function(_0x3fbb3){return{'name':_0x3fbb3['fieldName'],'type':_0x3fbb3[_0xe2b1('0x2a')]['key']};});_0x4b3291[_0xe2b1('0x2b')]=_[_0xe2b1('0x28')](_0x5b47cc,_0xe2b1('0x27'));_0x4b3291['query']=_[_0xe2b1('0x2c')](_0xf798a7['query']);_0x4b3291[_0xe2b1('0x2d')]=_[_0xe2b1('0x2e')](_0x4b3291['model'],_0x4b3291[_0xe2b1('0x2f')]);_0x4ea145[_0xe2b1('0x30')]=_['intersection'](_0x4b3291['model'],qs[_0xe2b1('0x31')](_0xf798a7[_0xe2b1('0x2f')]['fields']));_0x4ea145[_0xe2b1('0x30')]=_0x4ea145[_0xe2b1('0x30')][_0xe2b1('0x32')]?_0x4ea145[_0xe2b1('0x30')]:_0x4b3291[_0xe2b1('0x2b')];if(!_0xf798a7[_0xe2b1('0x2f')]['hasOwnProperty'](_0xe2b1('0x33'))){_0x4ea145[_0xe2b1('0x1b')]=qs[_0xe2b1('0x1b')](_0xf798a7['query'][_0xe2b1('0x1b')]);_0x4ea145[_0xe2b1('0x19')]=qs['offset'](_0xf798a7['query'][_0xe2b1('0x19')]);}_0x4ea145[_0xe2b1('0x34')]=qs['sort'](_0xf798a7[_0xe2b1('0x2f')][_0xe2b1('0x35')]);_0x4ea145[_0xe2b1('0x36')]=qs[_0xe2b1('0x2d')](_[_0xe2b1('0x37')](_0xf798a7[_0xe2b1('0x2f')],_0x4b3291['filters']),_0x5b47cc);if(_0xf798a7[_0xe2b1('0x2f')]['filter']){_0x4ea145[_0xe2b1('0x36')]=_[_0xe2b1('0x38')](_0x4ea145[_0xe2b1('0x36')],{'$or':[{'key':{'$like':'%'+_0xf798a7[_0xe2b1('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0xf798a7[_0xe2b1('0x2f')]['filter']+'%'}}]});}_0x4ea145=_[_0xe2b1('0x38')]({},_0x4ea145,_0xf798a7[_0xe2b1('0x39')]);var _0x33561d={'where':_0x4ea145[_0xe2b1('0x36')]};return db[_0xe2b1('0x3a')][_0xe2b1('0x1c')](_0x33561d)[_0xe2b1('0x23')](function(_0x272787){_0x9a0e6c[_0xe2b1('0x1c')]=_0x272787;if(_0xf798a7[_0xe2b1('0x2f')][_0xe2b1('0x3b')]){_0x4ea145['include']=[{'all':!![]}];}return db[_0xe2b1('0x3a')]['findAll'](_0x4ea145);})['then'](function(_0x237fbf){_0x9a0e6c[_0xe2b1('0x3c')]=_0x237fbf;return _0x9a0e6c;})[_0xe2b1('0x23')](respondWithFilteredResult(_0x1cbcf2,_0x4ea145))[_0xe2b1('0x3d')](handleError(_0x1cbcf2,null));};exports[_0xe2b1('0x3e')]=function(_0x432a78,_0xdcfdd0){var _0x6b5626={'raw':!![],'where':{'id':_0x432a78[_0xe2b1('0x3f')]['id']}},_0x165927={};_0x165927['model']=_['keys'](db[_0xe2b1('0x3a')][_0xe2b1('0x29')]);_0x165927[_0xe2b1('0x2f')]=_['keys'](_0x432a78[_0xe2b1('0x2f')]);_0x165927['filters']=_[_0xe2b1('0x2e')](_0x165927[_0xe2b1('0x2b')],_0x165927[_0xe2b1('0x2f')]);_0x6b5626[_0xe2b1('0x30')]=_[_0xe2b1('0x2e')](_0x165927[_0xe2b1('0x2b')],qs[_0xe2b1('0x31')](_0x432a78[_0xe2b1('0x2f')][_0xe2b1('0x31')]));_0x6b5626[_0xe2b1('0x30')]=_0x6b5626[_0xe2b1('0x30')]['length']?_0x6b5626[_0xe2b1('0x30')]:_0x165927[_0xe2b1('0x2b')];if(_0x432a78[_0xe2b1('0x2f')][_0xe2b1('0x3b')]){_0x6b5626['include']=[{'all':!![]}];}_0x6b5626=_['merge']({},_0x6b5626,_0x432a78['options']);return db[_0xe2b1('0x3a')][_0xe2b1('0x40')](_0x6b5626)[_0xe2b1('0x23')](handleEntityNotFound(_0xdcfdd0,null))[_0xe2b1('0x23')](respondWithResult(_0xdcfdd0,null))[_0xe2b1('0x3d')](handleError(_0xdcfdd0,null));};exports['update']=function(_0x54638f,_0x1ce3b7){if(_0x54638f[_0xe2b1('0x41')]['id']){delete _0x54638f['body']['id'];}return db[_0xe2b1('0x3a')]['find']({'where':{'id':_0x54638f[_0xe2b1('0x3f')]['id']}})[_0xe2b1('0x23')](handleEntityNotFound(_0x1ce3b7,null))[_0xe2b1('0x23')](saveUpdates(_0x54638f[_0xe2b1('0x41')],null))[_0xe2b1('0x23')](respondWithResult(_0x1ce3b7,null))['catch'](handleError(_0x1ce3b7,null));};exports[_0xe2b1('0x22')]=function(_0x4c3170,_0x18803e){return db[_0xe2b1('0x3a')][_0xe2b1('0x40')]({'where':{'id':_0x4c3170['params']['id']}})['then'](handleEntityNotFound(_0x18803e,null))['then'](removeEntity(_0x18803e,null))[_0xe2b1('0x3d')](handleError(_0x18803e,null));};exports['create']=function(_0x101cec,_0x1ad455){var _0x2ba19e={'key':_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x42')]};if(_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x43')]){_0x2ba19e[_0xe2b1('0x43')]=_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x43')];}else if(_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x44')]){_0x2ba19e[_0xe2b1('0x44')]=_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x44')];}else if(_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x45')]){_0x2ba19e[_0xe2b1('0x45')]=_0x101cec[_0xe2b1('0x41')][_0xe2b1('0x45')];}else if(_0x101cec[_0xe2b1('0x41')]['ChatWebsiteId']){_0x2ba19e['ChatWebsiteId']=_0x101cec['body'][_0xe2b1('0x46')];}return db[_0xe2b1('0x3a')][_0xe2b1('0x40')]({'where':_0x2ba19e})[_0xe2b1('0x23')](function(_0x2aa5cf){if(_0x2aa5cf){throw new db[(_0xe2b1('0x47'))][(_0xe2b1('0x48'))](_0xe2b1('0x49'));}return db[_0xe2b1('0x3a')][_0xe2b1('0x4a')](_0x101cec[_0xe2b1('0x41')]);})['then'](function(_0x4070dc){var _0x1626ad=_0x101cec['user'][_0xe2b1('0x4b')]({'plain':!![]});if(!_0x1626ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1626ad['role']===_0xe2b1('0x4c')){var _0x3ec7b0=_0x4070dc[_0xe2b1('0x4b')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe2b1('0x24'),'userProfileId':_0x1626ad[_0xe2b1('0x4d')]},'raw':!![]})[_0xe2b1('0x23')](function(_0x4b901d){if(_0x4b901d&&_0x4b901d[_0xe2b1('0x4e')]===0x0){return db['UserProfileResource'][_0xe2b1('0x4a')]({'name':_0x3ec7b0['name'],'resourceId':_0x3ec7b0['id'],'type':_0x4b901d[_0xe2b1('0x27')],'sectionId':_0x4b901d['id']},{})[_0xe2b1('0x23')](function(){return _0x4070dc;});}else{return _0x4070dc;}})[_0xe2b1('0x3d')](function(_0x5292b5){logger[_0xe2b1('0x26')](_0xe2b1('0x4f'),_0x5292b5);throw _0x5292b5;});}return _0x4070dc;})[_0xe2b1('0x23')](respondWithResult(_0x1ad455,0xc9))['catch'](handleError(_0x1ad455,null));};
\ No newline at end of file
+var _0xd52d=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','get','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','params','keys','catch','body','find','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xd52d,0x95));var _0xdd52=function(_0x3120d3,_0x3350f8){_0x3120d3=_0x3120d3-0x0;var _0x38ce5d=_0xd52d[_0x3120d3];return _0x38ce5d;};'use strict';var emlformat=require(_0xdd52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require(_0xdd52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x4'));var util=require(_0xdd52('0x5'));var path=require('path');var sox=require(_0xdd52('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd52('0x7'));var _=require(_0xdd52('0x8'));var squel=require(_0xdd52('0x9'));var crypto=require(_0xdd52('0xa'));var jsforce=require(_0xdd52('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdd52('0xc'));var querystring=require(_0xdd52('0xd'));var Papa=require(_0xdd52('0xe'));var Redis=require(_0xdd52('0xf'));var authService=require(_0xdd52('0x10'));var qs=require(_0xdd52('0x11'));var as=require(_0xdd52('0x12'));var hardwareService=require(_0xdd52('0x13'));var logger=require('../../config/logger')(_0xdd52('0x14'));var utils=require(_0xdd52('0x15'));var config=require(_0xdd52('0x16'));var licenseUtil=require(_0xdd52('0x17'));var db=require(_0xdd52('0x18'))['db'];function respondWithStatusCode(_0x36952f,_0x1da86f){_0x1da86f=_0x1da86f||0xcc;return function(_0x3564ac){if(_0x3564ac){return _0x36952f[_0xdd52('0x19')](_0x1da86f);}return _0x36952f[_0xdd52('0x1a')](_0x1da86f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x4cc74b,_0x417123){_0x417123=_0x417123||0xc8;return function(_0x5a649e){if(_0x5a649e){return _0x4cc74b[_0xdd52('0x1a')](_0x417123)[_0xdd52('0x1c')](_0x5a649e);}};}function respondWithFilteredResult(_0xb9e2c8,_0x28d9d9){return function(_0x4e9d32){if(_0x4e9d32){var _0x2d4d53=typeof _0x28d9d9[_0xdd52('0x1d')]==='undefined'&&typeof _0x28d9d9[_0xdd52('0x1e')]===_0xdd52('0x1f');var _0x13db77=_0x4e9d32[_0xdd52('0x20')];var _0x10b757=_0x2d4d53?0x0:_0x28d9d9[_0xdd52('0x1d')];var _0x5030c8=_0x2d4d53?_0x4e9d32[_0xdd52('0x20')]:_0x28d9d9['offset']+_0x28d9d9[_0xdd52('0x1e')];var _0x5a88ca;if(_0x5030c8>=_0x13db77){_0x5030c8=_0x13db77;_0x5a88ca=0xc8;}else{_0x5a88ca=0xce;}_0xb9e2c8[_0xdd52('0x1a')](_0x5a88ca);return _0xb9e2c8[_0xdd52('0x21')](_0xdd52('0x22'),_0x10b757+'-'+_0x5030c8+'/'+_0x13db77)[_0xdd52('0x1c')](_0x4e9d32);}return null;};}function patchUpdates(_0x23e3d5){return function(_0x258045){try{jsonpatch['apply'](_0x258045,_0x23e3d5,!![]);}catch(_0x33b7a9){return BPromise[_0xdd52('0x23')](_0x33b7a9);}return _0x258045['save']();};}function saveUpdates(_0x44108b,_0x27260d){return function(_0x4d84be){if(_0x4d84be){return _0x4d84be[_0xdd52('0x24')](_0x44108b)['then'](function(_0x4c6baf){return _0x4c6baf;});}return null;};}function removeEntity(_0x3c0a49,_0x17b8d7){return function(_0x4a0cef){if(_0x4a0cef){return _0x4a0cef['destroy']()[_0xdd52('0x25')](function(){var _0x3f7f6e=_0x4a0cef[_0xdd52('0x26')]({'plain':!![]});var _0x554fe5='CannedAnswers';return db['UserProfileResource'][_0xdd52('0x27')]({'where':{'type':_0x554fe5,'resourceId':_0x3f7f6e['id']}})[_0xdd52('0x25')](function(){return _0x4a0cef;});})['then'](function(){_0x3c0a49['status'](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x51ff92,_0x3e63fb){return function(_0x105788){if(!_0x105788){_0x51ff92[_0xdd52('0x19')](0x194);}return _0x105788;};}function handleError(_0x2d0ce6,_0x150aba){_0x150aba=_0x150aba||0x1f4;return function(_0x276b9f){logger[_0xdd52('0x28')](_0x276b9f[_0xdd52('0x29')]);if(_0x276b9f[_0xdd52('0x2a')]){delete _0x276b9f[_0xdd52('0x2a')];}_0x2d0ce6['status'](_0x150aba)[_0xdd52('0x2b')](_0x276b9f);};}exports[_0xdd52('0x2c')]=function(_0x35aeac,_0x48628b){var _0x38ca3b={},_0x4b112f={},_0x36079c={'count':0x0,'rows':[]};var _0x15fca2=_[_0xdd52('0x2d')](db[_0xdd52('0x2e')][_0xdd52('0x2f')],function(_0x14432e){return{'name':_0x14432e[_0xdd52('0x30')],'type':_0x14432e[_0xdd52('0x31')]['key']};});_0x4b112f['model']=_[_0xdd52('0x2d')](_0x15fca2,'name');_0x4b112f[_0xdd52('0x32')]=_['keys'](_0x35aeac['query']);_0x4b112f['filters']=_[_0xdd52('0x33')](_0x4b112f[_0xdd52('0x34')],_0x4b112f[_0xdd52('0x32')]);_0x38ca3b[_0xdd52('0x35')]=_[_0xdd52('0x33')](_0x4b112f[_0xdd52('0x34')],qs['fields'](_0x35aeac['query'][_0xdd52('0x36')]));_0x38ca3b['attributes']=_0x38ca3b[_0xdd52('0x35')][_0xdd52('0x37')]?_0x38ca3b[_0xdd52('0x35')]:_0x4b112f[_0xdd52('0x34')];if(!_0x35aeac[_0xdd52('0x32')][_0xdd52('0x38')](_0xdd52('0x39'))){_0x38ca3b['limit']=qs[_0xdd52('0x1e')](_0x35aeac[_0xdd52('0x32')][_0xdd52('0x1e')]);_0x38ca3b['offset']=qs[_0xdd52('0x1d')](_0x35aeac[_0xdd52('0x32')]['offset']);}_0x38ca3b[_0xdd52('0x3a')]=qs[_0xdd52('0x3b')](_0x35aeac[_0xdd52('0x32')][_0xdd52('0x3b')]);_0x38ca3b[_0xdd52('0x3c')]=qs[_0xdd52('0x3d')](_['pick'](_0x35aeac[_0xdd52('0x32')],_0x4b112f[_0xdd52('0x3d')]),_0x15fca2);if(_0x35aeac[_0xdd52('0x32')][_0xdd52('0x3e')]){_0x38ca3b[_0xdd52('0x3c')]=_[_0xdd52('0x3f')](_0x38ca3b['where'],{'$or':[{'key':{'$like':'%'+_0x35aeac[_0xdd52('0x32')][_0xdd52('0x3e')]+'%'}},{'value':{'$like':'%'+_0x35aeac[_0xdd52('0x32')][_0xdd52('0x3e')]+'%'}}]});}_0x38ca3b=_['merge']({},_0x38ca3b,_0x35aeac[_0xdd52('0x40')]);var _0x1eeca0={'where':_0x38ca3b[_0xdd52('0x3c')]};return db[_0xdd52('0x2e')][_0xdd52('0x20')](_0x1eeca0)[_0xdd52('0x25')](function(_0x13416c){_0x36079c[_0xdd52('0x20')]=_0x13416c;if(_0x35aeac[_0xdd52('0x32')][_0xdd52('0x41')]){_0x38ca3b[_0xdd52('0x42')]=[{'all':!![]}];}return db[_0xdd52('0x2e')][_0xdd52('0x43')](_0x38ca3b);})['then'](function(_0x529426){_0x36079c[_0xdd52('0x44')]=_0x529426;return _0x36079c;})['then'](respondWithFilteredResult(_0x48628b,_0x38ca3b))['catch'](handleError(_0x48628b,null));};exports['show']=function(_0x7d5a62,_0x2a1f09){var _0xe91c15={'raw':!![],'where':{'id':_0x7d5a62[_0xdd52('0x45')]['id']}},_0x508f89={};_0x508f89[_0xdd52('0x34')]=_[_0xdd52('0x46')](db['CannedAnswer'][_0xdd52('0x2f')]);_0x508f89['query']=_['keys'](_0x7d5a62[_0xdd52('0x32')]);_0x508f89[_0xdd52('0x3d')]=_[_0xdd52('0x33')](_0x508f89['model'],_0x508f89[_0xdd52('0x32')]);_0xe91c15[_0xdd52('0x35')]=_['intersection'](_0x508f89[_0xdd52('0x34')],qs[_0xdd52('0x36')](_0x7d5a62['query']['fields']));_0xe91c15[_0xdd52('0x35')]=_0xe91c15['attributes']['length']?_0xe91c15[_0xdd52('0x35')]:_0x508f89[_0xdd52('0x34')];if(_0x7d5a62[_0xdd52('0x32')][_0xdd52('0x41')]){_0xe91c15[_0xdd52('0x42')]=[{'all':!![]}];}_0xe91c15=_['merge']({},_0xe91c15,_0x7d5a62[_0xdd52('0x40')]);return db['CannedAnswer']['find'](_0xe91c15)['then'](handleEntityNotFound(_0x2a1f09,null))[_0xdd52('0x25')](respondWithResult(_0x2a1f09,null))[_0xdd52('0x47')](handleError(_0x2a1f09,null));};exports[_0xdd52('0x24')]=function(_0x2a08b4,_0x47883c){if(_0x2a08b4[_0xdd52('0x48')]['id']){delete _0x2a08b4[_0xdd52('0x48')]['id'];}return db[_0xdd52('0x2e')]['find']({'where':{'id':_0x2a08b4['params']['id']}})[_0xdd52('0x25')](handleEntityNotFound(_0x47883c,null))[_0xdd52('0x25')](saveUpdates(_0x2a08b4['body'],null))['then'](respondWithResult(_0x47883c,null))[_0xdd52('0x47')](handleError(_0x47883c,null));};exports[_0xdd52('0x27')]=function(_0x14716f,_0x7450b4){return db[_0xdd52('0x2e')][_0xdd52('0x49')]({'where':{'id':_0x14716f[_0xdd52('0x45')]['id']}})[_0xdd52('0x25')](handleEntityNotFound(_0x7450b4,null))[_0xdd52('0x25')](removeEntity(_0x7450b4,null))[_0xdd52('0x47')](handleError(_0x7450b4,null));};exports[_0xdd52('0x4a')]=function(_0x184902,_0x39f996){var _0xf91238={'key':_0x184902[_0xdd52('0x48')][_0xdd52('0x4b')]};if(_0x184902['body'][_0xdd52('0x4c')]){_0xf91238['MailAccountId']=_0x184902[_0xdd52('0x48')][_0xdd52('0x4c')];}else if(_0x184902[_0xdd52('0x48')]['SmsAccountId']){_0xf91238[_0xdd52('0x4d')]=_0x184902[_0xdd52('0x48')][_0xdd52('0x4d')];}else if(_0x184902[_0xdd52('0x48')][_0xdd52('0x4e')]){_0xf91238[_0xdd52('0x4e')]=_0x184902['body'][_0xdd52('0x4e')];}else if(_0x184902[_0xdd52('0x48')][_0xdd52('0x4f')]){_0xf91238[_0xdd52('0x4f')]=_0x184902[_0xdd52('0x48')][_0xdd52('0x4f')];}return db['CannedAnswer'][_0xdd52('0x49')]({'where':_0xf91238})['then'](function(_0x590c75){if(_0x590c75){throw new db['Sequelize']['ValidationError'](_0xdd52('0x50'));}return db['CannedAnswer'][_0xdd52('0x4a')](_0x184902[_0xdd52('0x48')]);})[_0xdd52('0x25')](function(_0x31c24a){var _0x2abf54=_0x184902[_0xdd52('0x51')][_0xdd52('0x26')]({'plain':!![]});if(!_0x2abf54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2abf54['role']===_0xdd52('0x51')){var _0x38d31c=_0x31c24a[_0xdd52('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xdd52('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x2abf54[_0xdd52('0x52')]},'raw':!![]})['then'](function(_0x2feb57){if(_0x2feb57&&_0x2feb57[_0xdd52('0x53')]===0x0){return db[_0xdd52('0x54')][_0xdd52('0x4a')]({'name':_0x38d31c[_0xdd52('0x2a')],'resourceId':_0x38d31c['id'],'type':_0x2feb57[_0xdd52('0x2a')],'sectionId':_0x2feb57['id']},{})[_0xdd52('0x25')](function(){return _0x31c24a;});}else{return _0x31c24a;}})['catch'](function(_0x3660c1){logger[_0xdd52('0x28')](_0xdd52('0x55'),_0x3660c1);throw _0x3660c1;});}return _0x31c24a;})['then'](respondWithResult(_0x39f996,0xc9))['catch'](handleError(_0x39f996,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0fc1ca3..594bbd7 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 _0x1daa=['bluebird','request-promise','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x3daeb6,_0xb8cb46){var _0x4d7a95=function(_0x4b6613){while(--_0x4b6613){_0x3daeb6['push'](_0x3daeb6['shift']());}};_0x4d7a95(++_0xb8cb46);}(_0x1daa,0xce));var _0xa1da=function(_0x38651d,_0x5ca1bc){_0x38651d=_0x38651d-0x0;var _0x3f4c9b=_0x1daa[_0x38651d];return _0x3f4c9b;};'use strict';var _=require(_0xa1da('0x0'));var util=require(_0xa1da('0x1'));var logger=require(_0xa1da('0x2'))('api');var moment=require(_0xa1da('0x3'));var BPromise=require(_0xa1da('0x4'));var rp=require(_0xa1da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x8092e9,_0x95cdbb){return _0x8092e9[_0xa1da('0x6')](_0xa1da('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1da('0x8'),'collate':_0xa1da('0x9')});};
\ No newline at end of file
+var _0xc0ec=['define','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x59b889,_0x4b026c){var _0x470d3f=function(_0x52eeb2){while(--_0x52eeb2){_0x59b889['push'](_0x59b889['shift']());}};_0x470d3f(++_0x4b026c);}(_0xc0ec,0x9f));var _0xcc0e=function(_0x597c8e,_0x398a0f){_0x597c8e=_0x597c8e-0x0;var _0xd70119=_0xc0ec[_0x597c8e];return _0xd70119;};'use strict';var _=require(_0xcc0e('0x0'));var util=require(_0xcc0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcc0e('0x2'));var BPromise=require(_0xcc0e('0x3'));var rp=require(_0xcc0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc0e('0x5'));var config=require(_0xcc0e('0x6'));var attributes=require(_0xcc0e('0x7'));module[_0xcc0e('0x8')]=function(_0x189281,_0x418f4b){return _0x189281[_0xcc0e('0x9')]('CannedAnswer',attributes,{'tableName':_0xcc0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc0e('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 710df69..ac06c8a 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(_0x4ec371,_0x3dbc42){var _0x4eb717=function(_0x52e416){while(--_0x52e416){_0x4ec371['push'](_0x4ec371['shift']());}};_0x4eb717(++_0x3dbc42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x1f373b,_0x37360f){var _0x4f7aa5=function(_0x5a3619){while(--_0x5a3619){_0x1f373b['push'](_0x1f373b['shift']());}};_0x4f7aa5(++_0x37360f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 0bed988..18a2be7 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 _0xd589=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x4d85db,_0x5933cb){var _0x11685c=function(_0x3e18d5){while(--_0x3e18d5){_0x4d85db['push'](_0x4d85db['shift']());}};_0x11685c(++_0x5933cb);}(_0xd589,0x80));var _0x9d58=function(_0x5b3df9,_0x4668e4){_0x5b3df9=_0x5b3df9-0x0;var _0x168ac4=_0xd589[_0x5b3df9];return _0x168ac4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d58('0x0'));var timeout=require(_0x9d58('0x1'));var express=require(_0x9d58('0x2'));var router=express[_0x9d58('0x3')]();var fs_extra=require(_0x9d58('0x4'));var auth=require(_0x9d58('0x5'));var interaction=require(_0x9d58('0x6'));var config=require(_0x9d58('0x7'));var controller=require(_0x9d58('0x8'));router['get']('/',auth[_0x9d58('0x9')](),controller[_0x9d58('0xa')]);router[_0x9d58('0xb')](_0x9d58('0xc'),auth[_0x9d58('0x9')](),controller[_0x9d58('0xd')]);router[_0x9d58('0xe')]('/',auth[_0x9d58('0x9')](),controller[_0x9d58('0xf')]);router['put'](_0x9d58('0xc'),auth[_0x9d58('0x9')](),controller[_0x9d58('0x10')]);router[_0x9d58('0x11')](_0x9d58('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x9d58('0x12')]=router;
\ No newline at end of file
+var _0xbbfc=['update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','index','isAuthenticated','show','post','create','put','/:id'];(function(_0x57ad41,_0x8d87ff){var _0x1d4965=function(_0x3a35b6){while(--_0x3a35b6){_0x57ad41['push'](_0x57ad41['shift']());}};_0x1d4965(++_0x8d87ff);}(_0xbbfc,0x1de));var _0xcbbf=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xbbfc[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0xcbbf('0x0'));var util=require(_0xcbbf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbbf('0x2'));var router=express[_0xcbbf('0x3')]();var fs_extra=require(_0xcbbf('0x4'));var auth=require(_0xcbbf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcbbf('0x6'));var controller=require(_0xcbbf('0x7'));router[_0xcbbf('0x8')]('/',auth['isAuthenticated'](),controller[_0xcbbf('0x9')]);router[_0xcbbf('0x8')]('/:id',auth[_0xcbbf('0xa')](),controller[_0xcbbf('0xb')]);router[_0xcbbf('0xc')]('/',auth[_0xcbbf('0xa')](),controller[_0xcbbf('0xd')]);router[_0xcbbf('0xe')](_0xcbbf('0xf'),auth['isAuthenticated'](),controller[_0xcbbf('0x10')]);router[_0xcbbf('0x11')](_0xcbbf('0xf'),auth['isAuthenticated'](),controller[_0xcbbf('0x12')]);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 b60b53f..267da8d 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 _0x5265=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0xb6669a,_0x4e6bac){var _0x734d12=function(_0x23d870){while(--_0x23d870){_0xb6669a['push'](_0xb6669a['shift']());}};_0x734d12(++_0x4e6bac);}(_0x5265,0x10c));var _0x5526=function(_0x4379d5,_0x4c18a0){_0x4379d5=_0x4379d5-0x0;var _0x30cb80=_0x5265[_0x4379d5];return _0x30cb80;};'use strict';var Sequelize=require(_0x5526('0x0'));module[_0x5526('0x1')]={'calldate':{'type':Sequelize[_0x5526('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5526('0x3')]},'dst':{'type':Sequelize[_0x5526('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5526('0x3')]},'dstchannel':{'type':Sequelize[_0x5526('0x3')]},'lastapp':{'type':Sequelize[_0x5526('0x3')]},'lastdata':{'type':Sequelize[_0x5526('0x3')]},'duration':{'type':Sequelize[_0x5526('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5526('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x5526('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5526('0x3')]},'userfield':{'type':Sequelize[_0x5526('0x3')]},'uniqueid':{'type':Sequelize[_0x5526('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x5526('0x3')]},'peeraccount':{'type':Sequelize[_0x5526('0x3')]},'type':{'type':Sequelize[_0x5526('0x3')]},'tag':{'type':Sequelize[_0x5526('0x3')]}};
\ No newline at end of file
+var _0xb5cd=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0xb5cd,0x134));var _0xdb5c=function(_0x3bd305,_0x2de198){_0x3bd305=_0x3bd305-0x0;var _0x4f9dfc=_0xb5cd[_0x3bd305];return _0x4f9dfc;};'use strict';var Sequelize=require(_0xdb5c('0x0'));module[_0xdb5c('0x1')]={'calldate':{'type':Sequelize[_0xdb5c('0x2')],'allowNull':![],'defaultValue':_0xdb5c('0x3')},'clid':{'type':Sequelize[_0xdb5c('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xdb5c('0x4')]},'dcontext':{'type':Sequelize[_0xdb5c('0x4')]},'channel':{'type':Sequelize[_0xdb5c('0x4')]},'dstchannel':{'type':Sequelize[_0xdb5c('0x4')]},'lastapp':{'type':Sequelize[_0xdb5c('0x4')]},'lastdata':{'type':Sequelize[_0xdb5c('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdb5c('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdb5c('0x4')]},'amaflags':{'type':Sequelize[_0xdb5c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdb5c('0x4')]},'linkedid':{'type':Sequelize[_0xdb5c('0x4')]},'sequence':{'type':Sequelize[_0xdb5c('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdb5c('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b7d4a5c..b5cecd4 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 _0x6363=['destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Cdr','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6363,0x13a));var _0x3636=function(_0x163157,_0x53c0dc){_0x163157=_0x163157-0x0;var _0x1e1796=_0x6363[_0x163157];return _0x1e1796;};'use strict';var emlformat=require(_0x3636('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3636('0x1'));var jsonpatch=require(_0x3636('0x2'));var rp=require(_0x3636('0x3'));var moment=require(_0x3636('0x4'));var BPromise=require(_0x3636('0x5'));var Mustache=require(_0x3636('0x6'));var util=require(_0x3636('0x7'));var path=require(_0x3636('0x8'));var sox=require(_0x3636('0x9'));var csv=require(_0x3636('0xa'));var ejs=require(_0x3636('0xb'));var fs=require('fs');var fs_extra=require(_0x3636('0xc'));var _=require(_0x3636('0xd'));var squel=require(_0x3636('0xe'));var crypto=require('crypto');var jsforce=require(_0x3636('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3636('0xa'));var querystring=require(_0x3636('0x10'));var Papa=require(_0x3636('0x11'));var Redis=require(_0x3636('0x12'));var authService=require(_0x3636('0x13'));var qs=require(_0x3636('0x14'));var as=require(_0x3636('0x15'));var hardwareService=require(_0x3636('0x16'));var logger=require(_0x3636('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3636('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3636('0x19'))['db'];function respondWithStatusCode(_0x41ddae,_0x62d6f9){_0x62d6f9=_0x62d6f9||0xcc;return function(_0x13ca35){if(_0x13ca35){return _0x41ddae[_0x3636('0x1a')](_0x62d6f9);}return _0x41ddae[_0x3636('0x1b')](_0x62d6f9)[_0x3636('0x1c')]();};}function respondWithResult(_0x12dfa9,_0x3295ab){_0x3295ab=_0x3295ab||0xc8;return function(_0x7b4b16){if(_0x7b4b16){return _0x12dfa9[_0x3636('0x1b')](_0x3295ab)[_0x3636('0x1d')](_0x7b4b16);}};}function respondWithFilteredResult(_0xcb2aa3,_0x3fc712){return function(_0x23cc34){if(_0x23cc34){var _0x3cbd0d=typeof _0x3fc712[_0x3636('0x1e')]==='undefined'&&typeof _0x3fc712[_0x3636('0x1f')]===_0x3636('0x20');var _0x4aa7fc=_0x23cc34[_0x3636('0x21')];var _0x5aa0ff=_0x3cbd0d?0x0:_0x3fc712['offset'];var _0xae6469=_0x3cbd0d?_0x23cc34[_0x3636('0x21')]:_0x3fc712[_0x3636('0x1e')]+_0x3fc712[_0x3636('0x1f')];var _0xe0e633;if(_0xae6469>=_0x4aa7fc){_0xae6469=_0x4aa7fc;_0xe0e633=0xc8;}else{_0xe0e633=0xce;}_0xcb2aa3[_0x3636('0x1b')](_0xe0e633);return _0xcb2aa3[_0x3636('0x22')](_0x3636('0x23'),_0x5aa0ff+'-'+_0xae6469+'/'+_0x4aa7fc)['json'](_0x23cc34);}return null;};}function patchUpdates(_0x48f598){return function(_0x316930){try{jsonpatch[_0x3636('0x24')](_0x316930,_0x48f598,!![]);}catch(_0x42b271){return BPromise['reject'](_0x42b271);}return _0x316930[_0x3636('0x25')]();};}function saveUpdates(_0xa46471,_0x15a0b3){return function(_0xe34cd9){if(_0xe34cd9){return _0xe34cd9[_0x3636('0x26')](_0xa46471)[_0x3636('0x27')](function(_0x4f5b0e){return _0x4f5b0e;});}return null;};}function removeEntity(_0x517fda,_0x368356){return function(_0x4ee098){if(_0x4ee098){return _0x4ee098['destroy']()[_0x3636('0x27')](function(){_0x517fda['status'](0xcc)[_0x3636('0x1c')]();});}};}function handleEntityNotFound(_0x4c24cf,_0x36f4c5){return function(_0x477c34){if(!_0x477c34){_0x4c24cf[_0x3636('0x1a')](0x194);}return _0x477c34;};}function handleError(_0x201ea1,_0x112b96){_0x112b96=_0x112b96||0x1f4;return function(_0x20ca8b){logger[_0x3636('0x28')](_0x20ca8b[_0x3636('0x29')]);if(_0x20ca8b[_0x3636('0x2a')]){delete _0x20ca8b[_0x3636('0x2a')];}_0x201ea1[_0x3636('0x1b')](_0x112b96)['send'](_0x20ca8b);};}exports[_0x3636('0x2b')]=function(_0x236f54,_0x2d644c){var _0x22b12f={},_0xd37c62={},_0x17e062={'count':0x0,'rows':[]};var _0x52ad91=_[_0x3636('0x2c')](db[_0x3636('0x2d')]['rawAttributes'],function(_0x8fffb0){return{'name':_0x8fffb0[_0x3636('0x2e')],'type':_0x8fffb0[_0x3636('0x2f')][_0x3636('0x30')]};});_0xd37c62[_0x3636('0x31')]=_['map'](_0x52ad91,_0x3636('0x2a'));_0xd37c62[_0x3636('0x32')]=_[_0x3636('0x33')](_0x236f54[_0x3636('0x32')]);_0xd37c62[_0x3636('0x34')]=_[_0x3636('0x35')](_0xd37c62[_0x3636('0x31')],_0xd37c62[_0x3636('0x32')]);_0x22b12f[_0x3636('0x36')]=_['intersection'](_0xd37c62['model'],qs[_0x3636('0x37')](_0x236f54['query']['fields']));_0x22b12f[_0x3636('0x36')]=_0x22b12f[_0x3636('0x36')][_0x3636('0x38')]?_0x22b12f['attributes']:_0xd37c62[_0x3636('0x31')];if(!_0x236f54[_0x3636('0x32')][_0x3636('0x39')](_0x3636('0x3a'))){_0x22b12f[_0x3636('0x1f')]=qs[_0x3636('0x1f')](_0x236f54[_0x3636('0x32')][_0x3636('0x1f')]);_0x22b12f[_0x3636('0x1e')]=qs[_0x3636('0x1e')](_0x236f54[_0x3636('0x32')][_0x3636('0x1e')]);}_0x22b12f[_0x3636('0x3b')]=qs['sort'](_0x236f54[_0x3636('0x32')][_0x3636('0x3c')]);_0x22b12f[_0x3636('0x3d')]=qs[_0x3636('0x34')](_['pick'](_0x236f54['query'],_0xd37c62[_0x3636('0x34')]),_0x52ad91);if(_0x236f54[_0x3636('0x32')][_0x3636('0x3e')]){_0x22b12f['where']=_[_0x3636('0x3f')](_0x22b12f[_0x3636('0x3d')],{'$or':_['map'](_0x52ad91,function(_0x58f03d){if(_0x58f03d[_0x3636('0x2f')]!=='VIRTUAL'){var _0x8c04cf={};_0x8c04cf[_0x58f03d[_0x3636('0x2a')]]={'$like':'%'+_0x236f54[_0x3636('0x32')][_0x3636('0x3e')]+'%'};return _0x8c04cf;}})});}_0x22b12f=_[_0x3636('0x3f')]({},_0x22b12f,_0x236f54[_0x3636('0x40')]);var _0x448397={'where':_0x22b12f[_0x3636('0x3d')]};return db[_0x3636('0x2d')]['count'](_0x448397)[_0x3636('0x27')](function(_0x44cb9c){_0x17e062[_0x3636('0x21')]=_0x44cb9c;if(_0x236f54[_0x3636('0x32')][_0x3636('0x41')]){_0x22b12f[_0x3636('0x42')]=[{'all':!![]}];}return db[_0x3636('0x2d')][_0x3636('0x43')](_0x22b12f);})[_0x3636('0x27')](function(_0x4df331){_0x17e062[_0x3636('0x44')]=_0x4df331;return _0x17e062;})[_0x3636('0x27')](respondWithFilteredResult(_0x2d644c,_0x22b12f))[_0x3636('0x45')](handleError(_0x2d644c,null));};exports[_0x3636('0x46')]=function(_0x9c59e0,_0x122cb2){var _0x201e2c={'raw':!![],'where':{'id':_0x9c59e0[_0x3636('0x47')]['id']}},_0x401281={};_0x401281[_0x3636('0x31')]=_[_0x3636('0x33')](db[_0x3636('0x2d')][_0x3636('0x48')]);_0x401281[_0x3636('0x32')]=_[_0x3636('0x33')](_0x9c59e0['query']);_0x401281[_0x3636('0x34')]=_[_0x3636('0x35')](_0x401281[_0x3636('0x31')],_0x401281[_0x3636('0x32')]);_0x201e2c[_0x3636('0x36')]=_[_0x3636('0x35')](_0x401281[_0x3636('0x31')],qs[_0x3636('0x37')](_0x9c59e0[_0x3636('0x32')][_0x3636('0x37')]));_0x201e2c[_0x3636('0x36')]=_0x201e2c[_0x3636('0x36')][_0x3636('0x38')]?_0x201e2c['attributes']:_0x401281['model'];if(_0x9c59e0['query'][_0x3636('0x41')]){_0x201e2c['include']=[{'all':!![]}];}_0x201e2c=_['merge']({},_0x201e2c,_0x9c59e0[_0x3636('0x40')]);return db[_0x3636('0x2d')][_0x3636('0x49')](_0x201e2c)['then'](handleEntityNotFound(_0x122cb2,null))[_0x3636('0x27')](respondWithResult(_0x122cb2,null))[_0x3636('0x45')](handleError(_0x122cb2,null));};exports[_0x3636('0x4a')]=function(_0x179410,_0x37a33e){return db[_0x3636('0x2d')][_0x3636('0x4a')](_0x179410[_0x3636('0x4b')],{})[_0x3636('0x27')](respondWithResult(_0x37a33e,0xc9))['catch'](handleError(_0x37a33e,null));};exports[_0x3636('0x26')]=function(_0x33c140,_0x16b65a){if(_0x33c140[_0x3636('0x4b')]['id']){delete _0x33c140[_0x3636('0x4b')]['id'];}return db[_0x3636('0x2d')]['find']({'where':{'id':_0x33c140[_0x3636('0x47')]['id']}})[_0x3636('0x27')](handleEntityNotFound(_0x16b65a,null))[_0x3636('0x27')](saveUpdates(_0x33c140[_0x3636('0x4b')],null))[_0x3636('0x27')](respondWithResult(_0x16b65a,null))['catch'](handleError(_0x16b65a,null));};exports[_0x3636('0x4c')]=function(_0x285ff1,_0xa61651){return db[_0x3636('0x2d')][_0x3636('0x49')]({'where':{'id':_0x285ff1['params']['id']}})[_0x3636('0x27')](handleEntityNotFound(_0xa61651,null))['then'](removeEntity(_0xa61651,null))['catch'](handleError(_0xa61651,null));};exports[_0x3636('0x4d')]=function(_0x1c1ec0,_0x2575ba){return db[_0x3636('0x2d')]['describe']()['then'](respondWithResult(_0x2575ba,null))[_0x3636('0x45')](handleError(_0x2575ba,null));};
\ No newline at end of file
+var _0xe015=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','name','send','index','Cdr','rawAttributes'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0xe015,0x13b));var _0x5e01=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe015[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x5e01('0x0'));var rimraf=require(_0x5e01('0x1'));var zipdir=require(_0x5e01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e01('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e01('0x4'));var util=require(_0x5e01('0x5'));var path=require(_0x5e01('0x6'));var sox=require(_0x5e01('0x7'));var csv=require('to-csv');var ejs=require(_0x5e01('0x8'));var fs=require('fs');var fs_extra=require(_0x5e01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e01('0xa'));var jsforce=require(_0x5e01('0xb'));var deskjs=require(_0x5e01('0xc'));var toCsv=require(_0x5e01('0xd'));var querystring=require(_0x5e01('0xe'));var Papa=require(_0x5e01('0xf'));var Redis=require('ioredis');var authService=require(_0x5e01('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e01('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e01('0x12'))(_0x5e01('0x13'));var utils=require('../../config/utils');var config=require(_0x5e01('0x14'));var licenseUtil=require(_0x5e01('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x560ae2,_0x3d0b04){_0x3d0b04=_0x3d0b04||0xcc;return function(_0x160f79){if(_0x160f79){return _0x560ae2[_0x5e01('0x16')](_0x3d0b04);}return _0x560ae2[_0x5e01('0x17')](_0x3d0b04)[_0x5e01('0x18')]();};}function respondWithResult(_0x16bc8f,_0x4bd426){_0x4bd426=_0x4bd426||0xc8;return function(_0x36da26){if(_0x36da26){return _0x16bc8f['status'](_0x4bd426)['json'](_0x36da26);}};}function respondWithFilteredResult(_0x1df2e0,_0x2dd70c){return function(_0x494b8a){if(_0x494b8a){var _0x27c6e7=typeof _0x2dd70c['offset']===_0x5e01('0x19')&&typeof _0x2dd70c['limit']===_0x5e01('0x19');var _0x5d85e3=_0x494b8a[_0x5e01('0x1a')];var _0x5eda1d=_0x27c6e7?0x0:_0x2dd70c['offset'];var _0x35a002=_0x27c6e7?_0x494b8a[_0x5e01('0x1a')]:_0x2dd70c['offset']+_0x2dd70c[_0x5e01('0x1b')];var _0x2df752;if(_0x35a002>=_0x5d85e3){_0x35a002=_0x5d85e3;_0x2df752=0xc8;}else{_0x2df752=0xce;}_0x1df2e0[_0x5e01('0x17')](_0x2df752);return _0x1df2e0[_0x5e01('0x1c')](_0x5e01('0x1d'),_0x5eda1d+'-'+_0x35a002+'/'+_0x5d85e3)[_0x5e01('0x1e')](_0x494b8a);}return null;};}function patchUpdates(_0x173410){return function(_0x153eb1){try{jsonpatch['apply'](_0x153eb1,_0x173410,!![]);}catch(_0x150ebf){return BPromise[_0x5e01('0x1f')](_0x150ebf);}return _0x153eb1['save']();};}function saveUpdates(_0xf6fe3f,_0x306cff){return function(_0x337ad2){if(_0x337ad2){return _0x337ad2[_0x5e01('0x20')](_0xf6fe3f)[_0x5e01('0x21')](function(_0x284803){return _0x284803;});}return null;};}function removeEntity(_0x5efff9,_0x329315){return function(_0x720922){if(_0x720922){return _0x720922[_0x5e01('0x22')]()[_0x5e01('0x21')](function(){_0x5efff9['status'](0xcc)[_0x5e01('0x18')]();});}};}function handleEntityNotFound(_0x23264f,_0x31eb7f){return function(_0x4f94d0){if(!_0x4f94d0){_0x23264f[_0x5e01('0x16')](0x194);}return _0x4f94d0;};}function handleError(_0x23454e,_0x12a19a){_0x12a19a=_0x12a19a||0x1f4;return function(_0x28344a){logger['error'](_0x28344a['stack']);if(_0x28344a[_0x5e01('0x23')]){delete _0x28344a['name'];}_0x23454e[_0x5e01('0x17')](_0x12a19a)[_0x5e01('0x24')](_0x28344a);};}exports[_0x5e01('0x25')]=function(_0xc26cf8,_0x592a61){var _0x531f0a={},_0x4a4a9f={},_0x51a98d={'count':0x0,'rows':[]};var _0x350ab4=_['map'](db[_0x5e01('0x26')][_0x5e01('0x27')],function(_0xc6d3c2){return{'name':_0xc6d3c2['fieldName'],'type':_0xc6d3c2[_0x5e01('0x28')][_0x5e01('0x29')]};});_0x4a4a9f[_0x5e01('0x2a')]=_[_0x5e01('0x2b')](_0x350ab4,'name');_0x4a4a9f['query']=_[_0x5e01('0x2c')](_0xc26cf8[_0x5e01('0x2d')]);_0x4a4a9f[_0x5e01('0x2e')]=_[_0x5e01('0x2f')](_0x4a4a9f[_0x5e01('0x2a')],_0x4a4a9f[_0x5e01('0x2d')]);_0x531f0a[_0x5e01('0x30')]=_[_0x5e01('0x2f')](_0x4a4a9f[_0x5e01('0x2a')],qs[_0x5e01('0x31')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x31')]));_0x531f0a['attributes']=_0x531f0a[_0x5e01('0x30')][_0x5e01('0x32')]?_0x531f0a[_0x5e01('0x30')]:_0x4a4a9f['model'];if(!_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x33')]('nolimit')){_0x531f0a[_0x5e01('0x1b')]=qs[_0x5e01('0x1b')](_0xc26cf8[_0x5e01('0x2d')]['limit']);_0x531f0a[_0x5e01('0x34')]=qs[_0x5e01('0x34')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x34')]);}_0x531f0a[_0x5e01('0x35')]=qs[_0x5e01('0x36')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x36')]);_0x531f0a[_0x5e01('0x37')]=qs[_0x5e01('0x2e')](_[_0x5e01('0x38')](_0xc26cf8[_0x5e01('0x2d')],_0x4a4a9f[_0x5e01('0x2e')]),_0x350ab4);if(_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x39')]){_0x531f0a['where']=_[_0x5e01('0x3a')](_0x531f0a['where'],{'$or':_['map'](_0x350ab4,function(_0x34e8f5){if(_0x34e8f5[_0x5e01('0x28')]!==_0x5e01('0x3b')){var _0x117fb3={};_0x117fb3[_0x34e8f5[_0x5e01('0x23')]]={'$like':'%'+_0xc26cf8['query'][_0x5e01('0x39')]+'%'};return _0x117fb3;}})});}_0x531f0a=_[_0x5e01('0x3a')]({},_0x531f0a,_0xc26cf8['options']);var _0x3c37d5={'where':_0x531f0a[_0x5e01('0x37')]};return db[_0x5e01('0x26')]['count'](_0x3c37d5)[_0x5e01('0x21')](function(_0xfed2d2){_0x51a98d['count']=_0xfed2d2;if(_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x3c')]){_0x531f0a['include']=[{'all':!![]}];}return db['Cdr'][_0x5e01('0x3d')](_0x531f0a);})['then'](function(_0x2d7423){_0x51a98d[_0x5e01('0x3e')]=_0x2d7423;return _0x51a98d;})[_0x5e01('0x21')](respondWithFilteredResult(_0x592a61,_0x531f0a))[_0x5e01('0x3f')](handleError(_0x592a61,null));};exports['show']=function(_0x296d33,_0xb93846){var _0x23275f={'raw':!![],'where':{'id':_0x296d33[_0x5e01('0x40')]['id']}},_0x44a5e4={};_0x44a5e4[_0x5e01('0x2a')]=_[_0x5e01('0x2c')](db['Cdr'][_0x5e01('0x27')]);_0x44a5e4[_0x5e01('0x2d')]=_[_0x5e01('0x2c')](_0x296d33[_0x5e01('0x2d')]);_0x44a5e4[_0x5e01('0x2e')]=_['intersection'](_0x44a5e4[_0x5e01('0x2a')],_0x44a5e4[_0x5e01('0x2d')]);_0x23275f[_0x5e01('0x30')]=_[_0x5e01('0x2f')](_0x44a5e4[_0x5e01('0x2a')],qs[_0x5e01('0x31')](_0x296d33[_0x5e01('0x2d')]['fields']));_0x23275f[_0x5e01('0x30')]=_0x23275f['attributes'][_0x5e01('0x32')]?_0x23275f[_0x5e01('0x30')]:_0x44a5e4[_0x5e01('0x2a')];if(_0x296d33[_0x5e01('0x2d')][_0x5e01('0x3c')]){_0x23275f[_0x5e01('0x41')]=[{'all':!![]}];}_0x23275f=_['merge']({},_0x23275f,_0x296d33[_0x5e01('0x42')]);return db['Cdr'][_0x5e01('0x43')](_0x23275f)[_0x5e01('0x21')](handleEntityNotFound(_0xb93846,null))[_0x5e01('0x21')](respondWithResult(_0xb93846,null))[_0x5e01('0x3f')](handleError(_0xb93846,null));};exports[_0x5e01('0x44')]=function(_0x1fbb1f,_0x555204){return db['Cdr'][_0x5e01('0x44')](_0x1fbb1f[_0x5e01('0x45')],{})[_0x5e01('0x21')](respondWithResult(_0x555204,0xc9))[_0x5e01('0x3f')](handleError(_0x555204,null));};exports[_0x5e01('0x20')]=function(_0x389520,_0x661d){if(_0x389520[_0x5e01('0x45')]['id']){delete _0x389520[_0x5e01('0x45')]['id'];}return db[_0x5e01('0x26')][_0x5e01('0x43')]({'where':{'id':_0x389520['params']['id']}})[_0x5e01('0x21')](handleEntityNotFound(_0x661d,null))[_0x5e01('0x21')](saveUpdates(_0x389520[_0x5e01('0x45')],null))['then'](respondWithResult(_0x661d,null))[_0x5e01('0x3f')](handleError(_0x661d,null));};exports[_0x5e01('0x22')]=function(_0x3fd5ac,_0xa8ff1b){return db[_0x5e01('0x26')]['find']({'where':{'id':_0x3fd5ac[_0x5e01('0x40')]['id']}})['then'](handleEntityNotFound(_0xa8ff1b,null))[_0x5e01('0x21')](removeEntity(_0xa8ff1b,null))[_0x5e01('0x3f')](handleError(_0xa8ff1b,null));};exports[_0x5e01('0x46')]=function(_0x4c368c,_0x11b36f){return db[_0x5e01('0x26')][_0x5e01('0x46')]()[_0x5e01('0x21')](respondWithResult(_0x11b36f,null))[_0x5e01('0x3f')](handleError(_0x11b36f,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 01763e8..3ee29bc 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3be4e4,_0x5dd6fb){var _0x17fc2f=function(_0x17320d){while(--_0x17320d){_0x3be4e4['push'](_0x3be4e4['shift']());}};_0x17fc2f(++_0x5dd6fb);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3fab4b,_0x5eba6e){var _0x564570=function(_0x4b51b8){while(--_0x4b51b8){_0x3fab4b['push'](_0x3fab4b['shift']());}};_0x564570(++_0x5eba6e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 2210ff8..4b77297 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 _0x4b4c=['Cdr,\x20%s,\x20%s,\x20%s','stringify','code','Cdr,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','request\x20sent','debug'];(function(_0x4d4f4f,_0x32b2e2){var _0x5d48bc=function(_0x5a15de){while(--_0x5a15de){_0x4d4f4f['push'](_0x4d4f4f['shift']());}};_0x5d48bc(++_0x32b2e2);}(_0x4b4c,0x80));var _0xc4b4=function(_0x4559ad,_0x2eba0c){_0x4559ad=_0x4559ad-0x0;var _0x392de1=_0x4b4c[_0x4559ad];return _0x392de1;};'use strict';var _=require('lodash');var util=require(_0xc4b4('0x0'));var moment=require(_0xc4b4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4b4('0x2'));var fs=require('fs');var Redis=require(_0xc4b4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4b4('0x4'));var logger=require(_0xc4b4('0x5'))('rpc');var config=require(_0xc4b4('0x6'));var jayson=require(_0xc4b4('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46cda2,_0x330940,_0x1eab66){return new BPromise(function(_0x3d31ec,_0x443d2e){return client['request'](_0x46cda2,_0x1eab66)[_0xc4b4('0x8')](function(_0x108893){logger[_0xc4b4('0x9')]('Cdr,\x20%s,\x20%s',_0x330940,_0xc4b4('0xa'));logger[_0xc4b4('0xb')](_0xc4b4('0xc'),_0x330940,'request\x20sent',JSON[_0xc4b4('0xd')](_0x108893));if(_0x108893['error']){if(_0x108893['error'][_0xc4b4('0xe')]===0x1f4){logger['error'](_0xc4b4('0xf'),_0x330940,_0x108893[_0xc4b4('0x10')]['message']);return _0x443d2e(_0x108893['error'][_0xc4b4('0x11')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x330940,_0x108893['error'][_0xc4b4('0x11')]);return _0x3d31ec(_0x108893[_0xc4b4('0x10')][_0xc4b4('0x11')]);}else{logger[_0xc4b4('0x9')]('Cdr,\x20%s,\x20%s',_0x330940,_0xc4b4('0xa'));_0x3d31ec(_0x108893[_0xc4b4('0x12')][_0xc4b4('0x11')]);}})[_0xc4b4('0x13')](function(_0x1460b4){logger[_0xc4b4('0x10')](_0xc4b4('0xf'),_0x330940,_0x1460b4);_0x443d2e(_0x1460b4);});});}
\ No newline at end of file
+var _0x4edc=['../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x1c3386,_0x2868c0){var _0x2cc8e9=function(_0x556aa2){while(--_0x556aa2){_0x1c3386['push'](_0x1c3386['shift']());}};_0x2cc8e9(++_0x2868c0);}(_0x4edc,0x14e));var _0xc4ed=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x4edc[_0x16771d];return _0x386f11;};'use strict';var _=require('lodash');var util=require(_0xc4ed('0x0'));var moment=require(_0xc4ed('0x1'));var BPromise=require(_0xc4ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4ed('0x3'));var db=require(_0xc4ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc4ed('0x5'));var config=require(_0xc4ed('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc4ed('0x7')][_0xc4ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c84cc,_0x3b480d,_0xc0b02c){return new BPromise(function(_0x18e271,_0x4091ca){return client[_0xc4ed('0x9')](_0x1c84cc,_0xc0b02c)[_0xc4ed('0xa')](function(_0x299804){logger[_0xc4ed('0xb')](_0xc4ed('0xc'),_0x3b480d,_0xc4ed('0xd'));logger['debug'](_0xc4ed('0xe'),_0x3b480d,'request\x20sent',JSON['stringify'](_0x299804));if(_0x299804[_0xc4ed('0xf')]){if(_0x299804[_0xc4ed('0xf')][_0xc4ed('0x10')]===0x1f4){logger['error'](_0xc4ed('0xc'),_0x3b480d,_0x299804[_0xc4ed('0xf')][_0xc4ed('0x11')]);return _0x4091ca(_0x299804['error'][_0xc4ed('0x11')]);}logger[_0xc4ed('0xf')](_0xc4ed('0xc'),_0x3b480d,_0x299804[_0xc4ed('0xf')][_0xc4ed('0x11')]);return _0x18e271(_0x299804[_0xc4ed('0xf')][_0xc4ed('0x11')]);}else{logger[_0xc4ed('0xb')](_0xc4ed('0xc'),_0x3b480d,_0xc4ed('0xd'));_0x18e271(_0x299804[_0xc4ed('0x12')]['message']);}})[_0xc4ed('0x13')](function(_0x1d1d2f){logger['error'](_0xc4ed('0xc'),_0x3b480d,_0x1d1d2f);_0x4091ca(_0x1d1d2f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8ad410d..4b2bc72 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(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 _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(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index c9bdaf8..deeaf90 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 _0x6556=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x44d87e,_0x236f5a){var _0x53a1b4=function(_0x591cf2){while(--_0x591cf2){_0x44d87e['push'](_0x44d87e['shift']());}};_0x53a1b4(++_0x236f5a);}(_0x6556,0x7a));var _0x6655=function(_0x1720ed,_0x585710){_0x1720ed=_0x1720ed-0x0;var _0x449644=_0x6556[_0x1720ed];return _0x449644;};'use strict';var Sequelize=require(_0x6655('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6655('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6655('0x2')],'allowNull':![],'defaultValue':_0x6655('0x3')},'appdata':{'type':Sequelize[_0x6655('0x4')]()},'description':{'type':Sequelize[_0x6655('0x2')]},'interval':{'type':Sequelize[_0x6655('0x2')],'defaultValue':_0x6655('0x5')}};
\ No newline at end of file
+var _0xfac2=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x428a63,_0x5c8b4c){var _0x6662ad=function(_0x4c1eaa){while(--_0x4c1eaa){_0x428a63['push'](_0x428a63['shift']());}};_0x6662ad(++_0x5c8b4c);}(_0xfac2,0xbf));var _0x2fac=function(_0x3950ba,_0x5a473a){_0x3950ba=_0x3950ba-0x0;var _0x38c4c5=_0xfac2[_0x3950ba];return _0x38c4c5;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2fac('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2fac('0x1')],'allowNull':![],'defaultValue':_0x2fac('0x2')},'appdata':{'type':Sequelize[_0x2fac('0x3')]()},'description':{'type':Sequelize[_0x2fac('0x1')]},'interval':{'type':Sequelize[_0x2fac('0x1')],'defaultValue':_0x2fac('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 3431de4..aeee7e9 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 _0xbee3=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','catch','body','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbee3,0xd5));var _0x3bee=function(_0x1e0b23,_0x447f13){_0x1e0b23=_0x1e0b23-0x0;var _0x9e049c=_0xbee3[_0x1e0b23];return _0x9e049c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x26')]();});}};}function handleEntityNotFound(_0x1e0111,_0x4b4cd4){return function(_0x5ed022){if(!_0x5ed022){_0x1e0111[_0x3bee('0x17')](0x194);}return _0x5ed022;};}function handleError(_0x479f45,_0x5341e2){_0x5341e2=_0x5341e2||0x1f4;return function(_0x2c0e50){logger[_0x3bee('0x27')](_0x2c0e50[_0x3bee('0x28')]);if(_0x2c0e50['name']){delete _0x2c0e50[_0x3bee('0x29')];}_0x479f45[_0x3bee('0x18')](_0x5341e2)[_0x3bee('0x2a')](_0x2c0e50);};}exports['show']=function(_0x239fa4,_0xf08fb3){var _0x3a3d92={'raw':!![],'where':{'id':_0x239fa4[_0x3bee('0x2b')]['id']}},_0x496abd={};_0x496abd[_0x3bee('0x2c')]=_[_0x3bee('0x2d')](db[_0x3bee('0x2e')][_0x3bee('0x2f')]);_0x496abd['query']=_['keys'](_0x239fa4[_0x3bee('0x30')]);_0x496abd[_0x3bee('0x31')]=_[_0x3bee('0x32')](_0x496abd[_0x3bee('0x2c')],_0x496abd['query']);_0x3a3d92['attributes']=_[_0x3bee('0x32')](_0x496abd[_0x3bee('0x2c')],qs['fields'](_0x239fa4['query'][_0x3bee('0x33')]));_0x3a3d92[_0x3bee('0x34')]=_0x3a3d92[_0x3bee('0x34')][_0x3bee('0x35')]?_0x3a3d92[_0x3bee('0x34')]:_0x496abd[_0x3bee('0x2c')];if(_0x239fa4[_0x3bee('0x30')][_0x3bee('0x36')]){_0x3a3d92[_0x3bee('0x37')]=[{'all':!![]}];}_0x3a3d92=_[_0x3bee('0x38')]({},_0x3a3d92,_0x239fa4['options']);return db['ChatApplication'][_0x3bee('0x39')](_0x3a3d92)['then'](handleEntityNotFound(_0xf08fb3,null))['then'](respondWithResult(_0xf08fb3,null))[_0x3bee('0x3a')](handleError(_0xf08fb3,null));};exports[_0x3bee('0x23')]=function(_0x15bba3,_0x474cf5){if(_0x15bba3[_0x3bee('0x3b')]['id']){delete _0x15bba3[_0x3bee('0x3b')]['id'];}return db[_0x3bee('0x2e')][_0x3bee('0x39')]({'where':{'id':_0x15bba3['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x474cf5,null))[_0x3bee('0x24')](saveUpdates(_0x15bba3['body'],null))[_0x3bee('0x24')](respondWithResult(_0x474cf5,null))[_0x3bee('0x3a')](handleError(_0x474cf5,null));};exports[_0x3bee('0x25')]=function(_0x13d2d5,_0x195540){return db['ChatApplication']['find']({'where':{'id':_0x13d2d5[_0x3bee('0x2b')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x195540,null))[_0x3bee('0x24')](removeEntity(_0x195540,null))[_0x3bee('0x3a')](handleError(_0x195540,null));};
\ No newline at end of file
+var _0x9efc=['limit','set','Content-Range','apply','save','then','stack','name','send','show','model','keys','query','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','update','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count'];(function(_0x48849a,_0x288d24){var _0x453b62=function(_0x1edc05){while(--_0x1edc05){_0x48849a['push'](_0x48849a['shift']());}};_0x453b62(++_0x288d24);}(_0x9efc,0x19c));var _0xc9ef=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0x9efc[_0x35d3a8];return _0x182378;};'use strict';var emlformat=require(_0xc9ef('0x0'));var rimraf=require(_0xc9ef('0x1'));var zipdir=require(_0xc9ef('0x2'));var jsonpatch=require(_0xc9ef('0x3'));var rp=require(_0xc9ef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc9ef('0x5'));var util=require('util');var path=require(_0xc9ef('0x6'));var sox=require('sox');var csv=require(_0xc9ef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9ef('0x8'));var _=require(_0xc9ef('0x9'));var squel=require(_0xc9ef('0xa'));var crypto=require(_0xc9ef('0xb'));var jsforce=require(_0xc9ef('0xc'));var deskjs=require(_0xc9ef('0xd'));var toCsv=require(_0xc9ef('0x7'));var querystring=require(_0xc9ef('0xe'));var Papa=require(_0xc9ef('0xf'));var Redis=require(_0xc9ef('0x10'));var authService=require(_0xc9ef('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9ef('0x12'));var logger=require('../../config/logger')(_0xc9ef('0x13'));var utils=require('../../config/utils');var config=require(_0xc9ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3297a4,_0x35fb8b){_0x35fb8b=_0x35fb8b||0xcc;return function(_0x2ce47b){if(_0x2ce47b){return _0x3297a4[_0xc9ef('0x15')](_0x35fb8b);}return _0x3297a4[_0xc9ef('0x16')](_0x35fb8b)[_0xc9ef('0x17')]();};}function respondWithResult(_0x17eed6,_0x19f4ab){_0x19f4ab=_0x19f4ab||0xc8;return function(_0x106a92){if(_0x106a92){return _0x17eed6[_0xc9ef('0x16')](_0x19f4ab)[_0xc9ef('0x18')](_0x106a92);}};}function respondWithFilteredResult(_0x5a7043,_0x1665e8){return function(_0x181c2b){if(_0x181c2b){var _0xc63528=typeof _0x1665e8[_0xc9ef('0x19')]===_0xc9ef('0x1a')&&typeof _0x1665e8['limit']===_0xc9ef('0x1a');var _0xd0cd36=_0x181c2b[_0xc9ef('0x1b')];var _0x122fb8=_0xc63528?0x0:_0x1665e8[_0xc9ef('0x19')];var _0x2d1b60=_0xc63528?_0x181c2b[_0xc9ef('0x1b')]:_0x1665e8[_0xc9ef('0x19')]+_0x1665e8[_0xc9ef('0x1c')];var _0xcc0fd8;if(_0x2d1b60>=_0xd0cd36){_0x2d1b60=_0xd0cd36;_0xcc0fd8=0xc8;}else{_0xcc0fd8=0xce;}_0x5a7043[_0xc9ef('0x16')](_0xcc0fd8);return _0x5a7043[_0xc9ef('0x1d')](_0xc9ef('0x1e'),_0x122fb8+'-'+_0x2d1b60+'/'+_0xd0cd36)[_0xc9ef('0x18')](_0x181c2b);}return null;};}function patchUpdates(_0x572f83){return function(_0x13f7d6){try{jsonpatch[_0xc9ef('0x1f')](_0x13f7d6,_0x572f83,!![]);}catch(_0x32999b){return BPromise['reject'](_0x32999b);}return _0x13f7d6[_0xc9ef('0x20')]();};}function saveUpdates(_0x23a402,_0x1ffff8){return function(_0x2bc10b){if(_0x2bc10b){return _0x2bc10b['update'](_0x23a402)[_0xc9ef('0x21')](function(_0x27df1f){return _0x27df1f;});}return null;};}function removeEntity(_0x486dc1,_0x3357e3){return function(_0xcd720a){if(_0xcd720a){return _0xcd720a['destroy']()[_0xc9ef('0x21')](function(){_0x486dc1[_0xc9ef('0x16')](0xcc)[_0xc9ef('0x17')]();});}};}function handleEntityNotFound(_0xf746bb,_0x55cdab){return function(_0x1c6422){if(!_0x1c6422){_0xf746bb[_0xc9ef('0x15')](0x194);}return _0x1c6422;};}function handleError(_0x2d804e,_0xec1e62){_0xec1e62=_0xec1e62||0x1f4;return function(_0x53bf57){logger['error'](_0x53bf57[_0xc9ef('0x22')]);if(_0x53bf57[_0xc9ef('0x23')]){delete _0x53bf57[_0xc9ef('0x23')];}_0x2d804e['status'](_0xec1e62)[_0xc9ef('0x24')](_0x53bf57);};}exports[_0xc9ef('0x25')]=function(_0x2b5831,_0x4042fc){var _0x147812={'raw':!![],'where':{'id':_0x2b5831['params']['id']}},_0x58f88d={};_0x58f88d[_0xc9ef('0x26')]=_[_0xc9ef('0x27')](db['ChatApplication']['rawAttributes']);_0x58f88d[_0xc9ef('0x28')]=_['keys'](_0x2b5831[_0xc9ef('0x28')]);_0x58f88d['filters']=_[_0xc9ef('0x29')](_0x58f88d[_0xc9ef('0x26')],_0x58f88d[_0xc9ef('0x28')]);_0x147812[_0xc9ef('0x2a')]=_[_0xc9ef('0x29')](_0x58f88d[_0xc9ef('0x26')],qs['fields'](_0x2b5831[_0xc9ef('0x28')][_0xc9ef('0x2b')]));_0x147812['attributes']=_0x147812[_0xc9ef('0x2a')][_0xc9ef('0x2c')]?_0x147812[_0xc9ef('0x2a')]:_0x58f88d[_0xc9ef('0x26')];if(_0x2b5831[_0xc9ef('0x28')]['includeAll']){_0x147812[_0xc9ef('0x2d')]=[{'all':!![]}];}_0x147812=_[_0xc9ef('0x2e')]({},_0x147812,_0x2b5831[_0xc9ef('0x2f')]);return db[_0xc9ef('0x30')][_0xc9ef('0x31')](_0x147812)['then'](handleEntityNotFound(_0x4042fc,null))['then'](respondWithResult(_0x4042fc,null))[_0xc9ef('0x32')](handleError(_0x4042fc,null));};exports[_0xc9ef('0x33')]=function(_0x2452d9,_0x5f10c9){if(_0x2452d9['body']['id']){delete _0x2452d9[_0xc9ef('0x34')]['id'];}return db[_0xc9ef('0x30')]['find']({'where':{'id':_0x2452d9['params']['id']}})[_0xc9ef('0x21')](handleEntityNotFound(_0x5f10c9,null))[_0xc9ef('0x21')](saveUpdates(_0x2452d9[_0xc9ef('0x34')],null))['then'](respondWithResult(_0x5f10c9,null))[_0xc9ef('0x32')](handleError(_0x5f10c9,null));};exports[_0xc9ef('0x35')]=function(_0x30d2ba,_0x4ef921){return db[_0xc9ef('0x30')][_0xc9ef('0x31')]({'where':{'id':_0x30d2ba[_0xc9ef('0x36')]['id']}})['then'](handleEntityNotFound(_0x4ef921,null))['then'](removeEntity(_0x4ef921,null))[_0xc9ef('0x32')](handleError(_0x4ef921,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index a455a95..47da10d 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 _0xabc7=['request-promise','path','./chatApplication.attributes','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5138f1,_0x31dfb9){var _0x2e2533=function(_0x25bbc7){while(--_0x25bbc7){_0x5138f1['push'](_0x5138f1['shift']());}};_0x2e2533(++_0x31dfb9);}(_0xabc7,0xc7));var _0x7abc=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xabc7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7abc('0x0'));var util=require(_0x7abc('0x1'));var logger=require(_0x7abc('0x2'))('api');var moment=require(_0x7abc('0x3'));var BPromise=require(_0x7abc('0x4'));var rp=require(_0x7abc('0x5'));var fs=require('fs');var path=require(_0x7abc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7abc('0x7'));module[_0x7abc('0x8')]=function(_0x542c09,_0x226476){return _0x542c09['define']('ChatApplication',attributes,{'tableName':_0x7abc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7abc('0xa'),'collate':_0x7abc('0xb')});};
\ No newline at end of file
+var _0x65b9=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','./chatApplication.attributes','exports','define'];(function(_0x3b20b6,_0x605618){var _0x19be63=function(_0x47deca){while(--_0x47deca){_0x3b20b6['push'](_0x3b20b6['shift']());}};_0x19be63(++_0x605618);}(_0x65b9,0x154));var _0x965b=function(_0x4643b2,_0x5ba362){_0x4643b2=_0x4643b2-0x0;var _0x5ab087=_0x65b9[_0x4643b2];return _0x5ab087;};'use strict';var _=require(_0x965b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x965b('0x1'));var moment=require('moment');var BPromise=require(_0x965b('0x2'));var rp=require(_0x965b('0x3'));var fs=require('fs');var path=require(_0x965b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x965b('0x5'));module[_0x965b('0x6')]=function(_0x556e5f,_0x5015a3){return _0x556e5f[_0x965b('0x7')](_0x965b('0x8'),attributes,{'tableName':_0x965b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x965b('0xa'),'collate':_0x965b('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index fbd8f32..5b4393b 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 _0x8349=['http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x538d22,_0x577235){var _0x343115=function(_0x41f1ee){while(--_0x41f1ee){_0x538d22['push'](_0x538d22['shift']());}};_0x343115(++_0x577235);}(_0x8349,0xe9));var _0x9834=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x8349[_0x5e8d3e];return _0x1348c0;};'use strict';var _=require(_0x9834('0x0'));var util=require(_0x9834('0x1'));var moment=require(_0x9834('0x2'));var BPromise=require(_0x9834('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9834('0x4'));var logger=require(_0x9834('0x5'))(_0x9834('0x6'));var config=require(_0x9834('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9834('0x8')][_0x9834('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b8dcd,_0x4f08df,_0x4c4082){return new BPromise(function(_0x1617d1,_0x5149fb){return client[_0x9834('0xa')](_0x5b8dcd,_0x4c4082)[_0x9834('0xb')](function(_0x41fe75){logger[_0x9834('0xc')](_0x9834('0xd'),_0x4f08df,_0x9834('0xe'));logger[_0x9834('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4f08df,'request\x20sent',JSON[_0x9834('0x10')](_0x41fe75));if(_0x41fe75[_0x9834('0x11')]){if(_0x41fe75[_0x9834('0x11')][_0x9834('0x12')]===0x1f4){logger[_0x9834('0x11')](_0x9834('0xd'),_0x4f08df,_0x41fe75[_0x9834('0x11')][_0x9834('0x13')]);return _0x5149fb(_0x41fe75[_0x9834('0x11')][_0x9834('0x13')]);}logger[_0x9834('0x11')](_0x9834('0xd'),_0x4f08df,_0x41fe75[_0x9834('0x11')]['message']);return _0x1617d1(_0x41fe75['error']['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x4f08df,_0x9834('0xe'));_0x1617d1(_0x41fe75[_0x9834('0x14')][_0x9834('0x13')]);}})[_0x9834('0x15')](function(_0x2ee9a6){logger[_0x9834('0x11')](_0x9834('0xd'),_0x4f08df,_0x2ee9a6);_0x5149fb(_0x2ee9a6);});});}
\ No newline at end of file
+var _0xb00a=['info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x5a2330,_0x1ee98c){var _0x50da64=function(_0x33682f){while(--_0x33682f){_0x5a2330['push'](_0x5a2330['shift']());}};_0x50da64(++_0x1ee98c);}(_0xb00a,0x171));var _0xab00=function(_0x10e2c0,_0xa19c34){_0x10e2c0=_0x10e2c0-0x0;var _0x1a7c4d=_0xb00a[_0x10e2c0];return _0x1a7c4d;};'use strict';var _=require(_0xab00('0x0'));var util=require(_0xab00('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab00('0x2'))['db'];var utils=require(_0xab00('0x3'));var logger=require(_0xab00('0x4'))(_0xab00('0x5'));var config=require(_0xab00('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xab00('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9a43,_0x2287f8,_0x52d888){return new BPromise(function(_0x43037a,_0x171e3d){return client[_0xab00('0x8')](_0x2c9a43,_0x52d888)['then'](function(_0x48637f){logger[_0xab00('0x9')](_0xab00('0xa'),_0x2287f8,'request\x20sent');logger['debug'](_0xab00('0xb'),_0x2287f8,'request\x20sent',JSON['stringify'](_0x48637f));if(_0x48637f[_0xab00('0xc')]){if(_0x48637f[_0xab00('0xc')][_0xab00('0xd')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2287f8,_0x48637f[_0xab00('0xc')][_0xab00('0xe')]);return _0x171e3d(_0x48637f[_0xab00('0xc')]['message']);}logger[_0xab00('0xc')](_0xab00('0xa'),_0x2287f8,_0x48637f[_0xab00('0xc')][_0xab00('0xe')]);return _0x43037a(_0x48637f[_0xab00('0xc')]['message']);}else{logger[_0xab00('0x9')]('ChatApplication,\x20%s,\x20%s',_0x2287f8,_0xab00('0xf'));_0x43037a(_0x48637f[_0xab00('0x10')][_0xab00('0xe')]);}})[_0xab00('0x11')](function(_0x3c0899){logger[_0xab00('0xc')](_0xab00('0xa'),_0x2287f8,_0x3c0899);_0x171e3d(_0x3c0899);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 491c04b..8244b10 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 _0x8180=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0x8180,0x182));var _0x0818=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x8180[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require('multer');var util=require(_0x0818('0x0'));var path=require(_0x0818('0x1'));var timeout=require(_0x0818('0x2'));var express=require(_0x0818('0x3'));var router=express[_0x0818('0x4')]();var fs_extra=require(_0x0818('0x5'));var auth=require(_0x0818('0x6'));var interaction=require(_0x0818('0x7'));var config=require(_0x0818('0x8'));var controller=require('./chatApplication.controller');router[_0x0818('0x9')]('/:id',auth[_0x0818('0xa')](),controller['show']);router[_0x0818('0xb')](_0x0818('0xc'),auth[_0x0818('0xa')](),controller[_0x0818('0xd')]);router[_0x0818('0xe')](_0x0818('0xc'),auth[_0x0818('0xa')](),controller[_0x0818('0xf')]);module[_0x0818('0x10')]=router;
\ No newline at end of file
+var _0xcbb9=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbb9,0x1a8));var _0x9cbb=function(_0x408da2,_0x427832){_0x408da2=_0x408da2-0x0;var _0x5ca6e7=_0xcbb9[_0x408da2];return _0x5ca6e7;};'use strict';var multer=require(_0x9cbb('0x0'));var util=require(_0x9cbb('0x1'));var path=require(_0x9cbb('0x2'));var timeout=require('connect-timeout');var express=require(_0x9cbb('0x3'));var router=express[_0x9cbb('0x4')]();var fs_extra=require(_0x9cbb('0x5'));var auth=require(_0x9cbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9cbb('0x7'));var controller=require(_0x9cbb('0x8'));router[_0x9cbb('0x9')](_0x9cbb('0xa'),auth[_0x9cbb('0xb')](),controller[_0x9cbb('0xc')]);router[_0x9cbb('0xd')](_0x9cbb('0xa'),auth[_0x9cbb('0xb')](),controller['update']);router[_0x9cbb('0xe')]('/:id',auth[_0x9cbb('0xb')](),controller[_0x9cbb('0xf')]);module[_0x9cbb('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f9b9e4b..2e9fb5e 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 _0x20de=['STRING','BOOLEAN','sequelize'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x20de,0x134));var _0xe20d=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x20de[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0xe20d('0x0'));module['exports']={'name':{'type':Sequelize[_0xe20d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe20d('0x1')]},'write':{'type':Sequelize[_0xe20d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x090d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1d3cdb,_0x1e72d8){var _0x12700a=function(_0x31f980){while(--_0x31f980){_0x1d3cdb['push'](_0x1d3cdb['shift']());}};_0x12700a(++_0x1e72d8);}(_0x090d,0xf5));var _0xd090=function(_0x32b2c3,_0x333f80){_0x32b2c3=_0x32b2c3-0x0;var _0x4ed7f9=_0x090d[_0x32b2c3];return _0x4ed7f9;};'use strict';var Sequelize=require(_0xd090('0x0'));module[_0xd090('0x1')]={'name':{'type':Sequelize[_0xd090('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd090('0x2')]},'write':{'type':Sequelize[_0xd090('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index d8349b3..66a2972 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 _0x5bee=['keys','length','create','body','find','describe','ChatInternalMessage','user','toInteger','ids','omit','getMembers','findOne','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','name','send','index','map','rawAttributes','fieldName','key','query','intersection','attributes','model','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','params'];(function(_0xfb65aa,_0x1651a6){var _0x2aee31=function(_0x492245){while(--_0x492245){_0xfb65aa['push'](_0xfb65aa['shift']());}};_0x2aee31(++_0x1651a6);}(_0x5bee,0x72));var _0xe5be=function(_0x5a2b06,_0x254bbb){_0x5a2b06=_0x5a2b06-0x0;var _0x40e9b0=_0x5bee[_0x5a2b06];return _0x40e9b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5be('0x0'));var zipdir=require(_0xe5be('0x1'));var jsonpatch=require(_0xe5be('0x2'));var rp=require('request-promise');var moment=require(_0xe5be('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe5be('0x4'));var util=require(_0xe5be('0x5'));var path=require(_0xe5be('0x6'));var sox=require('sox');var csv=require(_0xe5be('0x7'));var ejs=require(_0xe5be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5be('0x9'));var squel=require(_0xe5be('0xa'));var crypto=require(_0xe5be('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe5be('0xc'));var toCsv=require(_0xe5be('0x7'));var querystring=require('querystring');var Papa=require(_0xe5be('0xd'));var Redis=require(_0xe5be('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe5be('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5be('0x10'));var logger=require(_0xe5be('0x11'))(_0xe5be('0x12'));var utils=require(_0xe5be('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe5be('0x14'));var db=require(_0xe5be('0x15'))['db'];config['redis']=_[_0xe5be('0x16')](config[_0xe5be('0x17')],{'host':_0xe5be('0x18'),'port':0x18eb});var socket=require(_0xe5be('0x19'))(new Redis(config[_0xe5be('0x17')]));require(_0xe5be('0x1a'))['register'](socket);function respondWithStatusCode(_0x58c8f3,_0x1973bc){_0x1973bc=_0x1973bc||0xcc;return function(_0xe0aa16){if(_0xe0aa16){return _0x58c8f3[_0xe5be('0x1b')](_0x1973bc);}return _0x58c8f3['status'](_0x1973bc)['end']();};}function respondWithResult(_0x3842e8,_0x261ba3){_0x261ba3=_0x261ba3||0xc8;return function(_0xb2c93f){if(_0xb2c93f){return _0x3842e8[_0xe5be('0x1c')](_0x261ba3)[_0xe5be('0x1d')](_0xb2c93f);}};}function respondWithFilteredResult(_0x383b1c,_0x4603ea){return function(_0x4953aa){if(_0x4953aa){var _0x2f35a5=typeof _0x4603ea[_0xe5be('0x1e')]===_0xe5be('0x1f')&&typeof _0x4603ea['limit']===_0xe5be('0x1f');var _0x4f85fd=_0x4953aa[_0xe5be('0x20')];var _0x18fc71=_0x2f35a5?0x0:_0x4603ea[_0xe5be('0x1e')];var _0x412014=_0x2f35a5?_0x4953aa['count']:_0x4603ea['offset']+_0x4603ea['limit'];var _0x36c8d8;if(_0x412014>=_0x4f85fd){_0x412014=_0x4f85fd;_0x36c8d8=0xc8;}else{_0x36c8d8=0xce;}_0x383b1c[_0xe5be('0x1c')](_0x36c8d8);return _0x383b1c[_0xe5be('0x21')]('Content-Range',_0x18fc71+'-'+_0x412014+'/'+_0x4f85fd)['json'](_0x4953aa);}return null;};}function patchUpdates(_0x48acd4){return function(_0x4f9a50){try{jsonpatch[_0xe5be('0x22')](_0x4f9a50,_0x48acd4,!![]);}catch(_0x574c5f){return BPromise[_0xe5be('0x23')](_0x574c5f);}return _0x4f9a50[_0xe5be('0x24')]();};}function saveUpdates(_0x49a8c5,_0x472a9b){return function(_0x4e7314){if(_0x4e7314){return _0x4e7314[_0xe5be('0x25')](_0x49a8c5)['then'](function(_0x4a1f87){return _0x4a1f87;});}return null;};}function removeEntity(_0x2b822b,_0x408544){return function(_0x3ec7f8){if(_0x3ec7f8){return _0x3ec7f8[_0xe5be('0x26')]()[_0xe5be('0x27')](function(){_0x2b822b[_0xe5be('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xac2390,_0x3b03e3){return function(_0x2a3ce3){if(!_0x2a3ce3){_0xac2390[_0xe5be('0x1b')](0x194);}return _0x2a3ce3;};}function handleError(_0x2c6a82,_0x41fb16){_0x41fb16=_0x41fb16||0x1f4;return function(_0x1ec965){logger['error'](_0x1ec965['stack']);if(_0x1ec965[_0xe5be('0x28')]){delete _0x1ec965[_0xe5be('0x28')];}_0x2c6a82[_0xe5be('0x1c')](_0x41fb16)[_0xe5be('0x29')](_0x1ec965);};}exports[_0xe5be('0x2a')]=function(_0x188e08,_0x52eac3){var _0x5c5fee={},_0x20ed1d={},_0x2d5f5e={'count':0x0,'rows':[]};var _0x458883=_[_0xe5be('0x2b')](db['ChatGroup'][_0xe5be('0x2c')],function(_0x160595){return{'name':_0x160595[_0xe5be('0x2d')],'type':_0x160595['type'][_0xe5be('0x2e')]};});_0x20ed1d['model']=_[_0xe5be('0x2b')](_0x458883,_0xe5be('0x28'));_0x20ed1d['query']=_['keys'](_0x188e08[_0xe5be('0x2f')]);_0x20ed1d['filters']=_[_0xe5be('0x30')](_0x20ed1d['model'],_0x20ed1d['query']);_0x5c5fee[_0xe5be('0x31')]=_[_0xe5be('0x30')](_0x20ed1d[_0xe5be('0x32')],qs[_0xe5be('0x33')](_0x188e08[_0xe5be('0x2f')][_0xe5be('0x33')]));_0x5c5fee[_0xe5be('0x31')]=_0x5c5fee[_0xe5be('0x31')]['length']?_0x5c5fee['attributes']:_0x20ed1d[_0xe5be('0x32')];if(!_0x188e08[_0xe5be('0x2f')][_0xe5be('0x34')]('nolimit')){_0x5c5fee[_0xe5be('0x35')]=qs[_0xe5be('0x35')](_0x188e08['query'][_0xe5be('0x35')]);_0x5c5fee[_0xe5be('0x1e')]=qs[_0xe5be('0x1e')](_0x188e08[_0xe5be('0x2f')][_0xe5be('0x1e')]);}_0x5c5fee[_0xe5be('0x36')]=qs[_0xe5be('0x37')](_0x188e08['query'][_0xe5be('0x37')]);_0x5c5fee[_0xe5be('0x38')]=qs[_0xe5be('0x39')](_[_0xe5be('0x3a')](_0x188e08[_0xe5be('0x2f')],_0x20ed1d[_0xe5be('0x39')]),_0x458883);if(_0x188e08['query'][_0xe5be('0x3b')]){_0x5c5fee[_0xe5be('0x38')]=_[_0xe5be('0x3c')](_0x5c5fee['where'],{'$or':_[_0xe5be('0x2b')](_0x458883,function(_0x5cd882){if(_0x5cd882[_0xe5be('0x3d')]!==_0xe5be('0x3e')){var _0x237115={};_0x237115[_0x5cd882[_0xe5be('0x28')]]={'$like':'%'+_0x188e08[_0xe5be('0x2f')][_0xe5be('0x3b')]+'%'};return _0x237115;}})});}_0x5c5fee=_['merge']({},_0x5c5fee,_0x188e08[_0xe5be('0x3f')]);var _0x2c48bb={'where':_0x5c5fee['where']};return db[_0xe5be('0x40')][_0xe5be('0x20')](_0x2c48bb)['then'](function(_0x555ed3){_0x2d5f5e[_0xe5be('0x20')]=_0x555ed3;if(_0x188e08['query'][_0xe5be('0x41')]){_0x5c5fee[_0xe5be('0x42')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x5c5fee);})[_0xe5be('0x27')](function(_0x2de16b){_0x2d5f5e[_0xe5be('0x43')]=_0x2de16b;return _0x2d5f5e;})[_0xe5be('0x27')](respondWithFilteredResult(_0x52eac3,_0x5c5fee))[_0xe5be('0x44')](handleError(_0x52eac3,null));};exports['show']=function(_0x10aa65,_0x52f6c6){var _0xd2ae52={'raw':!![],'where':{'id':_0x10aa65[_0xe5be('0x45')]['id']}},_0x264e63={};_0x264e63[_0xe5be('0x32')]=_[_0xe5be('0x46')](db[_0xe5be('0x40')][_0xe5be('0x2c')]);_0x264e63[_0xe5be('0x2f')]=_[_0xe5be('0x46')](_0x10aa65['query']);_0x264e63[_0xe5be('0x39')]=_[_0xe5be('0x30')](_0x264e63[_0xe5be('0x32')],_0x264e63[_0xe5be('0x2f')]);_0xd2ae52[_0xe5be('0x31')]=_[_0xe5be('0x30')](_0x264e63['model'],qs[_0xe5be('0x33')](_0x10aa65[_0xe5be('0x2f')][_0xe5be('0x33')]));_0xd2ae52[_0xe5be('0x31')]=_0xd2ae52[_0xe5be('0x31')][_0xe5be('0x47')]?_0xd2ae52[_0xe5be('0x31')]:_0x264e63['model'];if(_0x10aa65['query']['includeAll']){_0xd2ae52[_0xe5be('0x42')]=[{'all':!![]}];}_0xd2ae52=_[_0xe5be('0x3c')]({},_0xd2ae52,_0x10aa65[_0xe5be('0x3f')]);return db[_0xe5be('0x40')]['find'](_0xd2ae52)[_0xe5be('0x27')](handleEntityNotFound(_0x52f6c6,null))[_0xe5be('0x27')](respondWithResult(_0x52f6c6,null))[_0xe5be('0x44')](handleError(_0x52f6c6,null));};exports[_0xe5be('0x48')]=function(_0x3bd420,_0x10839a){return db['ChatGroup'][_0xe5be('0x48')](_0x3bd420[_0xe5be('0x49')],{})[_0xe5be('0x27')](respondWithResult(_0x10839a,0xc9))['catch'](handleError(_0x10839a,null));};exports[_0xe5be('0x25')]=function(_0x249dbe,_0x126d1e){if(_0x249dbe['body']['id']){delete _0x249dbe[_0xe5be('0x49')]['id'];}return db[_0xe5be('0x40')][_0xe5be('0x4a')]({'where':{'id':_0x249dbe[_0xe5be('0x45')]['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x126d1e,null))[_0xe5be('0x27')](saveUpdates(_0x249dbe[_0xe5be('0x49')],null))['then'](respondWithResult(_0x126d1e,null))['catch'](handleError(_0x126d1e,null));};exports['destroy']=function(_0x3ca258,_0x1e231a){return db['ChatGroup']['find']({'where':{'id':_0x3ca258[_0xe5be('0x45')]['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x1e231a,null))[_0xe5be('0x27')](removeEntity(_0x1e231a,null))[_0xe5be('0x44')](handleError(_0x1e231a,null));};exports[_0xe5be('0x4b')]=function(_0x41cd7c,_0x1ea110){return db['ChatGroup'][_0xe5be('0x4b')]()[_0xe5be('0x27')](respondWithResult(_0x1ea110,null))[_0xe5be('0x44')](handleError(_0x1ea110,null));};exports['getUnread']=function(_0x565d12,_0x2c4e43,_0x547fc6){return db[_0xe5be('0x4c')][_0xe5be('0x20')]({'where':{'ChatGroupId':_0x565d12[_0xe5be('0x45')]['id'],'ToId':_0x565d12[_0xe5be('0x4d')]['id'],'read':![]}})[_0xe5be('0x27')](function(_0x77bca1){return{'id':_[_0xe5be('0x4e')](_0x565d12['params']['id']),'count':_0x77bca1};})['then'](respondWithResult(_0x2c4e43,null))[_0xe5be('0x44')](handleError(_0x2c4e43,null));};exports['addMembers']=function(_0x331552,_0x4a103c,_0x7c3386){return db[_0xe5be('0x40')][_0xe5be('0x4a')]({'where':{'id':_0x331552[_0xe5be('0x45')]['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x4a103c,null))[_0xe5be('0x27')](function(_0x3d813e){if(_0x3d813e){return _0x3d813e['addMembers'](_0x331552[_0xe5be('0x49')][_0xe5be('0x4f')],_[_0xe5be('0x50')](_0x331552[_0xe5be('0x49')],[_0xe5be('0x4f'),'id'])||{});}})[_0xe5be('0x27')](respondWithResult(_0x4a103c,null))[_0xe5be('0x44')](handleError(_0x4a103c,null));};exports[_0xe5be('0x51')]=function(_0x1b6a29,_0x29d277,_0xf3c42f){var _0x5781d8={};var _0x2b7cd1={};var _0x35dbab;var _0x1cf95d;return db[_0xe5be('0x40')][_0xe5be('0x52')]({'where':{'id':_0x1b6a29[_0xe5be('0x45')]['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x29d277,null))['then'](function(_0x322e75){if(_0x322e75){_0x35dbab=_0x322e75;_0x2b7cd1['model']=_[_0xe5be('0x46')](db['User']['rawAttributes']);_0x2b7cd1[_0xe5be('0x2f')]=_[_0xe5be('0x46')](_0x1b6a29[_0xe5be('0x2f')]);_0x2b7cd1[_0xe5be('0x39')]=_['intersection'](_0x2b7cd1[_0xe5be('0x32')],_0x2b7cd1[_0xe5be('0x2f')]);_0x5781d8['attributes']=_[_0xe5be('0x30')](_0x2b7cd1['model'],qs['fields'](_0x1b6a29[_0xe5be('0x2f')][_0xe5be('0x33')]));_0x5781d8[_0xe5be('0x31')]=_0x5781d8[_0xe5be('0x31')]['length']?_0x5781d8[_0xe5be('0x31')]:_0x2b7cd1[_0xe5be('0x32')];_0x5781d8[_0xe5be('0x36')]=qs[_0xe5be('0x37')](_0x1b6a29[_0xe5be('0x2f')]['sort']);_0x5781d8[_0xe5be('0x38')]=qs[_0xe5be('0x39')](_[_0xe5be('0x3a')](_0x1b6a29[_0xe5be('0x2f')],_0x2b7cd1[_0xe5be('0x39')]));if(_0x1b6a29['query']['filter']){_0x5781d8[_0xe5be('0x38')]=_[_0xe5be('0x3c')](_0x5781d8[_0xe5be('0x38')],{'$or':_[_0xe5be('0x2b')](_0x5781d8[_0xe5be('0x31')],function(_0x49de6e){var _0x5c48b5={};_0x5c48b5[_0x49de6e]={'$like':'%'+_0x1b6a29[_0xe5be('0x2f')][_0xe5be('0x3b')]+'%'};return _0x5c48b5;})});}_0x5781d8=_[_0xe5be('0x3c')]({},_0x5781d8,_0x1b6a29[_0xe5be('0x3f')]);return _0x35dbab[_0xe5be('0x51')](_0x5781d8);}})[_0xe5be('0x27')](function(_0x28fc73){if(_0x28fc73){_0x1cf95d=_0x28fc73[_0xe5be('0x47')];if(!_0x1b6a29[_0xe5be('0x2f')]['hasOwnProperty']('nolimit')){_0x5781d8[_0xe5be('0x35')]=qs[_0xe5be('0x35')](_0x1b6a29['query'][_0xe5be('0x35')]);_0x5781d8[_0xe5be('0x1e')]=qs[_0xe5be('0x1e')](_0x1b6a29[_0xe5be('0x2f')][_0xe5be('0x1e')]);}return _0x35dbab[_0xe5be('0x51')](_0x5781d8);}})['then'](function(_0x2ffa57){if(_0x2ffa57){return _0x2ffa57?{'count':_0x1cf95d,'rows':_0x2ffa57}:null;}})[_0xe5be('0x27')](respondWithResult(_0x29d277,null))[_0xe5be('0x44')](handleError(_0x29d277,null));};exports[_0xe5be('0x53')]=function(_0x122289,_0x47d009,_0x414925){return db[_0xe5be('0x40')]['find']({'where':{'id':_0x122289[_0xe5be('0x45')]['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x47d009,null))['then'](function(_0x3f519e){if(_0x3f519e){return _0x3f519e[_0xe5be('0x53')](_0x122289[_0xe5be('0x2f')][_0xe5be('0x4f')]);}})[_0xe5be('0x27')](respondWithStatusCode(_0x47d009,null))[_0xe5be('0x44')](handleError(_0x47d009,null));};exports[_0xe5be('0x54')]=function(_0x2faffd,_0x439bad,_0x5ef288){if(_0x2faffd[_0xe5be('0x49')]['id']){delete _0x2faffd[_0xe5be('0x49')]['id'];}return db['ChatGroup'][_0xe5be('0x4a')]({'where':{'id':_0x2faffd[_0xe5be('0x45')]['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x439bad,null))[_0xe5be('0x27')](function(_0x575957){if(_0x575957){_0x2faffd[_0xe5be('0x49')][_0xe5be('0x55')]=_0x575957['id'];return db['ChatInternalMessage'][_0xe5be('0x48')](_0x2faffd['body']);}})[_0xe5be('0x27')](respondWithResult(_0x439bad,null))[_0xe5be('0x44')](handleError(_0x439bad,null));};exports[_0xe5be('0x56')]=function(_0x425863,_0x2466aa,_0x489f8c){var _0x4c758b={};var _0x479137={};var _0x74148e;var _0x11d08c;return db[_0xe5be('0x40')][_0xe5be('0x52')]({'where':{'id':_0x425863['params']['id']}})[_0xe5be('0x27')](handleEntityNotFound(_0x2466aa,null))[_0xe5be('0x27')](function(_0x2dfb24){if(_0x2dfb24){_0x74148e=_0x2dfb24;_0x479137['model']=_[_0xe5be('0x46')](db[_0xe5be('0x4c')][_0xe5be('0x2c')]);_0x479137[_0xe5be('0x2f')]=_[_0xe5be('0x46')](_0x425863[_0xe5be('0x2f')]);_0x479137['filters']=_[_0xe5be('0x30')](_0x479137[_0xe5be('0x32')],_0x479137['query']);_0x4c758b[_0xe5be('0x31')]=_[_0xe5be('0x30')](_0x479137[_0xe5be('0x32')],qs[_0xe5be('0x33')](_0x425863['query']['fields']));_0x4c758b['attributes']=_0x4c758b[_0xe5be('0x31')][_0xe5be('0x47')]?_0x4c758b[_0xe5be('0x31')]:_0x479137[_0xe5be('0x32')];_0x4c758b[_0xe5be('0x36')]=qs[_0xe5be('0x37')](_0x425863[_0xe5be('0x2f')]['sort']);_0x4c758b[_0xe5be('0x38')]=qs['filters'](_[_0xe5be('0x3a')](_0x425863[_0xe5be('0x2f')],_0x479137[_0xe5be('0x39')]));if(_0x425863[_0xe5be('0x2f')]['filter']){_0x4c758b[_0xe5be('0x38')]=_[_0xe5be('0x3c')](_0x4c758b['where'],{'$or':_[_0xe5be('0x2b')](_0x4c758b['attributes'],function(_0x3a04e3){var _0x332ab3={};_0x332ab3[_0x3a04e3]={'$like':'%'+_0x425863[_0xe5be('0x2f')]['filter']+'%'};return _0x332ab3;})});}if(_0x425863[_0xe5be('0x2f')][_0xe5be('0x57')]){var _0x540966=_0x425863[_0xe5be('0x2f')]['$gte'][_0xe5be('0x58')](',');var _0x318d06={};_0x318d06[_0x540966[0x0]]={'$gte':moment(_0x540966[0x1])[_0xe5be('0x59')](_0xe5be('0x5a'))};_0x4c758b[_0xe5be('0x38')]=_[_0xe5be('0x3c')](_0x4c758b[_0xe5be('0x38')],_0x318d06);}_0x4c758b=_['merge']({},_0x4c758b,_0x425863[_0xe5be('0x3f')]);return _0x74148e['getMessages'](_0x4c758b);}})['then'](function(_0x33f878){if(_0x33f878){_0x11d08c=_0x33f878[_0xe5be('0x47')];if(!_0x425863[_0xe5be('0x2f')][_0xe5be('0x34')](_0xe5be('0x5b'))){_0x4c758b[_0xe5be('0x35')]=qs[_0xe5be('0x35')](_0x425863[_0xe5be('0x2f')][_0xe5be('0x35')]);_0x4c758b['offset']=qs[_0xe5be('0x1e')](_0x425863[_0xe5be('0x2f')]['offset']);}return _0x74148e[_0xe5be('0x56')](_0x4c758b);}})[_0xe5be('0x27')](function(_0x5bc794){if(_0x5bc794){return _0x5bc794?{'count':_0x11d08c,'rows':_0x5bc794}:null;}})['then'](respondWithResult(_0x2466aa,null))['catch'](handleError(_0x2466aa,null));};
\ No newline at end of file
+var _0x2e72=['format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','toInteger','addMembers','omit','ids','getMembers','User','order','sort','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2e72,0x11c));var _0x22e7=function(_0x571d85,_0xda439c){_0x571d85=_0x571d85-0x0;var _0x3c2e07=_0x2e72[_0x571d85];return _0x3c2e07;};'use strict';var emlformat=require(_0x22e7('0x0'));var rimraf=require(_0x22e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x22e7('0x2'));var moment=require('moment');var BPromise=require(_0x22e7('0x3'));var Mustache=require('mustache');var util=require(_0x22e7('0x4'));var path=require('path');var sox=require(_0x22e7('0x5'));var csv=require(_0x22e7('0x6'));var ejs=require(_0x22e7('0x7'));var fs=require('fs');var fs_extra=require(_0x22e7('0x8'));var _=require(_0x22e7('0x9'));var squel=require(_0x22e7('0xa'));var crypto=require(_0x22e7('0xb'));var jsforce=require(_0x22e7('0xc'));var deskjs=require(_0x22e7('0xd'));var toCsv=require(_0x22e7('0x6'));var querystring=require(_0x22e7('0xe'));var Papa=require(_0x22e7('0xf'));var Redis=require(_0x22e7('0x10'));var authService=require(_0x22e7('0x11'));var qs=require(_0x22e7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22e7('0x13'))('api');var utils=require(_0x22e7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x22e7('0x15'));var db=require(_0x22e7('0x16'))['db'];config[_0x22e7('0x17')]=_['defaults'](config[_0x22e7('0x17')],{'host':_0x22e7('0x18'),'port':0x18eb});var socket=require(_0x22e7('0x19'))(new Redis(config['redis']));require(_0x22e7('0x1a'))[_0x22e7('0x1b')](socket);function respondWithStatusCode(_0x12f7e9,_0x425572){_0x425572=_0x425572||0xcc;return function(_0x2576a7){if(_0x2576a7){return _0x12f7e9['sendStatus'](_0x425572);}return _0x12f7e9[_0x22e7('0x1c')](_0x425572)[_0x22e7('0x1d')]();};}function respondWithResult(_0x9ebc9e,_0x208e8e){_0x208e8e=_0x208e8e||0xc8;return function(_0x33718d){if(_0x33718d){return _0x9ebc9e['status'](_0x208e8e)[_0x22e7('0x1e')](_0x33718d);}};}function respondWithFilteredResult(_0x4e6df2,_0x168745){return function(_0x3cdcf2){if(_0x3cdcf2){var _0x14f211=typeof _0x168745[_0x22e7('0x1f')]===_0x22e7('0x20')&&typeof _0x168745[_0x22e7('0x21')]==='undefined';var _0x2a7a9c=_0x3cdcf2[_0x22e7('0x22')];var _0x1e252c=_0x14f211?0x0:_0x168745[_0x22e7('0x1f')];var _0x25ab8d=_0x14f211?_0x3cdcf2[_0x22e7('0x22')]:_0x168745[_0x22e7('0x1f')]+_0x168745[_0x22e7('0x21')];var _0xf5470a;if(_0x25ab8d>=_0x2a7a9c){_0x25ab8d=_0x2a7a9c;_0xf5470a=0xc8;}else{_0xf5470a=0xce;}_0x4e6df2[_0x22e7('0x1c')](_0xf5470a);return _0x4e6df2['set'](_0x22e7('0x23'),_0x1e252c+'-'+_0x25ab8d+'/'+_0x2a7a9c)[_0x22e7('0x1e')](_0x3cdcf2);}return null;};}function patchUpdates(_0x1bf7f9){return function(_0xe07d48){try{jsonpatch['apply'](_0xe07d48,_0x1bf7f9,!![]);}catch(_0x8ec519){return BPromise['reject'](_0x8ec519);}return _0xe07d48['save']();};}function saveUpdates(_0x2f2c99,_0x59d2f9){return function(_0x2051d1){if(_0x2051d1){return _0x2051d1[_0x22e7('0x24')](_0x2f2c99)[_0x22e7('0x25')](function(_0x29556e){return _0x29556e;});}return null;};}function removeEntity(_0x23e373,_0xf6048c){return function(_0x691319){if(_0x691319){return _0x691319[_0x22e7('0x26')]()['then'](function(){_0x23e373[_0x22e7('0x1c')](0xcc)[_0x22e7('0x1d')]();});}};}function handleEntityNotFound(_0x37d4ff,_0x6db24f){return function(_0x3af842){if(!_0x3af842){_0x37d4ff[_0x22e7('0x27')](0x194);}return _0x3af842;};}function handleError(_0x56e23d,_0x246bb2){_0x246bb2=_0x246bb2||0x1f4;return function(_0x3e883c){logger[_0x22e7('0x28')](_0x3e883c['stack']);if(_0x3e883c[_0x22e7('0x29')]){delete _0x3e883c[_0x22e7('0x29')];}_0x56e23d[_0x22e7('0x1c')](_0x246bb2)[_0x22e7('0x2a')](_0x3e883c);};}exports[_0x22e7('0x2b')]=function(_0x2096c3,_0x133ce7){var _0xbd59df={},_0x5be9aa={},_0x39431d={'count':0x0,'rows':[]};var _0x2d05be=_[_0x22e7('0x2c')](db[_0x22e7('0x2d')][_0x22e7('0x2e')],function(_0x323bba){return{'name':_0x323bba['fieldName'],'type':_0x323bba[_0x22e7('0x2f')][_0x22e7('0x30')]};});_0x5be9aa[_0x22e7('0x31')]=_[_0x22e7('0x2c')](_0x2d05be,_0x22e7('0x29'));_0x5be9aa[_0x22e7('0x32')]=_[_0x22e7('0x33')](_0x2096c3[_0x22e7('0x32')]);_0x5be9aa[_0x22e7('0x34')]=_[_0x22e7('0x35')](_0x5be9aa[_0x22e7('0x31')],_0x5be9aa[_0x22e7('0x32')]);_0xbd59df[_0x22e7('0x36')]=_[_0x22e7('0x35')](_0x5be9aa[_0x22e7('0x31')],qs['fields'](_0x2096c3[_0x22e7('0x32')][_0x22e7('0x37')]));_0xbd59df[_0x22e7('0x36')]=_0xbd59df[_0x22e7('0x36')][_0x22e7('0x38')]?_0xbd59df[_0x22e7('0x36')]:_0x5be9aa[_0x22e7('0x31')];if(!_0x2096c3[_0x22e7('0x32')][_0x22e7('0x39')](_0x22e7('0x3a'))){_0xbd59df[_0x22e7('0x21')]=qs['limit'](_0x2096c3[_0x22e7('0x32')]['limit']);_0xbd59df[_0x22e7('0x1f')]=qs[_0x22e7('0x1f')](_0x2096c3[_0x22e7('0x32')]['offset']);}_0xbd59df['order']=qs['sort'](_0x2096c3[_0x22e7('0x32')]['sort']);_0xbd59df[_0x22e7('0x3b')]=qs[_0x22e7('0x34')](_[_0x22e7('0x3c')](_0x2096c3['query'],_0x5be9aa[_0x22e7('0x34')]),_0x2d05be);if(_0x2096c3[_0x22e7('0x32')][_0x22e7('0x3d')]){_0xbd59df['where']=_[_0x22e7('0x3e')](_0xbd59df[_0x22e7('0x3b')],{'$or':_[_0x22e7('0x2c')](_0x2d05be,function(_0x3b27c0){if(_0x3b27c0['type']!==_0x22e7('0x3f')){var _0x4518b1={};_0x4518b1[_0x3b27c0['name']]={'$like':'%'+_0x2096c3[_0x22e7('0x32')][_0x22e7('0x3d')]+'%'};return _0x4518b1;}})});}_0xbd59df=_[_0x22e7('0x3e')]({},_0xbd59df,_0x2096c3[_0x22e7('0x40')]);var _0x1e10bd={'where':_0xbd59df[_0x22e7('0x3b')]};return db[_0x22e7('0x2d')][_0x22e7('0x22')](_0x1e10bd)[_0x22e7('0x25')](function(_0x1b2bc0){_0x39431d[_0x22e7('0x22')]=_0x1b2bc0;if(_0x2096c3[_0x22e7('0x32')][_0x22e7('0x41')]){_0xbd59df[_0x22e7('0x42')]=[{'all':!![]}];}return db[_0x22e7('0x2d')][_0x22e7('0x43')](_0xbd59df);})[_0x22e7('0x25')](function(_0x3bc116){_0x39431d[_0x22e7('0x44')]=_0x3bc116;return _0x39431d;})[_0x22e7('0x25')](respondWithFilteredResult(_0x133ce7,_0xbd59df))[_0x22e7('0x45')](handleError(_0x133ce7,null));};exports[_0x22e7('0x46')]=function(_0x265136,_0xba8bf4){var _0x18072c={'raw':!![],'where':{'id':_0x265136[_0x22e7('0x47')]['id']}},_0x59bf1a={};_0x59bf1a[_0x22e7('0x31')]=_[_0x22e7('0x33')](db['ChatGroup']['rawAttributes']);_0x59bf1a[_0x22e7('0x32')]=_[_0x22e7('0x33')](_0x265136['query']);_0x59bf1a[_0x22e7('0x34')]=_[_0x22e7('0x35')](_0x59bf1a['model'],_0x59bf1a['query']);_0x18072c[_0x22e7('0x36')]=_[_0x22e7('0x35')](_0x59bf1a[_0x22e7('0x31')],qs['fields'](_0x265136[_0x22e7('0x32')]['fields']));_0x18072c['attributes']=_0x18072c[_0x22e7('0x36')]['length']?_0x18072c[_0x22e7('0x36')]:_0x59bf1a[_0x22e7('0x31')];if(_0x265136[_0x22e7('0x32')][_0x22e7('0x41')]){_0x18072c['include']=[{'all':!![]}];}_0x18072c=_[_0x22e7('0x3e')]({},_0x18072c,_0x265136[_0x22e7('0x40')]);return db['ChatGroup'][_0x22e7('0x48')](_0x18072c)[_0x22e7('0x25')](handleEntityNotFound(_0xba8bf4,null))[_0x22e7('0x25')](respondWithResult(_0xba8bf4,null))[_0x22e7('0x45')](handleError(_0xba8bf4,null));};exports[_0x22e7('0x49')]=function(_0x11b014,_0x1b2b48){return db[_0x22e7('0x2d')][_0x22e7('0x49')](_0x11b014['body'],{})[_0x22e7('0x25')](respondWithResult(_0x1b2b48,0xc9))[_0x22e7('0x45')](handleError(_0x1b2b48,null));};exports[_0x22e7('0x24')]=function(_0x7e30f0,_0x47aa08){if(_0x7e30f0[_0x22e7('0x4a')]['id']){delete _0x7e30f0[_0x22e7('0x4a')]['id'];}return db[_0x22e7('0x2d')][_0x22e7('0x48')]({'where':{'id':_0x7e30f0[_0x22e7('0x47')]['id']}})[_0x22e7('0x25')](handleEntityNotFound(_0x47aa08,null))[_0x22e7('0x25')](saveUpdates(_0x7e30f0['body'],null))['then'](respondWithResult(_0x47aa08,null))[_0x22e7('0x45')](handleError(_0x47aa08,null));};exports[_0x22e7('0x26')]=function(_0x1e0f80,_0x42142c){return db[_0x22e7('0x2d')][_0x22e7('0x48')]({'where':{'id':_0x1e0f80['params']['id']}})['then'](handleEntityNotFound(_0x42142c,null))['then'](removeEntity(_0x42142c,null))[_0x22e7('0x45')](handleError(_0x42142c,null));};exports[_0x22e7('0x4b')]=function(_0x1728b4,_0x1820d0){return db[_0x22e7('0x2d')][_0x22e7('0x4b')]()[_0x22e7('0x25')](respondWithResult(_0x1820d0,null))[_0x22e7('0x45')](handleError(_0x1820d0,null));};exports['getUnread']=function(_0x118142,_0x10aff1,_0x5087c0){return db['ChatInternalMessage'][_0x22e7('0x22')]({'where':{'ChatGroupId':_0x118142['params']['id'],'ToId':_0x118142['user']['id'],'read':![]}})[_0x22e7('0x25')](function(_0x4a7aa8){return{'id':_[_0x22e7('0x4c')](_0x118142[_0x22e7('0x47')]['id']),'count':_0x4a7aa8};})[_0x22e7('0x25')](respondWithResult(_0x10aff1,null))[_0x22e7('0x45')](handleError(_0x10aff1,null));};exports[_0x22e7('0x4d')]=function(_0x323d3c,_0x5733fd,_0x330031){return db[_0x22e7('0x2d')][_0x22e7('0x48')]({'where':{'id':_0x323d3c['params']['id']}})['then'](handleEntityNotFound(_0x5733fd,null))[_0x22e7('0x25')](function(_0x6e17b0){if(_0x6e17b0){return _0x6e17b0['addMembers'](_0x323d3c[_0x22e7('0x4a')]['ids'],_[_0x22e7('0x4e')](_0x323d3c[_0x22e7('0x4a')],[_0x22e7('0x4f'),'id'])||{});}})[_0x22e7('0x25')](respondWithResult(_0x5733fd,null))[_0x22e7('0x45')](handleError(_0x5733fd,null));};exports[_0x22e7('0x50')]=function(_0x48bdef,_0xa8c13c,_0x136bed){var _0x4b3200={};var _0x4c11c6={};var _0x838af0;var _0x581ff9;return db[_0x22e7('0x2d')]['findOne']({'where':{'id':_0x48bdef[_0x22e7('0x47')]['id']}})['then'](handleEntityNotFound(_0xa8c13c,null))[_0x22e7('0x25')](function(_0x18f553){if(_0x18f553){_0x838af0=_0x18f553;_0x4c11c6[_0x22e7('0x31')]=_['keys'](db[_0x22e7('0x51')]['rawAttributes']);_0x4c11c6[_0x22e7('0x32')]=_[_0x22e7('0x33')](_0x48bdef[_0x22e7('0x32')]);_0x4c11c6['filters']=_[_0x22e7('0x35')](_0x4c11c6[_0x22e7('0x31')],_0x4c11c6['query']);_0x4b3200[_0x22e7('0x36')]=_[_0x22e7('0x35')](_0x4c11c6[_0x22e7('0x31')],qs[_0x22e7('0x37')](_0x48bdef[_0x22e7('0x32')][_0x22e7('0x37')]));_0x4b3200[_0x22e7('0x36')]=_0x4b3200[_0x22e7('0x36')]['length']?_0x4b3200[_0x22e7('0x36')]:_0x4c11c6['model'];_0x4b3200[_0x22e7('0x52')]=qs[_0x22e7('0x53')](_0x48bdef['query']['sort']);_0x4b3200['where']=qs[_0x22e7('0x34')](_[_0x22e7('0x3c')](_0x48bdef[_0x22e7('0x32')],_0x4c11c6[_0x22e7('0x34')]));if(_0x48bdef['query'][_0x22e7('0x3d')]){_0x4b3200['where']=_['merge'](_0x4b3200[_0x22e7('0x3b')],{'$or':_[_0x22e7('0x2c')](_0x4b3200['attributes'],function(_0x4501ae){var _0x2d5e94={};_0x2d5e94[_0x4501ae]={'$like':'%'+_0x48bdef[_0x22e7('0x32')][_0x22e7('0x3d')]+'%'};return _0x2d5e94;})});}_0x4b3200=_[_0x22e7('0x3e')]({},_0x4b3200,_0x48bdef[_0x22e7('0x40')]);return _0x838af0[_0x22e7('0x50')](_0x4b3200);}})[_0x22e7('0x25')](function(_0x251f00){if(_0x251f00){_0x581ff9=_0x251f00['length'];if(!_0x48bdef[_0x22e7('0x32')][_0x22e7('0x39')]('nolimit')){_0x4b3200['limit']=qs[_0x22e7('0x21')](_0x48bdef[_0x22e7('0x32')][_0x22e7('0x21')]);_0x4b3200[_0x22e7('0x1f')]=qs[_0x22e7('0x1f')](_0x48bdef[_0x22e7('0x32')][_0x22e7('0x1f')]);}return _0x838af0[_0x22e7('0x50')](_0x4b3200);}})[_0x22e7('0x25')](function(_0x36d08d){if(_0x36d08d){return _0x36d08d?{'count':_0x581ff9,'rows':_0x36d08d}:null;}})[_0x22e7('0x25')](respondWithResult(_0xa8c13c,null))[_0x22e7('0x45')](handleError(_0xa8c13c,null));};exports[_0x22e7('0x54')]=function(_0x494281,_0x55dbe9,_0x184dee){return db[_0x22e7('0x2d')][_0x22e7('0x48')]({'where':{'id':_0x494281[_0x22e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x55dbe9,null))[_0x22e7('0x25')](function(_0x18a528){if(_0x18a528){return _0x18a528[_0x22e7('0x54')](_0x494281[_0x22e7('0x32')][_0x22e7('0x4f')]);}})[_0x22e7('0x25')](respondWithStatusCode(_0x55dbe9,null))[_0x22e7('0x45')](handleError(_0x55dbe9,null));};exports[_0x22e7('0x55')]=function(_0x429edc,_0x56c860,_0x5bff9b){if(_0x429edc[_0x22e7('0x4a')]['id']){delete _0x429edc['body']['id'];}return db[_0x22e7('0x2d')][_0x22e7('0x48')]({'where':{'id':_0x429edc[_0x22e7('0x47')]['id']}})[_0x22e7('0x25')](handleEntityNotFound(_0x56c860,null))[_0x22e7('0x25')](function(_0x5c42c1){if(_0x5c42c1){_0x429edc[_0x22e7('0x4a')][_0x22e7('0x56')]=_0x5c42c1['id'];return db[_0x22e7('0x57')][_0x22e7('0x49')](_0x429edc[_0x22e7('0x4a')]);}})['then'](respondWithResult(_0x56c860,null))[_0x22e7('0x45')](handleError(_0x56c860,null));};exports[_0x22e7('0x58')]=function(_0x3a9b27,_0xfda45d,_0x352801){var _0x2e144d={};var _0x16be42={};var _0x603722;var _0x10ec9d;return db['ChatGroup'][_0x22e7('0x59')]({'where':{'id':_0x3a9b27[_0x22e7('0x47')]['id']}})['then'](handleEntityNotFound(_0xfda45d,null))[_0x22e7('0x25')](function(_0x14d466){if(_0x14d466){_0x603722=_0x14d466;_0x16be42[_0x22e7('0x31')]=_[_0x22e7('0x33')](db[_0x22e7('0x57')]['rawAttributes']);_0x16be42[_0x22e7('0x32')]=_[_0x22e7('0x33')](_0x3a9b27[_0x22e7('0x32')]);_0x16be42[_0x22e7('0x34')]=_[_0x22e7('0x35')](_0x16be42[_0x22e7('0x31')],_0x16be42[_0x22e7('0x32')]);_0x2e144d['attributes']=_[_0x22e7('0x35')](_0x16be42[_0x22e7('0x31')],qs[_0x22e7('0x37')](_0x3a9b27[_0x22e7('0x32')][_0x22e7('0x37')]));_0x2e144d[_0x22e7('0x36')]=_0x2e144d['attributes'][_0x22e7('0x38')]?_0x2e144d['attributes']:_0x16be42[_0x22e7('0x31')];_0x2e144d['order']=qs['sort'](_0x3a9b27[_0x22e7('0x32')][_0x22e7('0x53')]);_0x2e144d[_0x22e7('0x3b')]=qs['filters'](_[_0x22e7('0x3c')](_0x3a9b27['query'],_0x16be42[_0x22e7('0x34')]));if(_0x3a9b27[_0x22e7('0x32')][_0x22e7('0x3d')]){_0x2e144d[_0x22e7('0x3b')]=_['merge'](_0x2e144d[_0x22e7('0x3b')],{'$or':_[_0x22e7('0x2c')](_0x2e144d[_0x22e7('0x36')],function(_0x30ec01){var _0x2f0f87={};_0x2f0f87[_0x30ec01]={'$like':'%'+_0x3a9b27[_0x22e7('0x32')]['filter']+'%'};return _0x2f0f87;})});}if(_0x3a9b27[_0x22e7('0x32')][_0x22e7('0x5a')]){var _0x259c41=_0x3a9b27[_0x22e7('0x32')]['$gte'][_0x22e7('0x5b')](',');var _0x44ed73={};_0x44ed73[_0x259c41[0x0]]={'$gte':moment(_0x259c41[0x1])[_0x22e7('0x5c')](_0x22e7('0x5d'))};_0x2e144d[_0x22e7('0x3b')]=_['merge'](_0x2e144d[_0x22e7('0x3b')],_0x44ed73);}_0x2e144d=_['merge']({},_0x2e144d,_0x3a9b27['options']);return _0x603722[_0x22e7('0x58')](_0x2e144d);}})[_0x22e7('0x25')](function(_0x20b74e){if(_0x20b74e){_0x10ec9d=_0x20b74e[_0x22e7('0x38')];if(!_0x3a9b27[_0x22e7('0x32')][_0x22e7('0x39')](_0x22e7('0x3a'))){_0x2e144d[_0x22e7('0x21')]=qs[_0x22e7('0x21')](_0x3a9b27['query']['limit']);_0x2e144d[_0x22e7('0x1f')]=qs['offset'](_0x3a9b27[_0x22e7('0x32')][_0x22e7('0x1f')]);}return _0x603722[_0x22e7('0x58')](_0x2e144d);}})[_0x22e7('0x25')](function(_0x52978d){if(_0x52978d){return _0x52978d?{'count':_0x10ec9d,'rows':_0x52978d}:null;}})[_0x22e7('0x25')](respondWithResult(_0xfda45d,null))[_0x22e7('0x45')](handleError(_0xfda45d,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 76f5ad8..5f420c4 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 _0x7750=['hook','events','ChatGroup','setMaxListeners','emit'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0x7750,0x182));var _0x0775=function(_0x5b77fe,_0x3ba4ec){_0x5b77fe=_0x5b77fe-0x0;var _0x33cf70=_0x7750[_0x5b77fe];return _0x33cf70;};'use strict';var EventEmitter=require(_0x0775('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0775('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0775('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x255bdc){return function(_0x26b370,_0x114bbd,_0x3a2f34){ChatGroupEvents[_0x0775('0x3')](_0x255bdc+':'+_0x26b370['id'],_0x26b370);ChatGroupEvents[_0x0775('0x3')](_0x255bdc,_0x26b370);_0x3a2f34(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0775('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x7d8d=['hook','exports','events','../../mysqldb','ChatGroup','save','remove','emit','hasOwnProperty'];(function(_0x1c8e01,_0x214061){var _0x1c0a52=function(_0x2903b2){while(--_0x2903b2){_0x1c8e01['push'](_0x1c8e01['shift']());}};_0x1c0a52(++_0x214061);}(_0x7d8d,0x134));var _0xd7d8=function(_0x59f624,_0x5d01bd){_0x59f624=_0x59f624-0x0;var _0xc848a5=_0x7d8d[_0x59f624];return _0xc848a5;};'use strict';var EventEmitter=require(_0xd7d8('0x0'));var ChatGroup=require(_0xd7d8('0x1'))['db'][_0xd7d8('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd7d8('0x3'),'afterUpdate':'update','afterDestroy':_0xd7d8('0x4')};function emitEvent(_0x12de2f){return function(_0xb37a2b,_0x443200,_0x4a2da3){ChatGroupEvents[_0xd7d8('0x5')](_0x12de2f+':'+_0xb37a2b['id'],_0xb37a2b);ChatGroupEvents[_0xd7d8('0x5')](_0x12de2f,_0xb37a2b);_0x4a2da3(null);};}for(var e in events){if(events[_0xd7d8('0x6')](e)){var event=events[e];ChatGroup[_0xd7d8('0x7')](e,emitEvent(event));}}module[_0xd7d8('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index d4a5c61..a30014d 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 _0xe3c5=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0x9056a4,_0x421387){var _0x39324e=function(_0x54d19a){while(--_0x54d19a){_0x9056a4['push'](_0x9056a4['shift']());}};_0x39324e(++_0x421387);}(_0xe3c5,0xfa));var _0x5e3c=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0xe3c5[_0x5f746f];return _0x198d15;};'use strict';var _=require(_0x5e3c('0x0'));var util=require('util');var logger=require(_0x5e3c('0x1'))('api');var moment=require(_0x5e3c('0x2'));var BPromise=require(_0x5e3c('0x3'));var rp=require(_0x5e3c('0x4'));var fs=require('fs');var path=require(_0x5e3c('0x5'));var rimraf=require('rimraf');var config=require(_0x5e3c('0x6'));var attributes=require(_0x5e3c('0x7'));module[_0x5e3c('0x8')]=function(_0x599055,_0x2a13a1){return _0x599055['define']('ChatGroup',attributes,{'tableName':_0x5e3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e9a=['./chatGroup.attributes','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x302e01,_0xfd8a5){var _0x379e38=function(_0x240e7b){while(--_0x240e7b){_0x302e01['push'](_0x302e01['shift']());}};_0x379e38(++_0xfd8a5);}(_0x5e9a,0xee));var _0xa5e9=function(_0x5264ff,_0x51395b){_0x5264ff=_0x5264ff-0x0;var _0x390fd3=_0x5e9a[_0x5264ff];return _0x390fd3;};'use strict';var _=require('lodash');var util=require(_0xa5e9('0x0'));var logger=require(_0xa5e9('0x1'))(_0xa5e9('0x2'));var moment=require(_0xa5e9('0x3'));var BPromise=require(_0xa5e9('0x4'));var rp=require(_0xa5e9('0x5'));var fs=require('fs');var path=require(_0xa5e9('0x6'));var rimraf=require(_0xa5e9('0x7'));var config=require(_0xa5e9('0x8'));var attributes=require(_0xa5e9('0x9'));module['exports']=function(_0x8644ca,_0x2fd666){return _0x8644ca[_0xa5e9('0xa')](_0xa5e9('0xb'),attributes,{'tableName':_0xa5e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 9b57e57..d12947b 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 _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(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x536e,0x155));var _0xe536=function(_0x550eb7,_0x465856){_0x550eb7=_0x550eb7-0x0;var _0x33bffe=_0x536e[_0x550eb7];return _0x33bffe;};'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
+var _0x331c=['ioredis','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment'];(function(_0x28fac3,_0x49b0e7){var _0x3b79e6=function(_0x25a1b8){while(--_0x25a1b8){_0x28fac3['push'](_0x28fac3['shift']());}};_0x3b79e6(++_0x49b0e7);}(_0x331c,0xf0));var _0xc331=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x331c[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xc331('0x0'));var util=require('util');var moment=require(_0xc331('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc331('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc331('0x3'))('rpc');var config=require(_0xc331('0x4'));var jayson=require(_0xc331('0x5'));var client=jayson['client'][_0xc331('0x6')]({'port':0x232a});config[_0xc331('0x7')]=_['defaults'](config[_0xc331('0x7')],{'host':_0xc331('0x8'),'port':0x18eb});var socket=require(_0xc331('0x9'))(new Redis(config[_0xc331('0x7')]));require('./chatGroup.socket')[_0xc331('0xa')](socket);function respondWithRpcPromise(_0x55769a,_0x2c4a55,_0x3d9205){return new BPromise(function(_0x4381be,_0x199287){return client[_0xc331('0xb')](_0x55769a,_0x3d9205)[_0xc331('0xc')](function(_0x3e5932){logger[_0xc331('0xd')](_0xc331('0xe'),_0x2c4a55,'request\x20sent');logger[_0xc331('0xf')](_0xc331('0x10'),_0x2c4a55,_0xc331('0x11'),JSON[_0xc331('0x12')](_0x3e5932));if(_0x3e5932[_0xc331('0x13')]){if(_0x3e5932[_0xc331('0x13')]['code']===0x1f4){logger[_0xc331('0x13')](_0xc331('0xe'),_0x2c4a55,_0x3e5932['error'][_0xc331('0x14')]);return _0x199287(_0x3e5932[_0xc331('0x13')][_0xc331('0x14')]);}logger[_0xc331('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2c4a55,_0x3e5932['error'][_0xc331('0x14')]);return _0x4381be(_0x3e5932[_0xc331('0x13')]['message']);}else{logger[_0xc331('0xd')](_0xc331('0xe'),_0x2c4a55,'request\x20sent');_0x4381be(_0x3e5932[_0xc331('0x15')][_0xc331('0x14')]);}})['catch'](function(_0x110afe){logger[_0xc331('0x13')](_0xc331('0xe'),_0x2c4a55,_0x110afe);_0x199287(_0x110afe);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 510a066..6db246d 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 _0x40d1=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x102469,_0x3af853){var _0x57cd31=function(_0x57de24){while(--_0x57de24){_0x102469['push'](_0x102469['shift']());}};_0x57cd31(++_0x3af853);}(_0x40d1,0x130));var _0x140d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x40d1[_0x1035c1];return _0x308d67;};'use strict';var ChatGroupEvents=require(_0x140d('0x0'));var events=[_0x140d('0x1'),_0x140d('0x2'),_0x140d('0x3')];function createListener(_0x25d61a,_0x3be6ee){return function(_0x247473){_0x3be6ee[_0x140d('0x4')](_0x25d61a,_0x247473);};}function removeListener(_0x39fc6a,_0x3289fb){return function(){ChatGroupEvents[_0x140d('0x5')](_0x39fc6a,_0x3289fb);};}exports[_0x140d('0x6')]=function(_0x14d72f){for(var _0x424ae4=0x0,_0x801b4b=events[_0x140d('0x7')];_0x424ae4<_0x801b4b;_0x424ae4++){var _0x5e424b=events[_0x424ae4];var _0x50fd0c=createListener(_0x140d('0x8')+_0x5e424b,_0x14d72f);ChatGroupEvents['on'](_0x5e424b,_0x50fd0c);}};
\ No newline at end of file
+var _0x8892=['save','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8892,0xb7));var _0x2889=function(_0x174024,_0x1c34d3){_0x174024=_0x174024-0x0;var _0x1e6f08=_0x8892[_0x174024];return _0x1e6f08;};'use strict';var ChatGroupEvents=require(_0x2889('0x0'));var events=[_0x2889('0x1'),'remove',_0x2889('0x2')];function createListener(_0x22378f,_0x5dadc3){return function(_0x11009a){_0x5dadc3[_0x2889('0x3')](_0x22378f,_0x11009a);};}function removeListener(_0x13e14a,_0x1377ff){return function(){ChatGroupEvents[_0x2889('0x4')](_0x13e14a,_0x1377ff);};}exports[_0x2889('0x5')]=function(_0x51062c){for(var _0x1f7787=0x0,_0x231348=events[_0x2889('0x6')];_0x1f7787<_0x231348;_0x1f7787++){var _0x5202c9=events[_0x1f7787];var _0x34bf98=createListener(_0x2889('0x7')+_0x5202c9,_0x51062c);ChatGroupEvents['on'](_0x5202c9,_0x34bf98);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index fcdf46c..c4abd36 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 _0x68ac=['connect-timeout','Router','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','delete','destroy','removeMembers','exports','util','path'];(function(_0x45b9b1,_0x432eab){var _0x245b7d=function(_0x35f14a){while(--_0x35f14a){_0x45b9b1['push'](_0x45b9b1['shift']());}};_0x245b7d(++_0x432eab);}(_0x68ac,0x6a));var _0xc68a=function(_0x38fad2,_0x169ef8){_0x38fad2=_0x38fad2-0x0;var _0x1fd3fa=_0x68ac[_0x38fad2];return _0x1fd3fa;};'use strict';var multer=require('multer');var util=require(_0xc68a('0x0'));var path=require(_0xc68a('0x1'));var timeout=require(_0xc68a('0x2'));var express=require('express');var router=express[_0xc68a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc68a('0x4'));var controller=require('./chatGroup.controller');router[_0xc68a('0x5')]('/',auth['isAuthenticated'](),controller[_0xc68a('0x6')]);router['get'](_0xc68a('0x7'),auth[_0xc68a('0x8')](),controller[_0xc68a('0x9')]);router[_0xc68a('0x5')](_0xc68a('0xa'),auth['isAuthenticated'](),controller[_0xc68a('0xb')]);router[_0xc68a('0x5')](_0xc68a('0xc'),auth[_0xc68a('0x8')](),controller[_0xc68a('0xd')]);router[_0xc68a('0x5')](_0xc68a('0xe'),auth[_0xc68a('0x8')](),controller[_0xc68a('0xf')]);router[_0xc68a('0x5')](_0xc68a('0x10'),auth['isAuthenticated'](),controller[_0xc68a('0x11')]);router[_0xc68a('0x12')]('/',auth[_0xc68a('0x8')](),controller[_0xc68a('0x13')]);router[_0xc68a('0x12')](_0xc68a('0xe'),auth[_0xc68a('0x8')](),controller['addMembers']);router[_0xc68a('0x12')](_0xc68a('0x10'),auth['isAuthenticated'](),controller[_0xc68a('0x14')]);router[_0xc68a('0x15')](_0xc68a('0xa'),auth[_0xc68a('0x8')](),controller[_0xc68a('0x16')]);router[_0xc68a('0x17')](_0xc68a('0xa'),auth['isAuthenticated'](),controller[_0xc68a('0x18')]);router[_0xc68a('0x17')]('/:id/members',auth[_0xc68a('0x8')](),controller[_0xc68a('0x19')]);module[_0xc68a('0x1a')]=router;
\ No newline at end of file
+var _0x8aef=['/describe','describe','get','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x3fc287,_0x5c3f36){var _0x33af9f=function(_0x27cfc6){while(--_0x27cfc6){_0x3fc287['push'](_0x3fc287['shift']());}};_0x33af9f(++_0x5c3f36);}(_0x8aef,0x9e));var _0xf8ae=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x8aef[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0xf8ae('0x0'));var util=require(_0xf8ae('0x1'));var path=require(_0xf8ae('0x2'));var timeout=require(_0xf8ae('0x3'));var express=require(_0xf8ae('0x4'));var router=express[_0xf8ae('0x5')]();var fs_extra=require(_0xf8ae('0x6'));var auth=require(_0xf8ae('0x7'));var interaction=require(_0xf8ae('0x8'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0xf8ae('0x9')](),controller['index']);router['get'](_0xf8ae('0xa'),auth[_0xf8ae('0x9')](),controller[_0xf8ae('0xb')]);router[_0xf8ae('0xc')](_0xf8ae('0xd'),auth[_0xf8ae('0x9')](),controller['show']);router[_0xf8ae('0xc')](_0xf8ae('0xe'),auth[_0xf8ae('0x9')](),controller[_0xf8ae('0xf')]);router[_0xf8ae('0xc')](_0xf8ae('0x10'),auth[_0xf8ae('0x9')](),controller[_0xf8ae('0x11')]);router['get'](_0xf8ae('0x12'),auth[_0xf8ae('0x9')](),controller[_0xf8ae('0x13')]);router[_0xf8ae('0x14')]('/',auth[_0xf8ae('0x9')](),controller[_0xf8ae('0x15')]);router[_0xf8ae('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0xf8ae('0x16')]);router[_0xf8ae('0x14')](_0xf8ae('0x12'),auth[_0xf8ae('0x9')](),controller[_0xf8ae('0x17')]);router[_0xf8ae('0x18')]('/:id',auth[_0xf8ae('0x9')](),controller[_0xf8ae('0x19')]);router[_0xf8ae('0x1a')](_0xf8ae('0xd'),auth[_0xf8ae('0x9')](),controller['destroy']);router[_0xf8ae('0x1a')](_0xf8ae('0x10'),auth[_0xf8ae('0x9')](),controller['removeMembers']);module[_0xf8ae('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index b5942f3..f06bad5 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 _0x0bf5=['BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0x0bf5,0x11c));var _0x50bf=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x0bf5[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0x50bf('0x0'));module[_0x50bf('0x1')]={'closed':{'type':Sequelize[_0x50bf('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x50bf('0x3')]},'ratingType':{'type':Sequelize[_0x50bf('0x4')](_0x50bf('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x50bf('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x50bf('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x50bf('0x8')]},'disposition':{'type':Sequelize[_0x50bf('0x7')]},'secondDisposition':{'type':Sequelize[_0x50bf('0x7')]},'thirdDisposition':{'type':Sequelize[_0x50bf('0x7')]},'note':{'type':Sequelize[_0x50bf('0x7')]},'browserName':{'type':Sequelize[_0x50bf('0x7')]},'browserVersion':{'type':Sequelize[_0x50bf('0x7')]},'osName':{'type':Sequelize[_0x50bf('0x7')]},'osVersion':{'type':Sequelize[_0x50bf('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x50bf('0x7')]},'deviceType':{'type':Sequelize[_0x50bf('0x7')]},'referer':{'type':Sequelize[_0x50bf('0x6')]},'customerIp':{'type':Sequelize[_0x50bf('0x7')]},'formData':{'type':Sequelize[_0x50bf('0x6')](_0x50bf('0x9'))},'read1stAt':{'type':Sequelize[_0x50bf('0x8')]},'lastMsgAt':{'type':Sequelize[_0x50bf('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x50bf('0x4')]('in',_0x50bf('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x50bf('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x50bf('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x50bf('0x3')]}};
\ No newline at end of file
+var _0x1596=['INTEGER','sequelize','exports','BOOLEAN','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0x1596,0x175));var _0x6159=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1596[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x6159('0x0'));module[_0x6159('0x1')]={'closed':{'type':Sequelize[_0x6159('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x6159('0x3'),_0x6159('0x4')),'defaultValue':_0x6159('0x3')},'ratingMessage':{'type':Sequelize[_0x6159('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6159('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6159('0x7')]},'disposition':{'type':Sequelize[_0x6159('0x6')]},'secondDisposition':{'type':Sequelize[_0x6159('0x6')]},'thirdDisposition':{'type':Sequelize[_0x6159('0x6')]},'note':{'type':Sequelize[_0x6159('0x6')]},'browserName':{'type':Sequelize[_0x6159('0x6')]},'browserVersion':{'type':Sequelize[_0x6159('0x6')]},'osName':{'type':Sequelize[_0x6159('0x6')]},'osVersion':{'type':Sequelize[_0x6159('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x6159('0x6')]},'deviceType':{'type':Sequelize[_0x6159('0x6')]},'referer':{'type':Sequelize[_0x6159('0x5')]},'customerIp':{'type':Sequelize[_0x6159('0x6')]},'formData':{'type':Sequelize[_0x6159('0x5')](_0x6159('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6159('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x6159('0x9')]('in',_0x6159('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6159('0x6')]},'customerPort':{'type':Sequelize[_0x6159('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x6159('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x6159('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6159('0xb')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4827ac9..aa6700f 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 _0xe705=['redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','destroy','stack','name','render','merge','body','contact','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','attributes','fields','includeAll','include','options','find','create','update','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ContactId','%s%d','Visitor','agentAlias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','Contact','firstName','Account','Owner','get','mkdirSync','Chat','N.A.','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x3dc24c,_0x1f231d){var _0x4f0e1d=function(_0x3c4b6e){while(--_0x3c4b6e){_0x3dc24c['push'](_0x3dc24c['shift']());}};_0x4f0e1d(++_0x1f231d);}(_0xe705,0xc8));var _0x5e70=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0xe705[_0x54a9e3];return _0x247cce;};'use strict';var rimraf=require(_0x5e70('0x0'));var zipdir=require(_0x5e70('0x1'));var rp=require(_0x5e70('0x2'));var moment=require(_0x5e70('0x3'));var BPromise=require(_0x5e70('0x4'));var Mustache=require('mustache');var util=require(_0x5e70('0x5'));var path=require(_0x5e70('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e70('0x7'));var Redis=require(_0x5e70('0x8'));var interaction=require(_0x5e70('0x9'));var qs=require(_0x5e70('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0x5e70('0xb'))('api');var config=require(_0x5e70('0xc'));var db=require(_0x5e70('0xd'))['db'];config[_0x5e70('0xe')]=_['defaults'](config[_0x5e70('0xe')],{'host':_0x5e70('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5e70('0x10'))[_0x5e70('0x11')](socket);var jayson=require(_0x5e70('0x12'));var client=jayson[_0x5e70('0x13')][_0x5e70('0x14')]({'port':0x232b});var client9004=jayson[_0x5e70('0x13')][_0x5e70('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x2fb9d2,_0x55f4f7,_0x3d68eb,_0x37d258){return new BPromise(function(_0x17d963,_0x2c30ee){var _0x4895ae=_0x37d258||client;return _0x4895ae[_0x5e70('0x15')](_0x2fb9d2,_0x3d68eb)[_0x5e70('0x16')](function(_0x40b261){logger['info'](_0x5e70('0x17'),_0x55f4f7,_0x5e70('0x18'));logger[_0x5e70('0x19')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x55f4f7,'request\x20sent',JSON[_0x5e70('0x1a')](_0x40b261));if(_0x40b261[_0x5e70('0x1b')]){if(_0x40b261[_0x5e70('0x1b')]['code']===0x1f4){logger[_0x5e70('0x1b')](_0x5e70('0x17'),_0x55f4f7,_0x40b261[_0x5e70('0x1b')][_0x5e70('0x1c')]);return _0x2c30ee(_0x40b261[_0x5e70('0x1b')][_0x5e70('0x1c')]);}logger[_0x5e70('0x1b')](_0x5e70('0x17'),_0x55f4f7,_0x40b261[_0x5e70('0x1b')][_0x5e70('0x1c')]);return _0x17d963(_0x40b261[_0x5e70('0x1b')][_0x5e70('0x1c')]);}else{logger[_0x5e70('0x1d')](_0x5e70('0x17'),_0x55f4f7,'request\x20sent');_0x17d963(_0x40b261[_0x5e70('0x1e')]['message']);}})[_0x5e70('0x1f')](function(_0xdc589e){logger[_0x5e70('0x1b')](_0x5e70('0x17'),_0x55f4f7,_0xdc589e);_0x2c30ee(_0xdc589e);});});}function respondWithStatusCode(_0x43fcfc,_0x515782){_0x515782=_0x515782||0xcc;return function(_0x313229){if(_0x313229){return _0x43fcfc[_0x5e70('0x20')](_0x515782);}return _0x43fcfc['status'](_0x515782)[_0x5e70('0x21')]();};}function respondWithResult(_0x17f0ae,_0xf5e495){_0xf5e495=_0xf5e495||0xc8;return function(_0x18d401){if(_0x18d401){return _0x17f0ae[_0x5e70('0x22')](_0xf5e495)[_0x5e70('0x23')](_0x18d401);}};}function respondWithFilteredResult(_0x4f033b,_0xa5bd7c){return function(_0x11043d){if(_0x11043d){var _0x26dba6=typeof _0xa5bd7c[_0x5e70('0x24')]===_0x5e70('0x25')&&typeof _0xa5bd7c['limit']===_0x5e70('0x25');var _0x3d2978=_0x11043d[_0x5e70('0x26')];var _0xafb6fd=_0x26dba6?0x0:_0xa5bd7c[_0x5e70('0x24')];var _0x5bc0c4=_0x26dba6?_0x11043d[_0x5e70('0x26')]:_0xa5bd7c['offset']+_0xa5bd7c[_0x5e70('0x27')];var _0x47dd0c;if(_0x5bc0c4>=_0x3d2978){_0x5bc0c4=_0x3d2978;_0x47dd0c=0xc8;}else{_0x47dd0c=0xce;}_0x4f033b['status'](_0x47dd0c);return _0x4f033b[_0x5e70('0x28')]('Content-Range',_0xafb6fd+'-'+_0x5bc0c4+'/'+_0x3d2978)[_0x5e70('0x23')](_0x11043d);}return null;};}function saveUpdates(_0x380bc6){return function(_0x27fba0){if(_0x27fba0){return _0x27fba0['update'](_0x380bc6)['then'](function(_0x5b650c){return _0x5b650c;});}return null;};}function removeEntity(_0x4d3fe3){return function(_0x33aaad){if(_0x33aaad){return _0x33aaad[_0x5e70('0x29')]()[_0x5e70('0x16')](function(){_0x4d3fe3[_0x5e70('0x22')](0xcc)[_0x5e70('0x21')]();});}};}function handleEntityNotFound(_0x7b080){return function(_0x32eb29){if(!_0x32eb29){_0x7b080['sendStatus'](0x194);}return _0x32eb29;};}function handleError(_0x5f0c06,_0x596c52){_0x596c52=_0x596c52||0x1f4;return function(_0x1af793){logger['error'](_0x1af793[_0x5e70('0x2a')]);if(_0x1af793['name']){delete _0x1af793[_0x5e70('0x2b')];}_0x5f0c06[_0x5e70('0x22')](_0x596c52)['send'](_0x1af793);};}function getMustacheRender(_0x146333,_0x1f7d07){return Mustache[_0x5e70('0x2c')](_0x146333,_[_0x5e70('0x2d')](_0x1f7d07[_0x5e70('0x2e')],{'contact':_0x1f7d07[_0x5e70('0x2f')],'message':_0x1f7d07[_0x5e70('0x1c')],'agent':_0x1f7d07['agent'],'interaction':_0x1f7d07[_0x5e70('0x30')],'account':_0x1f7d07[_0x5e70('0x31')]}))||'';}exports['index']=function(_0x4364db,_0x261cc1){var _0x408d23={};var _0x3509b3=_[_0x5e70('0x32')](db[_0x5e70('0x33')][_0x5e70('0x34')],function(_0x5de661){return{'name':_0x5de661[_0x5e70('0x35')],'type':_0x5de661[_0x5e70('0x36')][_0x5e70('0x37')]};});_0x408d23=qs[_0x5e70('0x38')](_0x3509b3,_0x4364db);return interaction[_0x5e70('0x39')](_0x5e70('0x3a'),_0x4364db[_0x5e70('0x3b')],_0x4364db[_0x5e70('0x3c')],_0x408d23,_0x3509b3)[_0x5e70('0x16')](respondWithFilteredResult(_0x261cc1,_0x408d23))['catch'](handleError(_0x261cc1,null));};exports[_0x5e70('0x3d')]=function(_0x2a5152,_0x941360){var _0x3d38cf={'raw':![],'where':{'id':_0x2a5152[_0x5e70('0x3e')]['id']}},_0x3752af={};_0x3752af[_0x5e70('0x3f')]=_[_0x5e70('0x40')](db[_0x5e70('0x33')][_0x5e70('0x34')]);_0x3752af[_0x5e70('0x3b')]=_[_0x5e70('0x40')](_0x2a5152['query']);_0x3752af[_0x5e70('0x41')]=_[_0x5e70('0x42')](_0x3752af[_0x5e70('0x3f')],_0x3752af[_0x5e70('0x3b')]);_0x3d38cf[_0x5e70('0x43')]=_[_0x5e70('0x42')](_0x3752af['model'],qs[_0x5e70('0x44')](_0x2a5152[_0x5e70('0x3b')][_0x5e70('0x44')]));_0x3d38cf[_0x5e70('0x43')]=_0x3d38cf[_0x5e70('0x43')]['length']?_0x3d38cf[_0x5e70('0x43')]:_0x3752af[_0x5e70('0x3f')];if(_0x2a5152[_0x5e70('0x3b')][_0x5e70('0x45')]){_0x3d38cf[_0x5e70('0x46')]=[{'all':!![]}];}_0x3d38cf=_[_0x5e70('0x2d')]({},_0x3d38cf,_0x2a5152[_0x5e70('0x47')]);return db[_0x5e70('0x33')][_0x5e70('0x48')](_0x3d38cf)[_0x5e70('0x16')](handleEntityNotFound(_0x941360,null))[_0x5e70('0x16')](respondWithResult(_0x941360,null))['catch'](handleError(_0x941360,null));};exports[_0x5e70('0x49')]=function(_0x4b6b11,_0xf90a3b){return db[_0x5e70('0x33')][_0x5e70('0x49')](_0x4b6b11[_0x5e70('0x2e')],{})[_0x5e70('0x16')](respondWithResult(_0xf90a3b,0xc9))[_0x5e70('0x1f')](handleError(_0xf90a3b,null));};exports[_0x5e70('0x4a')]=function(_0x32f3cd,_0x45ae50){if(_0x32f3cd['body']['id']){delete _0x32f3cd[_0x5e70('0x2e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x32f3cd['params']['id']}})['then'](handleEntityNotFound(_0x45ae50,null))[_0x5e70('0x16')](saveUpdates(_0x32f3cd[_0x5e70('0x2e')],null))[_0x5e70('0x16')](respondWithResult(_0x45ae50,null))[_0x5e70('0x1f')](handleError(_0x45ae50,null));};exports['destroy']=function(_0x2e4f2a,_0x20f59b){return db[_0x5e70('0x33')][_0x5e70('0x48')]({'where':{'id':_0x2e4f2a[_0x5e70('0x3e')]['id']}})['then'](handleEntityNotFound(_0x20f59b,null))[_0x5e70('0x16')](removeEntity(_0x20f59b,null))[_0x5e70('0x1f')](handleError(_0x20f59b,null));};exports[_0x5e70('0x4b')]=function(_0x4b8848,_0xa73900){return db[_0x5e70('0x33')]['describe']()[_0x5e70('0x16')](respondWithResult(_0xa73900,null))['catch'](handleError(_0xa73900,null));};exports[_0x5e70('0x4c')]=function(_0xf73773,_0x3ab706){var _0x470019=_0xf73773['params']['id'];var _0x3dc4fe;var _0x5e4770;var _0x43339b;return db[_0x5e70('0x33')]['findOne']({'where':{'id':_0x470019}})[_0x5e70('0x16')](function(_0x4fb5c2){_0x3dc4fe=_0x4fb5c2;return db[_0x5e70('0x4d')]['findOne']({'where':{'id':_0x4fb5c2[_0x5e70('0x4e')]},'attributes':['id',_0x5e70('0x4f'),_0x5e70('0x50'),_0x5e70('0x51'),_0x5e70('0x52'),_0x5e70('0x53')],'raw':!![]});})[_0x5e70('0x16')](function(_0x4a8ad3){if(_0x4a8ad3&&_0x4a8ad3[_0x5e70('0x4f')]&&_0x4a8ad3[_0x5e70('0x50')]){_0x5e4770=_0x4a8ad3;var _0x38354d={'interaction':{'id':_0x470019},'agent':{'id':_0xf73773['user']['id'],'name':_0xf73773['user'][_0x5e70('0x2b')],'fullname':_0xf73773[_0x5e70('0x3c')][_0x5e70('0x54')],'email':_0xf73773[_0x5e70('0x3c')][_0x5e70('0x55')]},'contact':_0xf73773[_0x5e70('0x2e')][_0x5e70('0x2f')],'account':_0xf73773['body']['account']};var _0x5bdc5f={'rejectUnauthorized':![],'method':_0x5e70('0x56'),'url':_0x5e70('0x57'),'headers':{'X-APIKEY':_0x4a8ad3[_0x5e70('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xf73773['user'][_0x5e70('0x55')]],'buttons':null,'topic':_0x5e4770[_0x5e70('0x51')],'note':_[_0x5e70('0x58')](_0x5e4770['vidaooNote'])?null:getMustacheRender(_0x5e4770['vidaooNote'],_0x38354d),'metadata':null},'redirect':_0x5e70('0x59'),'json':!![]};try{if(!_[_0x5e70('0x58')](_0x5e4770[_0x5e70('0x53')])){var _0x262fb1=getMustacheRender(_0x5e4770[_0x5e70('0x53')],_0x38354d);var _0x54b575=JSON[_0x5e70('0x5a')](_0x262fb1);_0x5bdc5f['body'][_0x5e70('0x5b')]=_0x54b575;}}catch(_0x1fe2b5){throw new db[(_0x5e70('0x5c'))][(_0x5e70('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5bdc5f);}else{throw new db['Sequelize'][(_0x5e70('0x5d'))](_0x5e70('0x5e'));}})[_0x5e70('0x16')](function(_0x53fe4f){_0x43339b=_0x53fe4f;if(_0x43339b['id']){var _0x17ef5b={'body':_0x43339b[_0x5e70('0x5f')],'ChatWebsiteId':_0x5e4770['id'],'ChatInteractionId':_0x3dc4fe['id'],'direction':_0x5e70('0x60'),'UserId':_0xf73773[_0x5e70('0x3c')]['id']};return db[_0x5e70('0x61')][_0x5e70('0x49')](_0x17ef5b,{});}else{throw new db[(_0x5e70('0x5c'))]['ValidationError'](_0x5e70('0x62'));}})['then'](function(){return _0x3dc4fe[_0x5e70('0x63')]({'vidaooSessionId':_0x43339b['id']});})[_0x5e70('0x16')](respondWithResult(_0x3ab706,null))[_0x5e70('0x1f')](handleError(_0x3ab706,null));};exports[_0x5e70('0x64')]=function(_0x362e76,_0x54511b){if(_0x362e76[_0x5e70('0x2e')]['id']){delete _0x362e76['body']['id'];}return db[_0x5e70('0x33')][_0x5e70('0x48')]({'where':{'id':_0x362e76['params']['id']},'include':[{'model':db[_0x5e70('0x65')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x54511b,null))[_0x5e70('0x16')](saveUpdates(_0x362e76[_0x5e70('0x2e')],null))['then'](respondWithResult(_0x54511b,null))[_0x5e70('0x1f')](handleError(_0x54511b,null));};exports[_0x5e70('0x66')]=function(_0x4794d5,_0x4360dd){if(_0x4794d5['body']['id']){delete _0x4794d5['body']['id'];}return db[_0x5e70('0x33')][_0x5e70('0x48')]({'where':{'id':_0x4794d5[_0x5e70('0x3e')]['id']}})['then'](function(_0x4cbbf6){if(!_0x4cbbf6){logger['error'](_0x5e70('0x67'),_0x5e70('0x66'),0x194,_0x5e70('0x68'));_0x4360dd[_0x5e70('0x20')](0x194);}else{if(_0x4cbbf6[_0x5e70('0x69')]){throw new db[(_0x5e70('0x5c'))]['ValidationError'](_0x5e70('0x6a'));}}return _0x4cbbf6;})[_0x5e70('0x16')](function(_0x3c8b7f){if(_0x3c8b7f){return _0x3c8b7f[_0x5e70('0x4a')]({'closed':_0x4794d5['body']['closed'],'disposition':_0x4794d5[_0x5e70('0x2e')][_0x5e70('0x6b')]})[_0x5e70('0x16')](function(_0x4e2a77){return _0x4e2a77;});}})[_0x5e70('0x16')](function(){return respondWithRpcPromise(_0x5e70('0x6c'),_0x5e70('0x66'),_0x4794d5[_0x5e70('0x2e')],client9004);})['then'](respondWithResult(_0x4360dd,null))[_0x5e70('0x1f')](handleError(_0x4360dd,null));};exports[_0x5e70('0x6d')]=function(_0x14f0e1,_0x4793cd){_0x14f0e1[_0x5e70('0x2e')][_0x5e70('0x2b')]=_0x14f0e1[_0x5e70('0x6e')][_0x5e70('0x6f')];_0x14f0e1['body'][_0x5e70('0x70')]=_0x14f0e1[_0x5e70('0x6e')][_0x5e70('0x71')];_0x14f0e1[_0x5e70('0x2e')][_0x5e70('0x36')]=_0x14f0e1['file'][_0x5e70('0x72')];return db[_0x5e70('0x73')][_0x5e70('0x49')](_0x14f0e1['body'])[_0x5e70('0x16')](respondWithResult(_0x4793cd,0xc9))[_0x5e70('0x1f')](handleError(_0x4793cd,null));};exports['attachmentDownload']=function(_0x36df4b,_0x431953){return db[_0x5e70('0x33')]['findOne']({'where':{'id':_0x36df4b[_0x5e70('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x431953,null))[_0x5e70('0x16')](function(_0x58d69b){if(_0x58d69b){if(_0x58d69b[_0x5e70('0x74')]){return _0x431953[_0x5e70('0x22')](0x193)[_0x5e70('0x23')]({'status':0x193,'message':_0x5e70('0x75')});}return db['Attachment']['findOne']({'where':{'id':_0x36df4b['query'][_0x5e70('0x76')]},'raw':!![]})[_0x5e70('0x16')](handleEntityNotFound(_0x431953,null));}})[_0x5e70('0x16')](function(_0x2e285b){if(_0x2e285b){var _0x2b6d7a=_0x2e285b[_0x5e70('0x77')]!==null;var _0x58f7a9=path[_0x5e70('0x78')](config[_0x5e70('0x79')],_0x5e70('0x7a'));if(_0x2b6d7a){_0x58f7a9=path[_0x5e70('0x78')](_0x58f7a9,'offline-chat/');}var _0x28b8f6=path['join'](_0x58f7a9,_0x2e285b[_0x5e70('0x70')]);return _0x431953[_0x5e70('0x7b')](_0x28b8f6);}})[_0x5e70('0x1f')](handleError(_0x431953,null));};exports['close']=function(_0xb5b02b,_0x2bf957){var _0x51cb08=null;var _0xa30494=null;var _0x3bf07c=null;if(_0xb5b02b[_0x5e70('0x2e')]['id']){delete _0xb5b02b[_0x5e70('0x2e')]['id'];}if(_0xb5b02b['body'][_0x5e70('0x7c')]){_0x3bf07c=path[_0x5e70('0x78')](config['root'],_0x5e70('0x7d'),util[_0x5e70('0x7e')](_0x5e70('0x7f'),Date['now']()));_0xb5b02b[_0x5e70('0x2e')][_0x5e70('0x80')]=_0x3bf07c;}return db['ChatInteraction']['find']({'where':{'id':_0xb5b02b[_0x5e70('0x3e')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x5e70('0x81'),'include':[{'model':db[_0x5e70('0x82')],'as':_0x5e70('0x82')}]}]})[_0x5e70('0x16')](handleEntityNotFound(_0x2bf957,null))[_0x5e70('0x16')](saveUpdates(_0xb5b02b[_0x5e70('0x2e')],null))['then'](function(_0xbe77dc){if(_0xbe77dc){_0x51cb08=_0xbe77dc;return db[_0x5e70('0x4d')][_0x5e70('0x48')]({'where':{'id':_0x51cb08[_0x5e70('0x4e')]}});}})[_0x5e70('0x16')](function(_0x18f0d4){if(_0x18f0d4){_0xa30494=_0x18f0d4;return db['CmContact'][_0x5e70('0x48')]({'where':{'id':_0x51cb08[_0x5e70('0x83')]}});}})['then'](function(_0x58a037){if(_0x58a037){if(_0x3bf07c){var _0x1e00f5=null;for(var _0x2327b8=0x1;_0x2327b8<_0x51cb08[_0x5e70('0x81')]['length'];++_0x2327b8){_0x1e00f5=_0x51cb08['Messages'][_0x2327b8];var _0x3a87bd=_0x1e00f5[_0x5e70('0x69')]?util[_0x5e70('0x7e')](_0x5e70('0x84'),_0xa30494['agentAlias'],_0x1e00f5[_0x5e70('0x69')]):'System';var _0x304388=_0xb5b02b['body']['customer']||util['format']('%s%d',_0x5e70('0x85'),_0x1e00f5['ContactId']);switch(_0xa30494['agentIdentifier']){case'website_alias':_0x3a87bd=_0x1e00f5[_0x5e70('0x69')]?util[_0x5e70('0x7e')]('%s%d',_0xa30494[_0x5e70('0x86')],_0x1e00f5[_0x5e70('0x69')]):_0x5e70('0x87');break;case _0x5e70('0x88'):_0x3a87bd=_0x1e00f5[_0x5e70('0x69')]?_0x1e00f5[_0x5e70('0x82')][_0x5e70('0x89')]||_0x1e00f5['User'][_0x5e70('0x54')]:_0x5e70('0x87');break;case _0x5e70('0x8a'):_0x3a87bd=_0x1e00f5[_0x5e70('0x69')]?_0x1e00f5[_0x5e70('0x82')][_0x5e70('0x54')]:_0x5e70('0x87');break;default:_0x3a87bd=_0x1e00f5[_0x5e70('0x69')]?util[_0x5e70('0x7e')]('%s%d',_0xa30494[_0x5e70('0x86')],_0x1e00f5['UserId']):'System';}var _0x5c3226=util['format'](_0x5e70('0x8b'),moment(_0x1e00f5[_0x5e70('0x8c')])[_0x5e70('0x7e')](_0x5e70('0x8d')),_0x1e00f5[_0x5e70('0x8e')]==='in'?_0x304388:_0x3a87bd,_0x1e00f5['body']);if(!_0x1e00f5['secret']){fs[_0x5e70('0x8f')](_0x3bf07c,_0x5c3226);}}return db[_0x5e70('0x90')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x5e70('0x91')],'as':_0x5e70('0x92'),'raw':!![],'include':[{'model':db[_0x5e70('0x93')],'as':_0x5e70('0x93'),'raw':!![]}]}]});}}})['then'](function(_0x3527c0){if(!_0x3527c0||!_0x3527c0['Smtp']||!_0xb5b02b[_0x5e70('0x2e')])return _0x51cb08;var _0xb59872=_0x3527c0[_0x5e70('0x94')]();return respondWithRpcPromise(_0x5e70('0x95'),'sendMail',{'account':_0xb59872,'message':{'from':util[_0x5e70('0x7e')](_0x5e70('0x96'),_0x3527c0[_0x5e70('0x2b')],_0x3527c0['email']||_0x3527c0[_0x5e70('0x92')][_0x5e70('0x3c')]),'to':_0xb5b02b[_0x5e70('0x2e')][_0x5e70('0x7c')],'subject':_0x5e70('0x97'),'text':util[_0x5e70('0x7e')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xb5b02b[_0x5e70('0x2e')][_0x5e70('0x7c')]),'attachments':[{'path':_0x3bf07c}]}})[_0x5e70('0x16')](function(){return _0x51cb08;})['catch'](function(_0x487c5a){logger[_0x5e70('0x1b')](_0x487c5a);});})['then'](respondWithStatusCode(_0x2bf957,0xc8))[_0x5e70('0x1f')](handleError(_0x2bf957,null));};exports[_0x5e70('0x98')]=function(_0x3634e4,_0x2bd1e9){return db[_0x5e70('0x61')][_0x5e70('0x48')]({'where':{'id':_0x3634e4[_0x5e70('0x3e')]['id']}})[_0x5e70('0x16')](handleEntityNotFound(_0x2bd1e9,null))[_0x5e70('0x16')](function(_0x315362){if(_0x315362){return _0x315362[_0x5e70('0x98')](_0x3634e4['body']['ids'],_[_0x5e70('0x99')](_0x3634e4[_0x5e70('0x2e')],[_0x5e70('0x9a'),'id'])||{});}})[_0x5e70('0x16')](respondWithResult(_0x2bd1e9,null))['catch'](handleError(_0x2bd1e9,null));};exports[_0x5e70('0x9b')]=function(_0x3ade7c,_0x2bbb77){var _0x25108c={'raw':![],'where':{}};var _0x15af68={};var _0x4866b5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5e70('0x9c')]({'where':{'id':_0x3ade7c[_0x5e70('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2bbb77,null))[_0x5e70('0x16')](function(_0x47c592){if(_0x47c592){_0x15af68[_0x5e70('0x3f')]=_[_0x5e70('0x40')](db[_0x5e70('0x61')][_0x5e70('0x34')]);_0x15af68[_0x5e70('0x3b')]=_[_0x5e70('0x40')](_0x3ade7c[_0x5e70('0x3b')]);_0x15af68[_0x5e70('0x41')]=_[_0x5e70('0x42')](_0x15af68[_0x5e70('0x3f')],_0x15af68[_0x5e70('0x3b')]);_0x25108c[_0x5e70('0x43')]=_[_0x5e70('0x42')](_0x15af68[_0x5e70('0x3f')],qs[_0x5e70('0x44')](_0x3ade7c[_0x5e70('0x3b')][_0x5e70('0x44')]));_0x25108c[_0x5e70('0x43')]=_0x25108c[_0x5e70('0x43')][_0x5e70('0x9d')]?_0x25108c[_0x5e70('0x43')]:_0x15af68[_0x5e70('0x3f')];if(!_0x3ade7c[_0x5e70('0x3b')][_0x5e70('0x9e')](_0x5e70('0x9f'))){_0x25108c['limit']=qs['limit'](_0x3ade7c[_0x5e70('0x3b')]['limit']);_0x25108c[_0x5e70('0x24')]=qs['offset'](_0x3ade7c[_0x5e70('0x3b')][_0x5e70('0x24')]);}_0x25108c['order']=qs[_0x5e70('0xa0')](_0x3ade7c['query'][_0x5e70('0xa0')]);_0x25108c[_0x5e70('0xa1')]=qs[_0x5e70('0x41')](_[_0x5e70('0xa2')](_0x3ade7c['query'],_0x15af68[_0x5e70('0x41')]));_0x25108c[_0x5e70('0xa1')][_0x5e70('0xa3')]=_0x47c592['id'];if(_0x3ade7c['query'][_0x5e70('0xa4')]){_0x25108c[_0x5e70('0xa1')]=_[_0x5e70('0x2d')](_0x25108c[_0x5e70('0xa1')],{'$or':_[_0x5e70('0x32')](_0x25108c[_0x5e70('0x43')],function(_0x128fca){var _0xd4a57d={};_0xd4a57d[_0x128fca]={'$like':'%'+_0x3ade7c[_0x5e70('0x3b')]['filter']+'%'};return _0xd4a57d;})});}if(_0x3ade7c[_0x5e70('0x3b')]['$gte']){var _0x18a586=_0x3ade7c[_0x5e70('0x3b')][_0x5e70('0xa5')][_0x5e70('0xa6')](',');var _0x223e93={};_0x223e93[_0x18a586[0x0]]={'$gte':moment(_0x18a586[0x1])['format'](_0x5e70('0xa7'))};_0x25108c[_0x5e70('0xa1')]=_[_0x5e70('0x2d')](_0x25108c[_0x5e70('0xa1')],_0x223e93);}_0x25108c=_['merge']({},_0x25108c,_0x3ade7c[_0x5e70('0x47')]);return db['ChatMessage'][_0x5e70('0x26')]({'where':_0x25108c['where']})[_0x5e70('0x16')](function(_0x468cfb){_0x4866b5[_0x5e70('0x26')]=_0x468cfb;if(_0x3ade7c[_0x5e70('0x3b')][_0x5e70('0x45')]){_0x25108c[_0x5e70('0x46')]=[{'all':!![]}];}return db[_0x5e70('0x61')][_0x5e70('0x39')](_0x25108c);})['then'](function(_0x4e49cd){_0x4866b5[_0x5e70('0xa8')]=_0x4e49cd;return _0x4866b5;});}})[_0x5e70('0x16')](respondWithFilteredResult(_0x2bbb77,_0x25108c))[_0x5e70('0x1f')](handleError(_0x2bbb77,null));};exports[_0x5e70('0xa9')]=function(_0x58b017,_0x3748ea){var _0x3d1972={'where':{}},_0x1db6da={},_0x513213={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5e70('0x9c')]({'where':{'id':_0x58b017[_0x5e70('0x3e')]['id']}})[_0x5e70('0x16')](handleEntityNotFound(_0x3748ea,null))[_0x5e70('0x16')](function(_0x1c6093){if(_0x1c6093){_0x1db6da[_0x5e70('0x3f')]=_[_0x5e70('0x40')](db[_0x5e70('0x61')]['rawAttributes']);_0x1db6da['query']=_[_0x5e70('0x40')](_0x58b017[_0x5e70('0x3b')]);_0x1db6da[_0x5e70('0x41')]=_['intersection'](_0x1db6da['model'],_0x1db6da['query']);_0x3d1972[_0x5e70('0x43')]=_[_0x5e70('0x42')](_0x1db6da[_0x5e70('0x3f')],qs['fields'](_0x58b017['query'][_0x5e70('0x44')]));_0x3d1972[_0x5e70('0x43')]=_0x3d1972['attributes'][_0x5e70('0x9d')]?_0x3d1972[_0x5e70('0x43')]:_0x1db6da[_0x5e70('0x3f')];if(!_0x58b017[_0x5e70('0x3b')][_0x5e70('0x9e')](_0x5e70('0x9f'))){_0x3d1972[_0x5e70('0x27')]=qs[_0x5e70('0x27')](_0x58b017[_0x5e70('0x3b')][_0x5e70('0x27')]);_0x3d1972[_0x5e70('0x24')]=qs[_0x5e70('0x24')](_0x58b017[_0x5e70('0x3b')][_0x5e70('0x24')]);}_0x3d1972['order']=qs[_0x5e70('0xa0')](_0x58b017[_0x5e70('0x3b')][_0x5e70('0xa0')]);_0x3d1972[_0x5e70('0xa1')]=qs[_0x5e70('0x41')](_[_0x5e70('0xa2')](_0x58b017[_0x5e70('0x3b')],_0x1db6da[_0x5e70('0x41')]));_0x3d1972[_0x5e70('0xa1')][_0x5e70('0xa3')]=_0x1c6093['id'];if(_0x58b017[_0x5e70('0x3b')][_0x5e70('0xa4')]){_0x3d1972[_0x5e70('0xa1')]=_[_0x5e70('0x2d')](_0x3d1972[_0x5e70('0xa1')],{'$or':_[_0x5e70('0x32')](_0x3d1972[_0x5e70('0x43')],function(_0x2eed1e){var _0x913838={};_0x913838[_0x2eed1e]={'$like':'%'+_0x58b017[_0x5e70('0x3b')]['filter']+'%'};return _0x913838;})});}_0x3d1972[_0x5e70('0xa1')][_0x5e70('0xaa')]=![];if(_0x58b017['query']['id']){_0x3d1972[_0x5e70('0xa1')]['id']={'$gt':_0x58b017[_0x5e70('0x3b')]['id']};}_0x3d1972=_[_0x5e70('0x2d')]({},_0x3d1972,_0x58b017['options']);return db[_0x5e70('0x61')][_0x5e70('0x26')]({'where':_0x3d1972[_0x5e70('0xa1')]})['then'](function(_0x332ad1){_0x513213['count']=_0x332ad1;_0x3d1972[_0x5e70('0x46')]=[];if(_0x58b017[_0x5e70('0x3b')][_0x5e70('0xab')]){_0x3d1972[_0x5e70('0x46')]['push']({'model':db[_0x5e70('0x82')],'as':_0x5e70('0x82'),'attributes':['id','fullname',_0x5e70('0x89')]});}if(_0x58b017[_0x5e70('0x3b')]['includeAll']){_0x3d1972[_0x5e70('0x46')]=[{'all':!![]}];}return db[_0x5e70('0x61')]['findAll'](_0x3d1972);})[_0x5e70('0x16')](function(_0x23c128){_0x513213[_0x5e70('0xa8')]=_0x23c128;return _0x513213;});}})['then'](respondWithFilteredResult(_0x3748ea,_0x3d1972))[_0x5e70('0x1f')](handleError(_0x3748ea,null));};exports[_0x5e70('0xac')]=function(_0x14fcc1,_0x46f649){return db[_0x5e70('0x33')]['find']({'where':{'id':_0x14fcc1[_0x5e70('0x3e')]['id']}})[_0x5e70('0x16')](handleEntityNotFound(_0x46f649,null))[_0x5e70('0x16')](function(_0x260bce){if(_0x260bce){return _0x260bce[_0x5e70('0xad')](_0x14fcc1[_0x5e70('0x2e')][_0x5e70('0x9a')],_[_0x5e70('0x99')](_0x14fcc1[_0x5e70('0x2e')],[_0x5e70('0x9a'),'id'])||{})[_0x5e70('0xae')](function(){return db[_0x5e70('0xaf')]['findAll']({'attributes':['id',_0x5e70('0x2b'),_0x5e70('0xb0')],'where':{'id':_0x14fcc1[_0x5e70('0x2e')]['ids']}});})[_0x5e70('0x16')](function(_0x4b343e){socket[_0x5e70('0xb1')](_0x5e70('0xb2'),{'id':Number(_0x14fcc1['params']['id']),'tags':_0x4b343e||[]});return{'id':Number(_0x14fcc1['params']['id']),'tags':_0x4b343e||[]};});}})[_0x5e70('0x16')](respondWithResult(_0x46f649,null))[_0x5e70('0x1f')](handleError(_0x46f649,null));};exports[_0x5e70('0xb3')]=function(_0x1a72e7,_0x10c989){return db[_0x5e70('0x33')][_0x5e70('0x48')]({'where':{'id':_0x1a72e7[_0x5e70('0x3e')]['id']}})[_0x5e70('0x16')](handleEntityNotFound(_0x10c989,null))['then'](function(_0x4d2285){if(_0x4d2285){return _0x4d2285[_0x5e70('0xb3')](_0x1a72e7['query'][_0x5e70('0x9a')]);}})[_0x5e70('0x16')](respondWithStatusCode(_0x10c989,null))['catch'](handleError(_0x10c989,null));};exports[_0x5e70('0x7b')]=function(_0x2db7dd,_0x3b76f6){var _0x4e0017=moment()[_0x5e70('0xb4')]()[_0x5e70('0xb5')]();var _0x3be669=path[_0x5e70('0x78')](config[_0x5e70('0x79')],_0x5e70('0xb6'),_0x5e70('0xb7'),_0x5e70('0xb8'));var _0x404b31=path[_0x5e70('0x78')](config['root'],_0x5e70('0xb6'),'files',_0x5e70('0xb9'));var _0xb4a728=path[_0x5e70('0x78')](_0x3be669,_0x4e0017);var _0x372ceb=util[_0x5e70('0x7e')](_0x5e70('0xba'),_0x2db7dd[_0x5e70('0x3e')]['id'],_0x4e0017);var _0x51aad7=path['join'](_0x3be669,_0x372ceb);var _0x499ef3=[];_0x499ef3['push']({'model':db[_0x5e70('0x82')],'as':_0x5e70('0x82'),'attributes':['id',_0x5e70('0x54')],'raw':!![]});_0x499ef3[_0x5e70('0xbb')]({'model':db[_0x5e70('0x65')],'as':_0x5e70('0xbc'),'attributes':['id',_0x5e70('0xbd'),'lastName'],'raw':!![]});if(_0x2db7dd[_0x5e70('0x3b')][_0x5e70('0xb9')]){_0x499ef3['push']({'model':db[_0x5e70('0x73')],'as':_0x5e70('0x73'),'raw':!![]});}var _0x36c25f=[{'model':db[_0x5e70('0x61')],'as':_0x5e70('0x81'),'attributes':['id','body',_0x5e70('0x8c'),'direction',_0x5e70('0xaa'),'read'],'include':_0x499ef3}];_0x36c25f[_0x5e70('0xbb')]({'model':db[_0x5e70('0x4d')],'as':_0x5e70('0xbe'),'attributes':['id',_0x5e70('0x2b')]});_0x36c25f[_0x5e70('0xbb')]({'model':db[_0x5e70('0x82')],'as':_0x5e70('0xbf'),'attributes':['id',_0x5e70('0x54')]});return db[_0x5e70('0x33')][_0x5e70('0x48')]({'where':{'id':_0x2db7dd[_0x5e70('0x3e')]['id']},'include':_0x36c25f})['then'](handleEntityNotFound(_0x3b76f6,null))[_0x5e70('0x16')](function(_0x5e4390){if(_0x5e4390){var _0x1b1b3e=_0x5e4390[_0x5e70('0xc0')]({'plain':!![]});fs[_0x5e70('0xc1')](_0xb4a728);var _0x1a4dc8={'channel':_0x5e70('0xc2'),'account':_0x1b1b3e[_0x5e70('0xbe')][_0x5e70('0x2b')],'agent':_0x1b1b3e['Owner']?_0x1b1b3e[_0x5e70('0xbf')][_0x5e70('0x54')]:_0x5e70('0xc3'),'createdAt':moment(_0x1b1b3e[_0x5e70('0x8c')])[_0x5e70('0x7e')](_0x5e70('0xa7'))['toString'](),'closedAt':_0x1b1b3e[_0x5e70('0x74')]?moment(_0x1b1b3e['closedAt'])[_0x5e70('0x7e')](_0x5e70('0xa7'))[_0x5e70('0xb5')]():'','disposition':_0x1b1b3e['disposition'],'chatInfo':{'browser':_0x1b1b3e['browserName'],'os':_0x1b1b3e['osName'],'referer':_0x1b1b3e[_0x5e70('0xc4')],'customerIp':_0x1b1b3e['customerIp'],'customerPort':_0x1b1b3e[_0x5e70('0xc5')]?_0x1b1b3e[_0x5e70('0xc5')]:'N.A.'},'messages':_(_0x1b1b3e['Messages'])[_0x5e70('0xc6')]()['filter']({'secret':![]})['map'](function(_0x1c9b95){if(_0x1c9b95['Attachment']){var _0x36892e=path[_0x5e70('0x78')](_0x404b31,_0x1c9b95[_0x5e70('0x73')][_0x5e70('0x70')]);if(fs[_0x5e70('0xc7')](_0x36892e)){fs[_0x5e70('0xc8')](_0x36892e)[_0x5e70('0xc9')](fs[_0x5e70('0xca')](path['join'](_0xb4a728,_0x1c9b95['Attachment'][_0x5e70('0x70')])));}}return{'date':moment(_0x1c9b95[_0x5e70('0x8c')])[_0x5e70('0x7e')](_0x5e70('0xa7'))['toString'](),'sender':_0x1c9b95[_0x5e70('0x8e')]===_0x5e70('0x60')?_0x1c9b95[_0x5e70('0x82')]?_0x1c9b95[_0x5e70('0x82')][_0x5e70('0x54')]:_0x5e70('0x87'):_0x1c9b95[_0x5e70('0xbc')]['firstName']+(_0x1c9b95[_0x5e70('0xbc')]['lastName']?'\x20'+_0x1c9b95[_0x5e70('0xbc')][_0x5e70('0xcb')]:''),'body':_0x1c9b95[_0x5e70('0x73')]?_0x1c9b95['Attachment'][_0x5e70('0x70')]:_0x1c9b95[_0x5e70('0x2e')],'direction':_0x1c9b95[_0x5e70('0x8e')]===_0x5e70('0x60')?'A':'C','secret':_0x1c9b95[_0x5e70('0xaa')],'read':_0x1c9b95[_0x5e70('0xcc')],'attachment':_0x1c9b95[_0x5e70('0x73')]};})[_0x5e70('0xcd')]()};return ejs[_0x5e70('0xce')](path[_0x5e70('0x78')](config[_0x5e70('0x79')],_0x5e70('0xb6'),_0x5e70('0xcf'),_0x5e70('0xd0')),{'interaction':_0x1a4dc8})[_0x5e70('0x16')](function(_0x49c59b){var _0x2ce615=path['join'](_0xb4a728,_0x5e70('0xd1')+_0x1b1b3e['id']+'-'+_0x4e0017+_0x5e70('0xd2'));var _0x551668={'path':_0x2ce615,'channel':'Chat','interactionId':_0x1b1b3e['id']};return pdf[_0x5e70('0xd3')](_0x49c59b,_0x551668);})['then'](function(){return new Promise(function(_0xd6ac1e,_0x17b42a){zipdir(_0xb4a728,{'saveTo':_0x51aad7},function(_0x4f6ba5,_0x451280){if(_0x4f6ba5)return _0x17b42a(_0x4f6ba5);return _0xd6ac1e(_0x451280);});})['then'](function(){return new BPromise(function(_0x44e996,_0x4955f4){rimraf(_0xb4a728,function(_0x2eb5b0){if(_0x2eb5b0)_0x4955f4(_0x2eb5b0);return _0x44e996();});});})[_0x5e70('0x16')](function(){return _0x3b76f6['download'](_0x51aad7,_0x372ceb,function(_0x255283){if(_0x255283){logger[_0x5e70('0x1b')](_0x5e70('0xd4'),_0x255283);}else{fs[_0x5e70('0xd5')](_0x51aad7);}});});});}else{return _0x3b76f6[_0x5e70('0x20')](0xc8);}})[_0x5e70('0x1f')](handleError(_0x3b76f6,null));};
\ No newline at end of file
+var _0xf826=['views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','merge','body','interaction','account','index','map','ChatInteraction','type','key','findAll','chat','query','show','keys','filters','model','intersection','fields','attributes','length','includeAll','include','options','create','find','params','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','user','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ContactId','%s%d','System','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','SendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','nolimit','order','sort','where','pick','ChatInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','hasOwnProperty','includeAgent','push','rows','addTags','setTags','spread','color','removeTags','unix','toString','server','files','tmp','firstName','lastName','direction','read','ChatWebsite','Owner','mkdirSync','Chat','createdAt','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','pipe','createWriteStream','value','renderFile'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf826,0x1a6));var _0x6f82=function(_0x232e16,_0x1328d3){_0x232e16=_0x232e16-0x0;var _0x29719c=_0xf826[_0x232e16];return _0x29719c;};'use strict';var rimraf=require(_0x6f82('0x0'));var zipdir=require(_0x6f82('0x1'));var rp=require(_0x6f82('0x2'));var moment=require(_0x6f82('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f82('0x4'));var util=require(_0x6f82('0x5'));var path=require(_0x6f82('0x6'));var ejs=require(_0x6f82('0x7'));var fs=require('fs');var _=require(_0x6f82('0x8'));var Redis=require(_0x6f82('0x9'));var interaction=require(_0x6f82('0xa'));var qs=require(_0x6f82('0xb'));var pdf=require(_0x6f82('0xc'));var logger=require('../../config/logger')('api');var config=require(_0x6f82('0xd'));var db=require('../../mysqldb')['db'];config[_0x6f82('0xe')]=_[_0x6f82('0xf')](config['redis'],{'host':_0x6f82('0x10'),'port':0x18eb});var socket=require(_0x6f82('0x11'))(new Redis(config[_0x6f82('0xe')]));require(_0x6f82('0x12'))[_0x6f82('0x13')](socket);var jayson=require(_0x6f82('0x14'));var client=jayson['client'][_0x6f82('0x15')]({'port':0x232b});var client9004=jayson[_0x6f82('0x16')][_0x6f82('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x709c,_0x25865c,_0x5afeb6,_0x1037e8){return new BPromise(function(_0x51a91a,_0x4f7b63){var _0x19d397=_0x1037e8||client;return _0x19d397[_0x6f82('0x17')](_0x709c,_0x5afeb6)[_0x6f82('0x18')](function(_0x747c46){logger[_0x6f82('0x19')](_0x6f82('0x1a'),_0x25865c,'request\x20sent');logger[_0x6f82('0x1b')](_0x6f82('0x1c'),_0x25865c,_0x6f82('0x1d'),JSON['stringify'](_0x747c46));if(_0x747c46[_0x6f82('0x1e')]){if(_0x747c46[_0x6f82('0x1e')][_0x6f82('0x1f')]===0x1f4){logger[_0x6f82('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x25865c,_0x747c46['error'][_0x6f82('0x20')]);return _0x4f7b63(_0x747c46[_0x6f82('0x1e')]['message']);}logger[_0x6f82('0x1e')](_0x6f82('0x1a'),_0x25865c,_0x747c46[_0x6f82('0x1e')][_0x6f82('0x20')]);return _0x51a91a(_0x747c46[_0x6f82('0x1e')]['message']);}else{logger[_0x6f82('0x19')](_0x6f82('0x1a'),_0x25865c,_0x6f82('0x1d'));_0x51a91a(_0x747c46[_0x6f82('0x21')][_0x6f82('0x20')]);}})[_0x6f82('0x22')](function(_0x6d6181){logger[_0x6f82('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x25865c,_0x6d6181);_0x4f7b63(_0x6d6181);});});}function respondWithStatusCode(_0x4b79a3,_0x2f267c){_0x2f267c=_0x2f267c||0xcc;return function(_0x2ae704){if(_0x2ae704){return _0x4b79a3[_0x6f82('0x23')](_0x2f267c);}return _0x4b79a3[_0x6f82('0x24')](_0x2f267c)['end']();};}function respondWithResult(_0x57c5ec,_0x53914e){_0x53914e=_0x53914e||0xc8;return function(_0x5a1903){if(_0x5a1903){return _0x57c5ec['status'](_0x53914e)[_0x6f82('0x25')](_0x5a1903);}};}function respondWithFilteredResult(_0xdbe5a2,_0x29764d){return function(_0x4b3dd6){if(_0x4b3dd6){var _0x11fed2=typeof _0x29764d['offset']===_0x6f82('0x26')&&typeof _0x29764d[_0x6f82('0x27')]==='undefined';var _0x453f14=_0x4b3dd6['count'];var _0x12c634=_0x11fed2?0x0:_0x29764d['offset'];var _0x5d861c=_0x11fed2?_0x4b3dd6[_0x6f82('0x28')]:_0x29764d[_0x6f82('0x29')]+_0x29764d[_0x6f82('0x27')];var _0x5d599b;if(_0x5d861c>=_0x453f14){_0x5d861c=_0x453f14;_0x5d599b=0xc8;}else{_0x5d599b=0xce;}_0xdbe5a2[_0x6f82('0x24')](_0x5d599b);return _0xdbe5a2[_0x6f82('0x2a')](_0x6f82('0x2b'),_0x12c634+'-'+_0x5d861c+'/'+_0x453f14)[_0x6f82('0x25')](_0x4b3dd6);}return null;};}function saveUpdates(_0x5577bb){return function(_0x1b94d2){if(_0x1b94d2){return _0x1b94d2[_0x6f82('0x2c')](_0x5577bb)[_0x6f82('0x18')](function(_0x509a8f){return _0x509a8f;});}return null;};}function removeEntity(_0x594162){return function(_0x359d52){if(_0x359d52){return _0x359d52[_0x6f82('0x2d')]()[_0x6f82('0x18')](function(){_0x594162[_0x6f82('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31389b){return function(_0x4f27e5){if(!_0x4f27e5){_0x31389b[_0x6f82('0x23')](0x194);}return _0x4f27e5;};}function handleError(_0x510cf7,_0x488eb8){_0x488eb8=_0x488eb8||0x1f4;return function(_0x43783e){logger[_0x6f82('0x1e')](_0x43783e[_0x6f82('0x2e')]);if(_0x43783e[_0x6f82('0x2f')]){delete _0x43783e['name'];}_0x510cf7[_0x6f82('0x24')](_0x488eb8)['send'](_0x43783e);};}function getMustacheRender(_0x365eec,_0xb493dc){return Mustache['render'](_0x365eec,_[_0x6f82('0x30')](_0xb493dc[_0x6f82('0x31')],{'contact':_0xb493dc['contact'],'message':_0xb493dc[_0x6f82('0x20')],'agent':_0xb493dc['agent'],'interaction':_0xb493dc[_0x6f82('0x32')],'account':_0xb493dc[_0x6f82('0x33')]}))||'';}exports[_0x6f82('0x34')]=function(_0x331d0d,_0x492e41){var _0x466bbd={};var _0x99bedd=_[_0x6f82('0x35')](db[_0x6f82('0x36')]['rawAttributes'],function(_0x241c2a){return{'name':_0x241c2a['fieldName'],'type':_0x241c2a[_0x6f82('0x37')][_0x6f82('0x38')]};});_0x466bbd=qs['getOptions'](_0x99bedd,_0x331d0d);return interaction[_0x6f82('0x39')](_0x6f82('0x3a'),_0x331d0d[_0x6f82('0x3b')],_0x331d0d['user'],_0x466bbd,_0x99bedd)['then'](respondWithFilteredResult(_0x492e41,_0x466bbd))[_0x6f82('0x22')](handleError(_0x492e41,null));};exports[_0x6f82('0x3c')]=function(_0x5d326c,_0x3be0b6){var _0x2e97a3={'raw':![],'where':{'id':_0x5d326c['params']['id']}},_0x14f558={};_0x14f558['model']=_['keys'](db[_0x6f82('0x36')]['rawAttributes']);_0x14f558['query']=_[_0x6f82('0x3d')](_0x5d326c[_0x6f82('0x3b')]);_0x14f558[_0x6f82('0x3e')]=_['intersection'](_0x14f558[_0x6f82('0x3f')],_0x14f558[_0x6f82('0x3b')]);_0x2e97a3['attributes']=_[_0x6f82('0x40')](_0x14f558[_0x6f82('0x3f')],qs[_0x6f82('0x41')](_0x5d326c[_0x6f82('0x3b')][_0x6f82('0x41')]));_0x2e97a3[_0x6f82('0x42')]=_0x2e97a3[_0x6f82('0x42')][_0x6f82('0x43')]?_0x2e97a3[_0x6f82('0x42')]:_0x14f558[_0x6f82('0x3f')];if(_0x5d326c[_0x6f82('0x3b')][_0x6f82('0x44')]){_0x2e97a3[_0x6f82('0x45')]=[{'all':!![]}];}_0x2e97a3=_[_0x6f82('0x30')]({},_0x2e97a3,_0x5d326c[_0x6f82('0x46')]);return db[_0x6f82('0x36')]['find'](_0x2e97a3)[_0x6f82('0x18')](handleEntityNotFound(_0x3be0b6,null))[_0x6f82('0x18')](respondWithResult(_0x3be0b6,null))['catch'](handleError(_0x3be0b6,null));};exports[_0x6f82('0x47')]=function(_0x3b6a2f,_0x420354){return db[_0x6f82('0x36')][_0x6f82('0x47')](_0x3b6a2f[_0x6f82('0x31')],{})['then'](respondWithResult(_0x420354,0xc9))[_0x6f82('0x22')](handleError(_0x420354,null));};exports[_0x6f82('0x2c')]=function(_0x16e6b8,_0x4f5bb3){if(_0x16e6b8[_0x6f82('0x31')]['id']){delete _0x16e6b8[_0x6f82('0x31')]['id'];}return db['ChatInteraction'][_0x6f82('0x48')]({'where':{'id':_0x16e6b8[_0x6f82('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f5bb3,null))['then'](saveUpdates(_0x16e6b8[_0x6f82('0x31')],null))[_0x6f82('0x18')](respondWithResult(_0x4f5bb3,null))[_0x6f82('0x22')](handleError(_0x4f5bb3,null));};exports['destroy']=function(_0x4706a1,_0x268a4b){return db[_0x6f82('0x36')][_0x6f82('0x48')]({'where':{'id':_0x4706a1[_0x6f82('0x49')]['id']}})['then'](handleEntityNotFound(_0x268a4b,null))['then'](removeEntity(_0x268a4b,null))['catch'](handleError(_0x268a4b,null));};exports[_0x6f82('0x4a')]=function(_0x15ef73,_0x37aa21){return db[_0x6f82('0x36')][_0x6f82('0x4a')]()[_0x6f82('0x18')](respondWithResult(_0x37aa21,null))[_0x6f82('0x22')](handleError(_0x37aa21,null));};exports[_0x6f82('0x4b')]=function(_0x404ba9,_0x5a7baf){var _0x1c05e7=_0x404ba9['params']['id'];var _0x325bbd;var _0x2da950;var _0x515b74;return db['ChatInteraction'][_0x6f82('0x4c')]({'where':{'id':_0x1c05e7}})[_0x6f82('0x18')](function(_0x173a06){_0x325bbd=_0x173a06;return db['ChatWebsite'][_0x6f82('0x4c')]({'where':{'id':_0x173a06[_0x6f82('0x4d')]},'attributes':['id',_0x6f82('0x4e'),'vidaooEscalation',_0x6f82('0x4f'),_0x6f82('0x50'),_0x6f82('0x51')],'raw':!![]});})[_0x6f82('0x18')](function(_0x23e293){if(_0x23e293&&_0x23e293[_0x6f82('0x4e')]&&_0x23e293[_0x6f82('0x52')]){_0x2da950=_0x23e293;var _0x2cae63={'interaction':{'id':_0x1c05e7},'agent':{'id':_0x404ba9[_0x6f82('0x53')]['id'],'name':_0x404ba9[_0x6f82('0x53')][_0x6f82('0x2f')],'fullname':_0x404ba9[_0x6f82('0x53')][_0x6f82('0x54')],'email':_0x404ba9[_0x6f82('0x53')]['email']},'contact':_0x404ba9[_0x6f82('0x31')][_0x6f82('0x55')],'account':_0x404ba9['body']['account']};var _0x177f70={'rejectUnauthorized':![],'method':_0x6f82('0x56'),'url':_0x6f82('0x57'),'headers':{'X-APIKEY':_0x23e293[_0x6f82('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x404ba9[_0x6f82('0x53')][_0x6f82('0x58')]],'buttons':null,'topic':_0x2da950['vidaooTopic'],'note':_[_0x6f82('0x59')](_0x2da950[_0x6f82('0x50')])?null:getMustacheRender(_0x2da950['vidaooNote'],_0x2cae63),'metadata':null},'redirect':_0x6f82('0x5a'),'json':!![]};try{if(!_[_0x6f82('0x59')](_0x2da950[_0x6f82('0x51')])){var _0x1d0bbf=getMustacheRender(_0x2da950[_0x6f82('0x51')],_0x2cae63);var _0x11f92e=JSON[_0x6f82('0x5b')](_0x1d0bbf);_0x177f70[_0x6f82('0x31')][_0x6f82('0x5c')]=_0x11f92e;}}catch(_0x59e76f){throw new db[(_0x6f82('0x5d'))][(_0x6f82('0x5e'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x177f70);}else{throw new db[(_0x6f82('0x5d'))][(_0x6f82('0x5e'))](_0x6f82('0x5f'));}})['then'](function(_0x490cad){_0x515b74=_0x490cad;if(_0x515b74['id']){var _0xf16e8c={'body':_0x515b74[_0x6f82('0x60')],'ChatWebsiteId':_0x2da950['id'],'ChatInteractionId':_0x325bbd['id'],'direction':_0x6f82('0x61'),'UserId':_0x404ba9[_0x6f82('0x53')]['id']};return db[_0x6f82('0x62')]['create'](_0xf16e8c,{});}else{throw new db['Sequelize'][(_0x6f82('0x5e'))](_0x6f82('0x63'));}})[_0x6f82('0x18')](function(){return _0x325bbd[_0x6f82('0x64')]({'vidaooSessionId':_0x515b74['id']});})['then'](respondWithResult(_0x5a7baf,null))[_0x6f82('0x22')](handleError(_0x5a7baf,null));};exports[_0x6f82('0x65')]=function(_0x2296f4,_0x54e0bf){if(_0x2296f4[_0x6f82('0x31')]['id']){delete _0x2296f4['body']['id'];}return db[_0x6f82('0x36')][_0x6f82('0x48')]({'where':{'id':_0x2296f4[_0x6f82('0x49')]['id']},'include':[{'model':db[_0x6f82('0x66')],'as':_0x6f82('0x67')}]})['then'](handleEntityNotFound(_0x54e0bf,null))[_0x6f82('0x18')](saveUpdates(_0x2296f4[_0x6f82('0x31')],null))['then'](respondWithResult(_0x54e0bf,null))[_0x6f82('0x22')](handleError(_0x54e0bf,null));};exports[_0x6f82('0x68')]=function(_0x315386,_0x4ba998){if(_0x315386[_0x6f82('0x31')]['id']){delete _0x315386['body']['id'];}return db[_0x6f82('0x36')][_0x6f82('0x48')]({'where':{'id':_0x315386[_0x6f82('0x49')]['id']}})[_0x6f82('0x18')](function(_0xa25368){if(!_0xa25368){logger[_0x6f82('0x1e')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x6f82('0x68'),0x194,_0x6f82('0x69'));_0x4ba998[_0x6f82('0x23')](0x194);}else{if(_0xa25368[_0x6f82('0x6a')]){throw new db['Sequelize'][(_0x6f82('0x5e'))](_0x6f82('0x6b'));}}return _0xa25368;})['then'](function(_0xfcc9fe){if(_0xfcc9fe){return _0xfcc9fe[_0x6f82('0x2c')]({'closed':_0x315386['body'][_0x6f82('0x6c')],'disposition':_0x315386[_0x6f82('0x31')][_0x6f82('0x6d')]})[_0x6f82('0x18')](function(_0xe1df78){return _0xe1df78;});}})['then'](function(){return respondWithRpcPromise(_0x6f82('0x6e'),'abandon',_0x315386[_0x6f82('0x31')],client9004);})['then'](respondWithResult(_0x4ba998,null))[_0x6f82('0x22')](handleError(_0x4ba998,null));};exports[_0x6f82('0x6f')]=function(_0x2393ec,_0x7435a9){_0x2393ec[_0x6f82('0x31')][_0x6f82('0x2f')]=_0x2393ec[_0x6f82('0x70')][_0x6f82('0x71')];_0x2393ec[_0x6f82('0x31')]['basename']=_0x2393ec[_0x6f82('0x70')][_0x6f82('0x72')];_0x2393ec[_0x6f82('0x31')][_0x6f82('0x37')]=_0x2393ec[_0x6f82('0x70')][_0x6f82('0x73')];return db[_0x6f82('0x74')][_0x6f82('0x47')](_0x2393ec[_0x6f82('0x31')])['then'](respondWithResult(_0x7435a9,0xc9))[_0x6f82('0x22')](handleError(_0x7435a9,null));};exports['attachmentDownload']=function(_0x5bfbed,_0x37b99e){return db[_0x6f82('0x36')]['findOne']({'where':{'id':_0x5bfbed['params']['id']},'raw':!![]})[_0x6f82('0x18')](handleEntityNotFound(_0x37b99e,null))['then'](function(_0x4893f7){if(_0x4893f7){if(_0x4893f7[_0x6f82('0x6c')]){return _0x37b99e['status'](0x193)[_0x6f82('0x25')]({'status':0x193,'message':_0x6f82('0x75')});}return db[_0x6f82('0x74')][_0x6f82('0x4c')]({'where':{'id':_0x5bfbed[_0x6f82('0x3b')][_0x6f82('0x76')]},'raw':!![]})[_0x6f82('0x18')](handleEntityNotFound(_0x37b99e,null));}})[_0x6f82('0x18')](function(_0x56caf3){if(_0x56caf3){var _0x363965=_0x56caf3[_0x6f82('0x77')]!==null;var _0x58bfd8=path['join'](config[_0x6f82('0x78')],_0x6f82('0x79'));if(_0x363965){_0x58bfd8=path[_0x6f82('0x7a')](_0x58bfd8,_0x6f82('0x7b'));}var _0x4dfeb2=path[_0x6f82('0x7a')](_0x58bfd8,_0x56caf3[_0x6f82('0x7c')]);return _0x37b99e[_0x6f82('0x7d')](_0x4dfeb2);}})['catch'](handleError(_0x37b99e,null));};exports[_0x6f82('0x7e')]=function(_0x37fa5e,_0x5eedee){var _0xe6e8fa=null;var _0x426184=null;var _0x4dde2b=null;if(_0x37fa5e['body']['id']){delete _0x37fa5e[_0x6f82('0x31')]['id'];}if(_0x37fa5e[_0x6f82('0x31')]['mailTranscript']){_0x4dde2b=path[_0x6f82('0x7a')](config[_0x6f82('0x78')],_0x6f82('0x7f'),util[_0x6f82('0x80')]('transcript-%s.txt',Date[_0x6f82('0x81')]()));_0x37fa5e[_0x6f82('0x31')][_0x6f82('0x82')]=_0x4dde2b;}return db[_0x6f82('0x36')][_0x6f82('0x48')]({'where':{'id':_0x37fa5e[_0x6f82('0x49')]['id']},'include':[{'model':db[_0x6f82('0x62')],'as':_0x6f82('0x83'),'include':[{'model':db['User'],'as':_0x6f82('0x84')}]}]})[_0x6f82('0x18')](handleEntityNotFound(_0x5eedee,null))[_0x6f82('0x18')](saveUpdates(_0x37fa5e[_0x6f82('0x31')],null))[_0x6f82('0x18')](function(_0x55af75){if(_0x55af75){_0xe6e8fa=_0x55af75;return db['ChatWebsite'][_0x6f82('0x48')]({'where':{'id':_0xe6e8fa[_0x6f82('0x4d')]}});}})[_0x6f82('0x18')](function(_0x2ea1f9){if(_0x2ea1f9){_0x426184=_0x2ea1f9;return db['CmContact'][_0x6f82('0x48')]({'where':{'id':_0xe6e8fa[_0x6f82('0x85')]}});}})[_0x6f82('0x18')](function(_0x140925){if(_0x140925){if(_0x4dde2b){var _0x2e972e=null;for(var _0x427fd1=0x1;_0x427fd1<_0xe6e8fa['Messages']['length'];++_0x427fd1){_0x2e972e=_0xe6e8fa[_0x6f82('0x83')][_0x427fd1];var _0x16b85c=_0x2e972e['UserId']?util[_0x6f82('0x80')](_0x6f82('0x86'),_0x426184['agentAlias'],_0x2e972e[_0x6f82('0x6a')]):_0x6f82('0x87');var _0x1ab00a=_0x37fa5e['body']['customer']||util[_0x6f82('0x80')]('%s%d',_0x6f82('0x88'),_0x2e972e[_0x6f82('0x85')]);switch(_0x426184[_0x6f82('0x89')]){case _0x6f82('0x8a'):_0x16b85c=_0x2e972e[_0x6f82('0x6a')]?util[_0x6f82('0x80')](_0x6f82('0x86'),_0x426184[_0x6f82('0x8b')],_0x2e972e[_0x6f82('0x6a')]):_0x6f82('0x87');break;case _0x6f82('0x8c'):_0x16b85c=_0x2e972e[_0x6f82('0x6a')]?_0x2e972e[_0x6f82('0x84')][_0x6f82('0x8d')]||_0x2e972e[_0x6f82('0x84')][_0x6f82('0x54')]:_0x6f82('0x87');break;case _0x6f82('0x8e'):_0x16b85c=_0x2e972e[_0x6f82('0x6a')]?_0x2e972e[_0x6f82('0x84')][_0x6f82('0x54')]:'System';break;default:_0x16b85c=_0x2e972e[_0x6f82('0x6a')]?util[_0x6f82('0x80')](_0x6f82('0x86'),_0x426184[_0x6f82('0x8b')],_0x2e972e['UserId']):_0x6f82('0x87');}var _0x5e79e2=util[_0x6f82('0x80')](_0x6f82('0x8f'),moment(_0x2e972e['createdAt'])[_0x6f82('0x80')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2e972e['direction']==='in'?_0x1ab00a:_0x16b85c,_0x2e972e[_0x6f82('0x31')]);if(!_0x2e972e[_0x6f82('0x90')]){fs[_0x6f82('0x91')](_0x4dde2b,_0x5e79e2);}}return db['MailAccount'][_0x6f82('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x6f82('0x92')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6f82('0x93'),'raw':!![]}]}]});}}})[_0x6f82('0x18')](function(_0x1cf7ef){if(!_0x1cf7ef||!_0x1cf7ef[_0x6f82('0x94')]||!_0x37fa5e[_0x6f82('0x31')])return _0xe6e8fa;var _0x330f1b=_0x1cf7ef['getSmtpOptions']();return respondWithRpcPromise(_0x6f82('0x95'),'sendMail',{'account':_0x330f1b,'message':{'from':util[_0x6f82('0x80')]('\x22%s\x22\x20<%s>',_0x1cf7ef[_0x6f82('0x2f')],_0x1cf7ef[_0x6f82('0x58')]||_0x1cf7ef[_0x6f82('0x94')][_0x6f82('0x53')]),'to':_0x37fa5e[_0x6f82('0x31')][_0x6f82('0x96')],'subject':_0x6f82('0x97'),'text':util[_0x6f82('0x80')](_0x6f82('0x98'),_0x37fa5e['body'][_0x6f82('0x96')]),'attachments':[{'path':_0x4dde2b}]}})[_0x6f82('0x18')](function(){return _0xe6e8fa;})[_0x6f82('0x22')](function(_0x3ab502){logger[_0x6f82('0x1e')](_0x3ab502);});})['then'](respondWithStatusCode(_0x5eedee,0xc8))[_0x6f82('0x22')](handleError(_0x5eedee,null));};exports[_0x6f82('0x99')]=function(_0x183232,_0x15e721){return db[_0x6f82('0x62')][_0x6f82('0x48')]({'where':{'id':_0x183232[_0x6f82('0x49')]['id']}})['then'](handleEntityNotFound(_0x15e721,null))[_0x6f82('0x18')](function(_0x2035e3){if(_0x2035e3){return _0x2035e3[_0x6f82('0x99')](_0x183232[_0x6f82('0x31')][_0x6f82('0x9a')],_[_0x6f82('0x9b')](_0x183232[_0x6f82('0x31')],[_0x6f82('0x9a'),'id'])||{});}})['then'](respondWithResult(_0x15e721,null))['catch'](handleError(_0x15e721,null));};exports[_0x6f82('0x9c')]=function(_0x2923e8,_0x4fbd2f){var _0x2d1af0={'raw':![],'where':{}};var _0x21f81c={};var _0x582013={'count':0x0,'rows':[]};return db[_0x6f82('0x36')][_0x6f82('0x4c')]({'where':{'id':_0x2923e8['params']['id']}})[_0x6f82('0x18')](handleEntityNotFound(_0x4fbd2f,null))[_0x6f82('0x18')](function(_0x269970){if(_0x269970){_0x21f81c[_0x6f82('0x3f')]=_[_0x6f82('0x3d')](db['ChatMessage'][_0x6f82('0x9d')]);_0x21f81c[_0x6f82('0x3b')]=_[_0x6f82('0x3d')](_0x2923e8[_0x6f82('0x3b')]);_0x21f81c[_0x6f82('0x3e')]=_[_0x6f82('0x40')](_0x21f81c[_0x6f82('0x3f')],_0x21f81c['query']);_0x2d1af0[_0x6f82('0x42')]=_['intersection'](_0x21f81c['model'],qs[_0x6f82('0x41')](_0x2923e8[_0x6f82('0x3b')][_0x6f82('0x41')]));_0x2d1af0[_0x6f82('0x42')]=_0x2d1af0[_0x6f82('0x42')][_0x6f82('0x43')]?_0x2d1af0[_0x6f82('0x42')]:_0x21f81c[_0x6f82('0x3f')];if(!_0x2923e8[_0x6f82('0x3b')]['hasOwnProperty'](_0x6f82('0x9e'))){_0x2d1af0[_0x6f82('0x27')]=qs[_0x6f82('0x27')](_0x2923e8[_0x6f82('0x3b')]['limit']);_0x2d1af0[_0x6f82('0x29')]=qs['offset'](_0x2923e8[_0x6f82('0x3b')][_0x6f82('0x29')]);}_0x2d1af0[_0x6f82('0x9f')]=qs[_0x6f82('0xa0')](_0x2923e8[_0x6f82('0x3b')][_0x6f82('0xa0')]);_0x2d1af0[_0x6f82('0xa1')]=qs[_0x6f82('0x3e')](_[_0x6f82('0xa2')](_0x2923e8[_0x6f82('0x3b')],_0x21f81c[_0x6f82('0x3e')]));_0x2d1af0[_0x6f82('0xa1')][_0x6f82('0xa3')]=_0x269970['id'];if(_0x2923e8[_0x6f82('0x3b')][_0x6f82('0xa4')]){_0x2d1af0[_0x6f82('0xa1')]=_[_0x6f82('0x30')](_0x2d1af0['where'],{'$or':_[_0x6f82('0x35')](_0x2d1af0[_0x6f82('0x42')],function(_0x4ce02b){var _0x4963ab={};_0x4963ab[_0x4ce02b]={'$like':'%'+_0x2923e8[_0x6f82('0x3b')][_0x6f82('0xa4')]+'%'};return _0x4963ab;})});}if(_0x2923e8[_0x6f82('0x3b')]['$gte']){var _0x3d8234=_0x2923e8[_0x6f82('0x3b')]['$gte'][_0x6f82('0xa5')](',');var _0x40429a={};_0x40429a[_0x3d8234[0x0]]={'$gte':moment(_0x3d8234[0x1])[_0x6f82('0x80')](_0x6f82('0xa6'))};_0x2d1af0['where']=_[_0x6f82('0x30')](_0x2d1af0[_0x6f82('0xa1')],_0x40429a);}_0x2d1af0=_[_0x6f82('0x30')]({},_0x2d1af0,_0x2923e8[_0x6f82('0x46')]);return db['ChatMessage'][_0x6f82('0x28')]({'where':_0x2d1af0[_0x6f82('0xa1')]})['then'](function(_0x4fa415){_0x582013[_0x6f82('0x28')]=_0x4fa415;if(_0x2923e8[_0x6f82('0x3b')][_0x6f82('0x44')]){_0x2d1af0['include']=[{'all':!![]}];}return db[_0x6f82('0x62')][_0x6f82('0x39')](_0x2d1af0);})['then'](function(_0x217bc6){_0x582013['rows']=_0x217bc6;return _0x582013;});}})['then'](respondWithFilteredResult(_0x4fbd2f,_0x2d1af0))[_0x6f82('0x22')](handleError(_0x4fbd2f,null));};exports[_0x6f82('0xa7')]=function(_0x14c8bb,_0x1b76a7){var _0x4b580f={'where':{}},_0x1cbe28={},_0xe57f7e={'count':0x0,'rows':[]};return db[_0x6f82('0x36')][_0x6f82('0x4c')]({'where':{'id':_0x14c8bb[_0x6f82('0x49')]['id']}})[_0x6f82('0x18')](handleEntityNotFound(_0x1b76a7,null))[_0x6f82('0x18')](function(_0x5a53e9){if(_0x5a53e9){_0x1cbe28['model']=_[_0x6f82('0x3d')](db[_0x6f82('0x62')][_0x6f82('0x9d')]);_0x1cbe28[_0x6f82('0x3b')]=_['keys'](_0x14c8bb['query']);_0x1cbe28[_0x6f82('0x3e')]=_[_0x6f82('0x40')](_0x1cbe28['model'],_0x1cbe28[_0x6f82('0x3b')]);_0x4b580f[_0x6f82('0x42')]=_[_0x6f82('0x40')](_0x1cbe28[_0x6f82('0x3f')],qs[_0x6f82('0x41')](_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0x41')]));_0x4b580f['attributes']=_0x4b580f['attributes'][_0x6f82('0x43')]?_0x4b580f[_0x6f82('0x42')]:_0x1cbe28[_0x6f82('0x3f')];if(!_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0xa8')](_0x6f82('0x9e'))){_0x4b580f['limit']=qs['limit'](_0x14c8bb[_0x6f82('0x3b')]['limit']);_0x4b580f[_0x6f82('0x29')]=qs[_0x6f82('0x29')](_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0x29')]);}_0x4b580f[_0x6f82('0x9f')]=qs[_0x6f82('0xa0')](_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0xa0')]);_0x4b580f[_0x6f82('0xa1')]=qs[_0x6f82('0x3e')](_[_0x6f82('0xa2')](_0x14c8bb[_0x6f82('0x3b')],_0x1cbe28[_0x6f82('0x3e')]));_0x4b580f[_0x6f82('0xa1')][_0x6f82('0xa3')]=_0x5a53e9['id'];if(_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0xa4')]){_0x4b580f[_0x6f82('0xa1')]=_[_0x6f82('0x30')](_0x4b580f[_0x6f82('0xa1')],{'$or':_[_0x6f82('0x35')](_0x4b580f[_0x6f82('0x42')],function(_0x1c3267){var _0x24f6db={};_0x24f6db[_0x1c3267]={'$like':'%'+_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0xa4')]+'%'};return _0x24f6db;})});}_0x4b580f[_0x6f82('0xa1')][_0x6f82('0x90')]=![];if(_0x14c8bb[_0x6f82('0x3b')]['id']){_0x4b580f['where']['id']={'$gt':_0x14c8bb[_0x6f82('0x3b')]['id']};}_0x4b580f=_[_0x6f82('0x30')]({},_0x4b580f,_0x14c8bb['options']);return db[_0x6f82('0x62')][_0x6f82('0x28')]({'where':_0x4b580f['where']})['then'](function(_0x468b8b){_0xe57f7e[_0x6f82('0x28')]=_0x468b8b;_0x4b580f[_0x6f82('0x45')]=[];if(_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0xa9')]){_0x4b580f[_0x6f82('0x45')][_0x6f82('0xaa')]({'model':db['User'],'as':_0x6f82('0x84'),'attributes':['id',_0x6f82('0x54'),_0x6f82('0x8d')]});}if(_0x14c8bb[_0x6f82('0x3b')][_0x6f82('0x44')]){_0x4b580f['include']=[{'all':!![]}];}return db[_0x6f82('0x62')]['findAll'](_0x4b580f);})[_0x6f82('0x18')](function(_0x17e590){_0xe57f7e[_0x6f82('0xab')]=_0x17e590;return _0xe57f7e;});}})[_0x6f82('0x18')](respondWithFilteredResult(_0x1b76a7,_0x4b580f))[_0x6f82('0x22')](handleError(_0x1b76a7,null));};exports[_0x6f82('0xac')]=function(_0x49e4fd,_0x48b999){return db['ChatInteraction'][_0x6f82('0x48')]({'where':{'id':_0x49e4fd[_0x6f82('0x49')]['id']}})[_0x6f82('0x18')](handleEntityNotFound(_0x48b999,null))[_0x6f82('0x18')](function(_0x24df4c){if(_0x24df4c){return _0x24df4c[_0x6f82('0xad')](_0x49e4fd[_0x6f82('0x31')][_0x6f82('0x9a')],_[_0x6f82('0x9b')](_0x49e4fd[_0x6f82('0x31')],[_0x6f82('0x9a'),'id'])||{})[_0x6f82('0xae')](function(){return db['Tag'][_0x6f82('0x39')]({'attributes':['id',_0x6f82('0x2f'),_0x6f82('0xaf')],'where':{'id':_0x49e4fd[_0x6f82('0x31')]['ids']}});})['then'](function(_0x5c1e60){socket['emit']('chatInteractionTags:save',{'id':Number(_0x49e4fd[_0x6f82('0x49')]['id']),'tags':_0x5c1e60||[]});return{'id':Number(_0x49e4fd['params']['id']),'tags':_0x5c1e60||[]};});}})['then'](respondWithResult(_0x48b999,null))[_0x6f82('0x22')](handleError(_0x48b999,null));};exports[_0x6f82('0xb0')]=function(_0x3c58fa,_0x2aa76b){return db['ChatInteraction'][_0x6f82('0x48')]({'where':{'id':_0x3c58fa[_0x6f82('0x49')]['id']}})[_0x6f82('0x18')](handleEntityNotFound(_0x2aa76b,null))[_0x6f82('0x18')](function(_0x5c7967){if(_0x5c7967){return _0x5c7967[_0x6f82('0xb0')](_0x3c58fa[_0x6f82('0x3b')][_0x6f82('0x9a')]);}})[_0x6f82('0x18')](respondWithStatusCode(_0x2aa76b,null))[_0x6f82('0x22')](handleError(_0x2aa76b,null));};exports['download']=function(_0x5f4b02,_0x28debc){var _0x27c45b=moment()[_0x6f82('0xb1')]()[_0x6f82('0xb2')]();var _0x23b7ad=path[_0x6f82('0x7a')](config[_0x6f82('0x78')],_0x6f82('0xb3'),_0x6f82('0xb4'),_0x6f82('0xb5'));var _0x4c47f2=path[_0x6f82('0x7a')](config[_0x6f82('0x78')],_0x6f82('0xb3'),_0x6f82('0xb4'),'attachments');var _0x49d2dd=path[_0x6f82('0x7a')](_0x23b7ad,_0x27c45b);var _0x5bf729=util[_0x6f82('0x80')]('transcript-%d-%s.zip',_0x5f4b02[_0x6f82('0x49')]['id'],_0x27c45b);var _0x3b917b=path[_0x6f82('0x7a')](_0x23b7ad,_0x5bf729);var _0x4db060=[];_0x4db060['push']({'model':db[_0x6f82('0x84')],'as':_0x6f82('0x84'),'attributes':['id',_0x6f82('0x54')],'raw':!![]});_0x4db060['push']({'model':db[_0x6f82('0x66')],'as':_0x6f82('0x67'),'attributes':['id',_0x6f82('0xb6'),_0x6f82('0xb7')],'raw':!![]});if(_0x5f4b02[_0x6f82('0x3b')]['attachments']){_0x4db060[_0x6f82('0xaa')]({'model':db[_0x6f82('0x74')],'as':_0x6f82('0x74'),'raw':!![]});}var _0x269ae7=[{'model':db[_0x6f82('0x62')],'as':'Messages','attributes':['id',_0x6f82('0x31'),'createdAt',_0x6f82('0xb8'),_0x6f82('0x90'),_0x6f82('0xb9')],'include':_0x4db060}];_0x269ae7[_0x6f82('0xaa')]({'model':db[_0x6f82('0xba')],'as':'Account','attributes':['id',_0x6f82('0x2f')]});_0x269ae7['push']({'model':db[_0x6f82('0x84')],'as':_0x6f82('0xbb'),'attributes':['id',_0x6f82('0x54')]});return db['ChatInteraction']['find']({'where':{'id':_0x5f4b02[_0x6f82('0x49')]['id']},'include':_0x269ae7})['then'](handleEntityNotFound(_0x28debc,null))[_0x6f82('0x18')](function(_0x5d469c){if(_0x5d469c){var _0x3447a3=_0x5d469c['get']({'plain':!![]});fs[_0x6f82('0xbc')](_0x49d2dd);var _0x243505={'channel':_0x6f82('0xbd'),'account':_0x3447a3['Account'][_0x6f82('0x2f')],'agent':_0x3447a3[_0x6f82('0xbb')]?_0x3447a3[_0x6f82('0xbb')][_0x6f82('0x54')]:'N.A.','createdAt':moment(_0x3447a3[_0x6f82('0xbe')])[_0x6f82('0x80')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6f82('0xb2')](),'closedAt':_0x3447a3[_0x6f82('0x6c')]?moment(_0x3447a3[_0x6f82('0xbf')])['format'](_0x6f82('0xa6'))[_0x6f82('0xb2')]():'','disposition':_0x3447a3[_0x6f82('0x6d')],'chatInfo':{'browser':_0x3447a3['browserName'],'os':_0x3447a3[_0x6f82('0xc0')],'referer':_0x3447a3[_0x6f82('0xc1')],'customerIp':_0x3447a3[_0x6f82('0xc2')],'customerPort':_0x3447a3[_0x6f82('0xc3')]?_0x3447a3[_0x6f82('0xc3')]:_0x6f82('0xc4')},'messages':_(_0x3447a3[_0x6f82('0x83')])[_0x6f82('0xc5')]()[_0x6f82('0xa4')]({'secret':![]})['map'](function(_0x2e654c){if(_0x2e654c['Attachment']){var _0x1087d5=path[_0x6f82('0x7a')](_0x4c47f2,_0x2e654c[_0x6f82('0x74')]['basename']);if(fs['existsSync'](_0x1087d5)){fs['createReadStream'](_0x1087d5)[_0x6f82('0xc6')](fs[_0x6f82('0xc7')](path[_0x6f82('0x7a')](_0x49d2dd,_0x2e654c[_0x6f82('0x74')]['basename'])));}}return{'date':moment(_0x2e654c[_0x6f82('0xbe')])[_0x6f82('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2e654c[_0x6f82('0xb8')]===_0x6f82('0x61')?_0x2e654c[_0x6f82('0x84')]?_0x2e654c[_0x6f82('0x84')][_0x6f82('0x54')]:_0x6f82('0x87'):_0x2e654c[_0x6f82('0x67')][_0x6f82('0xb6')]+(_0x2e654c[_0x6f82('0x67')][_0x6f82('0xb7')]?'\x20'+_0x2e654c[_0x6f82('0x67')][_0x6f82('0xb7')]:''),'body':_0x2e654c[_0x6f82('0x74')]?_0x2e654c['Attachment'][_0x6f82('0x7c')]:_0x2e654c[_0x6f82('0x31')],'direction':_0x2e654c['direction']===_0x6f82('0x61')?'A':'C','secret':_0x2e654c[_0x6f82('0x90')],'read':_0x2e654c[_0x6f82('0xb9')],'attachment':_0x2e654c[_0x6f82('0x74')]};})[_0x6f82('0xc8')]()};return ejs[_0x6f82('0xc9')](path[_0x6f82('0x7a')](config[_0x6f82('0x78')],_0x6f82('0xb3'),_0x6f82('0xca'),_0x6f82('0xcb')),{'interaction':_0x243505})[_0x6f82('0x18')](function(_0x61d3aa){var _0x1b2f21=path[_0x6f82('0x7a')](_0x49d2dd,_0x6f82('0xcc')+_0x3447a3['id']+'-'+_0x27c45b+_0x6f82('0xcd'));var _0x3317df={'path':_0x1b2f21,'channel':'Chat','interactionId':_0x3447a3['id']};return pdf[_0x6f82('0xce')](_0x61d3aa,_0x3317df);})[_0x6f82('0x18')](function(){return new Promise(function(_0x12cdde,_0x7c1325){zipdir(_0x49d2dd,{'saveTo':_0x3b917b},function(_0x49ac21,_0xd738e2){if(_0x49ac21)return _0x7c1325(_0x49ac21);return _0x12cdde(_0xd738e2);});})[_0x6f82('0x18')](function(){return new BPromise(function(_0x5696b0,_0x3d7a6a){rimraf(_0x49d2dd,function(_0x5d030d){if(_0x5d030d)_0x3d7a6a(_0x5d030d);return _0x5696b0();});});})[_0x6f82('0x18')](function(){return _0x28debc['download'](_0x3b917b,_0x5bf729,function(_0x47dbb2){if(_0x47dbb2){logger[_0x6f82('0x1e')]('err',_0x47dbb2);}else{fs[_0x6f82('0xcf')](_0x3b917b);}});});});}else{return _0x28debc[_0x6f82('0x23')](0xc8);}})[_0x6f82('0x22')](handleError(_0x28debc,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index df7f45b..808118a 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 _0x6c23=['ChatInteraction','ChatMessage','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x21a38e,_0x31404b){var _0x61dd7d=function(_0x105f79){while(--_0x105f79){_0x21a38e['push'](_0x21a38e['shift']());}};_0x61dd7d(++_0x31404b);}(_0x6c23,0x131));var _0x36c2=function(_0x37c840,_0x5d052a){_0x37c840=_0x37c840-0x0;var _0x975c36=_0x6c23[_0x37c840];return _0x975c36;};'use strict';var EventEmitter=require(_0x36c2('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x36c2('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x36c2('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x36c2('0x3')](0x0);var events={'afterCreate':_0x36c2('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3c6ea8){return function(_0x2f9129,_0x2606e9,_0x2cd54b){_0x2f9129[_0x36c2('0x5')]({'attributes':['id'],'raw':!![]})[_0x36c2('0x6')](function(_0x38e107){_0x2f9129['setDataValue'](_0x36c2('0x7'),_0x38e107[_0x36c2('0x8')](function(_0x6992b8){return{'id':_0x6992b8['id']};}));return ChatMessage[_0x36c2('0x9')]({'where':{'ChatInteractionId':_0x2f9129['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x99f706){_0x2f9129[_0x36c2('0xa')](_0x36c2('0xb'),_0x99f706[_0x36c2('0xc')]);ChatInteractionEvents[_0x36c2('0xd')](_0x3c6ea8+':'+_0x2f9129['id'],_0x2f9129);ChatInteractionEvents['emit'](_0x3c6ea8,_0x2f9129);_0x2cd54b(null);})[_0x36c2('0xe')](_0x2cd54b(null));};}for(var e in events){if(events[_0x36c2('0xf')](e)){var event=events[e];ChatInteraction[_0x36c2('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x770f=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x770f,0x7e));var _0xf770=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x770f[_0x38854e];return _0x3f8415;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xf770('0x0'))['db'][_0xf770('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf770('0x2')](0x0);var events={'afterCreate':_0xf770('0x3'),'afterUpdate':_0xf770('0x4'),'afterDestroy':_0xf770('0x5')};function emitEvent(_0x52f9b9){return function(_0x16e042,_0x91eb20,_0x4fe207){_0x16e042['getUsers']({'attributes':['id'],'raw':!![]})[_0xf770('0x6')](function(_0x4a9d77){_0x16e042[_0xf770('0x7')](_0xf770('0x8'),_0x4a9d77[_0xf770('0x9')](function(_0x3f909e){return{'id':_0x3f909e['id']};}));return ChatMessage[_0xf770('0xa')]({'where':{'ChatInteractionId':_0x16e042['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf770('0x6')](function(_0x2c1c57){_0x16e042[_0xf770('0x7')](_0xf770('0xb'),_0x2c1c57['length']);ChatInteractionEvents['emit'](_0x52f9b9+':'+_0x16e042['id'],_0x16e042);ChatInteractionEvents[_0xf770('0xc')](_0x52f9b9,_0x16e042);_0x4fe207(null);})[_0xf770('0xd')](_0x4fe207(null));};}for(var e in events){if(events[_0xf770('0xe')](e)){var event=events[e];ChatInteraction[_0xf770('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 5969992..878e8dc 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 _0x2f99=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2f99,0x133));var _0x92f9=function(_0x5b2008,_0x5121fe){_0x5b2008=_0x5b2008-0x0;var _0x1eb25a=_0x2f99[_0x5b2008];return _0x1eb25a;};'use strict';var _=require('lodash');var util=require(_0x92f9('0x0'));var logger=require(_0x92f9('0x1'))(_0x92f9('0x2'));var moment=require(_0x92f9('0x3'));var BPromise=require(_0x92f9('0x4'));var rp=require(_0x92f9('0x5'));var fs=require('fs');var path=require(_0x92f9('0x6'));var rimraf=require(_0x92f9('0x7'));var config=require(_0x92f9('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x224695,_0x155a6f){return _0x224695[_0x92f9('0x9')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x563566,_0x3cbaeb,_0x49caad){if(_0x563566['changed']('closed')){_0x563566[_0x92f9('0xa')]=moment()[_0x92f9('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x49caad(null,_0x563566);}},'charset':_0x92f9('0xc'),'collate':_0x92f9('0xd')});};
\ No newline at end of file
+var _0x6238=['moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0xb2d0a3,_0x76c6b1){var _0x52f58c=function(_0x2ded29){while(--_0x2ded29){_0xb2d0a3['push'](_0xb2d0a3['shift']());}};_0x52f58c(++_0x76c6b1);}(_0x6238,0x8d));var _0x8623=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6238[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x8623('0x0'));var logger=require(_0x8623('0x1'))(_0x8623('0x2'));var moment=require(_0x8623('0x3'));var BPromise=require(_0x8623('0x4'));var rp=require(_0x8623('0x5'));var fs=require('fs');var path=require(_0x8623('0x6'));var rimraf=require(_0x8623('0x7'));var config=require('../../config/environment');var attributes=require(_0x8623('0x8'));module[_0x8623('0x9')]=function(_0x43b64f,_0x88d5c7){return _0x43b64f[_0x8623('0xa')]('ChatInteraction',attributes,{'tableName':_0x8623('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2140eb,_0x5c6a8c,_0x133833){if(_0x2140eb[_0x8623('0xc')](_0x8623('0xd'))){_0x2140eb[_0x8623('0xe')]=moment()['format'](_0x8623('0xf'));}_0x133833(null,_0x2140eb);}},'charset':_0x8623('0x10'),'collate':_0x8623('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e4dfd8f..49797e2 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 _0x7ecd=['raw','options','limit','debug','AddTagsToChatInteraction','where','ids','omit','AddTags','stringify','lodash','util','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','body'];(function(_0x5f425c,_0x2a7106){var _0x38ebb4=function(_0x1eba01){while(--_0x1eba01){_0x5f425c['push'](_0x5f425c['shift']());}};_0x38ebb4(++_0x2a7106);}(_0x7ecd,0x1eb));var _0xd7ec=function(_0x50b268,_0x47ba92){_0x50b268=_0x50b268-0x0;var _0x41577c=_0x7ecd[_0x50b268];return _0x41577c;};'use strict';var _=require(_0xd7ec('0x0'));var util=require(_0xd7ec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7ec('0x2'));var db=require(_0xd7ec('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7ec('0x4'))('rpc');var config=require(_0xd7ec('0x5'));var jayson=require(_0xd7ec('0x6'));var client=jayson[_0xd7ec('0x7')][_0xd7ec('0x8')]({'port':0x232a});config[_0xd7ec('0x9')]=_[_0xd7ec('0xa')](config[_0xd7ec('0x9')],{'host':_0xd7ec('0xb'),'port':0x18eb});var socket=require(_0xd7ec('0xc'))(new Redis(config['redis']));require(_0xd7ec('0xd'))['register'](socket);function respondWithRpcPromise(_0x10a501,_0x37dd1a,_0x287db0){return new BPromise(function(_0x5be2b2,_0x144913){return client[_0xd7ec('0xe')](_0x10a501,_0x287db0)[_0xd7ec('0xf')](function(_0x5e6534){logger[_0xd7ec('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x37dd1a,_0xd7ec('0x11'));logger['debug'](_0xd7ec('0x12'),_0x37dd1a,_0xd7ec('0x11'),JSON['stringify'](_0x5e6534));if(_0x5e6534[_0xd7ec('0x13')]){if(_0x5e6534[_0xd7ec('0x13')][_0xd7ec('0x14')]===0x1f4){logger[_0xd7ec('0x13')](_0xd7ec('0x15'),_0x37dd1a,_0x5e6534['error'][_0xd7ec('0x16')]);return _0x144913(_0x5e6534[_0xd7ec('0x13')]['message']);}logger[_0xd7ec('0x13')](_0xd7ec('0x15'),_0x37dd1a,_0x5e6534[_0xd7ec('0x13')][_0xd7ec('0x16')]);return _0x5be2b2(_0x5e6534[_0xd7ec('0x13')][_0xd7ec('0x16')]);}else{logger[_0xd7ec('0x10')](_0xd7ec('0x15'),_0x37dd1a,'request\x20sent');_0x5be2b2(_0x5e6534['result']['message']);}})[_0xd7ec('0x17')](function(_0x4dbb02){logger[_0xd7ec('0x13')](_0xd7ec('0x15'),_0x37dd1a,_0x4dbb02);_0x144913(_0x4dbb02);});});}exports[_0xd7ec('0x18')]=function(_0x20e40b){var _0x324571=this;return new Promise(function(_0x4ac388,_0x3286b0){return db[_0xd7ec('0x19')]['update'](_0x20e40b[_0xd7ec('0x1a')],{'raw':_0x20e40b['options']?_0x20e40b['options'][_0xd7ec('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20e40b[_0xd7ec('0x1c')]?_0x20e40b[_0xd7ec('0x1c')]['where']||null:null,'attributes':_0x20e40b[_0xd7ec('0x1c')]?_0x20e40b[_0xd7ec('0x1c')]['attributes']||null:null,'limit':_0x20e40b[_0xd7ec('0x1c')]?_0x20e40b['options'][_0xd7ec('0x1d')]||null:null})['then'](function(_0x220169){logger[_0xd7ec('0x10')](_0xd7ec('0x18'),_0x20e40b);logger[_0xd7ec('0x1e')](_0xd7ec('0x18'),_0x20e40b,JSON['stringify'](_0x220169));_0x4ac388(_0x220169);})['catch'](function(_0x4d9b4f){logger[_0xd7ec('0x13')]('UpdateChatInteraction',_0x4d9b4f[_0xd7ec('0x16')],_0x20e40b);_0x3286b0(_0x324571[_0xd7ec('0x13')](0x1f4,_0x4d9b4f[_0xd7ec('0x16')]));});});};exports[_0xd7ec('0x1f')]=function(_0x211443){return new Promise(function(_0x33ebd5,_0x4bd123){return db['ChatInteraction']['find']({'where':_0x211443[_0xd7ec('0x1c')]?_0x211443[_0xd7ec('0x1c')][_0xd7ec('0x20')]||null:null})[_0xd7ec('0xf')](function(_0x52efad){if(_0x52efad){return _0x52efad['addTags'](_0x211443[_0xd7ec('0x1a')][_0xd7ec('0x21')],_[_0xd7ec('0x22')](_0x211443[_0xd7ec('0x1a')],['ids','id'])||{});}})['spread'](function(_0x5824b8){logger['info']('AddTags',_0x211443);logger[_0xd7ec('0x1e')](_0xd7ec('0x23'),_0x211443,JSON[_0xd7ec('0x24')](_0x5824b8));_0x33ebd5(_0x5824b8);})[_0xd7ec('0x17')](function(_0x2ed5fd){logger['error'](_0xd7ec('0x23'),_0x2ed5fd[_0xd7ec('0x16')],_0x211443);_0x4bd123(_this['error'](0x1f4,_0x2ed5fd[_0xd7ec('0x16')]));});});};
\ No newline at end of file
+var _0x4d59=['http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','update','body','raw','options','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x58f342,_0x10a137){var _0x41aecc=function(_0x13c5f0){while(--_0x13c5f0){_0x58f342['push'](_0x58f342['shift']());}};_0x41aecc(++_0x10a137);}(_0x4d59,0xf7));var _0x94d5=function(_0x3834e6,_0x3716eb){_0x3834e6=_0x3834e6-0x0;var _0x4d50e4=_0x4d59[_0x3834e6];return _0x4d50e4;};'use strict';var _=require(_0x94d5('0x0'));var util=require(_0x94d5('0x1'));var moment=require(_0x94d5('0x2'));var BPromise=require(_0x94d5('0x3'));var rs=require(_0x94d5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94d5('0x5'))['db'];var utils=require(_0x94d5('0x6'));var logger=require(_0x94d5('0x7'))(_0x94d5('0x8'));var config=require(_0x94d5('0x9'));var jayson=require(_0x94d5('0xa'));var client=jayson['client'][_0x94d5('0xb')]({'port':0x232a});config[_0x94d5('0xc')]=_[_0x94d5('0xd')](config[_0x94d5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x94d5('0xe'))(new Redis(config[_0x94d5('0xc')]));require(_0x94d5('0xf'))['register'](socket);function respondWithRpcPromise(_0x314d2c,_0x566065,_0x1dd5e3){return new BPromise(function(_0x1fc133,_0x4c1be8){return client[_0x94d5('0x10')](_0x314d2c,_0x1dd5e3)[_0x94d5('0x11')](function(_0xcb2e70){logger[_0x94d5('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x566065,'request\x20sent');logger[_0x94d5('0x13')](_0x94d5('0x14'),_0x566065,_0x94d5('0x15'),JSON[_0x94d5('0x16')](_0xcb2e70));if(_0xcb2e70[_0x94d5('0x17')]){if(_0xcb2e70[_0x94d5('0x17')][_0x94d5('0x18')]===0x1f4){logger['error'](_0x94d5('0x19'),_0x566065,_0xcb2e70[_0x94d5('0x17')][_0x94d5('0x1a')]);return _0x4c1be8(_0xcb2e70['error'][_0x94d5('0x1a')]);}logger[_0x94d5('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x566065,_0xcb2e70[_0x94d5('0x17')]['message']);return _0x1fc133(_0xcb2e70['error'][_0x94d5('0x1a')]);}else{logger[_0x94d5('0x12')](_0x94d5('0x19'),_0x566065,'request\x20sent');_0x1fc133(_0xcb2e70['result']['message']);}})[_0x94d5('0x1b')](function(_0x1246c2){logger[_0x94d5('0x17')](_0x94d5('0x19'),_0x566065,_0x1246c2);_0x4c1be8(_0x1246c2);});});}exports[_0x94d5('0x1c')]=function(_0x3dba1b){var _0x3a7cba=this;return new Promise(function(_0x3a6663,_0x370aa4){return db[_0x94d5('0x1d')][_0x94d5('0x1e')](_0x3dba1b[_0x94d5('0x1f')],{'raw':_0x3dba1b['options']?_0x3dba1b['options'][_0x94d5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dba1b[_0x94d5('0x21')]?_0x3dba1b['options']['where']||null:null,'attributes':_0x3dba1b[_0x94d5('0x21')]?_0x3dba1b['options'][_0x94d5('0x22')]||null:null,'limit':_0x3dba1b[_0x94d5('0x21')]?_0x3dba1b[_0x94d5('0x21')][_0x94d5('0x23')]||null:null})[_0x94d5('0x11')](function(_0x147fec){logger['info'](_0x94d5('0x1c'),_0x3dba1b);logger[_0x94d5('0x13')](_0x94d5('0x1c'),_0x3dba1b,JSON[_0x94d5('0x16')](_0x147fec));_0x3a6663(_0x147fec);})[_0x94d5('0x1b')](function(_0x365d9a){logger[_0x94d5('0x17')](_0x94d5('0x1c'),_0x365d9a[_0x94d5('0x1a')],_0x3dba1b);_0x370aa4(_0x3a7cba['error'](0x1f4,_0x365d9a[_0x94d5('0x1a')]));});});};exports[_0x94d5('0x24')]=function(_0x5c961a){return new Promise(function(_0xd99e6b,_0x30f27c){return db[_0x94d5('0x1d')][_0x94d5('0x25')]({'where':_0x5c961a[_0x94d5('0x21')]?_0x5c961a['options'][_0x94d5('0x26')]||null:null})[_0x94d5('0x11')](function(_0xeab39b){if(_0xeab39b){return _0xeab39b[_0x94d5('0x27')](_0x5c961a['body'][_0x94d5('0x28')],_['omit'](_0x5c961a['body'],[_0x94d5('0x28'),'id'])||{});}})[_0x94d5('0x29')](function(_0x5a5cad){logger[_0x94d5('0x12')](_0x94d5('0x2a'),_0x5c961a);logger[_0x94d5('0x13')](_0x94d5('0x2a'),_0x5c961a,JSON[_0x94d5('0x16')](_0x5a5cad));_0xd99e6b(_0x5a5cad);})[_0x94d5('0x1b')](function(_0x1b068e){logger['error'](_0x94d5('0x2a'),_0x1b068e['message'],_0x5c961a);_0x30f27c(_this[_0x94d5('0x17')](0x1f4,_0x1b068e[_0x94d5('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d1ef32f..b6b91a2 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 _0xe1c3=['remove','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x2129df,_0x357045){var _0x1e09a8=function(_0x19a3b9){while(--_0x19a3b9){_0x2129df['push'](_0x2129df['shift']());}};_0x1e09a8(++_0x357045);}(_0xe1c3,0x1de));var _0x3e1c=function(_0x28b43d,_0x53eaaf){_0x28b43d=_0x28b43d-0x0;var _0x3083e8=_0xe1c3[_0x28b43d];return _0x3083e8;};'use strict';var ChatInteractionEvents=require(_0x3e1c('0x0'));var events=[_0x3e1c('0x1'),_0x3e1c('0x2'),'update'];function createListener(_0x4eada8,_0x240748){return function(_0x5e34f2){_0x240748[_0x3e1c('0x3')](_0x4eada8,_0x5e34f2);};}function removeListener(_0x234423,_0x5aca4f){return function(){ChatInteractionEvents[_0x3e1c('0x4')](_0x234423,_0x5aca4f);};}exports[_0x3e1c('0x5')]=function(_0x23fb17){for(var _0x11b92b=0x0,_0x26f5e6=events[_0x3e1c('0x6')];_0x11b92b<_0x26f5e6;_0x11b92b++){var _0x4c8285=events[_0x11b92b];var _0x438353=createListener(_0x3e1c('0x7')+_0x4c8285,_0x23fb17);ChatInteractionEvents['on'](_0x4c8285,_0x438353);}};
\ No newline at end of file
+var _0x948d=['length','chatInteraction:','save','update','emit','removeListener','register'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x948d,0x1c9));var _0xd948=function(_0x1b8920,_0x22ddbe){_0x1b8920=_0x1b8920-0x0;var _0x687a5c=_0x948d[_0x1b8920];return _0x687a5c;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xd948('0x0'),'remove',_0xd948('0x1')];function createListener(_0x3744cb,_0x301371){return function(_0x591d3d){_0x301371[_0xd948('0x2')](_0x3744cb,_0x591d3d);};}function removeListener(_0x539c7f,_0x30676e){return function(){ChatInteractionEvents[_0xd948('0x3')](_0x539c7f,_0x30676e);};}exports[_0xd948('0x4')]=function(_0x85ca62){for(var _0x469aee=0x0,_0x3313d9=events[_0xd948('0x5')];_0x469aee<_0x3313d9;_0x469aee++){var _0x2da851=events[_0x469aee];var _0x2e26ba=createListener(_0xd948('0x6')+_0x2da851,_0x85ca62);ChatInteractionEvents['on'](_0x2da851,_0x2e26ba);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d48cc12..a1d7a54 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 _0x9c06=['delete','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','post','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy'];(function(_0x2beabf,_0x1c98e5){var _0x5437d9=function(_0x461772){while(--_0x461772){_0x2beabf['push'](_0x2beabf['shift']());}};_0x5437d9(++_0x1c98e5);}(_0x9c06,0x107));var _0x69c0=function(_0x42d95e,_0x496c02){_0x42d95e=_0x42d95e-0x0;var _0x1c38c6=_0x9c06[_0x42d95e];return _0x1c38c6;};'use strict';var multer=require('multer');var util=require(_0x69c0('0x0'));var path=require(_0x69c0('0x1'));var timeout=require(_0x69c0('0x2'));var express=require(_0x69c0('0x3'));var router=express['Router']();var fs_extra=require(_0x69c0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x69c0('0x5'));var config=require('../../config/environment');var controller=require(_0x69c0('0x6'));router[_0x69c0('0x7')]('/',auth[_0x69c0('0x8')](),controller[_0x69c0('0x9')]);router[_0x69c0('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x69c0('0xa')]);router[_0x69c0('0x7')](_0x69c0('0xb'),auth[_0x69c0('0xc')](),controller[_0x69c0('0xd')]);router[_0x69c0('0x7')](_0x69c0('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x69c0('0xf')]);router[_0x69c0('0x7')](_0x69c0('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x69c0('0x7')]('/:id/my_messages',auth[_0x69c0('0xc')](),controller[_0x69c0('0x11')]);router['get']('/:id/download',auth[_0x69c0('0x8')](),controller[_0x69c0('0x12')]);router[_0x69c0('0x13')]('/',auth[_0x69c0('0x8')](),controller['create']);router['post'](_0x69c0('0x14'),auth[_0x69c0('0x8')](),controller[_0x69c0('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x23570a,_0x2db4e5,_0xa973ed){_0xa973ed(null,path[_0x69c0('0x16')](config[_0x69c0('0x17')],_0x69c0('0x18')));},'filename':function(_0x10f47c,_0x2015bb,_0x17ae21){_0x17ae21(null,util[_0x69c0('0x19')](_0x69c0('0x1a'),Date[_0x69c0('0x1b')](),_0x2015bb[_0x69c0('0x1c')][_0x69c0('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x69c0('0x1e')](_0x69c0('0x1f')),controller[_0x69c0('0x20')]);router[_0x69c0('0x13')](_0x69c0('0x10'),auth[_0x69c0('0xc')](),controller[_0x69c0('0x21')]);router['post'](_0x69c0('0x22'),auth[_0x69c0('0x8')](),interaction[_0x69c0('0x23')]('chat',_0x69c0('0x24')),controller['addTags']);router[_0x69c0('0x25')](_0x69c0('0xb'),auth[_0x69c0('0x8')](),interaction[_0x69c0('0x23')](_0x69c0('0x26'),_0x69c0('0x27')),controller[_0x69c0('0x28')]);router[_0x69c0('0x25')](_0x69c0('0x29'),controller[_0x69c0('0x2a')]);router[_0x69c0('0x25')](_0x69c0('0x2b'),auth[_0x69c0('0xc')](),controller[_0x69c0('0x2c')]);router[_0x69c0('0x25')](_0x69c0('0x2d'),controller[_0x69c0('0x2e')]);router['delete'](_0x69c0('0xb'),auth[_0x69c0('0x8')](),interaction[_0x69c0('0x23')](_0x69c0('0x26'),_0x69c0('0x2f')),controller[_0x69c0('0x30')]);router[_0x69c0('0x31')](_0x69c0('0x22'),auth[_0x69c0('0x8')](),controller[_0x69c0('0x32')]);module[_0x69c0('0x33')]=router;
\ No newline at end of file
+var _0x5536=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','root','format','%s-%s','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put'];(function(_0x9e51d4,_0x21d976){var _0x29efb8=function(_0x41e09b){while(--_0x41e09b){_0x9e51d4['push'](_0x9e51d4['shift']());}};_0x29efb8(++_0x21d976);}(_0x5536,0xd6));var _0x6553=function(_0xaed81a,_0x193d9f){_0xaed81a=_0xaed81a-0x0;var _0x5e02f6=_0x5536[_0xaed81a];return _0x5e02f6;};'use strict';var multer=require('multer');var util=require(_0x6553('0x0'));var path=require(_0x6553('0x1'));var timeout=require(_0x6553('0x2'));var express=require(_0x6553('0x3'));var router=express['Router']();var fs_extra=require(_0x6553('0x4'));var auth=require(_0x6553('0x5'));var interaction=require(_0x6553('0x6'));var config=require(_0x6553('0x7'));var controller=require(_0x6553('0x8'));router[_0x6553('0x9')]('/',auth[_0x6553('0xa')](),controller[_0x6553('0xb')]);router['get'](_0x6553('0xc'),auth['isAuthenticated'](),controller[_0x6553('0xd')]);router[_0x6553('0x9')](_0x6553('0xe'),auth[_0x6553('0xf')](),controller[_0x6553('0x10')]);router[_0x6553('0x9')](_0x6553('0x11'),auth[_0x6553('0xf')](),controller[_0x6553('0x12')]);router[_0x6553('0x9')](_0x6553('0x13'),auth[_0x6553('0xa')](),controller[_0x6553('0x14')]);router[_0x6553('0x9')](_0x6553('0x15'),auth[_0x6553('0xf')](),controller[_0x6553('0x16')]);router[_0x6553('0x9')](_0x6553('0x17'),auth[_0x6553('0xa')](),controller['download']);router[_0x6553('0x18')]('/',auth[_0x6553('0xa')](),controller[_0x6553('0x19')]);router['post'](_0x6553('0x1a'),auth[_0x6553('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2335d9,_0x39cc1e,_0x349f30){_0x349f30(null,path['join'](config[_0x6553('0x1b')],'server/files/attachments/'));},'filename':function(_0x3b80b4,_0x507856,_0x18d70f){_0x18d70f(null,util[_0x6553('0x1c')](_0x6553('0x1d'),Date['now'](),_0x507856[_0x6553('0x1e')][_0x6553('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x6553('0x20'),upload['single'](_0x6553('0x21')),controller['attachmentUpload']);router[_0x6553('0x18')](_0x6553('0x13'),auth[_0x6553('0xf')](),controller[_0x6553('0x22')]);router[_0x6553('0x18')](_0x6553('0x23'),auth[_0x6553('0xa')](),interaction[_0x6553('0x24')](_0x6553('0x25'),_0x6553('0x26')),controller[_0x6553('0x27')]);router[_0x6553('0x28')](_0x6553('0xe'),auth[_0x6553('0xa')](),interaction['tracked'](_0x6553('0x25'),_0x6553('0x29')),controller[_0x6553('0x2a')]);router[_0x6553('0x28')](_0x6553('0x2b'),controller[_0x6553('0x2c')]);router['put'](_0x6553('0x2d'),auth[_0x6553('0xf')](),controller['abandon']);router[_0x6553('0x28')](_0x6553('0x2e'),controller['close']);router[_0x6553('0x2f')]('/:id',auth[_0x6553('0xa')](),interaction[_0x6553('0x24')](_0x6553('0x25'),_0x6553('0x30')),controller['destroy']);router[_0x6553('0x2f')](_0x6553('0x23'),auth[_0x6553('0xa')](),controller[_0x6553('0x31')]);module[_0x6553('0x32')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 12b6afd..618fbeb 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 _0x6e44=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x26f38c,_0x2021ad){var _0x124df8=function(_0x501adb){while(--_0x501adb){_0x26f38c['push'](_0x26f38c['shift']());}};_0x124df8(++_0x2021ad);}(_0x6e44,0xbf));var _0x46e4=function(_0x15f685,_0x39436d){_0x15f685=_0x15f685-0x0;var _0x171efd=_0x6e44[_0x15f685];return _0x171efd;};'use strict';var Sequelize=require(_0x46e4('0x0'));module[_0x46e4('0x1')]={'body':{'type':Sequelize[_0x46e4('0x2')](_0x46e4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x46e4('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1ccf=['exports','INTEGER'];(function(_0x2cdd7b,_0x21ae5a){var _0xf8dcf8=function(_0x497663){while(--_0x497663){_0x2cdd7b['push'](_0x2cdd7b['shift']());}};_0xf8dcf8(++_0x21ae5a);}(_0x1ccf,0x1ba));var _0xf1cc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1ccf[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0xf1cc('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf1cc('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 434ead7..f0af5fd 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 _0x193c=['messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Agents','UserProfileResource','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','filters','include','create','body','find','describe','get'];(function(_0x4bca54,_0x4750c0){var _0x478911=function(_0x2c498a){while(--_0x2c498a){_0x4bca54['push'](_0x4bca54['shift']());}};_0x478911(++_0x4750c0);}(_0x193c,0x1d3));var _0xc193=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x193c[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xc193('0x0'));var rimraf=require(_0xc193('0x1'));var zipdir=require(_0xc193('0x2'));var jsonpatch=require(_0xc193('0x3'));var rp=require(_0xc193('0x4'));var moment=require(_0xc193('0x5'));var BPromise=require(_0xc193('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc193('0x7'));var sox=require(_0xc193('0x8'));var csv=require(_0xc193('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc193('0xa'));var _=require(_0xc193('0xb'));var squel=require(_0xc193('0xc'));var crypto=require(_0xc193('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc193('0xe'));var toCsv=require(_0xc193('0x9'));var querystring=require(_0xc193('0xf'));var Papa=require(_0xc193('0x10'));var Redis=require('ioredis');var authService=require(_0xc193('0x11'));var qs=require(_0xc193('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc193('0x13'));var logger=require(_0xc193('0x14'))(_0xc193('0x15'));var utils=require(_0xc193('0x16'));var config=require(_0xc193('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc193('0x18'))['db'];config[_0xc193('0x19')]=_[_0xc193('0x1a')](config[_0xc193('0x19')],{'host':_0xc193('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc193('0x1c'))['register'](socket);function respondWithStatusCode(_0x21a12e,_0xaa7591){_0xaa7591=_0xaa7591||0xcc;return function(_0x734d9f){if(_0x734d9f){return _0x21a12e[_0xc193('0x1d')](_0xaa7591);}return _0x21a12e[_0xc193('0x1e')](_0xaa7591)[_0xc193('0x1f')]();};}function respondWithResult(_0x3edda6,_0x333875){_0x333875=_0x333875||0xc8;return function(_0x327451){if(_0x327451){return _0x3edda6[_0xc193('0x1e')](_0x333875)[_0xc193('0x20')](_0x327451);}};}function respondWithFilteredResult(_0x2e941f,_0x2f4e58){return function(_0x2876b1){if(_0x2876b1){var _0x3a3a36=typeof _0x2f4e58[_0xc193('0x21')]===_0xc193('0x22')&&typeof _0x2f4e58[_0xc193('0x23')]===_0xc193('0x22');var _0x4222fa=_0x2876b1['count'];var _0x540242=_0x3a3a36?0x0:_0x2f4e58[_0xc193('0x21')];var _0xcd5cc3=_0x3a3a36?_0x2876b1[_0xc193('0x24')]:_0x2f4e58[_0xc193('0x21')]+_0x2f4e58[_0xc193('0x23')];var _0x45b6cf;if(_0xcd5cc3>=_0x4222fa){_0xcd5cc3=_0x4222fa;_0x45b6cf=0xc8;}else{_0x45b6cf=0xce;}_0x2e941f[_0xc193('0x1e')](_0x45b6cf);return _0x2e941f[_0xc193('0x25')](_0xc193('0x26'),_0x540242+'-'+_0xcd5cc3+'/'+_0x4222fa)[_0xc193('0x20')](_0x2876b1);}return null;};}function patchUpdates(_0x17de7b){return function(_0x4c4474){try{jsonpatch[_0xc193('0x27')](_0x4c4474,_0x17de7b,!![]);}catch(_0x33a8c5){return BPromise[_0xc193('0x28')](_0x33a8c5);}return _0x4c4474['save']();};}function saveUpdates(_0x4643c2,_0x12fc74){return function(_0xd0c93c){if(_0xd0c93c){return _0xd0c93c[_0xc193('0x29')](_0x4643c2)[_0xc193('0x2a')](function(_0x572b50){return _0x572b50;});}return null;};}function removeEntity(_0x39924d,_0x584b1a){return function(_0x37e625){if(_0x37e625){return _0x37e625[_0xc193('0x2b')]()[_0xc193('0x2a')](function(){_0x39924d[_0xc193('0x1e')](0xcc)[_0xc193('0x1f')]();});}};}function handleEntityNotFound(_0x41f321,_0x3584af){return function(_0x3d2ed8){if(!_0x3d2ed8){_0x41f321[_0xc193('0x1d')](0x194);}return _0x3d2ed8;};}function handleError(_0x522dca,_0x558d04){_0x558d04=_0x558d04||0x1f4;return function(_0x10edbf){logger[_0xc193('0x2c')](_0x10edbf[_0xc193('0x2d')]);if(_0x10edbf['name']){delete _0x10edbf[_0xc193('0x2e')];}_0x522dca[_0xc193('0x1e')](_0x558d04)['send'](_0x10edbf);};}exports[_0xc193('0x2f')]=function(_0x16457f,_0x2407c9){var _0x4069a={},_0x2e3dbb={},_0x24d4d2={'count':0x0,'rows':[]};var _0x3debe1=_[_0xc193('0x30')](db[_0xc193('0x31')][_0xc193('0x32')],function(_0x16dd5f){return{'name':_0x16dd5f[_0xc193('0x33')],'type':_0x16dd5f[_0xc193('0x34')][_0xc193('0x35')]};});_0x2e3dbb['model']=_[_0xc193('0x30')](_0x3debe1,_0xc193('0x2e'));_0x2e3dbb['query']=_[_0xc193('0x36')](_0x16457f[_0xc193('0x37')]);_0x2e3dbb['filters']=_[_0xc193('0x38')](_0x2e3dbb[_0xc193('0x39')],_0x2e3dbb[_0xc193('0x37')]);_0x4069a[_0xc193('0x3a')]=_[_0xc193('0x38')](_0x2e3dbb[_0xc193('0x39')],qs[_0xc193('0x3b')](_0x16457f[_0xc193('0x37')][_0xc193('0x3b')]));_0x4069a['attributes']=_0x4069a[_0xc193('0x3a')][_0xc193('0x3c')]?_0x4069a['attributes']:_0x2e3dbb[_0xc193('0x39')];if(!_0x16457f[_0xc193('0x37')][_0xc193('0x3d')](_0xc193('0x3e'))){_0x4069a[_0xc193('0x23')]=qs[_0xc193('0x23')](_0x16457f['query']['limit']);_0x4069a[_0xc193('0x21')]=qs['offset'](_0x16457f['query']['offset']);}_0x4069a[_0xc193('0x3f')]=qs[_0xc193('0x40')](_0x16457f[_0xc193('0x37')][_0xc193('0x40')]);_0x4069a[_0xc193('0x41')]=qs['filters'](_[_0xc193('0x42')](_0x16457f[_0xc193('0x37')],_0x2e3dbb['filters']),_0x3debe1);if(_0x16457f[_0xc193('0x37')][_0xc193('0x43')]){_0x4069a[_0xc193('0x41')]=_[_0xc193('0x44')](_0x4069a[_0xc193('0x41')],{'$or':_['map'](_0x3debe1,function(_0x50401b){if(_0x50401b['type']!==_0xc193('0x45')){var _0x85fea9={};_0x85fea9[_0x50401b[_0xc193('0x2e')]]={'$like':'%'+_0x16457f[_0xc193('0x37')][_0xc193('0x43')]+'%'};return _0x85fea9;}})});}_0x4069a=_['merge']({},_0x4069a,_0x16457f[_0xc193('0x46')]);var _0xcd64a4={'where':_0x4069a[_0xc193('0x41')]};return db['ChatInternalMessage'][_0xc193('0x24')](_0xcd64a4)['then'](function(_0x5f5a54){_0x24d4d2[_0xc193('0x24')]=_0x5f5a54;if(_0x16457f[_0xc193('0x37')][_0xc193('0x47')]){_0x4069a['include']=[{'all':!![]}];}return db[_0xc193('0x31')][_0xc193('0x48')](_0x4069a);})[_0xc193('0x2a')](function(_0x56e592){_0x24d4d2['rows']=_0x56e592;return _0x24d4d2;})[_0xc193('0x2a')](respondWithFilteredResult(_0x2407c9,_0x4069a))[_0xc193('0x49')](handleError(_0x2407c9,null));};exports[_0xc193('0x4a')]=function(_0x3f1a5e,_0x379ad9){var _0x12c489={'raw':!![],'where':{'id':_0x3f1a5e[_0xc193('0x4b')]['id']}},_0x1b1817={};_0x1b1817[_0xc193('0x39')]=_[_0xc193('0x36')](db[_0xc193('0x31')][_0xc193('0x32')]);_0x1b1817[_0xc193('0x37')]=_['keys'](_0x3f1a5e[_0xc193('0x37')]);_0x1b1817[_0xc193('0x4c')]=_['intersection'](_0x1b1817['model'],_0x1b1817[_0xc193('0x37')]);_0x12c489[_0xc193('0x3a')]=_[_0xc193('0x38')](_0x1b1817[_0xc193('0x39')],qs[_0xc193('0x3b')](_0x3f1a5e[_0xc193('0x37')]['fields']));_0x12c489['attributes']=_0x12c489[_0xc193('0x3a')]['length']?_0x12c489['attributes']:_0x1b1817['model'];if(_0x3f1a5e['query'][_0xc193('0x47')]){_0x12c489[_0xc193('0x4d')]=[{'all':!![]}];}_0x12c489=_[_0xc193('0x44')]({},_0x12c489,_0x3f1a5e[_0xc193('0x46')]);return db['ChatInternalMessage']['find'](_0x12c489)[_0xc193('0x2a')](handleEntityNotFound(_0x379ad9,null))['then'](respondWithResult(_0x379ad9,null))[_0xc193('0x49')](handleError(_0x379ad9,null));};exports[_0xc193('0x4e')]=function(_0x4977a7,_0x3dbde7){return db[_0xc193('0x31')]['create'](_0x4977a7['body'],{})['then'](respondWithResult(_0x3dbde7,0xc9))[_0xc193('0x49')](handleError(_0x3dbde7,null));};exports[_0xc193('0x29')]=function(_0x4d8514,_0x129168){if(_0x4d8514[_0xc193('0x4f')]['id']){delete _0x4d8514[_0xc193('0x4f')]['id'];}return db[_0xc193('0x31')][_0xc193('0x50')]({'where':{'id':_0x4d8514[_0xc193('0x4b')]['id']}})[_0xc193('0x2a')](handleEntityNotFound(_0x129168,null))[_0xc193('0x2a')](saveUpdates(_0x4d8514[_0xc193('0x4f')],null))[_0xc193('0x2a')](respondWithResult(_0x129168,null))[_0xc193('0x49')](handleError(_0x129168,null));};exports[_0xc193('0x2b')]=function(_0x54b1ff,_0x309eff){return db[_0xc193('0x31')][_0xc193('0x50')]({'where':{'id':_0x54b1ff[_0xc193('0x4b')]['id']}})[_0xc193('0x2a')](handleEntityNotFound(_0x309eff,null))[_0xc193('0x2a')](removeEntity(_0x309eff,null))[_0xc193('0x49')](handleError(_0x309eff,null));};exports[_0xc193('0x51')]=function(_0x4d4235,_0x3575c3){return db[_0xc193('0x31')][_0xc193('0x51')]()[_0xc193('0x2a')](respondWithResult(_0x3575c3,null))[_0xc193('0x49')](handleError(_0x3575c3,null));};function wrapUser(_0x57d509){return function(_0xf31445){var _0x21e39d=_0x57d509[_0xc193('0x52')]({'plain':!![]});_0x21e39d[_0xc193('0x53')]=[];if(_0xf31445){_0x21e39d[_0xc193('0x54')]=_0xf31445[_0xc193('0x55')];_0x21e39d[_0xc193('0x56')]=_0xf31445;}else{_0x21e39d[_0xc193('0x54')]=moment(0x0)['format'](_0xc193('0x57'));_0x21e39d[_0xc193('0x56')]={};}return _0x21e39d;};}exports[_0xc193('0x58')]=function(_0x524ed4,_0x3b9720,_0x120f99){var _0x59f9d8=[];return db[_0xc193('0x59')]['findAll']({'where':{'role':[_0xc193('0x5a'),_0xc193('0x5b'),_0xc193('0x5c')]},'attributes':['id',_0xc193('0x5d'),_0xc193('0x2e'),_0xc193('0x5e'),_0xc193('0x5f'),'internal','online',_0xc193('0x60'),_0xc193('0x61'),_0xc193('0x62')],'order':qs[_0xc193('0x40')](_0xc193('0x63')),'include':[{'model':db[_0xc193('0x64')],'as':_0xc193('0x65'),'attributes':['id',_0xc193('0x2e'),_0xc193('0x34')],'through':{'attributes':[]}}]})[_0xc193('0x2a')](function(_0x51a661){if(_0x51a661){var _0x19448b=_0x524ed4[_0xc193('0x5c')]['get']({'plain':!![]});if(!_0x19448b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19448b[_0xc193('0x5e')]===_0xc193('0x5c')){return db['UserProfileSection'][_0xc193('0x50')]({'where':{'name':_0xc193('0x66'),'userProfileId':_0x19448b['userProfileId']},'raw':!![]})['then'](function(_0x338cd7){if(_0x338cd7){if(_0x338cd7['autoAssociation']===0x0){return db[_0xc193('0x67')][_0xc193('0x48')]({'where':{'sectionId':_0x338cd7['id']},'raw':!![]})['then'](function(_0xba5505){var _0x19e2fb=[];if(_['isEmpty'](_0xba5505)){_0x19e2fb=_[_0xc193('0x43')](_0x51a661,function(_0x54120a){if(_0x54120a[_0xc193('0x5e')]!==_0xc193('0x5a')){return _0x54120a;}});return _0x19e2fb;}else{for(var _0x1781fa=0x0;_0x1781fa<_0x51a661[_0xc193('0x3c')];_0x1781fa++){var _0xafea8=_0x51a661[_0x1781fa];if(_0xafea8[_0xc193('0x5e')]===_0xc193('0x5a')){var _0x490561=_['find'](_0xba5505,function(_0x3c56de){return _0x3c56de[_0xc193('0x68')]===_0xafea8['id'];});if(_0x490561)_0x19e2fb['push'](_0xafea8);}else{_0x19e2fb[_0xc193('0x69')](_0xafea8);}}return _0x19e2fb;}});}else{return _0x51a661;}}else{var _0x36b717=_['filter'](_0x51a661,function(_0x168fe0){if(_0x168fe0[_0xc193('0x5e')]!=='agent'){return _0x168fe0;}});return _0x36b717;}});}else{return _0x51a661;}}})[_0xc193('0x2a')](function(_0x3c886b){var _0xd6bcb6=[];if(_0x3c886b){_0x59f9d8=_0x3c886b;for(var _0x6d83aa=0x0;_0x6d83aa<_0x3c886b[_0xc193('0x3c')];_0x6d83aa+=0x1){_0x59f9d8[_0x6d83aa][_0xc193('0x53')]=[];_0xd6bcb6['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x524ed4[_0xc193('0x5c')]['id'],_0x3c886b[_0x6d83aa]['id']],'ToId':[_0x524ed4[_0xc193('0x5c')]['id'],_0x3c886b[_0x6d83aa]['id']],'ChatGroupId':null},'attributes':['id',_0xc193('0x55'),_0xc193('0x6a'),_0xc193('0x6b'),'read',_0xc193('0x4f')],'order':qs[_0xc193('0x40')](_0xc193('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3c886b[_0x6d83aa])));}return BPromise[_0xc193('0x6d')](_0xd6bcb6);}return[];})['then'](function(_0x5d61f5){return{'rows':_0x5d61f5,'count':_0x5d61f5[_0xc193('0x3c')]};})['then'](respondWithResult(_0x3b9720,null))['catch'](handleError(_0x3b9720,null));};
\ No newline at end of file
+var _0x66bf=['count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','ChatInternalMessage','rows','catch','rawAttributes','find','create','body','params','describe','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','type','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','length','resourceId','push','messages','FromId','ToId','-createdAt','all','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit'];(function(_0x4c6c66,_0x7764f5){var _0x1c7e6b=function(_0x4a60cc){while(--_0x4a60cc){_0x4c6c66['push'](_0x4c6c66['shift']());}};_0x1c7e6b(++_0x7764f5);}(_0x66bf,0x121));var _0xf66b=function(_0x5e6901,_0x5b28e6){_0x5e6901=_0x5e6901-0x0;var _0x46a109=_0x66bf[_0x5e6901];return _0x46a109;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf66b('0x0'));var zipdir=require(_0xf66b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf66b('0x2'));var BPromise=require(_0xf66b('0x3'));var Mustache=require('mustache');var util=require(_0xf66b('0x4'));var path=require(_0xf66b('0x5'));var sox=require(_0xf66b('0x6'));var csv=require('to-csv');var ejs=require(_0xf66b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf66b('0x8'));var squel=require(_0xf66b('0x9'));var crypto=require(_0xf66b('0xa'));var jsforce=require(_0xf66b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf66b('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf66b('0xd'));var as=require(_0xf66b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf66b('0xf'));var utils=require(_0xf66b('0x10'));var config=require(_0xf66b('0x11'));var licenseUtil=require(_0xf66b('0x12'));var db=require(_0xf66b('0x13'))['db'];config[_0xf66b('0x14')]=_[_0xf66b('0x15')](config['redis'],{'host':_0xf66b('0x16'),'port':0x18eb});var socket=require(_0xf66b('0x17'))(new Redis(config[_0xf66b('0x14')]));require(_0xf66b('0x18'))[_0xf66b('0x19')](socket);function respondWithStatusCode(_0x5dafd7,_0x49b3c2){_0x49b3c2=_0x49b3c2||0xcc;return function(_0x5b4689){if(_0x5b4689){return _0x5dafd7[_0xf66b('0x1a')](_0x49b3c2);}return _0x5dafd7[_0xf66b('0x1b')](_0x49b3c2)['end']();};}function respondWithResult(_0x12b4bc,_0x2f21ce){_0x2f21ce=_0x2f21ce||0xc8;return function(_0x5e9a99){if(_0x5e9a99){return _0x12b4bc[_0xf66b('0x1b')](_0x2f21ce)[_0xf66b('0x1c')](_0x5e9a99);}};}function respondWithFilteredResult(_0x148cb2,_0x2099a2){return function(_0x24be14){if(_0x24be14){var _0x48623b=typeof _0x2099a2[_0xf66b('0x1d')]===_0xf66b('0x1e')&&typeof _0x2099a2[_0xf66b('0x1f')]===_0xf66b('0x1e');var _0x2d2b64=_0x24be14[_0xf66b('0x20')];var _0x51d078=_0x48623b?0x0:_0x2099a2['offset'];var _0x5869dd=_0x48623b?_0x24be14[_0xf66b('0x20')]:_0x2099a2[_0xf66b('0x1d')]+_0x2099a2['limit'];var _0x344f4e;if(_0x5869dd>=_0x2d2b64){_0x5869dd=_0x2d2b64;_0x344f4e=0xc8;}else{_0x344f4e=0xce;}_0x148cb2['status'](_0x344f4e);return _0x148cb2[_0xf66b('0x21')](_0xf66b('0x22'),_0x51d078+'-'+_0x5869dd+'/'+_0x2d2b64)['json'](_0x24be14);}return null;};}function patchUpdates(_0x3243c6){return function(_0x190616){try{jsonpatch[_0xf66b('0x23')](_0x190616,_0x3243c6,!![]);}catch(_0x700063){return BPromise[_0xf66b('0x24')](_0x700063);}return _0x190616[_0xf66b('0x25')]();};}function saveUpdates(_0x1a27c4,_0x15dcd1){return function(_0x205368){if(_0x205368){return _0x205368['update'](_0x1a27c4)['then'](function(_0x13e0f1){return _0x13e0f1;});}return null;};}function removeEntity(_0x2f816d,_0x38d3ee){return function(_0x4936a6){if(_0x4936a6){return _0x4936a6[_0xf66b('0x26')]()[_0xf66b('0x27')](function(){_0x2f816d[_0xf66b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b2c7,_0x5834c1){return function(_0x380255){if(!_0x380255){_0x54b2c7['sendStatus'](0x194);}return _0x380255;};}function handleError(_0xf813c0,_0xb25798){_0xb25798=_0xb25798||0x1f4;return function(_0x19584a){logger[_0xf66b('0x28')](_0x19584a[_0xf66b('0x29')]);if(_0x19584a[_0xf66b('0x2a')]){delete _0x19584a[_0xf66b('0x2a')];}_0xf813c0['status'](_0xb25798)[_0xf66b('0x2b')](_0x19584a);};}exports[_0xf66b('0x2c')]=function(_0x157363,_0x4affe6){var _0x3aeb57={},_0x456c1a={},_0x3dfb7a={'count':0x0,'rows':[]};var _0xf92eee=_[_0xf66b('0x2d')](db['ChatInternalMessage']['rawAttributes'],function(_0x5c7517){return{'name':_0x5c7517[_0xf66b('0x2e')],'type':_0x5c7517['type'][_0xf66b('0x2f')]};});_0x456c1a[_0xf66b('0x30')]=_['map'](_0xf92eee,_0xf66b('0x2a'));_0x456c1a[_0xf66b('0x31')]=_[_0xf66b('0x32')](_0x157363[_0xf66b('0x31')]);_0x456c1a[_0xf66b('0x33')]=_[_0xf66b('0x34')](_0x456c1a[_0xf66b('0x30')],_0x456c1a[_0xf66b('0x31')]);_0x3aeb57[_0xf66b('0x35')]=_[_0xf66b('0x34')](_0x456c1a['model'],qs[_0xf66b('0x36')](_0x157363['query'][_0xf66b('0x36')]));_0x3aeb57[_0xf66b('0x35')]=_0x3aeb57['attributes']['length']?_0x3aeb57[_0xf66b('0x35')]:_0x456c1a[_0xf66b('0x30')];if(!_0x157363[_0xf66b('0x31')][_0xf66b('0x37')](_0xf66b('0x38'))){_0x3aeb57[_0xf66b('0x1f')]=qs[_0xf66b('0x1f')](_0x157363[_0xf66b('0x31')][_0xf66b('0x1f')]);_0x3aeb57[_0xf66b('0x1d')]=qs['offset'](_0x157363[_0xf66b('0x31')]['offset']);}_0x3aeb57['order']=qs['sort'](_0x157363[_0xf66b('0x31')][_0xf66b('0x39')]);_0x3aeb57[_0xf66b('0x3a')]=qs[_0xf66b('0x33')](_['pick'](_0x157363['query'],_0x456c1a[_0xf66b('0x33')]),_0xf92eee);if(_0x157363[_0xf66b('0x31')]['filter']){_0x3aeb57[_0xf66b('0x3a')]=_[_0xf66b('0x3b')](_0x3aeb57[_0xf66b('0x3a')],{'$or':_['map'](_0xf92eee,function(_0x4b39a3){if(_0x4b39a3['type']!=='VIRTUAL'){var _0x2cefb8={};_0x2cefb8[_0x4b39a3[_0xf66b('0x2a')]]={'$like':'%'+_0x157363[_0xf66b('0x31')][_0xf66b('0x3c')]+'%'};return _0x2cefb8;}})});}_0x3aeb57=_[_0xf66b('0x3b')]({},_0x3aeb57,_0x157363[_0xf66b('0x3d')]);var _0x1b57e6={'where':_0x3aeb57['where']};return db['ChatInternalMessage'][_0xf66b('0x20')](_0x1b57e6)[_0xf66b('0x27')](function(_0x3a5530){_0x3dfb7a[_0xf66b('0x20')]=_0x3a5530;if(_0x157363['query'][_0xf66b('0x3e')]){_0x3aeb57[_0xf66b('0x3f')]=[{'all':!![]}];}return db[_0xf66b('0x40')]['findAll'](_0x3aeb57);})[_0xf66b('0x27')](function(_0x1ee692){_0x3dfb7a[_0xf66b('0x41')]=_0x1ee692;return _0x3dfb7a;})[_0xf66b('0x27')](respondWithFilteredResult(_0x4affe6,_0x3aeb57))[_0xf66b('0x42')](handleError(_0x4affe6,null));};exports['show']=function(_0x20194f,_0x52f4bf){var _0x1f0d9a={'raw':!![],'where':{'id':_0x20194f['params']['id']}},_0x295bc1={};_0x295bc1[_0xf66b('0x30')]=_[_0xf66b('0x32')](db[_0xf66b('0x40')][_0xf66b('0x43')]);_0x295bc1[_0xf66b('0x31')]=_[_0xf66b('0x32')](_0x20194f[_0xf66b('0x31')]);_0x295bc1[_0xf66b('0x33')]=_['intersection'](_0x295bc1['model'],_0x295bc1[_0xf66b('0x31')]);_0x1f0d9a[_0xf66b('0x35')]=_[_0xf66b('0x34')](_0x295bc1['model'],qs['fields'](_0x20194f['query']['fields']));_0x1f0d9a[_0xf66b('0x35')]=_0x1f0d9a[_0xf66b('0x35')]['length']?_0x1f0d9a[_0xf66b('0x35')]:_0x295bc1[_0xf66b('0x30')];if(_0x20194f[_0xf66b('0x31')][_0xf66b('0x3e')]){_0x1f0d9a['include']=[{'all':!![]}];}_0x1f0d9a=_[_0xf66b('0x3b')]({},_0x1f0d9a,_0x20194f['options']);return db[_0xf66b('0x40')][_0xf66b('0x44')](_0x1f0d9a)[_0xf66b('0x27')](handleEntityNotFound(_0x52f4bf,null))[_0xf66b('0x27')](respondWithResult(_0x52f4bf,null))['catch'](handleError(_0x52f4bf,null));};exports['create']=function(_0x474efc,_0x48d9f5){return db['ChatInternalMessage'][_0xf66b('0x45')](_0x474efc[_0xf66b('0x46')],{})['then'](respondWithResult(_0x48d9f5,0xc9))[_0xf66b('0x42')](handleError(_0x48d9f5,null));};exports['update']=function(_0x5d504a,_0x595c7c){if(_0x5d504a[_0xf66b('0x46')]['id']){delete _0x5d504a[_0xf66b('0x46')]['id'];}return db[_0xf66b('0x40')][_0xf66b('0x44')]({'where':{'id':_0x5d504a['params']['id']}})[_0xf66b('0x27')](handleEntityNotFound(_0x595c7c,null))[_0xf66b('0x27')](saveUpdates(_0x5d504a[_0xf66b('0x46')],null))[_0xf66b('0x27')](respondWithResult(_0x595c7c,null))['catch'](handleError(_0x595c7c,null));};exports['destroy']=function(_0x175829,_0x685f88){return db[_0xf66b('0x40')]['find']({'where':{'id':_0x175829[_0xf66b('0x47')]['id']}})[_0xf66b('0x27')](handleEntityNotFound(_0x685f88,null))[_0xf66b('0x27')](removeEntity(_0x685f88,null))[_0xf66b('0x42')](handleError(_0x685f88,null));};exports[_0xf66b('0x48')]=function(_0xff9a4f,_0x1540f1){return db[_0xf66b('0x40')][_0xf66b('0x48')]()['then'](respondWithResult(_0x1540f1,null))[_0xf66b('0x42')](handleError(_0x1540f1,null));};function wrapUser(_0x278d5c){return function(_0x2b1da3){var _0x20cf34=_0x278d5c['get']({'plain':!![]});_0x20cf34['messages']=[];if(_0x2b1da3){_0x20cf34[_0xf66b('0x49')]=_0x2b1da3[_0xf66b('0x4a')];_0x20cf34[_0xf66b('0x4b')]=_0x2b1da3;}else{_0x20cf34[_0xf66b('0x49')]=moment(0x0)[_0xf66b('0x4c')](_0xf66b('0x4d'));_0x20cf34[_0xf66b('0x4b')]={};}return _0x20cf34;};}exports[_0xf66b('0x4e')]=function(_0x3965f5,_0xd6f009,_0x431570){var _0x41006d=[];return db[_0xf66b('0x4f')]['findAll']({'where':{'role':[_0xf66b('0x50'),_0xf66b('0x51'),_0xf66b('0x52')]},'attributes':['id',_0xf66b('0x53'),_0xf66b('0x2a'),_0xf66b('0x54'),_0xf66b('0x55'),_0xf66b('0x56'),_0xf66b('0x57'),_0xf66b('0x58'),_0xf66b('0x59'),'showWebBar'],'order':qs[_0xf66b('0x39')](_0xf66b('0x5a')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xf66b('0x2a'),_0xf66b('0x5b')],'through':{'attributes':[]}}]})[_0xf66b('0x27')](function(_0x5b1758){if(_0x5b1758){var _0x550219=_0x3965f5[_0xf66b('0x52')][_0xf66b('0x5c')]({'plain':!![]});if(!_0x550219)throw new Error(_0xf66b('0x5d'));if(_0x550219['role']===_0xf66b('0x52')){return db[_0xf66b('0x5e')][_0xf66b('0x44')]({'where':{'name':_0xf66b('0x5f'),'userProfileId':_0x550219[_0xf66b('0x60')]},'raw':!![]})[_0xf66b('0x27')](function(_0x445b40){if(_0x445b40){if(_0x445b40['autoAssociation']===0x0){return db[_0xf66b('0x61')]['findAll']({'where':{'sectionId':_0x445b40['id']},'raw':!![]})[_0xf66b('0x27')](function(_0x5894c5){var _0x538aa9=[];if(_[_0xf66b('0x62')](_0x5894c5)){_0x538aa9=_[_0xf66b('0x3c')](_0x5b1758,function(_0x4a20c5){if(_0x4a20c5['role']!==_0xf66b('0x50')){return _0x4a20c5;}});return _0x538aa9;}else{for(var _0x37a78c=0x0;_0x37a78c<_0x5b1758[_0xf66b('0x63')];_0x37a78c++){var _0x535977=_0x5b1758[_0x37a78c];if(_0x535977['role']===_0xf66b('0x50')){var _0x46ccf4=_[_0xf66b('0x44')](_0x5894c5,function(_0x2dbed1){return _0x2dbed1[_0xf66b('0x64')]===_0x535977['id'];});if(_0x46ccf4)_0x538aa9[_0xf66b('0x65')](_0x535977);}else{_0x538aa9[_0xf66b('0x65')](_0x535977);}}return _0x538aa9;}});}else{return _0x5b1758;}}else{var _0x3ce6ff=_[_0xf66b('0x3c')](_0x5b1758,function(_0x1c7c15){if(_0x1c7c15[_0xf66b('0x54')]!=='agent'){return _0x1c7c15;}});return _0x3ce6ff;}});}else{return _0x5b1758;}}})[_0xf66b('0x27')](function(_0x290e1e){var _0x34dd62=[];if(_0x290e1e){_0x41006d=_0x290e1e;for(var _0x4c1107=0x0;_0x4c1107<_0x290e1e[_0xf66b('0x63')];_0x4c1107+=0x1){_0x41006d[_0x4c1107][_0xf66b('0x66')]=[];_0x34dd62[_0xf66b('0x65')](db['ChatInternalMessage'][_0xf66b('0x44')]({'where':{'FromId':[_0x3965f5[_0xf66b('0x52')]['id'],_0x290e1e[_0x4c1107]['id']],'ToId':[_0x3965f5[_0xf66b('0x52')]['id'],_0x290e1e[_0x4c1107]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xf66b('0x67'),_0xf66b('0x68'),'read',_0xf66b('0x46')],'order':qs[_0xf66b('0x39')](_0xf66b('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf66b('0x27')](wrapUser(_0x290e1e[_0x4c1107])));}return BPromise[_0xf66b('0x6a')](_0x34dd62);}return[];})[_0xf66b('0x27')](function(_0x542ec6){return{'rows':_0x542ec6,'count':_0x542ec6[_0xf66b('0x63')]};})[_0xf66b('0x27')](respondWithResult(_0xd6f009,null))[_0xf66b('0x42')](handleError(_0xd6f009,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index fd12ef8..91061cd 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 _0x894b=['../../mysqldb','ChatInternalMessage','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x894b,0x104));var _0xb894=function(_0x3808b5,_0x5907a0){_0x3808b5=_0x3808b5-0x0;var _0x352c3d=_0x894b[_0x3808b5];return _0x352c3d;};'use strict';var EventEmitter=require(_0xb894('0x0'));var ChatInternalMessage=require(_0xb894('0x1'))['db'][_0xb894('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb894('0x3'),'afterUpdate':'update','afterDestroy':_0xb894('0x4')};function emitEvent(_0x395c60){return function(_0x17bb70,_0x4c9aee,_0x209205){ChatInternalMessageEvents[_0xb894('0x5')](_0x395c60+':'+_0x17bb70['id'],_0x17bb70);ChatInternalMessageEvents['emit'](_0x395c60,_0x17bb70);_0x209205(null);};}for(var e in events){if(events[_0xb894('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb894('0x7')](e,emitEvent(event));}}module[_0xb894('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xa82c=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0xa82c,0x16b));var _0xca82=function(_0x3741f0,_0x5c8d89){_0x3741f0=_0x3741f0-0x0;var _0x591247=_0xa82c[_0x3741f0];return _0x591247;};'use strict';var EventEmitter=require(_0xca82('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xca82('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xca82('0x2')](0x0);var events={'afterCreate':_0xca82('0x3'),'afterUpdate':'update','afterDestroy':_0xca82('0x4')};function emitEvent(_0x455d33){return function(_0x4ef537,_0x3bdd67,_0x54a25f){ChatInternalMessageEvents['emit'](_0x455d33+':'+_0x4ef537['id'],_0x4ef537);ChatInternalMessageEvents[_0xca82('0x5')](_0x455d33,_0x4ef537);_0x54a25f(null);};}for(var e in events){if(events[_0xca82('0x6')](e)){var event=events[e];ChatInternalMessage[_0xca82('0x7')](e,emitEvent(event));}}module[_0xca82('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1aadacf..1fbd7f7 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 _0x16a8=['exports','define','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x2aeb4b,_0x29d79d){var _0x16138d=function(_0xab860f){while(--_0xab860f){_0x2aeb4b['push'](_0x2aeb4b['shift']());}};_0x16138d(++_0x29d79d);}(_0x16a8,0x9e));var _0x816a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x16a8[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x816a('0x0'));var util=require(_0x816a('0x1'));var logger=require(_0x816a('0x2'))(_0x816a('0x3'));var moment=require('moment');var BPromise=require(_0x816a('0x4'));var rp=require(_0x816a('0x5'));var fs=require('fs');var path=require(_0x816a('0x6'));var rimraf=require(_0x816a('0x7'));var config=require(_0x816a('0x8'));var attributes=require(_0x816a('0x9'));module[_0x816a('0xa')]=function(_0x41f489,_0x57e3e7){return _0x41f489[_0x816a('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x816a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x816a('0xd')});};
\ No newline at end of file
+var _0x47c5=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x44abe7,_0x14879e){var _0x13b01a=function(_0x10b615){while(--_0x10b615){_0x44abe7['push'](_0x44abe7['shift']());}};_0x13b01a(++_0x14879e);}(_0x47c5,0xf5));var _0x547c=function(_0x13ee11,_0x129ca5){_0x13ee11=_0x13ee11-0x0;var _0xfe3915=_0x47c5[_0x13ee11];return _0xfe3915;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x547c('0x0'))(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x547c('0x5'));var config=require(_0x547c('0x6'));var attributes=require(_0x547c('0x7'));module[_0x547c('0x8')]=function(_0x174bf6,_0x75d2ff){return _0x174bf6[_0x547c('0x9')](_0x547c('0xa'),attributes,{'tableName':_0x547c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x547c('0xc'),'collate':_0x547c('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3c08ff1..741f60e 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 _0x0baf=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x136cf2,_0xef8751){var _0x33f719=function(_0x5ac1af){while(--_0x5ac1af){_0x136cf2['push'](_0x136cf2['shift']());}};_0x33f719(++_0xef8751);}(_0x0baf,0x73));var _0xf0ba=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x0baf[_0x5e709a];return _0x57401a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0ba('0x0'));var BPromise=require('bluebird');var rs=require(_0xf0ba('0x1'));var fs=require('fs');var Redis=require(_0xf0ba('0x2'));var db=require(_0xf0ba('0x3'))['db'];var utils=require(_0xf0ba('0x4'));var logger=require('../../config/logger')(_0xf0ba('0x5'));var config=require(_0xf0ba('0x6'));var jayson=require(_0xf0ba('0x7'));var client=jayson[_0xf0ba('0x8')]['http']({'port':0x232a});config['redis']=_[_0xf0ba('0x9')](config[_0xf0ba('0xa')],{'host':_0xf0ba('0xb'),'port':0x18eb});var socket=require(_0xf0ba('0xc'))(new Redis(config[_0xf0ba('0xa')]));require(_0xf0ba('0xd'))[_0xf0ba('0xe')](socket);function respondWithRpcPromise(_0x49fd08,_0x530204,_0x20dfa0){return new BPromise(function(_0x390740,_0x6a930b){return client[_0xf0ba('0xf')](_0x49fd08,_0x20dfa0)[_0xf0ba('0x10')](function(_0x4e5658){logger[_0xf0ba('0x11')](_0xf0ba('0x12'),_0x530204,_0xf0ba('0x13'));logger['debug'](_0xf0ba('0x14'),_0x530204,_0xf0ba('0x13'),JSON['stringify'](_0x4e5658));if(_0x4e5658[_0xf0ba('0x15')]){if(_0x4e5658['error']['code']===0x1f4){logger[_0xf0ba('0x15')](_0xf0ba('0x12'),_0x530204,_0x4e5658[_0xf0ba('0x15')][_0xf0ba('0x16')]);return _0x6a930b(_0x4e5658[_0xf0ba('0x15')][_0xf0ba('0x16')]);}logger[_0xf0ba('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x530204,_0x4e5658['error']['message']);return _0x390740(_0x4e5658['error'][_0xf0ba('0x16')]);}else{logger[_0xf0ba('0x11')](_0xf0ba('0x12'),_0x530204,'request\x20sent');_0x390740(_0x4e5658['result'][_0xf0ba('0x16')]);}})[_0xf0ba('0x17')](function(_0x394cd0){logger['error'](_0xf0ba('0x12'),_0x530204,_0x394cd0);_0x6a930b(_0x394cd0);});});}
\ No newline at end of file
+var _0x7610=['code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x312cdc,_0x5468d2){var _0x908678=function(_0x51c699){while(--_0x51c699){_0x312cdc['push'](_0x312cdc['shift']());}};_0x908678(++_0x5468d2);}(_0x7610,0x123));var _0x0761=function(_0x16adb1,_0x12ab49){_0x16adb1=_0x16adb1-0x0;var _0x4e6dec=_0x7610[_0x16adb1];return _0x4e6dec;};'use strict';var _=require(_0x0761('0x0'));var util=require(_0x0761('0x1'));var moment=require(_0x0761('0x2'));var BPromise=require(_0x0761('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0761('0x4'))['db'];var utils=require(_0x0761('0x5'));var logger=require('../../config/logger')(_0x0761('0x6'));var config=require(_0x0761('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0761('0x8')]['http']({'port':0x232a});config[_0x0761('0x9')]=_[_0x0761('0xa')](config['redis'],{'host':_0x0761('0xb'),'port':0x18eb});var socket=require(_0x0761('0xc'))(new Redis(config[_0x0761('0x9')]));require('./chatInternalMessage.socket')[_0x0761('0xd')](socket);function respondWithRpcPromise(_0x527e5e,_0x51ea13,_0x19b98c){return new BPromise(function(_0x14f021,_0x4fd8ed){return client[_0x0761('0xe')](_0x527e5e,_0x19b98c)['then'](function(_0x2b2d34){logger[_0x0761('0xf')](_0x0761('0x10'),_0x51ea13,_0x0761('0x11'));logger['debug'](_0x0761('0x12'),_0x51ea13,'request\x20sent',JSON[_0x0761('0x13')](_0x2b2d34));if(_0x2b2d34[_0x0761('0x14')]){if(_0x2b2d34[_0x0761('0x14')][_0x0761('0x15')]===0x1f4){logger[_0x0761('0x14')](_0x0761('0x10'),_0x51ea13,_0x2b2d34['error']['message']);return _0x4fd8ed(_0x2b2d34[_0x0761('0x14')][_0x0761('0x16')]);}logger['error'](_0x0761('0x10'),_0x51ea13,_0x2b2d34[_0x0761('0x14')][_0x0761('0x16')]);return _0x14f021(_0x2b2d34[_0x0761('0x14')][_0x0761('0x16')]);}else{logger[_0x0761('0xf')](_0x0761('0x10'),_0x51ea13,_0x0761('0x11'));_0x14f021(_0x2b2d34[_0x0761('0x17')]['message']);}})['catch'](function(_0x1273b5){logger[_0x0761('0x14')](_0x0761('0x10'),_0x51ea13,_0x1273b5);_0x4fd8ed(_0x1273b5);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4398aba..85d42a3 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 _0xa5e1=['./chatInternalMessage.events','save','remove','update','emit'];(function(_0x510e73,_0x44b617){var _0x54a077=function(_0x467b7c){while(--_0x467b7c){_0x510e73['push'](_0x510e73['shift']());}};_0x54a077(++_0x44b617);}(_0xa5e1,0xb4));var _0x1a5e=function(_0x2e0763,_0x37e6e4){_0x2e0763=_0x2e0763-0x0;var _0x189643=_0xa5e1[_0x2e0763];return _0x189643;};'use strict';var ChatInternalMessageEvents=require(_0x1a5e('0x0'));var events=[_0x1a5e('0x1'),_0x1a5e('0x2'),_0x1a5e('0x3')];function createListener(_0x1b783f,_0x4eca4f){return function(_0x27ede1){_0x4eca4f[_0x1a5e('0x4')](_0x1b783f,_0x27ede1);};}function removeListener(_0xab19e8,_0x5ed082){return function(){ChatInternalMessageEvents['removeListener'](_0xab19e8,_0x5ed082);};}exports['register']=function(_0x2aa967){for(var _0x84270e=0x0,_0x33beaa=events['length'];_0x84270e<_0x33beaa;_0x84270e++){var _0x2b3a24=events[_0x84270e];var _0x3d78b0=createListener('chatInternalMessage:'+_0x2b3a24,_0x2aa967);ChatInternalMessageEvents['on'](_0x2b3a24,_0x3d78b0);}};
\ No newline at end of file
+var _0xc8df=['register','length','save','remove','update','emit'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0xc8df,0xb0));var _0xfc8d=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xc8df[_0x45783c];return _0x1161da;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xfc8d('0x0'),_0xfc8d('0x1'),_0xfc8d('0x2')];function createListener(_0x3f4159,_0x9df48d){return function(_0x536825){_0x9df48d[_0xfc8d('0x3')](_0x3f4159,_0x536825);};}function removeListener(_0x2f88d0,_0x2b6909){return function(){ChatInternalMessageEvents['removeListener'](_0x2f88d0,_0x2b6909);};}exports[_0xfc8d('0x4')]=function(_0x5b785d){for(var _0x3fada6=0x0,_0x20157c=events[_0xfc8d('0x5')];_0x3fada6<_0x20157c;_0x3fada6++){var _0x4b0c02=events[_0x3fada6];var _0x1514bc=createListener('chatInternalMessage:'+_0x4b0c02,_0x5b785d);ChatInternalMessageEvents['on'](_0x4b0c02,_0x1514bc);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 5117ff7..7f084a1 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 _0x392e=['update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put'];(function(_0x28aa42,_0x1db5dc){var _0x1a540b=function(_0x2a0c48){while(--_0x2a0c48){_0x28aa42['push'](_0x28aa42['shift']());}};_0x1a540b(++_0x1db5dc);}(_0x392e,0xeb));var _0xe392=function(_0x53659d,_0x2ff6a5){_0x53659d=_0x53659d-0x0;var _0x2d9165=_0x392e[_0x53659d];return _0x2d9165;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe392('0x0'));var express=require(_0xe392('0x1'));var router=express[_0xe392('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe392('0x3'));var interaction=require(_0xe392('0x4'));var config=require('../../config/environment');var controller=require(_0xe392('0x5'));router[_0xe392('0x6')]('/',auth[_0xe392('0x7')](),controller[_0xe392('0x8')]);router[_0xe392('0x6')](_0xe392('0x9'),auth[_0xe392('0x7')](),controller[_0xe392('0xa')]);router['get']('/users',auth[_0xe392('0x7')](),controller[_0xe392('0xb')]);router[_0xe392('0x6')](_0xe392('0xc'),auth[_0xe392('0x7')](),controller[_0xe392('0xd')]);router[_0xe392('0xe')]('/',auth[_0xe392('0x7')](),controller[_0xe392('0xf')]);router[_0xe392('0x10')](_0xe392('0xc'),controller[_0xe392('0x11')]);router[_0xe392('0x12')](_0xe392('0xc'),auth[_0xe392('0x7')](),controller[_0xe392('0x13')]);module[_0xe392('0x14')]=router;
\ No newline at end of file
+var _0x7efa=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','create','delete','util'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7efa,0x103));var _0xa7ef=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7efa[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require('multer');var util=require(_0xa7ef('0x0'));var path=require(_0xa7ef('0x1'));var timeout=require(_0xa7ef('0x2'));var express=require(_0xa7ef('0x3'));var router=express[_0xa7ef('0x4')]();var fs_extra=require(_0xa7ef('0x5'));var auth=require(_0xa7ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7ef('0x7'));var controller=require(_0xa7ef('0x8'));router[_0xa7ef('0x9')]('/',auth[_0xa7ef('0xa')](),controller[_0xa7ef('0xb')]);router[_0xa7ef('0x9')]('/describe',auth[_0xa7ef('0xa')](),controller[_0xa7ef('0xc')]);router['get'](_0xa7ef('0xd'),auth[_0xa7ef('0xa')](),controller[_0xa7ef('0xe')]);router[_0xa7ef('0x9')](_0xa7ef('0xf'),auth[_0xa7ef('0xa')](),controller[_0xa7ef('0x10')]);router[_0xa7ef('0x11')]('/',auth['isAuthenticated'](),controller[_0xa7ef('0x12')]);router['put'](_0xa7ef('0xf'),controller['update']);router[_0xa7ef('0x13')]('/:id',auth[_0xa7ef('0xa')](),controller['destroy']);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 c3e309d..1e138f4 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 _0x8eba=['exports','BOOLEAN','ENUM','out','STRING','TEXT','sequelize'];(function(_0x7fbe13,_0x444d90){var _0x1d6cf1=function(_0x1f32ec){while(--_0x1f32ec){_0x7fbe13['push'](_0x7fbe13['shift']());}};_0x1d6cf1(++_0x444d90);}(_0x8eba,0xc3));var _0xa8eb=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x8eba[_0x323d87];return _0x5e8f74;};'use strict';var Sequelize=require(_0xa8eb('0x0'));module[_0xa8eb('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa8eb('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa8eb('0x3')]('in',_0xa8eb('0x4')),'defaultValue':_0xa8eb('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa8eb('0x5')]},'providerResponse':{'type':Sequelize[_0xa8eb('0x6')]}};
\ No newline at end of file
+var _0xb91a=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xb91a,0xe5));var _0xab91=function(_0x182c7c,_0x355a06){_0x182c7c=_0x182c7c-0x0;var _0x3ad022=_0xb91a[_0x182c7c];return _0x3ad022;};'use strict';var Sequelize=require('sequelize');module[_0xab91('0x0')]={'body':{'type':Sequelize[_0xab91('0x1')](_0xab91('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xab91('0x4')]('in',_0xab91('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xab91('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6f57f0a..f7e432d 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 _0xe956=['redis','localhost','socket.io-emitter','jayson/promise','client','http','../../config/logger','chat-interactions','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','limit','count','offset','set','Content-Range','json','then','destroy','end','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','fields','include','create','body','update','find','describe','accept','chat','acceptMessage','reject','UserId','user','agent','get','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','format','SIP/%s','channel','motionChannel','event','EventManager','rejectmessage','parse','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0xe956,0xc4));var _0x6e95=function(_0x20ea6d,_0x154e66){_0x20ea6d=_0x20ea6d-0x0;var _0xe492ba=_0xe956[_0x20ea6d];return _0xe492ba;};'use strict';var util=require(_0x6e95('0x0'));var _=require(_0x6e95('0x1'));var Redis=require(_0x6e95('0x2'));var interactionService=require(_0x6e95('0x3'));var qs=require(_0x6e95('0x4'));var logger=require('../../config/logger')(_0x6e95('0x5'));var config=require(_0x6e95('0x6'));var db=require(_0x6e95('0x7'))['db'];config[_0x6e95('0x8')]=_['defaults'](config['redis'],{'host':_0x6e95('0x9'),'port':0x18eb});var socket=require(_0x6e95('0xa'))(new Redis(config[_0x6e95('0x8')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x6e95('0xb'));var client=jayson[_0x6e95('0xc')][_0x6e95('0xd')]({'port':0x232c});var client9002=jayson['client'][_0x6e95('0xd')]({'port':0x232a});var interaction_log=require(_0x6e95('0xe'))(_0x6e95('0xf'));function respondWithRpcPromise(_0x3a3460,_0xcd3d28,_0x61e789,_0x16bd53){return new Promise(function(_0x477b88,_0x142d76){var _0x35f990=_0x16bd53||client;return _0x35f990[_0x6e95('0x10')](_0x3a3460,_0x61e789)['then'](function(_0xc1bfdf){logger[_0x6e95('0x11')](_0x6e95('0x12'),_0xcd3d28,_0x6e95('0x13'));logger['debug'](_0x6e95('0x14'),_0xcd3d28,_0x6e95('0x13'),JSON[_0x6e95('0x15')](_0xc1bfdf));if(_0xc1bfdf[_0x6e95('0x16')]){if(_0xc1bfdf['error'][_0x6e95('0x17')]===0x1f4){logger[_0x6e95('0x16')]('ChatMessage,\x20%s,\x20%s',_0xcd3d28,_0xc1bfdf[_0x6e95('0x16')][_0x6e95('0x18')]);return _0x142d76(_0xc1bfdf['error'][_0x6e95('0x18')]);}logger[_0x6e95('0x16')](_0x6e95('0x12'),_0xcd3d28,_0xc1bfdf['error'][_0x6e95('0x18')]);return _0x477b88(_0xc1bfdf[_0x6e95('0x16')][_0x6e95('0x18')]);}else{logger[_0x6e95('0x11')](_0x6e95('0x12'),_0xcd3d28,'request\x20sent');_0x477b88(_0xc1bfdf['result'][_0x6e95('0x18')]);}})['catch'](function(_0x114635){logger[_0x6e95('0x16')](_0x6e95('0x12'),_0xcd3d28,_0x114635);_0x142d76(_0x114635);});});}function respondWithResult(_0x431ec3,_0x1e6276){_0x1e6276=_0x1e6276||0xc8;return function(_0x133075){if(_0x133075){return _0x431ec3[_0x6e95('0x19')](_0x1e6276)['json'](_0x133075);}};}function respondWithFilteredResult(_0x3843a1,_0x3901f0){return function(_0x1f96fb){if(_0x1f96fb){var _0x2699ff=typeof _0x3901f0['offset']==='undefined'&&typeof _0x3901f0[_0x6e95('0x1a')]==='undefined';var _0x221ede=_0x1f96fb[_0x6e95('0x1b')];var _0x3ceadd=_0x2699ff?0x0:_0x3901f0[_0x6e95('0x1c')];var _0x314d1a=_0x2699ff?_0x1f96fb[_0x6e95('0x1b')]:_0x3901f0[_0x6e95('0x1c')]+_0x3901f0[_0x6e95('0x1a')];var _0x31386b;if(_0x314d1a>=_0x221ede){_0x314d1a=_0x221ede;_0x31386b=0xc8;}else{_0x31386b=0xce;}_0x3843a1['status'](_0x31386b);return _0x3843a1[_0x6e95('0x1d')](_0x6e95('0x1e'),_0x3ceadd+'-'+_0x314d1a+'/'+_0x221ede)[_0x6e95('0x1f')](_0x1f96fb);}return null;};}function saveUpdates(_0x3cd549){return function(_0x468398){if(_0x468398){return _0x468398['update'](_0x3cd549)[_0x6e95('0x20')](function(_0x45cea1){return _0x45cea1;});}return null;};}function removeEntity(_0x5c8c7f){return function(_0x660d94){if(_0x660d94){return _0x660d94[_0x6e95('0x21')]()['then'](function(){_0x5c8c7f[_0x6e95('0x19')](0xcc)[_0x6e95('0x22')]();});}};}function handleEntityNotFound(_0x919b37){return function(_0xe46659){if(!_0xe46659){_0x919b37[_0x6e95('0x23')](0x194);}return _0xe46659;};}function handleError(_0x5be8bd,_0x3fa390){_0x3fa390=_0x3fa390||0x1f4;return function(_0x591b51){logger[_0x6e95('0x16')](_0x591b51[_0x6e95('0x24')]);if(_0x591b51[_0x6e95('0x25')]){delete _0x591b51[_0x6e95('0x25')];}_0x5be8bd['status'](_0x3fa390)[_0x6e95('0x26')](_0x591b51);};}exports['index']=function(_0x4506cd,_0x2c7559){var _0x5265ca={},_0x427f7e={},_0x24ba8f={'count':0x0,'rows':[]};var _0x43ea07=_[_0x6e95('0x27')](db[_0x6e95('0x28')][_0x6e95('0x29')],function(_0x568b5a){return{'name':_0x568b5a[_0x6e95('0x2a')],'type':_0x568b5a['type']['key']};});_0x427f7e[_0x6e95('0x2b')]=_['map'](_0x43ea07,_0x6e95('0x25'));_0x427f7e[_0x6e95('0x2c')]=_['keys'](_0x4506cd[_0x6e95('0x2c')]);_0x427f7e[_0x6e95('0x2d')]=_[_0x6e95('0x2e')](_0x427f7e['model'],_0x427f7e[_0x6e95('0x2c')]);_0x5265ca[_0x6e95('0x2f')]=_[_0x6e95('0x2e')](_0x427f7e[_0x6e95('0x2b')],qs['fields'](_0x4506cd[_0x6e95('0x2c')]['fields']));_0x5265ca['attributes']=_0x5265ca[_0x6e95('0x2f')][_0x6e95('0x30')]?_0x5265ca[_0x6e95('0x2f')]:_0x427f7e[_0x6e95('0x2b')];if(!_0x4506cd['query'][_0x6e95('0x31')]('nolimit')){_0x5265ca['limit']=qs['limit'](_0x4506cd['query'][_0x6e95('0x1a')]);_0x5265ca[_0x6e95('0x1c')]=qs[_0x6e95('0x1c')](_0x4506cd[_0x6e95('0x2c')][_0x6e95('0x1c')]);}_0x5265ca[_0x6e95('0x32')]=qs[_0x6e95('0x33')](_0x4506cd[_0x6e95('0x2c')]['sort']);_0x5265ca['where']=qs[_0x6e95('0x2d')](_['pick'](_0x4506cd[_0x6e95('0x2c')],_0x427f7e[_0x6e95('0x2d')]),_0x43ea07);if(_0x4506cd[_0x6e95('0x2c')][_0x6e95('0x34')]){_0x5265ca[_0x6e95('0x35')]=_[_0x6e95('0x36')](_0x5265ca[_0x6e95('0x35')],{'$or':_['map'](_0x43ea07,function(_0x5addd5){if(_0x5addd5[_0x6e95('0x37')]!==_0x6e95('0x38')){var _0x43e2fa={};_0x43e2fa[_0x5addd5[_0x6e95('0x25')]]={'$like':'%'+_0x4506cd[_0x6e95('0x2c')][_0x6e95('0x34')]+'%'};return _0x43e2fa;}})});}_0x5265ca=_[_0x6e95('0x36')]({},_0x5265ca,_0x4506cd[_0x6e95('0x39')]);var _0x5592ea={'where':_0x5265ca['where']};return db[_0x6e95('0x28')]['count'](_0x5592ea)['then'](function(_0x341f9c){_0x24ba8f[_0x6e95('0x1b')]=_0x341f9c;if(_0x4506cd[_0x6e95('0x2c')][_0x6e95('0x3a')]){_0x5265ca['include']=[{'all':!![]}];}return db[_0x6e95('0x28')][_0x6e95('0x3b')](_0x5265ca);})[_0x6e95('0x20')](function(_0x43c24a){_0x24ba8f[_0x6e95('0x3c')]=_0x43c24a;return _0x24ba8f;})[_0x6e95('0x20')](respondWithFilteredResult(_0x2c7559,_0x5265ca))[_0x6e95('0x3d')](handleError(_0x2c7559,null));};exports['show']=function(_0x5bcd4c,_0x66403b){var _0x39123c={'raw':!![],'where':{'id':_0x5bcd4c[_0x6e95('0x3e')]['id']}},_0x1fefb8={};_0x1fefb8[_0x6e95('0x2b')]=_['keys'](db[_0x6e95('0x28')][_0x6e95('0x29')]);_0x1fefb8[_0x6e95('0x2c')]=_['keys'](_0x5bcd4c[_0x6e95('0x2c')]);_0x1fefb8[_0x6e95('0x2d')]=_[_0x6e95('0x2e')](_0x1fefb8[_0x6e95('0x2b')],_0x1fefb8['query']);_0x39123c['attributes']=_['intersection'](_0x1fefb8['model'],qs[_0x6e95('0x3f')](_0x5bcd4c['query'][_0x6e95('0x3f')]));_0x39123c[_0x6e95('0x2f')]=_0x39123c[_0x6e95('0x2f')][_0x6e95('0x30')]?_0x39123c['attributes']:_0x1fefb8[_0x6e95('0x2b')];if(_0x5bcd4c[_0x6e95('0x2c')][_0x6e95('0x3a')]){_0x39123c[_0x6e95('0x40')]=[{'all':!![]}];}_0x39123c=_[_0x6e95('0x36')]({},_0x39123c,_0x5bcd4c[_0x6e95('0x39')]);return db[_0x6e95('0x28')]['find'](_0x39123c)[_0x6e95('0x20')](handleEntityNotFound(_0x66403b,null))[_0x6e95('0x20')](respondWithResult(_0x66403b,null))['catch'](handleError(_0x66403b,null));};exports[_0x6e95('0x41')]=function(_0x1caac3,_0x3aa371){return db[_0x6e95('0x28')][_0x6e95('0x41')](_0x1caac3[_0x6e95('0x42')],{})[_0x6e95('0x20')](respondWithResult(_0x3aa371,0xc9))[_0x6e95('0x3d')](handleError(_0x3aa371,null));};exports[_0x6e95('0x43')]=function(_0x296e3c,_0x40e3ff){if(_0x296e3c['body']['id']){delete _0x296e3c['body']['id'];}return db[_0x6e95('0x28')][_0x6e95('0x44')]({'where':{'id':_0x296e3c[_0x6e95('0x3e')]['id']}})[_0x6e95('0x20')](handleEntityNotFound(_0x40e3ff,null))[_0x6e95('0x20')](saveUpdates(_0x296e3c[_0x6e95('0x42')],null))['then'](respondWithResult(_0x40e3ff,null))[_0x6e95('0x3d')](handleError(_0x40e3ff,null));};exports[_0x6e95('0x21')]=function(_0x2ca5f9,_0x1a1fd1){return db['ChatMessage'][_0x6e95('0x44')]({'where':{'id':_0x2ca5f9[_0x6e95('0x3e')]['id']}})[_0x6e95('0x20')](handleEntityNotFound(_0x1a1fd1,null))['then'](removeEntity(_0x1a1fd1,null))[_0x6e95('0x3d')](handleError(_0x1a1fd1,null));};exports['describe']=function(_0x17e8e7,_0x2fb552){return db['ChatMessage'][_0x6e95('0x45')]()[_0x6e95('0x20')](respondWithResult(_0x2fb552,null))['catch'](handleError(_0x2fb552,null));};exports[_0x6e95('0x46')]=function(_0x13d25b,_0x47b478){var _0x2c4bda=_0x6e95('0x47');return interactionService[_0x6e95('0x48')](_0x13d25b,_0x2c4bda)[_0x6e95('0x20')](respondWithResult(_0x47b478,null))['catch'](handleError(_0x47b478,null));};exports[_0x6e95('0x49')]=function(_0x700b92,_0x3c46ff){var _0x58f10a={'agent':{},'channel':_0x6e95('0x47')};if(_0x700b92['body']['id']){delete _0x700b92['body']['id'];}_0x700b92[_0x6e95('0x42')][_0x6e95('0x4a')]=_0x700b92[_0x6e95('0x42')][_0x6e95('0x4a')]||_0x700b92[_0x6e95('0x4b')]['id'];_0x58f10a[_0x6e95('0x4c')]['id']=_0x700b92[_0x6e95('0x42')][_0x6e95('0x4a')];return db[_0x6e95('0x28')][_0x6e95('0x44')]({'where':{'id':_0x700b92[_0x6e95('0x3e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c46ff,null))['then'](function(_0x181a34){if(_0x181a34){_0x58f10a[_0x6e95('0x18')]=_0x181a34[_0x6e95('0x4d')]({'plain':!![]});return db[_0x6e95('0x4e')][_0x6e95('0x44')]({'where':{'id':_0x181a34['ChatInteractionId']}});}return null;})[_0x6e95('0x20')](handleEntityNotFound(_0x3c46ff,null))[_0x6e95('0x20')](function(_0x95e89c){if(_0x95e89c){_0x58f10a['interaction']=_0x95e89c[_0x6e95('0x4d')]({'plain':!![]});interaction_log[_0x6e95('0x11')](_0x6e95('0x4f'),_0x700b92['user']['id'],_0x700b92['user'][_0x6e95('0x25')],_0x700b92[_0x6e95('0x4b')][_0x6e95('0x50')],_0x58f10a[_0x6e95('0x51')]['id'],_0x700b92[_0x6e95('0x42')]?JSON[_0x6e95('0x15')](_0x700b92['body']):_0x6e95('0x52'));return respondWithRpcPromise(_0x6e95('0x53'),'rejectMessage',_0x58f10a);}return null;})[_0x6e95('0x20')](function(_0xa71126){var _0x7d74ac=_0x6e95('0x54')+_0xa71126[_0x6e95('0x18')]['ContactId'];return db['sequelize']['query'](_0x7d74ac,{'type':db[_0x6e95('0x55')][_0x6e95('0x56')][_0x6e95('0x57')],'raw':!![]})[_0x6e95('0x20')](function(_0xe9d5d2){return _0xe9d5d2;});})[_0x6e95('0x20')](function(_0x19b97e){if(_0x19b97e){_0x58f10a[_0x6e95('0x18')][_0x6e95('0x58')]=_0x19b97e[0x0];if(!_0x700b92['body']['UserId'])return;return db[_0x6e95('0x59')][_0x6e95('0x44')]({'where':{'id':_0x700b92[_0x6e95('0x42')][_0x6e95('0x4a')],'role':_0x6e95('0x4c')},'attributes':['id',_0x6e95('0x25'),_0x6e95('0x5a'),_0x6e95('0x5b'),_0x6e95('0x5c')],'raw':!![]});}return null;})[_0x6e95('0x20')](function(_0x5092fc){if(!_0x5092fc)return null;_0x58f10a['message'][_0x6e95('0x4c')]=_0x5092fc;return _0x58f10a;})[_0x6e95('0x20')](function(_0x2c4bde){if(_0x2c4bde){_0x2c4bde[_0x6e95('0x18')][_0x6e95('0x5d')]=util[_0x6e95('0x5e')](_0x6e95('0x5f'),_0x700b92[_0x6e95('0x4b')]['name']);_0x2c4bde['message'][_0x6e95('0x60')]=_0x58f10a['channel'];_0x2c4bde['message'][_0x6e95('0x61')]=_0x58f10a[_0x6e95('0x60')];_0x2c4bde[_0x6e95('0x18')][_0x6e95('0x62')]=_0x6e95('0x49');respondWithRpcPromise(_0x6e95('0x63'),_0x6e95('0x63'),{'event':_0x6e95('0x64'),'message':_[_0x6e95('0x36')](_0x58f10a[_0x6e95('0x18')],JSON[_0x6e95('0x65')](_0x58f10a['interaction']['formData']))},client9002);return _0x58f10a;}return null;})[_0x6e95('0x20')](respondWithResult(_0x3c46ff,null))[_0x6e95('0x3d')](handleError(_0x3c46ff,null));};
\ No newline at end of file
+var _0xa6d4=['findAll','rows','show','params','find','create','body','describe','accept','chat','reject','UserId','user','agent','get','ChatInteraction','ChatInteractionId','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','format','SIP/%s','channel','motionChannel','EventManager','rejectmessage','parse','formData','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','chat-interactions','request','then','info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','status','json','undefined','count','offset','limit','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0xa6d4,0x101));var _0x4a6d=function(_0x26eba8,_0x3e5db7){_0x26eba8=_0x26eba8-0x0;var _0x19fa6e=_0xa6d4[_0x26eba8];return _0x19fa6e;};'use strict';var util=require(_0x4a6d('0x0'));var _=require(_0x4a6d('0x1'));var Redis=require(_0x4a6d('0x2'));var interactionService=require(_0x4a6d('0x3'));var qs=require(_0x4a6d('0x4'));var logger=require(_0x4a6d('0x5'))('api');var config=require('../../config/environment');var db=require(_0x4a6d('0x6'))['db'];config[_0x4a6d('0x7')]=_[_0x4a6d('0x8')](config[_0x4a6d('0x7')],{'host':_0x4a6d('0x9'),'port':0x18eb});var socket=require(_0x4a6d('0xa'))(new Redis(config[_0x4a6d('0x7')]));require(_0x4a6d('0xb'))[_0x4a6d('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4a6d('0xd')]['http']({'port':0x232c});var client9002=jayson[_0x4a6d('0xd')][_0x4a6d('0xe')]({'port':0x232a});var interaction_log=require(_0x4a6d('0x5'))(_0x4a6d('0xf'));function respondWithRpcPromise(_0x2f0d9f,_0x5b5edf,_0x3b7aef,_0x358671){return new Promise(function(_0x560c85,_0x4c1a8e){var _0x5a04a4=_0x358671||client;return _0x5a04a4[_0x4a6d('0x10')](_0x2f0d9f,_0x3b7aef)[_0x4a6d('0x11')](function(_0x498876){logger[_0x4a6d('0x12')](_0x4a6d('0x13'),_0x5b5edf,'request\x20sent');logger[_0x4a6d('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5b5edf,'request\x20sent',JSON[_0x4a6d('0x15')](_0x498876));if(_0x498876[_0x4a6d('0x16')]){if(_0x498876[_0x4a6d('0x16')][_0x4a6d('0x17')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5b5edf,_0x498876[_0x4a6d('0x16')][_0x4a6d('0x18')]);return _0x4c1a8e(_0x498876['error'][_0x4a6d('0x18')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x5b5edf,_0x498876[_0x4a6d('0x16')][_0x4a6d('0x18')]);return _0x560c85(_0x498876[_0x4a6d('0x16')][_0x4a6d('0x18')]);}else{logger[_0x4a6d('0x12')](_0x4a6d('0x13'),_0x5b5edf,'request\x20sent');_0x560c85(_0x498876[_0x4a6d('0x19')][_0x4a6d('0x18')]);}})[_0x4a6d('0x1a')](function(_0x34bc7d){logger[_0x4a6d('0x16')](_0x4a6d('0x13'),_0x5b5edf,_0x34bc7d);_0x4c1a8e(_0x34bc7d);});});}function respondWithResult(_0x39edf5,_0xebec82){_0xebec82=_0xebec82||0xc8;return function(_0x3537ff){if(_0x3537ff){return _0x39edf5[_0x4a6d('0x1b')](_0xebec82)[_0x4a6d('0x1c')](_0x3537ff);}};}function respondWithFilteredResult(_0x3afe1e,_0xcef94){return function(_0x23b8af){if(_0x23b8af){var _0x264bc5=typeof _0xcef94['offset']===_0x4a6d('0x1d')&&typeof _0xcef94['limit']==='undefined';var _0x35e132=_0x23b8af[_0x4a6d('0x1e')];var _0x3c8f66=_0x264bc5?0x0:_0xcef94[_0x4a6d('0x1f')];var _0x38d9bd=_0x264bc5?_0x23b8af[_0x4a6d('0x1e')]:_0xcef94['offset']+_0xcef94[_0x4a6d('0x20')];var _0x4f29cc;if(_0x38d9bd>=_0x35e132){_0x38d9bd=_0x35e132;_0x4f29cc=0xc8;}else{_0x4f29cc=0xce;}_0x3afe1e[_0x4a6d('0x1b')](_0x4f29cc);return _0x3afe1e[_0x4a6d('0x21')](_0x4a6d('0x22'),_0x3c8f66+'-'+_0x38d9bd+'/'+_0x35e132)[_0x4a6d('0x1c')](_0x23b8af);}return null;};}function saveUpdates(_0x3a6b6c){return function(_0x5bb6da){if(_0x5bb6da){return _0x5bb6da[_0x4a6d('0x23')](_0x3a6b6c)[_0x4a6d('0x11')](function(_0x254b92){return _0x254b92;});}return null;};}function removeEntity(_0x24abb4){return function(_0x4ea11e){if(_0x4ea11e){return _0x4ea11e[_0x4a6d('0x24')]()[_0x4a6d('0x11')](function(){_0x24abb4['status'](0xcc)[_0x4a6d('0x25')]();});}};}function handleEntityNotFound(_0x2a65e1){return function(_0x51fdeb){if(!_0x51fdeb){_0x2a65e1[_0x4a6d('0x26')](0x194);}return _0x51fdeb;};}function handleError(_0x462225,_0xaeaa7c){_0xaeaa7c=_0xaeaa7c||0x1f4;return function(_0x2e6fdc){logger[_0x4a6d('0x16')](_0x2e6fdc[_0x4a6d('0x27')]);if(_0x2e6fdc[_0x4a6d('0x28')]){delete _0x2e6fdc[_0x4a6d('0x28')];}_0x462225[_0x4a6d('0x1b')](_0xaeaa7c)[_0x4a6d('0x29')](_0x2e6fdc);};}exports['index']=function(_0x4d0740,_0x671273){var _0x5edef6={},_0x73ff6e={},_0x16f52f={'count':0x0,'rows':[]};var _0x308a3a=_[_0x4a6d('0x2a')](db[_0x4a6d('0x2b')][_0x4a6d('0x2c')],function(_0x23c76f){return{'name':_0x23c76f[_0x4a6d('0x2d')],'type':_0x23c76f['type'][_0x4a6d('0x2e')]};});_0x73ff6e[_0x4a6d('0x2f')]=_[_0x4a6d('0x2a')](_0x308a3a,_0x4a6d('0x28'));_0x73ff6e['query']=_[_0x4a6d('0x30')](_0x4d0740[_0x4a6d('0x31')]);_0x73ff6e[_0x4a6d('0x32')]=_[_0x4a6d('0x33')](_0x73ff6e['model'],_0x73ff6e[_0x4a6d('0x31')]);_0x5edef6['attributes']=_[_0x4a6d('0x33')](_0x73ff6e[_0x4a6d('0x2f')],qs[_0x4a6d('0x34')](_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x34')]));_0x5edef6[_0x4a6d('0x35')]=_0x5edef6[_0x4a6d('0x35')][_0x4a6d('0x36')]?_0x5edef6[_0x4a6d('0x35')]:_0x73ff6e[_0x4a6d('0x2f')];if(!_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x37')]('nolimit')){_0x5edef6['limit']=qs['limit'](_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x20')]);_0x5edef6['offset']=qs[_0x4a6d('0x1f')](_0x4d0740['query'][_0x4a6d('0x1f')]);}_0x5edef6[_0x4a6d('0x38')]=qs[_0x4a6d('0x39')](_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x39')]);_0x5edef6[_0x4a6d('0x3a')]=qs[_0x4a6d('0x32')](_[_0x4a6d('0x3b')](_0x4d0740[_0x4a6d('0x31')],_0x73ff6e[_0x4a6d('0x32')]),_0x308a3a);if(_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x3c')]){_0x5edef6[_0x4a6d('0x3a')]=_[_0x4a6d('0x3d')](_0x5edef6[_0x4a6d('0x3a')],{'$or':_[_0x4a6d('0x2a')](_0x308a3a,function(_0x4b4656){if(_0x4b4656[_0x4a6d('0x3e')]!==_0x4a6d('0x3f')){var _0x3cde5e={};_0x3cde5e[_0x4b4656[_0x4a6d('0x28')]]={'$like':'%'+_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x3c')]+'%'};return _0x3cde5e;}})});}_0x5edef6=_['merge']({},_0x5edef6,_0x4d0740[_0x4a6d('0x40')]);var _0x547827={'where':_0x5edef6[_0x4a6d('0x3a')]};return db['ChatMessage'][_0x4a6d('0x1e')](_0x547827)[_0x4a6d('0x11')](function(_0x53d100){_0x16f52f[_0x4a6d('0x1e')]=_0x53d100;if(_0x4d0740[_0x4a6d('0x31')][_0x4a6d('0x41')]){_0x5edef6[_0x4a6d('0x42')]=[{'all':!![]}];}return db[_0x4a6d('0x2b')][_0x4a6d('0x43')](_0x5edef6);})[_0x4a6d('0x11')](function(_0x4d6ba4){_0x16f52f[_0x4a6d('0x44')]=_0x4d6ba4;return _0x16f52f;})[_0x4a6d('0x11')](respondWithFilteredResult(_0x671273,_0x5edef6))[_0x4a6d('0x1a')](handleError(_0x671273,null));};exports[_0x4a6d('0x45')]=function(_0x133d7f,_0x274c10){var _0x5a3e58={'raw':!![],'where':{'id':_0x133d7f[_0x4a6d('0x46')]['id']}},_0x5bf88a={};_0x5bf88a[_0x4a6d('0x2f')]=_['keys'](db[_0x4a6d('0x2b')][_0x4a6d('0x2c')]);_0x5bf88a[_0x4a6d('0x31')]=_[_0x4a6d('0x30')](_0x133d7f[_0x4a6d('0x31')]);_0x5bf88a[_0x4a6d('0x32')]=_[_0x4a6d('0x33')](_0x5bf88a[_0x4a6d('0x2f')],_0x5bf88a[_0x4a6d('0x31')]);_0x5a3e58[_0x4a6d('0x35')]=_[_0x4a6d('0x33')](_0x5bf88a[_0x4a6d('0x2f')],qs[_0x4a6d('0x34')](_0x133d7f[_0x4a6d('0x31')][_0x4a6d('0x34')]));_0x5a3e58[_0x4a6d('0x35')]=_0x5a3e58[_0x4a6d('0x35')]['length']?_0x5a3e58['attributes']:_0x5bf88a['model'];if(_0x133d7f[_0x4a6d('0x31')][_0x4a6d('0x41')]){_0x5a3e58['include']=[{'all':!![]}];}_0x5a3e58=_[_0x4a6d('0x3d')]({},_0x5a3e58,_0x133d7f[_0x4a6d('0x40')]);return db[_0x4a6d('0x2b')][_0x4a6d('0x47')](_0x5a3e58)[_0x4a6d('0x11')](handleEntityNotFound(_0x274c10,null))['then'](respondWithResult(_0x274c10,null))[_0x4a6d('0x1a')](handleError(_0x274c10,null));};exports[_0x4a6d('0x48')]=function(_0x13a6c2,_0x4eeecd){return db[_0x4a6d('0x2b')][_0x4a6d('0x48')](_0x13a6c2['body'],{})[_0x4a6d('0x11')](respondWithResult(_0x4eeecd,0xc9))[_0x4a6d('0x1a')](handleError(_0x4eeecd,null));};exports[_0x4a6d('0x23')]=function(_0x3a2098,_0x3de169){if(_0x3a2098[_0x4a6d('0x49')]['id']){delete _0x3a2098['body']['id'];}return db['ChatMessage'][_0x4a6d('0x47')]({'where':{'id':_0x3a2098[_0x4a6d('0x46')]['id']}})['then'](handleEntityNotFound(_0x3de169,null))['then'](saveUpdates(_0x3a2098['body'],null))[_0x4a6d('0x11')](respondWithResult(_0x3de169,null))[_0x4a6d('0x1a')](handleError(_0x3de169,null));};exports[_0x4a6d('0x24')]=function(_0x63af58,_0xc3f141){return db[_0x4a6d('0x2b')][_0x4a6d('0x47')]({'where':{'id':_0x63af58[_0x4a6d('0x46')]['id']}})[_0x4a6d('0x11')](handleEntityNotFound(_0xc3f141,null))[_0x4a6d('0x11')](removeEntity(_0xc3f141,null))[_0x4a6d('0x1a')](handleError(_0xc3f141,null));};exports[_0x4a6d('0x4a')]=function(_0x258179,_0x3b5d51){return db[_0x4a6d('0x2b')][_0x4a6d('0x4a')]()['then'](respondWithResult(_0x3b5d51,null))[_0x4a6d('0x1a')](handleError(_0x3b5d51,null));};exports[_0x4a6d('0x4b')]=function(_0x53060a,_0x1a5854){var _0x1cbc62=_0x4a6d('0x4c');return interactionService['acceptMessage'](_0x53060a,_0x1cbc62)['then'](respondWithResult(_0x1a5854,null))[_0x4a6d('0x1a')](handleError(_0x1a5854,null));};exports[_0x4a6d('0x4d')]=function(_0xfb9e39,_0x347b7b){var _0x2e45c9={'agent':{},'channel':_0x4a6d('0x4c')};if(_0xfb9e39[_0x4a6d('0x49')]['id']){delete _0xfb9e39[_0x4a6d('0x49')]['id'];}_0xfb9e39[_0x4a6d('0x49')][_0x4a6d('0x4e')]=_0xfb9e39[_0x4a6d('0x49')][_0x4a6d('0x4e')]||_0xfb9e39[_0x4a6d('0x4f')]['id'];_0x2e45c9[_0x4a6d('0x50')]['id']=_0xfb9e39['body'][_0x4a6d('0x4e')];return db['ChatMessage'][_0x4a6d('0x47')]({'where':{'id':_0xfb9e39[_0x4a6d('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x347b7b,null))[_0x4a6d('0x11')](function(_0x43d6cd){if(_0x43d6cd){_0x2e45c9[_0x4a6d('0x18')]=_0x43d6cd[_0x4a6d('0x51')]({'plain':!![]});return db[_0x4a6d('0x52')][_0x4a6d('0x47')]({'where':{'id':_0x43d6cd[_0x4a6d('0x53')]}});}return null;})[_0x4a6d('0x11')](handleEntityNotFound(_0x347b7b,null))['then'](function(_0x1c1444){if(_0x1c1444){_0x2e45c9[_0x4a6d('0x54')]=_0x1c1444[_0x4a6d('0x51')]({'plain':!![]});interaction_log[_0x4a6d('0x12')](_0x4a6d('0x55'),_0xfb9e39['user']['id'],_0xfb9e39[_0x4a6d('0x4f')]['name'],_0xfb9e39[_0x4a6d('0x4f')][_0x4a6d('0x56')],_0x2e45c9[_0x4a6d('0x54')]['id'],_0xfb9e39[_0x4a6d('0x49')]?JSON['stringify'](_0xfb9e39['body']):_0x4a6d('0x57'));return respondWithRpcPromise(_0x4a6d('0x58'),_0x4a6d('0x59'),_0x2e45c9);}return null;})[_0x4a6d('0x11')](function(_0x2ca1b9){var _0x4ad7ce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ca1b9['message'][_0x4a6d('0x5a')];return db[_0x4a6d('0x5b')][_0x4a6d('0x31')](_0x4ad7ce,{'type':db[_0x4a6d('0x5c')][_0x4a6d('0x5d')][_0x4a6d('0x5e')],'raw':!![]})[_0x4a6d('0x11')](function(_0x4012c0){return _0x4012c0;});})[_0x4a6d('0x11')](function(_0x32980e){if(_0x32980e){_0x2e45c9[_0x4a6d('0x18')][_0x4a6d('0x5f')]=_0x32980e[0x0];if(!_0xfb9e39[_0x4a6d('0x49')][_0x4a6d('0x4e')])return;return db[_0x4a6d('0x60')]['find']({'where':{'id':_0xfb9e39[_0x4a6d('0x49')][_0x4a6d('0x4e')],'role':_0x4a6d('0x50')},'attributes':['id',_0x4a6d('0x28'),_0x4a6d('0x61'),'email',_0x4a6d('0x62')],'raw':!![]});}return null;})[_0x4a6d('0x11')](function(_0x236bc4){if(!_0x236bc4)return null;_0x2e45c9[_0x4a6d('0x18')][_0x4a6d('0x50')]=_0x236bc4;return _0x2e45c9;})[_0x4a6d('0x11')](function(_0x476cfe){if(_0x476cfe){_0x476cfe[_0x4a6d('0x18')][_0x4a6d('0x63')]=util[_0x4a6d('0x64')](_0x4a6d('0x65'),_0xfb9e39['user'][_0x4a6d('0x28')]);_0x476cfe[_0x4a6d('0x18')][_0x4a6d('0x66')]=_0x2e45c9[_0x4a6d('0x66')];_0x476cfe[_0x4a6d('0x18')][_0x4a6d('0x67')]=_0x2e45c9['channel'];_0x476cfe[_0x4a6d('0x18')]['event']='reject';respondWithRpcPromise(_0x4a6d('0x68'),_0x4a6d('0x68'),{'event':_0x4a6d('0x69'),'message':_[_0x4a6d('0x3d')](_0x2e45c9[_0x4a6d('0x18')],JSON[_0x4a6d('0x6a')](_0x2e45c9['interaction'][_0x4a6d('0x6b')]))},client9002);return _0x2e45c9;}return null;})['then'](respondWithResult(_0x347b7b,null))[_0x4a6d('0x1a')](handleError(_0x347b7b,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 957f3a0..bd791c6 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 _0xc236=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0xc236,0x12b));var _0x6c23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc236[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6c23('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x6c23('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6c23('0x2')](0x0);var events={'afterCreate':_0x6c23('0x3'),'afterUpdate':_0x6c23('0x4'),'afterDestroy':_0x6c23('0x5')};function emitEvent(_0x1cd6a0){return function(_0x5cf94f,_0x19b9fc,_0x4494c4){ChatMessageEvents[_0x6c23('0x6')](_0x1cd6a0+':'+_0x5cf94f['id'],_0x5cf94f);ChatMessageEvents['emit'](_0x1cd6a0,_0x5cf94f);_0x4494c4(null);};}for(var e in events){if(events[_0x6c23('0x7')](e)){var event=events[e];ChatMessage[_0x6c23('0x8')](e,emitEvent(event));}}module[_0x6c23('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x9b30=['hasOwnProperty','../../mysqldb','ChatMessage','setMaxListeners','remove','emit'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x9b30,0x8b));var _0x09b3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x9b30[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x09b3('0x0'))['db'][_0x09b3('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x09b3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x09b3('0x3')};function emitEvent(_0x119466){return function(_0x59fb17,_0x355e28,_0x1ba406){ChatMessageEvents[_0x09b3('0x4')](_0x119466+':'+_0x59fb17['id'],_0x59fb17);ChatMessageEvents['emit'](_0x119466,_0x59fb17);_0x1ba406(null);};}for(var e in events){if(events[_0x09b3('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 17ddeeb..a21c040 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 _0xcc92=['toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction'];(function(_0x21fb16,_0x2d7fb5){var _0x470ab7=function(_0x169d5c){while(--_0x169d5c){_0x21fb16['push'](_0x21fb16['shift']());}};_0x470ab7(++_0x2d7fb5);}(_0xcc92,0x141));var _0x2cc9=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xcc92[_0x16629d];return _0x56ccee;};'use strict';var _=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var logger=require(_0x2cc9('0x2'))('api');var moment=require(_0x2cc9('0x3'));var BPromise=require(_0x2cc9('0x4'));var rp=require(_0x2cc9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2cc9('0x6'));var attributes=require(_0x2cc9('0x7'));module['exports']=function(_0x2260b6,_0x5f3e9c){return _0x2260b6[_0x2cc9('0x8')](_0x2cc9('0x9'),attributes,{'tableName':_0x2cc9('0xa'),'paranoid':![],'indexes':[{'name':_0x2cc9('0xb'),'fields':['body'],'type':_0x2cc9('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e9d6e,_0x103a34,_0xeff44e){var _0x59c85c=_0x2260b6['models'];var _0x1e3624=_0x4e9d6e[_0x2cc9('0xd')]({'plain':!![]});if(_0x1e3624[_0x2cc9('0xe')][_0x2cc9('0xf')]()==='in'||_0x1e3624[_0x2cc9('0xe')][_0x2cc9('0xf')]()===_0x2cc9('0x10')&&!_0x1e3624[_0x2cc9('0x11')]&&!_[_0x2cc9('0x12')](_0x1e3624[_0x2cc9('0x13')])){_0x59c85c[_0x2cc9('0x14')][_0x2cc9('0x15')]({'where':{'id':_0x1e3624['ChatInteractionId']}})[_0x2cc9('0x16')](function(_0x45a3d4){if(_0x45a3d4){_0x45a3d4[_0x2cc9('0x17')]({'lastMsgAt':_0x1e3624[_0x2cc9('0x18')],'lastMsgDirection':_0x1e3624['direction'][_0x2cc9('0xf')]()});}})[_0x2cc9('0x19')](function(_0x3c380c){console[_0x2cc9('0x1a')](_0x3c380c);});}_0xeff44e();}},'charset':'utf8mb4','collate':_0x2cc9('0x1b')});};
\ No newline at end of file
+var _0xd1d4=['util','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4cecf8,_0x522f97){var _0x311797=function(_0x243bcb){while(--_0x243bcb){_0x4cecf8['push'](_0x4cecf8['shift']());}};_0x311797(++_0x522f97);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xd1d4[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var logger=require('../../config/logger')(_0x4d1d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d1d('0x3'));var fs=require('fs');var path=require(_0x4d1d('0x4'));var rimraf=require(_0x4d1d('0x5'));var config=require(_0x4d1d('0x6'));var attributes=require(_0x4d1d('0x7'));module[_0x4d1d('0x8')]=function(_0x30466a,_0xb8a403){return _0x30466a[_0x4d1d('0x9')](_0x4d1d('0xa'),attributes,{'tableName':_0x4d1d('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x4d1d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x371de3,_0x52cbbf,_0x2053ab){var _0x33d8a7=_0x30466a[_0x4d1d('0xd')];var _0x248db3=_0x371de3[_0x4d1d('0xe')]({'plain':!![]});if(_0x248db3[_0x4d1d('0xf')][_0x4d1d('0x10')]()==='in'||_0x248db3[_0x4d1d('0xf')][_0x4d1d('0x10')]()===_0x4d1d('0x11')&&!_0x248db3[_0x4d1d('0x12')]&&!_[_0x4d1d('0x13')](_0x248db3[_0x4d1d('0x14')])){_0x33d8a7['ChatInteraction'][_0x4d1d('0x15')]({'where':{'id':_0x248db3[_0x4d1d('0x16')]}})[_0x4d1d('0x17')](function(_0x377ff7){if(_0x377ff7){_0x377ff7['update']({'lastMsgAt':_0x248db3['createdAt'],'lastMsgDirection':_0x248db3[_0x4d1d('0xf')][_0x4d1d('0x10')]()});}})[_0x4d1d('0x18')](function(_0x569809){console[_0x4d1d('0x19')](_0x569809);});}_0x2053ab();}},'charset':_0x4d1d('0x1a'),'collate':_0x4d1d('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 25636f3..63550c6 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 _0x0505=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0x23dac3,_0x282874){var _0x5702cc=function(_0xcbf1c1){while(--_0xcbf1c1){_0x23dac3['push'](_0x23dac3['shift']());}};_0x5702cc(++_0x282874);}(_0x0505,0x13f));var _0x5050=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x0505[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5050('0x0'));var rs=require(_0x5050('0x1'));var fs=require('fs');var Redis=require(_0x5050('0x2'));var db=require(_0x5050('0x3'))['db'];var utils=require(_0x5050('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5050('0x5'));var jayson=require(_0x5050('0x6'));var client=jayson['client'][_0x5050('0x7')]({'port':0x232a});config['redis']=_[_0x5050('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5050('0x9'))(new Redis(config['redis']));require(_0x5050('0xa'))[_0x5050('0xb')](socket);function respondWithRpcPromise(_0x42307a,_0x53fe07,_0x3e91ac){return new BPromise(function(_0x3612a4,_0x792b1){return client[_0x5050('0xc')](_0x42307a,_0x3e91ac)[_0x5050('0xd')](function(_0x4301a9){logger[_0x5050('0xe')](_0x5050('0xf'),_0x53fe07,'request\x20sent');logger[_0x5050('0x10')](_0x5050('0x11'),_0x53fe07,_0x5050('0x12'),JSON[_0x5050('0x13')](_0x4301a9));if(_0x4301a9[_0x5050('0x14')]){if(_0x4301a9[_0x5050('0x14')][_0x5050('0x15')]===0x1f4){logger[_0x5050('0x14')](_0x5050('0xf'),_0x53fe07,_0x4301a9[_0x5050('0x14')]['message']);return _0x792b1(_0x4301a9['error'][_0x5050('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x53fe07,_0x4301a9['error'][_0x5050('0x16')]);return _0x3612a4(_0x4301a9['error']['message']);}else{logger[_0x5050('0xe')](_0x5050('0xf'),_0x53fe07,_0x5050('0x12'));_0x3612a4(_0x4301a9['result']['message']);}})[_0x5050('0x17')](function(_0xe7b615){logger[_0x5050('0x14')](_0x5050('0xf'),_0x53fe07,_0xe7b615);_0x792b1(_0xe7b615);});});}exports[_0x5050('0x18')]=function(_0x60911b){var _0x2adbf9=this;return new Promise(function(_0x476b9f,_0x253d1e){return db[_0x5050('0x19')][_0x5050('0x1a')](_0x60911b['body'],{'raw':_0x60911b[_0x5050('0x1b')]?_0x60911b[_0x5050('0x1b')][_0x5050('0x1c')]===undefined?!![]:![]:!![]})[_0x5050('0xd')](function(_0x919bc3){logger[_0x5050('0xe')](_0x5050('0x18'),_0x60911b);logger[_0x5050('0x10')]('CreateChatMessage',_0x60911b,JSON[_0x5050('0x13')](_0x919bc3));_0x476b9f(_0x919bc3);})['catch'](function(_0xf3a2f0){logger['error'](_0x5050('0x18'),_0xf3a2f0[_0x5050('0x16')],_0x60911b);_0x253d1e(_0x2adbf9['error'](0x1f4,_0xf3a2f0[_0x5050('0x16')]));});});};
\ No newline at end of file
+var _0x7567=['ChatMessage','create','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage'];(function(_0x50dfa5,_0x2d0564){var _0x24331c=function(_0x588c76){while(--_0x588c76){_0x50dfa5['push'](_0x50dfa5['shift']());}};_0x24331c(++_0x2d0564);}(_0x7567,0x143));var _0x7756=function(_0x448855,_0x11578a){_0x448855=_0x448855-0x0;var _0x3c5264=_0x7567[_0x448855];return _0x3c5264;};'use strict';var _=require(_0x7756('0x0'));var util=require(_0x7756('0x1'));var moment=require(_0x7756('0x2'));var BPromise=require(_0x7756('0x3'));var rs=require(_0x7756('0x4'));var fs=require('fs');var Redis=require(_0x7756('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7756('0x6'));var logger=require(_0x7756('0x7'))(_0x7756('0x8'));var config=require(_0x7756('0x9'));var jayson=require(_0x7756('0xa'));var client=jayson['client'][_0x7756('0xb')]({'port':0x232a});config[_0x7756('0xc')]=_[_0x7756('0xd')](config[_0x7756('0xc')],{'host':_0x7756('0xe'),'port':0x18eb});var socket=require(_0x7756('0xf'))(new Redis(config[_0x7756('0xc')]));require(_0x7756('0x10'))['register'](socket);function respondWithRpcPromise(_0x58d891,_0x4f0081,_0x217251){return new BPromise(function(_0x59387c,_0x5ca726){return client[_0x7756('0x11')](_0x58d891,_0x217251)[_0x7756('0x12')](function(_0x23e939){logger[_0x7756('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4f0081,_0x7756('0x14'));logger['debug'](_0x7756('0x15'),_0x4f0081,_0x7756('0x14'),JSON[_0x7756('0x16')](_0x23e939));if(_0x23e939[_0x7756('0x17')]){if(_0x23e939[_0x7756('0x17')]['code']===0x1f4){logger[_0x7756('0x17')](_0x7756('0x18'),_0x4f0081,_0x23e939[_0x7756('0x17')][_0x7756('0x19')]);return _0x5ca726(_0x23e939['error'][_0x7756('0x19')]);}logger[_0x7756('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4f0081,_0x23e939[_0x7756('0x17')][_0x7756('0x19')]);return _0x59387c(_0x23e939[_0x7756('0x17')][_0x7756('0x19')]);}else{logger[_0x7756('0x13')](_0x7756('0x18'),_0x4f0081,'request\x20sent');_0x59387c(_0x23e939[_0x7756('0x1a')][_0x7756('0x19')]);}})[_0x7756('0x1b')](function(_0x10964a){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4f0081,_0x10964a);_0x5ca726(_0x10964a);});});}exports[_0x7756('0x1c')]=function(_0x430ecd){var _0x432776=this;return new Promise(function(_0x34937a,_0x3c1be5){return db[_0x7756('0x1d')][_0x7756('0x1e')](_0x430ecd['body'],{'raw':_0x430ecd[_0x7756('0x1f')]?_0x430ecd[_0x7756('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x7756('0x12')](function(_0x1ac55d){logger[_0x7756('0x13')]('CreateChatMessage',_0x430ecd);logger['debug'](_0x7756('0x1c'),_0x430ecd,JSON[_0x7756('0x16')](_0x1ac55d));_0x34937a(_0x1ac55d);})[_0x7756('0x1b')](function(_0x579cb7){logger[_0x7756('0x17')]('CreateChatMessage',_0x579cb7[_0x7756('0x19')],_0x430ecd);_0x3c1be5(_0x432776[_0x7756('0x17')](0x1f4,_0x579cb7[_0x7756('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 10113ea..63b0eca 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 _0x2e65=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x2e65,0x193));var _0x52e6=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x2e65[_0x2dd390];return _0x3afe47;};'use strict';var ChatMessageEvents=require(_0x52e6('0x0'));var events=[_0x52e6('0x1'),_0x52e6('0x2'),_0x52e6('0x3')];function createListener(_0xd7e693,_0x23aa21){return function(_0x1ab739){_0x23aa21[_0x52e6('0x4')](_0xd7e693,_0x1ab739);};}function removeListener(_0x47912f,_0x383919){return function(){ChatMessageEvents[_0x52e6('0x5')](_0x47912f,_0x383919);};}exports[_0x52e6('0x6')]=function(_0xe67caa){for(var _0x1cf6d2=0x0,_0x116651=events[_0x52e6('0x7')];_0x1cf6d2<_0x116651;_0x1cf6d2++){var _0x1401a3=events[_0x1cf6d2];var _0x27f270=createListener(_0x52e6('0x8')+_0x1401a3,_0xe67caa);ChatMessageEvents['on'](_0x1401a3,_0x27f270);}};
\ No newline at end of file
+var _0xe009=['length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xe009,0x122));var _0x9e00=function(_0x147968,_0xeba403){_0x147968=_0x147968-0x0;var _0x5253e3=_0xe009[_0x147968];return _0x5253e3;};'use strict';var ChatMessageEvents=require(_0x9e00('0x0'));var events=[_0x9e00('0x1'),_0x9e00('0x2'),_0x9e00('0x3')];function createListener(_0x53b46a,_0x126adc){return function(_0x4b0d66){_0x126adc[_0x9e00('0x4')](_0x53b46a,_0x4b0d66);};}function removeListener(_0x24d136,_0x30f741){return function(){ChatMessageEvents[_0x9e00('0x5')](_0x24d136,_0x30f741);};}exports[_0x9e00('0x6')]=function(_0x467e35){for(var _0x32b4ee=0x0,_0x402bb0=events[_0x9e00('0x7')];_0x32b4ee<_0x402bb0;_0x32b4ee++){var _0x1eb956=events[_0x32b4ee];var _0x5da6a4=createListener(_0x9e00('0x8')+_0x1eb956,_0x467e35);ChatMessageEvents['on'](_0x1eb956,_0x5da6a4);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 8f2cfd1..c98d471 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 _0x7b17=['get','describe','/:id','tracked','chat','chatmessage:create','put','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','express','Router','../../components/auth/service','./chatMessage.controller','isAuthenticated','index'];(function(_0x378aca,_0x13e103){var _0x1b7b4b=function(_0xed42d6){while(--_0xed42d6){_0x378aca['push'](_0x378aca['shift']());}};_0x1b7b4b(++_0x13e103);}(_0x7b17,0x75));var _0x77b1=function(_0x3c97e3,_0x321677){_0x3c97e3=_0x3c97e3-0x0;var _0x9bb0ed=_0x7b17[_0x3c97e3];return _0x9bb0ed;};'use strict';var multer=require(_0x77b1('0x0'));var util=require(_0x77b1('0x1'));var path=require(_0x77b1('0x2'));var timeout=require('connect-timeout');var express=require(_0x77b1('0x3'));var router=express[_0x77b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x77b1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77b1('0x6'));router['get']('/',auth[_0x77b1('0x7')](),controller[_0x77b1('0x8')]);router[_0x77b1('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x77b1('0xa')]);router['get'](_0x77b1('0xb'),auth[_0x77b1('0x7')](),controller['show']);router['post']('/',auth[_0x77b1('0x7')](),interaction[_0x77b1('0xc')](_0x77b1('0xd'),_0x77b1('0xe')),controller['create']);router['put']('/:id',controller['update']);router[_0x77b1('0xf')](_0x77b1('0x10'),auth[_0x77b1('0x7')](),controller['accept']);router['put'](_0x77b1('0x11'),auth[_0x77b1('0x7')](),controller[_0x77b1('0x12')]);router[_0x77b1('0x13')](_0x77b1('0xb'),auth[_0x77b1('0x7')](),controller[_0x77b1('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x592e=['../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','chat','chatmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x18fb3d,_0x2f0778){var _0x420061=function(_0x163aff){while(--_0x163aff){_0x18fb3d['push'](_0x18fb3d['shift']());}};_0x420061(++_0x2f0778);}(_0x592e,0x13f));var _0xe592=function(_0xe63142,_0xebe351){_0xe63142=_0xe63142-0x0;var _0x285167=_0x592e[_0xe63142];return _0x285167;};'use strict';var multer=require(_0xe592('0x0'));var util=require(_0xe592('0x1'));var path=require(_0xe592('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe592('0x3'));var auth=require(_0xe592('0x4'));var interaction=require(_0xe592('0x5'));var config=require('../../config/environment');var controller=require(_0xe592('0x6'));router[_0xe592('0x7')]('/',auth[_0xe592('0x8')](),controller[_0xe592('0x9')]);router[_0xe592('0x7')](_0xe592('0xa'),auth[_0xe592('0x8')](),controller[_0xe592('0xb')]);router[_0xe592('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe592('0xc')]);router[_0xe592('0xd')]('/',auth[_0xe592('0x8')](),interaction['tracked'](_0xe592('0xe'),_0xe592('0xf')),controller[_0xe592('0x10')]);router[_0xe592('0x11')](_0xe592('0x12'),controller[_0xe592('0x13')]);router[_0xe592('0x11')](_0xe592('0x14'),auth['isAuthenticated'](),controller[_0xe592('0x15')]);router[_0xe592('0x11')](_0xe592('0x16'),auth[_0xe592('0x8')](),controller[_0xe592('0x17')]);router[_0xe592('0x18')](_0xe592('0x12'),auth[_0xe592('0x8')](),controller[_0xe592('0x19')]);module[_0xe592('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 7b39354..31a6985 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['medium','exports','TEXT'];(function(_0x4d1055,_0x3be1fd){var _0x56a5bd=function(_0x2068e2){while(--_0x2068e2){_0x4d1055['push'](_0x4d1055['shift']());}};_0x56a5bd(++_0x3be1fd);}(_0x2032,0xd9));var _0x2203=function(_0x4fc6d7,_0x518b57){_0x4fc6d7=_0x4fc6d7-0x0;var _0x3872c1=_0x2032[_0x4fc6d7];return _0x3872c1;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x45da21,_0x45d703){var _0x311883=function(_0x2d66a1){while(--_0x2d66a1){_0x45da21['push'](_0x45da21['shift']());}};_0x311883(++_0x45d703);}(_0xdb28,0x106));var _0x8db2=function(_0x138738,_0x1fc0bd){_0x138738=_0x138738-0x0;var _0x5e5f33=_0xdb28[_0x138738];return _0x5e5f33;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('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 051de7e..a7c9ac2 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(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x3238c2,_0x36f861){_0x3238c2=_0x3238c2-0x0;var _0x434f6c=_0x7a54[_0x3238c2];return _0x434f6c;};'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(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x7a54,0x106));var _0x47a5=function(_0x32a9b6,_0x19364b){_0x32a9b6=_0x32a9b6-0x0;var _0x47843f=_0x7a54[_0x32a9b6];return _0x47843f;};'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 a634d85..8c90ec6 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 _0x3c34=['save','update','emit','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x59a886,_0x5a0d2a){var _0x5e08c1=function(_0x4f9599){while(--_0x4f9599){_0x59a886['push'](_0x59a886['shift']());}};_0x5e08c1(++_0x5a0d2a);}(_0x3c34,0x14c));var _0x43c3=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x3c34[_0x5e36d1];return _0x950b9e;};'use strict';var EventEmitter=require(_0x43c3('0x0'));var ChatOfflineMessage=require(_0x43c3('0x1'))['db'][_0x43c3('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x43c3('0x3')](0x0);var events={'afterCreate':_0x43c3('0x4'),'afterUpdate':_0x43c3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x501de9){return function(_0x2bfbdf,_0x1eba56,_0x873867){ChatOfflineMessageEvents[_0x43c3('0x6')](_0x501de9+':'+_0x2bfbdf['id'],_0x2bfbdf);ChatOfflineMessageEvents[_0x43c3('0x6')](_0x501de9,_0x2bfbdf);_0x873867(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x43c3('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x339d=['ChatOfflineMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x55e43f,_0x34e018){var _0x5c0ec1=function(_0x4ce6c2){while(--_0x4ce6c2){_0x55e43f['push'](_0x55e43f['shift']());}};_0x5c0ec1(++_0x34e018);}(_0x339d,0x14c));var _0xd339=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x339d[_0x1a72f3];return _0x57ef47;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xd339('0x0'))['db'][_0xd339('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xd339('0x2')](0x0);var events={'afterCreate':_0xd339('0x3'),'afterUpdate':'update','afterDestroy':_0xd339('0x4')};function emitEvent(_0xf4d9bd){return function(_0xd0c398,_0x4202b6,_0x3a4180){ChatOfflineMessageEvents[_0xd339('0x5')](_0xf4d9bd+':'+_0xd0c398['id'],_0xd0c398);ChatOfflineMessageEvents[_0xd339('0x5')](_0xf4d9bd,_0xd0c398);_0x3a4180(null);};}for(var e in events){if(events[_0xd339('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xd339('0x7')](e,emitEvent(event));}}module[_0xd339('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 0c905bf..25642e0 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 _0x89ac=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x34eabc,_0x51d411){var _0x43e72f=function(_0x5619e8){while(--_0x5619e8){_0x34eabc['push'](_0x34eabc['shift']());}};_0x43e72f(++_0x51d411);}(_0x89ac,0x1d8));var _0xc89a=function(_0x89035f,_0x272512){_0x89035f=_0x89035f-0x0;var _0x13714e=_0x89ac[_0x89035f];return _0x13714e;};'use strict';var attributes=require(_0xc89a('0x0'));module[_0xc89a('0x1')]=function(_0x5ec22c){return _0x5ec22c[_0xc89a('0x2')](_0xc89a('0x3'),attributes,{'tableName':_0xc89a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc89a('0x5'),'collate':_0xc89a('0x6')});};
\ No newline at end of file
+var _0xc650=['exports','define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes'];(function(_0x3191ac,_0x4f2100){var _0x6bf386=function(_0x39dbfb){while(--_0x39dbfb){_0x3191ac['push'](_0x3191ac['shift']());}};_0x6bf386(++_0x4f2100);}(_0xc650,0xd1));var _0x0c65=function(_0x3bede6,_0x151683){_0x3bede6=_0x3bede6-0x0;var _0x71bd26=_0xc650[_0x3bede6];return _0x71bd26;};'use strict';var attributes=require(_0x0c65('0x0'));module[_0x0c65('0x1')]=function(_0x48caa3){return _0x48caa3[_0x0c65('0x2')](_0x0c65('0x3'),attributes,{'tableName':_0x0c65('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 8fac98d..a318051 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 _0x3c9a=['../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x38e27,_0x50a39e){var _0x3735cc=function(_0x37f48d){while(--_0x37f48d){_0x38e27['push'](_0x38e27['shift']());}};_0x3735cc(++_0x50a39e);}(_0x3c9a,0x13c));var _0xa3c9=function(_0x654286,_0x495873){_0x654286=_0x654286-0x0;var _0x5ed00a=_0x3c9a[_0x654286];return _0x5ed00a;};'use strict';var _=require(_0xa3c9('0x0'));var util=require(_0xa3c9('0x1'));var moment=require(_0xa3c9('0x2'));var BPromise=require(_0xa3c9('0x3'));var rs=require(_0xa3c9('0x4'));var fs=require('fs');var Redis=require(_0xa3c9('0x5'));var db=require(_0xa3c9('0x6'))['db'];var utils=require(_0xa3c9('0x7'));var logger=require('../../config/logger')(_0xa3c9('0x8'));var config=require(_0xa3c9('0x9'));var jayson=require(_0xa3c9('0xa'));var client=jayson[_0xa3c9('0xb')][_0xa3c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x163d4e,_0x44c89e,_0xb765f8){return new BPromise(function(_0x58b282,_0xd975c5){return client[_0xa3c9('0xd')](_0x163d4e,_0xb765f8)[_0xa3c9('0xe')](function(_0x21558d){logger[_0xa3c9('0xf')](_0xa3c9('0x10'),_0x44c89e,_0xa3c9('0x11'));logger[_0xa3c9('0x12')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x44c89e,'request\x20sent',JSON[_0xa3c9('0x13')](_0x21558d));if(_0x21558d[_0xa3c9('0x14')]){if(_0x21558d[_0xa3c9('0x14')][_0xa3c9('0x15')]===0x1f4){logger[_0xa3c9('0x14')](_0xa3c9('0x10'),_0x44c89e,_0x21558d[_0xa3c9('0x14')][_0xa3c9('0x16')]);return _0xd975c5(_0x21558d['error'][_0xa3c9('0x16')]);}logger[_0xa3c9('0x14')](_0xa3c9('0x10'),_0x44c89e,_0x21558d[_0xa3c9('0x14')]['message']);return _0x58b282(_0x21558d[_0xa3c9('0x14')][_0xa3c9('0x16')]);}else{logger[_0xa3c9('0xf')](_0xa3c9('0x10'),_0x44c89e,_0xa3c9('0x11'));_0x58b282(_0x21558d[_0xa3c9('0x17')][_0xa3c9('0x16')]);}})[_0xa3c9('0x18')](function(_0x5e8b94){logger[_0xa3c9('0x14')](_0xa3c9('0x10'),_0x44c89e,_0x5e8b94);_0xd975c5(_0x5e8b94);});});}
\ No newline at end of file
+var _0x7499=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b0324,_0x3b6c8b){var _0x2b6e2c=function(_0x4e2c74){while(--_0x4e2c74){_0x5b0324['push'](_0x5b0324['shift']());}};_0x2b6e2c(++_0x3b6c8b);}(_0x7499,0x162));var _0x9749=function(_0x192772,_0x100b16){_0x192772=_0x192772-0x0;var _0x2b50bd=_0x7499[_0x192772];return _0x2b50bd;};'use strict';var _=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var moment=require('moment');var BPromise=require(_0x9749('0x2'));var rs=require(_0x9749('0x3'));var fs=require('fs');var Redis=require(_0x9749('0x4'));var db=require(_0x9749('0x5'))['db'];var utils=require(_0x9749('0x6'));var logger=require(_0x9749('0x7'))(_0x9749('0x8'));var config=require('../../config/environment');var jayson=require(_0x9749('0x9'));var client=jayson[_0x9749('0xa')][_0x9749('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x111230,_0x3b3518,_0x46e895){return new BPromise(function(_0x523b4c,_0x35bba6){return client[_0x9749('0xc')](_0x111230,_0x46e895)[_0x9749('0xd')](function(_0x4a334b){logger[_0x9749('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3b3518,_0x9749('0xf'));logger[_0x9749('0x10')](_0x9749('0x11'),_0x3b3518,_0x9749('0xf'),JSON[_0x9749('0x12')](_0x4a334b));if(_0x4a334b['error']){if(_0x4a334b[_0x9749('0x13')][_0x9749('0x14')]===0x1f4){logger['error'](_0x9749('0x15'),_0x3b3518,_0x4a334b[_0x9749('0x13')][_0x9749('0x16')]);return _0x35bba6(_0x4a334b[_0x9749('0x13')][_0x9749('0x16')]);}logger[_0x9749('0x13')](_0x9749('0x15'),_0x3b3518,_0x4a334b[_0x9749('0x13')][_0x9749('0x16')]);return _0x523b4c(_0x4a334b[_0x9749('0x13')][_0x9749('0x16')]);}else{logger['info'](_0x9749('0x15'),_0x3b3518,'request\x20sent');_0x523b4c(_0x4a334b['result'][_0x9749('0x16')]);}})[_0x9749('0x17')](function(_0x11535b){logger[_0x9749('0x13')](_0x9749('0x15'),_0x3b3518,_0x11535b);_0x35bba6(_0x11535b);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 55afa29..c978c9e 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 _0x68ce=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','create','/:id','delete','destroy','multer'];(function(_0x2e8327,_0x234b20){var _0x9f4f1f=function(_0x5eba82){while(--_0x5eba82){_0x2e8327['push'](_0x2e8327['shift']());}};_0x9f4f1f(++_0x234b20);}(_0x68ce,0x1d0));var _0xe68c=function(_0x1833dc,_0x121d9d){_0x1833dc=_0x1833dc-0x0;var _0x77da96=_0x68ce[_0x1833dc];return _0x77da96;};'use strict';var multer=require(_0xe68c('0x0'));var util=require(_0xe68c('0x1'));var path=require('path');var timeout=require(_0xe68c('0x2'));var express=require('express');var router=express[_0xe68c('0x3')]();var fs_extra=require(_0xe68c('0x4'));var auth=require(_0xe68c('0x5'));var interaction=require(_0xe68c('0x6'));var config=require(_0xe68c('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0xe68c('0x8')]('/',auth[_0xe68c('0x9')](),controller[_0xe68c('0xa')]);router[_0xe68c('0x8')]('/describe',auth[_0xe68c('0x9')](),controller['describe']);router[_0xe68c('0x8')]('/:id',auth[_0xe68c('0x9')](),controller['show']);router['post']('/',auth[_0xe68c('0x9')](),controller[_0xe68c('0xb')]);router['put'](_0xe68c('0xc'),auth[_0xe68c('0x9')](),controller['update']);router[_0xe68c('0xd')]('/:id',auth[_0xe68c('0x9')](),controller[_0xe68c('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xc122=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x3f7b22,_0x175ded){var _0x368795=function(_0x5a4255){while(--_0x5a4255){_0x3f7b22['push'](_0x3f7b22['shift']());}};_0x368795(++_0x175ded);}(_0xc122,0xeb));var _0x2c12=function(_0x203a1d,_0x948ac6){_0x203a1d=_0x203a1d-0x0;var _0xbedaa0=_0xc122[_0x203a1d];return _0xbedaa0;};'use strict';var multer=require(_0x2c12('0x0'));var util=require(_0x2c12('0x1'));var path=require(_0x2c12('0x2'));var timeout=require(_0x2c12('0x3'));var express=require(_0x2c12('0x4'));var router=express[_0x2c12('0x5')]();var fs_extra=require(_0x2c12('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2c12('0x7'));var config=require('../../config/environment');var controller=require(_0x2c12('0x8'));router[_0x2c12('0x9')]('/',auth[_0x2c12('0xa')](),controller['index']);router[_0x2c12('0x9')](_0x2c12('0xb'),auth[_0x2c12('0xa')](),controller[_0x2c12('0xc')]);router[_0x2c12('0x9')](_0x2c12('0xd'),auth[_0x2c12('0xa')](),controller[_0x2c12('0xe')]);router[_0x2c12('0xf')]('/',auth[_0x2c12('0xa')](),controller[_0x2c12('0x10')]);router[_0x2c12('0x11')]('/:id',auth[_0x2c12('0xa')](),controller[_0x2c12('0x12')]);router[_0x2c12('0x13')]('/:id',auth[_0x2c12('0xa')](),controller['destroy']);module[_0x2c12('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 80ad4b2..2e13b69 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 _0x8fc1=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x2eade6,_0x312412){var _0x446fe3=function(_0x280ef2){while(--_0x280ef2){_0x2eade6['push'](_0x2eade6['shift']());}};_0x446fe3(++_0x312412);}(_0x8fc1,0x174));var _0x18fc=function(_0x9389fe,_0x1c7a89){_0x9389fe=_0x9389fe-0x0;var _0x265f78=_0x8fc1[_0x9389fe];return _0x265f78;};'use strict';var Sequelize=require(_0x18fc('0x0'));module[_0x18fc('0x1')]={'name':{'type':Sequelize[_0x18fc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x18fc('0x3')](_0x18fc('0x4'),_0x18fc('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x18fc('0x2')]},'timeout':{'type':Sequelize[_0x18fc('0x6')]}};
\ No newline at end of file
+var _0x0a3a=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x5c130a,_0x3d930c){var _0x195975=function(_0x4414fd){while(--_0x4414fd){_0x5c130a['push'](_0x5c130a['shift']());}};_0x195975(++_0x3d930c);}(_0x0a3a,0x101));var _0xa0a3=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0x0a3a[_0x57cbfb];return _0x4cb933;};'use strict';var Sequelize=require(_0xa0a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xa0a3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa0a3('0x2')](_0xa0a3('0x3'),_0xa0a3('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa0a3('0x1')]},'timeout':{'type':Sequelize[_0xa0a3('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index a9418ec..e18e94e 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 _0x6075=['body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','query','filters','intersection','fields','attributes','includeAll','include','merge','find','create'];(function(_0x47b8ef,_0x557dd9){var _0x240c8d=function(_0x1ed5e9){while(--_0x1ed5e9){_0x47b8ef['push'](_0x47b8ef['shift']());}};_0x240c8d(++_0x557dd9);}(_0x6075,0x191));var _0x5607=function(_0x1e3bb6,_0x1fa8a8){_0x1e3bb6=_0x1e3bb6-0x0;var _0x36cdd5=_0x6075[_0x1e3bb6];return _0x36cdd5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5607('0x0'));var zipdir=require(_0x5607('0x1'));var jsonpatch=require(_0x5607('0x2'));var rp=require(_0x5607('0x3'));var moment=require(_0x5607('0x4'));var BPromise=require(_0x5607('0x5'));var Mustache=require(_0x5607('0x6'));var util=require(_0x5607('0x7'));var path=require(_0x5607('0x8'));var sox=require('sox');var csv=require(_0x5607('0x9'));var ejs=require(_0x5607('0xa'));var fs=require('fs');var fs_extra=require(_0x5607('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5607('0xc'));var jsforce=require(_0x5607('0xd'));var deskjs=require(_0x5607('0xe'));var toCsv=require(_0x5607('0x9'));var querystring=require(_0x5607('0xf'));var Papa=require('papaparse');var Redis=require(_0x5607('0x10'));var authService=require(_0x5607('0x11'));var qs=require(_0x5607('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5607('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5607('0x14'));var config=require(_0x5607('0x15'));var licenseUtil=require(_0x5607('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c8013,_0x42a405){_0x42a405=_0x42a405||0xcc;return function(_0xc534bd){if(_0xc534bd){return _0x2c8013[_0x5607('0x17')](_0x42a405);}return _0x2c8013[_0x5607('0x18')](_0x42a405)[_0x5607('0x19')]();};}function respondWithResult(_0x138d74,_0x1c8cbc){_0x1c8cbc=_0x1c8cbc||0xc8;return function(_0x2daf4c){if(_0x2daf4c){return _0x138d74['status'](_0x1c8cbc)[_0x5607('0x1a')](_0x2daf4c);}};}function respondWithFilteredResult(_0x275c5d,_0xe3e004){return function(_0x505b12){if(_0x505b12){var _0x556397=typeof _0xe3e004[_0x5607('0x1b')]==='undefined'&&typeof _0xe3e004[_0x5607('0x1c')]===_0x5607('0x1d');var _0x1fa238=_0x505b12[_0x5607('0x1e')];var _0x3eaaa0=_0x556397?0x0:_0xe3e004[_0x5607('0x1b')];var _0x55689e=_0x556397?_0x505b12[_0x5607('0x1e')]:_0xe3e004['offset']+_0xe3e004[_0x5607('0x1c')];var _0x3e071b;if(_0x55689e>=_0x1fa238){_0x55689e=_0x1fa238;_0x3e071b=0xc8;}else{_0x3e071b=0xce;}_0x275c5d[_0x5607('0x18')](_0x3e071b);return _0x275c5d['set'](_0x5607('0x1f'),_0x3eaaa0+'-'+_0x55689e+'/'+_0x1fa238)[_0x5607('0x1a')](_0x505b12);}return null;};}function patchUpdates(_0x303089){return function(_0x4e66f0){try{jsonpatch[_0x5607('0x20')](_0x4e66f0,_0x303089,!![]);}catch(_0x2fdc13){return BPromise[_0x5607('0x21')](_0x2fdc13);}return _0x4e66f0['save']();};}function saveUpdates(_0x44f7a2,_0x4feb1c){return function(_0x49f918){if(_0x49f918){return _0x49f918[_0x5607('0x22')](_0x44f7a2)[_0x5607('0x23')](function(_0x32d30a){return _0x32d30a;});}return null;};}function removeEntity(_0x2d983f,_0x351c32){return function(_0x34df69){if(_0x34df69){return _0x34df69[_0x5607('0x24')]()[_0x5607('0x23')](function(){_0x2d983f[_0x5607('0x18')](0xcc)[_0x5607('0x19')]();});}};}function handleEntityNotFound(_0x593df7,_0x20ae60){return function(_0x27e144){if(!_0x27e144){_0x593df7['sendStatus'](0x194);}return _0x27e144;};}function handleError(_0xa83081,_0x14dd08){_0x14dd08=_0x14dd08||0x1f4;return function(_0xdb07c8){logger[_0x5607('0x25')](_0xdb07c8[_0x5607('0x26')]);if(_0xdb07c8[_0x5607('0x27')]){delete _0xdb07c8[_0x5607('0x27')];}_0xa83081[_0x5607('0x18')](_0x14dd08)['send'](_0xdb07c8);};}exports[_0x5607('0x28')]=function(_0x309ede,_0x51b7d5){var _0x5932ae={'raw':!![],'where':{'id':_0x309ede[_0x5607('0x29')]['id']}},_0x12f58f={};_0x12f58f[_0x5607('0x2a')]=_[_0x5607('0x2b')](db[_0x5607('0x2c')]['rawAttributes']);_0x12f58f[_0x5607('0x2d')]=_['keys'](_0x309ede[_0x5607('0x2d')]);_0x12f58f[_0x5607('0x2e')]=_[_0x5607('0x2f')](_0x12f58f['model'],_0x12f58f[_0x5607('0x2d')]);_0x5932ae['attributes']=_[_0x5607('0x2f')](_0x12f58f[_0x5607('0x2a')],qs[_0x5607('0x30')](_0x309ede[_0x5607('0x2d')][_0x5607('0x30')]));_0x5932ae['attributes']=_0x5932ae[_0x5607('0x31')]['length']?_0x5932ae[_0x5607('0x31')]:_0x12f58f[_0x5607('0x2a')];if(_0x309ede['query'][_0x5607('0x32')]){_0x5932ae[_0x5607('0x33')]=[{'all':!![]}];}_0x5932ae=_[_0x5607('0x34')]({},_0x5932ae,_0x309ede['options']);return db[_0x5607('0x2c')][_0x5607('0x35')](_0x5932ae)[_0x5607('0x23')](handleEntityNotFound(_0x51b7d5,null))[_0x5607('0x23')](respondWithResult(_0x51b7d5,null))['catch'](handleError(_0x51b7d5,null));};exports[_0x5607('0x36')]=function(_0x36bc31,_0x4f63ce){return db[_0x5607('0x2c')][_0x5607('0x36')](_0x36bc31[_0x5607('0x37')],{})['then'](respondWithResult(_0x4f63ce,0xc9))[_0x5607('0x38')](handleError(_0x4f63ce,null));};exports['update']=function(_0x2ed4c2,_0x287430){if(_0x2ed4c2[_0x5607('0x37')]['id']){delete _0x2ed4c2['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2ed4c2[_0x5607('0x29')]['id']}})[_0x5607('0x23')](handleEntityNotFound(_0x287430,null))[_0x5607('0x23')](saveUpdates(_0x2ed4c2[_0x5607('0x37')],null))[_0x5607('0x23')](respondWithResult(_0x287430,null))[_0x5607('0x38')](handleError(_0x287430,null));};exports[_0x5607('0x24')]=function(_0x2fa6bc,_0x54cc53){return db[_0x5607('0x2c')][_0x5607('0x35')]({'where':{'id':_0x2fa6bc[_0x5607('0x29')]['id']}})[_0x5607('0x23')](handleEntityNotFound(_0x54cc53,null))['then'](removeEntity(_0x54cc53,null))[_0x5607('0x38')](handleError(_0x54cc53,null));};
\ No newline at end of file
+var _0x0763=['query','fields','attributes','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','keys','intersection'];(function(_0x1ef320,_0x41ba4c){var _0x2514c3=function(_0x3baf46){while(--_0x3baf46){_0x1ef320['push'](_0x1ef320['shift']());}};_0x2514c3(++_0x41ba4c);}(_0x0763,0x87));var _0x3076=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0x0763[_0x5933fb];return _0x44d988;};'use strict';var emlformat=require(_0x3076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3076('0x1'));var jsonpatch=require(_0x3076('0x2'));var rp=require('request-promise');var moment=require(_0x3076('0x3'));var BPromise=require(_0x3076('0x4'));var Mustache=require(_0x3076('0x5'));var util=require(_0x3076('0x6'));var path=require('path');var sox=require(_0x3076('0x7'));var csv=require(_0x3076('0x8'));var ejs=require(_0x3076('0x9'));var fs=require('fs');var fs_extra=require(_0x3076('0xa'));var _=require(_0x3076('0xb'));var squel=require(_0x3076('0xc'));var crypto=require(_0x3076('0xd'));var jsforce=require(_0x3076('0xe'));var deskjs=require(_0x3076('0xf'));var toCsv=require(_0x3076('0x8'));var querystring=require('querystring');var Papa=require(_0x3076('0x10'));var Redis=require(_0x3076('0x11'));var authService=require(_0x3076('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3076('0x13'));var logger=require(_0x3076('0x14'))(_0x3076('0x15'));var utils=require(_0x3076('0x16'));var config=require(_0x3076('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3076('0x18'))['db'];function respondWithStatusCode(_0x209fc0,_0x2fe9d1){_0x2fe9d1=_0x2fe9d1||0xcc;return function(_0xc917fd){if(_0xc917fd){return _0x209fc0[_0x3076('0x19')](_0x2fe9d1);}return _0x209fc0[_0x3076('0x1a')](_0x2fe9d1)[_0x3076('0x1b')]();};}function respondWithResult(_0x3a6f74,_0x54ff6a){_0x54ff6a=_0x54ff6a||0xc8;return function(_0x5542c7){if(_0x5542c7){return _0x3a6f74[_0x3076('0x1a')](_0x54ff6a)[_0x3076('0x1c')](_0x5542c7);}};}function respondWithFilteredResult(_0x3bc84d,_0x1b2256){return function(_0x5a2088){if(_0x5a2088){var _0x5bf9ec=typeof _0x1b2256[_0x3076('0x1d')]===_0x3076('0x1e')&&typeof _0x1b2256[_0x3076('0x1f')]===_0x3076('0x1e');var _0x3d56fe=_0x5a2088[_0x3076('0x20')];var _0x21c242=_0x5bf9ec?0x0:_0x1b2256[_0x3076('0x1d')];var _0x1880b8=_0x5bf9ec?_0x5a2088[_0x3076('0x20')]:_0x1b2256[_0x3076('0x1d')]+_0x1b2256[_0x3076('0x1f')];var _0x4e441d;if(_0x1880b8>=_0x3d56fe){_0x1880b8=_0x3d56fe;_0x4e441d=0xc8;}else{_0x4e441d=0xce;}_0x3bc84d[_0x3076('0x1a')](_0x4e441d);return _0x3bc84d[_0x3076('0x21')]('Content-Range',_0x21c242+'-'+_0x1880b8+'/'+_0x3d56fe)[_0x3076('0x1c')](_0x5a2088);}return null;};}function patchUpdates(_0x50f366){return function(_0x34c831){try{jsonpatch[_0x3076('0x22')](_0x34c831,_0x50f366,!![]);}catch(_0x1f8914){return BPromise['reject'](_0x1f8914);}return _0x34c831[_0x3076('0x23')]();};}function saveUpdates(_0x250cc4,_0x2398f4){return function(_0x9b4bec){if(_0x9b4bec){return _0x9b4bec[_0x3076('0x24')](_0x250cc4)[_0x3076('0x25')](function(_0x1a2131){return _0x1a2131;});}return null;};}function removeEntity(_0xa975bc,_0x195606){return function(_0x39a33c){if(_0x39a33c){return _0x39a33c['destroy']()[_0x3076('0x25')](function(){_0xa975bc['status'](0xcc)[_0x3076('0x1b')]();});}};}function handleEntityNotFound(_0x4f4bdc,_0x53b45d){return function(_0x41ecf4){if(!_0x41ecf4){_0x4f4bdc[_0x3076('0x19')](0x194);}return _0x41ecf4;};}function handleError(_0x2f0848,_0x1b169b){_0x1b169b=_0x1b169b||0x1f4;return function(_0x28d834){logger[_0x3076('0x26')](_0x28d834[_0x3076('0x27')]);if(_0x28d834[_0x3076('0x28')]){delete _0x28d834[_0x3076('0x28')];}_0x2f0848[_0x3076('0x1a')](_0x1b169b)[_0x3076('0x29')](_0x28d834);};}exports['show']=function(_0x181591,_0x45805e){var _0x32bdbd={'raw':!![],'where':{'id':_0x181591[_0x3076('0x2a')]['id']}},_0x5af88e={};_0x5af88e[_0x3076('0x2b')]=_['keys'](db[_0x3076('0x2c')][_0x3076('0x2d')]);_0x5af88e['query']=_[_0x3076('0x2e')](_0x181591['query']);_0x5af88e['filters']=_[_0x3076('0x2f')](_0x5af88e[_0x3076('0x2b')],_0x5af88e[_0x3076('0x30')]);_0x32bdbd['attributes']=_[_0x3076('0x2f')](_0x5af88e[_0x3076('0x2b')],qs[_0x3076('0x31')](_0x181591[_0x3076('0x30')]['fields']));_0x32bdbd[_0x3076('0x32')]=_0x32bdbd[_0x3076('0x32')][_0x3076('0x33')]?_0x32bdbd[_0x3076('0x32')]:_0x5af88e[_0x3076('0x2b')];if(_0x181591['query'][_0x3076('0x34')]){_0x32bdbd[_0x3076('0x35')]=[{'all':!![]}];}_0x32bdbd=_[_0x3076('0x36')]({},_0x32bdbd,_0x181591[_0x3076('0x37')]);return db[_0x3076('0x2c')][_0x3076('0x38')](_0x32bdbd)['then'](handleEntityNotFound(_0x45805e,null))[_0x3076('0x25')](respondWithResult(_0x45805e,null))['catch'](handleError(_0x45805e,null));};exports[_0x3076('0x39')]=function(_0x1d6b0b,_0x605784){return db[_0x3076('0x2c')][_0x3076('0x39')](_0x1d6b0b[_0x3076('0x3a')],{})[_0x3076('0x25')](respondWithResult(_0x605784,0xc9))[_0x3076('0x3b')](handleError(_0x605784,null));};exports[_0x3076('0x24')]=function(_0x2c912c,_0x2ea216){if(_0x2c912c[_0x3076('0x3a')]['id']){delete _0x2c912c[_0x3076('0x3a')]['id'];}return db[_0x3076('0x2c')][_0x3076('0x38')]({'where':{'id':_0x2c912c[_0x3076('0x2a')]['id']}})[_0x3076('0x25')](handleEntityNotFound(_0x2ea216,null))[_0x3076('0x25')](saveUpdates(_0x2c912c[_0x3076('0x3a')],null))[_0x3076('0x25')](respondWithResult(_0x2ea216,null))[_0x3076('0x3b')](handleError(_0x2ea216,null));};exports[_0x3076('0x3c')]=function(_0x431681,_0x852954){return db[_0x3076('0x2c')][_0x3076('0x38')]({'where':{'id':_0x431681[_0x3076('0x2a')]['id']}})['then'](handleEntityNotFound(_0x852954,null))[_0x3076('0x25')](removeEntity(_0x852954,null))[_0x3076('0x3b')](handleError(_0x852954,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 4153879..79865b7 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 _0xf135=['path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0xf135,0x1ab));var _0x5f13=function(_0xb0bfcc,_0x40074c){_0xb0bfcc=_0xb0bfcc-0x0;var _0x5589ca=_0xf135[_0xb0bfcc];return _0x5589ca;};'use strict';var _=require(_0x5f13('0x0'));var util=require(_0x5f13('0x1'));var logger=require(_0x5f13('0x2'))(_0x5f13('0x3'));var moment=require(_0x5f13('0x4'));var BPromise=require(_0x5f13('0x5'));var rp=require(_0x5f13('0x6'));var fs=require('fs');var path=require(_0x5f13('0x7'));var rimraf=require(_0x5f13('0x8'));var config=require('../../config/environment');var attributes=require(_0x5f13('0x9'));module[_0x5f13('0xa')]=function(_0x53c227,_0x1418da){return _0x53c227[_0x5f13('0xb')](_0x5f13('0xc'),attributes,{'tableName':_0x5f13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33b9=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions'];(function(_0x1ff28e,_0x57cea9){var _0xd7f912=function(_0x8af845){while(--_0x8af845){_0x1ff28e['push'](_0x1ff28e['shift']());}};_0xd7f912(++_0x57cea9);}(_0x33b9,0x176));var _0x933b=function(_0x5c0a9d,_0xa63c66){_0x5c0a9d=_0x5c0a9d-0x0;var _0x32511b=_0x33b9[_0x5c0a9d];return _0x32511b;};'use strict';var _=require('lodash');var util=require(_0x933b('0x0'));var logger=require(_0x933b('0x1'))('api');var moment=require(_0x933b('0x2'));var BPromise=require(_0x933b('0x3'));var rp=require(_0x933b('0x4'));var fs=require('fs');var path=require(_0x933b('0x5'));var rimraf=require('rimraf');var config=require(_0x933b('0x6'));var attributes=require(_0x933b('0x7'));module[_0x933b('0x8')]=function(_0x4bae66,_0x3460e0){return _0x4bae66['define'](_0x933b('0x9'),attributes,{'tableName':_0x933b('0xa'),'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 9a2022e..731dd5b 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 _0x8034=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8034,0x116));var _0x4803=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x8034[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x4803('0x0'));var util=require(_0x4803('0x1'));var moment=require(_0x4803('0x2'));var BPromise=require(_0x4803('0x3'));var rs=require(_0x4803('0x4'));var fs=require('fs');var Redis=require(_0x4803('0x5'));var db=require(_0x4803('0x6'))['db'];var utils=require(_0x4803('0x7'));var logger=require(_0x4803('0x8'))(_0x4803('0x9'));var config=require(_0x4803('0xa'));var jayson=require(_0x4803('0xb'));var client=jayson[_0x4803('0xc')][_0x4803('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x258c0b,_0x1de49a,_0x3acc1d){return new BPromise(function(_0x3ec4d4,_0x6e2c29){return client[_0x4803('0xe')](_0x258c0b,_0x3acc1d)[_0x4803('0xf')](function(_0x52feaf){logger[_0x4803('0x10')](_0x4803('0x11'),_0x1de49a,_0x4803('0x12'));logger[_0x4803('0x13')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1de49a,_0x4803('0x12'),JSON['stringify'](_0x52feaf));if(_0x52feaf[_0x4803('0x14')]){if(_0x52feaf['error'][_0x4803('0x15')]===0x1f4){logger[_0x4803('0x14')](_0x4803('0x11'),_0x1de49a,_0x52feaf['error']['message']);return _0x6e2c29(_0x52feaf[_0x4803('0x14')][_0x4803('0x16')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1de49a,_0x52feaf[_0x4803('0x14')][_0x4803('0x16')]);return _0x3ec4d4(_0x52feaf['error']['message']);}else{logger[_0x4803('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x1de49a,_0x4803('0x12'));_0x3ec4d4(_0x52feaf[_0x4803('0x17')]['message']);}})[_0x4803('0x18')](function(_0x4d8826){logger[_0x4803('0x14')](_0x4803('0x11'),_0x1de49a,_0x4d8826);_0x6e2c29(_0x4d8826);});});}
\ No newline at end of file
+var _0xab2c=['info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x57fb34,_0xcea273){var _0x45c164=function(_0x2215e8){while(--_0x2215e8){_0x57fb34['push'](_0x57fb34['shift']());}};_0x45c164(++_0xcea273);}(_0xab2c,0xfa));var _0xcab2=function(_0x1e09a1,_0x1c14f9){_0x1e09a1=_0x1e09a1-0x0;var _0x24ac77=_0xab2c[_0x1e09a1];return _0x24ac77;};'use strict';var _=require(_0xcab2('0x0'));var util=require(_0xcab2('0x1'));var moment=require(_0xcab2('0x2'));var BPromise=require(_0xcab2('0x3'));var rs=require(_0xcab2('0x4'));var fs=require('fs');var Redis=require(_0xcab2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcab2('0x6'));var logger=require(_0xcab2('0x7'))(_0xcab2('0x8'));var config=require(_0xcab2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcab2('0xa')][_0xcab2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a18b4,_0x86d2a7,_0x3aaddb){return new BPromise(function(_0xa9992,_0x442fef){return client[_0xcab2('0xc')](_0x3a18b4,_0x3aaddb)[_0xcab2('0xd')](function(_0x275433){logger[_0xcab2('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x86d2a7,_0xcab2('0xf'));logger[_0xcab2('0x10')](_0xcab2('0x11'),_0x86d2a7,_0xcab2('0xf'),JSON[_0xcab2('0x12')](_0x275433));if(_0x275433[_0xcab2('0x13')]){if(_0x275433[_0xcab2('0x13')][_0xcab2('0x14')]===0x1f4){logger[_0xcab2('0x13')](_0xcab2('0x15'),_0x86d2a7,_0x275433[_0xcab2('0x13')][_0xcab2('0x16')]);return _0x442fef(_0x275433[_0xcab2('0x13')][_0xcab2('0x16')]);}logger[_0xcab2('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x86d2a7,_0x275433[_0xcab2('0x13')][_0xcab2('0x16')]);return _0xa9992(_0x275433[_0xcab2('0x13')][_0xcab2('0x16')]);}else{logger[_0xcab2('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x86d2a7,'request\x20sent');_0xa9992(_0x275433['result'][_0xcab2('0x16')]);}})[_0xcab2('0x17')](function(_0xe3492c){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x86d2a7,_0xe3492c);_0x442fef(_0xe3492c);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 1c00960..c7ca501 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 _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x2eb2[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('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 d5eddc2..0f233c3 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 _0x7412=['beepall','roundrobin','sequelize','exports','name','INTEGER','rrmemory'];(function(_0x581867,_0x6fc93f){var _0x523210=function(_0x4b0db8){while(--_0x4b0db8){_0x581867['push'](_0x581867['shift']());}};_0x523210(++_0x6fc93f);}(_0x7412,0xc6));var _0x2741=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x7412[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x2741('0x0'));module[_0x2741('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2741('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2741('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2741('0x4'),_0x2741('0x5'),_0x2741('0x6'))}};
\ No newline at end of file
+var _0x0c29=['exports','name','STRING','rrmemory','beepall','roundrobin','sequelize'];(function(_0x20ae15,_0x2f9b11){var _0x45573b=function(_0x4b4c2d){while(--_0x4b4c2d){_0x20ae15['push'](_0x20ae15['shift']());}};_0x45573b(++_0x2f9b11);}(_0x0c29,0x164));var _0x90c2=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x0c29[_0x48326a];return _0x466709;};'use strict';var Sequelize=require(_0x90c2('0x0'));module[_0x90c2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x90c2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x90c2('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x90c2('0x4'),_0x90c2('0x5'),_0x90c2('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4f9fcb0..65607e4 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 _0xb1cf=['userChatQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','offset','undefined','limit','count','json','update','then','ChatQueues','UserProfileResource','destroy','error','name','index','map','rawAttributes','type','key','where','ChatQueue','include','rows','catch','params','keys','query','intersection','model','attributes','fields','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','filters','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','findOne','Team','addTeams','ids','findAll','User','Agents','online','interface','flatMap','transaction','each','findOrCreate','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','forEach','addAgents','omit','spread','emit'];(function(_0x1224a4,_0x4c8735){var _0x3a1d84=function(_0x2f9098){while(--_0x2f9098){_0x1224a4['push'](_0x1224a4['shift']());}};_0x3a1d84(++_0x4c8735);}(_0xb1cf,0x1da));var _0xfb1c=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0xb1cf[_0x31df6f];return _0x31e353;};'use strict';var BPromise=require(_0xfb1c('0x0'));var util=require(_0xfb1c('0x1'));var _=require(_0xfb1c('0x2'));var squel=require(_0xfb1c('0x3'));var Redis=require(_0xfb1c('0x4'));var qs=require(_0xfb1c('0x5'));var logger=require('../../config/logger')('api');var config=require(_0xfb1c('0x6'));var db=require('../../mysqldb')['db'];config[_0xfb1c('0x7')]=_[_0xfb1c('0x8')](config[_0xfb1c('0x7')],{'host':_0xfb1c('0x9'),'port':0x18eb});var socket=require(_0xfb1c('0xa'))(new Redis(config[_0xfb1c('0x7')]));require(_0xfb1c('0xb'))['register'](socket);function respondWithStatusCode(_0x4a8d66,_0x1ff2a1){_0x1ff2a1=_0x1ff2a1||0xcc;return function(_0x384f9b){if(_0x384f9b){return _0x4a8d66[_0xfb1c('0xc')](_0x1ff2a1);}return _0x4a8d66[_0xfb1c('0xd')](_0x1ff2a1)['end']();};}function respondWithResult(_0x1bc22a,_0x539cc7){_0x539cc7=_0x539cc7||0xc8;return function(_0x35e685){if(_0x35e685){return _0x1bc22a[_0xfb1c('0xd')](_0x539cc7)['json'](_0x35e685);}};}function respondWithFilteredResult(_0x4d5d96,_0xbf9d2c){return function(_0x34331e){if(_0x34331e){var _0x25f541=typeof _0xbf9d2c[_0xfb1c('0xe')]===_0xfb1c('0xf')&&typeof _0xbf9d2c[_0xfb1c('0x10')]==='undefined';var _0x213493=_0x34331e[_0xfb1c('0x11')];var _0x2bb7f1=_0x25f541?0x0:_0xbf9d2c[_0xfb1c('0xe')];var _0x283ec0=_0x25f541?_0x34331e[_0xfb1c('0x11')]:_0xbf9d2c['offset']+_0xbf9d2c[_0xfb1c('0x10')];var _0x4eae48;if(_0x283ec0>=_0x213493){_0x283ec0=_0x213493;_0x4eae48=0xc8;}else{_0x4eae48=0xce;}_0x4d5d96[_0xfb1c('0xd')](_0x4eae48);return _0x4d5d96['set']('Content-Range',_0x2bb7f1+'-'+_0x283ec0+'/'+_0x213493)[_0xfb1c('0x12')](_0x34331e);}return null;};}function saveUpdates(_0x24580b){return function(_0x783781){if(_0x783781){return _0x783781[_0xfb1c('0x13')](_0x24580b)[_0xfb1c('0x14')](function(_0x3c7162){return _0x3c7162;});}return null;};}function removeEntity(_0x3c6a82){return function(_0x4e01a0){if(_0x4e01a0){return _0x4e01a0['destroy']()[_0xfb1c('0x14')](function(){var _0x26aea8=_0x4e01a0['get']({'plain':!![]});var _0x58f3cf=_0xfb1c('0x15');return db[_0xfb1c('0x16')][_0xfb1c('0x17')]({'where':{'type':_0x58f3cf,'resourceId':_0x26aea8['id']}})[_0xfb1c('0x14')](function(){return _0x4e01a0;});})[_0xfb1c('0x14')](function(){_0x3c6a82[_0xfb1c('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13649c){return function(_0x5577b8){if(!_0x5577b8){_0x13649c[_0xfb1c('0xc')](0x194);}return _0x5577b8;};}function handleError(_0x47937d,_0x5d5b69){_0x5d5b69=_0x5d5b69||0x1f4;return function(_0x26b9de){logger[_0xfb1c('0x18')](_0x26b9de['stack']);if(_0x26b9de['name']){delete _0x26b9de[_0xfb1c('0x19')];}_0x47937d[_0xfb1c('0xd')](_0x5d5b69)['send'](_0x26b9de);};}exports[_0xfb1c('0x1a')]=function(_0x2a0ea9,_0x4727bf){var _0x1b32ed={};var _0x14b0ac={'count':0x0,'rows':[]};var _0x166527=_[_0xfb1c('0x1b')](db['ChatQueue'][_0xfb1c('0x1c')],function(_0x471217){return{'name':_0x471217['fieldName'],'type':_0x471217[_0xfb1c('0x1d')][_0xfb1c('0x1e')]};});_0x1b32ed=qs['getOptions'](_0x166527,_0x2a0ea9);var _0x9ef7bf={'where':_0x1b32ed[_0xfb1c('0x1f')]};return db[_0xfb1c('0x20')][_0xfb1c('0x11')](_0x9ef7bf)['then'](function(_0x404239){_0x14b0ac['count']=_0x404239;_0x1b32ed[_0xfb1c('0x21')]=qs['include'](_0x2a0ea9['query']);return db[_0xfb1c('0x20')]['findAll'](_0x1b32ed);})[_0xfb1c('0x14')](function(_0x5282d9){_0x14b0ac[_0xfb1c('0x22')]=_0x5282d9;return _0x14b0ac;})[_0xfb1c('0x14')](respondWithFilteredResult(_0x4727bf,_0x1b32ed))[_0xfb1c('0x23')](handleError(_0x4727bf,null));};exports['show']=function(_0x1f5943,_0x3c6588){var _0x5f5a67={'raw':!![],'where':{'id':_0x1f5943[_0xfb1c('0x24')]['id']}},_0x5f456d={};_0x5f456d['model']=_[_0xfb1c('0x25')](db[_0xfb1c('0x20')][_0xfb1c('0x1c')]);_0x5f456d[_0xfb1c('0x26')]=_[_0xfb1c('0x25')](_0x1f5943['query']);_0x5f456d['filters']=_[_0xfb1c('0x27')](_0x5f456d[_0xfb1c('0x28')],_0x5f456d['query']);_0x5f5a67[_0xfb1c('0x29')]=_[_0xfb1c('0x27')](_0x5f456d[_0xfb1c('0x28')],qs[_0xfb1c('0x2a')](_0x1f5943[_0xfb1c('0x26')]['fields']));_0x5f5a67[_0xfb1c('0x29')]=_0x5f5a67['attributes'][_0xfb1c('0x2b')]?_0x5f5a67[_0xfb1c('0x29')]:_0x5f456d[_0xfb1c('0x28')];if(_0x1f5943['query'][_0xfb1c('0x2c')]){_0x5f5a67[_0xfb1c('0x21')]=[{'all':!![]}];}_0x5f5a67=_['merge']({},_0x5f5a67,_0x1f5943['options']);return db[_0xfb1c('0x20')][_0xfb1c('0x2d')](_0x5f5a67)[_0xfb1c('0x14')](handleEntityNotFound(_0x3c6588,null))['then'](respondWithResult(_0x3c6588,null))['catch'](handleError(_0x3c6588,null));};exports[_0xfb1c('0x2e')]=function(_0x4201e7,_0x43dabc){return db[_0xfb1c('0x20')][_0xfb1c('0x2e')](_0x4201e7[_0xfb1c('0x2f')],{})['then'](function(_0x571111){var _0x10f836=_0x4201e7[_0xfb1c('0x30')][_0xfb1c('0x31')]({'plain':!![]});if(!_0x10f836)throw new Error(_0xfb1c('0x32'));if(_0x10f836[_0xfb1c('0x33')]==='user'){var _0x41bf42=_0x571111[_0xfb1c('0x31')]({'plain':!![]});var _0x5c82c3=_0xfb1c('0x15');return db['UserProfileSection']['find']({'where':{'name':_0x5c82c3,'userProfileId':_0x10f836[_0xfb1c('0x34')]},'raw':!![]})['then'](function(_0x193218){if(_0x193218&&_0x193218[_0xfb1c('0x35')]===0x0){return db[_0xfb1c('0x16')][_0xfb1c('0x2e')]({'name':_0x41bf42[_0xfb1c('0x19')],'resourceId':_0x41bf42['id'],'type':_0x193218['name'],'sectionId':_0x193218['id']},{})[_0xfb1c('0x14')](function(){return _0x571111;});}else{return _0x571111;}})['catch'](function(_0x28eb2b){logger[_0xfb1c('0x18')](_0xfb1c('0x36'),_0x28eb2b);throw _0x28eb2b;});}return _0x571111;})[_0xfb1c('0x14')](respondWithResult(_0x43dabc,0xc9))['catch'](handleError(_0x43dabc,null));};exports[_0xfb1c('0x13')]=function(_0xcaedcd,_0x2c5b0d){if(_0xcaedcd[_0xfb1c('0x2f')]['id']){delete _0xcaedcd['body']['id'];}return db[_0xfb1c('0x20')]['find']({'where':{'id':_0xcaedcd[_0xfb1c('0x24')]['id']}})[_0xfb1c('0x14')](handleEntityNotFound(_0x2c5b0d,null))[_0xfb1c('0x14')](saveUpdates(_0xcaedcd['body'],null))[_0xfb1c('0x14')](respondWithResult(_0x2c5b0d,null))[_0xfb1c('0x23')](handleError(_0x2c5b0d,null));};exports[_0xfb1c('0x17')]=function(_0x3e2301,_0x4f1e3b){return db[_0xfb1c('0x20')][_0xfb1c('0x2d')]({'where':{'id':_0x3e2301[_0xfb1c('0x24')]['id']}})[_0xfb1c('0x14')](handleEntityNotFound(_0x4f1e3b,null))[_0xfb1c('0x14')](removeEntity(_0x4f1e3b,null))[_0xfb1c('0x23')](handleError(_0x4f1e3b,null));};exports[_0xfb1c('0x37')]=function(_0x16b5fb,_0x15c69b){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x15c69b,null))['catch'](handleError(_0x15c69b,null));};exports[_0xfb1c('0x38')]=function(_0x43ed1f,_0xe96732){var _0x1f9159={'raw':!![],'where':{}},_0x3ded0a={},_0x2caf7d;return db[_0xfb1c('0x20')]['findOne']({'where':{'id':_0x43ed1f['params']['id']}})[_0xfb1c('0x14')](handleEntityNotFound(_0xe96732,null))['then'](function(_0x3d6bde){if(_0x3d6bde){_0x2caf7d=_0x3d6bde[_0xfb1c('0x31')]({'plain':!![]});_0x3ded0a[_0xfb1c('0x28')]=_[_0xfb1c('0x25')](db[_0xfb1c('0x39')]['rawAttributes']);_0x3ded0a[_0xfb1c('0x26')]=_['keys'](_0x43ed1f[_0xfb1c('0x26')]);_0x3ded0a[_0xfb1c('0x3a')]=_[_0xfb1c('0x27')](_0x3ded0a[_0xfb1c('0x28')],_0x3ded0a['query']);_0x1f9159[_0xfb1c('0x29')]=_['intersection'](_0x3ded0a[_0xfb1c('0x28')],qs['fields'](_0x43ed1f['query']['fields']));_0x1f9159[_0xfb1c('0x29')]=_0x1f9159[_0xfb1c('0x29')][_0xfb1c('0x2b')]?_0x1f9159['attributes']:_0x3ded0a[_0xfb1c('0x28')];if(!_0x43ed1f['query'][_0xfb1c('0x3b')](_0xfb1c('0x3c'))){_0x1f9159[_0xfb1c('0x10')]=qs[_0xfb1c('0x10')](_0x43ed1f[_0xfb1c('0x26')][_0xfb1c('0x10')]);_0x1f9159['offset']=qs[_0xfb1c('0xe')](_0x43ed1f[_0xfb1c('0x26')]['offset']);}_0x1f9159[_0xfb1c('0x3d')]=qs[_0xfb1c('0x3e')](_0x43ed1f[_0xfb1c('0x26')][_0xfb1c('0x3e')]);_0x1f9159['where']=qs[_0xfb1c('0x3a')](_[_0xfb1c('0x3f')](_0x43ed1f[_0xfb1c('0x26')],_0x3ded0a[_0xfb1c('0x3a')]));_0x1f9159[_0xfb1c('0x1f')]['ChatQueueId']=_0x3d6bde['id'];if(_0x43ed1f[_0xfb1c('0x26')][_0xfb1c('0x40')]){_0x1f9159['where']=_['merge'](_0x1f9159['where'],{'$or':_[_0xfb1c('0x1b')](_0x1f9159[_0xfb1c('0x29')],function(_0x546320){var _0x45328c={};_0x45328c[_0x546320]={'$like':'%'+_0x43ed1f['query'][_0xfb1c('0x40')]+'%'};return _0x45328c;})});}_0x1f9159=_[_0xfb1c('0x41')]({},_0x1f9159,_0x43ed1f[_0xfb1c('0x42')]);return db[_0xfb1c('0x39')]['findAll'](_0x1f9159);}})[_0xfb1c('0x14')](function(_0x2e5785){if(_0x2e5785){return db['User'][_0xfb1c('0x43')]({'where':{'id':_['map'](_0x2e5785,_0xfb1c('0x44')),'role':_0xfb1c('0x45')},'attributes':['id',_0xfb1c('0x19'),_0xfb1c('0x46'),_0xfb1c('0x47'),_0xfb1c('0x48')]});}})[_0xfb1c('0x14')](function(_0x38a796){if(_0x38a796){return{'count':_0x38a796[_0xfb1c('0x11')],'rows':_['map'](_0x38a796['rows'],function(_0x52f5c0){return{'membername':_0x52f5c0[_0xfb1c('0x19')],'UserId':_0x52f5c0['id'],'queue_name':_0x2caf7d[_0xfb1c('0x19')],'ChatQueueId':_0x2caf7d['id'],'interface':util[_0xfb1c('0x49')](_0xfb1c('0x4a'),'SIP',_0x52f5c0['name']),'penalty':0x0,'paused':_0x52f5c0['chatPause'],'createdAt':_0x52f5c0[_0xfb1c('0x48')],'updatedAt':_0x52f5c0[_0xfb1c('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfb1c('0x14')](respondWithFilteredResult(_0xe96732,_0x1f9159))[_0xfb1c('0x23')](handleError(_0xe96732,null));};exports['getTeams']=function(_0x249894,_0x428665){var _0x2eba0b={};var _0x333d74={};var _0xe7eccb;var _0x421207;return db[_0xfb1c('0x20')][_0xfb1c('0x4b')]({'where':{'id':_0x249894[_0xfb1c('0x24')]['id']}})[_0xfb1c('0x14')](handleEntityNotFound(_0x428665,null))['then'](function(_0x1aabfe){if(_0x1aabfe){_0xe7eccb=_0x1aabfe;_0x333d74[_0xfb1c('0x28')]=_[_0xfb1c('0x25')](db[_0xfb1c('0x4c')][_0xfb1c('0x1c')]);_0x333d74[_0xfb1c('0x26')]=_[_0xfb1c('0x25')](_0x249894['query']);_0x333d74['filters']=_[_0xfb1c('0x27')](_0x333d74[_0xfb1c('0x28')],_0x333d74[_0xfb1c('0x26')]);_0x2eba0b[_0xfb1c('0x29')]=_[_0xfb1c('0x27')](_0x333d74['model'],qs[_0xfb1c('0x2a')](_0x249894[_0xfb1c('0x26')]['fields']));_0x2eba0b[_0xfb1c('0x29')]=_0x2eba0b[_0xfb1c('0x29')][_0xfb1c('0x2b')]?_0x2eba0b[_0xfb1c('0x29')]:_0x333d74[_0xfb1c('0x28')];_0x2eba0b[_0xfb1c('0x3d')]=qs['sort'](_0x249894[_0xfb1c('0x26')][_0xfb1c('0x3e')]);_0x2eba0b[_0xfb1c('0x1f')]=qs[_0xfb1c('0x3a')](_['pick'](_0x249894[_0xfb1c('0x26')],_0x333d74['filters']));if(_0x249894[_0xfb1c('0x26')][_0xfb1c('0x40')]){_0x2eba0b[_0xfb1c('0x1f')]=_[_0xfb1c('0x41')](_0x2eba0b['where'],{'$or':_[_0xfb1c('0x1b')](_0x2eba0b[_0xfb1c('0x29')],function(_0x17b3b4){var _0x4430d={};_0x4430d[_0x17b3b4]={'$like':'%'+_0x249894['query'][_0xfb1c('0x40')]+'%'};return _0x4430d;})});}_0x2eba0b=_[_0xfb1c('0x41')]({},_0x2eba0b,_0x249894[_0xfb1c('0x42')]);return _0xe7eccb['getTeams'](_0x2eba0b);}})[_0xfb1c('0x14')](function(_0x55995b){if(_0x55995b){_0x421207=_0x55995b['length'];if(!_0x249894[_0xfb1c('0x26')][_0xfb1c('0x3b')](_0xfb1c('0x3c'))){_0x2eba0b[_0xfb1c('0x10')]=qs[_0xfb1c('0x10')](_0x249894['query'][_0xfb1c('0x10')]);_0x2eba0b[_0xfb1c('0xe')]=qs[_0xfb1c('0xe')](_0x249894[_0xfb1c('0x26')]['offset']);}return _0xe7eccb['getTeams'](_0x2eba0b);}})[_0xfb1c('0x14')](function(_0x3712e4){if(_0x3712e4){return _0x3712e4?{'count':_0x421207,'rows':_0x3712e4}:null;}})[_0xfb1c('0x14')](respondWithResult(_0x428665,null))[_0xfb1c('0x23')](handleError(_0x428665,null));};exports[_0xfb1c('0x4d')]=function(_0x4f41a9,_0x3c849e){var _0x4d7dac=_0x4f41a9[_0xfb1c('0x2f')][_0xfb1c('0x4e')];return db['Team'][_0xfb1c('0x4f')]({'where':{'id':_0x4d7dac},'attributes':['id'],'include':[{'model':db[_0xfb1c('0x50')],'as':_0xfb1c('0x51'),'attributes':['id',_0xfb1c('0x19'),_0xfb1c('0x52'),'voicePause',_0xfb1c('0x53')],'raw':!![]}]})['then'](function(_0x543e71){if(_0x543e71){var _0x329517=_[_0xfb1c('0x54')](_0x543e71,function(_0x27594c){var _0x5aa868=_0x27594c['get']({'plain':!![]});return _0x5aa868['Agents'];});return db['ChatQueue'][_0xfb1c('0x2d')]({'where':{'id':_0x4f41a9[_0xfb1c('0x24')]['id']}})[_0xfb1c('0x14')](function(_0x48a76b){return db['sequelize'][_0xfb1c('0x55')](function(_0x59ab5f){return _0x48a76b[_0xfb1c('0x4d')](_0x4d7dac,{'transaction':_0x59ab5f})[_0xfb1c('0x14')](function(){return BPromise[_0xfb1c('0x56')](_0x329517,function(_0x273644){return db[_0xfb1c('0x39')][_0xfb1c('0x57')]({'where':{'UserId':_0x273644['id'],'ChatQueueId':_0x4f41a9[_0xfb1c('0x24')]['id']},'transaction':_0x59ab5f});});})['then'](function(){_0x329517['forEach'](function(_0x1ad08b){socket['emit'](_0xfb1c('0x58'),{'UserId':_0x1ad08b['id'],'ChatQueueId':_0x48a76b['id']});});});});});}})[_0xfb1c('0x14')](respondWithStatusCode(_0x3c849e,null))['catch'](handleError(_0x3c849e,null));};exports[_0xfb1c('0x59')]=function(_0x2765c1,_0x1403af){return db[_0xfb1c('0x4c')]['findAll']({'where':{'id':_0x2765c1[_0xfb1c('0x26')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfb1c('0x51'),'attributes':['id'],'raw':!![]}]})[_0xfb1c('0x14')](handleEntityNotFound(_0x1403af,null))[_0xfb1c('0x14')](function(_0x38f7bb){var _0x4afd6b=_[_0xfb1c('0x1b')](_0x38f7bb,'id');var _0x18be53=[];var _0xfd5b93=[];var _0x126370=squel[_0xfb1c('0x5a')]();_0x126370[_0xfb1c('0x5b')]('tq.TeamId')[_0xfb1c('0x5c')](_0xfb1c('0x5d'),'tq')['join'](_0xfb1c('0x5e'),'ut',_0xfb1c('0x5f'))[_0xfb1c('0x1f')](_0xfb1c('0x60'),_0x2765c1[_0xfb1c('0x24')]['id']);for(var _0x18b1ca=0x0;_0x18b1ca<_0x38f7bb[_0xfb1c('0x2b')];_0x18b1ca+=0x1){let _0x36cf63=_0x38f7bb[_0x18b1ca];for(var _0x1235c1=0x0;_0x1235c1<_0x36cf63[_0xfb1c('0x51')][_0xfb1c('0x2b')];_0x1235c1+=0x1){let _0x33061e=_0x36cf63['Agents'][_0x1235c1];var _0x288ace=_0x126370[_0xfb1c('0x61')]();_0x288ace[_0xfb1c('0x1f')](_0xfb1c('0x62'),_0x33061e['id']);_0xfd5b93[_0xfb1c('0x63')](db[_0xfb1c('0x64')][_0xfb1c('0x26')](_0x288ace[_0xfb1c('0x65')](),{'type':db[_0xfb1c('0x64')][_0xfb1c('0x66')][_0xfb1c('0x67')]})['then'](function(_0x171b52){if(_0x171b52[_0xfb1c('0x2b')]===0x1){return _0x33061e['id'];}else{var _0x615c60=_[_0xfb1c('0x68')](_[_0xfb1c('0x1b')](_0x171b52,_0xfb1c('0x69')),function(_0x413fdd){return _[_0xfb1c('0x6a')](_0x4afd6b,_0x413fdd);});if(_0x615c60){return _0x33061e['id'];}}}));}}return BPromise[_0xfb1c('0x6b')](_0xfd5b93)[_0xfb1c('0x14')](function(_0x28911f){_0x18be53=_(_0x18be53)[_0xfb1c('0x6c')](_0x28911f)['compact']()['value']();return db[_0xfb1c('0x20')][_0xfb1c('0x2d')]({'where':{'id':_0x2765c1[_0xfb1c('0x24')]['id']}})['then'](function(_0x58dd94){return db['sequelize'][_0xfb1c('0x55')](function(_0x4088e6){return _0x58dd94['removeTeams'](_0x2765c1[_0xfb1c('0x26')]['ids'],{'transaction':_0x4088e6})[_0xfb1c('0x14')](function(){if(!_[_0xfb1c('0x6d')](_0x18be53)){return _0x58dd94[_0xfb1c('0x6e')](_0x18be53,{'transaction':_0x4088e6});}})['then'](function(){_0x18be53[_0xfb1c('0x6f')](function(_0x1fd674){socket['emit']('userChatQueue:remove',{'UserId':_0x1fd674,'ChatQueueId':_0x58dd94['id']});});});});});});})[_0xfb1c('0x14')](respondWithStatusCode(_0x1403af,null))[_0xfb1c('0x23')](handleError(_0x1403af,null));};exports[_0xfb1c('0x70')]=function(_0x2d9f6d,_0x38689b){return db['ChatQueue'][_0xfb1c('0x2d')]({'where':{'id':_0x2d9f6d[_0xfb1c('0x24')]['id']}})['then'](handleEntityNotFound(_0x38689b,null))[_0xfb1c('0x14')](function(_0x48187c){if(_0x48187c){return _0x48187c[_0xfb1c('0x70')](_0x2d9f6d['body'][_0xfb1c('0x4e')],_[_0xfb1c('0x71')](_0x2d9f6d[_0xfb1c('0x2f')],['ids','id'])||{})[_0xfb1c('0x72')](function(_0x54768e){for(var _0x409ab6=0x0;_0x409ab6<_0x2d9f6d[_0xfb1c('0x2f')][_0xfb1c('0x4e')][_0xfb1c('0x2b')];_0x409ab6+=0x1){socket[_0xfb1c('0x73')]('userChatQueue:save',{'UserId':Number(_0x2d9f6d['body']['ids'][_0x409ab6]),'ChatQueueId':Number(_0x2d9f6d[_0xfb1c('0x24')]['id'])});}return _0x54768e;});}})['then'](respondWithResult(_0x38689b,null))[_0xfb1c('0x23')](handleError(_0x38689b,null));};exports[_0xfb1c('0x6e')]=function(_0x6fb7c7,_0x4df587){return db['ChatQueue']['find']({'where':{'id':_0x6fb7c7[_0xfb1c('0x24')]['id']}})[_0xfb1c('0x14')](handleEntityNotFound(_0x4df587,null))[_0xfb1c('0x14')](function(_0x453e6b){if(_0x453e6b){return _0x453e6b[_0xfb1c('0x6e')](_0x6fb7c7['query']['ids'])[_0xfb1c('0x14')](function(){if(_['isArray'](_0x6fb7c7['query']['ids'])){for(var _0x1e1f12=0x0;_0x1e1f12<_0x6fb7c7[_0xfb1c('0x26')][_0xfb1c('0x4e')]['length'];_0x1e1f12+=0x1){socket[_0xfb1c('0x73')](_0xfb1c('0x74'),{'UserId':Number(_0x6fb7c7['query'][_0xfb1c('0x4e')][_0x1e1f12]),'ChatQueueId':Number(_0x6fb7c7['params']['id'])});}}else{socket['emit'](_0xfb1c('0x74'),{'UserId':Number(_0x6fb7c7[_0xfb1c('0x26')]['ids']),'ChatQueueId':Number(_0x6fb7c7[_0xfb1c('0x24')]['id'])});}});}})['then'](respondWithStatusCode(_0x4df587,null))[_0xfb1c('0x23')](handleError(_0x4df587,null));};exports[_0xfb1c('0x75')]=function(_0x4cadaa,_0x9d9f95){var _0x864a56={};var _0x4a80e4={};var _0x43b434;var _0xa1a561;return db[_0xfb1c('0x20')][_0xfb1c('0x4b')]({'where':{'id':_0x4cadaa[_0xfb1c('0x24')]['id']}})[_0xfb1c('0x14')](handleEntityNotFound(_0x9d9f95,null))['then'](function(_0x3ede97){if(_0x3ede97){_0x43b434=_0x3ede97;_0x4a80e4['model']=_[_0xfb1c('0x25')](db[_0xfb1c('0x50')][_0xfb1c('0x1c')]);_0x4a80e4[_0xfb1c('0x26')]=_[_0xfb1c('0x25')](_0x4cadaa[_0xfb1c('0x26')]);_0x4a80e4['filters']=_[_0xfb1c('0x27')](_0x4a80e4[_0xfb1c('0x28')],_0x4a80e4[_0xfb1c('0x26')]);_0x864a56[_0xfb1c('0x29')]=_[_0xfb1c('0x27')](_0x4a80e4[_0xfb1c('0x28')],qs[_0xfb1c('0x2a')](_0x4cadaa['query']['fields']));_0x864a56[_0xfb1c('0x29')]=_0x864a56[_0xfb1c('0x29')][_0xfb1c('0x2b')]?_0x864a56[_0xfb1c('0x29')]:_0x4a80e4['model'];_0x864a56['order']=qs['sort'](_0x4cadaa[_0xfb1c('0x26')][_0xfb1c('0x3e')]);_0x864a56[_0xfb1c('0x1f')]=qs[_0xfb1c('0x3a')](_[_0xfb1c('0x3f')](_0x4cadaa['query'],_0x4a80e4[_0xfb1c('0x3a')]));if(_0x4cadaa['query'][_0xfb1c('0x40')]){_0x864a56[_0xfb1c('0x1f')]=_['merge'](_0x864a56['where'],{'$or':_['map'](_0x864a56[_0xfb1c('0x29')],function(_0x4929f3){var _0x25fd98={};_0x25fd98[_0x4929f3]={'$like':'%'+_0x4cadaa[_0xfb1c('0x26')][_0xfb1c('0x40')]+'%'};return _0x25fd98;})});}_0x864a56=_[_0xfb1c('0x41')]({},_0x864a56,_0x4cadaa[_0xfb1c('0x42')]);return _0x43b434[_0xfb1c('0x75')](_0x864a56);}})[_0xfb1c('0x14')](function(_0xdaf89f){if(_0xdaf89f){_0xa1a561=_0xdaf89f[_0xfb1c('0x2b')];if(!_0x4cadaa[_0xfb1c('0x26')][_0xfb1c('0x3b')](_0xfb1c('0x3c'))){_0x864a56['limit']=qs[_0xfb1c('0x10')](_0x4cadaa[_0xfb1c('0x26')][_0xfb1c('0x10')]);_0x864a56[_0xfb1c('0xe')]=qs[_0xfb1c('0xe')](_0x4cadaa[_0xfb1c('0x26')][_0xfb1c('0xe')]);}return _0x43b434[_0xfb1c('0x75')](_0x864a56);}})[_0xfb1c('0x14')](function(_0x309fb7){if(_0x309fb7){return _0x309fb7?{'count':_0xa1a561,'rows':_0x309fb7}:null;}})[_0xfb1c('0x14')](respondWithResult(_0x9d9f95,null))['catch'](handleError(_0x9d9f95,null));};
\ No newline at end of file
+var _0x5ab1=['catch','show','params','model','rawAttributes','filters','attributes','intersection','fields','includeAll','merge','find','create','user','role','ChatQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','keys','UserChatQueue','length','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','findOne','Team','order','options','getTeams','addTeams','ids','flatMap','Agents','transaction','each','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','get','error','stack','name','send','index','map','ChatQueue','fieldName','type','key','getOptions','where','include','query','findAll','rows'];(function(_0x20dbb9,_0x12ee9e){var _0x3513ad=function(_0x4b31df){while(--_0x4b31df){_0x20dbb9['push'](_0x20dbb9['shift']());}};_0x3513ad(++_0x12ee9e);}(_0x5ab1,0x1b5));var _0x15ab=function(_0x36a98e,_0x40578c){_0x36a98e=_0x36a98e-0x0;var _0x4ff372=_0x5ab1[_0x36a98e];return _0x4ff372;};'use strict';var BPromise=require(_0x15ab('0x0'));var util=require(_0x15ab('0x1'));var _=require(_0x15ab('0x2'));var squel=require('squel');var Redis=require(_0x15ab('0x3'));var qs=require(_0x15ab('0x4'));var logger=require(_0x15ab('0x5'))(_0x15ab('0x6'));var config=require('../../config/environment');var db=require(_0x15ab('0x7'))['db'];config[_0x15ab('0x8')]=_[_0x15ab('0x9')](config[_0x15ab('0x8')],{'host':_0x15ab('0xa'),'port':0x18eb});var socket=require(_0x15ab('0xb'))(new Redis(config[_0x15ab('0x8')]));require(_0x15ab('0xc'))[_0x15ab('0xd')](socket);function respondWithStatusCode(_0x323899,_0x530bf0){_0x530bf0=_0x530bf0||0xcc;return function(_0x479a36){if(_0x479a36){return _0x323899[_0x15ab('0xe')](_0x530bf0);}return _0x323899[_0x15ab('0xf')](_0x530bf0)[_0x15ab('0x10')]();};}function respondWithResult(_0x18cf5a,_0x2cfd54){_0x2cfd54=_0x2cfd54||0xc8;return function(_0x50fe0b){if(_0x50fe0b){return _0x18cf5a[_0x15ab('0xf')](_0x2cfd54)[_0x15ab('0x11')](_0x50fe0b);}};}function respondWithFilteredResult(_0x2dcaf4,_0x370b18){return function(_0x22b898){if(_0x22b898){var _0x5cbdf4=typeof _0x370b18[_0x15ab('0x12')]==='undefined'&&typeof _0x370b18[_0x15ab('0x13')]==='undefined';var _0x4b1b2f=_0x22b898[_0x15ab('0x14')];var _0xf07d37=_0x5cbdf4?0x0:_0x370b18['offset'];var _0x5b960a=_0x5cbdf4?_0x22b898[_0x15ab('0x14')]:_0x370b18[_0x15ab('0x12')]+_0x370b18[_0x15ab('0x13')];var _0x423102;if(_0x5b960a>=_0x4b1b2f){_0x5b960a=_0x4b1b2f;_0x423102=0xc8;}else{_0x423102=0xce;}_0x2dcaf4[_0x15ab('0xf')](_0x423102);return _0x2dcaf4[_0x15ab('0x15')](_0x15ab('0x16'),_0xf07d37+'-'+_0x5b960a+'/'+_0x4b1b2f)[_0x15ab('0x11')](_0x22b898);}return null;};}function saveUpdates(_0x210c2b){return function(_0x5cfe53){if(_0x5cfe53){return _0x5cfe53[_0x15ab('0x17')](_0x210c2b)[_0x15ab('0x18')](function(_0x4809f2){return _0x4809f2;});}return null;};}function removeEntity(_0x5448c6){return function(_0x47a47d){if(_0x47a47d){return _0x47a47d[_0x15ab('0x19')]()[_0x15ab('0x18')](function(){var _0x59af52=_0x47a47d[_0x15ab('0x1a')]({'plain':!![]});var _0x3e6ee8='ChatQueues';return db['UserProfileResource'][_0x15ab('0x19')]({'where':{'type':_0x3e6ee8,'resourceId':_0x59af52['id']}})[_0x15ab('0x18')](function(){return _0x47a47d;});})[_0x15ab('0x18')](function(){_0x5448c6[_0x15ab('0xf')](0xcc)[_0x15ab('0x10')]();});}};}function handleEntityNotFound(_0x4ad726){return function(_0x367b1e){if(!_0x367b1e){_0x4ad726[_0x15ab('0xe')](0x194);}return _0x367b1e;};}function handleError(_0x1bb98c,_0x4856a5){_0x4856a5=_0x4856a5||0x1f4;return function(_0x1c2037){logger[_0x15ab('0x1b')](_0x1c2037[_0x15ab('0x1c')]);if(_0x1c2037[_0x15ab('0x1d')]){delete _0x1c2037[_0x15ab('0x1d')];}_0x1bb98c[_0x15ab('0xf')](_0x4856a5)[_0x15ab('0x1e')](_0x1c2037);};}exports[_0x15ab('0x1f')]=function(_0x586675,_0xf00df3){var _0xf8acf6={};var _0x6712c3={'count':0x0,'rows':[]};var _0x88dd1e=_[_0x15ab('0x20')](db[_0x15ab('0x21')]['rawAttributes'],function(_0x51af40){return{'name':_0x51af40[_0x15ab('0x22')],'type':_0x51af40[_0x15ab('0x23')][_0x15ab('0x24')]};});_0xf8acf6=qs[_0x15ab('0x25')](_0x88dd1e,_0x586675);var _0x3cee5c={'where':_0xf8acf6[_0x15ab('0x26')]};return db[_0x15ab('0x21')][_0x15ab('0x14')](_0x3cee5c)[_0x15ab('0x18')](function(_0x28e9cc){_0x6712c3[_0x15ab('0x14')]=_0x28e9cc;_0xf8acf6[_0x15ab('0x27')]=qs[_0x15ab('0x27')](_0x586675[_0x15ab('0x28')]);return db[_0x15ab('0x21')][_0x15ab('0x29')](_0xf8acf6);})[_0x15ab('0x18')](function(_0xf6b55d){_0x6712c3[_0x15ab('0x2a')]=_0xf6b55d;return _0x6712c3;})[_0x15ab('0x18')](respondWithFilteredResult(_0xf00df3,_0xf8acf6))[_0x15ab('0x2b')](handleError(_0xf00df3,null));};exports[_0x15ab('0x2c')]=function(_0x525711,_0x550e86){var _0x3a28d0={'raw':!![],'where':{'id':_0x525711[_0x15ab('0x2d')]['id']}},_0x51105d={};_0x51105d[_0x15ab('0x2e')]=_['keys'](db[_0x15ab('0x21')][_0x15ab('0x2f')]);_0x51105d['query']=_['keys'](_0x525711[_0x15ab('0x28')]);_0x51105d[_0x15ab('0x30')]=_['intersection'](_0x51105d['model'],_0x51105d[_0x15ab('0x28')]);_0x3a28d0[_0x15ab('0x31')]=_[_0x15ab('0x32')](_0x51105d['model'],qs[_0x15ab('0x33')](_0x525711[_0x15ab('0x28')][_0x15ab('0x33')]));_0x3a28d0[_0x15ab('0x31')]=_0x3a28d0['attributes']['length']?_0x3a28d0[_0x15ab('0x31')]:_0x51105d['model'];if(_0x525711[_0x15ab('0x28')][_0x15ab('0x34')]){_0x3a28d0[_0x15ab('0x27')]=[{'all':!![]}];}_0x3a28d0=_[_0x15ab('0x35')]({},_0x3a28d0,_0x525711['options']);return db[_0x15ab('0x21')][_0x15ab('0x36')](_0x3a28d0)['then'](handleEntityNotFound(_0x550e86,null))['then'](respondWithResult(_0x550e86,null))['catch'](handleError(_0x550e86,null));};exports[_0x15ab('0x37')]=function(_0x4df538,_0x3dff2d){return db['ChatQueue']['create'](_0x4df538['body'],{})[_0x15ab('0x18')](function(_0x227e7d){var _0x5bc6cc=_0x4df538[_0x15ab('0x38')]['get']({'plain':!![]});if(!_0x5bc6cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bc6cc[_0x15ab('0x39')]===_0x15ab('0x38')){var _0x2fa2f6=_0x227e7d[_0x15ab('0x1a')]({'plain':!![]});var _0x44ade2=_0x15ab('0x3a');return db[_0x15ab('0x3b')][_0x15ab('0x36')]({'where':{'name':_0x44ade2,'userProfileId':_0x5bc6cc[_0x15ab('0x3c')]},'raw':!![]})[_0x15ab('0x18')](function(_0x39e090){if(_0x39e090&&_0x39e090['autoAssociation']===0x0){return db[_0x15ab('0x3d')]['create']({'name':_0x2fa2f6['name'],'resourceId':_0x2fa2f6['id'],'type':_0x39e090['name'],'sectionId':_0x39e090['id']},{})[_0x15ab('0x18')](function(){return _0x227e7d;});}else{return _0x227e7d;}})[_0x15ab('0x2b')](function(_0x62bd61){logger[_0x15ab('0x1b')](_0x15ab('0x3e'),_0x62bd61);throw _0x62bd61;});}return _0x227e7d;})[_0x15ab('0x18')](respondWithResult(_0x3dff2d,0xc9))[_0x15ab('0x2b')](handleError(_0x3dff2d,null));};exports[_0x15ab('0x17')]=function(_0x2778b4,_0x99aef0){if(_0x2778b4[_0x15ab('0x3f')]['id']){delete _0x2778b4[_0x15ab('0x3f')]['id'];}return db[_0x15ab('0x21')]['find']({'where':{'id':_0x2778b4[_0x15ab('0x2d')]['id']}})[_0x15ab('0x18')](handleEntityNotFound(_0x99aef0,null))[_0x15ab('0x18')](saveUpdates(_0x2778b4['body'],null))[_0x15ab('0x18')](respondWithResult(_0x99aef0,null))[_0x15ab('0x2b')](handleError(_0x99aef0,null));};exports[_0x15ab('0x19')]=function(_0x29643b,_0x127b6c){return db[_0x15ab('0x21')][_0x15ab('0x36')]({'where':{'id':_0x29643b['params']['id']}})['then'](handleEntityNotFound(_0x127b6c,null))[_0x15ab('0x18')](removeEntity(_0x127b6c,null))['catch'](handleError(_0x127b6c,null));};exports['describe']=function(_0x502b54,_0x39b749){return db[_0x15ab('0x21')]['describe']()[_0x15ab('0x18')](respondWithResult(_0x39b749,null))['catch'](handleError(_0x39b749,null));};exports['getMembers']=function(_0x4046a9,_0x344e7d){var _0x105f26={'raw':!![],'where':{}},_0x147b7e={},_0xff7542;return db[_0x15ab('0x21')]['findOne']({'where':{'id':_0x4046a9[_0x15ab('0x2d')]['id']}})['then'](handleEntityNotFound(_0x344e7d,null))[_0x15ab('0x18')](function(_0x308994){if(_0x308994){_0xff7542=_0x308994[_0x15ab('0x1a')]({'plain':!![]});_0x147b7e['model']=_[_0x15ab('0x40')](db[_0x15ab('0x41')]['rawAttributes']);_0x147b7e[_0x15ab('0x28')]=_[_0x15ab('0x40')](_0x4046a9[_0x15ab('0x28')]);_0x147b7e['filters']=_[_0x15ab('0x32')](_0x147b7e['model'],_0x147b7e[_0x15ab('0x28')]);_0x105f26['attributes']=_['intersection'](_0x147b7e[_0x15ab('0x2e')],qs['fields'](_0x4046a9[_0x15ab('0x28')][_0x15ab('0x33')]));_0x105f26[_0x15ab('0x31')]=_0x105f26[_0x15ab('0x31')][_0x15ab('0x42')]?_0x105f26[_0x15ab('0x31')]:_0x147b7e[_0x15ab('0x2e')];if(!_0x4046a9[_0x15ab('0x28')][_0x15ab('0x43')](_0x15ab('0x44'))){_0x105f26[_0x15ab('0x13')]=qs[_0x15ab('0x13')](_0x4046a9[_0x15ab('0x28')][_0x15ab('0x13')]);_0x105f26['offset']=qs['offset'](_0x4046a9[_0x15ab('0x28')][_0x15ab('0x12')]);}_0x105f26['order']=qs['sort'](_0x4046a9['query'][_0x15ab('0x45')]);_0x105f26[_0x15ab('0x26')]=qs[_0x15ab('0x30')](_[_0x15ab('0x46')](_0x4046a9[_0x15ab('0x28')],_0x147b7e[_0x15ab('0x30')]));_0x105f26[_0x15ab('0x26')][_0x15ab('0x47')]=_0x308994['id'];if(_0x4046a9[_0x15ab('0x28')][_0x15ab('0x48')]){_0x105f26[_0x15ab('0x26')]=_[_0x15ab('0x35')](_0x105f26['where'],{'$or':_[_0x15ab('0x20')](_0x105f26[_0x15ab('0x31')],function(_0x48d6f2){var _0x1893a8={};_0x1893a8[_0x48d6f2]={'$like':'%'+_0x4046a9[_0x15ab('0x28')][_0x15ab('0x48')]+'%'};return _0x1893a8;})});}_0x105f26=_[_0x15ab('0x35')]({},_0x105f26,_0x4046a9['options']);return db[_0x15ab('0x41')][_0x15ab('0x29')](_0x105f26);}})[_0x15ab('0x18')](function(_0x486c66){if(_0x486c66){return db[_0x15ab('0x49')][_0x15ab('0x4a')]({'where':{'id':_[_0x15ab('0x20')](_0x486c66,_0x15ab('0x4b')),'role':_0x15ab('0x4c')},'attributes':['id',_0x15ab('0x1d'),_0x15ab('0x4d'),_0x15ab('0x4e'),_0x15ab('0x4f')]});}})[_0x15ab('0x18')](function(_0x571f5d){if(_0x571f5d){return{'count':_0x571f5d[_0x15ab('0x14')],'rows':_[_0x15ab('0x20')](_0x571f5d[_0x15ab('0x2a')],function(_0x363107){return{'membername':_0x363107[_0x15ab('0x1d')],'UserId':_0x363107['id'],'queue_name':_0xff7542[_0x15ab('0x1d')],'ChatQueueId':_0xff7542['id'],'interface':util[_0x15ab('0x50')]('%s/%s','SIP',_0x363107[_0x15ab('0x1d')]),'penalty':0x0,'paused':_0x363107[_0x15ab('0x4d')],'createdAt':_0x363107[_0x15ab('0x4f')],'updatedAt':_0x363107[_0x15ab('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x15ab('0x18')](respondWithFilteredResult(_0x344e7d,_0x105f26))['catch'](handleError(_0x344e7d,null));};exports['getTeams']=function(_0x139f23,_0xda10c3){var _0x37ec84={};var _0x5e7a60={};var _0x7e8bb5;var _0x3c1456;return db[_0x15ab('0x21')][_0x15ab('0x51')]({'where':{'id':_0x139f23[_0x15ab('0x2d')]['id']}})[_0x15ab('0x18')](handleEntityNotFound(_0xda10c3,null))['then'](function(_0x1de636){if(_0x1de636){_0x7e8bb5=_0x1de636;_0x5e7a60[_0x15ab('0x2e')]=_[_0x15ab('0x40')](db[_0x15ab('0x52')][_0x15ab('0x2f')]);_0x5e7a60[_0x15ab('0x28')]=_[_0x15ab('0x40')](_0x139f23['query']);_0x5e7a60[_0x15ab('0x30')]=_['intersection'](_0x5e7a60[_0x15ab('0x2e')],_0x5e7a60['query']);_0x37ec84[_0x15ab('0x31')]=_['intersection'](_0x5e7a60[_0x15ab('0x2e')],qs[_0x15ab('0x33')](_0x139f23['query']['fields']));_0x37ec84[_0x15ab('0x31')]=_0x37ec84['attributes'][_0x15ab('0x42')]?_0x37ec84['attributes']:_0x5e7a60[_0x15ab('0x2e')];_0x37ec84[_0x15ab('0x53')]=qs['sort'](_0x139f23['query'][_0x15ab('0x45')]);_0x37ec84[_0x15ab('0x26')]=qs[_0x15ab('0x30')](_[_0x15ab('0x46')](_0x139f23[_0x15ab('0x28')],_0x5e7a60['filters']));if(_0x139f23[_0x15ab('0x28')][_0x15ab('0x48')]){_0x37ec84[_0x15ab('0x26')]=_['merge'](_0x37ec84['where'],{'$or':_['map'](_0x37ec84[_0x15ab('0x31')],function(_0x4e5cb9){var _0x3b75f8={};_0x3b75f8[_0x4e5cb9]={'$like':'%'+_0x139f23['query'][_0x15ab('0x48')]+'%'};return _0x3b75f8;})});}_0x37ec84=_[_0x15ab('0x35')]({},_0x37ec84,_0x139f23[_0x15ab('0x54')]);return _0x7e8bb5[_0x15ab('0x55')](_0x37ec84);}})[_0x15ab('0x18')](function(_0x178c08){if(_0x178c08){_0x3c1456=_0x178c08[_0x15ab('0x42')];if(!_0x139f23[_0x15ab('0x28')][_0x15ab('0x43')](_0x15ab('0x44'))){_0x37ec84[_0x15ab('0x13')]=qs[_0x15ab('0x13')](_0x139f23['query'][_0x15ab('0x13')]);_0x37ec84[_0x15ab('0x12')]=qs[_0x15ab('0x12')](_0x139f23[_0x15ab('0x28')][_0x15ab('0x12')]);}return _0x7e8bb5[_0x15ab('0x55')](_0x37ec84);}})[_0x15ab('0x18')](function(_0x40bd88){if(_0x40bd88){return _0x40bd88?{'count':_0x3c1456,'rows':_0x40bd88}:null;}})[_0x15ab('0x18')](respondWithResult(_0xda10c3,null))[_0x15ab('0x2b')](handleError(_0xda10c3,null));};exports[_0x15ab('0x56')]=function(_0x3dd8e5,_0x27834c){var _0x11e73f=_0x3dd8e5[_0x15ab('0x3f')][_0x15ab('0x57')];return db[_0x15ab('0x52')][_0x15ab('0x29')]({'where':{'id':_0x11e73f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x15ab('0x1d'),'online','voicePause','interface'],'raw':!![]}]})[_0x15ab('0x18')](function(_0x51d0ab){if(_0x51d0ab){var _0x426f35=_[_0x15ab('0x58')](_0x51d0ab,function(_0x2664e7){var _0x491918=_0x2664e7[_0x15ab('0x1a')]({'plain':!![]});return _0x491918[_0x15ab('0x59')];});return db[_0x15ab('0x21')]['find']({'where':{'id':_0x3dd8e5['params']['id']}})[_0x15ab('0x18')](function(_0x139dea){return db['sequelize'][_0x15ab('0x5a')](function(_0x1c25df){return _0x139dea['addTeams'](_0x11e73f,{'transaction':_0x1c25df})['then'](function(){return BPromise[_0x15ab('0x5b')](_0x426f35,function(_0x5d12b7){return db[_0x15ab('0x41')]['findOrCreate']({'where':{'UserId':_0x5d12b7['id'],'ChatQueueId':_0x3dd8e5[_0x15ab('0x2d')]['id']},'transaction':_0x1c25df});});})[_0x15ab('0x18')](function(){_0x426f35['forEach'](function(_0x562be3){socket[_0x15ab('0x5c')](_0x15ab('0x5d'),{'UserId':_0x562be3['id'],'ChatQueueId':_0x139dea['id']});});});});});}})['then'](respondWithStatusCode(_0x27834c,null))['catch'](handleError(_0x27834c,null));};exports[_0x15ab('0x5e')]=function(_0x4bc824,_0x48f415){return db[_0x15ab('0x52')][_0x15ab('0x29')]({'where':{'id':_0x4bc824['query'][_0x15ab('0x57')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x15ab('0x59'),'attributes':['id'],'raw':!![]}]})[_0x15ab('0x18')](handleEntityNotFound(_0x48f415,null))['then'](function(_0x42c91a){var _0x42b624=_[_0x15ab('0x20')](_0x42c91a,'id');var _0x8d67bd=[];var _0x199399=[];var _0x3ebfcc=squel[_0x15ab('0x5f')]();_0x3ebfcc['field'](_0x15ab('0x60'))[_0x15ab('0x61')](_0x15ab('0x62'),'tq')[_0x15ab('0x63')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x4bc824['params']['id']);for(var _0x223e8f=0x0;_0x223e8f<_0x42c91a[_0x15ab('0x42')];_0x223e8f+=0x1){let _0x33cf14=_0x42c91a[_0x223e8f];for(var _0x526a54=0x0;_0x526a54<_0x33cf14['Agents'][_0x15ab('0x42')];_0x526a54+=0x1){let _0x4ef52c=_0x33cf14[_0x15ab('0x59')][_0x526a54];var _0x48921c=_0x3ebfcc['clone']();_0x48921c[_0x15ab('0x26')](_0x15ab('0x64'),_0x4ef52c['id']);_0x199399[_0x15ab('0x65')](db[_0x15ab('0x66')][_0x15ab('0x28')](_0x48921c[_0x15ab('0x67')](),{'type':db['sequelize'][_0x15ab('0x68')][_0x15ab('0x69')]})[_0x15ab('0x18')](function(_0xeecd47){if(_0xeecd47[_0x15ab('0x42')]===0x1){return _0x4ef52c['id'];}else{var _0x67a1b1=_[_0x15ab('0x6a')](_[_0x15ab('0x20')](_0xeecd47,'TeamId'),function(_0x244b43){return _[_0x15ab('0x6b')](_0x42b624,_0x244b43);});if(_0x67a1b1){return _0x4ef52c['id'];}}}));}}return BPromise['all'](_0x199399)['then'](function(_0x498bf1){_0x8d67bd=_(_0x8d67bd)[_0x15ab('0x6c')](_0x498bf1)[_0x15ab('0x6d')]()[_0x15ab('0x6e')]();return db['ChatQueue'][_0x15ab('0x36')]({'where':{'id':_0x4bc824[_0x15ab('0x2d')]['id']}})[_0x15ab('0x18')](function(_0x586a13){return db[_0x15ab('0x66')][_0x15ab('0x5a')](function(_0x4f58c9){return _0x586a13[_0x15ab('0x5e')](_0x4bc824[_0x15ab('0x28')][_0x15ab('0x57')],{'transaction':_0x4f58c9})[_0x15ab('0x18')](function(){if(!_[_0x15ab('0x6f')](_0x8d67bd)){return _0x586a13[_0x15ab('0x70')](_0x8d67bd,{'transaction':_0x4f58c9});}})[_0x15ab('0x18')](function(){_0x8d67bd[_0x15ab('0x71')](function(_0x5aedf0){socket[_0x15ab('0x5c')](_0x15ab('0x72'),{'UserId':_0x5aedf0,'ChatQueueId':_0x586a13['id']});});});});});});})[_0x15ab('0x18')](respondWithStatusCode(_0x48f415,null))[_0x15ab('0x2b')](handleError(_0x48f415,null));};exports[_0x15ab('0x73')]=function(_0x435197,_0x1275b5){return db[_0x15ab('0x21')][_0x15ab('0x36')]({'where':{'id':_0x435197[_0x15ab('0x2d')]['id']}})[_0x15ab('0x18')](handleEntityNotFound(_0x1275b5,null))[_0x15ab('0x18')](function(_0x4142d3){if(_0x4142d3){return _0x4142d3[_0x15ab('0x73')](_0x435197[_0x15ab('0x3f')][_0x15ab('0x57')],_[_0x15ab('0x74')](_0x435197[_0x15ab('0x3f')],[_0x15ab('0x57'),'id'])||{})[_0x15ab('0x75')](function(_0x627df4){for(var _0x26792b=0x0;_0x26792b<_0x435197[_0x15ab('0x3f')][_0x15ab('0x57')][_0x15ab('0x42')];_0x26792b+=0x1){socket[_0x15ab('0x5c')](_0x15ab('0x5d'),{'UserId':Number(_0x435197[_0x15ab('0x3f')][_0x15ab('0x57')][_0x26792b]),'ChatQueueId':Number(_0x435197[_0x15ab('0x2d')]['id'])});}return _0x627df4;});}})[_0x15ab('0x18')](respondWithResult(_0x1275b5,null))['catch'](handleError(_0x1275b5,null));};exports[_0x15ab('0x70')]=function(_0x1d6f3e,_0x2d0e28){return db[_0x15ab('0x21')]['find']({'where':{'id':_0x1d6f3e['params']['id']}})[_0x15ab('0x18')](handleEntityNotFound(_0x2d0e28,null))[_0x15ab('0x18')](function(_0x2edf2c){if(_0x2edf2c){return _0x2edf2c['removeAgents'](_0x1d6f3e[_0x15ab('0x28')][_0x15ab('0x57')])[_0x15ab('0x18')](function(){if(_[_0x15ab('0x76')](_0x1d6f3e[_0x15ab('0x28')]['ids'])){for(var _0x1f9c4e=0x0;_0x1f9c4e<_0x1d6f3e['query'][_0x15ab('0x57')]['length'];_0x1f9c4e+=0x1){socket['emit'](_0x15ab('0x72'),{'UserId':Number(_0x1d6f3e[_0x15ab('0x28')]['ids'][_0x1f9c4e]),'ChatQueueId':Number(_0x1d6f3e[_0x15ab('0x2d')]['id'])});}}else{socket[_0x15ab('0x5c')](_0x15ab('0x72'),{'UserId':Number(_0x1d6f3e[_0x15ab('0x28')][_0x15ab('0x57')]),'ChatQueueId':Number(_0x1d6f3e['params']['id'])});}});}})[_0x15ab('0x18')](respondWithStatusCode(_0x2d0e28,null))['catch'](handleError(_0x2d0e28,null));};exports[_0x15ab('0x77')]=function(_0x4a6825,_0x46fac7){var _0x5eaf91={};var _0x2334f4={};var _0x53f53f;var _0x4c4bef;return db[_0x15ab('0x21')][_0x15ab('0x51')]({'where':{'id':_0x4a6825['params']['id']}})[_0x15ab('0x18')](handleEntityNotFound(_0x46fac7,null))[_0x15ab('0x18')](function(_0x5b448f){if(_0x5b448f){_0x53f53f=_0x5b448f;_0x2334f4[_0x15ab('0x2e')]=_[_0x15ab('0x40')](db['User'][_0x15ab('0x2f')]);_0x2334f4['query']=_[_0x15ab('0x40')](_0x4a6825[_0x15ab('0x28')]);_0x2334f4[_0x15ab('0x30')]=_[_0x15ab('0x32')](_0x2334f4['model'],_0x2334f4[_0x15ab('0x28')]);_0x5eaf91[_0x15ab('0x31')]=_[_0x15ab('0x32')](_0x2334f4[_0x15ab('0x2e')],qs[_0x15ab('0x33')](_0x4a6825['query'][_0x15ab('0x33')]));_0x5eaf91[_0x15ab('0x31')]=_0x5eaf91['attributes'][_0x15ab('0x42')]?_0x5eaf91[_0x15ab('0x31')]:_0x2334f4[_0x15ab('0x2e')];_0x5eaf91[_0x15ab('0x53')]=qs['sort'](_0x4a6825[_0x15ab('0x28')][_0x15ab('0x45')]);_0x5eaf91[_0x15ab('0x26')]=qs[_0x15ab('0x30')](_[_0x15ab('0x46')](_0x4a6825['query'],_0x2334f4['filters']));if(_0x4a6825['query'][_0x15ab('0x48')]){_0x5eaf91[_0x15ab('0x26')]=_[_0x15ab('0x35')](_0x5eaf91[_0x15ab('0x26')],{'$or':_[_0x15ab('0x20')](_0x5eaf91[_0x15ab('0x31')],function(_0x325398){var _0x5f30b2={};_0x5f30b2[_0x325398]={'$like':'%'+_0x4a6825[_0x15ab('0x28')][_0x15ab('0x48')]+'%'};return _0x5f30b2;})});}_0x5eaf91=_['merge']({},_0x5eaf91,_0x4a6825[_0x15ab('0x54')]);return _0x53f53f[_0x15ab('0x77')](_0x5eaf91);}})[_0x15ab('0x18')](function(_0x21375c){if(_0x21375c){_0x4c4bef=_0x21375c[_0x15ab('0x42')];if(!_0x4a6825[_0x15ab('0x28')][_0x15ab('0x43')](_0x15ab('0x44'))){_0x5eaf91[_0x15ab('0x13')]=qs[_0x15ab('0x13')](_0x4a6825[_0x15ab('0x28')][_0x15ab('0x13')]);_0x5eaf91[_0x15ab('0x12')]=qs[_0x15ab('0x12')](_0x4a6825[_0x15ab('0x28')][_0x15ab('0x12')]);}return _0x53f53f[_0x15ab('0x77')](_0x5eaf91);}})['then'](function(_0x26dcc4){if(_0x26dcc4){return _0x26dcc4?{'count':_0x4c4bef,'rows':_0x26dcc4}:null;}})[_0x15ab('0x18')](respondWithResult(_0x46fac7,null))['catch'](handleError(_0x46fac7,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index fb45ccc..1ed2d54 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 _0x5329=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5329,0xab));var _0x9532=function(_0x3854f6,_0x307471){_0x3854f6=_0x3854f6-0x0;var _0xe566a2=_0x5329[_0x3854f6];return _0xe566a2;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x9532('0x0'))['db'][_0x9532('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9532('0x2')](0x0);var events={'afterCreate':_0x9532('0x3'),'afterUpdate':_0x9532('0x4'),'afterDestroy':_0x9532('0x5')};function emitEvent(_0xff50c4){return function(_0x5192a4,_0x344ada,_0x17744c){ChatQueueEvents[_0x9532('0x6')](_0xff50c4+':'+_0x5192a4['id'],_0x5192a4);ChatQueueEvents['emit'](_0xff50c4,_0x5192a4);_0x17744c(null);};}for(var e in events){if(events[_0x9532('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x9532('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xc0f7=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue'];(function(_0x2daa63,_0x4a01d4){var _0x1afeba=function(_0x38b789){while(--_0x38b789){_0x2daa63['push'](_0x2daa63['shift']());}};_0x1afeba(++_0x4a01d4);}(_0xc0f7,0x9f));var _0x7c0f=function(_0x1233d2,_0x5a0246){_0x1233d2=_0x1233d2-0x0;var _0x93e5d0=_0xc0f7[_0x1233d2];return _0x93e5d0;};'use strict';var EventEmitter=require(_0x7c0f('0x0'));var ChatQueue=require(_0x7c0f('0x1'))['db'][_0x7c0f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7c0f('0x3')](0x0);var events={'afterCreate':_0x7c0f('0x4'),'afterUpdate':'update','afterDestroy':_0x7c0f('0x5')};function emitEvent(_0x4fb15e){return function(_0x5e0275,_0x23d4c6,_0x1da53a){ChatQueueEvents[_0x7c0f('0x6')](_0x4fb15e+':'+_0x5e0275['id'],_0x5e0275);ChatQueueEvents[_0x7c0f('0x6')](_0x4fb15e,_0x5e0275);_0x1da53a(null);};}for(var e in events){if(events[_0x7c0f('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x7c0f('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 6183874..5b18ed7 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 _0xd854=['api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x3af129,_0x38e38a){var _0x50a010=function(_0x39cf50){while(--_0x39cf50){_0x3af129['push'](_0x3af129['shift']());}};_0x50a010(++_0x38e38a);}(_0xd854,0xf5));var _0x4d85=function(_0x2e268f,_0x51d1e5){_0x2e268f=_0x2e268f-0x0;var _0x3d1ced=_0xd854[_0x2e268f];return _0x3d1ced;};'use strict';var _=require(_0x4d85('0x0'));var util=require('util');var logger=require(_0x4d85('0x1'))(_0x4d85('0x2'));var moment=require(_0x4d85('0x3'));var BPromise=require(_0x4d85('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d85('0x5'));var rimraf=require(_0x4d85('0x6'));var config=require(_0x4d85('0x7'));var attributes=require(_0x4d85('0x8'));module[_0x4d85('0x9')]=function(_0x4c2ddf,_0x2cb8e4){return _0x4c2ddf[_0x4d85('0xa')](_0x4d85('0xb'),attributes,{'tableName':_0x4d85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79d2=['../../config/environment','./chatQueue.attributes','define','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c7b40,_0x4aa210){var _0x2247e7=function(_0x4a8c20){while(--_0x4a8c20){_0x5c7b40['push'](_0x5c7b40['shift']());}};_0x2247e7(++_0x4aa210);}(_0x79d2,0x10c));var _0x279d=function(_0x53d9a7,_0x44c4a3){_0x53d9a7=_0x53d9a7-0x0;var _0x1c8958=_0x79d2[_0x53d9a7];return _0x1c8958;};'use strict';var _=require(_0x279d('0x0'));var util=require(_0x279d('0x1'));var logger=require(_0x279d('0x2'))(_0x279d('0x3'));var moment=require(_0x279d('0x4'));var BPromise=require(_0x279d('0x5'));var rp=require(_0x279d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x279d('0x7'));var attributes=require(_0x279d('0x8'));module['exports']=function(_0x115f94,_0x3e60f5){return _0x115f94[_0x279d('0x9')](_0x279d('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index e8b68bc..07f06e6 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 _0x5a13=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','options','where','attributes','limit','include','model','map','ShowChatQueue','raw','util','moment'];(function(_0x5daa20,_0x45420c){var _0x4517ec=function(_0x3e944f){while(--_0x3e944f){_0x5daa20['push'](_0x5daa20['shift']());}};_0x4517ec(++_0x45420c);}(_0x5a13,0x92));var _0x35a1=function(_0x4f6f3d,_0x217c9b){_0x4f6f3d=_0x4f6f3d-0x0;var _0x7ff5ea=_0x5a13[_0x4f6f3d];return _0x7ff5ea;};'use strict';var _=require('lodash');var util=require(_0x35a1('0x0'));var moment=require(_0x35a1('0x1'));var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x35a1('0x6'))('rpc');var config=require(_0x35a1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x35a1('0x8')]=_[_0x35a1('0x9')](config[_0x35a1('0x8')],{'host':_0x35a1('0xa'),'port':0x18eb});var socket=require(_0x35a1('0xb'))(new Redis(config['redis']));require(_0x35a1('0xc'))[_0x35a1('0xd')](socket);function respondWithRpcPromise(_0x29f3f7,_0x3c4501,_0x10d627){return new BPromise(function(_0x2d9801,_0x38a711){return client[_0x35a1('0xe')](_0x29f3f7,_0x10d627)[_0x35a1('0xf')](function(_0x5ee208){logger[_0x35a1('0x10')](_0x35a1('0x11'),_0x3c4501,_0x35a1('0x12'));logger[_0x35a1('0x13')](_0x35a1('0x14'),_0x3c4501,'request\x20sent',JSON[_0x35a1('0x15')](_0x5ee208));if(_0x5ee208['error']){if(_0x5ee208[_0x35a1('0x16')][_0x35a1('0x17')]===0x1f4){logger['error'](_0x35a1('0x11'),_0x3c4501,_0x5ee208[_0x35a1('0x16')][_0x35a1('0x18')]);return _0x38a711(_0x5ee208[_0x35a1('0x16')]['message']);}logger[_0x35a1('0x16')](_0x35a1('0x11'),_0x3c4501,_0x5ee208[_0x35a1('0x16')][_0x35a1('0x18')]);return _0x2d9801(_0x5ee208['error'][_0x35a1('0x18')]);}else{logger[_0x35a1('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3c4501,_0x35a1('0x12'));_0x2d9801(_0x5ee208[_0x35a1('0x19')]['message']);}})[_0x35a1('0x1a')](function(_0x11acfb){logger[_0x35a1('0x16')](_0x35a1('0x11'),_0x3c4501,_0x11acfb);_0x38a711(_0x11acfb);});});}exports[_0x35a1('0x1b')]=function(_0x5a324d){var _0xffc38=this;return new Promise(function(_0xcada3,_0x4b978e){return db['ChatQueue']['findAll']({'raw':_0x5a324d['options']?_0x5a324d[_0x35a1('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5a324d[_0x35a1('0x1c')]?_0x5a324d[_0x35a1('0x1c')][_0x35a1('0x1d')]||null:null,'attributes':_0x5a324d['options']?_0x5a324d[_0x35a1('0x1c')][_0x35a1('0x1e')]||null:null,'limit':_0x5a324d[_0x35a1('0x1c')]?_0x5a324d[_0x35a1('0x1c')][_0x35a1('0x1f')]||null:null,'include':_0x5a324d[_0x35a1('0x1c')]?_0x5a324d[_0x35a1('0x1c')][_0x35a1('0x20')]?_['map'](_0x5a324d[_0x35a1('0x1c')][_0x35a1('0x20')],function(_0x4e9a35){return{'model':db[_0x4e9a35[_0x35a1('0x21')]],'as':_0x4e9a35['as'],'attributes':_0x4e9a35[_0x35a1('0x1e')],'include':_0x4e9a35['include']?_[_0x35a1('0x22')](_0x4e9a35[_0x35a1('0x20')],function(_0x346d2e){return{'model':db[_0x346d2e[_0x35a1('0x21')]],'as':_0x346d2e['as'],'attributes':_0x346d2e[_0x35a1('0x1e')],'include':_0x346d2e[_0x35a1('0x20')]?_[_0x35a1('0x22')](_0x346d2e[_0x35a1('0x20')],function(_0x5f9764){return{'model':db[_0x5f9764['model']],'as':_0x5f9764['as'],'attributes':_0x5f9764[_0x35a1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x35a1('0xf')](function(_0x4d22b2){logger['info'](_0x35a1('0x1b'),_0x5a324d);logger[_0x35a1('0x13')](_0x35a1('0x1b'),_0x5a324d,JSON[_0x35a1('0x15')](_0x4d22b2));_0xcada3(_0x4d22b2);})[_0x35a1('0x1a')](function(_0x19be3d){logger[_0x35a1('0x16')](_0x35a1('0x1b'),_0x19be3d['message'],_0x5a324d);_0x4b978e(_0xffc38['error'](0x1f4,_0x19be3d[_0x35a1('0x18')]));});});};exports[_0x35a1('0x23')]=function(_0x4629c1){var _0x42ea25=this;return new Promise(function(_0x5d0ab5,_0x42e11e){return db['ChatQueue']['find']({'raw':_0x4629c1[_0x35a1('0x1c')]?_0x4629c1[_0x35a1('0x1c')][_0x35a1('0x24')]===undefined?!![]:![]:!![],'where':_0x4629c1['options']?_0x4629c1[_0x35a1('0x1c')][_0x35a1('0x1d')]||null:null,'attributes':_0x4629c1[_0x35a1('0x1c')]?_0x4629c1[_0x35a1('0x1c')][_0x35a1('0x1e')]||null:null,'include':_0x4629c1[_0x35a1('0x1c')]?_0x4629c1[_0x35a1('0x1c')][_0x35a1('0x20')]?_[_0x35a1('0x22')](_0x4629c1['options'][_0x35a1('0x20')],function(_0x202c2d){return{'model':db[_0x202c2d[_0x35a1('0x21')]],'as':_0x202c2d['as'],'attributes':_0x202c2d[_0x35a1('0x1e')],'include':_0x202c2d[_0x35a1('0x20')]?_[_0x35a1('0x22')](_0x202c2d[_0x35a1('0x20')],function(_0x3ec283){return{'model':db[_0x3ec283[_0x35a1('0x21')]],'as':_0x3ec283['as'],'attributes':_0x3ec283['attributes'],'include':_0x3ec283[_0x35a1('0x20')]?_['map'](_0x3ec283[_0x35a1('0x20')],function(_0xa5bfa3){return{'model':db[_0xa5bfa3[_0x35a1('0x21')]],'as':_0xa5bfa3['as'],'attributes':_0xa5bfa3[_0x35a1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x461bbe){logger['info'](_0x35a1('0x23'),_0x4629c1);logger[_0x35a1('0x13')]('ShowChatQueue',_0x4629c1,JSON[_0x35a1('0x15')](_0x461bbe));_0x5d0ab5(_0x461bbe);})['catch'](function(_0xd14f9f){logger[_0x35a1('0x16')]('ShowChatQueue',_0xd14f9f['message'],_0x4629c1);_0x42e11e(_0x42ea25['error'](0x1f4,_0xd14f9f[_0x35a1('0x18')]));});});};
\ No newline at end of file
+var _0x45d8=['stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x3d53dd,_0x2fdac5){var _0xfa348a=function(_0x2479f8){while(--_0x2479f8){_0x3d53dd['push'](_0x3d53dd['shift']());}};_0xfa348a(++_0x2fdac5);}(_0x45d8,0x174));var _0x845d=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0x45d8[_0x383158];return _0x507985;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var moment=require(_0x845d('0x2'));var BPromise=require(_0x845d('0x3'));var rs=require(_0x845d('0x4'));var fs=require('fs');var Redis=require(_0x845d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845d('0x6'));var logger=require('../../config/logger')(_0x845d('0x7'));var config=require(_0x845d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x845d('0x9')]({'port':0x232a});config['redis']=_[_0x845d('0xa')](config[_0x845d('0xb')],{'host':_0x845d('0xc'),'port':0x18eb});var socket=require(_0x845d('0xd'))(new Redis(config[_0x845d('0xb')]));require(_0x845d('0xe'))['register'](socket);function respondWithRpcPromise(_0x209d2e,_0x234efb,_0x50b504){return new BPromise(function(_0x5d4128,_0x1a2afb){return client[_0x845d('0xf')](_0x209d2e,_0x50b504)[_0x845d('0x10')](function(_0x10deb0){logger[_0x845d('0x11')]('ChatQueue,\x20%s,\x20%s',_0x234efb,_0x845d('0x12'));logger[_0x845d('0x13')](_0x845d('0x14'),_0x234efb,_0x845d('0x12'),JSON['stringify'](_0x10deb0));if(_0x10deb0['error']){if(_0x10deb0[_0x845d('0x15')][_0x845d('0x16')]===0x1f4){logger[_0x845d('0x15')]('ChatQueue,\x20%s,\x20%s',_0x234efb,_0x10deb0[_0x845d('0x15')]['message']);return _0x1a2afb(_0x10deb0[_0x845d('0x15')]['message']);}logger[_0x845d('0x15')](_0x845d('0x17'),_0x234efb,_0x10deb0[_0x845d('0x15')][_0x845d('0x18')]);return _0x5d4128(_0x10deb0[_0x845d('0x15')]['message']);}else{logger['info'](_0x845d('0x17'),_0x234efb,_0x845d('0x12'));_0x5d4128(_0x10deb0[_0x845d('0x19')][_0x845d('0x18')]);}})[_0x845d('0x1a')](function(_0x523b63){logger[_0x845d('0x15')](_0x845d('0x17'),_0x234efb,_0x523b63);_0x1a2afb(_0x523b63);});});}exports[_0x845d('0x1b')]=function(_0x377998){var _0x4683e1=this;return new Promise(function(_0x4a500a,_0xe5768b){return db[_0x845d('0x1c')][_0x845d('0x1d')]({'raw':_0x377998[_0x845d('0x1e')]?_0x377998[_0x845d('0x1e')][_0x845d('0x1f')]===undefined?!![]:![]:!![],'where':_0x377998['options']?_0x377998[_0x845d('0x1e')][_0x845d('0x20')]||null:null,'attributes':_0x377998[_0x845d('0x1e')]?_0x377998['options'][_0x845d('0x21')]||null:null,'limit':_0x377998[_0x845d('0x1e')]?_0x377998[_0x845d('0x1e')][_0x845d('0x22')]||null:null,'include':_0x377998[_0x845d('0x1e')]?_0x377998['options'][_0x845d('0x23')]?_['map'](_0x377998[_0x845d('0x1e')][_0x845d('0x23')],function(_0x5716cd){return{'model':db[_0x5716cd['model']],'as':_0x5716cd['as'],'attributes':_0x5716cd[_0x845d('0x21')],'include':_0x5716cd[_0x845d('0x23')]?_[_0x845d('0x24')](_0x5716cd[_0x845d('0x23')],function(_0x1ea3a2){return{'model':db[_0x1ea3a2['model']],'as':_0x1ea3a2['as'],'attributes':_0x1ea3a2[_0x845d('0x21')],'include':_0x1ea3a2[_0x845d('0x23')]?_['map'](_0x1ea3a2['include'],function(_0x4c60c8){return{'model':db[_0x4c60c8[_0x845d('0x25')]],'as':_0x4c60c8['as'],'attributes':_0x4c60c8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f6d5b){logger[_0x845d('0x11')](_0x845d('0x1b'),_0x377998);logger['debug'](_0x845d('0x1b'),_0x377998,JSON[_0x845d('0x26')](_0x1f6d5b));_0x4a500a(_0x1f6d5b);})[_0x845d('0x1a')](function(_0x48e7a0){logger[_0x845d('0x15')]('GetChatQueue',_0x48e7a0[_0x845d('0x18')],_0x377998);_0xe5768b(_0x4683e1[_0x845d('0x15')](0x1f4,_0x48e7a0[_0x845d('0x18')]));});});};exports[_0x845d('0x27')]=function(_0x142c0f){var _0x546d77=this;return new Promise(function(_0x541de4,_0xf2e232){return db[_0x845d('0x1c')][_0x845d('0x28')]({'raw':_0x142c0f[_0x845d('0x1e')]?_0x142c0f['options']['raw']===undefined?!![]:![]:!![],'where':_0x142c0f[_0x845d('0x1e')]?_0x142c0f['options'][_0x845d('0x20')]||null:null,'attributes':_0x142c0f['options']?_0x142c0f[_0x845d('0x1e')][_0x845d('0x21')]||null:null,'include':_0x142c0f[_0x845d('0x1e')]?_0x142c0f['options'][_0x845d('0x23')]?_[_0x845d('0x24')](_0x142c0f['options'][_0x845d('0x23')],function(_0xcedad){return{'model':db[_0xcedad[_0x845d('0x25')]],'as':_0xcedad['as'],'attributes':_0xcedad[_0x845d('0x21')],'include':_0xcedad[_0x845d('0x23')]?_[_0x845d('0x24')](_0xcedad['include'],function(_0x2b87ce){return{'model':db[_0x2b87ce['model']],'as':_0x2b87ce['as'],'attributes':_0x2b87ce[_0x845d('0x21')],'include':_0x2b87ce[_0x845d('0x23')]?_[_0x845d('0x24')](_0x2b87ce[_0x845d('0x23')],function(_0x47c48f){return{'model':db[_0x47c48f[_0x845d('0x25')]],'as':_0x47c48f['as'],'attributes':_0x47c48f[_0x845d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x845d('0x10')](function(_0xd33156){logger[_0x845d('0x11')](_0x845d('0x27'),_0x142c0f);logger[_0x845d('0x13')]('ShowChatQueue',_0x142c0f,JSON['stringify'](_0xd33156));_0x541de4(_0xd33156);})[_0x845d('0x1a')](function(_0x534a2c){logger['error'](_0x845d('0x27'),_0x534a2c[_0x845d('0x18')],_0x142c0f);_0xf2e232(_0x546d77[_0x845d('0x15')](0x1f4,_0x534a2c[_0x845d('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 62fff5f..41f418f 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 _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x334815,_0x46bf53){var _0x49e9ae=function(_0x5688d4){while(--_0x5688d4){_0x334815['push'](_0x334815['shift']());}};_0x49e9ae(++_0x46bf53);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1ed9bb,_0x123c72){_0x1ed9bb=_0x1ed9bb-0x0;var _0x27ce3e=_0x6f0d[_0x1ed9bb];return _0x27ce3e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}};
\ No newline at end of file
+var _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x5c5cd2,_0x5033f3){var _0x1f78b3=function(_0x20efa6){while(--_0x20efa6){_0x5c5cd2['push'](_0x5c5cd2['shift']());}};_0x1f78b3(++_0x5033f3);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 92b7a04..9d2dece 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3708f6,_0x57e46f){var _0x33d960=function(_0x4da776){while(--_0x4da776){_0x3708f6['push'](_0x3708f6['shift']());}};_0x33d960(++_0x57e46f);}(_0xe14b,0x93));var _0xbe14=function(_0x152e00,_0x37404b){_0x152e00=_0x152e00-0x0;var _0x3b4c1a=_0xe14b[_0x152e00];return _0x3b4c1a;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23e51b,_0x3da511){var _0x110999=function(_0x162ea0){while(--_0x162ea0){_0x23e51b['push'](_0x23e51b['shift']());}};_0x110999(++_0x3da511);}(_0x008c,0x188));var _0xc008=function(_0x291bc2,_0x580442){_0x291bc2=_0x291bc2-0x0;var _0xab139c=_0x008c[_0x291bc2];return _0xab139c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e36615c..cc2711f 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 _0xe6f0=['exports','STRING','DATE'];(function(_0x3a209f,_0x116905){var _0x4eeb4f=function(_0x414387){while(--_0x414387){_0x3a209f['push'](_0x3a209f['shift']());}};_0x4eeb4f(++_0x116905);}(_0xe6f0,0x10e));var _0x0e6f=function(_0x18b86d,_0x45e41d){_0x18b86d=_0x18b86d-0x0;var _0x5b9f9d=_0xe6f0[_0x18b86d];return _0x5b9f9d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0e6f('0x0')]={'uniqueid':{'type':Sequelize[_0x0e6f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0e6f('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0e6f('0x2')]},'acceptAt':{'type':Sequelize[_0x0e6f('0x2')]},'exitAt':{'type':Sequelize[_0x0e6f('0x2')]},'reason':{'type':Sequelize[_0x0e6f('0x1')]}};
\ No newline at end of file
+var _0x2122=['sequelize','exports','STRING','DATE','moment'];(function(_0xa9ffa5,_0x2d8774){var _0x4fc76a=function(_0x2ad13c){while(--_0x2ad13c){_0xa9ffa5['push'](_0xa9ffa5['shift']());}};_0x4fc76a(++_0x2d8774);}(_0x2122,0x167));var _0x2212=function(_0x253e49,_0x16549e){_0x253e49=_0x253e49-0x0;var _0x59b8aa=_0x2122[_0x253e49];return _0x59b8aa;};'use strict';var moment=require(_0x2212('0x0'));var Sequelize=require(_0x2212('0x1'));module[_0x2212('0x2')]={'uniqueid':{'type':Sequelize[_0x2212('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2212('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2212('0x4')]},'exitAt':{'type':Sequelize[_0x2212('0x4')]},'reason':{'type':Sequelize[_0x2212('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 69c6d6c..5a1608b 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 _0x103f=['rows','catch','show','params','intersection','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','index','ChatQueueReport','rawAttributes','fieldName','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x203b79,_0x3662e0){var _0xfd2f50=function(_0x201f0d){while(--_0x201f0d){_0x203b79['push'](_0x203b79['shift']());}};_0xfd2f50(++_0x3662e0);}(_0x103f,0x13e));var _0xf103=function(_0x1d62bc,_0x49ba33){_0x1d62bc=_0x1d62bc-0x0;var _0x7e3156=_0x103f[_0x1d62bc];return _0x7e3156;};'use strict';var emlformat=require(_0xf103('0x0'));var rimraf=require(_0xf103('0x1'));var zipdir=require(_0xf103('0x2'));var jsonpatch=require(_0xf103('0x3'));var rp=require(_0xf103('0x4'));var moment=require(_0xf103('0x5'));var BPromise=require(_0xf103('0x6'));var Mustache=require(_0xf103('0x7'));var util=require(_0xf103('0x8'));var path=require(_0xf103('0x9'));var sox=require('sox');var csv=require(_0xf103('0xa'));var ejs=require(_0xf103('0xb'));var fs=require('fs');var fs_extra=require(_0xf103('0xc'));var _=require(_0xf103('0xd'));var squel=require(_0xf103('0xe'));var crypto=require(_0xf103('0xf'));var jsforce=require(_0xf103('0x10'));var deskjs=require(_0xf103('0x11'));var toCsv=require(_0xf103('0xa'));var querystring=require(_0xf103('0x12'));var Papa=require(_0xf103('0x13'));var Redis=require(_0xf103('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf103('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf103('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf103('0x17'));var config=require(_0xf103('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf103('0x19'))['db'];function respondWithStatusCode(_0x568960,_0x5735d1){_0x5735d1=_0x5735d1||0xcc;return function(_0x4e7ec5){if(_0x4e7ec5){return _0x568960[_0xf103('0x1a')](_0x5735d1);}return _0x568960['status'](_0x5735d1)[_0xf103('0x1b')]();};}function respondWithResult(_0x1e8765,_0x55ec64){_0x55ec64=_0x55ec64||0xc8;return function(_0x189a41){if(_0x189a41){return _0x1e8765[_0xf103('0x1c')](_0x55ec64)['json'](_0x189a41);}};}function respondWithFilteredResult(_0x1de2a8,_0x299ddf){return function(_0x5bf405){if(_0x5bf405){var _0x13be78=typeof _0x299ddf['offset']==='undefined'&&typeof _0x299ddf[_0xf103('0x1d')]===_0xf103('0x1e');var _0x31e26e=_0x5bf405[_0xf103('0x1f')];var _0x1659fa=_0x13be78?0x0:_0x299ddf[_0xf103('0x20')];var _0x5a2e85=_0x13be78?_0x5bf405[_0xf103('0x1f')]:_0x299ddf[_0xf103('0x20')]+_0x299ddf['limit'];var _0x21ea69;if(_0x5a2e85>=_0x31e26e){_0x5a2e85=_0x31e26e;_0x21ea69=0xc8;}else{_0x21ea69=0xce;}_0x1de2a8[_0xf103('0x1c')](_0x21ea69);return _0x1de2a8[_0xf103('0x21')](_0xf103('0x22'),_0x1659fa+'-'+_0x5a2e85+'/'+_0x31e26e)[_0xf103('0x23')](_0x5bf405);}return null;};}function patchUpdates(_0x5d28e9){return function(_0x32aaa5){try{jsonpatch[_0xf103('0x24')](_0x32aaa5,_0x5d28e9,!![]);}catch(_0x467b15){return BPromise[_0xf103('0x25')](_0x467b15);}return _0x32aaa5[_0xf103('0x26')]();};}function saveUpdates(_0x319c49,_0x3607ce){return function(_0x111e83){if(_0x111e83){return _0x111e83['update'](_0x319c49)[_0xf103('0x27')](function(_0x4fab08){return _0x4fab08;});}return null;};}function removeEntity(_0x470479,_0x4d1752){return function(_0x3a8d9e){if(_0x3a8d9e){return _0x3a8d9e[_0xf103('0x28')]()[_0xf103('0x27')](function(){_0x470479[_0xf103('0x1c')](0xcc)[_0xf103('0x1b')]();});}};}function handleEntityNotFound(_0x297198,_0x23a122){return function(_0x259797){if(!_0x259797){_0x297198['sendStatus'](0x194);}return _0x259797;};}function handleError(_0x2c415a,_0x4bdc52){_0x4bdc52=_0x4bdc52||0x1f4;return function(_0x259fdc){logger['error'](_0x259fdc[_0xf103('0x29')]);if(_0x259fdc[_0xf103('0x2a')]){delete _0x259fdc[_0xf103('0x2a')];}_0x2c415a[_0xf103('0x1c')](_0x4bdc52)['send'](_0x259fdc);};}exports[_0xf103('0x2b')]=function(_0x1d3cdd,_0x14b6b7){var _0x5a1f81={},_0x4adf44={},_0x1b0a13={'count':0x0,'rows':[]};var _0x7ee263=_['map'](db[_0xf103('0x2c')][_0xf103('0x2d')],function(_0x2fab93){return{'name':_0x2fab93[_0xf103('0x2e')],'type':_0x2fab93['type']['key']};});_0x4adf44['model']=_['map'](_0x7ee263,_0xf103('0x2a'));_0x4adf44['query']=_[_0xf103('0x2f')](_0x1d3cdd[_0xf103('0x30')]);_0x4adf44[_0xf103('0x31')]=_['intersection'](_0x4adf44['model'],_0x4adf44[_0xf103('0x30')]);_0x5a1f81[_0xf103('0x32')]=_['intersection'](_0x4adf44[_0xf103('0x33')],qs[_0xf103('0x34')](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x34')]));_0x5a1f81[_0xf103('0x32')]=_0x5a1f81[_0xf103('0x32')][_0xf103('0x35')]?_0x5a1f81[_0xf103('0x32')]:_0x4adf44[_0xf103('0x33')];if(!_0x1d3cdd[_0xf103('0x30')][_0xf103('0x36')](_0xf103('0x37'))){_0x5a1f81[_0xf103('0x1d')]=qs[_0xf103('0x1d')](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x1d')]);_0x5a1f81[_0xf103('0x20')]=qs['offset'](_0x1d3cdd[_0xf103('0x30')][_0xf103('0x20')]);}_0x5a1f81[_0xf103('0x38')]=qs['sort'](_0x1d3cdd[_0xf103('0x30')]['sort']);_0x5a1f81['where']=qs[_0xf103('0x31')](_[_0xf103('0x39')](_0x1d3cdd[_0xf103('0x30')],_0x4adf44[_0xf103('0x31')]),_0x7ee263);if(_0x1d3cdd[_0xf103('0x30')][_0xf103('0x3a')]){_0x5a1f81[_0xf103('0x3b')]=_[_0xf103('0x3c')](_0x5a1f81[_0xf103('0x3b')],{'$or':_['map'](_0x7ee263,function(_0x3cd906){if(_0x3cd906[_0xf103('0x3d')]!==_0xf103('0x3e')){var _0x4a192c={};_0x4a192c[_0x3cd906[_0xf103('0x2a')]]={'$like':'%'+_0x1d3cdd[_0xf103('0x30')][_0xf103('0x3a')]+'%'};return _0x4a192c;}})});}_0x5a1f81=_['merge']({},_0x5a1f81,_0x1d3cdd[_0xf103('0x3f')]);var _0x7ff67a={'where':_0x5a1f81[_0xf103('0x3b')]};return db[_0xf103('0x2c')][_0xf103('0x1f')](_0x7ff67a)['then'](function(_0x4c22b2){_0x1b0a13[_0xf103('0x1f')]=_0x4c22b2;if(_0x1d3cdd[_0xf103('0x30')][_0xf103('0x40')]){_0x5a1f81[_0xf103('0x41')]=[{'all':!![]}];}return db[_0xf103('0x2c')][_0xf103('0x42')](_0x5a1f81);})[_0xf103('0x27')](function(_0x304ce2){_0x1b0a13[_0xf103('0x43')]=_0x304ce2;return _0x1b0a13;})[_0xf103('0x27')](respondWithFilteredResult(_0x14b6b7,_0x5a1f81))[_0xf103('0x44')](handleError(_0x14b6b7,null));};exports[_0xf103('0x45')]=function(_0x439cf4,_0x26df37){var _0x434a3a={'raw':!![],'where':{'id':_0x439cf4[_0xf103('0x46')]['id']}},_0x16ed02={};_0x16ed02['model']=_['keys'](db[_0xf103('0x2c')][_0xf103('0x2d')]);_0x16ed02['query']=_[_0xf103('0x2f')](_0x439cf4[_0xf103('0x30')]);_0x16ed02[_0xf103('0x31')]=_[_0xf103('0x47')](_0x16ed02[_0xf103('0x33')],_0x16ed02['query']);_0x434a3a[_0xf103('0x32')]=_[_0xf103('0x47')](_0x16ed02['model'],qs[_0xf103('0x34')](_0x439cf4[_0xf103('0x30')][_0xf103('0x34')]));_0x434a3a[_0xf103('0x32')]=_0x434a3a[_0xf103('0x32')]['length']?_0x434a3a['attributes']:_0x16ed02['model'];if(_0x439cf4['query'][_0xf103('0x40')]){_0x434a3a[_0xf103('0x41')]=[{'all':!![]}];}_0x434a3a=_[_0xf103('0x3c')]({},_0x434a3a,_0x439cf4[_0xf103('0x3f')]);return db[_0xf103('0x2c')][_0xf103('0x48')](_0x434a3a)[_0xf103('0x27')](handleEntityNotFound(_0x26df37,null))[_0xf103('0x27')](respondWithResult(_0x26df37,null))[_0xf103('0x44')](handleError(_0x26df37,null));};exports[_0xf103('0x49')]=function(_0x326562,_0x2f6cca){return db[_0xf103('0x2c')]['create'](_0x326562[_0xf103('0x4a')],{})[_0xf103('0x27')](respondWithResult(_0x2f6cca,0xc9))['catch'](handleError(_0x2f6cca,null));};exports[_0xf103('0x4b')]=function(_0x5209ac,_0x382217){if(_0x5209ac[_0xf103('0x4a')]['id']){delete _0x5209ac[_0xf103('0x4a')]['id'];}return db[_0xf103('0x2c')][_0xf103('0x48')]({'where':{'id':_0x5209ac['params']['id']}})[_0xf103('0x27')](handleEntityNotFound(_0x382217,null))['then'](saveUpdates(_0x5209ac[_0xf103('0x4a')],null))[_0xf103('0x27')](respondWithResult(_0x382217,null))['catch'](handleError(_0x382217,null));};exports['destroy']=function(_0x267e8f,_0x677aaf){return db[_0xf103('0x2c')][_0xf103('0x48')]({'where':{'id':_0x267e8f[_0xf103('0x46')]['id']}})['then'](handleEntityNotFound(_0x677aaf,null))[_0xf103('0x27')](removeEntity(_0x677aaf,null))[_0xf103('0x44')](handleError(_0x677aaf,null));};exports['describe']=function(_0x463494,_0x2a0e12){return db[_0xf103('0x2c')][_0xf103('0x4c')]()[_0xf103('0x27')](respondWithResult(_0x2a0e12,null))['catch'](handleError(_0x2a0e12,null));};
\ No newline at end of file
+var _0xe635=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','status','error','stack','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x49818b,_0x11f5b9){var _0x58ec37=function(_0x56a59b){while(--_0x56a59b){_0x49818b['push'](_0x49818b['shift']());}};_0x58ec37(++_0x11f5b9);}(_0xe635,0x1be));var _0x5e63=function(_0x28e3d3,_0x54fb1b){_0x28e3d3=_0x28e3d3-0x0;var _0x257607=_0xe635[_0x28e3d3];return _0x257607;};'use strict';var emlformat=require(_0x5e63('0x0'));var rimraf=require(_0x5e63('0x1'));var zipdir=require(_0x5e63('0x2'));var jsonpatch=require(_0x5e63('0x3'));var rp=require(_0x5e63('0x4'));var moment=require(_0x5e63('0x5'));var BPromise=require(_0x5e63('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5e63('0x7'));var sox=require(_0x5e63('0x8'));var csv=require(_0x5e63('0x9'));var ejs=require(_0x5e63('0xa'));var fs=require('fs');var fs_extra=require(_0x5e63('0xb'));var _=require(_0x5e63('0xc'));var squel=require(_0x5e63('0xd'));var crypto=require(_0x5e63('0xe'));var jsforce=require(_0x5e63('0xf'));var deskjs=require(_0x5e63('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5e63('0x11'));var Papa=require(_0x5e63('0x12'));var Redis=require(_0x5e63('0x13'));var authService=require(_0x5e63('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5e63('0x15'));var hardwareService=require(_0x5e63('0x16'));var logger=require('../../config/logger')(_0x5e63('0x17'));var utils=require(_0x5e63('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5e63('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dcbf4,_0x23c833){_0x23c833=_0x23c833||0xcc;return function(_0x3bc901){if(_0x3bc901){return _0x1dcbf4[_0x5e63('0x1a')](_0x23c833);}return _0x1dcbf4['status'](_0x23c833)['end']();};}function respondWithResult(_0x560fee,_0x187e2e){_0x187e2e=_0x187e2e||0xc8;return function(_0x1fc0f8){if(_0x1fc0f8){return _0x560fee['status'](_0x187e2e)[_0x5e63('0x1b')](_0x1fc0f8);}};}function respondWithFilteredResult(_0x1f7149,_0x3c5d47){return function(_0x491e27){if(_0x491e27){var _0x42a714=typeof _0x3c5d47[_0x5e63('0x1c')]===_0x5e63('0x1d')&&typeof _0x3c5d47[_0x5e63('0x1e')]===_0x5e63('0x1d');var _0x578c68=_0x491e27[_0x5e63('0x1f')];var _0x42b370=_0x42a714?0x0:_0x3c5d47[_0x5e63('0x1c')];var _0xbdcef0=_0x42a714?_0x491e27[_0x5e63('0x1f')]:_0x3c5d47['offset']+_0x3c5d47[_0x5e63('0x1e')];var _0x566514;if(_0xbdcef0>=_0x578c68){_0xbdcef0=_0x578c68;_0x566514=0xc8;}else{_0x566514=0xce;}_0x1f7149['status'](_0x566514);return _0x1f7149[_0x5e63('0x20')](_0x5e63('0x21'),_0x42b370+'-'+_0xbdcef0+'/'+_0x578c68)[_0x5e63('0x1b')](_0x491e27);}return null;};}function patchUpdates(_0x2ba2f0){return function(_0x239d37){try{jsonpatch[_0x5e63('0x22')](_0x239d37,_0x2ba2f0,!![]);}catch(_0x464b76){return BPromise[_0x5e63('0x23')](_0x464b76);}return _0x239d37[_0x5e63('0x24')]();};}function saveUpdates(_0x3fdabb,_0x4c52f9){return function(_0x11c00f){if(_0x11c00f){return _0x11c00f['update'](_0x3fdabb)['then'](function(_0xeeff0e){return _0xeeff0e;});}return null;};}function removeEntity(_0x3ff002,_0x2d9387){return function(_0x9dc630){if(_0x9dc630){return _0x9dc630[_0x5e63('0x25')]()[_0x5e63('0x26')](function(){_0x3ff002[_0x5e63('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x275715,_0x58628a){return function(_0xeef6b7){if(!_0xeef6b7){_0x275715[_0x5e63('0x1a')](0x194);}return _0xeef6b7;};}function handleError(_0x5b468d,_0x3f9440){_0x3f9440=_0x3f9440||0x1f4;return function(_0x4fe1b3){logger[_0x5e63('0x28')](_0x4fe1b3[_0x5e63('0x29')]);if(_0x4fe1b3['name']){delete _0x4fe1b3['name'];}_0x5b468d[_0x5e63('0x27')](_0x3f9440)[_0x5e63('0x2a')](_0x4fe1b3);};}exports[_0x5e63('0x2b')]=function(_0x395bb2,_0x38da60){var _0x25c635={},_0x4b3e42={},_0x104694={'count':0x0,'rows':[]};var _0x56a105=_[_0x5e63('0x2c')](db[_0x5e63('0x2d')][_0x5e63('0x2e')],function(_0x2bd382){return{'name':_0x2bd382[_0x5e63('0x2f')],'type':_0x2bd382[_0x5e63('0x30')]['key']};});_0x4b3e42[_0x5e63('0x31')]=_[_0x5e63('0x2c')](_0x56a105,_0x5e63('0x32'));_0x4b3e42['query']=_[_0x5e63('0x33')](_0x395bb2[_0x5e63('0x34')]);_0x4b3e42[_0x5e63('0x35')]=_[_0x5e63('0x36')](_0x4b3e42['model'],_0x4b3e42['query']);_0x25c635['attributes']=_['intersection'](_0x4b3e42[_0x5e63('0x31')],qs[_0x5e63('0x37')](_0x395bb2[_0x5e63('0x34')]['fields']));_0x25c635[_0x5e63('0x38')]=_0x25c635[_0x5e63('0x38')]['length']?_0x25c635[_0x5e63('0x38')]:_0x4b3e42[_0x5e63('0x31')];if(!_0x395bb2[_0x5e63('0x34')][_0x5e63('0x39')]('nolimit')){_0x25c635[_0x5e63('0x1e')]=qs['limit'](_0x395bb2['query'][_0x5e63('0x1e')]);_0x25c635[_0x5e63('0x1c')]=qs[_0x5e63('0x1c')](_0x395bb2[_0x5e63('0x34')]['offset']);}_0x25c635[_0x5e63('0x3a')]=qs[_0x5e63('0x3b')](_0x395bb2[_0x5e63('0x34')][_0x5e63('0x3b')]);_0x25c635[_0x5e63('0x3c')]=qs[_0x5e63('0x35')](_[_0x5e63('0x3d')](_0x395bb2[_0x5e63('0x34')],_0x4b3e42['filters']),_0x56a105);if(_0x395bb2[_0x5e63('0x34')]['filter']){_0x25c635[_0x5e63('0x3c')]=_['merge'](_0x25c635[_0x5e63('0x3c')],{'$or':_[_0x5e63('0x2c')](_0x56a105,function(_0x5555fc){if(_0x5555fc[_0x5e63('0x30')]!==_0x5e63('0x3e')){var _0x14a660={};_0x14a660[_0x5555fc[_0x5e63('0x32')]]={'$like':'%'+_0x395bb2['query']['filter']+'%'};return _0x14a660;}})});}_0x25c635=_[_0x5e63('0x3f')]({},_0x25c635,_0x395bb2[_0x5e63('0x40')]);var _0x288ab1={'where':_0x25c635[_0x5e63('0x3c')]};return db['ChatQueueReport']['count'](_0x288ab1)['then'](function(_0x416f30){_0x104694[_0x5e63('0x1f')]=_0x416f30;if(_0x395bb2[_0x5e63('0x34')][_0x5e63('0x41')]){_0x25c635[_0x5e63('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x5e63('0x43')](_0x25c635);})[_0x5e63('0x26')](function(_0x51b36c){_0x104694[_0x5e63('0x44')]=_0x51b36c;return _0x104694;})['then'](respondWithFilteredResult(_0x38da60,_0x25c635))[_0x5e63('0x45')](handleError(_0x38da60,null));};exports['show']=function(_0x286266,_0x3c544c){var _0x14861f={'raw':!![],'where':{'id':_0x286266[_0x5e63('0x46')]['id']}},_0x4d1bf1={};_0x4d1bf1[_0x5e63('0x31')]=_[_0x5e63('0x33')](db[_0x5e63('0x2d')][_0x5e63('0x2e')]);_0x4d1bf1[_0x5e63('0x34')]=_['keys'](_0x286266[_0x5e63('0x34')]);_0x4d1bf1[_0x5e63('0x35')]=_[_0x5e63('0x36')](_0x4d1bf1[_0x5e63('0x31')],_0x4d1bf1[_0x5e63('0x34')]);_0x14861f['attributes']=_[_0x5e63('0x36')](_0x4d1bf1[_0x5e63('0x31')],qs['fields'](_0x286266['query'][_0x5e63('0x37')]));_0x14861f['attributes']=_0x14861f[_0x5e63('0x38')]['length']?_0x14861f['attributes']:_0x4d1bf1[_0x5e63('0x31')];if(_0x286266[_0x5e63('0x34')][_0x5e63('0x41')]){_0x14861f[_0x5e63('0x42')]=[{'all':!![]}];}_0x14861f=_[_0x5e63('0x3f')]({},_0x14861f,_0x286266[_0x5e63('0x40')]);return db[_0x5e63('0x2d')][_0x5e63('0x47')](_0x14861f)[_0x5e63('0x26')](handleEntityNotFound(_0x3c544c,null))[_0x5e63('0x26')](respondWithResult(_0x3c544c,null))[_0x5e63('0x45')](handleError(_0x3c544c,null));};exports[_0x5e63('0x48')]=function(_0x266493,_0x571e6d){return db[_0x5e63('0x2d')][_0x5e63('0x48')](_0x266493[_0x5e63('0x49')],{})[_0x5e63('0x26')](respondWithResult(_0x571e6d,0xc9))[_0x5e63('0x45')](handleError(_0x571e6d,null));};exports[_0x5e63('0x4a')]=function(_0x4aad13,_0x2968bd){if(_0x4aad13['body']['id']){delete _0x4aad13[_0x5e63('0x49')]['id'];}return db['ChatQueueReport'][_0x5e63('0x47')]({'where':{'id':_0x4aad13[_0x5e63('0x46')]['id']}})['then'](handleEntityNotFound(_0x2968bd,null))['then'](saveUpdates(_0x4aad13['body'],null))[_0x5e63('0x26')](respondWithResult(_0x2968bd,null))['catch'](handleError(_0x2968bd,null));};exports[_0x5e63('0x25')]=function(_0x4be837,_0x43001f){return db[_0x5e63('0x2d')][_0x5e63('0x47')]({'where':{'id':_0x4be837['params']['id']}})['then'](handleEntityNotFound(_0x43001f,null))[_0x5e63('0x26')](removeEntity(_0x43001f,null))['catch'](handleError(_0x43001f,null));};exports[_0x5e63('0x4b')]=function(_0x24426f,_0x82e226){return db['ChatQueueReport'][_0x5e63('0x4b')]()['then'](respondWithResult(_0x82e226,null))[_0x5e63('0x45')](handleError(_0x82e226,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 2b8b162..97a6717 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x273bde,_0xe53b0){var _0x3401ac=function(_0x460f93){while(--_0x460f93){_0x273bde['push'](_0x273bde['shift']());}};_0x3401ac(++_0xe53b0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x261363,_0x57a4f0){var _0x153c76=function(_0x51ff0f){while(--_0x51ff0f){_0x261363['push'](_0x261363['shift']());}};_0x153c76(++_0x57a4f0);}(_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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f05591c..c16b466 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 _0xaf02=['ChatQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','ChatQueueReport','create','body','options','raw','info','CreateChatQueueReport','UpdateChatQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','stringify','error'];(function(_0x20d14c,_0x44fad9){var _0x324717=function(_0x1a4d6e){while(--_0x1a4d6e){_0x20d14c['push'](_0x20d14c['shift']());}};_0x324717(++_0x44fad9);}(_0xaf02,0x90));var _0x2af0=function(_0x4471d3,_0x53f1c5){_0x4471d3=_0x4471d3-0x0;var _0x403ca7=_0xaf02[_0x4471d3];return _0x403ca7;};'use strict';var _=require(_0x2af0('0x0'));var util=require(_0x2af0('0x1'));var moment=require('moment');var BPromise=require(_0x2af0('0x2'));var rs=require(_0x2af0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2af0('0x4'))['db'];var utils=require(_0x2af0('0x5'));var logger=require(_0x2af0('0x6'))(_0x2af0('0x7'));var config=require(_0x2af0('0x8'));var jayson=require(_0x2af0('0x9'));var client=jayson[_0x2af0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46fa24,_0x490d8e,_0x9afc16){return new BPromise(function(_0x3935e9,_0x29d049){return client[_0x2af0('0xb')](_0x46fa24,_0x9afc16)[_0x2af0('0xc')](function(_0x32dfee){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x490d8e,'request\x20sent');logger[_0x2af0('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x490d8e,'request\x20sent',JSON[_0x2af0('0xe')](_0x32dfee));if(_0x32dfee[_0x2af0('0xf')]){if(_0x32dfee[_0x2af0('0xf')]['code']===0x1f4){logger[_0x2af0('0xf')](_0x2af0('0x10'),_0x490d8e,_0x32dfee['error'][_0x2af0('0x11')]);return _0x29d049(_0x32dfee[_0x2af0('0xf')][_0x2af0('0x11')]);}logger[_0x2af0('0xf')](_0x2af0('0x10'),_0x490d8e,_0x32dfee[_0x2af0('0xf')]['message']);return _0x3935e9(_0x32dfee[_0x2af0('0xf')][_0x2af0('0x11')]);}else{logger['info'](_0x2af0('0x10'),_0x490d8e,_0x2af0('0x12'));_0x3935e9(_0x32dfee[_0x2af0('0x13')][_0x2af0('0x11')]);}})[_0x2af0('0x14')](function(_0x3e9a58){logger[_0x2af0('0xf')](_0x2af0('0x10'),_0x490d8e,_0x3e9a58);_0x29d049(_0x3e9a58);});});}exports['CreateChatQueueReport']=function(_0x4663b1){var _0x4330c2=this;return new Promise(function(_0xae7a9b,_0x205390){return db[_0x2af0('0x15')][_0x2af0('0x16')](_0x4663b1[_0x2af0('0x17')],{'raw':_0x4663b1[_0x2af0('0x18')]?_0x4663b1[_0x2af0('0x18')][_0x2af0('0x19')]===undefined?!![]:![]:!![]})[_0x2af0('0xc')](function(_0x4279f0){logger[_0x2af0('0x1a')](_0x2af0('0x1b'),_0x4663b1);logger['debug'](_0x2af0('0x1b'),_0x4663b1,JSON[_0x2af0('0xe')](_0x4279f0));_0xae7a9b(_0x4279f0);})[_0x2af0('0x14')](function(_0x2b25fb){logger['error'](_0x2af0('0x1b'),_0x2b25fb[_0x2af0('0x11')],_0x4663b1);_0x205390(_0x4330c2['error'](0x1f4,_0x2b25fb[_0x2af0('0x11')]));});});};exports[_0x2af0('0x1c')]=function(_0x40b175){var _0x2ff672=this;return new Promise(function(_0x47d9f9,_0x140fe7){return db['ChatQueueReport'][_0x2af0('0x1d')](_0x40b175[_0x2af0('0x17')],{'raw':_0x40b175[_0x2af0('0x18')]?_0x40b175[_0x2af0('0x18')][_0x2af0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40b175[_0x2af0('0x18')]?_0x40b175['options']['where']||null:null,'attributes':_0x40b175[_0x2af0('0x18')]?_0x40b175[_0x2af0('0x18')][_0x2af0('0x1e')]||null:null,'limit':_0x40b175[_0x2af0('0x18')]?_0x40b175['options'][_0x2af0('0x1f')]||null:null})[_0x2af0('0xc')](function(_0x1dc54f){logger[_0x2af0('0x1a')](_0x2af0('0x1c'),_0x40b175);logger[_0x2af0('0xd')](_0x2af0('0x1c'),_0x40b175,JSON[_0x2af0('0xe')](_0x1dc54f));_0x47d9f9(_0x1dc54f);})[_0x2af0('0x14')](function(_0x189131){logger[_0x2af0('0xf')](_0x2af0('0x1c'),_0x189131[_0x2af0('0x11')],_0x40b175);_0x140fe7(_0x2ff672['error'](0x1f4,_0x189131[_0x2af0('0x11')]));});});};
\ No newline at end of file
+var _0xe404=['UpdateChatQueueReport','update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','stringify'];(function(_0x165201,_0x27338d){var _0x12b17e=function(_0x29ff3b){while(--_0x29ff3b){_0x165201['push'](_0x165201['shift']());}};_0x12b17e(++_0x27338d);}(_0xe404,0x117));var _0x4e40=function(_0x2147b6,_0x5dfca3){_0x2147b6=_0x2147b6-0x0;var _0x497241=_0xe404[_0x2147b6];return _0x497241;};'use strict';var _=require(_0x4e40('0x0'));var util=require(_0x4e40('0x1'));var moment=require(_0x4e40('0x2'));var BPromise=require(_0x4e40('0x3'));var rs=require(_0x4e40('0x4'));var fs=require('fs');var Redis=require(_0x4e40('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4e40('0x6'))(_0x4e40('0x7'));var config=require(_0x4e40('0x8'));var jayson=require(_0x4e40('0x9'));var client=jayson[_0x4e40('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x450b68,_0x5cb646,_0x59d6d8){return new BPromise(function(_0x781196,_0xa7cf12){return client[_0x4e40('0xb')](_0x450b68,_0x59d6d8)[_0x4e40('0xc')](function(_0x1bfb5b){logger[_0x4e40('0xd')](_0x4e40('0xe'),_0x5cb646,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5cb646,_0x4e40('0xf'),JSON['stringify'](_0x1bfb5b));if(_0x1bfb5b[_0x4e40('0x10')]){if(_0x1bfb5b[_0x4e40('0x10')][_0x4e40('0x11')]===0x1f4){logger[_0x4e40('0x10')](_0x4e40('0xe'),_0x5cb646,_0x1bfb5b[_0x4e40('0x10')][_0x4e40('0x12')]);return _0xa7cf12(_0x1bfb5b[_0x4e40('0x10')][_0x4e40('0x12')]);}logger[_0x4e40('0x10')](_0x4e40('0xe'),_0x5cb646,_0x1bfb5b[_0x4e40('0x10')][_0x4e40('0x12')]);return _0x781196(_0x1bfb5b[_0x4e40('0x10')][_0x4e40('0x12')]);}else{logger[_0x4e40('0xd')](_0x4e40('0xe'),_0x5cb646,_0x4e40('0xf'));_0x781196(_0x1bfb5b[_0x4e40('0x13')][_0x4e40('0x12')]);}})[_0x4e40('0x14')](function(_0x4921b6){logger[_0x4e40('0x10')](_0x4e40('0xe'),_0x5cb646,_0x4921b6);_0xa7cf12(_0x4921b6);});});}exports[_0x4e40('0x15')]=function(_0x157304){var _0x28193b=this;return new Promise(function(_0x4b4d1c,_0x32c42c){return db[_0x4e40('0x16')][_0x4e40('0x17')](_0x157304['body'],{'raw':_0x157304['options']?_0x157304[_0x4e40('0x18')][_0x4e40('0x19')]===undefined?!![]:![]:!![]})[_0x4e40('0xc')](function(_0x36dd5f){logger[_0x4e40('0xd')](_0x4e40('0x15'),_0x157304);logger['debug']('CreateChatQueueReport',_0x157304,JSON[_0x4e40('0x1a')](_0x36dd5f));_0x4b4d1c(_0x36dd5f);})[_0x4e40('0x14')](function(_0x42db96){logger['error'](_0x4e40('0x15'),_0x42db96[_0x4e40('0x12')],_0x157304);_0x32c42c(_0x28193b[_0x4e40('0x10')](0x1f4,_0x42db96[_0x4e40('0x12')]));});});};exports[_0x4e40('0x1b')]=function(_0x203edd){var _0x2f9699=this;return new Promise(function(_0x12d3a1,_0x4ca270){return db[_0x4e40('0x16')][_0x4e40('0x1c')](_0x203edd[_0x4e40('0x1d')],{'raw':_0x203edd[_0x4e40('0x18')]?_0x203edd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203edd[_0x4e40('0x18')]?_0x203edd[_0x4e40('0x18')][_0x4e40('0x1e')]||null:null,'attributes':_0x203edd['options']?_0x203edd['options'][_0x4e40('0x1f')]||null:null,'limit':_0x203edd[_0x4e40('0x18')]?_0x203edd['options'][_0x4e40('0x20')]||null:null})[_0x4e40('0xc')](function(_0x4e9a4f){logger[_0x4e40('0xd')](_0x4e40('0x1b'),_0x203edd);logger[_0x4e40('0x21')](_0x4e40('0x1b'),_0x203edd,JSON[_0x4e40('0x1a')](_0x4e9a4f));_0x12d3a1(_0x4e9a4f);})[_0x4e40('0x14')](function(_0x238430){logger[_0x4e40('0x10')](_0x4e40('0x1b'),_0x238430[_0x4e40('0x12')],_0x203edd);_0x4ca270(_0x2f9699['error'](0x1f4,_0x238430[_0x4e40('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index ca01f1e..a95413d 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 _0x3f92=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','put','update','delete','destroy','exports','util','path'];(function(_0x1b7d0b,_0x4e5b15){var _0x20db16=function(_0x5d725c){while(--_0x5d725c){_0x1b7d0b['push'](_0x1b7d0b['shift']());}};_0x20db16(++_0x4e5b15);}(_0x3f92,0x116));var _0x23f9=function(_0x511497,_0x57ea9c){_0x511497=_0x511497-0x0;var _0x3c949a=_0x3f92[_0x511497];return _0x3c949a;};'use strict';var multer=require('multer');var util=require(_0x23f9('0x0'));var path=require(_0x23f9('0x1'));var timeout=require('connect-timeout');var express=require(_0x23f9('0x2'));var router=express[_0x23f9('0x3')]();var fs_extra=require(_0x23f9('0x4'));var auth=require(_0x23f9('0x5'));var interaction=require(_0x23f9('0x6'));var config=require(_0x23f9('0x7'));var controller=require(_0x23f9('0x8'));router[_0x23f9('0x9')]('/',auth[_0x23f9('0xa')](),controller['index']);router[_0x23f9('0x9')](_0x23f9('0xb'),auth['isAuthenticated'](),controller[_0x23f9('0xc')]);router['get']('/:id',auth[_0x23f9('0xa')](),controller[_0x23f9('0xd')]);router[_0x23f9('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x23f9('0xf')]('/:id',auth[_0x23f9('0xa')](),controller[_0x23f9('0x10')]);router[_0x23f9('0x11')]('/:id',auth[_0x23f9('0xa')](),controller[_0x23f9('0x12')]);module[_0x23f9('0x13')]=router;
\ No newline at end of file
+var _0xd508=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','delete','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3161fd,_0x2a6c39){var _0x18f6a6=function(_0xad3c1e){while(--_0xad3c1e){_0x3161fd['push'](_0x3161fd['shift']());}};_0x18f6a6(++_0x2a6c39);}(_0xd508,0x77));var _0x8d50=function(_0x2fe51c,_0x5d55b5){_0x2fe51c=_0x2fe51c-0x0;var _0x1ddf0f=_0xd508[_0x2fe51c];return _0x1ddf0f;};'use strict';var multer=require(_0x8d50('0x0'));var util=require('util');var path=require(_0x8d50('0x1'));var timeout=require(_0x8d50('0x2'));var express=require(_0x8d50('0x3'));var router=express['Router']();var fs_extra=require(_0x8d50('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8d50('0x5'));var config=require(_0x8d50('0x6'));var controller=require(_0x8d50('0x7'));router[_0x8d50('0x8')]('/',auth[_0x8d50('0x9')](),controller[_0x8d50('0xa')]);router[_0x8d50('0x8')](_0x8d50('0xb'),auth[_0x8d50('0x9')](),controller[_0x8d50('0xc')]);router[_0x8d50('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8d50('0xd')]);router['post']('/',auth[_0x8d50('0x9')](),controller[_0x8d50('0xe')]);router[_0x8d50('0xf')](_0x8d50('0x10'),auth[_0x8d50('0x9')](),controller['update']);router[_0x8d50('0x11')]('/:id',auth[_0x8d50('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 66fe38b..6fb7a4e 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xed996a,_0x38a424){var _0x381be2=function(_0x441b70){while(--_0x441b70){_0xed996a['push'](_0xed996a['shift']());}};_0x381be2(++_0x38a424);}(_0x70e0,0x17b));var _0x070e=function(_0x2083bd,_0x554430){_0x2083bd=_0x2083bd-0x0;var _0x32a285=_0x70e0[_0x2083bd];return _0x32a285;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x9e72c8,_0x5ac1a9){var _0x1468b2=function(_0x2cac69){while(--_0x2cac69){_0x9e72c8['push'](_0x9e72c8['shift']());}};_0x1468b2(++_0x5ac1a9);}(_0x008c,0x188));var _0xc008=function(_0x494160,_0xadfa3f){_0x494160=_0x494160-0x0;var _0x5934b2=_0x008c[_0x494160];return _0x5934b2;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8281865..b5ee1b3 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 _0xdee2=['set','Content-Range','apply','reject','update','then','destroy','error','name','send','ChatTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x5474bc,_0xabecb7){var _0x18e6b5=function(_0x40bcfc){while(--_0x40bcfc){_0x5474bc['push'](_0x5474bc['shift']());}};_0x18e6b5(++_0xabecb7);}(_0xdee2,0x1f4));var _0x2dee=function(_0x2a530f,_0x20a9f2){_0x2a530f=_0x2a530f-0x0;var _0xdeb772=_0xdee2[_0x2a530f];return _0xdeb772;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2dee('0x0'));var zipdir=require(_0x2dee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2dee('0x2'));var moment=require(_0x2dee('0x3'));var BPromise=require(_0x2dee('0x4'));var Mustache=require(_0x2dee('0x5'));var util=require(_0x2dee('0x6'));var path=require('path');var sox=require(_0x2dee('0x7'));var csv=require(_0x2dee('0x8'));var ejs=require(_0x2dee('0x9'));var fs=require('fs');var fs_extra=require(_0x2dee('0xa'));var _=require(_0x2dee('0xb'));var squel=require(_0x2dee('0xc'));var crypto=require(_0x2dee('0xd'));var jsforce=require(_0x2dee('0xe'));var deskjs=require(_0x2dee('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2dee('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dee('0x11'));var qs=require(_0x2dee('0x12'));var as=require(_0x2dee('0x13'));var hardwareService=require(_0x2dee('0x14'));var logger=require(_0x2dee('0x15'))(_0x2dee('0x16'));var utils=require('../../config/utils');var config=require(_0x2dee('0x17'));var licenseUtil=require(_0x2dee('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a73a,_0x1c97fe){_0x1c97fe=_0x1c97fe||0xcc;return function(_0xcad7d){if(_0xcad7d){return _0x18a73a[_0x2dee('0x19')](_0x1c97fe);}return _0x18a73a[_0x2dee('0x1a')](_0x1c97fe)[_0x2dee('0x1b')]();};}function respondWithResult(_0x315b3d,_0x18931e){_0x18931e=_0x18931e||0xc8;return function(_0x28f3c4){if(_0x28f3c4){return _0x315b3d[_0x2dee('0x1a')](_0x18931e)['json'](_0x28f3c4);}};}function respondWithFilteredResult(_0x5068db,_0x15ca44){return function(_0x43bd23){if(_0x43bd23){var _0x49b2ae=typeof _0x15ca44[_0x2dee('0x1c')]===_0x2dee('0x1d')&&typeof _0x15ca44[_0x2dee('0x1e')]===_0x2dee('0x1d');var _0x4e06e9=_0x43bd23[_0x2dee('0x1f')];var _0x5e61aa=_0x49b2ae?0x0:_0x15ca44[_0x2dee('0x1c')];var _0x1f523d=_0x49b2ae?_0x43bd23[_0x2dee('0x1f')]:_0x15ca44[_0x2dee('0x1c')]+_0x15ca44[_0x2dee('0x1e')];var _0x38cc82;if(_0x1f523d>=_0x4e06e9){_0x1f523d=_0x4e06e9;_0x38cc82=0xc8;}else{_0x38cc82=0xce;}_0x5068db[_0x2dee('0x1a')](_0x38cc82);return _0x5068db[_0x2dee('0x20')](_0x2dee('0x21'),_0x5e61aa+'-'+_0x1f523d+'/'+_0x4e06e9)['json'](_0x43bd23);}return null;};}function patchUpdates(_0x43ee8b){return function(_0x3b153a){try{jsonpatch[_0x2dee('0x22')](_0x3b153a,_0x43ee8b,!![]);}catch(_0xbc3b05){return BPromise[_0x2dee('0x23')](_0xbc3b05);}return _0x3b153a['save']();};}function saveUpdates(_0x2c5c44,_0x18575c){return function(_0x566a13){if(_0x566a13){return _0x566a13[_0x2dee('0x24')](_0x2c5c44)[_0x2dee('0x25')](function(_0x475f59){return _0x475f59;});}return null;};}function removeEntity(_0x4c3118,_0x2e8685){return function(_0x5e9194){if(_0x5e9194){return _0x5e9194[_0x2dee('0x26')]()[_0x2dee('0x25')](function(){_0x4c3118[_0x2dee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523aa9,_0xcdf2f){return function(_0x3c19e5){if(!_0x3c19e5){_0x523aa9['sendStatus'](0x194);}return _0x3c19e5;};}function handleError(_0x5180e8,_0x1b1079){_0x1b1079=_0x1b1079||0x1f4;return function(_0x3dbff5){logger[_0x2dee('0x27')](_0x3dbff5['stack']);if(_0x3dbff5[_0x2dee('0x28')]){delete _0x3dbff5[_0x2dee('0x28')];}_0x5180e8[_0x2dee('0x1a')](_0x1b1079)[_0x2dee('0x29')](_0x3dbff5);};}exports['index']=function(_0x14b78b,_0xcc0e8a){var _0x249c45={},_0x459d7a={},_0x42960={'count':0x0,'rows':[]};var _0x399eeb=_['map'](db[_0x2dee('0x2a')]['rawAttributes'],function(_0x4e0ff1){return{'name':_0x4e0ff1[_0x2dee('0x2b')],'type':_0x4e0ff1[_0x2dee('0x2c')][_0x2dee('0x2d')]};});_0x459d7a[_0x2dee('0x2e')]=_['map'](_0x399eeb,_0x2dee('0x28'));_0x459d7a[_0x2dee('0x2f')]=_['keys'](_0x14b78b['query']);_0x459d7a[_0x2dee('0x30')]=_[_0x2dee('0x31')](_0x459d7a[_0x2dee('0x2e')],_0x459d7a[_0x2dee('0x2f')]);_0x249c45[_0x2dee('0x32')]=_['intersection'](_0x459d7a[_0x2dee('0x2e')],qs[_0x2dee('0x33')](_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x33')]));_0x249c45[_0x2dee('0x32')]=_0x249c45[_0x2dee('0x32')][_0x2dee('0x34')]?_0x249c45[_0x2dee('0x32')]:_0x459d7a[_0x2dee('0x2e')];if(!_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x35')](_0x2dee('0x36'))){_0x249c45['limit']=qs['limit'](_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x1e')]);_0x249c45[_0x2dee('0x1c')]=qs['offset'](_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x1c')]);}_0x249c45[_0x2dee('0x37')]=qs[_0x2dee('0x38')](_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x38')]);_0x249c45['where']=qs[_0x2dee('0x30')](_[_0x2dee('0x39')](_0x14b78b[_0x2dee('0x2f')],_0x459d7a[_0x2dee('0x30')]),_0x399eeb);if(_0x14b78b['query'][_0x2dee('0x3a')]){_0x249c45[_0x2dee('0x3b')]=_[_0x2dee('0x3c')](_0x249c45[_0x2dee('0x3b')],{'$or':_[_0x2dee('0x3d')](_0x399eeb,function(_0x313a1d){if(_0x313a1d['type']!==_0x2dee('0x3e')){var _0x5113f5={};_0x5113f5[_0x313a1d[_0x2dee('0x28')]]={'$like':'%'+_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x3a')]+'%'};return _0x5113f5;}})});}_0x249c45=_[_0x2dee('0x3c')]({},_0x249c45,_0x14b78b[_0x2dee('0x3f')]);var _0x1755a7={'where':_0x249c45[_0x2dee('0x3b')]};return db[_0x2dee('0x2a')]['count'](_0x1755a7)[_0x2dee('0x25')](function(_0x478673){_0x42960['count']=_0x478673;if(_0x14b78b[_0x2dee('0x2f')][_0x2dee('0x40')]){_0x249c45[_0x2dee('0x41')]=[{'all':!![]}];}return db[_0x2dee('0x2a')][_0x2dee('0x42')](_0x249c45);})[_0x2dee('0x25')](function(_0x4a0ea3){_0x42960[_0x2dee('0x43')]=_0x4a0ea3;return _0x42960;})[_0x2dee('0x25')](respondWithFilteredResult(_0xcc0e8a,_0x249c45))[_0x2dee('0x44')](handleError(_0xcc0e8a,null));};exports[_0x2dee('0x45')]=function(_0x2305ff,_0x47426f){var _0x54454c={'raw':!![],'where':{'id':_0x2305ff['params']['id']}},_0xf2e2f={};_0xf2e2f[_0x2dee('0x2e')]=_['keys'](db[_0x2dee('0x2a')]['rawAttributes']);_0xf2e2f[_0x2dee('0x2f')]=_[_0x2dee('0x46')](_0x2305ff[_0x2dee('0x2f')]);_0xf2e2f[_0x2dee('0x30')]=_[_0x2dee('0x31')](_0xf2e2f[_0x2dee('0x2e')],_0xf2e2f[_0x2dee('0x2f')]);_0x54454c['attributes']=_['intersection'](_0xf2e2f[_0x2dee('0x2e')],qs['fields'](_0x2305ff[_0x2dee('0x2f')]['fields']));_0x54454c[_0x2dee('0x32')]=_0x54454c[_0x2dee('0x32')][_0x2dee('0x34')]?_0x54454c[_0x2dee('0x32')]:_0xf2e2f[_0x2dee('0x2e')];if(_0x2305ff[_0x2dee('0x2f')][_0x2dee('0x40')]){_0x54454c[_0x2dee('0x41')]=[{'all':!![]}];}_0x54454c=_[_0x2dee('0x3c')]({},_0x54454c,_0x2305ff[_0x2dee('0x3f')]);return db['ChatTransferReport'][_0x2dee('0x47')](_0x54454c)[_0x2dee('0x25')](handleEntityNotFound(_0x47426f,null))[_0x2dee('0x25')](respondWithResult(_0x47426f,null))[_0x2dee('0x44')](handleError(_0x47426f,null));};exports[_0x2dee('0x48')]=function(_0x16a05e,_0xa36c9a){return db[_0x2dee('0x2a')]['create'](_0x16a05e[_0x2dee('0x49')],{})['then'](respondWithResult(_0xa36c9a,0xc9))[_0x2dee('0x44')](handleError(_0xa36c9a,null));};exports[_0x2dee('0x24')]=function(_0x3f6112,_0x370550){if(_0x3f6112['body']['id']){delete _0x3f6112[_0x2dee('0x49')]['id'];}return db['ChatTransferReport'][_0x2dee('0x47')]({'where':{'id':_0x3f6112[_0x2dee('0x4a')]['id']}})[_0x2dee('0x25')](handleEntityNotFound(_0x370550,null))[_0x2dee('0x25')](saveUpdates(_0x3f6112[_0x2dee('0x49')],null))[_0x2dee('0x25')](respondWithResult(_0x370550,null))[_0x2dee('0x44')](handleError(_0x370550,null));};exports[_0x2dee('0x26')]=function(_0xb78d56,_0xe1a1e){return db[_0x2dee('0x2a')]['find']({'where':{'id':_0xb78d56[_0x2dee('0x4a')]['id']}})[_0x2dee('0x25')](handleEntityNotFound(_0xe1a1e,null))[_0x2dee('0x25')](removeEntity(_0xe1a1e,null))[_0x2dee('0x44')](handleError(_0xe1a1e,null));};exports[_0x2dee('0x4b')]=function(_0x5e1c8e,_0x45dac1){return db[_0x2dee('0x2a')][_0x2dee('0x4b')]()[_0x2dee('0x25')](respondWithResult(_0x45dac1,null))[_0x2dee('0x44')](handleError(_0x45dac1,null));};
\ No newline at end of file
+var _0x2fda=['map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','ChatTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2fda,0xfb));var _0xa2fd=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x2fda[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2fd('0x0'));var zipdir=require(_0xa2fd('0x1'));var jsonpatch=require(_0xa2fd('0x2'));var rp=require(_0xa2fd('0x3'));var moment=require('moment');var BPromise=require(_0xa2fd('0x4'));var Mustache=require(_0xa2fd('0x5'));var util=require(_0xa2fd('0x6'));var path=require(_0xa2fd('0x7'));var sox=require(_0xa2fd('0x8'));var csv=require('to-csv');var ejs=require(_0xa2fd('0x9'));var fs=require('fs');var fs_extra=require(_0xa2fd('0xa'));var _=require(_0xa2fd('0xb'));var squel=require(_0xa2fd('0xc'));var crypto=require('crypto');var jsforce=require(_0xa2fd('0xd'));var deskjs=require(_0xa2fd('0xe'));var toCsv=require(_0xa2fd('0xf'));var querystring=require(_0xa2fd('0x10'));var Papa=require(_0xa2fd('0x11'));var Redis=require('ioredis');var authService=require(_0xa2fd('0x12'));var qs=require(_0xa2fd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2fd('0x14'))(_0xa2fd('0x15'));var utils=require(_0xa2fd('0x16'));var config=require(_0xa2fd('0x17'));var licenseUtil=require(_0xa2fd('0x18'));var db=require(_0xa2fd('0x19'))['db'];function respondWithStatusCode(_0x323deb,_0x3a79b9){_0x3a79b9=_0x3a79b9||0xcc;return function(_0x1e4675){if(_0x1e4675){return _0x323deb[_0xa2fd('0x1a')](_0x3a79b9);}return _0x323deb[_0xa2fd('0x1b')](_0x3a79b9)['end']();};}function respondWithResult(_0x43f8c9,_0xa8cbd3){_0xa8cbd3=_0xa8cbd3||0xc8;return function(_0x147f2a){if(_0x147f2a){return _0x43f8c9[_0xa2fd('0x1b')](_0xa8cbd3)['json'](_0x147f2a);}};}function respondWithFilteredResult(_0x1026f4,_0x9ae164){return function(_0x3c6d59){if(_0x3c6d59){var _0x55dcc8=typeof _0x9ae164[_0xa2fd('0x1c')]===_0xa2fd('0x1d')&&typeof _0x9ae164[_0xa2fd('0x1e')]===_0xa2fd('0x1d');var _0x1d4d76=_0x3c6d59[_0xa2fd('0x1f')];var _0x12d317=_0x55dcc8?0x0:_0x9ae164[_0xa2fd('0x1c')];var _0x49601e=_0x55dcc8?_0x3c6d59[_0xa2fd('0x1f')]:_0x9ae164[_0xa2fd('0x1c')]+_0x9ae164[_0xa2fd('0x1e')];var _0x5b7e38;if(_0x49601e>=_0x1d4d76){_0x49601e=_0x1d4d76;_0x5b7e38=0xc8;}else{_0x5b7e38=0xce;}_0x1026f4[_0xa2fd('0x1b')](_0x5b7e38);return _0x1026f4[_0xa2fd('0x20')](_0xa2fd('0x21'),_0x12d317+'-'+_0x49601e+'/'+_0x1d4d76)[_0xa2fd('0x22')](_0x3c6d59);}return null;};}function patchUpdates(_0x2197b5){return function(_0x35b930){try{jsonpatch['apply'](_0x35b930,_0x2197b5,!![]);}catch(_0x536b57){return BPromise[_0xa2fd('0x23')](_0x536b57);}return _0x35b930[_0xa2fd('0x24')]();};}function saveUpdates(_0x1d09ee,_0x593a2e){return function(_0x5d564c){if(_0x5d564c){return _0x5d564c[_0xa2fd('0x25')](_0x1d09ee)['then'](function(_0xbfaba5){return _0xbfaba5;});}return null;};}function removeEntity(_0x2631c0,_0x274a75){return function(_0x549047){if(_0x549047){return _0x549047[_0xa2fd('0x26')]()[_0xa2fd('0x27')](function(){_0x2631c0[_0xa2fd('0x1b')](0xcc)[_0xa2fd('0x28')]();});}};}function handleEntityNotFound(_0x17eccf,_0x3d4682){return function(_0xdcf4df){if(!_0xdcf4df){_0x17eccf[_0xa2fd('0x1a')](0x194);}return _0xdcf4df;};}function handleError(_0x56e00d,_0x1dcfa1){_0x1dcfa1=_0x1dcfa1||0x1f4;return function(_0x23332a){logger[_0xa2fd('0x29')](_0x23332a[_0xa2fd('0x2a')]);if(_0x23332a[_0xa2fd('0x2b')]){delete _0x23332a['name'];}_0x56e00d[_0xa2fd('0x1b')](_0x1dcfa1)[_0xa2fd('0x2c')](_0x23332a);};}exports[_0xa2fd('0x2d')]=function(_0x301bdf,_0x8813ab){var _0x23777e={},_0x4cb228={},_0x2c3f56={'count':0x0,'rows':[]};var _0x8e9373=_['map'](db[_0xa2fd('0x2e')]['rawAttributes'],function(_0x56bb40){return{'name':_0x56bb40['fieldName'],'type':_0x56bb40[_0xa2fd('0x2f')][_0xa2fd('0x30')]};});_0x4cb228[_0xa2fd('0x31')]=_['map'](_0x8e9373,_0xa2fd('0x2b'));_0x4cb228[_0xa2fd('0x32')]=_[_0xa2fd('0x33')](_0x301bdf[_0xa2fd('0x32')]);_0x4cb228[_0xa2fd('0x34')]=_[_0xa2fd('0x35')](_0x4cb228[_0xa2fd('0x31')],_0x4cb228[_0xa2fd('0x32')]);_0x23777e[_0xa2fd('0x36')]=_['intersection'](_0x4cb228['model'],qs[_0xa2fd('0x37')](_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x37')]));_0x23777e[_0xa2fd('0x36')]=_0x23777e[_0xa2fd('0x36')][_0xa2fd('0x38')]?_0x23777e[_0xa2fd('0x36')]:_0x4cb228[_0xa2fd('0x31')];if(!_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x39')](_0xa2fd('0x3a'))){_0x23777e[_0xa2fd('0x1e')]=qs['limit'](_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x1e')]);_0x23777e[_0xa2fd('0x1c')]=qs[_0xa2fd('0x1c')](_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x1c')]);}_0x23777e[_0xa2fd('0x3b')]=qs[_0xa2fd('0x3c')](_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x3c')]);_0x23777e[_0xa2fd('0x3d')]=qs[_0xa2fd('0x34')](_[_0xa2fd('0x3e')](_0x301bdf[_0xa2fd('0x32')],_0x4cb228[_0xa2fd('0x34')]),_0x8e9373);if(_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x3f')]){_0x23777e['where']=_[_0xa2fd('0x40')](_0x23777e[_0xa2fd('0x3d')],{'$or':_[_0xa2fd('0x41')](_0x8e9373,function(_0xc735bd){if(_0xc735bd[_0xa2fd('0x2f')]!==_0xa2fd('0x42')){var _0x4dc528={};_0x4dc528[_0xc735bd[_0xa2fd('0x2b')]]={'$like':'%'+_0x301bdf[_0xa2fd('0x32')]['filter']+'%'};return _0x4dc528;}})});}_0x23777e=_['merge']({},_0x23777e,_0x301bdf[_0xa2fd('0x43')]);var _0x5170d3={'where':_0x23777e['where']};return db[_0xa2fd('0x2e')][_0xa2fd('0x1f')](_0x5170d3)[_0xa2fd('0x27')](function(_0x58d8f7){_0x2c3f56[_0xa2fd('0x1f')]=_0x58d8f7;if(_0x301bdf[_0xa2fd('0x32')][_0xa2fd('0x44')]){_0x23777e[_0xa2fd('0x45')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa2fd('0x46')](_0x23777e);})['then'](function(_0x587730){_0x2c3f56[_0xa2fd('0x47')]=_0x587730;return _0x2c3f56;})['then'](respondWithFilteredResult(_0x8813ab,_0x23777e))[_0xa2fd('0x48')](handleError(_0x8813ab,null));};exports[_0xa2fd('0x49')]=function(_0x3a77db,_0x5573bb){var _0x5c6134={'raw':!![],'where':{'id':_0x3a77db[_0xa2fd('0x4a')]['id']}},_0x397400={};_0x397400[_0xa2fd('0x31')]=_[_0xa2fd('0x33')](db[_0xa2fd('0x2e')][_0xa2fd('0x4b')]);_0x397400[_0xa2fd('0x32')]=_['keys'](_0x3a77db[_0xa2fd('0x32')]);_0x397400[_0xa2fd('0x34')]=_[_0xa2fd('0x35')](_0x397400[_0xa2fd('0x31')],_0x397400[_0xa2fd('0x32')]);_0x5c6134[_0xa2fd('0x36')]=_[_0xa2fd('0x35')](_0x397400['model'],qs[_0xa2fd('0x37')](_0x3a77db[_0xa2fd('0x32')][_0xa2fd('0x37')]));_0x5c6134[_0xa2fd('0x36')]=_0x5c6134['attributes'][_0xa2fd('0x38')]?_0x5c6134[_0xa2fd('0x36')]:_0x397400[_0xa2fd('0x31')];if(_0x3a77db[_0xa2fd('0x32')][_0xa2fd('0x44')]){_0x5c6134['include']=[{'all':!![]}];}_0x5c6134=_['merge']({},_0x5c6134,_0x3a77db[_0xa2fd('0x43')]);return db[_0xa2fd('0x2e')][_0xa2fd('0x4c')](_0x5c6134)[_0xa2fd('0x27')](handleEntityNotFound(_0x5573bb,null))[_0xa2fd('0x27')](respondWithResult(_0x5573bb,null))['catch'](handleError(_0x5573bb,null));};exports['create']=function(_0x13eab1,_0x21c657){return db[_0xa2fd('0x2e')]['create'](_0x13eab1[_0xa2fd('0x4d')],{})[_0xa2fd('0x27')](respondWithResult(_0x21c657,0xc9))['catch'](handleError(_0x21c657,null));};exports[_0xa2fd('0x25')]=function(_0x376d7f,_0x17b17b){if(_0x376d7f[_0xa2fd('0x4d')]['id']){delete _0x376d7f[_0xa2fd('0x4d')]['id'];}return db['ChatTransferReport'][_0xa2fd('0x4c')]({'where':{'id':_0x376d7f['params']['id']}})[_0xa2fd('0x27')](handleEntityNotFound(_0x17b17b,null))[_0xa2fd('0x27')](saveUpdates(_0x376d7f[_0xa2fd('0x4d')],null))[_0xa2fd('0x27')](respondWithResult(_0x17b17b,null))[_0xa2fd('0x48')](handleError(_0x17b17b,null));};exports[_0xa2fd('0x26')]=function(_0x1b54e3,_0x383a4e){return db[_0xa2fd('0x2e')][_0xa2fd('0x4c')]({'where':{'id':_0x1b54e3['params']['id']}})[_0xa2fd('0x27')](handleEntityNotFound(_0x383a4e,null))['then'](removeEntity(_0x383a4e,null))[_0xa2fd('0x48')](handleError(_0x383a4e,null));};exports[_0xa2fd('0x4e')]=function(_0x6eda0b,_0x216bc1){return db[_0xa2fd('0x2e')][_0xa2fd('0x4e')]()[_0xa2fd('0x27')](respondWithResult(_0x216bc1,null))[_0xa2fd('0x48')](handleError(_0x216bc1,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 06c8ed1..1a716b6 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 _0x5b06=['uniqueid','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x3cff66,_0x222594){var _0x27e00a=function(_0x32b5eb){while(--_0x32b5eb){_0x3cff66['push'](_0x3cff66['shift']());}};_0x27e00a(++_0x222594);}(_0x5b06,0x161));var _0x65b0=function(_0x5d0504,_0x48a726){_0x5d0504=_0x5d0504-0x0;var _0x2c0435=_0x5b06[_0x5d0504];return _0x2c0435;};'use strict';var _=require('lodash');var util=require(_0x65b0('0x0'));var logger=require(_0x65b0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x65b0('0x2'));var rp=require(_0x65b0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x65b0('0x4'));var attributes=require(_0x65b0('0x5'));module[_0x65b0('0x6')]=function(_0x3f743c,_0x301e0e){return _0x3f743c[_0x65b0('0x7')](_0x65b0('0x8'),attributes,{'tableName':_0x65b0('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x65b0('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2901=['path','rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api','request-promise'];(function(_0x323eac,_0x2983d4){var _0x49cd05=function(_0x5975fa){while(--_0x5975fa){_0x323eac['push'](_0x323eac['shift']());}};_0x49cd05(++_0x2983d4);}(_0x2901,0x1a1));var _0x1290=function(_0x35396d,_0x4f6ac5){_0x35396d=_0x35396d-0x0;var _0x101733=_0x2901[_0x35396d];return _0x101733;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1290('0x0'))(_0x1290('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1290('0x2'));var fs=require('fs');var path=require(_0x1290('0x3'));var rimraf=require(_0x1290('0x4'));var config=require(_0x1290('0x5'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x4478a5,_0x11d32f){return _0x4478a5[_0x1290('0x6')](_0x1290('0x7'),attributes,{'tableName':_0x1290('0x8'),'paranoid':![],'indexes':[{'name':_0x1290('0x9'),'fields':[_0x1290('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 5360eb9..8838eed 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 _0x9234=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x339f67,_0x3eef63){var _0x9d6b2=function(_0x260f5c){while(--_0x260f5c){_0x339f67['push'](_0x339f67['shift']());}};_0x9d6b2(++_0x3eef63);}(_0x9234,0x1d1));var _0x4923=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0x9234[_0x4a96d2];return _0x38af04;};'use strict';var _=require(_0x4923('0x0'));var util=require(_0x4923('0x1'));var moment=require('moment');var BPromise=require(_0x4923('0x2'));var rs=require(_0x4923('0x3'));var fs=require('fs');var Redis=require(_0x4923('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4923('0x5'));var logger=require('../../config/logger')(_0x4923('0x6'));var config=require(_0x4923('0x7'));var jayson=require(_0x4923('0x8'));var client=jayson['client'][_0x4923('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x178b0e,_0x1b3c7d,_0x587420){return new BPromise(function(_0x3f5624,_0x4dbeb2){return client[_0x4923('0xa')](_0x178b0e,_0x587420)[_0x4923('0xb')](function(_0x31825b){logger[_0x4923('0xc')](_0x4923('0xd'),_0x1b3c7d,_0x4923('0xe'));logger['debug'](_0x4923('0xf'),_0x1b3c7d,_0x4923('0xe'),JSON[_0x4923('0x10')](_0x31825b));if(_0x31825b[_0x4923('0x11')]){if(_0x31825b[_0x4923('0x11')][_0x4923('0x12')]===0x1f4){logger[_0x4923('0x11')](_0x4923('0xd'),_0x1b3c7d,_0x31825b['error'][_0x4923('0x13')]);return _0x4dbeb2(_0x31825b[_0x4923('0x11')]['message']);}logger[_0x4923('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1b3c7d,_0x31825b[_0x4923('0x11')][_0x4923('0x13')]);return _0x3f5624(_0x31825b[_0x4923('0x11')]['message']);}else{logger[_0x4923('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x1b3c7d,'request\x20sent');_0x3f5624(_0x31825b['result'][_0x4923('0x13')]);}})[_0x4923('0x14')](function(_0xac4714){logger[_0x4923('0x11')](_0x4923('0xd'),_0x1b3c7d,_0xac4714);_0x4dbeb2(_0xac4714);});});}
\ No newline at end of file
+var _0x171c=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x4fa1,_0xbe2f16){var _0x153b4c=function(_0x5d0743){while(--_0x5d0743){_0x4fa1['push'](_0x4fa1['shift']());}};_0x153b4c(++_0xbe2f16);}(_0x171c,0x96));var _0xc171=function(_0x2f3d22,_0x4d2d1b){_0x2f3d22=_0x2f3d22-0x0;var _0x2c61a7=_0x171c[_0x2f3d22];return _0x2c61a7;};'use strict';var _=require(_0xc171('0x0'));var util=require(_0xc171('0x1'));var moment=require('moment');var BPromise=require(_0xc171('0x2'));var rs=require(_0xc171('0x3'));var fs=require('fs');var Redis=require(_0xc171('0x4'));var db=require(_0xc171('0x5'))['db'];var utils=require(_0xc171('0x6'));var logger=require(_0xc171('0x7'))(_0xc171('0x8'));var config=require(_0xc171('0x9'));var jayson=require(_0xc171('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x488155,_0x3b6aa1,_0x10bc35){return new BPromise(function(_0x3ddfbc,_0x30b9da){return client['request'](_0x488155,_0x10bc35)[_0xc171('0xb')](function(_0x17ed3e){logger[_0xc171('0xc')](_0xc171('0xd'),_0x3b6aa1,_0xc171('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3b6aa1,_0xc171('0xe'),JSON['stringify'](_0x17ed3e));if(_0x17ed3e[_0xc171('0xf')]){if(_0x17ed3e[_0xc171('0xf')]['code']===0x1f4){logger[_0xc171('0xf')](_0xc171('0xd'),_0x3b6aa1,_0x17ed3e[_0xc171('0xf')][_0xc171('0x10')]);return _0x30b9da(_0x17ed3e[_0xc171('0xf')]['message']);}logger[_0xc171('0xf')](_0xc171('0xd'),_0x3b6aa1,_0x17ed3e[_0xc171('0xf')][_0xc171('0x10')]);return _0x3ddfbc(_0x17ed3e['error']['message']);}else{logger[_0xc171('0xc')](_0xc171('0xd'),_0x3b6aa1,'request\x20sent');_0x3ddfbc(_0x17ed3e[_0xc171('0x11')][_0xc171('0x10')]);}})['catch'](function(_0x113916){logger[_0xc171('0xf')](_0xc171('0xd'),_0x3b6aa1,_0x113916);_0x30b9da(_0x113916);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 25e91fc..d9c3d48 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 _0x3121=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','show','create','/:id','update','delete','exports','util','path','fs-extra'];(function(_0x1b20b3,_0x3cc702){var _0x5a1d56=function(_0x4d568d){while(--_0x4d568d){_0x1b20b3['push'](_0x1b20b3['shift']());}};_0x5a1d56(++_0x3cc702);}(_0x3121,0x15d));var _0x1312=function(_0x2a028b,_0x285678){_0x2a028b=_0x2a028b-0x0;var _0x280443=_0x3121[_0x2a028b];return _0x280443;};'use strict';var multer=require('multer');var util=require(_0x1312('0x0'));var path=require(_0x1312('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1312('0x2'));var auth=require(_0x1312('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1312('0x4'));var controller=require(_0x1312('0x5'));router[_0x1312('0x6')]('/',auth[_0x1312('0x7')](),controller[_0x1312('0x8')]);router[_0x1312('0x6')](_0x1312('0x9'),auth[_0x1312('0x7')](),controller['describe']);router['get']('/:id',auth[_0x1312('0x7')](),controller[_0x1312('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1312('0xb')]);router['put'](_0x1312('0xc'),auth['isAuthenticated'](),controller[_0x1312('0xd')]);router[_0x1312('0xe')]('/:id',auth[_0x1312('0x7')](),controller['destroy']);module[_0x1312('0xf')]=router;
\ No newline at end of file
+var _0x5461=['path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','multer'];(function(_0x15f44b,_0x304221){var _0xa20138=function(_0x50892e){while(--_0x50892e){_0x15f44b['push'](_0x15f44b['shift']());}};_0xa20138(++_0x304221);}(_0x5461,0xa9));var _0x1546=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x5461[_0x65c50e];return _0x4573e7;};'use strict';var multer=require(_0x1546('0x0'));var util=require('util');var path=require(_0x1546('0x1'));var timeout=require('connect-timeout');var express=require(_0x1546('0x2'));var router=express[_0x1546('0x3')]();var fs_extra=require(_0x1546('0x4'));var auth=require(_0x1546('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x1546('0x6')]('/',auth[_0x1546('0x7')](),controller[_0x1546('0x8')]);router[_0x1546('0x6')](_0x1546('0x9'),auth[_0x1546('0x7')](),controller[_0x1546('0xa')]);router[_0x1546('0x6')](_0x1546('0xb'),auth[_0x1546('0x7')](),controller[_0x1546('0xc')]);router['post']('/',auth[_0x1546('0x7')](),controller[_0x1546('0xd')]);router[_0x1546('0xe')](_0x1546('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1546('0xf')](_0x1546('0xb'),auth[_0x1546('0x7')](),controller[_0x1546('0x10')]);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 851af29..f3bbba9 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 _0xe877=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','star','TEXT','stringify','name','input','getDataValue','parse','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY'];(function(_0x930824,_0x5279ec){var _0x116006=function(_0x55ef0c){while(--_0x55ef0c){_0x930824['push'](_0x930824['shift']());}};_0x116006(++_0x5279ec);}(_0xe877,0x19f));var _0x7e87=function(_0x39f687,_0x1203e3){_0x39f687=_0x39f687-0x0;var _0x115075=_0xe877[_0x39f687];return _0x115075;};'use strict';var Sequelize=require(_0x7e87('0x0'));var rs=require('randomstring');module[_0x7e87('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'unique':_0x7e87('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x5')},'customerAlias':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'defaultValue':_0x7e87('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'defaultValue':_0x7e87('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'defaultValue':_0x7e87('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'defaultValue':_0x7e87('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7e87('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7e87('0x2')]},'animation':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x7e87('0xa'),_0x7e87('0xb')),'defaultValue':_0x7e87('0xa')},'header_online':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0xc')},'start_chat_button':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0xf')},'download_transcript':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7e87('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x13')},'noteTitle':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0x15')},'closingMessage':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x16')},'closingMessageButton':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x17')},'ratingType':{'type':Sequelize[_0x7e87('0x18')](_0x7e87('0x19'),'thumb'),'defaultValue':_0x7e87('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7e87('0x1a')],'defaultValue':function(){return JSON[_0x7e87('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x7e87('0x1c'),'type':'text','required':!![]},'props':{'title':_0x7e87('0x1c'),'helpText':''}},{'type':_0x7e87('0x1d'),'props':{'title':_0x7e87('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x7e87('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7e87('0x1e')]('onlineForm')?JSON[_0x7e87('0x1f')](this['getDataValue'](_0x7e87('0x20'))):{};},'set':function(_0x46128a){return this['setDataValue'](_0x7e87('0x20'),JSON[_0x7e87('0x1b')](_0x46128a));}},'offlineForm':{'type':Sequelize[_0x7e87('0x1a')],'defaultValue':function(){return JSON[_0x7e87('0x1b')]({'items':[{'type':'input','props':{'title':_0x7e87('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x7e87('0x4'),'type':'email'},'variable':null},{'type':_0x7e87('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x7e87('0x22'),'helpText':_0x7e87('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x7e87('0x1e')]('offlineForm')?JSON[_0x7e87('0x1f')](this[_0x7e87('0x1e')](_0x7e87('0x24'))):{};},'set':function(_0x54a8b0){return this[_0x7e87('0x25')](_0x7e87('0x24'),JSON['stringify'](_0x54a8b0));}},'token':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7e87('0x2')]},'forwardOffline':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0x26')},'waitingMessage':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x27')},'offlineMessageBody':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x29')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7e87('0x1a')]},'showAgentAvatar':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7e87('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7e87('0x2b');}},'notificationSound':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7e87('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x2d')},'verticalAlignment':{'type':Sequelize[_0x7e87('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x7e87('0x2')],'defaultValue':_0x7e87('0x2e')},'defaultTitle':{'type':Sequelize[_0x7e87('0x2')]},'customerAvatar':{'type':Sequelize[_0x7e87('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'defaultValue':_0x7e87('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7e87('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7e87('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7e87('0x30')},'systemAvatar':{'type':Sequelize[_0x7e87('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e87('0x8')],'comment':_0x7e87('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5064a7){if(!_0x5064a7)this[_0x7e87('0x25')](_0x7e87('0x32'),null);this[_0x7e87('0x25')](_0x7e87('0x33'),_0x5064a7);}},'vidaooEscalation':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x7e87('0x2')]},'vidaooTopic':{'type':Sequelize[_0x7e87('0x2')],'allowNull':![],'defaultValue':_0x7e87('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x7e87('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7e87('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7e87('0x1a')]}};
\ No newline at end of file
+var _0x65ce=['email','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','TEXT','stringify','name','text','input','onlineForm','parse','getDataValue','Comments','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','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','System','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING'];(function(_0x1d6a61,_0x177f8a){var _0x4f28ae=function(_0x22a8b1){while(--_0x22a8b1){_0x1d6a61['push'](_0x1d6a61['shift']());}};_0x4f28ae(++_0x177f8a);}(_0x65ce,0x185));var _0xe65c=function(_0x460bbf,_0x3d6053){_0x460bbf=_0x460bbf-0x0;var _0x1a65c1=_0x65ce[_0x460bbf];return _0x1a65c1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe65c('0x0'));module[_0xe65c('0x1')]={'name':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xe65c('0x3')},'mapKeyOffline':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x3')},'key':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe65c('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![],'defaultValue':_0xe65c('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![],'defaultValue':_0xe65c('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe65c('0x7')](_0xe65c('0x8'),_0xe65c('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0xa')},'start_chat_button':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe65c('0xc')},'header_offline':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe65c('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x12')},'noteTitle':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x13')},'placeholderMessage':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x14')},'closingMessage':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x15')},'closingMessageButton':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x16')},'ratingType':{'type':Sequelize[_0xe65c('0x7')](_0xe65c('0x17'),_0xe65c('0x18')),'defaultValue':_0xe65c('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe65c('0x19')],'defaultValue':function(){return JSON[_0xe65c('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xe65c('0x1b'),'type':_0xe65c('0x1c'),'required':!![]},'props':{'title':_0xe65c('0x1b'),'helpText':''}},{'type':_0xe65c('0x1d'),'props':{'title':_0xe65c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xe65c('0x3'),'type':_0xe65c('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xe65c('0x1e'))?JSON[_0xe65c('0x1f')](this[_0xe65c('0x20')](_0xe65c('0x1e'))):{};},'set':function(_0x45ab33){return this['setDataValue'](_0xe65c('0x1e'),JSON[_0xe65c('0x1a')](_0x45ab33));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xe65c('0x1a')]({'items':[{'type':_0xe65c('0x1d'),'props':{'title':_0xe65c('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xe65c('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xe65c('0x21')},'props':{'title':_0xe65c('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xe65c('0x20')](_0xe65c('0x22'))?JSON[_0xe65c('0x1f')](this[_0xe65c('0x20')](_0xe65c('0x22'))):{};},'set':function(_0x3cab6a){return this[_0xe65c('0x23')](_0xe65c('0x22'),JSON[_0xe65c('0x1a')](_0x3cab6a));}},'token':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':function(){return rs[_0xe65c('0x24')]();}},'autoclose':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe65c('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe65c('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe65c('0x25')},'waitingMessage':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x27')},'offlineMessageBody':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x28')},'skipUnmanaged':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x29')},'sendUnmanaged':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe65c('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe65c('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe65c('0x19')],'defaultValue':function(){return _0xe65c('0x2a');}},'notificationSound':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe65c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x2b')},'verticalAlignment':{'type':Sequelize[_0xe65c('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':_0xe65c('0x2c')},'messagesAlignment':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xe65c('0x2')]},'customerAvatar':{'type':Sequelize[_0xe65c('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe65c('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe65c('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe65c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe65c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe65c('0x2e')},'systemAvatar':{'type':Sequelize[_0xe65c('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe65c('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x175bd8){if(!_0x175bd8)this['setDataValue'](_0xe65c('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x175bd8);}},'vidaooEscalation':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xe65c('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xe65c('0x2')],'defaultValue':function(){return _0xe65c('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xe65c('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe65c('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe65c('0x19')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1c0a9bb..33ffa19 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 _0xac31=['\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','params','describe','addDisposition','ChatWebsiteId','getDispositions','nolimit','Disposition','findAll','removeDispositions','CannedAnswer','getAnswers','findOne','hasOwnProperty','order','removeAnswers','ids','addLogo','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','sitepic','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','Interval','resolve','ifTime','notify','chat','isNil','from','mapKey','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','CmList','List','Contacts','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','priority','asc','account','list','contact','headers','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','Tag','color','tag','getSnippet','virtual','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','User','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','api','../../config/environment','../../errors/api','APIBadRequestError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','undefined','limit','count','offset','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','includeAll','find','create','address','split','forEach','testWildcardValidity','trim'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0xac31,0xca));var _0x1ac3=function(_0x16af45,_0x6508fb){_0x16af45=_0x16af45-0x0;var _0x3fbddb=_0xac31[_0x16af45];return _0x3fbddb;};'use strict';var Mustache=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var ejs=require(_0x1ac3('0x3'));var fs=require('fs');var fs_extra=require(_0x1ac3('0x4'));var _=require(_0x1ac3('0x5'));var querystring=require(_0x1ac3('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x1ac3('0x7'));var jayson=require(_0x1ac3('0x8'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x1ac3('0x9'));var config=require(_0x1ac3('0xa'));var APIBadRequestError=require(_0x1ac3('0xb'))[_0x1ac3('0xc')];var APINotFoundError=require(_0x1ac3('0xb'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x1ac3('0xb'))['APIOutOfIntervalError'];var APIHandleError=require(_0x1ac3('0xb'))[_0x1ac3('0xd')];var APIConflictError=require(_0x1ac3('0xb'))['APIConflictError'];var wildcardUtils=require(_0x1ac3('0xe'));var URL=require(_0x1ac3('0xf'))[_0x1ac3('0x10')];var db=require(_0x1ac3('0x11'))['db'];config[_0x1ac3('0x12')]=_[_0x1ac3('0x13')](config['redis'],{'host':_0x1ac3('0x14'),'port':0x18eb});var socket=require(_0x1ac3('0x15'))(new Redis(config[_0x1ac3('0x12')]));require(_0x1ac3('0x16'))['register'](socket);var client=jayson[_0x1ac3('0x17')][_0x1ac3('0x18')]({'port':0x232c});var client9002=jayson[_0x1ac3('0x17')][_0x1ac3('0x18')]({'port':0x232a});var client9003=jayson['client'][_0x1ac3('0x18')]({'port':0x232b});var client9001=jayson[_0x1ac3('0x17')]['http']({'port':0x2329});function respondWithRpcPromise(_0x29a7b3,_0x1f9641,_0x38b52a,_0x51f1e4){return new Promise(function(_0x2f14ca,_0x8590ce){var _0x23e6e9=_0x51f1e4||client;return _0x23e6e9['request'](_0x29a7b3,_0x38b52a)[_0x1ac3('0x19')](function(_0x58000f){logger[_0x1ac3('0x1a')](_0x1ac3('0x1b'),_0x1f9641,_0x1ac3('0x1c'));logger[_0x1ac3('0x1d')](_0x1ac3('0x1e'),_0x1f9641,'request\x20sent',JSON[_0x1ac3('0x1f')](_0x58000f));if(_0x58000f[_0x1ac3('0x20')]){if(_0x58000f[_0x1ac3('0x20')][_0x1ac3('0x21')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1f9641,_0x58000f[_0x1ac3('0x20')][_0x1ac3('0x22')]);return _0x8590ce(_0x58000f[_0x1ac3('0x20')][_0x1ac3('0x22')]);}logger[_0x1ac3('0x20')](_0x1ac3('0x1b'),_0x1f9641,_0x58000f[_0x1ac3('0x20')][_0x1ac3('0x22')]);return _0x2f14ca(_0x58000f[_0x1ac3('0x20')]['message']);}else{logger[_0x1ac3('0x1a')](_0x1ac3('0x1b'),_0x1f9641,'request\x20sent');_0x2f14ca(_0x58000f[_0x1ac3('0x23')][_0x1ac3('0x22')]);}})['catch'](function(_0xf9affb){logger[_0x1ac3('0x20')](_0x1ac3('0x1b'),_0x1f9641,_0xf9affb);_0x8590ce(_0xf9affb);});});}function respondWithStatusCode(_0x2dfdb7,_0x10db3d){_0x10db3d=_0x10db3d||0xcc;return function(_0x565a0f){if(_0x565a0f){return _0x2dfdb7['sendStatus'](_0x10db3d);}return _0x2dfdb7['status'](_0x10db3d)['end']();};}function respondWithResult(_0x52a1a5,_0x3ea482){_0x3ea482=_0x3ea482||0xc8;return function(_0x4b04fb){if(_0x4b04fb){return _0x52a1a5[_0x1ac3('0x24')](_0x3ea482)[_0x1ac3('0x25')](_0x4b04fb);}};}function respondWithFilteredResult(_0x4243e4,_0x435d6c){return function(_0x4b3d3c){if(_0x4b3d3c){var _0x61441d=typeof _0x435d6c['offset']===_0x1ac3('0x26')&&typeof _0x435d6c[_0x1ac3('0x27')]===_0x1ac3('0x26');var _0x1c5653=_0x4b3d3c[_0x1ac3('0x28')];var _0xc3f097=_0x61441d?0x0:_0x435d6c[_0x1ac3('0x29')];var _0x5351b2=_0x61441d?_0x4b3d3c[_0x1ac3('0x28')]:_0x435d6c[_0x1ac3('0x29')]+_0x435d6c[_0x1ac3('0x27')];var _0x47437c;if(_0x5351b2>=_0x1c5653){_0x5351b2=_0x1c5653;_0x47437c=0xc8;}else{_0x47437c=0xce;}_0x4243e4['status'](_0x47437c);return _0x4243e4[_0x1ac3('0x2a')](_0x1ac3('0x2b'),_0xc3f097+'-'+_0x5351b2+'/'+_0x1c5653)[_0x1ac3('0x25')](_0x4b3d3c);}return null;};}function saveUpdates(_0x294513){return function(_0x204d78){if(_0x204d78){return _0x204d78['update'](_0x294513)[_0x1ac3('0x19')](function(_0x760b65){return _0x760b65;});}return null;};}function removeEntity(_0x11987b){return function(_0x156ccd){if(_0x156ccd){return _0x156ccd[_0x1ac3('0x2c')]()[_0x1ac3('0x19')](function(){var _0x4c1283=_0x156ccd[_0x1ac3('0x2d')]({'plain':!![]});var _0x174a53=_0x1ac3('0x2e');return db[_0x1ac3('0x2f')]['destroy']({'where':{'type':_0x174a53,'resourceId':_0x4c1283['id']}})[_0x1ac3('0x19')](function(){return _0x156ccd;});})[_0x1ac3('0x19')](function(){_0x11987b[_0x1ac3('0x24')](0xcc)[_0x1ac3('0x30')]();});}};}function handleEntityNotFound(_0x31a932){return function(_0x170bb8){if(!_0x170bb8){_0x31a932[_0x1ac3('0x31')](0x194);}return _0x170bb8;};}function handleError(_0x277b7b,_0x30b815){_0x30b815=_0x30b815||0x1f4;return function(_0x5c29c1){logger[_0x1ac3('0x20')](_0x5c29c1[_0x1ac3('0x32')]);if(_0x5c29c1['name']){delete _0x5c29c1[_0x1ac3('0x33')];}_0x277b7b[_0x1ac3('0x24')](_0x30b815)[_0x1ac3('0x34')](_0x5c29c1);};}function createInteractionObject(_0x448fb5,_0x2e8494,_0x4b2217,_0x1c8bf5){var _0xa15199=require('user-agent-parser');var _0x17fc8a=new _0xa15199();var _0x49717b=_0x17fc8a[_0x1ac3('0x35')](_0x4b2217[_0x1ac3('0x36')])[_0x1ac3('0x37')]();var _0x1e2f5e=_0x2e8494[_0x1ac3('0x38')];if(_0x4b2217[_0x1ac3('0x39')]){_0x1e2f5e=_0x4b2217['cf-connecting-ip'];}else if(_0x4b2217[_0x1ac3('0x3a')]){_0x1e2f5e=_[_0x1ac3('0x3b')](_0x4b2217[_0x1ac3('0x3a')]['split'](','));}return{'ContactId':_0x1c8bf5['id'],'ChatWebsiteId':_0x448fb5,'from':(_0x1c8bf5[_0x1ac3('0x3c')]||'')+'\x20'+(_0x1c8bf5[_0x1ac3('0x3d')]||''),'customerIp':_0x1e2f5e,'customerPort':_0x4b2217['x-real-port']?_0x4b2217[_0x1ac3('0x3e')]:null,'referer':_0x2e8494[_0x1ac3('0x3f')],'browserName':_0x49717b[_0x1ac3('0x40')][_0x1ac3('0x33')]&&_0x49717b[_0x1ac3('0x40')][_0x1ac3('0x41')]?util[_0x1ac3('0x42')](_0x1ac3('0x43'),_0x49717b['browser'][_0x1ac3('0x33')],_0x49717b[_0x1ac3('0x40')][_0x1ac3('0x41')]):_0x1ac3('0x44'),'browserVersion':_0x49717b[_0x1ac3('0x40')][_0x1ac3('0x41')]||_0x1ac3('0x44'),'osName':util['format']('%s\x20%s',_0x49717b['os'][_0x1ac3('0x33')],_0x49717b['os'][_0x1ac3('0x41')]),'osVersion':_0x49717b['os']['version'],'deviceModel':_0x49717b[_0x1ac3('0x45')][_0x1ac3('0x46')]&&_0x49717b['device'][_0x1ac3('0x47')]?util['format'](_0x1ac3('0x48'),_0x49717b[_0x1ac3('0x45')][_0x1ac3('0x46')],_0x49717b[_0x1ac3('0x45')]['vendor'],_0x49717b[_0x1ac3('0x45')][_0x1ac3('0x49')]):null,'deviceVendor':_0x49717b[_0x1ac3('0x45')][_0x1ac3('0x47')],'deviceType':_0x49717b[_0x1ac3('0x45')]['type'],'formData':JSON[_0x1ac3('0x1f')](_0x2e8494)};}exports[_0x1ac3('0x4a')]=function(_0x13f09d,_0x2513f9){var _0x589434={'include':[{'model':db[_0x1ac3('0x4b')],'as':_0x1ac3('0x4c')}]},_0x16d56a={},_0x2b6195={'count':0x0,'rows':[]};var _0x47af4e=_[_0x1ac3('0x4d')](db[_0x1ac3('0x4e')][_0x1ac3('0x4f')],function(_0x522146){return{'name':_0x522146['fieldName'],'type':_0x522146[_0x1ac3('0x49')]['key']};});_0x16d56a[_0x1ac3('0x46')]=_[_0x1ac3('0x4d')](_0x47af4e,_0x1ac3('0x33'));_0x16d56a[_0x1ac3('0x50')]=_[_0x1ac3('0x51')](_0x13f09d[_0x1ac3('0x50')]);_0x16d56a[_0x1ac3('0x52')]=_['intersection'](_0x16d56a['model'],_0x16d56a[_0x1ac3('0x50')]);_0x589434[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x16d56a['model'],qs['fields'](_0x13f09d['query'][_0x1ac3('0x55')]));_0x589434[_0x1ac3('0x53')]=_0x589434['attributes'][_0x1ac3('0x56')]?_0x589434[_0x1ac3('0x53')]:_0x16d56a[_0x1ac3('0x46')];if(!_0x13f09d[_0x1ac3('0x50')]['hasOwnProperty']('nolimit')){_0x589434[_0x1ac3('0x27')]=qs[_0x1ac3('0x27')](_0x13f09d['query'][_0x1ac3('0x27')]);_0x589434['offset']=qs['offset'](_0x13f09d[_0x1ac3('0x50')][_0x1ac3('0x29')]);}_0x589434['order']=qs[_0x1ac3('0x57')](_0x13f09d['query'][_0x1ac3('0x57')]);_0x589434[_0x1ac3('0x58')]=qs[_0x1ac3('0x52')](_[_0x1ac3('0x59')](_0x13f09d[_0x1ac3('0x50')],_0x16d56a[_0x1ac3('0x52')]),_0x47af4e);if(_0x13f09d[_0x1ac3('0x50')][_0x1ac3('0x5a')]){_0x589434[_0x1ac3('0x58')]=_[_0x1ac3('0x5b')](_0x589434[_0x1ac3('0x58')],{'$or':_['map'](_0x47af4e,function(_0x5d6270){if(_0x5d6270[_0x1ac3('0x49')]!==_0x1ac3('0x5c')){var _0x3bf701={};_0x3bf701[_0x5d6270[_0x1ac3('0x33')]]={'$like':'%'+_0x13f09d[_0x1ac3('0x50')][_0x1ac3('0x5a')]+'%'};return _0x3bf701;}})});}_0x589434=_[_0x1ac3('0x5b')]({},_0x589434,_0x13f09d[_0x1ac3('0x5d')]);var _0xcf3bba={'where':_0x589434[_0x1ac3('0x58')]};return db['ChatWebsite'][_0x1ac3('0x28')](_0xcf3bba)[_0x1ac3('0x19')](function(_0x10a29d){_0x2b6195[_0x1ac3('0x28')]=_0x10a29d;if(_0x13f09d[_0x1ac3('0x50')]['includeAll']){_0x589434[_0x1ac3('0x5e')]=[{'all':!![]}];}return db[_0x1ac3('0x4e')]['findAll'](_0x589434);})['then'](function(_0x51af03){_0x2b6195[_0x1ac3('0x5f')]=_0x51af03;return _0x2b6195;})[_0x1ac3('0x19')](respondWithFilteredResult(_0x2513f9,_0x589434))[_0x1ac3('0x60')](handleError(_0x2513f9,null));};exports['show']=function(_0x3a5d23,_0x5d05dd){var _0x5035cf={'raw':![],'where':{'id':_0x3a5d23['params']['id']},'include':[{'model':db[_0x1ac3('0x4b')],'as':_0x1ac3('0x4c')}]},_0x52ef77={};_0x52ef77[_0x1ac3('0x46')]=_[_0x1ac3('0x51')](db[_0x1ac3('0x4e')]['rawAttributes']);_0x52ef77[_0x1ac3('0x50')]=_[_0x1ac3('0x51')](_0x3a5d23['query']);_0x52ef77[_0x1ac3('0x52')]=_[_0x1ac3('0x54')](_0x52ef77[_0x1ac3('0x46')],_0x52ef77[_0x1ac3('0x50')]);_0x5035cf[_0x1ac3('0x53')]=_['intersection'](_0x52ef77[_0x1ac3('0x46')],qs[_0x1ac3('0x55')](_0x3a5d23[_0x1ac3('0x50')][_0x1ac3('0x55')]));_0x5035cf['attributes']=_0x5035cf[_0x1ac3('0x53')][_0x1ac3('0x56')]?_0x5035cf[_0x1ac3('0x53')]:_0x52ef77[_0x1ac3('0x46')];if(_0x3a5d23[_0x1ac3('0x50')][_0x1ac3('0x61')]){_0x5035cf['include']=[{'all':!![]}];}_0x5035cf=_['merge']({},_0x5035cf,_0x3a5d23['options']);return db['ChatWebsite'][_0x1ac3('0x62')](_0x5035cf)['then'](handleEntityNotFound(_0x5d05dd,null))[_0x1ac3('0x19')](respondWithResult(_0x5d05dd,null))[_0x1ac3('0x60')](handleError(_0x5d05dd,null));};exports[_0x1ac3('0x63')]=function(_0x20fa43,_0x11f451){var _0xa2d2c=null;_0x20fa43['body'][_0x1ac3('0x64')][_0x1ac3('0x65')](',')[_0x1ac3('0x66')](_0x422b15=>{if(_0x422b15['trim']()!==''&&!wildcardUtils[_0x1ac3('0x67')](_0x422b15[_0x1ac3('0x68')]())){_0xa2d2c=new APIBadRequestError('\x22'+_0x422b15[_0x1ac3('0x68')]()+_0x1ac3('0x69'));}});if(_0xa2d2c){return handleError(_0x11f451,null)(_0xa2d2c);}return db[_0x1ac3('0x4e')]['create'](_0x20fa43[_0x1ac3('0x6a')],{})['then'](function(_0x4d6e52){var _0x402507=_0x20fa43[_0x1ac3('0x6b')][_0x1ac3('0x2d')]({'plain':!![]});if(!_0x402507)throw new Error(_0x1ac3('0x6c'));if(_0x402507[_0x1ac3('0x6d')]===_0x1ac3('0x6b')){var _0x3e8b55=_0x4d6e52[_0x1ac3('0x2d')]({'plain':!![]});var _0x419040='ChatWebsites';return db[_0x1ac3('0x6e')][_0x1ac3('0x62')]({'where':{'name':_0x419040,'userProfileId':_0x402507[_0x1ac3('0x6f')]},'raw':!![]})['then'](function(_0x256f8d){if(_0x256f8d&&_0x256f8d[_0x1ac3('0x70')]===0x0){return db[_0x1ac3('0x2f')][_0x1ac3('0x63')]({'name':_0x3e8b55[_0x1ac3('0x33')],'resourceId':_0x3e8b55['id'],'type':_0x256f8d[_0x1ac3('0x33')],'sectionId':_0x256f8d['id']},{})[_0x1ac3('0x19')](function(){return _0x4d6e52;});}else{return _0x4d6e52;}})[_0x1ac3('0x60')](function(_0x2edd17){logger[_0x1ac3('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2edd17);throw _0x2edd17;});}return _0x4d6e52;})[_0x1ac3('0x19')](respondWithResult(_0x11f451,0xc9))[_0x1ac3('0x60')](handleError(_0x11f451,null));};exports[_0x1ac3('0x71')]=function(_0x566ddc,_0xd53c2c){var _0x6a53c6=null;_0x566ddc[_0x1ac3('0x6a')][_0x1ac3('0x64')][_0x1ac3('0x65')](',')['forEach'](_0x4d9d77=>{if(_0x4d9d77['trim']()!==''&&!wildcardUtils[_0x1ac3('0x67')](_0x4d9d77['trim']())){_0x6a53c6=new APIBadRequestError('\x22'+_0x4d9d77[_0x1ac3('0x68')]()+_0x1ac3('0x69'));}});if(_0x6a53c6){return handleError(_0xd53c2c,null)(_0x6a53c6);}if(_0x566ddc[_0x1ac3('0x6a')]['id']){delete _0x566ddc['body']['id'];}return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x566ddc[_0x1ac3('0x72')]['id']},'include':[{'model':db[_0x1ac3('0x4b')],'as':_0x1ac3('0x4c')}]})['then'](handleEntityNotFound(_0xd53c2c,null))['then'](saveUpdates(_0x566ddc[_0x1ac3('0x6a')],null))[_0x1ac3('0x19')](respondWithResult(_0xd53c2c,null))['catch'](handleError(_0xd53c2c,null));};exports[_0x1ac3('0x2c')]=function(_0x476863,_0x2a4316){return db['ChatWebsite'][_0x1ac3('0x62')]({'where':{'id':_0x476863[_0x1ac3('0x72')]['id']}})['then'](handleEntityNotFound(_0x2a4316,null))[_0x1ac3('0x19')](removeEntity(_0x2a4316,null))['catch'](handleError(_0x2a4316,null));};exports[_0x1ac3('0x73')]=function(_0x5c7c1c,_0x4cb532){return db[_0x1ac3('0x4e')][_0x1ac3('0x73')]()[_0x1ac3('0x19')](respondWithResult(_0x4cb532,null))[_0x1ac3('0x60')](handleError(_0x4cb532,null));};exports[_0x1ac3('0x74')]=function(_0x42e682,_0x367e9d){if(_0x42e682[_0x1ac3('0x6a')]['id']){delete _0x42e682[_0x1ac3('0x6a')]['id'];}return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x42e682[_0x1ac3('0x72')]['id']}})['then'](handleEntityNotFound(_0x367e9d,null))['then'](function(_0x588726){if(_0x588726){_0x42e682[_0x1ac3('0x6a')][_0x1ac3('0x75')]=_0x588726['id'];return db['Disposition'][_0x1ac3('0x63')](_0x42e682[_0x1ac3('0x6a')]);}})[_0x1ac3('0x19')](respondWithResult(_0x367e9d,null))[_0x1ac3('0x60')](handleError(_0x367e9d,null));};exports[_0x1ac3('0x76')]=function(_0x5278ed,_0x24ab6e){var _0x50fe83={'raw':![],'where':{}};var _0x468f39={};var _0x57a3b0={'count':0x0,'rows':[]};return db[_0x1ac3('0x4e')]['findOne']({'where':{'id':_0x5278ed[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x24ab6e,null))[_0x1ac3('0x19')](function(_0x2d700f){if(_0x2d700f){_0x468f39[_0x1ac3('0x46')]=_['keys'](db['Disposition']['rawAttributes']);_0x468f39[_0x1ac3('0x50')]=_[_0x1ac3('0x51')](_0x5278ed[_0x1ac3('0x50')]);_0x468f39[_0x1ac3('0x52')]=_['intersection'](_0x468f39[_0x1ac3('0x46')],_0x468f39[_0x1ac3('0x50')]);_0x50fe83['attributes']=_[_0x1ac3('0x54')](_0x468f39['model'],qs[_0x1ac3('0x55')](_0x5278ed['query']['fields']));_0x50fe83['attributes']=_0x50fe83[_0x1ac3('0x53')][_0x1ac3('0x56')]?_0x50fe83[_0x1ac3('0x53')]:_0x468f39[_0x1ac3('0x46')];if(!_0x5278ed[_0x1ac3('0x50')]['hasOwnProperty'](_0x1ac3('0x77'))){_0x50fe83[_0x1ac3('0x27')]=qs[_0x1ac3('0x27')](_0x5278ed[_0x1ac3('0x50')]['limit']);_0x50fe83[_0x1ac3('0x29')]=qs[_0x1ac3('0x29')](_0x5278ed['query']['offset']);}_0x50fe83['order']=qs[_0x1ac3('0x57')](_0x5278ed[_0x1ac3('0x50')][_0x1ac3('0x57')]);_0x50fe83[_0x1ac3('0x58')]=qs['filters'](_[_0x1ac3('0x59')](_0x5278ed[_0x1ac3('0x50')],_0x468f39['filters']));_0x50fe83[_0x1ac3('0x58')][_0x1ac3('0x75')]=_0x2d700f['id'];if(_0x5278ed[_0x1ac3('0x50')][_0x1ac3('0x5a')]){_0x50fe83['where']=_[_0x1ac3('0x5b')](_0x50fe83[_0x1ac3('0x58')],{'$or':_[_0x1ac3('0x4d')](_0x50fe83[_0x1ac3('0x53')],function(_0x195dd5){var _0x592736={};_0x592736[_0x195dd5]={'$like':'%'+_0x5278ed[_0x1ac3('0x50')][_0x1ac3('0x5a')]+'%'};return _0x592736;})});}_0x50fe83=_['merge']({},_0x50fe83,_0x5278ed['options']);return db[_0x1ac3('0x78')][_0x1ac3('0x28')]({'where':_0x50fe83['where']})['then'](function(_0x88e53e){_0x57a3b0['count']=_0x88e53e;if(_0x5278ed[_0x1ac3('0x50')][_0x1ac3('0x61')]){_0x50fe83['include']=[{'all':!![]}];}return db['Disposition'][_0x1ac3('0x79')](_0x50fe83);})['then'](function(_0x45faf6){_0x57a3b0[_0x1ac3('0x5f')]=_0x45faf6;return _0x57a3b0;});}})[_0x1ac3('0x19')](respondWithFilteredResult(_0x24ab6e,_0x50fe83))[_0x1ac3('0x60')](handleError(_0x24ab6e,null));};exports[_0x1ac3('0x7a')]=function(_0xfbcc08,_0x9a48b8){return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0xfbcc08['params']['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x9a48b8,null))[_0x1ac3('0x19')](function(_0x532a9a){if(_0x532a9a){return _0x532a9a[_0x1ac3('0x7a')](_0xfbcc08[_0x1ac3('0x50')]['ids']);}})[_0x1ac3('0x19')](respondWithStatusCode(_0x9a48b8,null))['catch'](handleError(_0x9a48b8,null));};exports['addAnswer']=function(_0x31f1e7,_0x19a898){if(_0x31f1e7[_0x1ac3('0x6a')]['id']){delete _0x31f1e7['body']['id'];}return db['ChatWebsite'][_0x1ac3('0x62')]({'where':{'id':_0x31f1e7[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x19a898,null))[_0x1ac3('0x19')](function(_0x406738){if(_0x406738){_0x31f1e7[_0x1ac3('0x6a')][_0x1ac3('0x75')]=_0x406738['id'];return db[_0x1ac3('0x7b')][_0x1ac3('0x63')](_0x31f1e7[_0x1ac3('0x6a')]);}})[_0x1ac3('0x19')](respondWithResult(_0x19a898,null))[_0x1ac3('0x60')](handleError(_0x19a898,null));};exports[_0x1ac3('0x7c')]=function(_0x2a6657,_0x753ab8){var _0x46fdaa={'raw':![],'where':{}};var _0x26d623={};var _0xbb9f39={'count':0x0,'rows':[]};return db[_0x1ac3('0x4e')][_0x1ac3('0x7d')]({'where':{'id':_0x2a6657[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x753ab8,null))['then'](function(_0x461a00){if(_0x461a00){_0x26d623[_0x1ac3('0x46')]=_[_0x1ac3('0x51')](db[_0x1ac3('0x7b')][_0x1ac3('0x4f')]);_0x26d623[_0x1ac3('0x50')]=_['keys'](_0x2a6657['query']);_0x26d623[_0x1ac3('0x52')]=_[_0x1ac3('0x54')](_0x26d623[_0x1ac3('0x46')],_0x26d623[_0x1ac3('0x50')]);_0x46fdaa[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x26d623[_0x1ac3('0x46')],qs[_0x1ac3('0x55')](_0x2a6657[_0x1ac3('0x50')][_0x1ac3('0x55')]));_0x46fdaa[_0x1ac3('0x53')]=_0x46fdaa['attributes'][_0x1ac3('0x56')]?_0x46fdaa[_0x1ac3('0x53')]:_0x26d623[_0x1ac3('0x46')];if(!_0x2a6657['query'][_0x1ac3('0x7e')](_0x1ac3('0x77'))){_0x46fdaa['limit']=qs[_0x1ac3('0x27')](_0x2a6657[_0x1ac3('0x50')][_0x1ac3('0x27')]);_0x46fdaa[_0x1ac3('0x29')]=qs['offset'](_0x2a6657['query']['offset']);}_0x46fdaa[_0x1ac3('0x7f')]=qs[_0x1ac3('0x57')](_0x2a6657[_0x1ac3('0x50')][_0x1ac3('0x57')]);_0x46fdaa[_0x1ac3('0x58')]=qs['filters'](_[_0x1ac3('0x59')](_0x2a6657[_0x1ac3('0x50')],_0x26d623[_0x1ac3('0x52')]));_0x46fdaa['where'][_0x1ac3('0x75')]=_0x461a00['id'];if(_0x2a6657[_0x1ac3('0x50')][_0x1ac3('0x5a')]){_0x46fdaa[_0x1ac3('0x58')]=_[_0x1ac3('0x5b')](_0x46fdaa['where'],{'$or':_[_0x1ac3('0x4d')](_0x46fdaa[_0x1ac3('0x53')],function(_0x22422c){var _0x3fb464={};_0x3fb464[_0x22422c]={'$like':'%'+_0x2a6657['query']['filter']+'%'};return _0x3fb464;})});}_0x46fdaa=_[_0x1ac3('0x5b')]({},_0x46fdaa,_0x2a6657[_0x1ac3('0x5d')]);return db['CannedAnswer'][_0x1ac3('0x28')]({'where':_0x46fdaa[_0x1ac3('0x58')]})[_0x1ac3('0x19')](function(_0x424ed8){_0xbb9f39['count']=_0x424ed8;if(_0x2a6657[_0x1ac3('0x50')][_0x1ac3('0x61')]){_0x46fdaa[_0x1ac3('0x5e')]=[{'all':!![]}];}return db[_0x1ac3('0x7b')][_0x1ac3('0x79')](_0x46fdaa);})[_0x1ac3('0x19')](function(_0x11e2a1){_0xbb9f39['rows']=_0x11e2a1;return _0xbb9f39;});}})[_0x1ac3('0x19')](respondWithFilteredResult(_0x753ab8,_0x46fdaa))[_0x1ac3('0x60')](handleError(_0x753ab8,null));};exports[_0x1ac3('0x80')]=function(_0x3a9f4c,_0x41e04d){return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x3a9f4c[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x41e04d,null))[_0x1ac3('0x19')](function(_0x45767b){if(_0x45767b){return _0x45767b[_0x1ac3('0x80')](_0x3a9f4c[_0x1ac3('0x50')][_0x1ac3('0x81')]);}})['then'](respondWithStatusCode(_0x41e04d,null))[_0x1ac3('0x60')](handleError(_0x41e04d,null));};exports[_0x1ac3('0x82')]=function(_0x1fba37,_0x1b50dc){_0x1fba37['body']['sitepic']=_0x1fba37[_0x1ac3('0x83')][_0x1ac3('0x84')];return db[_0x1ac3('0x4e')]['find']({'where':{'id':_0x1fba37['params']['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x1b50dc,null))[_0x1ac3('0x19')](saveUpdates(_0x1fba37[_0x1ac3('0x6a')],null))[_0x1ac3('0x19')](respondWithResult(_0x1b50dc,null))[_0x1ac3('0x60')](handleError(_0x1b50dc,null));};exports['addAvatar']=function(_0x223e07,_0x1a354a){_0x223e07[_0x1ac3('0x6a')][_0x1ac3('0x85')]=_0x223e07[_0x1ac3('0x83')][_0x1ac3('0x84')];return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x223e07[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x1a354a,null))[_0x1ac3('0x19')](saveUpdates(_0x223e07['body'],null))[_0x1ac3('0x19')](respondWithResult(_0x1a354a,null))[_0x1ac3('0x60')](handleError(_0x1a354a,null));};exports[_0x1ac3('0x86')]=function(_0x53b8a3,_0x4d7f0c){_0x53b8a3[_0x1ac3('0x6a')]['customerAvatar']=_0x53b8a3[_0x1ac3('0x83')][_0x1ac3('0x84')];return db[_0x1ac3('0x4e')]['find']({'where':{'id':_0x53b8a3['params']['id']}})['then'](handleEntityNotFound(_0x4d7f0c,null))[_0x1ac3('0x19')](saveUpdates(_0x53b8a3[_0x1ac3('0x6a')],null))[_0x1ac3('0x19')](respondWithResult(_0x4d7f0c,null))[_0x1ac3('0x60')](handleError(_0x4d7f0c,null));};exports[_0x1ac3('0x87')]=function(_0x24e287,_0x35071c){_0x24e287[_0x1ac3('0x6a')][_0x1ac3('0x88')]=_0x24e287[_0x1ac3('0x83')][_0x1ac3('0x84')];return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x24e287[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x35071c,null))[_0x1ac3('0x19')](saveUpdates(_0x24e287[_0x1ac3('0x6a')],null))[_0x1ac3('0x19')](respondWithResult(_0x35071c,null))['catch'](handleError(_0x35071c,null));};exports[_0x1ac3('0x89')]=function(_0x34b5dd,_0x218fb9){var _0x389b53=path[_0x1ac3('0x8a')](config['root'],_0x1ac3('0x8b'));var _0x32c91f={'where':{'id':_0x34b5dd['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2e9309=![];return require(_0x1ac3('0x8c'))[_0x1ac3('0x8d')]()[_0x1ac3('0x19')](function(_0x1dddbf){if(_0x1dddbf){_0x2e9309=_0x1dddbf[_0x1ac3('0x8e')];}})[_0x1ac3('0x19')](function(){return db[_0x1ac3('0x4e')][_0x1ac3('0x62')](_0x32c91f);})[_0x1ac3('0x19')](handleEntityNotFound(_0x218fb9,null))[_0x1ac3('0x19')](function(_0x1b099a){if(_0x1b099a){if(!_['isNil'](_0x1b099a[_0x1ac3('0x8f')])){if(fs['existsSync'](path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x91'),_0x1b099a[_0x1ac3('0x8f')]))&&_0x2e9309){_0x389b53=path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x91'),_0x1b099a[_0x1ac3('0x8f')]);}}return _0x218fb9[_0x1ac3('0x92')](_0x389b53);}})['catch'](handleError(_0x218fb9,null));};exports['getAvatar']=function(_0x53f1a2,_0x1b27e2){var _0x226281=path[_0x1ac3('0x8a')](config['root'],_0x1ac3('0x93'));var _0x471582={'where':{'id':_0x53f1a2['params']['id']},'attributes':['id',_0x1ac3('0x85')],'raw':!![]};return db[_0x1ac3('0x4e')][_0x1ac3('0x62')](_0x471582)['then'](handleEntityNotFound(_0x1b27e2,null))[_0x1ac3('0x19')](function(_0x57fa85){if(_0x57fa85){if(!_['isNil'](_0x57fa85['agentAvatar'])){if(fs[_0x1ac3('0x94')](path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x95'),_0x57fa85[_0x1ac3('0x85')]))){_0x226281=path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x95'),_0x57fa85[_0x1ac3('0x85')]);}}return _0x1b27e2[_0x1ac3('0x92')](_0x226281);}})[_0x1ac3('0x60')](handleError(_0x1b27e2,null));};exports[_0x1ac3('0x96')]=function(_0x113a0e,_0x588753){var _0x5af8bc=path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],'server/files/images/avatars/customer_avatar.png');var _0x170209={'where':{'id':_0x113a0e[_0x1ac3('0x72')]['id']},'attributes':['id',_0x1ac3('0x97'),_0x1ac3('0x98')],'raw':!![]};return db[_0x1ac3('0x4e')][_0x1ac3('0x62')](_0x170209)[_0x1ac3('0x19')](handleEntityNotFound(_0x588753,null))[_0x1ac3('0x19')](function(_0x44c60e){if(_0x44c60e){if(!_['isNil'](_0x44c60e[_0x1ac3('0x97')])){if(fs[_0x1ac3('0x94')](path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x95'),_0x44c60e[_0x1ac3('0x97')]))&&_0x44c60e[_0x1ac3('0x98')]){_0x5af8bc=path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],'server/files/images/avatars/',_0x44c60e[_0x1ac3('0x97')]);}}return _0x588753['download'](_0x5af8bc);}})[_0x1ac3('0x60')](handleError(_0x588753,null));};exports[_0x1ac3('0x99')]=function(_0x4ecbaa,_0x32c876){var _0x45c00a=path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],'server/files/images/avatars/system_avatar.png');var _0xf1d28c={'where':{'id':_0x4ecbaa[_0x1ac3('0x72')]['id']},'attributes':['id',_0x1ac3('0x88')],'raw':!![]};return db[_0x1ac3('0x4e')][_0x1ac3('0x62')](_0xf1d28c)[_0x1ac3('0x19')](handleEntityNotFound(_0x32c876,null))[_0x1ac3('0x19')](function(_0x4d6d80){if(_0x4d6d80){if(!_['isNil'](_0x4d6d80['systemAvatar'])){if(fs['existsSync'](path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x95'),_0x4d6d80[_0x1ac3('0x88')]))){_0x45c00a=path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x95'),_0x4d6d80['systemAvatar']);}}return _0x32c876['download'](_0x45c00a);}})['catch'](handleError(_0x32c876,null));};function checkWebsiteInterval(_0x421671){var _0x3e292d=_0x421671[_0x1ac3('0x9a')];if(!_0x3e292d){return Promise[_0x1ac3('0x9b')](_0x421671);}var _0x45ea6f=_0x421671['timezone']||undefined;return _0x3e292d[_0x1ac3('0x9c')](_0x45ea6f)[_0x1ac3('0x19')](function(_0x13250b){if(!_0x13250b){throw new APIOutOfIntervalError();}return _0x421671;});}exports[_0x1ac3('0x9d')]=function(_0x38cbd0,_0x2211e0){var _0x24f2cd={'body':_0x38cbd0[_0x1ac3('0x6a')],'channel':_0x1ac3('0x9e')};var _0x43cba5=[];var _0x4c7764=[];var _0x398d45={};var _0x99b822=![];if(_0x38cbd0[_0x1ac3('0x6a')]['id']){delete _0x38cbd0['body']['id'];}if(_[_0x1ac3('0x9f')](_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xa0')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x1ac3('0x9f')](_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xa1')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x38cbd0['body'][_0x1ac3('0x6a')])){throw new APIBadRequestError(_0x1ac3('0xa2'));}var _0x3f013f=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0x38')]&&_0x38cbd0['body'][_0x1ac3('0x3f')];return db[_0x1ac3('0xa3')]['describe']()[_0x1ac3('0x19')](function(_0x2d1166){if(!_0x2d1166){throw new Error(_0x1ac3('0xa4'));}_0x43cba5=Object['keys'](_0x2d1166)[_0x1ac3('0x5a')](function(_0x1263ae){return![_0x1ac3('0xa5'),_0x1ac3('0xa6')][_0x1ac3('0xa7')](_0x1263ae);});_0x4c7764=Object[_0x1ac3('0x51')](_0x2d1166)[_0x1ac3('0x5a')](function(_0x2258b8){return!['createdAt','updatedAt',_0x1ac3('0xa8'),_0x1ac3('0xa9')]['includes'](_0x2258b8);});if(!_[_0x1ac3('0xa7')](_0x4c7764,_0x38cbd0['body'][_0x1ac3('0xa1')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x4c7764[_0x1ac3('0x8a')](',\x20'));}_0x398d45[_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xa1')]]=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xa0')];})[_0x1ac3('0x19')](function(){return db[_0x1ac3('0x4e')]['find']({'where':{'id':_0x38cbd0[_0x1ac3('0x72')]['id']},'include':[{'model':db[_0x1ac3('0xaa')],'as':_0x1ac3('0xab'),'include':[{'model':db['CmContact'],'as':_0x1ac3('0xac'),'where':_0x398d45,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1ac3('0xad')],'as':_0x1ac3('0xae')},{'model':db['Interval'],'as':_0x1ac3('0x9a'),'include':[{'model':db[_0x1ac3('0x9a')],'as':_0x1ac3('0xaf'),'attributes':['id',_0x1ac3('0xb0')],'raw':!![]}]}]});})['then'](function(_0x3b2d96){if(!_0x3b2d96){throw new APINotFoundError(util['format'](_0x1ac3('0xb1'),_0x38cbd0[_0x1ac3('0x72')]['id']));}if(_0x3f013f){return checkWebsiteInterval(_0x3b2d96);}return _0x3b2d96;})[_0x1ac3('0x19')](function(_0x16a2c6){_0x24f2cd['account']=_0x16a2c6;_0x24f2cd[_0x1ac3('0xb2')]=_['orderBy'](_0x16a2c6[_0x1ac3('0xae')],[_0x1ac3('0xb3')],[_0x1ac3('0xb4')]);if(_0x24f2cd[_0x1ac3('0xb5')]['Applications']){delete _0x24f2cd[_0x1ac3('0xb5')][_0x1ac3('0xae')];}_0x24f2cd[_0x1ac3('0xb6')]=_0x16a2c6[_0x1ac3('0xab')]||{'id':_0x16a2c6[_0x1ac3('0xa9')]};if(_0x24f2cd[_0x1ac3('0xb6')]&&_0x24f2cd['list'][_0x1ac3('0xac')][_0x1ac3('0x56')]){return _0x24f2cd['list'][_0x1ac3('0xac')][0x0];}var _0x51100d=_['defaults'](_0x38cbd0['body'],{'firstName':_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xa0')],'ListId':_0x16a2c6['ListId']});_0x51100d[_0x38cbd0['body'][_0x1ac3('0xa1')]]=_0x38cbd0[_0x1ac3('0x6a')]['from'];return db[_0x1ac3('0xa3')][_0x1ac3('0x63')](_0x51100d,{'fields':_0x43cba5,'raw':!![]});})[_0x1ac3('0x19')](function(_0x34a13d){_0x24f2cd[_0x1ac3('0xb7')]=_0x34a13d;var _0x58cff1=createInteractionObject(_0x38cbd0[_0x1ac3('0x72')]['id'],_0x38cbd0[_0x1ac3('0x6a')],_0x38cbd0[_0x1ac3('0xb8')],_0x34a13d);var _0x1dc63c={'ChatWebsiteId':_0x38cbd0[_0x1ac3('0x72')]['id']};if(_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xb9')]){_0x1dc63c[_0x1ac3('0xb9')]=_0x38cbd0[_0x1ac3('0x6a')]['threadId'];_0x1dc63c['closed']=![];return db[_0x1ac3('0xba')][_0x1ac3('0x62')]({'where':_0x1dc63c})['then'](function(_0x263b6a){var _0x242dad=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0x38')]&&_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0x3f')];if(_0x263b6a){_0x99b822=!![];return _0x263b6a;}else if(!_0x242dad&&_0x263b6a&&_0x263b6a[_0x1ac3('0xbb')]){throw new APIConflictError(_0x1ac3('0xbc'));}_0x58cff1[_0x1ac3('0xb9')]=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xb9')];_0x58cff1[_0x1ac3('0xbd')]=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xbd')];return db[_0x1ac3('0xba')]['create'](_0x58cff1);});}_0x1dc63c[_0x1ac3('0xbe')]=_0x34a13d['id'];if(_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xbf')]&&_0x38cbd0['body'][_0x1ac3('0xbf')]['id']){_0x1dc63c['id']=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xbf')]['id'];return db[_0x1ac3('0xba')][_0x1ac3('0x62')]({'where':_0x1dc63c})['then'](function(_0x2b988f){var _0x3dc636=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0x38')]&&_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0x3f')];if(!_0x3dc636&&_0x2b988f&&_0x2b988f[_0x1ac3('0xbb')]){throw new APIConflictError(_0x1ac3('0xbc'));}else if(_0x2b988f){_0x99b822=!![];return _0x2b988f;}else{return db[_0x1ac3('0xba')][_0x1ac3('0x63')](_0x58cff1);}});}return db[_0x1ac3('0xba')]['create'](_0x58cff1);})['then'](function(_0x3381e7){if(!_0x99b822){return _0x3381e7;}var _0x4a3b9a={'from':(_0x24f2cd[_0x1ac3('0xb7')][_0x1ac3('0x3c')]||'')+'\x20'+(_0x24f2cd[_0x1ac3('0xb7')][_0x1ac3('0x3d')]||'')};if(_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xb9')]&&_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xc0')]&&_0x38cbd0['body'][_0x1ac3('0xb9')]!=_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xc0')]){_0x4a3b9a[_0x1ac3('0xb9')]=_0x38cbd0['body'][_0x1ac3('0xc0')];}return _0x3381e7[_0x1ac3('0x71')](_0x4a3b9a);})[_0x1ac3('0x19')](function(_0x15fc32){_0x24f2cd[_0x1ac3('0xbf')]=_0x15fc32[_0x1ac3('0x2d')]({'plain':!![]});_0x24f2cd[_0x1ac3('0xbf')]['created']=!_0x99b822;if(_0x24f2cd[_0x1ac3('0xbf')]['created']){if(_0x24f2cd['account'][_0x1ac3('0xc1')]){_0x24f2cd['applications'][_0x1ac3('0xc2')]({'id':0x0,'priority':_0x24f2cd[_0x1ac3('0xb2')][_0x1ac3('0x56')]+0x1,'app':_0x1ac3('0xc3'),'appdata':'unmanaged','interval':_0x1ac3('0xc4')});}}return db[_0x1ac3('0xc5')][_0x1ac3('0x63')]({'body':_0x38cbd0[_0x1ac3('0x6a')]['body'],'ChatWebsiteId':_0x38cbd0[_0x1ac3('0x72')]['id'],'ChatInteractionId':_0x15fc32['id'],'direction':'in','ContactId':_0x24f2cd[_0x1ac3('0xb7')]['id'],'AttachmentId':_0x38cbd0[_0x1ac3('0x6a')][_0x1ac3('0xc6')]});})[_0x1ac3('0x19')](function(_0x22bb76){_0x24f2cd['message']=_0x22bb76;if(!_0x24f2cd[_0x1ac3('0xbf')]['UserId']){return;}return db['User'][_0x1ac3('0x62')]({'attributes':['id','name'],'where':{'id':_0x24f2cd[_0x1ac3('0xbf')][_0x1ac3('0xc7')]}});})[_0x1ac3('0x19')](function(_0x252472){if(_0x252472){_0x24f2cd[_0x1ac3('0xb2')][_0x1ac3('0xc8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x252472[_0x1ac3('0x33')]+','+(_0x24f2cd['account'][_0x1ac3('0xc9')]||0xa),'interval':_0x1ac3('0xc4')});_0x24f2cd[_0x1ac3('0xca')]=!![];}if(!_0x24f2cd[_0x1ac3('0xbf')][_0x1ac3('0xcb')]){return;}return db[_0x1ac3('0xcc')][_0x1ac3('0x62')]({'attributes':['id',_0x1ac3('0x33')],'where':{'id':_0x24f2cd[_0x1ac3('0xbf')]['queueId']}});})[_0x1ac3('0x19')](function(_0x40d9cf){if(_0x40d9cf){_0x24f2cd['applications'][_0x1ac3('0xc8')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x40d9cf['name']+','+(_0x24f2cd[_0x1ac3('0xb5')][_0x1ac3('0xcd')]||0x12c),'interval':_0x1ac3('0xc4')});}return respondWithRpcPromise(_0x1ac3('0xce'),'startRouting',_0x24f2cd);})[_0x1ac3('0x19')](function(_0x227652){respondWithRpcPromise(_0x1ac3('0xcf'),_0x1ac3('0xcf'),{'event':_0x1ac3('0x9d'),'message':_0x227652},client9002);return _0x227652;})[_0x1ac3('0x19')](respondWithResult(_0x2211e0,null))[_0x1ac3('0x60')](APIHandleError(_0x2211e0));};exports[_0x1ac3('0xd0')]=function(_0x2a08d2,_0x3617fd){var _0x56f158,_0x4587a5,_0x41a670;var _0x1f9dee=[];var _0x383637={};var _0x45c73b=_0x2a08d2[_0x1ac3('0xd1')]||[];var _0x5eec53=[];var _0x5435ef;return db[_0x1ac3('0xa3')][_0x1ac3('0x73')]()['then'](function(_0x536090){if(!_0x536090){throw new db[(_0x1ac3('0xd2'))][(_0x1ac3('0xd3'))](_0x1ac3('0xd4'));}_0x1f9dee=_[_0x1ac3('0xd5')](_['keys'](_0x536090),[_0x1ac3('0xa5'),_0x1ac3('0xa6'),_0x1ac3('0xa8'),_0x1ac3('0xa9')]);if(_0x2a08d2[_0x1ac3('0x6a')]['id']){delete _0x2a08d2['body']['id'];}if(_[_0x1ac3('0x9f')](_0x2a08d2[_0x1ac3('0x6a')][_0x1ac3('0xa0')])){throw _0x3617fd[_0x1ac3('0x24')](0x1f4)[_0x1ac3('0x34')](new db[(_0x1ac3('0xd2'))][(_0x1ac3('0xd3'))](_0x1ac3('0xd6')));}if(_[_0x1ac3('0x9f')](_0x2a08d2[_0x1ac3('0x6a')][_0x1ac3('0x6a')])||_0x2a08d2[_0x1ac3('0x6a')]['body']===''){throw _0x3617fd[_0x1ac3('0x24')](0x1f4)[_0x1ac3('0x34')](new db[(_0x1ac3('0xd2'))][(_0x1ac3('0xd3'))](_0x1ac3('0xd7')));}if(_[_0x1ac3('0x9f')](_0x2a08d2[_0x1ac3('0x6a')][_0x1ac3('0xd8')])){throw _0x3617fd[_0x1ac3('0x24')](0x1f4)[_0x1ac3('0x34')](new db[(_0x1ac3('0xd2'))][(_0x1ac3('0xd3'))](_0x1ac3('0xd9')+_0x1f9dee));}if(!_[_0x1ac3('0xa7')](_0x1f9dee,_0x2a08d2['body'][_0x1ac3('0xd8')])){throw _0x3617fd['status'](0x1f4)[_0x1ac3('0x34')](new db[(_0x1ac3('0xd2'))][(_0x1ac3('0xd3'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f9dee));}_0x383637[_0x2a08d2[_0x1ac3('0x6a')][_0x1ac3('0xd8')]]=_0x2a08d2['body'][_0x1ac3('0xa0')];})[_0x1ac3('0x19')](function(){return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x2a08d2[_0x1ac3('0x72')]['id']},'include':[{'model':db['CmList'],'as':_0x1ac3('0xab')},{'model':db['MailAccount'],'as':_0x1ac3('0xda')}]});})['then'](handleEntityNotFound(_0x3617fd,null))[_0x1ac3('0x19')](function(_0x1e721b){if(_0x1e721b&&_0x1e721b['List']){_0x4587a5=_0x1e721b;var _0x5180f8=_[_0x1ac3('0x13')](_0x2a08d2[_0x1ac3('0x6a')],{'firstName':_0x2a08d2['body']['from'],'phone':_0x2a08d2[_0x1ac3('0x6a')]['from'],'ListId':_0x1e721b[_0x1ac3('0xa9')]});_0x5180f8[_0x2a08d2[_0x1ac3('0x6a')]['mapKeyOffline']]=_0x2a08d2[_0x1ac3('0x6a')][_0x1ac3('0xa0')];return db[_0x1ac3('0xa3')][_0x1ac3('0xdb')]({'where':_0x383637,'defaults':_0x5180f8});}})[_0x1ac3('0xdc')](function(_0x4d2d5d){if(_0x4d2d5d){_0x41a670=_0x4d2d5d;var _0x42fd83=fs[_0x1ac3('0xdd')](path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0xde')),_0x1ac3('0xdf'));var _0x5adf55=ejs[_0x1ac3('0xe0')](_0x42fd83,{'body':_[_0x1ac3('0xe1')](_0x2a08d2[_0x1ac3('0x6a')][_0x1ac3('0x6a')]),'bodyTitle':_0x4587a5[_0x1ac3('0xe2')]});return db[_0x1ac3('0xe3')][_0x1ac3('0x63')]({'body':_0x5adf55,'plainBody':htmlToText[_0x1ac3('0xe4')](_0x5adf55),'ContactId':_0x4d2d5d['id'],'ChatWebsiteId':_0x4587a5['id']});}})[_0x1ac3('0x19')](function(_0x13a32b){_0x5435ef=_0x13a32b;if(_0x45c73b[_0x1ac3('0x56')]){var _0x547357=_0x45c73b['map'](function(_0x7847bf){return{'name':_0x7847bf[_0x1ac3('0xe5')],'basename':_0x7847bf['filename'],'type':_0x7847bf[_0x1ac3('0xe6')],'ChatOfflineMessageId':_0x13a32b['id']};});_0x5eec53=_0x547357[_0x1ac3('0x4d')](_0x404710=>{var _0x1133a9={'filename':_0x404710[_0x1ac3('0x33')],'path':path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0xe7'),_0x1ac3('0xd1'),_0x1ac3('0xe8'),'offline-chat',_0x404710[_0x1ac3('0xe9')])};return _0x1133a9;});if(!_0x4587a5[_0x1ac3('0xea')]){return db['sequelize']['transaction'](function(_0x51b78b){return db[_0x1ac3('0xeb')][_0x1ac3('0xec')](_0x547357,{'transaction':_0x51b78b});});}}})['then'](function(){if(_0x5435ef){_0x56f158=_0x5435ef;return db[_0x1ac3('0xda')][_0x1ac3('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0x1ac3('0xed')],'as':_0x1ac3('0xee'),'raw':!![],'include':[{'model':db[_0x1ac3('0xef')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x2b8ef5){if(_0x2b8ef5&&_0x2b8ef5['Smtp']&&_0x4587a5[_0x1ac3('0xf0')]&&_0x4587a5[_0x1ac3('0xf1')]){var _0x5bed59=_0x2b8ef5[_0x1ac3('0xf2')]();return respondWithRpcPromise(_0x1ac3('0xf3'),_0x1ac3('0xf4'),{'account':_0x5bed59,'message':{'from':util[_0x1ac3('0x42')](_0x1ac3('0xf5'),_0x2b8ef5[_0x1ac3('0x33')],_0x2b8ef5[_0x1ac3('0xf6')]||_0x2b8ef5[_0x1ac3('0xee')][_0x1ac3('0x6b')]),'to':_0x4587a5[_0x1ac3('0xf1')],'subject':_0x4587a5['offlineMessageSubject'],'html':_0x56f158[_0x1ac3('0x6a')],'attachments':_0x5eec53}},client9003)[_0x1ac3('0x19')](function(){return _0x56f158;})[_0x1ac3('0x60')](function(_0x5181a9){logger[_0x1ac3('0x20')](_0x5181a9);});}})[_0x1ac3('0x19')](function(){if(_0x4587a5&&_0x4587a5[_0x1ac3('0xea')]&&_0x4587a5[_0x1ac3('0xf7')]){var _0x409f22=[];if(_0x45c73b[_0x1ac3('0x56')]){_0x409f22=_0x45c73b['map'](function(_0x97e4ca){return{'name':_0x97e4ca[_0x1ac3('0xe5')],'basename':_0x97e4ca[_0x1ac3('0x84')],'type':_0x97e4ca[_0x1ac3('0xe6')],'ChatOfflineMessageId':_0x5435ef['id']};});}var _0x29ece7;if(!_['isNil'](_0x4587a5[_0x1ac3('0xf8')])){var _0x413433=_[_0x1ac3('0x4d')](_0x2a08d2[_0x1ac3('0x6a')],function(_0x433b63){return _0x433b63;});var _0x2f5088=_[_0x1ac3('0xf9')](_0x413433)[0x0];var _0x1068b7=_['mapValues'](_0x2f5088,function(_0x4cce26){return _0x4cce26;});_0x29ece7=_0x1068b7[0x1][_0x4587a5[_0x1ac3('0xf8')]];}var _0x481270={'from':_0x41a670[_0x1ac3('0xf6')],'firstName':_0x41a670[_0x1ac3('0x3c')],'lastName':_0x41a670[_0x1ac3('0x3d')],'mapKey':_0x1ac3('0xf6'),'message':{'from':_0x41a670[_0x1ac3('0xf6')],'to':_0x4587a5[_0x1ac3('0xda')][_0x1ac3('0xf6')],'cc':'','subject':_['isNil'](_0x29ece7)?_0x4587a5['offlineMessageSubject']:_0x29ece7,'messageId':'','sentAt':new Date(),'attach':_0x409f22['length'],'attachments':_0x409f22,'originChannel':'Chat','ChatWebsiteId':_0x4587a5['id'],'ChatOfflineMessageId':_0x56f158['id'],'originTo':_0x4587a5[_0x1ac3('0xda')]['email']},'body':_0x56f158[_0x1ac3('0x6a')]};var _0x5b70f9={'account':{'id':_0x4587a5[_0x1ac3('0xf7')]},'body':_0x481270,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x1ac3('0xfa'),_0x5b70f9,client9001)[_0x1ac3('0x19')](function(){return _0x56f158;})[_0x1ac3('0x60')](function(_0x46cc44){logger[_0x1ac3('0x20')](_0x46cc44);});}return;})['then'](function(){if(_0x56f158){return _0x56f158;}})[_0x1ac3('0x19')](respondWithResult(_0x3617fd,null))['catch'](function(){for(var _0x2dce91 of _0x45c73b){var _0x5c4582=path['join'](config[_0x1ac3('0x90')],_0x1ac3('0xe7'),'files',_0x1ac3('0xe8'),_0x1ac3('0xfb'),_0x2dce91[_0x1ac3('0x84')]);fs_extra[_0x1ac3('0xfc')](_0x5c4582)[_0x1ac3('0x60')](function(_0x35e1fe){logger[_0x1ac3('0x20')](_0x1ac3('0xfd'),_0x5c4582,_0x35e1fe);});}});};exports[_0x1ac3('0xfe')]=function(_0x363cef,_0x2d8843){return db[_0x1ac3('0xba')][_0x1ac3('0x62')]({'where':{'id':_0x363cef[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x2d8843,null))[_0x1ac3('0x19')](function(_0x50e977){if(_0x50e977){return _0x50e977[_0x1ac3('0xfe')](_0x363cef[_0x1ac3('0x6a')][_0x1ac3('0x81')],_[_0x1ac3('0xff')](_0x363cef[_0x1ac3('0x6a')],['ids','id'])||{});}})[_0x1ac3('0x19')](respondWithResult(_0x2d8843,null))[_0x1ac3('0x60')](handleError(_0x2d8843,null));};exports['getInteractions']=function(_0x305805,_0x10ffd4){var _0xcbc2a3={'raw':![],'where':{}};var _0x4a02e3={};var _0x59fa4e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1ac3('0x7d')]({'where':{'id':_0x305805[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x10ffd4,null))[_0x1ac3('0x19')](function(_0x689aa2){if(_0x689aa2){_0x4a02e3['model']=_['keys'](db[_0x1ac3('0xba')][_0x1ac3('0x4f')]);_0x4a02e3[_0x1ac3('0x50')]=_[_0x1ac3('0x51')](_0x305805[_0x1ac3('0x50')]);_0x4a02e3[_0x1ac3('0x52')]=_['intersection'](_0x4a02e3[_0x1ac3('0x46')],_0x4a02e3[_0x1ac3('0x50')]);_0xcbc2a3[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x4a02e3[_0x1ac3('0x46')],qs[_0x1ac3('0x55')](_0x305805['query'][_0x1ac3('0x55')]));_0xcbc2a3['attributes']=_0xcbc2a3[_0x1ac3('0x53')]['length']?_0xcbc2a3[_0x1ac3('0x53')]:_0x4a02e3[_0x1ac3('0x46')];if(!_0x305805['query'][_0x1ac3('0x7e')](_0x1ac3('0x77'))){_0xcbc2a3[_0x1ac3('0x27')]=qs['limit'](_0x305805['query'][_0x1ac3('0x27')]);_0xcbc2a3[_0x1ac3('0x29')]=qs[_0x1ac3('0x29')](_0x305805[_0x1ac3('0x50')][_0x1ac3('0x29')]);}_0xcbc2a3[_0x1ac3('0x7f')]=qs[_0x1ac3('0x57')](_0x305805[_0x1ac3('0x50')]['sort']);_0xcbc2a3[_0x1ac3('0x58')]=qs[_0x1ac3('0x52')](_[_0x1ac3('0x59')](_0x305805[_0x1ac3('0x50')],_0x4a02e3['filters']));_0xcbc2a3[_0x1ac3('0x58')]['ChatWebsiteId']=_0x689aa2['id'];if(_0x305805['query']['filter']){_0xcbc2a3[_0x1ac3('0x58')]=_[_0x1ac3('0x5b')](_0xcbc2a3[_0x1ac3('0x58')],{'$or':_[_0x1ac3('0x4d')](_0xcbc2a3['attributes'],function(_0x238ce4){var _0x4e0a18={};_0x4e0a18[_0x238ce4]={'$like':'%'+_0x305805[_0x1ac3('0x50')][_0x1ac3('0x5a')]+'%'};return _0x4e0a18;})});}_0xcbc2a3=_[_0x1ac3('0x5b')]({},_0xcbc2a3,_0x305805[_0x1ac3('0x5d')]);return db[_0x1ac3('0xba')]['count']({'where':_0xcbc2a3['where']})[_0x1ac3('0x19')](function(_0x3c2a20){_0x59fa4e[_0x1ac3('0x28')]=_0x3c2a20;if(_0x305805[_0x1ac3('0x50')]['includeAll']){_0xcbc2a3[_0x1ac3('0x5e')]=[{'model':db['CmContact'],'as':_0x1ac3('0x100'),'required':![]},{'model':db['User'],'as':_0x1ac3('0x101'),'attributes':[_0x1ac3('0x33'),_0x1ac3('0x102'),'internal'],'required':![]},{'model':db[_0x1ac3('0x103')],'as':'Tags','attributes':['id',_0x1ac3('0x33'),_0x1ac3('0x104')],'where':_0x305805[_0x1ac3('0x50')][_0x1ac3('0x105')]?{'id':_0x305805[_0x1ac3('0x50')][_0x1ac3('0x105')]}:undefined,'required':_0x305805[_0x1ac3('0x50')]['tag']?!![]:![]}];}return db[_0x1ac3('0xba')][_0x1ac3('0x79')](_0xcbc2a3);})[_0x1ac3('0x19')](function(_0x40adad){_0x59fa4e[_0x1ac3('0x5f')]=_0x40adad;return _0x59fa4e;});}})[_0x1ac3('0x19')](respondWithFilteredResult(_0x10ffd4,_0xcbc2a3))['catch'](handleError(_0x10ffd4,null));};exports[_0x1ac3('0x106')]=function(_0x3d0215,_0x33494b){var _0x1d710b=0x0;var _0x2cf9a5=0x0;var _0x421647=![];var _0x34dfec;var _0x593b7c;return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x3d0215[_0x1ac3('0x72')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x1ac3('0x9a')],'as':_0x1ac3('0xaf'),'attributes':['id',_0x1ac3('0xb0')]}]}]})[_0x1ac3('0x19')](handleEntityNotFound(_0x33494b,null))[_0x1ac3('0x19')](function(_0x36732e){if(_0x36732e){_0x34dfec=_0x36732e;return _0x36732e['getProactiveActions']({'raw':!![]});}})[_0x1ac3('0x19')](function(_0x3b21f4){if(_0x34dfec){if(_0x3b21f4){_0x593b7c=_0x3b21f4;}}return require(_0x1ac3('0x8c'))[_0x1ac3('0x8d')]();})[_0x1ac3('0x19')](function(_0x3a4f72){if(_0x3a4f72){_0x2cf9a5=_0x3a4f72[_0x1ac3('0x107')];_0x421647=_0x3a4f72['custom'];}})[_0x1ac3('0x19')](function(){return db[_0x1ac3('0xba')]['count']({'where':{'closed':![]}});})[_0x1ac3('0x19')](function(_0x3e3def){_0x1d710b=_0x3e3def;if(_0x2cf9a5&&_0x3e3def>_0x2cf9a5){return db['License'][_0x1ac3('0x7d')]({'where':{'id':0x1}})[_0x1ac3('0x19')](function(_0x1e8e1e){if(_0x1e8e1e){_0x1e8e1e['increment'](_0x1ac3('0x108'));}});}})[_0x1ac3('0x19')](function(){var _0x440ba3=_0x34dfec[_0x1ac3('0x9a')];var _0x2fd9c3=_0x34dfec['timezone']||undefined;return _0x440ba3?_0x440ba3[_0x1ac3('0x9c')](_0x2fd9c3):!![];})[_0x1ac3('0x19')](function(_0x1772bb){var _0x25f8de=fs[_0x1ac3('0xdd')](path[_0x1ac3('0x8a')](config[_0x1ac3('0x90')],_0x1ac3('0x109')),_0x1ac3('0xdf'));var _0x194b94=_0x1ac3('0x10a');var _0x54dcef=![];var _0x2ea510,_0x55ef0f;if(_0x3d0215['headers']['referer']){_0x2ea510=new URL(_0x3d0215[_0x1ac3('0xb8')][_0x1ac3('0x3f')])[_0x1ac3('0x10b')];}else if(_0x3d0215[_0x1ac3('0xb8')][_0x1ac3('0x10b')]){_0x2ea510=new URL(_0x3d0215[_0x1ac3('0xb8')][_0x1ac3('0x10b')])[_0x1ac3('0x10b')];}else{_0x2ea510=_0x1ac3('0x10c');}_0x55ef0f=typeof _0x34dfec[_0x1ac3('0x64')][_0x1ac3('0x65')](',')[_0x1ac3('0x62')](function(_0x3262b9){return wildcardUtils[_0x1ac3('0x10d')](_0x3262b9,_0x2ea510);})!==_0x1ac3('0x26');var _0x1f88ae={'chatVersion':_0x194b94,'chatWebsiteAddressOrigin':_0x55ef0f?_0x2ea510:_0x34dfec[_0x1ac3('0x64')],'remote':_0x34dfec['remote'],'query':querystring[_0x1ac3('0x1f')](_[_0x1ac3('0x5b')](_0x34dfec[_0x1ac3('0x2d')]({'plain':!![]}),{'customerIp':_0x3d0215[_0x1ac3('0xb8')][_0x1ac3('0x3a')]||_0x3d0215[_0x1ac3('0xb8')][_0x1ac3('0x10e')]||_0x3d0215[_0x1ac3('0x10f')][_0x1ac3('0x110')]||_0x3d0215['ip'],'referer':_0x3d0215['headers'][_0x1ac3('0x3f')],'openedInteractions':_0x1d710b,'maxInteractions':_0x2cf9a5,'virtual':_0x421647[_0x1ac3('0x107')],'online':_0x1772bb,'custom':_0x421647,'address':_0x55ef0f?_0x2ea510:null}))[_0x1ac3('0x111')](/'/g,'\x5c\x27')};_0x33494b['send'](ejs[_0x1ac3('0xe0')](Mustache[_0x1ac3('0xe0')](_0x25f8de,_0x1f88ae),{'proactiveActions':_0x593b7c,'alignment':_0x34dfec['alignment'],'verticalAlignment':_0x34dfec['verticalAlignment'],'div_color':_0x34dfec[_0x1ac3('0x104')],'labelText':_0x34dfec[_0x1ac3('0x112')],'text_color':_0x34dfec[_0x1ac3('0x113')],'text_button_color':_0x34dfec[_0x1ac3('0x114')],'button_color':_0x34dfec[_0x1ac3('0x115')],'background_color':_0x34dfec[_0x1ac3('0x116')],'hideWhenOffline':_0x34dfec['hideWhenOffline'],'intervalId':_0x34dfec[_0x1ac3('0x117')],'isDevelopment':_0x54dcef,'chatVersion':_0x194b94}));})['catch'](handleError(_0x33494b,null));};exports['addApplications']=function(_0x56a48f,_0xd4a6b1){var _0x30c581=_0x56a48f['params']['id'];var _0xd47633=_0x56a48f[_0x1ac3('0x6a')];var _0x12bb2d=0xc8;var _0x16d03f=null;return db[_0x1ac3('0x118')]['transaction']({'isolationLevel':db[_0x1ac3('0x118')][_0x1ac3('0x119')][_0x1ac3('0x11a')][_0x1ac3('0x11b')]},function(_0x57d89f){return db['ChatWebsite'][_0x1ac3('0x7d')]({'where':{'id':_0x30c581},'transaction':_0x57d89f})[_0x1ac3('0x19')](function(_0x2ed699){if(_0x2ed699){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x30c581},'transaction':_0x57d89f})[_0x1ac3('0x19')](function(){var _0x53eff0=_['map'](_0xd47633,function(_0x456e15){_0x456e15['ChatWebsiteId']=_0x30c581;return _0x456e15;});return db[_0x1ac3('0xad')][_0x1ac3('0xec')](_0x53eff0,{'transaction':_0x57d89f});});}else{_0x12bb2d=0x194;_0x16d03f=[];}});})[_0x1ac3('0x19')](function(){if(_0x12bb2d!==0x194){return db[_0x1ac3('0xad')][_0x1ac3('0x11c')]({'where':{'ChatWebsiteId':_0x30c581},'order':_0x1ac3('0xb3')})[_0x1ac3('0x19')](function(_0xd90038){_0x16d03f=_0xd90038;});}})[_0x1ac3('0x60')](function(_0xca8344){_0x12bb2d=0x1f4;logger[_0x1ac3('0x20')](_0xca8344['stack']);if(_0xca8344[_0x1ac3('0x33')]){delete _0xca8344['name'];}_0x16d03f=_0xca8344;})[_0x1ac3('0x11d')](function(){if(_0x16d03f===null){_0xd4a6b1['sendStatus'](_0x12bb2d);}else{if(_0x12bb2d===0x1f4){_0xd4a6b1[_0x1ac3('0x24')](_0x12bb2d)[_0x1ac3('0x34')](_0x16d03f);}else{_0xd4a6b1[_0x1ac3('0x24')](_0x12bb2d)[_0x1ac3('0x25')](_0x16d03f);}}});};exports[_0x1ac3('0x11e')]=function(_0x2b890f,_0x576038){var _0x251dda={};var _0x39bbe9={};var _0x5b5e82;var _0x21f8d4;return db[_0x1ac3('0x4e')][_0x1ac3('0x7d')]({'where':{'id':_0x2b890f[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x576038,null))[_0x1ac3('0x19')](function(_0x2af72a){if(_0x2af72a){_0x5b5e82=_0x2af72a;_0x39bbe9[_0x1ac3('0x46')]=_['keys'](db[_0x1ac3('0xad')][_0x1ac3('0x4f')]);_0x39bbe9[_0x1ac3('0x50')]=_['keys'](_0x2b890f['query']);_0x39bbe9[_0x1ac3('0x52')]=_['intersection'](_0x39bbe9[_0x1ac3('0x46')],_0x39bbe9[_0x1ac3('0x50')]);_0x251dda[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x39bbe9[_0x1ac3('0x46')],qs['fields'](_0x2b890f[_0x1ac3('0x50')][_0x1ac3('0x55')]));_0x251dda[_0x1ac3('0x53')]=_0x251dda[_0x1ac3('0x53')][_0x1ac3('0x56')]?_0x251dda['attributes']:_0x39bbe9['model'];_0x251dda[_0x1ac3('0x7f')]=qs[_0x1ac3('0x57')](_0x2b890f[_0x1ac3('0x50')][_0x1ac3('0x57')]);_0x251dda['where']=qs[_0x1ac3('0x52')](_[_0x1ac3('0x59')](_0x2b890f[_0x1ac3('0x50')],_0x39bbe9['filters']));if(_0x2b890f[_0x1ac3('0x50')][_0x1ac3('0x5a')]){_0x251dda[_0x1ac3('0x58')]=_['merge'](_0x251dda['where'],{'$or':_[_0x1ac3('0x4d')](_0x251dda[_0x1ac3('0x53')],function(_0x4a3a6c){var _0x19fc86={};_0x19fc86[_0x4a3a6c]={'$like':'%'+_0x2b890f['query'][_0x1ac3('0x5a')]+'%'};return _0x19fc86;})});}_0x251dda=_[_0x1ac3('0x5b')]({},_0x251dda,_0x2b890f[_0x1ac3('0x5d')]);return _0x5b5e82[_0x1ac3('0x11e')](_0x251dda);}})[_0x1ac3('0x19')](function(_0x278e1e){if(_0x278e1e){_0x21f8d4=_0x278e1e['length'];if(!_0x2b890f['query'][_0x1ac3('0x7e')](_0x1ac3('0x77'))){_0x251dda[_0x1ac3('0x27')]=qs[_0x1ac3('0x27')](_0x2b890f[_0x1ac3('0x50')][_0x1ac3('0x27')]);_0x251dda[_0x1ac3('0x29')]=qs[_0x1ac3('0x29')](_0x2b890f[_0x1ac3('0x50')][_0x1ac3('0x29')]);}return _0x5b5e82[_0x1ac3('0x11e')](_0x251dda);}})[_0x1ac3('0x19')](function(_0x178f4e){if(_0x178f4e){return _0x178f4e?{'count':_0x21f8d4,'rows':_0x178f4e}:null;}})[_0x1ac3('0x19')](respondWithResult(_0x576038,null))[_0x1ac3('0x60')](handleError(_0x576038,null));};exports['addProactiveActions']=function(_0x47b1fb,_0x21c927){return db[_0x1ac3('0x11f')][_0x1ac3('0x62')]({'where':{'id':_0x47b1fb[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x21c927,null))[_0x1ac3('0x19')](function(_0xfe73ef){if(_0xfe73ef){return _0xfe73ef[_0x1ac3('0x120')](_0x47b1fb['body'][_0x1ac3('0x81')],_[_0x1ac3('0xff')](_0x47b1fb['body'],[_0x1ac3('0x81'),'id'])||{});}})[_0x1ac3('0x19')](respondWithResult(_0x21c927,null))[_0x1ac3('0x60')](handleError(_0x21c927,null));};exports[_0x1ac3('0x121')]=function(_0x843684,_0x54132b){var _0x1e9e85={};var _0x5953a3={};var _0x361e9f;var _0x50d9e9;return db['ChatWebsite'][_0x1ac3('0x7d')]({'where':{'id':_0x843684['params']['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x54132b,null))[_0x1ac3('0x19')](function(_0x38dee5){if(_0x38dee5){_0x361e9f=_0x38dee5;_0x5953a3[_0x1ac3('0x46')]=_[_0x1ac3('0x51')](db[_0x1ac3('0x122')][_0x1ac3('0x4f')]);_0x5953a3[_0x1ac3('0x50')]=_['keys'](_0x843684[_0x1ac3('0x50')]);_0x5953a3[_0x1ac3('0x52')]=_['intersection'](_0x5953a3[_0x1ac3('0x46')],_0x5953a3[_0x1ac3('0x50')]);_0x1e9e85[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x5953a3[_0x1ac3('0x46')],qs[_0x1ac3('0x55')](_0x843684['query'][_0x1ac3('0x55')]));_0x1e9e85['attributes']=_0x1e9e85[_0x1ac3('0x53')]['length']?_0x1e9e85[_0x1ac3('0x53')]:_0x5953a3['model'];_0x1e9e85[_0x1ac3('0x7f')]=qs[_0x1ac3('0x57')](_0x843684['query']['sort']);_0x1e9e85[_0x1ac3('0x58')]=qs[_0x1ac3('0x52')](_[_0x1ac3('0x59')](_0x843684[_0x1ac3('0x50')],_0x5953a3[_0x1ac3('0x52')]));if(_0x843684[_0x1ac3('0x50')][_0x1ac3('0x5a')]){_0x1e9e85[_0x1ac3('0x58')]=_[_0x1ac3('0x5b')](_0x1e9e85['where'],{'$or':_['map'](_0x1e9e85[_0x1ac3('0x53')],function(_0x153450){var _0x1607d1={};_0x1607d1[_0x153450]={'$like':'%'+_0x843684[_0x1ac3('0x50')]['filter']+'%'};return _0x1607d1;})});}_0x1e9e85=_[_0x1ac3('0x5b')]({},_0x1e9e85,_0x843684['options']);return _0x361e9f['getProactiveActions'](_0x1e9e85);}})[_0x1ac3('0x19')](function(_0x400ca1){if(_0x400ca1){_0x50d9e9=_0x400ca1['length'];if(!_0x843684[_0x1ac3('0x50')]['hasOwnProperty'](_0x1ac3('0x77'))){_0x1e9e85[_0x1ac3('0x27')]=qs[_0x1ac3('0x27')](_0x843684[_0x1ac3('0x50')][_0x1ac3('0x27')]);_0x1e9e85[_0x1ac3('0x29')]=qs['offset'](_0x843684[_0x1ac3('0x50')][_0x1ac3('0x29')]);}return _0x361e9f['getProactiveActions'](_0x1e9e85);}})[_0x1ac3('0x19')](function(_0x3b9715){if(_0x3b9715){return _0x3b9715?{'count':_0x50d9e9,'rows':_0x3b9715}:null;}})[_0x1ac3('0x19')](respondWithResult(_0x54132b,null))[_0x1ac3('0x60')](handleError(_0x54132b,null));};exports[_0x1ac3('0x123')]=function(_0x5aa22e,_0x321e10){var _0x10726d=_0x5aa22e['query'][_0x1ac3('0x124')]===_0x1ac3('0x125')?_0x1ac3('0x126'):_0x1ac3('0x127');return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'attributes':['id',_0x10726d],'where':{'id':_0x5aa22e[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x321e10,null))['then'](function(_0x4193e4){if(_0x4193e4){var _0x2a9db2=_0x4193e4[_0x10726d];var _0x5921a6=_0x2a9db2&&_0x2a9db2[_0x1ac3('0x128')]?_0x2a9db2['items']:[];_0x321e10[_0x1ac3('0x34')]({'fromKey':_['isNil'](_0x2a9db2[_0x1ac3('0x129')])?undefined:_0x2a9db2[_0x1ac3('0x129')],'count':_0x5921a6[_0x1ac3('0x56')],'rows':_0x5921a6});}})[_0x1ac3('0x60')](handleError(_0x321e10,null));};exports[_0x1ac3('0x12a')]=function(_0x1350e3,_0x3389e9){var _0xe11bd9={'raw':![],'where':{}};var _0x2cb37f={};var _0x1578d7={'count':0x0,'rows':[]};return db[_0x1ac3('0x4e')][_0x1ac3('0x7d')]({'where':{'id':_0x1350e3['params']['id']}})['then'](handleEntityNotFound(_0x3389e9,null))['then'](function(_0x12ce2a){if(_0x12ce2a){_0x2cb37f[_0x1ac3('0x46')]=_[_0x1ac3('0x51')](db[_0x1ac3('0xe3')][_0x1ac3('0x4f')]);_0x2cb37f[_0x1ac3('0x50')]=_[_0x1ac3('0x51')](_0x1350e3[_0x1ac3('0x50')]);_0x2cb37f['filters']=_['intersection'](_0x2cb37f[_0x1ac3('0x46')],_0x2cb37f[_0x1ac3('0x50')]);_0xe11bd9[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x2cb37f['model'],qs[_0x1ac3('0x55')](_0x1350e3['query'][_0x1ac3('0x55')]));_0xe11bd9[_0x1ac3('0x53')]=_0xe11bd9[_0x1ac3('0x53')][_0x1ac3('0x56')]?_0xe11bd9[_0x1ac3('0x53')]:_0x2cb37f['model'];if(!_0x1350e3[_0x1ac3('0x50')][_0x1ac3('0x7e')](_0x1ac3('0x77'))){_0xe11bd9[_0x1ac3('0x27')]=qs[_0x1ac3('0x27')](_0x1350e3[_0x1ac3('0x50')]['limit']);_0xe11bd9['offset']=qs[_0x1ac3('0x29')](_0x1350e3[_0x1ac3('0x50')]['offset']);}_0xe11bd9[_0x1ac3('0x7f')]=qs[_0x1ac3('0x57')](_0x1350e3[_0x1ac3('0x50')]['sort']);_0xe11bd9['where']=qs[_0x1ac3('0x52')](_[_0x1ac3('0x59')](_0x1350e3[_0x1ac3('0x50')],_0x2cb37f[_0x1ac3('0x52')]));_0xe11bd9[_0x1ac3('0x58')]['ChatWebsiteId']=_0x12ce2a['id'];if(_0x1350e3['query'][_0x1ac3('0x5a')]){_0xe11bd9[_0x1ac3('0x58')]=_[_0x1ac3('0x5b')](_0xe11bd9[_0x1ac3('0x58')],{'$or':_[_0x1ac3('0x4d')](_0xe11bd9[_0x1ac3('0x53')],function(_0x2358e2){var _0xff4802={};_0xff4802[_0x2358e2]={'$like':'%'+_0x1350e3['query'][_0x1ac3('0x5a')]+'%'};return _0xff4802;})});}_0xe11bd9=_['merge']({},_0xe11bd9,_0x1350e3['options']);return db[_0x1ac3('0xe3')][_0x1ac3('0x28')]({'where':_0xe11bd9[_0x1ac3('0x58')]})[_0x1ac3('0x19')](function(_0x34691d){_0x1578d7[_0x1ac3('0x28')]=_0x34691d;if(_0x1350e3['query'][_0x1ac3('0x61')]){_0xe11bd9['include']=[{'all':!![]}];}else{_0xe11bd9[_0x1ac3('0x5e')]=[{'model':db[_0x1ac3('0xa3')],'as':_0x1ac3('0x100'),'required':![]},{'model':db[_0x1ac3('0xeb')],'as':_0x1ac3('0x12b'),'required':![]}];}return db[_0x1ac3('0xe3')][_0x1ac3('0x79')](_0xe11bd9);})[_0x1ac3('0x19')](function(_0x30feef){_0x1578d7['rows']=_0x30feef;return _0x1578d7;});}})[_0x1ac3('0x19')](respondWithFilteredResult(_0x3389e9,_0xe11bd9))['catch'](handleError(_0x3389e9,null));};exports[_0x1ac3('0x12c')]=function(_0x515dbb,_0xb8cb1c){return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x515dbb[_0x1ac3('0x72')]['id']}})['then'](handleEntityNotFound(_0xb8cb1c,null))[_0x1ac3('0x19')](function(_0xfbeb5f){if(_0xfbeb5f){return _0xfbeb5f[_0x1ac3('0x12c')](_0x515dbb['body'][_0x1ac3('0x81')],_['omit'](_0x515dbb[_0x1ac3('0x6a')],['ids','id'])||{})['spread'](function(_0x5171b9){for(var _0x4431bc=0x0;_0x4431bc<_0x515dbb[_0x1ac3('0x6a')][_0x1ac3('0x81')][_0x1ac3('0x56')];_0x4431bc+=0x1){socket[_0x1ac3('0x12d')](_0x1ac3('0x12e'),{'UserId':Number(_0x515dbb['body'][_0x1ac3('0x81')][_0x4431bc]),'ChatWebsiteId':Number(_0x515dbb[_0x1ac3('0x72')]['id'])});}return _0x5171b9;});}})[_0x1ac3('0x19')](respondWithResult(_0xb8cb1c,null))['catch'](handleError(_0xb8cb1c,null));};exports['removeAgents']=function(_0x2042d2,_0x2bc485){return db[_0x1ac3('0x4e')][_0x1ac3('0x62')]({'where':{'id':_0x2042d2[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x2bc485,null))['then'](function(_0x12f2c4){if(_0x12f2c4){return _0x12f2c4['removeAgents'](_0x2042d2[_0x1ac3('0x50')][_0x1ac3('0x81')])[_0x1ac3('0x19')](function(){if(_[_0x1ac3('0x12f')](_0x2042d2[_0x1ac3('0x50')]['ids'])){for(var _0x3629b3=0x0;_0x3629b3<_0x2042d2[_0x1ac3('0x50')][_0x1ac3('0x81')][_0x1ac3('0x56')];_0x3629b3+=0x1){socket[_0x1ac3('0x12d')](_0x1ac3('0x130'),{'UserId':Number(_0x2042d2['query'][_0x1ac3('0x81')][_0x3629b3]),'ChatWebsiteId':Number(_0x2042d2[_0x1ac3('0x72')]['id'])});}}else{socket[_0x1ac3('0x12d')](_0x1ac3('0x130'),{'UserId':Number(_0x2042d2['query'][_0x1ac3('0x81')]),'ChatWebsiteId':Number(_0x2042d2[_0x1ac3('0x72')]['id'])});}});}})['then'](respondWithStatusCode(_0x2bc485,null))[_0x1ac3('0x60')](handleError(_0x2bc485,null));};exports[_0x1ac3('0x131')]=function(_0x5c6f2f,_0x200853){var _0x16e33e={};var _0x93ba={};var _0x32a3e2;var _0x4c5ea3;return db[_0x1ac3('0x4e')][_0x1ac3('0x7d')]({'where':{'id':_0x5c6f2f[_0x1ac3('0x72')]['id']}})[_0x1ac3('0x19')](handleEntityNotFound(_0x200853,null))[_0x1ac3('0x19')](function(_0x5c2d79){if(_0x5c2d79){_0x32a3e2=_0x5c2d79;_0x93ba[_0x1ac3('0x46')]=_['keys'](db[_0x1ac3('0x132')]['rawAttributes']);_0x93ba[_0x1ac3('0x50')]=_['keys'](_0x5c6f2f[_0x1ac3('0x50')]);_0x93ba[_0x1ac3('0x52')]=_['intersection'](_0x93ba['model'],_0x93ba[_0x1ac3('0x50')]);_0x16e33e[_0x1ac3('0x53')]=_[_0x1ac3('0x54')](_0x93ba[_0x1ac3('0x46')],qs[_0x1ac3('0x55')](_0x5c6f2f['query'][_0x1ac3('0x55')]));_0x16e33e[_0x1ac3('0x53')]=_0x16e33e[_0x1ac3('0x53')]['length']?_0x16e33e[_0x1ac3('0x53')]:_0x93ba[_0x1ac3('0x46')];_0x16e33e['order']=qs['sort'](_0x5c6f2f['query'][_0x1ac3('0x57')]);_0x16e33e['where']=qs[_0x1ac3('0x52')](_[_0x1ac3('0x59')](_0x5c6f2f[_0x1ac3('0x50')],_0x93ba['filters']));if(_0x5c6f2f[_0x1ac3('0x50')][_0x1ac3('0x5a')]){_0x16e33e[_0x1ac3('0x58')]=_[_0x1ac3('0x5b')](_0x16e33e[_0x1ac3('0x58')],{'$or':_['map'](_0x16e33e[_0x1ac3('0x53')],function(_0x28d776){var _0x16e468={};_0x16e468[_0x28d776]={'$like':'%'+_0x5c6f2f[_0x1ac3('0x50')]['filter']+'%'};return _0x16e468;})});}_0x16e33e=_[_0x1ac3('0x5b')]({},_0x16e33e,_0x5c6f2f[_0x1ac3('0x5d')]);return _0x32a3e2[_0x1ac3('0x131')](_0x16e33e);}})[_0x1ac3('0x19')](function(_0x307e16){if(_0x307e16){_0x4c5ea3=_0x307e16[_0x1ac3('0x56')];if(!_0x5c6f2f[_0x1ac3('0x50')][_0x1ac3('0x7e')](_0x1ac3('0x77'))){_0x16e33e[_0x1ac3('0x27')]=qs[_0x1ac3('0x27')](_0x5c6f2f[_0x1ac3('0x50')]['limit']);_0x16e33e[_0x1ac3('0x29')]=qs['offset'](_0x5c6f2f[_0x1ac3('0x50')][_0x1ac3('0x29')]);}return _0x32a3e2[_0x1ac3('0x131')](_0x16e33e);}})['then'](function(_0x12238e){if(_0x12238e){return _0x12238e?{'count':_0x4c5ea3,'rows':_0x12238e}:null;}})[_0x1ac3('0x19')](respondWithResult(_0x200853,null))['catch'](handleError(_0x200853,null));};
\ No newline at end of file
+var _0xee14=['userChatWebsite:remove','getAgents','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','%s\x20%s\x20%s','vendor','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','Pause','length','include','body','address','forEach','trim','testWildcardValidity','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','resolve','timezone','ifTime','notify','chat','from','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','Interval','interval','account','applications','priority','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','push','unmanaged','UserId','User','unshift','agent','*,*,*,*','queueId','ChatQueue','queue','Start','EventManager','offline','files','ValidationError','no\x20available\x20attributes','difference','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Intervals','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','replace','alignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','spread','emit','removeAgents'];(function(_0x4b8e55,_0x13db4f){var _0x185f42=function(_0x136295){while(--_0x136295){_0x4b8e55['push'](_0x4b8e55['shift']());}};_0x185f42(++_0x13db4f);}(_0xee14,0x13a));var _0x4ee1=function(_0x3caa98,_0xbc584b){_0x3caa98=_0x3caa98-0x0;var _0x4b386f=_0xee14[_0x3caa98];return _0x4b386f;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x4ee1('0x0'));var ejs=require(_0x4ee1('0x1'));var fs=require('fs');var fs_extra=require(_0x4ee1('0x2'));var _=require(_0x4ee1('0x3'));var querystring=require(_0x4ee1('0x4'));var htmlToText=require(_0x4ee1('0x5'));var Redis=require(_0x4ee1('0x6'));var jayson=require(_0x4ee1('0x7'));var qs=require(_0x4ee1('0x8'));var logger=require('../../config/logger')(_0x4ee1('0x9'));var config=require('../../config/environment');var APIBadRequestError=require(_0x4ee1('0xa'))[_0x4ee1('0xb')];var APINotFoundError=require(_0x4ee1('0xa'))[_0x4ee1('0xc')];var APIOutOfIntervalError=require(_0x4ee1('0xa'))[_0x4ee1('0xd')];var APIHandleError=require('../../errors/api')[_0x4ee1('0xe')];var APIConflictError=require(_0x4ee1('0xa'))['APIConflictError'];var wildcardUtils=require(_0x4ee1('0xf'));var URL=require(_0x4ee1('0x10'))[_0x4ee1('0x11')];var db=require(_0x4ee1('0x12'))['db'];config['redis']=_[_0x4ee1('0x13')](config[_0x4ee1('0x14')],{'host':_0x4ee1('0x15'),'port':0x18eb});var socket=require(_0x4ee1('0x16'))(new Redis(config[_0x4ee1('0x14')]));require(_0x4ee1('0x17'))['register'](socket);var client=jayson[_0x4ee1('0x18')][_0x4ee1('0x19')]({'port':0x232c});var client9002=jayson[_0x4ee1('0x18')][_0x4ee1('0x19')]({'port':0x232a});var client9003=jayson[_0x4ee1('0x18')][_0x4ee1('0x19')]({'port':0x232b});var client9001=jayson[_0x4ee1('0x18')][_0x4ee1('0x19')]({'port':0x2329});function respondWithRpcPromise(_0xb7eafd,_0x4e3490,_0x2f9194,_0x38008f){return new Promise(function(_0x34651b,_0x1b1e0e){var _0x123c5e=_0x38008f||client;return _0x123c5e[_0x4ee1('0x1a')](_0xb7eafd,_0x2f9194)[_0x4ee1('0x1b')](function(_0x2b8f0e){logger[_0x4ee1('0x1c')](_0x4ee1('0x1d'),_0x4e3490,_0x4ee1('0x1e'));logger['debug'](_0x4ee1('0x1f'),_0x4e3490,_0x4ee1('0x1e'),JSON[_0x4ee1('0x20')](_0x2b8f0e));if(_0x2b8f0e[_0x4ee1('0x21')]){if(_0x2b8f0e[_0x4ee1('0x21')][_0x4ee1('0x22')]===0x1f4){logger['error'](_0x4ee1('0x1d'),_0x4e3490,_0x2b8f0e[_0x4ee1('0x21')][_0x4ee1('0x23')]);return _0x1b1e0e(_0x2b8f0e[_0x4ee1('0x21')][_0x4ee1('0x23')]);}logger[_0x4ee1('0x21')](_0x4ee1('0x1d'),_0x4e3490,_0x2b8f0e[_0x4ee1('0x21')][_0x4ee1('0x23')]);return _0x34651b(_0x2b8f0e[_0x4ee1('0x21')]['message']);}else{logger['info'](_0x4ee1('0x1d'),_0x4e3490,_0x4ee1('0x1e'));_0x34651b(_0x2b8f0e[_0x4ee1('0x24')][_0x4ee1('0x23')]);}})[_0x4ee1('0x25')](function(_0x28efdc){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4e3490,_0x28efdc);_0x1b1e0e(_0x28efdc);});});}function respondWithStatusCode(_0x442c71,_0x28b7e1){_0x28b7e1=_0x28b7e1||0xcc;return function(_0x4d39dd){if(_0x4d39dd){return _0x442c71[_0x4ee1('0x26')](_0x28b7e1);}return _0x442c71[_0x4ee1('0x27')](_0x28b7e1)[_0x4ee1('0x28')]();};}function respondWithResult(_0x215949,_0x2d699c){_0x2d699c=_0x2d699c||0xc8;return function(_0x3c7b2a){if(_0x3c7b2a){return _0x215949[_0x4ee1('0x27')](_0x2d699c)['json'](_0x3c7b2a);}};}function respondWithFilteredResult(_0x1f7b74,_0x59029c){return function(_0x4746c2){if(_0x4746c2){var _0x4ec408=typeof _0x59029c[_0x4ee1('0x29')]===_0x4ee1('0x2a')&&typeof _0x59029c[_0x4ee1('0x2b')]===_0x4ee1('0x2a');var _0x19ba11=_0x4746c2['count'];var _0x1f7483=_0x4ec408?0x0:_0x59029c['offset'];var _0x121301=_0x4ec408?_0x4746c2[_0x4ee1('0x2c')]:_0x59029c[_0x4ee1('0x29')]+_0x59029c[_0x4ee1('0x2b')];var _0xac31e9;if(_0x121301>=_0x19ba11){_0x121301=_0x19ba11;_0xac31e9=0xc8;}else{_0xac31e9=0xce;}_0x1f7b74['status'](_0xac31e9);return _0x1f7b74[_0x4ee1('0x2d')](_0x4ee1('0x2e'),_0x1f7483+'-'+_0x121301+'/'+_0x19ba11)[_0x4ee1('0x2f')](_0x4746c2);}return null;};}function saveUpdates(_0x2e37a3){return function(_0x79f87c){if(_0x79f87c){return _0x79f87c[_0x4ee1('0x30')](_0x2e37a3)['then'](function(_0x4aa2b8){return _0x4aa2b8;});}return null;};}function removeEntity(_0x2260bd){return function(_0x54482b){if(_0x54482b){return _0x54482b[_0x4ee1('0x31')]()['then'](function(){var _0x963c2b=_0x54482b[_0x4ee1('0x32')]({'plain':!![]});var _0x264aed=_0x4ee1('0x33');return db[_0x4ee1('0x34')][_0x4ee1('0x31')]({'where':{'type':_0x264aed,'resourceId':_0x963c2b['id']}})[_0x4ee1('0x1b')](function(){return _0x54482b;});})[_0x4ee1('0x1b')](function(){_0x2260bd[_0x4ee1('0x27')](0xcc)[_0x4ee1('0x28')]();});}};}function handleEntityNotFound(_0x4445d0){return function(_0x1f3371){if(!_0x1f3371){_0x4445d0[_0x4ee1('0x26')](0x194);}return _0x1f3371;};}function handleError(_0x55ac4a,_0x463d90){_0x463d90=_0x463d90||0x1f4;return function(_0x3de40e){logger[_0x4ee1('0x21')](_0x3de40e['stack']);if(_0x3de40e['name']){delete _0x3de40e[_0x4ee1('0x35')];}_0x55ac4a[_0x4ee1('0x27')](_0x463d90)[_0x4ee1('0x36')](_0x3de40e);};}function createInteractionObject(_0x1f2b4b,_0x4b6892,_0x315ae0,_0x2ed16f){var _0x11721a=require(_0x4ee1('0x37'));var _0x2653c4=new _0x11721a();var _0x2445c2=_0x2653c4[_0x4ee1('0x38')](_0x315ae0[_0x4ee1('0x39')])['getResult']();var _0x3b346e=_0x4b6892[_0x4ee1('0x3a')];if(_0x315ae0[_0x4ee1('0x3b')]){_0x3b346e=_0x315ae0[_0x4ee1('0x3b')];}else if(_0x315ae0[_0x4ee1('0x3c')]){_0x3b346e=_[_0x4ee1('0x3d')](_0x315ae0['x-forwarded-for'][_0x4ee1('0x3e')](','));}return{'ContactId':_0x2ed16f['id'],'ChatWebsiteId':_0x1f2b4b,'from':(_0x2ed16f[_0x4ee1('0x3f')]||'')+'\x20'+(_0x2ed16f[_0x4ee1('0x40')]||''),'customerIp':_0x3b346e,'customerPort':_0x315ae0[_0x4ee1('0x41')]?_0x315ae0[_0x4ee1('0x41')]:null,'referer':_0x4b6892[_0x4ee1('0x42')],'browserName':_0x2445c2[_0x4ee1('0x43')][_0x4ee1('0x35')]&&_0x2445c2[_0x4ee1('0x43')][_0x4ee1('0x44')]?util[_0x4ee1('0x45')](_0x4ee1('0x46'),_0x2445c2[_0x4ee1('0x43')]['name'],_0x2445c2[_0x4ee1('0x43')][_0x4ee1('0x44')]):'unknown','browserVersion':_0x2445c2[_0x4ee1('0x43')]['version']||_0x4ee1('0x47'),'osName':util['format'](_0x4ee1('0x46'),_0x2445c2['os'][_0x4ee1('0x35')],_0x2445c2['os']['version']),'osVersion':_0x2445c2['os'][_0x4ee1('0x44')],'deviceModel':_0x2445c2[_0x4ee1('0x48')][_0x4ee1('0x49')]&&_0x2445c2[_0x4ee1('0x48')]['vendor']?util[_0x4ee1('0x45')](_0x4ee1('0x4a'),_0x2445c2[_0x4ee1('0x48')]['model'],_0x2445c2['device'][_0x4ee1('0x4b')],_0x2445c2[_0x4ee1('0x48')][_0x4ee1('0x4c')]):null,'deviceVendor':_0x2445c2[_0x4ee1('0x48')][_0x4ee1('0x4b')],'deviceType':_0x2445c2['device']['type'],'formData':JSON[_0x4ee1('0x20')](_0x4b6892)};}exports[_0x4ee1('0x4d')]=function(_0x8aaff9,_0x183b4a){var _0x5c5862={'include':[{'model':db['Pause'],'as':_0x4ee1('0x4e')}]},_0x3d6bf4={},_0x32cc34={'count':0x0,'rows':[]};var _0x16dc20=_[_0x4ee1('0x4f')](db[_0x4ee1('0x50')][_0x4ee1('0x51')],function(_0x154ec0){return{'name':_0x154ec0[_0x4ee1('0x52')],'type':_0x154ec0[_0x4ee1('0x4c')][_0x4ee1('0x53')]};});_0x3d6bf4['model']=_['map'](_0x16dc20,_0x4ee1('0x35'));_0x3d6bf4[_0x4ee1('0x54')]=_[_0x4ee1('0x55')](_0x8aaff9[_0x4ee1('0x54')]);_0x3d6bf4['filters']=_[_0x4ee1('0x56')](_0x3d6bf4[_0x4ee1('0x49')],_0x3d6bf4[_0x4ee1('0x54')]);_0x5c5862[_0x4ee1('0x57')]=_[_0x4ee1('0x56')](_0x3d6bf4['model'],qs[_0x4ee1('0x58')](_0x8aaff9[_0x4ee1('0x54')][_0x4ee1('0x58')]));_0x5c5862['attributes']=_0x5c5862[_0x4ee1('0x57')]['length']?_0x5c5862[_0x4ee1('0x57')]:_0x3d6bf4['model'];if(!_0x8aaff9[_0x4ee1('0x54')]['hasOwnProperty'](_0x4ee1('0x59'))){_0x5c5862['limit']=qs[_0x4ee1('0x2b')](_0x8aaff9[_0x4ee1('0x54')][_0x4ee1('0x2b')]);_0x5c5862['offset']=qs[_0x4ee1('0x29')](_0x8aaff9[_0x4ee1('0x54')][_0x4ee1('0x29')]);}_0x5c5862[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0x8aaff9[_0x4ee1('0x54')][_0x4ee1('0x5b')]);_0x5c5862['where']=qs['filters'](_[_0x4ee1('0x5c')](_0x8aaff9[_0x4ee1('0x54')],_0x3d6bf4[_0x4ee1('0x5d')]),_0x16dc20);if(_0x8aaff9[_0x4ee1('0x54')][_0x4ee1('0x5e')]){_0x5c5862[_0x4ee1('0x5f')]=_[_0x4ee1('0x60')](_0x5c5862[_0x4ee1('0x5f')],{'$or':_[_0x4ee1('0x4f')](_0x16dc20,function(_0x464136){if(_0x464136[_0x4ee1('0x4c')]!==_0x4ee1('0x61')){var _0x3c2e42={};_0x3c2e42[_0x464136['name']]={'$like':'%'+_0x8aaff9[_0x4ee1('0x54')]['filter']+'%'};return _0x3c2e42;}})});}_0x5c5862=_[_0x4ee1('0x60')]({},_0x5c5862,_0x8aaff9[_0x4ee1('0x62')]);var _0x59bbca={'where':_0x5c5862[_0x4ee1('0x5f')]};return db[_0x4ee1('0x50')]['count'](_0x59bbca)['then'](function(_0x130166){_0x32cc34['count']=_0x130166;if(_0x8aaff9[_0x4ee1('0x54')][_0x4ee1('0x63')]){_0x5c5862['include']=[{'all':!![]}];}return db[_0x4ee1('0x50')][_0x4ee1('0x64')](_0x5c5862);})[_0x4ee1('0x1b')](function(_0x44eb11){_0x32cc34[_0x4ee1('0x65')]=_0x44eb11;return _0x32cc34;})[_0x4ee1('0x1b')](respondWithFilteredResult(_0x183b4a,_0x5c5862))[_0x4ee1('0x25')](handleError(_0x183b4a,null));};exports['show']=function(_0x533a6b,_0x2fd331){var _0x39f7ff={'raw':![],'where':{'id':_0x533a6b[_0x4ee1('0x66')]['id']},'include':[{'model':db[_0x4ee1('0x67')],'as':_0x4ee1('0x4e')}]},_0x5e43b6={};_0x5e43b6['model']=_[_0x4ee1('0x55')](db['ChatWebsite'][_0x4ee1('0x51')]);_0x5e43b6['query']=_['keys'](_0x533a6b[_0x4ee1('0x54')]);_0x5e43b6[_0x4ee1('0x5d')]=_[_0x4ee1('0x56')](_0x5e43b6[_0x4ee1('0x49')],_0x5e43b6[_0x4ee1('0x54')]);_0x39f7ff['attributes']=_[_0x4ee1('0x56')](_0x5e43b6[_0x4ee1('0x49')],qs[_0x4ee1('0x58')](_0x533a6b['query'][_0x4ee1('0x58')]));_0x39f7ff[_0x4ee1('0x57')]=_0x39f7ff[_0x4ee1('0x57')][_0x4ee1('0x68')]?_0x39f7ff[_0x4ee1('0x57')]:_0x5e43b6[_0x4ee1('0x49')];if(_0x533a6b[_0x4ee1('0x54')][_0x4ee1('0x63')]){_0x39f7ff[_0x4ee1('0x69')]=[{'all':!![]}];}_0x39f7ff=_[_0x4ee1('0x60')]({},_0x39f7ff,_0x533a6b[_0x4ee1('0x62')]);return db[_0x4ee1('0x50')]['find'](_0x39f7ff)[_0x4ee1('0x1b')](handleEntityNotFound(_0x2fd331,null))['then'](respondWithResult(_0x2fd331,null))[_0x4ee1('0x25')](handleError(_0x2fd331,null));};exports['create']=function(_0x15834b,_0x473f04){var _0x190527=null;_0x15834b[_0x4ee1('0x6a')][_0x4ee1('0x6b')][_0x4ee1('0x3e')](',')[_0x4ee1('0x6c')](_0x447060=>{if(_0x447060[_0x4ee1('0x6d')]()!==''&&!wildcardUtils[_0x4ee1('0x6e')](_0x447060[_0x4ee1('0x6d')]())){_0x190527=new APIBadRequestError('\x22'+_0x447060[_0x4ee1('0x6d')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x190527){return handleError(_0x473f04,null)(_0x190527);}return db[_0x4ee1('0x50')][_0x4ee1('0x6f')](_0x15834b[_0x4ee1('0x6a')],{})['then'](function(_0x4ba745){var _0x40dac3=_0x15834b[_0x4ee1('0x70')]['get']({'plain':!![]});if(!_0x40dac3)throw new Error(_0x4ee1('0x71'));if(_0x40dac3[_0x4ee1('0x72')]===_0x4ee1('0x70')){var _0x216925=_0x4ba745[_0x4ee1('0x32')]({'plain':!![]});var _0x1e6d5d=_0x4ee1('0x33');return db[_0x4ee1('0x73')][_0x4ee1('0x74')]({'where':{'name':_0x1e6d5d,'userProfileId':_0x40dac3[_0x4ee1('0x75')]},'raw':!![]})['then'](function(_0x219153){if(_0x219153&&_0x219153[_0x4ee1('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x216925[_0x4ee1('0x35')],'resourceId':_0x216925['id'],'type':_0x219153[_0x4ee1('0x35')],'sectionId':_0x219153['id']},{})[_0x4ee1('0x1b')](function(){return _0x4ba745;});}else{return _0x4ba745;}})[_0x4ee1('0x25')](function(_0x29a075){logger[_0x4ee1('0x21')](_0x4ee1('0x77'),_0x29a075);throw _0x29a075;});}return _0x4ba745;})['then'](respondWithResult(_0x473f04,0xc9))[_0x4ee1('0x25')](handleError(_0x473f04,null));};exports[_0x4ee1('0x30')]=function(_0x44af66,_0x43a775){var _0x463e55=null;_0x44af66['body'][_0x4ee1('0x6b')]['split'](',')[_0x4ee1('0x6c')](_0x29371c=>{if(_0x29371c['trim']()!==''&&!wildcardUtils['testWildcardValidity'](_0x29371c[_0x4ee1('0x6d')]())){_0x463e55=new APIBadRequestError('\x22'+_0x29371c[_0x4ee1('0x6d')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x463e55){return handleError(_0x43a775,null)(_0x463e55);}if(_0x44af66[_0x4ee1('0x6a')]['id']){delete _0x44af66['body']['id'];}return db['ChatWebsite'][_0x4ee1('0x74')]({'where':{'id':_0x44af66[_0x4ee1('0x66')]['id']},'include':[{'model':db[_0x4ee1('0x67')],'as':_0x4ee1('0x4e')}]})[_0x4ee1('0x1b')](handleEntityNotFound(_0x43a775,null))[_0x4ee1('0x1b')](saveUpdates(_0x44af66['body'],null))[_0x4ee1('0x1b')](respondWithResult(_0x43a775,null))['catch'](handleError(_0x43a775,null));};exports['destroy']=function(_0x465e06,_0x2c1c65){return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x465e06[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x2c1c65,null))[_0x4ee1('0x1b')](removeEntity(_0x2c1c65,null))[_0x4ee1('0x25')](handleError(_0x2c1c65,null));};exports['describe']=function(_0x163d45,_0x396f85){return db['ChatWebsite'][_0x4ee1('0x78')]()[_0x4ee1('0x1b')](respondWithResult(_0x396f85,null))[_0x4ee1('0x25')](handleError(_0x396f85,null));};exports[_0x4ee1('0x79')]=function(_0x22778e,_0x4657ee){if(_0x22778e[_0x4ee1('0x6a')]['id']){delete _0x22778e['body']['id'];}return db[_0x4ee1('0x50')]['find']({'where':{'id':_0x22778e[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x4657ee,null))[_0x4ee1('0x1b')](function(_0x35a719){if(_0x35a719){_0x22778e['body'][_0x4ee1('0x7a')]=_0x35a719['id'];return db[_0x4ee1('0x7b')][_0x4ee1('0x6f')](_0x22778e['body']);}})['then'](respondWithResult(_0x4657ee,null))[_0x4ee1('0x25')](handleError(_0x4657ee,null));};exports['getDispositions']=function(_0x3976a6,_0x229bc8){var _0x3f28b2={'raw':![],'where':{}};var _0x5690a9={};var _0x5aa865={'count':0x0,'rows':[]};return db[_0x4ee1('0x50')][_0x4ee1('0x7c')]({'where':{'id':_0x3976a6[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x229bc8,null))[_0x4ee1('0x1b')](function(_0x335c90){if(_0x335c90){_0x5690a9[_0x4ee1('0x49')]=_['keys'](db['Disposition']['rawAttributes']);_0x5690a9[_0x4ee1('0x54')]=_[_0x4ee1('0x55')](_0x3976a6[_0x4ee1('0x54')]);_0x5690a9[_0x4ee1('0x5d')]=_['intersection'](_0x5690a9[_0x4ee1('0x49')],_0x5690a9['query']);_0x3f28b2[_0x4ee1('0x57')]=_[_0x4ee1('0x56')](_0x5690a9[_0x4ee1('0x49')],qs[_0x4ee1('0x58')](_0x3976a6[_0x4ee1('0x54')][_0x4ee1('0x58')]));_0x3f28b2['attributes']=_0x3f28b2[_0x4ee1('0x57')][_0x4ee1('0x68')]?_0x3f28b2[_0x4ee1('0x57')]:_0x5690a9[_0x4ee1('0x49')];if(!_0x3976a6[_0x4ee1('0x54')][_0x4ee1('0x7d')](_0x4ee1('0x59'))){_0x3f28b2[_0x4ee1('0x2b')]=qs[_0x4ee1('0x2b')](_0x3976a6[_0x4ee1('0x54')][_0x4ee1('0x2b')]);_0x3f28b2['offset']=qs[_0x4ee1('0x29')](_0x3976a6[_0x4ee1('0x54')][_0x4ee1('0x29')]);}_0x3f28b2[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0x3976a6[_0x4ee1('0x54')][_0x4ee1('0x5b')]);_0x3f28b2[_0x4ee1('0x5f')]=qs[_0x4ee1('0x5d')](_[_0x4ee1('0x5c')](_0x3976a6[_0x4ee1('0x54')],_0x5690a9[_0x4ee1('0x5d')]));_0x3f28b2[_0x4ee1('0x5f')][_0x4ee1('0x7a')]=_0x335c90['id'];if(_0x3976a6[_0x4ee1('0x54')][_0x4ee1('0x5e')]){_0x3f28b2['where']=_[_0x4ee1('0x60')](_0x3f28b2[_0x4ee1('0x5f')],{'$or':_['map'](_0x3f28b2[_0x4ee1('0x57')],function(_0x1435f8){var _0x5eb977={};_0x5eb977[_0x1435f8]={'$like':'%'+_0x3976a6['query'][_0x4ee1('0x5e')]+'%'};return _0x5eb977;})});}_0x3f28b2=_['merge']({},_0x3f28b2,_0x3976a6[_0x4ee1('0x62')]);return db[_0x4ee1('0x7b')]['count']({'where':_0x3f28b2[_0x4ee1('0x5f')]})[_0x4ee1('0x1b')](function(_0x1dfb34){_0x5aa865[_0x4ee1('0x2c')]=_0x1dfb34;if(_0x3976a6['query'][_0x4ee1('0x63')]){_0x3f28b2[_0x4ee1('0x69')]=[{'all':!![]}];}return db[_0x4ee1('0x7b')][_0x4ee1('0x64')](_0x3f28b2);})[_0x4ee1('0x1b')](function(_0x4315e9){_0x5aa865[_0x4ee1('0x65')]=_0x4315e9;return _0x5aa865;});}})[_0x4ee1('0x1b')](respondWithFilteredResult(_0x229bc8,_0x3f28b2))['catch'](handleError(_0x229bc8,null));};exports[_0x4ee1('0x7e')]=function(_0x319fd8,_0x59c975){return db[_0x4ee1('0x50')]['find']({'where':{'id':_0x319fd8['params']['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x59c975,null))[_0x4ee1('0x1b')](function(_0x24a951){if(_0x24a951){return _0x24a951[_0x4ee1('0x7e')](_0x319fd8[_0x4ee1('0x54')][_0x4ee1('0x7f')]);}})['then'](respondWithStatusCode(_0x59c975,null))[_0x4ee1('0x25')](handleError(_0x59c975,null));};exports[_0x4ee1('0x80')]=function(_0x427e48,_0x17ae2d){if(_0x427e48[_0x4ee1('0x6a')]['id']){delete _0x427e48[_0x4ee1('0x6a')]['id'];}return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x427e48['params']['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x17ae2d,null))[_0x4ee1('0x1b')](function(_0x2704ed){if(_0x2704ed){_0x427e48[_0x4ee1('0x6a')][_0x4ee1('0x7a')]=_0x2704ed['id'];return db['CannedAnswer'][_0x4ee1('0x6f')](_0x427e48['body']);}})[_0x4ee1('0x1b')](respondWithResult(_0x17ae2d,null))[_0x4ee1('0x25')](handleError(_0x17ae2d,null));};exports[_0x4ee1('0x81')]=function(_0x3bcd9b,_0x4977bf){var _0x2f3795={'raw':![],'where':{}};var _0x2eddce={};var _0x48146c={'count':0x0,'rows':[]};return db[_0x4ee1('0x50')]['findOne']({'where':{'id':_0x3bcd9b[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x4977bf,null))['then'](function(_0x5a2c17){if(_0x5a2c17){_0x2eddce[_0x4ee1('0x49')]=_[_0x4ee1('0x55')](db['CannedAnswer']['rawAttributes']);_0x2eddce['query']=_[_0x4ee1('0x55')](_0x3bcd9b['query']);_0x2eddce[_0x4ee1('0x5d')]=_[_0x4ee1('0x56')](_0x2eddce[_0x4ee1('0x49')],_0x2eddce[_0x4ee1('0x54')]);_0x2f3795['attributes']=_[_0x4ee1('0x56')](_0x2eddce[_0x4ee1('0x49')],qs['fields'](_0x3bcd9b[_0x4ee1('0x54')][_0x4ee1('0x58')]));_0x2f3795[_0x4ee1('0x57')]=_0x2f3795['attributes']['length']?_0x2f3795[_0x4ee1('0x57')]:_0x2eddce[_0x4ee1('0x49')];if(!_0x3bcd9b[_0x4ee1('0x54')][_0x4ee1('0x7d')](_0x4ee1('0x59'))){_0x2f3795[_0x4ee1('0x2b')]=qs[_0x4ee1('0x2b')](_0x3bcd9b[_0x4ee1('0x54')][_0x4ee1('0x2b')]);_0x2f3795[_0x4ee1('0x29')]=qs[_0x4ee1('0x29')](_0x3bcd9b[_0x4ee1('0x54')]['offset']);}_0x2f3795[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0x3bcd9b[_0x4ee1('0x54')][_0x4ee1('0x5b')]);_0x2f3795[_0x4ee1('0x5f')]=qs[_0x4ee1('0x5d')](_['pick'](_0x3bcd9b[_0x4ee1('0x54')],_0x2eddce['filters']));_0x2f3795[_0x4ee1('0x5f')]['ChatWebsiteId']=_0x5a2c17['id'];if(_0x3bcd9b[_0x4ee1('0x54')][_0x4ee1('0x5e')]){_0x2f3795[_0x4ee1('0x5f')]=_[_0x4ee1('0x60')](_0x2f3795[_0x4ee1('0x5f')],{'$or':_[_0x4ee1('0x4f')](_0x2f3795[_0x4ee1('0x57')],function(_0x323e2d){var _0x40d044={};_0x40d044[_0x323e2d]={'$like':'%'+_0x3bcd9b['query'][_0x4ee1('0x5e')]+'%'};return _0x40d044;})});}_0x2f3795=_[_0x4ee1('0x60')]({},_0x2f3795,_0x3bcd9b['options']);return db[_0x4ee1('0x82')][_0x4ee1('0x2c')]({'where':_0x2f3795[_0x4ee1('0x5f')]})[_0x4ee1('0x1b')](function(_0x3f2546){_0x48146c[_0x4ee1('0x2c')]=_0x3f2546;if(_0x3bcd9b[_0x4ee1('0x54')]['includeAll']){_0x2f3795[_0x4ee1('0x69')]=[{'all':!![]}];}return db[_0x4ee1('0x82')][_0x4ee1('0x64')](_0x2f3795);})['then'](function(_0x414aae){_0x48146c[_0x4ee1('0x65')]=_0x414aae;return _0x48146c;});}})[_0x4ee1('0x1b')](respondWithFilteredResult(_0x4977bf,_0x2f3795))['catch'](handleError(_0x4977bf,null));};exports['removeAnswers']=function(_0x16526e,_0x48d858){return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x16526e[_0x4ee1('0x66')]['id']}})['then'](handleEntityNotFound(_0x48d858,null))[_0x4ee1('0x1b')](function(_0x44da18){if(_0x44da18){return _0x44da18[_0x4ee1('0x83')](_0x16526e[_0x4ee1('0x54')][_0x4ee1('0x7f')]);}})[_0x4ee1('0x1b')](respondWithStatusCode(_0x48d858,null))[_0x4ee1('0x25')](handleError(_0x48d858,null));};exports[_0x4ee1('0x84')]=function(_0x517ae9,_0x11cd98){_0x517ae9[_0x4ee1('0x6a')][_0x4ee1('0x85')]=_0x517ae9[_0x4ee1('0x86')][_0x4ee1('0x87')];return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x517ae9['params']['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x11cd98,null))['then'](saveUpdates(_0x517ae9[_0x4ee1('0x6a')],null))['then'](respondWithResult(_0x11cd98,null))[_0x4ee1('0x25')](handleError(_0x11cd98,null));};exports[_0x4ee1('0x88')]=function(_0x3d9f81,_0x111632){_0x3d9f81['body']['agentAvatar']=_0x3d9f81[_0x4ee1('0x86')][_0x4ee1('0x87')];return db['ChatWebsite'][_0x4ee1('0x74')]({'where':{'id':_0x3d9f81[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x111632,null))['then'](saveUpdates(_0x3d9f81[_0x4ee1('0x6a')],null))[_0x4ee1('0x1b')](respondWithResult(_0x111632,null))[_0x4ee1('0x25')](handleError(_0x111632,null));};exports['addCustomerAvatar']=function(_0x153e69,_0x4ec743){_0x153e69[_0x4ee1('0x6a')]['customerAvatar']=_0x153e69[_0x4ee1('0x86')][_0x4ee1('0x87')];return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x153e69[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x4ec743,null))[_0x4ee1('0x1b')](saveUpdates(_0x153e69['body'],null))[_0x4ee1('0x1b')](respondWithResult(_0x4ec743,null))[_0x4ee1('0x25')](handleError(_0x4ec743,null));};exports[_0x4ee1('0x89')]=function(_0x4301ae,_0x8a9d40){_0x4301ae[_0x4ee1('0x6a')]['systemAvatar']=_0x4301ae[_0x4ee1('0x86')][_0x4ee1('0x87')];return db['ChatWebsite'][_0x4ee1('0x74')]({'where':{'id':_0x4301ae[_0x4ee1('0x66')]['id']}})['then'](handleEntityNotFound(_0x8a9d40,null))[_0x4ee1('0x1b')](saveUpdates(_0x4301ae[_0x4ee1('0x6a')],null))[_0x4ee1('0x1b')](respondWithResult(_0x8a9d40,null))[_0x4ee1('0x25')](handleError(_0x8a9d40,null));};exports[_0x4ee1('0x8a')]=function(_0x3d0b47,_0x2f6412){var _0x7a50e9=path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x8d'));var _0x4f9079={'where':{'id':_0x3d0b47[_0x4ee1('0x66')]['id']},'attributes':['id',_0x4ee1('0x85')],'raw':!![]};var _0x3bfd9d=![];return require(_0x4ee1('0x8e'))['getLicense']()[_0x4ee1('0x1b')](function(_0x38595b){if(_0x38595b){_0x3bfd9d=_0x38595b[_0x4ee1('0x8f')];}})[_0x4ee1('0x1b')](function(){return db[_0x4ee1('0x50')][_0x4ee1('0x74')](_0x4f9079);})[_0x4ee1('0x1b')](handleEntityNotFound(_0x2f6412,null))[_0x4ee1('0x1b')](function(_0x347de3){if(_0x347de3){if(!_[_0x4ee1('0x90')](_0x347de3['sitepic'])){if(fs[_0x4ee1('0x91')](path['join'](config[_0x4ee1('0x8c')],_0x4ee1('0x92'),_0x347de3[_0x4ee1('0x85')]))&&_0x3bfd9d){_0x7a50e9=path['join'](config[_0x4ee1('0x8c')],_0x4ee1('0x92'),_0x347de3[_0x4ee1('0x85')]);}}return _0x2f6412[_0x4ee1('0x93')](_0x7a50e9);}})[_0x4ee1('0x25')](handleError(_0x2f6412,null));};exports[_0x4ee1('0x94')]=function(_0x3c937f,_0x5d0972){var _0x5e78f5=path[_0x4ee1('0x8b')](config['root'],_0x4ee1('0x95'));var _0xe3020c={'where':{'id':_0x3c937f[_0x4ee1('0x66')]['id']},'attributes':['id',_0x4ee1('0x96')],'raw':!![]};return db[_0x4ee1('0x50')][_0x4ee1('0x74')](_0xe3020c)[_0x4ee1('0x1b')](handleEntityNotFound(_0x5d0972,null))['then'](function(_0x2d3f99){if(_0x2d3f99){if(!_[_0x4ee1('0x90')](_0x2d3f99['agentAvatar'])){if(fs['existsSync'](path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x97'),_0x2d3f99[_0x4ee1('0x96')]))){_0x5e78f5=path['join'](config[_0x4ee1('0x8c')],_0x4ee1('0x97'),_0x2d3f99[_0x4ee1('0x96')]);}}return _0x5d0972['download'](_0x5e78f5);}})[_0x4ee1('0x25')](handleError(_0x5d0972,null));};exports[_0x4ee1('0x98')]=function(_0x355f76,_0xdc201b){var _0x21acbf=path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x99'));var _0x427dab={'where':{'id':_0x355f76[_0x4ee1('0x66')]['id']},'attributes':['id',_0x4ee1('0x9a'),_0x4ee1('0x9b')],'raw':!![]};return db['ChatWebsite'][_0x4ee1('0x74')](_0x427dab)[_0x4ee1('0x1b')](handleEntityNotFound(_0xdc201b,null))[_0x4ee1('0x1b')](function(_0x386fcd){if(_0x386fcd){if(!_[_0x4ee1('0x90')](_0x386fcd[_0x4ee1('0x9a')])){if(fs[_0x4ee1('0x91')](path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x97'),_0x386fcd['customerAvatar']))&&_0x386fcd[_0x4ee1('0x9b')]){_0x21acbf=path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],'server/files/images/avatars/',_0x386fcd[_0x4ee1('0x9a')]);}}return _0xdc201b['download'](_0x21acbf);}})[_0x4ee1('0x25')](handleError(_0xdc201b,null));};exports[_0x4ee1('0x9c')]=function(_0x23a60b,_0x46694f){var _0x1e399e=path[_0x4ee1('0x8b')](config['root'],_0x4ee1('0x9d'));var _0x3c4790={'where':{'id':_0x23a60b['params']['id']},'attributes':['id',_0x4ee1('0x9e')],'raw':!![]};return db[_0x4ee1('0x50')][_0x4ee1('0x74')](_0x3c4790)[_0x4ee1('0x1b')](handleEntityNotFound(_0x46694f,null))[_0x4ee1('0x1b')](function(_0x2ebf0c){if(_0x2ebf0c){if(!_[_0x4ee1('0x90')](_0x2ebf0c[_0x4ee1('0x9e')])){if(fs[_0x4ee1('0x91')](path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x97'),_0x2ebf0c[_0x4ee1('0x9e')]))){_0x1e399e=path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x97'),_0x2ebf0c[_0x4ee1('0x9e')]);}}return _0x46694f['download'](_0x1e399e);}})['catch'](handleError(_0x46694f,null));};function checkWebsiteInterval(_0x401071){var _0x6800a8=_0x401071['Interval'];if(!_0x6800a8){return Promise[_0x4ee1('0x9f')](_0x401071);}var _0x46995d=_0x401071[_0x4ee1('0xa0')]||undefined;return _0x6800a8[_0x4ee1('0xa1')](_0x46995d)[_0x4ee1('0x1b')](function(_0x381b0b){if(!_0x381b0b){throw new APIOutOfIntervalError();}return _0x401071;});}exports[_0x4ee1('0xa2')]=function(_0x1921db,_0x35db5f){var _0x5c555d={'body':_0x1921db[_0x4ee1('0x6a')],'channel':_0x4ee1('0xa3')};var _0x241582=[];var _0x1e0872=[];var _0xc7a96={};var _0x259e57=![];if(_0x1921db[_0x4ee1('0x6a')]['id']){delete _0x1921db['body']['id'];}if(_['isNil'](_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xa4')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x4ee1('0x90')](_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xa5')])){throw new APIBadRequestError(_0x4ee1('0xa6'));}if(_['isEmpty'](_0x1921db[_0x4ee1('0x6a')]['body'])){throw new APIBadRequestError(_0x4ee1('0xa7'));}var _0x5e74b2=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0x3a')]&&_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0x42')];return db[_0x4ee1('0xa8')][_0x4ee1('0x78')]()[_0x4ee1('0x1b')](function(_0x1a0aad){if(!_0x1a0aad){throw new Error(_0x4ee1('0xa9'));}_0x241582=Object[_0x4ee1('0x55')](_0x1a0aad)['filter'](function(_0x639adf){return!['createdAt',_0x4ee1('0xaa')]['includes'](_0x639adf);});_0x1e0872=Object['keys'](_0x1a0aad)[_0x4ee1('0x5e')](function(_0x2ab951){return![_0x4ee1('0xab'),_0x4ee1('0xaa'),_0x4ee1('0xac'),_0x4ee1('0xad')][_0x4ee1('0xae')](_0x2ab951);});if(!_[_0x4ee1('0xae')](_0x1e0872,_0x1921db[_0x4ee1('0x6a')]['mapKey'])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x1e0872[_0x4ee1('0x8b')](',\x20'));}_0xc7a96[_0x1921db['body'][_0x4ee1('0xa5')]]=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xa4')];})[_0x4ee1('0x1b')](function(){return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x1921db[_0x4ee1('0x66')]['id']},'include':[{'model':db[_0x4ee1('0xaf')],'as':_0x4ee1('0xb0'),'include':[{'model':db[_0x4ee1('0xa8')],'as':_0x4ee1('0xb1'),'where':_0xc7a96,'limit':0x1,'order':[[_0x4ee1('0xaa'),_0x4ee1('0xb2')]]}]},{'model':db[_0x4ee1('0xb3')],'as':_0x4ee1('0xb4')},{'model':db['Interval'],'as':_0x4ee1('0xb5'),'include':[{'model':db[_0x4ee1('0xb5')],'as':'Intervals','attributes':['id',_0x4ee1('0xb6')],'raw':!![]}]}]});})[_0x4ee1('0x1b')](function(_0x57cfbc){if(!_0x57cfbc){throw new APINotFoundError(util[_0x4ee1('0x45')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x1921db[_0x4ee1('0x66')]['id']));}if(_0x5e74b2){return checkWebsiteInterval(_0x57cfbc);}return _0x57cfbc;})[_0x4ee1('0x1b')](function(_0x4cdf88){_0x5c555d[_0x4ee1('0xb7')]=_0x4cdf88;_0x5c555d[_0x4ee1('0xb8')]=_['orderBy'](_0x4cdf88['Applications'],[_0x4ee1('0xb9')],['asc']);if(_0x5c555d[_0x4ee1('0xb7')][_0x4ee1('0xb4')]){delete _0x5c555d[_0x4ee1('0xb7')][_0x4ee1('0xb4')];}_0x5c555d['list']=_0x4cdf88[_0x4ee1('0xb0')]||{'id':_0x4cdf88['ListId']};if(_0x5c555d[_0x4ee1('0xba')]&&_0x5c555d[_0x4ee1('0xba')][_0x4ee1('0xb1')]['length']){return _0x5c555d[_0x4ee1('0xba')][_0x4ee1('0xb1')][0x0];}var _0x2f70be=_[_0x4ee1('0x13')](_0x1921db[_0x4ee1('0x6a')],{'firstName':_0x1921db[_0x4ee1('0x6a')]['from'],'ListId':_0x4cdf88[_0x4ee1('0xad')]});_0x2f70be[_0x1921db[_0x4ee1('0x6a')]['mapKey']]=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xa4')];return db['CmContact'][_0x4ee1('0x6f')](_0x2f70be,{'fields':_0x241582,'raw':!![]});})[_0x4ee1('0x1b')](function(_0x5eaaee){_0x5c555d[_0x4ee1('0xbb')]=_0x5eaaee;var _0x52634b=createInteractionObject(_0x1921db[_0x4ee1('0x66')]['id'],_0x1921db['body'],_0x1921db[_0x4ee1('0xbc')],_0x5eaaee);var _0x4824fc={'ChatWebsiteId':_0x1921db['params']['id']};if(_0x1921db['body']['threadId']){_0x4824fc[_0x4ee1('0xbd')]=_0x1921db['body'][_0x4ee1('0xbd')];_0x4824fc[_0x4ee1('0xbe')]=![];return db[_0x4ee1('0xbf')][_0x4ee1('0x74')]({'where':_0x4824fc})[_0x4ee1('0x1b')](function(_0x395220){var _0x11110d=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0x3a')]&&_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0x42')];if(_0x395220){_0x259e57=!![];return _0x395220;}else if(!_0x11110d&&_0x395220&&_0x395220[_0x4ee1('0xbe')]){throw new APIConflictError(_0x4ee1('0xc0'));}_0x52634b[_0x4ee1('0xbd')]=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xbd')];_0x52634b[_0x4ee1('0xc1')]=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xc1')];return db[_0x4ee1('0xbf')][_0x4ee1('0x6f')](_0x52634b);});}_0x4824fc[_0x4ee1('0xc2')]=_0x5eaaee['id'];if(_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xc3')]&&_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xc3')]['id']){_0x4824fc['id']=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xc3')]['id'];return db[_0x4ee1('0xbf')][_0x4ee1('0x74')]({'where':_0x4824fc})['then'](function(_0x5424a3){var _0x583eff=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0x3a')]&&_0x1921db[_0x4ee1('0x6a')]['referer'];if(!_0x583eff&&_0x5424a3&&_0x5424a3[_0x4ee1('0xbe')]){throw new APIConflictError(_0x4ee1('0xc0'));}else if(_0x5424a3){_0x259e57=!![];return _0x5424a3;}else{return db[_0x4ee1('0xbf')][_0x4ee1('0x6f')](_0x52634b);}});}return db[_0x4ee1('0xbf')][_0x4ee1('0x6f')](_0x52634b);})[_0x4ee1('0x1b')](function(_0x3169ad){if(!_0x259e57){return _0x3169ad;}var _0x453b3f={'from':(_0x5c555d[_0x4ee1('0xbb')]['firstName']||'')+'\x20'+(_0x5c555d[_0x4ee1('0xbb')][_0x4ee1('0x40')]||'')};if(_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xbd')]&&_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xc4')]&&_0x1921db['body'][_0x4ee1('0xbd')]!=_0x1921db['body'][_0x4ee1('0xc4')]){_0x453b3f[_0x4ee1('0xbd')]=_0x1921db[_0x4ee1('0x6a')][_0x4ee1('0xc4')];}return _0x3169ad[_0x4ee1('0x30')](_0x453b3f);})['then'](function(_0x2eb073){_0x5c555d[_0x4ee1('0xc3')]=_0x2eb073[_0x4ee1('0x32')]({'plain':!![]});_0x5c555d[_0x4ee1('0xc3')][_0x4ee1('0xc5')]=!_0x259e57;if(_0x5c555d[_0x4ee1('0xc3')]['created']){if(_0x5c555d[_0x4ee1('0xb7')]['autoclose']){_0x5c555d[_0x4ee1('0xb8')][_0x4ee1('0xc6')]({'id':0x0,'priority':_0x5c555d['applications']['length']+0x1,'app':'close','appdata':_0x4ee1('0xc7'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x4ee1('0x6f')]({'body':_0x1921db[_0x4ee1('0x6a')]['body'],'ChatWebsiteId':_0x1921db[_0x4ee1('0x66')]['id'],'ChatInteractionId':_0x2eb073['id'],'direction':'in','ContactId':_0x5c555d[_0x4ee1('0xbb')]['id'],'AttachmentId':_0x1921db[_0x4ee1('0x6a')]['AttachmentId']});})[_0x4ee1('0x1b')](function(_0x37b6c0){_0x5c555d[_0x4ee1('0x23')]=_0x37b6c0;if(!_0x5c555d[_0x4ee1('0xc3')][_0x4ee1('0xc8')]){return;}return db[_0x4ee1('0xc9')][_0x4ee1('0x74')]({'attributes':['id','name'],'where':{'id':_0x5c555d[_0x4ee1('0xc3')][_0x4ee1('0xc8')]}});})['then'](function(_0x4f7067){if(_0x4f7067){_0x5c555d['applications'][_0x4ee1('0xca')]({'id':0x0,'priority':0x0,'app':_0x4ee1('0xcb'),'appdata':_0x4f7067[_0x4ee1('0x35')]+','+(_0x5c555d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x4ee1('0xcc')});_0x5c555d['forcedOwnership']=!![];}if(!_0x5c555d[_0x4ee1('0xc3')][_0x4ee1('0xcd')]){return;}return db[_0x4ee1('0xce')]['find']({'attributes':['id',_0x4ee1('0x35')],'where':{'id':_0x5c555d[_0x4ee1('0xc3')]['queueId']}});})[_0x4ee1('0x1b')](function(_0x956035){if(_0x956035){_0x5c555d[_0x4ee1('0xb8')][_0x4ee1('0xca')]({'id':0x0,'priority':0x1,'app':_0x4ee1('0xcf'),'appdata':_0x956035[_0x4ee1('0x35')]+','+(_0x5c555d[_0x4ee1('0xb7')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4ee1('0xd0'),'startRouting',_0x5c555d);})[_0x4ee1('0x1b')](function(_0xbc69d3){respondWithRpcPromise(_0x4ee1('0xd1'),'EventManager',{'event':_0x4ee1('0xa2'),'message':_0xbc69d3},client9002);return _0xbc69d3;})[_0x4ee1('0x1b')](respondWithResult(_0x35db5f,null))[_0x4ee1('0x25')](APIHandleError(_0x35db5f));};exports[_0x4ee1('0xd2')]=function(_0xd08dc9,_0x4f258f){var _0x341e69,_0x527525,_0xf634c4;var _0x393fae=[];var _0x4b63a8={};var _0x26a657=_0xd08dc9[_0x4ee1('0xd3')]||[];var _0x2660b2=[];var _0x193cc6;return db['CmContact'][_0x4ee1('0x78')]()[_0x4ee1('0x1b')](function(_0x5bee69){if(!_0x5bee69){throw new db['Sequelize'][(_0x4ee1('0xd4'))](_0x4ee1('0xd5'));}_0x393fae=_[_0x4ee1('0xd6')](_[_0x4ee1('0x55')](_0x5bee69),[_0x4ee1('0xab'),_0x4ee1('0xaa'),_0x4ee1('0xac'),_0x4ee1('0xad')]);if(_0xd08dc9[_0x4ee1('0x6a')]['id']){delete _0xd08dc9['body']['id'];}if(_['isNil'](_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xa4')])){throw _0x4f258f[_0x4ee1('0x27')](0x1f4)[_0x4ee1('0x36')](new db[(_0x4ee1('0xd7'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x4ee1('0x90')](_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0x6a')])||_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0x6a')]===''){throw _0x4f258f[_0x4ee1('0x27')](0x1f4)[_0x4ee1('0x36')](new db[(_0x4ee1('0xd7'))]['ValidationError'](_0x4ee1('0xd8')));}if(_[_0x4ee1('0x90')](_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xd9')])){throw _0x4f258f['status'](0x1f4)[_0x4ee1('0x36')](new db[(_0x4ee1('0xd7'))][(_0x4ee1('0xd4'))](_0x4ee1('0xda')+_0x393fae));}if(!_['includes'](_0x393fae,_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xd9')])){throw _0x4f258f['status'](0x1f4)[_0x4ee1('0x36')](new db['Sequelize']['ValidationError'](_0x4ee1('0xdb')+_0x393fae));}_0x4b63a8[_0xd08dc9['body'][_0x4ee1('0xd9')]]=_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xa4')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0xd08dc9[_0x4ee1('0x66')]['id']},'include':[{'model':db[_0x4ee1('0xaf')],'as':_0x4ee1('0xb0')},{'model':db[_0x4ee1('0xdc')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x4f258f,null))[_0x4ee1('0x1b')](function(_0x22a8ed){if(_0x22a8ed&&_0x22a8ed[_0x4ee1('0xb0')]){_0x527525=_0x22a8ed;var _0x4a2cd2=_[_0x4ee1('0x13')](_0xd08dc9[_0x4ee1('0x6a')],{'firstName':_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xa4')],'phone':_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xa4')],'ListId':_0x22a8ed[_0x4ee1('0xad')]});_0x4a2cd2[_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0xd9')]]=_0xd08dc9['body'][_0x4ee1('0xa4')];return db['CmContact'][_0x4ee1('0xdd')]({'where':_0x4b63a8,'defaults':_0x4a2cd2});}})['spread'](function(_0x11d28e){if(_0x11d28e){_0xf634c4=_0x11d28e;var _0x383cd5=fs[_0x4ee1('0xde')](path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0xdf')),_0x4ee1('0xe0'));var _0x284743=ejs[_0x4ee1('0xe1')](_0x383cd5,{'body':_[_0x4ee1('0xe2')](_0xd08dc9[_0x4ee1('0x6a')][_0x4ee1('0x6a')]),'bodyTitle':_0x527525[_0x4ee1('0xe3')]});return db['ChatOfflineMessage']['create']({'body':_0x284743,'plainBody':htmlToText['fromString'](_0x284743),'ContactId':_0x11d28e['id'],'ChatWebsiteId':_0x527525['id']});}})[_0x4ee1('0x1b')](function(_0x1a1772){_0x193cc6=_0x1a1772;if(_0x26a657[_0x4ee1('0x68')]){var _0x3cc8f5=_0x26a657[_0x4ee1('0x4f')](function(_0x1e8038){return{'name':_0x1e8038[_0x4ee1('0xe4')],'basename':_0x1e8038['filename'],'type':_0x1e8038[_0x4ee1('0xe5')],'ChatOfflineMessageId':_0x1a1772['id']};});_0x2660b2=_0x3cc8f5['map'](_0x2d7c22=>{var _0x6c7209={'filename':_0x2d7c22[_0x4ee1('0x35')],'path':path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],'server',_0x4ee1('0xd3'),'attachments',_0x4ee1('0xe6'),_0x2d7c22[_0x4ee1('0xe7')])};return _0x6c7209;});if(!_0x527525['openNewInteraction']){return db[_0x4ee1('0xe8')][_0x4ee1('0xe9')](function(_0x19bee2){return db[_0x4ee1('0xea')][_0x4ee1('0xeb')](_0x3cc8f5,{'transaction':_0x19bee2});});}}})[_0x4ee1('0x1b')](function(){if(_0x193cc6){_0x341e69=_0x193cc6;return db['MailAccount'][_0x4ee1('0x7c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4ee1('0xec'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x4ee1('0x1b')](function(_0x208fb9){if(_0x208fb9&&_0x208fb9['Smtp']&&_0x527525[_0x4ee1('0xed')]&&_0x527525['forwardOfflineAddress']){var _0x561bf2=_0x208fb9[_0x4ee1('0xee')]();return respondWithRpcPromise(_0x4ee1('0xef'),_0x4ee1('0xf0'),{'account':_0x561bf2,'message':{'from':util[_0x4ee1('0x45')](_0x4ee1('0xf1'),_0x208fb9[_0x4ee1('0x35')],_0x208fb9[_0x4ee1('0xf2')]||_0x208fb9[_0x4ee1('0xec')][_0x4ee1('0x70')]),'to':_0x527525[_0x4ee1('0xf3')],'subject':_0x527525[_0x4ee1('0xf4')],'html':_0x341e69[_0x4ee1('0x6a')],'attachments':_0x2660b2}},client9003)[_0x4ee1('0x1b')](function(){return _0x341e69;})[_0x4ee1('0x25')](function(_0x4728be){logger[_0x4ee1('0x21')](_0x4728be);});}})[_0x4ee1('0x1b')](function(){if(_0x527525&&_0x527525[_0x4ee1('0xf5')]&&_0x527525[_0x4ee1('0xf6')]){var _0xc6fa7f=[];if(_0x26a657['length']){_0xc6fa7f=_0x26a657['map'](function(_0x7d6d5e){return{'name':_0x7d6d5e[_0x4ee1('0xe4')],'basename':_0x7d6d5e[_0x4ee1('0x87')],'type':_0x7d6d5e[_0x4ee1('0xe5')],'ChatOfflineMessageId':_0x193cc6['id']};});}var _0x3812d1;if(!_['isNil'](_0x527525[_0x4ee1('0xf7')])){var _0x25f728=_[_0x4ee1('0x4f')](_0xd08dc9[_0x4ee1('0x6a')],function(_0x135cff){return _0x135cff;});var _0x5b9cc6=_['toPairsIn'](_0x25f728)[0x0];var _0x2640cb=_[_0x4ee1('0xf8')](_0x5b9cc6,function(_0x120951){return _0x120951;});_0x3812d1=_0x2640cb[0x1][_0x527525[_0x4ee1('0xf7')]];}var _0x1ecf31={'from':_0xf634c4[_0x4ee1('0xf2')],'firstName':_0xf634c4[_0x4ee1('0x3f')],'lastName':_0xf634c4['lastName'],'mapKey':_0x4ee1('0xf2'),'message':{'from':_0xf634c4['email'],'to':_0x527525[_0x4ee1('0xdc')]['email'],'cc':'','subject':_['isNil'](_0x3812d1)?_0x527525[_0x4ee1('0xf4')]:_0x3812d1,'messageId':'','sentAt':new Date(),'attach':_0xc6fa7f['length'],'attachments':_0xc6fa7f,'originChannel':_0x4ee1('0xf9'),'ChatWebsiteId':_0x527525['id'],'ChatOfflineMessageId':_0x341e69['id'],'originTo':_0x527525[_0x4ee1('0xdc')][_0x4ee1('0xf2')]},'body':_0x341e69['body']};var _0x2f57b8={'account':{'id':_0x527525[_0x4ee1('0xf6')]},'body':_0x1ecf31,'log':_0x4ee1('0xfa')};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x2f57b8,client9001)[_0x4ee1('0x1b')](function(){return _0x341e69;})[_0x4ee1('0x25')](function(_0x2238c6){logger['error'](_0x2238c6);});}return;})[_0x4ee1('0x1b')](function(){if(_0x341e69){return _0x341e69;}})[_0x4ee1('0x1b')](respondWithResult(_0x4f258f,null))[_0x4ee1('0x25')](function(){for(var _0xe67279 of _0x26a657){var _0x3d6f0e=path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0xfb'),_0x4ee1('0xd3'),_0x4ee1('0xfc'),'offline-chat',_0xe67279[_0x4ee1('0x87')]);fs_extra[_0x4ee1('0xfd')](_0x3d6f0e)[_0x4ee1('0x25')](function(_0x55fde2){logger[_0x4ee1('0x21')](_0x4ee1('0xfe'),_0x3d6f0e,_0x55fde2);});}});};exports[_0x4ee1('0xff')]=function(_0x4e598c,_0x20e099){return db['ChatInteraction'][_0x4ee1('0x74')]({'where':{'id':_0x4e598c[_0x4ee1('0x66')]['id']}})['then'](handleEntityNotFound(_0x20e099,null))['then'](function(_0x3b35d8){if(_0x3b35d8){return _0x3b35d8['addInteraction'](_0x4e598c[_0x4ee1('0x6a')][_0x4ee1('0x7f')],_[_0x4ee1('0x100')](_0x4e598c[_0x4ee1('0x6a')],[_0x4ee1('0x7f'),'id'])||{});}})[_0x4ee1('0x1b')](respondWithResult(_0x20e099,null))[_0x4ee1('0x25')](handleError(_0x20e099,null));};exports[_0x4ee1('0x101')]=function(_0xb62797,_0x265d1c){var _0x5deff2={'raw':![],'where':{}};var _0x19857a={};var _0x505fd7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4ee1('0x7c')]({'where':{'id':_0xb62797[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x265d1c,null))[_0x4ee1('0x1b')](function(_0x5ebd39){if(_0x5ebd39){_0x19857a['model']=_['keys'](db[_0x4ee1('0xbf')]['rawAttributes']);_0x19857a['query']=_[_0x4ee1('0x55')](_0xb62797[_0x4ee1('0x54')]);_0x19857a[_0x4ee1('0x5d')]=_[_0x4ee1('0x56')](_0x19857a['model'],_0x19857a[_0x4ee1('0x54')]);_0x5deff2['attributes']=_['intersection'](_0x19857a[_0x4ee1('0x49')],qs['fields'](_0xb62797['query'][_0x4ee1('0x58')]));_0x5deff2[_0x4ee1('0x57')]=_0x5deff2[_0x4ee1('0x57')][_0x4ee1('0x68')]?_0x5deff2[_0x4ee1('0x57')]:_0x19857a[_0x4ee1('0x49')];if(!_0xb62797[_0x4ee1('0x54')][_0x4ee1('0x7d')]('nolimit')){_0x5deff2[_0x4ee1('0x2b')]=qs['limit'](_0xb62797[_0x4ee1('0x54')][_0x4ee1('0x2b')]);_0x5deff2[_0x4ee1('0x29')]=qs[_0x4ee1('0x29')](_0xb62797[_0x4ee1('0x54')][_0x4ee1('0x29')]);}_0x5deff2[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0xb62797[_0x4ee1('0x54')][_0x4ee1('0x5b')]);_0x5deff2[_0x4ee1('0x5f')]=qs[_0x4ee1('0x5d')](_[_0x4ee1('0x5c')](_0xb62797[_0x4ee1('0x54')],_0x19857a['filters']));_0x5deff2[_0x4ee1('0x5f')][_0x4ee1('0x7a')]=_0x5ebd39['id'];if(_0xb62797['query'][_0x4ee1('0x5e')]){_0x5deff2[_0x4ee1('0x5f')]=_[_0x4ee1('0x60')](_0x5deff2[_0x4ee1('0x5f')],{'$or':_[_0x4ee1('0x4f')](_0x5deff2[_0x4ee1('0x57')],function(_0x20cd92){var _0x1185ca={};_0x1185ca[_0x20cd92]={'$like':'%'+_0xb62797[_0x4ee1('0x54')]['filter']+'%'};return _0x1185ca;})});}_0x5deff2=_[_0x4ee1('0x60')]({},_0x5deff2,_0xb62797[_0x4ee1('0x62')]);return db[_0x4ee1('0xbf')]['count']({'where':_0x5deff2[_0x4ee1('0x5f')]})[_0x4ee1('0x1b')](function(_0x355aae){_0x505fd7[_0x4ee1('0x2c')]=_0x355aae;if(_0xb62797[_0x4ee1('0x54')][_0x4ee1('0x63')]){_0x5deff2[_0x4ee1('0x69')]=[{'model':db['CmContact'],'as':_0x4ee1('0x102'),'required':![]},{'model':db[_0x4ee1('0xc9')],'as':_0x4ee1('0x103'),'attributes':[_0x4ee1('0x35'),_0x4ee1('0x104'),_0x4ee1('0x105')],'required':![]},{'model':db[_0x4ee1('0x106')],'as':'Tags','attributes':['id',_0x4ee1('0x35'),'color'],'where':_0xb62797['query']['tag']?{'id':_0xb62797[_0x4ee1('0x54')]['tag']}:undefined,'required':_0xb62797[_0x4ee1('0x54')]['tag']?!![]:![]}];}return db[_0x4ee1('0xbf')]['findAll'](_0x5deff2);})['then'](function(_0x128f36){_0x505fd7[_0x4ee1('0x65')]=_0x128f36;return _0x505fd7;});}})[_0x4ee1('0x1b')](respondWithFilteredResult(_0x265d1c,_0x5deff2))[_0x4ee1('0x25')](handleError(_0x265d1c,null));};exports['getSnippet']=function(_0x573cc2,_0x533d05){var _0x3abec4=0x0;var _0x2b0075=0x0;var _0x3adc79=![];var _0x2654b6;var _0x3a538f;return db['ChatWebsite'][_0x4ee1('0x74')]({'where':{'id':_0x573cc2['params']['id']},'include':[{'model':db[_0x4ee1('0xb5')],'as':_0x4ee1('0xb5'),'include':[{'model':db['Interval'],'as':_0x4ee1('0x107'),'attributes':['id',_0x4ee1('0xb6')]}]}]})[_0x4ee1('0x1b')](handleEntityNotFound(_0x533d05,null))[_0x4ee1('0x1b')](function(_0xe56709){if(_0xe56709){_0x2654b6=_0xe56709;return _0xe56709[_0x4ee1('0x108')]({'raw':!![]});}})['then'](function(_0x531a6b){if(_0x2654b6){if(_0x531a6b){_0x3a538f=_0x531a6b;}}return require('../../config/license/util')[_0x4ee1('0x109')]();})[_0x4ee1('0x1b')](function(_0x5771b1){if(_0x5771b1){_0x2b0075=_0x5771b1['virtual'];_0x3adc79=_0x5771b1[_0x4ee1('0x8f')];}})[_0x4ee1('0x1b')](function(){return db[_0x4ee1('0xbf')][_0x4ee1('0x2c')]({'where':{'closed':![]}});})['then'](function(_0x25f00e){_0x3abec4=_0x25f00e;if(_0x2b0075&&_0x25f00e>_0x2b0075){return db[_0x4ee1('0x10a')][_0x4ee1('0x7c')]({'where':{'id':0x1}})[_0x4ee1('0x1b')](function(_0xe52d37){if(_0xe52d37){_0xe52d37[_0x4ee1('0x10b')](_0x4ee1('0x10c'));}});}})[_0x4ee1('0x1b')](function(){var _0x3d4370=_0x2654b6[_0x4ee1('0xb5')];var _0x52f9f6=_0x2654b6['timezone']||undefined;return _0x3d4370?_0x3d4370[_0x4ee1('0xa1')](_0x52f9f6):!![];})[_0x4ee1('0x1b')](function(_0x2798bc){var _0x45badb=fs['readFileSync'](path[_0x4ee1('0x8b')](config[_0x4ee1('0x8c')],_0x4ee1('0x10d')),'utf8');var _0x303605=_0x4ee1('0x10e');var _0x40419d=![];var _0x4d7d01,_0x53aa81;if(_0x573cc2[_0x4ee1('0xbc')]['referer']){_0x4d7d01=new URL(_0x573cc2[_0x4ee1('0xbc')][_0x4ee1('0x42')])['origin'];}else if(_0x573cc2[_0x4ee1('0xbc')][_0x4ee1('0x10f')]){_0x4d7d01=new URL(_0x573cc2[_0x4ee1('0xbc')]['origin'])['origin'];}else{_0x4d7d01=_0x4ee1('0x110');}_0x53aa81=typeof _0x2654b6[_0x4ee1('0x6b')][_0x4ee1('0x3e')](',')[_0x4ee1('0x74')](function(_0x2a5b6d){return wildcardUtils[_0x4ee1('0x111')](_0x2a5b6d,_0x4d7d01);})!==_0x4ee1('0x2a');var _0x455774={'chatVersion':_0x303605,'chatWebsiteAddressOrigin':_0x53aa81?_0x4d7d01:_0x2654b6[_0x4ee1('0x6b')],'remote':_0x2654b6[_0x4ee1('0x112')],'query':querystring[_0x4ee1('0x20')](_[_0x4ee1('0x60')](_0x2654b6[_0x4ee1('0x32')]({'plain':!![]}),{'customerIp':_0x573cc2['headers'][_0x4ee1('0x3c')]||_0x573cc2[_0x4ee1('0xbc')][_0x4ee1('0x113')]||_0x573cc2[_0x4ee1('0x114')][_0x4ee1('0x115')]||_0x573cc2['ip'],'referer':_0x573cc2['headers'][_0x4ee1('0x42')],'openedInteractions':_0x3abec4,'maxInteractions':_0x2b0075,'virtual':_0x3adc79['virtual'],'online':_0x2798bc,'custom':_0x3adc79,'address':_0x53aa81?_0x4d7d01:null}))[_0x4ee1('0x116')](/'/g,'\x5c\x27')};_0x533d05[_0x4ee1('0x36')](ejs['render'](Mustache[_0x4ee1('0xe1')](_0x45badb,_0x455774),{'proactiveActions':_0x3a538f,'alignment':_0x2654b6[_0x4ee1('0x117')],'verticalAlignment':_0x2654b6['verticalAlignment'],'div_color':_0x2654b6[_0x4ee1('0x118')],'labelText':_0x2654b6[_0x4ee1('0x119')],'text_color':_0x2654b6[_0x4ee1('0x11a')],'text_button_color':_0x2654b6[_0x4ee1('0x11b')],'button_color':_0x2654b6[_0x4ee1('0x11c')],'background_color':_0x2654b6[_0x4ee1('0x11d')],'hideWhenOffline':_0x2654b6[_0x4ee1('0x11e')],'intervalId':_0x2654b6[_0x4ee1('0x11f')],'isDevelopment':_0x40419d,'chatVersion':_0x303605}));})[_0x4ee1('0x25')](handleError(_0x533d05,null));};exports[_0x4ee1('0x120')]=function(_0x1e1dd7,_0x5585a7){var _0x1dd24a=_0x1e1dd7[_0x4ee1('0x66')]['id'];var _0x3f2307=_0x1e1dd7[_0x4ee1('0x6a')];var _0x4e59ce=0xc8;var _0x47b557=null;return db[_0x4ee1('0xe8')][_0x4ee1('0xe9')]({'isolationLevel':db[_0x4ee1('0xe8')]['Transaction'][_0x4ee1('0x121')][_0x4ee1('0x122')]},function(_0x43baf4){return db['ChatWebsite'][_0x4ee1('0x7c')]({'where':{'id':_0x1dd24a},'transaction':_0x43baf4})[_0x4ee1('0x1b')](function(_0x299872){if(_0x299872){return db[_0x4ee1('0xb3')][_0x4ee1('0x31')]({'where':{'ChatWebsiteId':_0x1dd24a},'transaction':_0x43baf4})[_0x4ee1('0x1b')](function(){var _0x473044=_['map'](_0x3f2307,function(_0x2e9fbc){_0x2e9fbc['ChatWebsiteId']=_0x1dd24a;return _0x2e9fbc;});return db['ChatApplication'][_0x4ee1('0xeb')](_0x473044,{'transaction':_0x43baf4});});}else{_0x4e59ce=0x194;_0x47b557=[];}});})[_0x4ee1('0x1b')](function(){if(_0x4e59ce!==0x194){return db[_0x4ee1('0xb3')][_0x4ee1('0x123')]({'where':{'ChatWebsiteId':_0x1dd24a},'order':'priority'})[_0x4ee1('0x1b')](function(_0x9d4b85){_0x47b557=_0x9d4b85;});}})[_0x4ee1('0x25')](function(_0x209ba3){_0x4e59ce=0x1f4;logger[_0x4ee1('0x21')](_0x209ba3['stack']);if(_0x209ba3['name']){delete _0x209ba3[_0x4ee1('0x35')];}_0x47b557=_0x209ba3;})['finally'](function(){if(_0x47b557===null){_0x5585a7[_0x4ee1('0x26')](_0x4e59ce);}else{if(_0x4e59ce===0x1f4){_0x5585a7['status'](_0x4e59ce)[_0x4ee1('0x36')](_0x47b557);}else{_0x5585a7[_0x4ee1('0x27')](_0x4e59ce)[_0x4ee1('0x2f')](_0x47b557);}}});};exports[_0x4ee1('0x124')]=function(_0x25ac7b,_0x99b63c){var _0x531dca={};var _0x25bf05={};var _0x575ef2;var _0xeec531;return db[_0x4ee1('0x50')][_0x4ee1('0x7c')]({'where':{'id':_0x25ac7b[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x99b63c,null))[_0x4ee1('0x1b')](function(_0x467786){if(_0x467786){_0x575ef2=_0x467786;_0x25bf05['model']=_[_0x4ee1('0x55')](db[_0x4ee1('0xb3')][_0x4ee1('0x51')]);_0x25bf05['query']=_[_0x4ee1('0x55')](_0x25ac7b[_0x4ee1('0x54')]);_0x25bf05[_0x4ee1('0x5d')]=_[_0x4ee1('0x56')](_0x25bf05['model'],_0x25bf05[_0x4ee1('0x54')]);_0x531dca[_0x4ee1('0x57')]=_[_0x4ee1('0x56')](_0x25bf05[_0x4ee1('0x49')],qs[_0x4ee1('0x58')](_0x25ac7b['query'][_0x4ee1('0x58')]));_0x531dca['attributes']=_0x531dca[_0x4ee1('0x57')][_0x4ee1('0x68')]?_0x531dca[_0x4ee1('0x57')]:_0x25bf05[_0x4ee1('0x49')];_0x531dca[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0x25ac7b[_0x4ee1('0x54')][_0x4ee1('0x5b')]);_0x531dca[_0x4ee1('0x5f')]=qs['filters'](_[_0x4ee1('0x5c')](_0x25ac7b[_0x4ee1('0x54')],_0x25bf05[_0x4ee1('0x5d')]));if(_0x25ac7b[_0x4ee1('0x54')]['filter']){_0x531dca[_0x4ee1('0x5f')]=_[_0x4ee1('0x60')](_0x531dca[_0x4ee1('0x5f')],{'$or':_['map'](_0x531dca['attributes'],function(_0x16a2d2){var _0x48bfd6={};_0x48bfd6[_0x16a2d2]={'$like':'%'+_0x25ac7b[_0x4ee1('0x54')][_0x4ee1('0x5e')]+'%'};return _0x48bfd6;})});}_0x531dca=_[_0x4ee1('0x60')]({},_0x531dca,_0x25ac7b[_0x4ee1('0x62')]);return _0x575ef2[_0x4ee1('0x124')](_0x531dca);}})[_0x4ee1('0x1b')](function(_0x1cc229){if(_0x1cc229){_0xeec531=_0x1cc229[_0x4ee1('0x68')];if(!_0x25ac7b['query']['hasOwnProperty'](_0x4ee1('0x59'))){_0x531dca[_0x4ee1('0x2b')]=qs[_0x4ee1('0x2b')](_0x25ac7b[_0x4ee1('0x54')][_0x4ee1('0x2b')]);_0x531dca['offset']=qs[_0x4ee1('0x29')](_0x25ac7b[_0x4ee1('0x54')][_0x4ee1('0x29')]);}return _0x575ef2[_0x4ee1('0x124')](_0x531dca);}})[_0x4ee1('0x1b')](function(_0x11f348){if(_0x11f348){return _0x11f348?{'count':_0xeec531,'rows':_0x11f348}:null;}})[_0x4ee1('0x1b')](respondWithResult(_0x99b63c,null))[_0x4ee1('0x25')](handleError(_0x99b63c,null));};exports[_0x4ee1('0x125')]=function(_0x5cef8d,_0x452961){return db[_0x4ee1('0x126')][_0x4ee1('0x74')]({'where':{'id':_0x5cef8d['params']['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x452961,null))['then'](function(_0x30afa6){if(_0x30afa6){return _0x30afa6[_0x4ee1('0x125')](_0x5cef8d[_0x4ee1('0x6a')][_0x4ee1('0x7f')],_['omit'](_0x5cef8d[_0x4ee1('0x6a')],[_0x4ee1('0x7f'),'id'])||{});}})[_0x4ee1('0x1b')](respondWithResult(_0x452961,null))[_0x4ee1('0x25')](handleError(_0x452961,null));};exports[_0x4ee1('0x108')]=function(_0x861c76,_0x3f80ba){var _0x1e8d49={};var _0x595c90={};var _0x346d97;var _0xf36b32;return db[_0x4ee1('0x50')][_0x4ee1('0x7c')]({'where':{'id':_0x861c76[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x3f80ba,null))[_0x4ee1('0x1b')](function(_0x2201e2){if(_0x2201e2){_0x346d97=_0x2201e2;_0x595c90[_0x4ee1('0x49')]=_[_0x4ee1('0x55')](db[_0x4ee1('0x127')][_0x4ee1('0x51')]);_0x595c90['query']=_[_0x4ee1('0x55')](_0x861c76[_0x4ee1('0x54')]);_0x595c90['filters']=_['intersection'](_0x595c90[_0x4ee1('0x49')],_0x595c90[_0x4ee1('0x54')]);_0x1e8d49[_0x4ee1('0x57')]=_[_0x4ee1('0x56')](_0x595c90[_0x4ee1('0x49')],qs[_0x4ee1('0x58')](_0x861c76[_0x4ee1('0x54')]['fields']));_0x1e8d49[_0x4ee1('0x57')]=_0x1e8d49[_0x4ee1('0x57')][_0x4ee1('0x68')]?_0x1e8d49[_0x4ee1('0x57')]:_0x595c90[_0x4ee1('0x49')];_0x1e8d49[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0x861c76[_0x4ee1('0x54')]['sort']);_0x1e8d49[_0x4ee1('0x5f')]=qs[_0x4ee1('0x5d')](_[_0x4ee1('0x5c')](_0x861c76['query'],_0x595c90['filters']));if(_0x861c76['query'][_0x4ee1('0x5e')]){_0x1e8d49['where']=_[_0x4ee1('0x60')](_0x1e8d49['where'],{'$or':_[_0x4ee1('0x4f')](_0x1e8d49['attributes'],function(_0x330d3a){var _0x35da62={};_0x35da62[_0x330d3a]={'$like':'%'+_0x861c76[_0x4ee1('0x54')][_0x4ee1('0x5e')]+'%'};return _0x35da62;})});}_0x1e8d49=_[_0x4ee1('0x60')]({},_0x1e8d49,_0x861c76['options']);return _0x346d97['getProactiveActions'](_0x1e8d49);}})['then'](function(_0x5f0f5d){if(_0x5f0f5d){_0xf36b32=_0x5f0f5d['length'];if(!_0x861c76[_0x4ee1('0x54')]['hasOwnProperty'](_0x4ee1('0x59'))){_0x1e8d49[_0x4ee1('0x2b')]=qs[_0x4ee1('0x2b')](_0x861c76['query'][_0x4ee1('0x2b')]);_0x1e8d49[_0x4ee1('0x29')]=qs[_0x4ee1('0x29')](_0x861c76[_0x4ee1('0x54')][_0x4ee1('0x29')]);}return _0x346d97[_0x4ee1('0x108')](_0x1e8d49);}})['then'](function(_0x50860d){if(_0x50860d){return _0x50860d?{'count':_0xf36b32,'rows':_0x50860d}:null;}})[_0x4ee1('0x1b')](respondWithResult(_0x3f80ba,null))[_0x4ee1('0x25')](handleError(_0x3f80ba,null));};exports[_0x4ee1('0x128')]=function(_0x5217b2,_0x307be5){var _0x15030c=_0x5217b2[_0x4ee1('0x54')][_0x4ee1('0x129')]===_0x4ee1('0x12a')?_0x4ee1('0x12b'):_0x4ee1('0x12c');return db['ChatWebsite']['find']({'attributes':['id',_0x15030c],'where':{'id':_0x5217b2[_0x4ee1('0x66')]['id']}})['then'](handleEntityNotFound(_0x307be5,null))[_0x4ee1('0x1b')](function(_0x43b20a){if(_0x43b20a){var _0x122584=_0x43b20a[_0x15030c];var _0x437954=_0x122584&&_0x122584[_0x4ee1('0x12d')]?_0x122584[_0x4ee1('0x12d')]:[];_0x307be5[_0x4ee1('0x36')]({'fromKey':_[_0x4ee1('0x90')](_0x122584['fromKey'])?undefined:_0x122584[_0x4ee1('0x12e')],'count':_0x437954[_0x4ee1('0x68')],'rows':_0x437954});}})['catch'](handleError(_0x307be5,null));};exports[_0x4ee1('0x12f')]=function(_0x299b4,_0x62a888){var _0x442cff={'raw':![],'where':{}};var _0x2a3cf2={};var _0x54fe5f={'count':0x0,'rows':[]};return db[_0x4ee1('0x50')]['findOne']({'where':{'id':_0x299b4[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x62a888,null))[_0x4ee1('0x1b')](function(_0x410628){if(_0x410628){_0x2a3cf2[_0x4ee1('0x49')]=_[_0x4ee1('0x55')](db['ChatOfflineMessage'][_0x4ee1('0x51')]);_0x2a3cf2[_0x4ee1('0x54')]=_[_0x4ee1('0x55')](_0x299b4[_0x4ee1('0x54')]);_0x2a3cf2['filters']=_[_0x4ee1('0x56')](_0x2a3cf2[_0x4ee1('0x49')],_0x2a3cf2[_0x4ee1('0x54')]);_0x442cff['attributes']=_['intersection'](_0x2a3cf2[_0x4ee1('0x49')],qs[_0x4ee1('0x58')](_0x299b4['query'][_0x4ee1('0x58')]));_0x442cff[_0x4ee1('0x57')]=_0x442cff[_0x4ee1('0x57')]['length']?_0x442cff[_0x4ee1('0x57')]:_0x2a3cf2[_0x4ee1('0x49')];if(!_0x299b4[_0x4ee1('0x54')][_0x4ee1('0x7d')](_0x4ee1('0x59'))){_0x442cff[_0x4ee1('0x2b')]=qs[_0x4ee1('0x2b')](_0x299b4[_0x4ee1('0x54')][_0x4ee1('0x2b')]);_0x442cff['offset']=qs['offset'](_0x299b4['query'][_0x4ee1('0x29')]);}_0x442cff[_0x4ee1('0x5a')]=qs['sort'](_0x299b4[_0x4ee1('0x54')]['sort']);_0x442cff[_0x4ee1('0x5f')]=qs[_0x4ee1('0x5d')](_['pick'](_0x299b4['query'],_0x2a3cf2[_0x4ee1('0x5d')]));_0x442cff['where'][_0x4ee1('0x7a')]=_0x410628['id'];if(_0x299b4[_0x4ee1('0x54')][_0x4ee1('0x5e')]){_0x442cff[_0x4ee1('0x5f')]=_['merge'](_0x442cff[_0x4ee1('0x5f')],{'$or':_['map'](_0x442cff[_0x4ee1('0x57')],function(_0x38bb5e){var _0x377523={};_0x377523[_0x38bb5e]={'$like':'%'+_0x299b4[_0x4ee1('0x54')]['filter']+'%'};return _0x377523;})});}_0x442cff=_[_0x4ee1('0x60')]({},_0x442cff,_0x299b4[_0x4ee1('0x62')]);return db[_0x4ee1('0x130')][_0x4ee1('0x2c')]({'where':_0x442cff[_0x4ee1('0x5f')]})[_0x4ee1('0x1b')](function(_0x21c854){_0x54fe5f[_0x4ee1('0x2c')]=_0x21c854;if(_0x299b4['query'][_0x4ee1('0x63')]){_0x442cff[_0x4ee1('0x69')]=[{'all':!![]}];}else{_0x442cff[_0x4ee1('0x69')]=[{'model':db['CmContact'],'as':_0x4ee1('0x102'),'required':![]},{'model':db[_0x4ee1('0xea')],'as':_0x4ee1('0x131'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x442cff);})[_0x4ee1('0x1b')](function(_0x4a5ad6){_0x54fe5f[_0x4ee1('0x65')]=_0x4a5ad6;return _0x54fe5f;});}})[_0x4ee1('0x1b')](respondWithFilteredResult(_0x62a888,_0x442cff))[_0x4ee1('0x25')](handleError(_0x62a888,null));};exports[_0x4ee1('0x132')]=function(_0x817279,_0x228b46){return db[_0x4ee1('0x50')][_0x4ee1('0x74')]({'where':{'id':_0x817279[_0x4ee1('0x66')]['id']}})['then'](handleEntityNotFound(_0x228b46,null))['then'](function(_0x3ff1a7){if(_0x3ff1a7){return _0x3ff1a7[_0x4ee1('0x132')](_0x817279[_0x4ee1('0x6a')]['ids'],_[_0x4ee1('0x100')](_0x817279[_0x4ee1('0x6a')],[_0x4ee1('0x7f'),'id'])||{})[_0x4ee1('0x133')](function(_0x3e3912){for(var _0x4215b0=0x0;_0x4215b0<_0x817279[_0x4ee1('0x6a')][_0x4ee1('0x7f')][_0x4ee1('0x68')];_0x4215b0+=0x1){socket[_0x4ee1('0x134')]('userChatWebsite:save',{'UserId':Number(_0x817279[_0x4ee1('0x6a')][_0x4ee1('0x7f')][_0x4215b0]),'ChatWebsiteId':Number(_0x817279[_0x4ee1('0x66')]['id'])});}return _0x3e3912;});}})[_0x4ee1('0x1b')](respondWithResult(_0x228b46,null))['catch'](handleError(_0x228b46,null));};exports[_0x4ee1('0x135')]=function(_0x3c7e0e,_0x12de81){return db['ChatWebsite'][_0x4ee1('0x74')]({'where':{'id':_0x3c7e0e[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x12de81,null))[_0x4ee1('0x1b')](function(_0x47a2cf){if(_0x47a2cf){return _0x47a2cf[_0x4ee1('0x135')](_0x3c7e0e[_0x4ee1('0x54')][_0x4ee1('0x7f')])[_0x4ee1('0x1b')](function(){if(_['isArray'](_0x3c7e0e[_0x4ee1('0x54')][_0x4ee1('0x7f')])){for(var _0x1c7273=0x0;_0x1c7273<_0x3c7e0e['query'][_0x4ee1('0x7f')][_0x4ee1('0x68')];_0x1c7273+=0x1){socket['emit'](_0x4ee1('0x136'),{'UserId':Number(_0x3c7e0e[_0x4ee1('0x54')]['ids'][_0x1c7273]),'ChatWebsiteId':Number(_0x3c7e0e[_0x4ee1('0x66')]['id'])});}}else{socket[_0x4ee1('0x134')](_0x4ee1('0x136'),{'UserId':Number(_0x3c7e0e['query'][_0x4ee1('0x7f')]),'ChatWebsiteId':Number(_0x3c7e0e[_0x4ee1('0x66')]['id'])});}});}})[_0x4ee1('0x1b')](respondWithStatusCode(_0x12de81,null))[_0x4ee1('0x25')](handleError(_0x12de81,null));};exports[_0x4ee1('0x137')]=function(_0x48cd81,_0x29b302){var _0x50e85e={};var _0x202fe8={};var _0x3a7317;var _0x4dfd2e;return db['ChatWebsite'][_0x4ee1('0x7c')]({'where':{'id':_0x48cd81[_0x4ee1('0x66')]['id']}})[_0x4ee1('0x1b')](handleEntityNotFound(_0x29b302,null))[_0x4ee1('0x1b')](function(_0x8f615f){if(_0x8f615f){_0x3a7317=_0x8f615f;_0x202fe8[_0x4ee1('0x49')]=_[_0x4ee1('0x55')](db[_0x4ee1('0xc9')][_0x4ee1('0x51')]);_0x202fe8[_0x4ee1('0x54')]=_[_0x4ee1('0x55')](_0x48cd81['query']);_0x202fe8[_0x4ee1('0x5d')]=_['intersection'](_0x202fe8[_0x4ee1('0x49')],_0x202fe8[_0x4ee1('0x54')]);_0x50e85e[_0x4ee1('0x57')]=_[_0x4ee1('0x56')](_0x202fe8[_0x4ee1('0x49')],qs[_0x4ee1('0x58')](_0x48cd81[_0x4ee1('0x54')][_0x4ee1('0x58')]));_0x50e85e[_0x4ee1('0x57')]=_0x50e85e[_0x4ee1('0x57')][_0x4ee1('0x68')]?_0x50e85e[_0x4ee1('0x57')]:_0x202fe8[_0x4ee1('0x49')];_0x50e85e[_0x4ee1('0x5a')]=qs[_0x4ee1('0x5b')](_0x48cd81[_0x4ee1('0x54')]['sort']);_0x50e85e[_0x4ee1('0x5f')]=qs[_0x4ee1('0x5d')](_[_0x4ee1('0x5c')](_0x48cd81['query'],_0x202fe8[_0x4ee1('0x5d')]));if(_0x48cd81[_0x4ee1('0x54')]['filter']){_0x50e85e[_0x4ee1('0x5f')]=_[_0x4ee1('0x60')](_0x50e85e[_0x4ee1('0x5f')],{'$or':_[_0x4ee1('0x4f')](_0x50e85e[_0x4ee1('0x57')],function(_0x2c95ff){var _0x364845={};_0x364845[_0x2c95ff]={'$like':'%'+_0x48cd81[_0x4ee1('0x54')][_0x4ee1('0x5e')]+'%'};return _0x364845;})});}_0x50e85e=_[_0x4ee1('0x60')]({},_0x50e85e,_0x48cd81[_0x4ee1('0x62')]);return _0x3a7317[_0x4ee1('0x137')](_0x50e85e);}})['then'](function(_0x1b7163){if(_0x1b7163){_0x4dfd2e=_0x1b7163['length'];if(!_0x48cd81[_0x4ee1('0x54')]['hasOwnProperty'](_0x4ee1('0x59'))){_0x50e85e['limit']=qs[_0x4ee1('0x2b')](_0x48cd81['query'][_0x4ee1('0x2b')]);_0x50e85e[_0x4ee1('0x29')]=qs['offset'](_0x48cd81[_0x4ee1('0x54')]['offset']);}return _0x3a7317[_0x4ee1('0x137')](_0x50e85e);}})['then'](function(_0x10d3f0){if(_0x10d3f0){return _0x10d3f0?{'count':_0x4dfd2e,'rows':_0x10d3f0}:null;}})[_0x4ee1('0x1b')](respondWithResult(_0x29b302,null))[_0x4ee1('0x25')](handleError(_0x29b302,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 4a8f284..c07f97e 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 _0x6732=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2673('0x0'));var ChatWebsite=require(_0x2673('0x1'))['db'][_0x2673('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2673('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2673('0x4'),'afterDestroy':_0x2673('0x5')};function emitEvent(_0x5467cd){return function(_0xfef746,_0x3ac2c4,_0x5c7f5c){ChatWebsiteEvents['emit'](_0x5467cd+':'+_0xfef746['id'],_0xfef746);ChatWebsiteEvents[_0x2673('0x6')](_0x5467cd,_0xfef746);_0x5c7f5c(null);};}for(var e in events){if(events[_0x2673('0x7')](e)){var event=events[e];ChatWebsite[_0x2673('0x8')](e,emitEvent(event));}}module[_0x2673('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x383a=['emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x383a,0x1ad));var _0xa383=function(_0x2b1fa9,_0x2e6a4b){_0x2b1fa9=_0x2b1fa9-0x0;var _0x405640=_0x383a[_0x2b1fa9];return _0x405640;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xa383('0x0'))['db'][_0xa383('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa383('0x2'),'afterDestroy':'remove'};function emitEvent(_0x15f485){return function(_0x2d5b89,_0x86d0d9,_0x576c27){ChatWebsiteEvents['emit'](_0x15f485+':'+_0x2d5b89['id'],_0x2d5b89);ChatWebsiteEvents[_0xa383('0x3')](_0x15f485,_0x2d5b89);_0x576c27(null);};}for(var e in events){if(events[_0xa383('0x4')](e)){var event=events[e];ChatWebsite[_0xa383('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 200ef5c..e80699b 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 _0x78a6=['rimraf','./chatWebsite.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise'];(function(_0x33fc57,_0xdd2591){var _0xf701ca=function(_0x4a38b9){while(--_0x4a38b9){_0x33fc57['push'](_0x33fc57['shift']());}};_0xf701ca(++_0xdd2591);}(_0x78a6,0x163));var _0x678a=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x78a6[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x678a('0x0'));var util=require('util');var logger=require(_0x678a('0x1'))(_0x678a('0x2'));var moment=require(_0x678a('0x3'));var BPromise=require('bluebird');var rp=require(_0x678a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x678a('0x5'));var config=require('../../config/environment');var attributes=require(_0x678a('0x6'));module[_0x678a('0x7')]=function(_0x12d977,_0x3ae359){return _0x12d977[_0x678a('0x8')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33ff=['moment','bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x97ab47,_0x5cdab2){var _0x2d291f=function(_0x14f4fd){while(--_0x14f4fd){_0x97ab47['push'](_0x97ab47['shift']());}};_0x2d291f(++_0x5cdab2);}(_0x33ff,0xb0));var _0xf33f=function(_0x3ee9b2,_0xa090bb){_0x3ee9b2=_0x3ee9b2-0x0;var _0x51ac3e=_0x33ff[_0x3ee9b2];return _0x51ac3e;};'use strict';var _=require(_0xf33f('0x0'));var util=require(_0xf33f('0x1'));var logger=require(_0xf33f('0x2'))(_0xf33f('0x3'));var moment=require(_0xf33f('0x4'));var BPromise=require(_0xf33f('0x5'));var rp=require(_0xf33f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf33f('0x7'));var config=require('../../config/environment');var attributes=require(_0xf33f('0x8'));module[_0xf33f('0x9')]=function(_0x1038fa,_0xaf76fc){return _0x1038fa[_0xf33f('0xa')]('ChatWebsite',attributes,{'tableName':_0xf33f('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 1726010..b9ae192 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 _0x6557=['request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x3a83df,_0x3a750f){var _0x3d0adb=function(_0x27a1b5){while(--_0x27a1b5){_0x3a83df['push'](_0x3a83df['shift']());}};_0x3d0adb(++_0x3a750f);}(_0x6557,0x12e));var _0x7655=function(_0xe72d8f,_0x1398c7){_0xe72d8f=_0xe72d8f-0x0;var _0x4add7d=_0x6557[_0xe72d8f];return _0x4add7d;};'use strict';var _=require(_0x7655('0x0'));var util=require(_0x7655('0x1'));var moment=require('moment');var BPromise=require(_0x7655('0x2'));var rs=require(_0x7655('0x3'));var fs=require('fs');var Redis=require(_0x7655('0x4'));var db=require(_0x7655('0x5'))['db'];var utils=require(_0x7655('0x6'));var logger=require(_0x7655('0x7'))(_0x7655('0x8'));var config=require(_0x7655('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7655('0xa')][_0x7655('0xb')]({'port':0x232a});config[_0x7655('0xc')]=_[_0x7655('0xd')](config[_0x7655('0xc')],{'host':_0x7655('0xe'),'port':0x18eb});var socket=require(_0x7655('0xf'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x7655('0x10')](socket);function respondWithRpcPromise(_0x5bbfc7,_0x4b7e9d,_0x2c1dc2){return new BPromise(function(_0x257564,_0x3efca2){return client['request'](_0x5bbfc7,_0x2c1dc2)[_0x7655('0x11')](function(_0x38955f){logger[_0x7655('0x12')](_0x7655('0x13'),_0x4b7e9d,'request\x20sent');logger[_0x7655('0x14')](_0x7655('0x15'),_0x4b7e9d,_0x7655('0x16'),JSON[_0x7655('0x17')](_0x38955f));if(_0x38955f['error']){if(_0x38955f[_0x7655('0x18')]['code']===0x1f4){logger[_0x7655('0x18')](_0x7655('0x13'),_0x4b7e9d,_0x38955f['error'][_0x7655('0x19')]);return _0x3efca2(_0x38955f[_0x7655('0x18')][_0x7655('0x19')]);}logger[_0x7655('0x18')](_0x7655('0x13'),_0x4b7e9d,_0x38955f['error'][_0x7655('0x19')]);return _0x257564(_0x38955f[_0x7655('0x18')][_0x7655('0x19')]);}else{logger[_0x7655('0x12')](_0x7655('0x13'),_0x4b7e9d,_0x7655('0x16'));_0x257564(_0x38955f[_0x7655('0x1a')][_0x7655('0x19')]);}})['catch'](function(_0x83594b){logger[_0x7655('0x18')](_0x7655('0x13'),_0x4b7e9d,_0x83594b);_0x3efca2(_0x83594b);});});}
\ No newline at end of file
+var _0xa42f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x58c7a6,_0x9336c9){var _0x51e95a=function(_0x3d4d7b){while(--_0x3d4d7b){_0x58c7a6['push'](_0x58c7a6['shift']());}};_0x51e95a(++_0x9336c9);}(_0xa42f,0x18b));var _0xfa42=function(_0x26401a,_0xbdff78){_0x26401a=_0x26401a-0x0;var _0x1f179c=_0xa42f[_0x26401a];return _0x1f179c;};'use strict';var _=require(_0xfa42('0x0'));var util=require(_0xfa42('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa42('0x2'));var db=require(_0xfa42('0x3'))['db'];var utils=require(_0xfa42('0x4'));var logger=require(_0xfa42('0x5'))(_0xfa42('0x6'));var config=require(_0xfa42('0x7'));var jayson=require(_0xfa42('0x8'));var client=jayson[_0xfa42('0x9')][_0xfa42('0xa')]({'port':0x232a});config[_0xfa42('0xb')]=_[_0xfa42('0xc')](config[_0xfa42('0xb')],{'host':_0xfa42('0xd'),'port':0x18eb});var socket=require(_0xfa42('0xe'))(new Redis(config[_0xfa42('0xb')]));require(_0xfa42('0xf'))[_0xfa42('0x10')](socket);function respondWithRpcPromise(_0x1e8a39,_0x233b9b,_0x3a8b9f){return new BPromise(function(_0x3315fb,_0x1e191c){return client['request'](_0x1e8a39,_0x3a8b9f)['then'](function(_0x1292b6){logger['info'](_0xfa42('0x11'),_0x233b9b,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x233b9b,'request\x20sent',JSON['stringify'](_0x1292b6));if(_0x1292b6[_0xfa42('0x12')]){if(_0x1292b6[_0xfa42('0x12')][_0xfa42('0x13')]===0x1f4){logger[_0xfa42('0x12')](_0xfa42('0x11'),_0x233b9b,_0x1292b6[_0xfa42('0x12')]['message']);return _0x1e191c(_0x1292b6[_0xfa42('0x12')][_0xfa42('0x14')]);}logger[_0xfa42('0x12')](_0xfa42('0x11'),_0x233b9b,_0x1292b6[_0xfa42('0x12')][_0xfa42('0x14')]);return _0x3315fb(_0x1292b6[_0xfa42('0x12')][_0xfa42('0x14')]);}else{logger[_0xfa42('0x15')](_0xfa42('0x11'),_0x233b9b,_0xfa42('0x16'));_0x3315fb(_0x1292b6[_0xfa42('0x17')][_0xfa42('0x14')]);}})[_0xfa42('0x18')](function(_0x14f42a){logger['error'](_0xfa42('0x11'),_0x233b9b,_0x14f42a);_0x1e191c(_0x14f42a);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index ecbe4da..09d7211 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 _0x3b1f=['length','chatWebsite:','save','remove','update','emit','register'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3b1f,0x11a));var _0xf3b1=function(_0xa65634,_0x3d436c){_0xa65634=_0xa65634-0x0;var _0x756716=_0x3b1f[_0xa65634];return _0x756716;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xf3b1('0x0'),_0xf3b1('0x1'),_0xf3b1('0x2')];function createListener(_0x27425d,_0x4d37a2){return function(_0x179928){_0x4d37a2[_0xf3b1('0x3')](_0x27425d,_0x179928);};}function removeListener(_0x266031,_0x2795d0){return function(){ChatWebsiteEvents['removeListener'](_0x266031,_0x2795d0);};}exports[_0xf3b1('0x4')]=function(_0x13374c){for(var _0x4fdf25=0x0,_0x7f59c7=events[_0xf3b1('0x5')];_0x4fdf25<_0x7f59c7;_0x4fdf25++){var _0x3b69ee=events[_0x4fdf25];var _0x47e280=createListener(_0xf3b1('0x6')+_0x3b69ee,_0x13374c);ChatWebsiteEvents['on'](_0x3b69ee,_0x47e280);}};
\ No newline at end of file
+var _0x7d09=['removeListener','register','length','chatWebsite:','save','update','emit'];(function(_0x43b333,_0x1ffed4){var _0xea9fff=function(_0x13d523){while(--_0x13d523){_0x43b333['push'](_0x43b333['shift']());}};_0xea9fff(++_0x1ffed4);}(_0x7d09,0x154));var _0x97d0=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x7d09[_0x3fe6df];return _0x372a0e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x97d0('0x0'),'remove',_0x97d0('0x1')];function createListener(_0x5ae8c4,_0x2c36cf){return function(_0x167020){_0x2c36cf[_0x97d0('0x2')](_0x5ae8c4,_0x167020);};}function removeListener(_0x5c0b13,_0x2f2e2c){return function(){ChatWebsiteEvents[_0x97d0('0x3')](_0x5c0b13,_0x2f2e2c);};}exports[_0x97d0('0x4')]=function(_0xe01cdf){for(var _0x53a404=0x0,_0x3e978d=events[_0x97d0('0x5')];_0x53a404<_0x3e978d;_0x53a404++){var _0x36ba24=events[_0x53a404];var _0x17a332=createListener(_0x97d0('0x6')+_0x36ba24,_0xe01cdf);ChatWebsiteEvents['on'](_0x36ba24,_0x17a332);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index f45ab4f..871e05a 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc3ed=['trim','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','URL','replace','localhost','test'];(function(_0x520b9f,_0x2be5aa){var _0xe5e7df=function(_0x2dacd0){while(--_0x2dacd0){_0x520b9f['push'](_0x520b9f['shift']());}};_0xe5e7df(++_0x2be5aa);}(_0xc3ed,0x111));var _0xdc3e=function(_0x175c40,_0x37f161){_0x175c40=_0x175c40-0x0;var _0x3feac9=_0xc3ed[_0x175c40];return _0x3feac9;};var escapeRegExp=require(_0xdc3e('0x0'))[_0xdc3e('0x1')];var URL=require('url')[_0xdc3e('0x2')];function testWildcardValidity(_0x44efb2){var _0x166afe=!![];try{new URL(_0x44efb2[_0xdc3e('0x3')]('*',_0xdc3e('0x4')));}catch(_0x55ffdd){_0x166afe=![];}return _0x166afe&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xdc3e('0x5')](_0x44efb2);}function testWebsiteWithWildcard(_0x5922b7,_0x9a9a96){var _0x27b691;var _0x3f6e1c=escapeRegExp(_0x5922b7[_0xdc3e('0x6')]()[_0xdc3e('0x3')](/\/$/,''))[_0xdc3e('0x3')]('\x5c*',_0xdc3e('0x7'));try{new URL(_0x5922b7[_0xdc3e('0x3')]('\x5c*',_0xdc3e('0x4')));_0x27b691=new RegExp(_0x3f6e1c)[_0xdc3e('0x5')](_0x9a9a96);}catch(_0x3becac){_0x27b691=![];}return _0x27b691;}module[_0xdc3e('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x3af5=['URL','localhost','replace','([\x5cw]+)','test','../../../utils/misc','escapeRegExp'];(function(_0x171d03,_0x3eebb0){var _0x5f0402=function(_0xf7dba1){while(--_0xf7dba1){_0x171d03['push'](_0x171d03['shift']());}};_0x5f0402(++_0x3eebb0);}(_0x3af5,0x1d3));var _0x53af=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x3af5[_0x1d5a32];return _0x361ca0;};var escapeRegExp=require(_0x53af('0x0'))[_0x53af('0x1')];var URL=require('url')[_0x53af('0x2')];function testWildcardValidity(_0x2a2a9){var _0x4ec541=!![];try{new URL(_0x2a2a9['replace']('*',_0x53af('0x3')));}catch(_0x500041){_0x4ec541=![];}return _0x4ec541&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x2a2a9);}function testWebsiteWithWildcard(_0x205be1,_0x11651b){var _0x4e0137;var _0xba7147=escapeRegExp(_0x205be1['trim']()[_0x53af('0x4')](/\/$/,''))[_0x53af('0x4')]('\x5c*',_0x53af('0x5'));try{new URL(_0x205be1[_0x53af('0x4')]('\x5c*',_0x53af('0x3')));_0x4e0137=new RegExp(_0xba7147)[_0x53af('0x6')](_0x11651b);}catch(_0x56751b){_0x4e0137=![];}return _0x4e0137;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index d266274..479d76e 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 _0xa711=['/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','join','format','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet'];(function(_0x3573b2,_0x37b3ec){var _0x2494a4=function(_0x5c705f){while(--_0x5c705f){_0x3573b2['push'](_0x3573b2['shift']());}};_0x2494a4(++_0x37b3ec);}(_0xa711,0x106));var _0x1a71=function(_0x208f45,_0x32a9db){_0x208f45=_0x208f45-0x0;var _0x1eb380=_0xa711[_0x208f45];return _0x1eb380;};'use strict';var multer=require(_0x1a71('0x0'));var util=require('util');var path=require(_0x1a71('0x1'));var timeout=require(_0x1a71('0x2'));var express=require(_0x1a71('0x3'));var router=express[_0x1a71('0x4')]();var fs_extra=require(_0x1a71('0x5'));var auth=require(_0x1a71('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1a71('0x7'));var controller=require('./chatWebsite.controller');router[_0x1a71('0x8')]('/',auth[_0x1a71('0x9')](),controller[_0x1a71('0xa')]);router['get'](_0x1a71('0xb'),auth[_0x1a71('0x9')](),controller[_0x1a71('0xc')]);router[_0x1a71('0x8')](_0x1a71('0xd'),auth[_0x1a71('0x9')](),controller[_0x1a71('0xe')]);router[_0x1a71('0x8')](_0x1a71('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x1a71('0x8')](_0x1a71('0x10'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x11')]);router['get'](_0x1a71('0x12'),controller[_0x1a71('0x13')]);router[_0x1a71('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x1a71('0x8')](_0x1a71('0x14'),controller[_0x1a71('0x15')]);router[_0x1a71('0x8')](_0x1a71('0x16'),controller[_0x1a71('0x17')]);router[_0x1a71('0x8')]('/:id/interactions',auth[_0x1a71('0x9')](),controller[_0x1a71('0x18')]);router[_0x1a71('0x8')]('/:id/snippet',controller[_0x1a71('0x19')]);router[_0x1a71('0x8')](_0x1a71('0x1a'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x1b')]);router[_0x1a71('0x8')]('/:id/proactive_actions',auth[_0x1a71('0x9')](),controller[_0x1a71('0x1c')]);router[_0x1a71('0x8')](_0x1a71('0x1d'),controller[_0x1a71('0x1e')]);router[_0x1a71('0x8')]('/:id/offline_messages',auth[_0x1a71('0x9')](),controller[_0x1a71('0x1f')]);router['get'](_0x1a71('0x20'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x21')]);router['post']('/',auth[_0x1a71('0x9')](),controller[_0x1a71('0x22')]);router['post'](_0x1a71('0xf'),auth['isAuthenticated'](),controller[_0x1a71('0x23')]);router[_0x1a71('0x24')](_0x1a71('0x10'),auth[_0x1a71('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x1a71('0x25')]({'destination':function(_0x4a6630,_0x250f71,_0x26ebb3){_0x26ebb3(null,path['join'](config[_0x1a71('0x26')],_0x1a71('0x27')));},'filename':function(_0x12d9d3,_0x1c047b,_0x2f81a1){_0x2f81a1(null,util['format'](_0x1a71('0x28'),Date[_0x1a71('0x29')](),_0x1c047b[_0x1a71('0x2a')]));}})});router['post'](_0x1a71('0x12'),upload[_0x1a71('0x2b')](_0x1a71('0x2c')),controller[_0x1a71('0x2d')]);var upload=multer({'storage':multer[_0x1a71('0x25')]({'destination':function(_0x5ab9d5,_0x8921b4,_0x2887fb){_0x2887fb(null,path[_0x1a71('0x2e')](config[_0x1a71('0x26')],'server/files/images/avatars/'));},'filename':function(_0x1010e7,_0x13ecd9,_0x50eada){_0x50eada(null,util[_0x1a71('0x2f')](_0x1a71('0x28'),Date[_0x1a71('0x29')](),_0x13ecd9[_0x1a71('0x2a')]));}})});router['post']('/:id/avatar',upload[_0x1a71('0x2b')](_0x1a71('0x2c')),controller[_0x1a71('0x30')]);var upload=multer({'storage':multer[_0x1a71('0x25')]({'destination':function(_0x426126,_0x3dd5a2,_0x5810ca){_0x5810ca(null,path[_0x1a71('0x2e')](config[_0x1a71('0x26')],_0x1a71('0x31')));},'filename':function(_0x29bbbd,_0x293325,_0x139f43){_0x139f43(null,util[_0x1a71('0x2f')]('%s-%s',Date[_0x1a71('0x29')](),_0x293325[_0x1a71('0x2a')]));}})});router[_0x1a71('0x24')](_0x1a71('0x14'),upload[_0x1a71('0x2b')](_0x1a71('0x2c')),controller[_0x1a71('0x32')]);var upload=multer({'storage':multer[_0x1a71('0x25')]({'destination':function(_0x4c514d,_0x2d5b3b,_0xa9135){_0xa9135(null,path[_0x1a71('0x2e')](config[_0x1a71('0x26')],'server/files/images/avatars/'));},'filename':function(_0x2028ef,_0x49f264,_0x3ed8c4){_0x3ed8c4(null,util[_0x1a71('0x2f')](_0x1a71('0x28'),Date[_0x1a71('0x29')](),_0x49f264[_0x1a71('0x2a')]));}})});router['post'](_0x1a71('0x16'),upload['single'](_0x1a71('0x2c')),controller[_0x1a71('0x33')]);router[_0x1a71('0x24')](_0x1a71('0x34'),controller[_0x1a71('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x1a71('0x25')]({'destination':function(_0x1681f0,_0x312cba,_0x2f4144){const _0x3ab6ce=path['join'](config[_0x1a71('0x26')],_0x1a71('0x36'),_0x1a71('0x37'),_0x1a71('0x38'));fs_extra['ensureDir'](_0x3ab6ce,function(){_0x2f4144(null,_0x3ab6ce);});},'filename':function(_0x1942f0,_0x5287cb,_0x3c3b59){const _0x41a957=_0x5287cb[_0x1a71('0x2a')][_0x1a71('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x570f27=path[_0x1a71('0x3a')](_0x41a957);const _0x5ab215=Date[_0x1a71('0x29')]()+'-'+_0x41a957[_0x1a71('0x39')](_0x570f27,'')+_0x570f27;_0x3c3b59(null,_0x5ab215);}})});router['post'](_0x1a71('0x3b'),offlineUploadMulter[_0x1a71('0x3c')](),controller['offline']);router[_0x1a71('0x24')]('/:id/interactions',auth[_0x1a71('0x9')](),controller[_0x1a71('0x3d')]);router[_0x1a71('0x24')]('/:id/applications',auth[_0x1a71('0x9')](),controller[_0x1a71('0x3e')]);router[_0x1a71('0x24')](_0x1a71('0x3f'),auth[_0x1a71('0x9')](),controller['addProactiveActions']);router['post'](_0x1a71('0x20'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x40')]);router[_0x1a71('0x41')](_0x1a71('0xd'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x42')]);router['delete'](_0x1a71('0xd'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x43')]);router[_0x1a71('0x44')](_0x1a71('0xf'),auth[_0x1a71('0x9')](),controller['removeDispositions']);router[_0x1a71('0x44')](_0x1a71('0x10'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x45')]);router['delete'](_0x1a71('0x20'),auth[_0x1a71('0x9')](),controller[_0x1a71('0x46')]);module[_0x1a71('0x47')]=router;
\ No newline at end of file
+var _0xe40e=['/:id/interactions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','/:id/notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','/:id/users','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0xe40e,0x70));var _0xee40=function(_0x548f01,_0x98cc45){_0x548f01=_0x548f01-0x0;var _0x5719b0=_0xe40e[_0x548f01];return _0x5719b0;};'use strict';var multer=require('multer');var util=require(_0xee40('0x0'));var path=require(_0xee40('0x1'));var timeout=require(_0xee40('0x2'));var express=require(_0xee40('0x3'));var router=express[_0xee40('0x4')]();var fs_extra=require(_0xee40('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee40('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xee40('0x7')](),controller[_0xee40('0x8')]);router[_0xee40('0x9')](_0xee40('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xee40('0x7')](),controller[_0xee40('0xb')]);router[_0xee40('0x9')](_0xee40('0xc'),auth['isAuthenticated'](),controller[_0xee40('0xd')]);router[_0xee40('0x9')](_0xee40('0xe'),auth['isAuthenticated'](),controller[_0xee40('0xf')]);router[_0xee40('0x9')](_0xee40('0x10'),controller[_0xee40('0x11')]);router[_0xee40('0x9')](_0xee40('0x12'),controller['getAvatar']);router[_0xee40('0x9')](_0xee40('0x13'),controller[_0xee40('0x14')]);router['get']('/:id/system_avatar',controller[_0xee40('0x15')]);router[_0xee40('0x9')](_0xee40('0x16'),auth[_0xee40('0x7')](),controller['getInteractions']);router[_0xee40('0x9')]('/:id/snippet',controller[_0xee40('0x17')]);router[_0xee40('0x9')](_0xee40('0x18'),auth[_0xee40('0x7')](),controller[_0xee40('0x19')]);router[_0xee40('0x9')]('/:id/proactive_actions',auth[_0xee40('0x7')](),controller[_0xee40('0x1a')]);router[_0xee40('0x9')](_0xee40('0x1b'),controller[_0xee40('0x1c')]);router[_0xee40('0x9')]('/:id/offline_messages',auth[_0xee40('0x7')](),controller[_0xee40('0x1d')]);router[_0xee40('0x9')]('/:id/users',auth[_0xee40('0x7')](),controller['getAgents']);router[_0xee40('0x1e')]('/',auth[_0xee40('0x7')](),controller[_0xee40('0x1f')]);router['post'](_0xee40('0xc'),auth[_0xee40('0x7')](),controller['addDisposition']);router['post'](_0xee40('0xe'),auth['isAuthenticated'](),controller[_0xee40('0x20')]);var upload=multer({'storage':multer[_0xee40('0x21')]({'destination':function(_0x14919c,_0x237578,_0x5c5a5b){_0x5c5a5b(null,path[_0xee40('0x22')](config[_0xee40('0x23')],_0xee40('0x24')));},'filename':function(_0x5ace01,_0x13cf6f,_0x45d6fb){_0x45d6fb(null,util[_0xee40('0x25')](_0xee40('0x26'),Date[_0xee40('0x27')](),_0x13cf6f[_0xee40('0x28')]));}})});router['post']('/:id/logo',upload[_0xee40('0x29')](_0xee40('0x2a')),controller[_0xee40('0x2b')]);var upload=multer({'storage':multer[_0xee40('0x21')]({'destination':function(_0x3b9542,_0x26a347,_0x377ada){_0x377ada(null,path[_0xee40('0x22')](config[_0xee40('0x23')],'server/files/images/avatars/'));},'filename':function(_0x4b5424,_0x34b482,_0xb9f710){_0xb9f710(null,util['format'](_0xee40('0x26'),Date[_0xee40('0x27')](),_0x34b482[_0xee40('0x28')]));}})});router[_0xee40('0x1e')]('/:id/avatar',upload[_0xee40('0x29')](_0xee40('0x2a')),controller[_0xee40('0x2c')]);var upload=multer({'storage':multer[_0xee40('0x21')]({'destination':function(_0x1b3378,_0x541ec9,_0x5c4414){_0x5c4414(null,path[_0xee40('0x22')](config['root'],_0xee40('0x2d')));},'filename':function(_0xe364d5,_0x35e857,_0x4035ab){_0x4035ab(null,util[_0xee40('0x25')](_0xee40('0x26'),Date['now'](),_0x35e857[_0xee40('0x28')]));}})});router[_0xee40('0x1e')](_0xee40('0x13'),upload[_0xee40('0x29')](_0xee40('0x2a')),controller[_0xee40('0x2e')]);var upload=multer({'storage':multer[_0xee40('0x21')]({'destination':function(_0x4d0ebd,_0x5905a5,_0x8a2cc1){_0x8a2cc1(null,path[_0xee40('0x22')](config[_0xee40('0x23')],_0xee40('0x2d')));},'filename':function(_0xa15b29,_0x12e093,_0x44c8e6){_0x44c8e6(null,util[_0xee40('0x25')](_0xee40('0x26'),Date['now'](),_0x12e093[_0xee40('0x28')]));}})});router[_0xee40('0x1e')](_0xee40('0x2f'),upload[_0xee40('0x29')]('file'),controller['addSystemAvatar']);router[_0xee40('0x1e')](_0xee40('0x30'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xee40('0x21')]({'destination':function(_0x2a144c,_0x1ca18d,_0x65f93a){const _0x22901c=path[_0xee40('0x22')](config['root'],'server/files',_0xee40('0x31'),_0xee40('0x32'));fs_extra[_0xee40('0x33')](_0x22901c,function(){_0x65f93a(null,_0x22901c);});},'filename':function(_0x2ce305,_0x1d5820,_0x48de65){const _0x2e111c=_0x1d5820[_0xee40('0x28')][_0xee40('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51e980=path[_0xee40('0x35')](_0x2e111c);const _0x14c9cb=Date[_0xee40('0x27')]()+'-'+_0x2e111c[_0xee40('0x34')](_0x51e980,'')+_0x51e980;_0x48de65(null,_0x14c9cb);}})});router[_0xee40('0x1e')](_0xee40('0x36'),offlineUploadMulter[_0xee40('0x37')](),controller[_0xee40('0x38')]);router[_0xee40('0x1e')](_0xee40('0x16'),auth[_0xee40('0x7')](),controller[_0xee40('0x39')]);router['post']('/:id/applications',auth[_0xee40('0x7')](),controller['addApplications']);router[_0xee40('0x1e')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xee40('0x3a')]);router['post'](_0xee40('0x3b'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xee40('0x3c'),auth[_0xee40('0x7')](),controller['update']);router[_0xee40('0x3d')]('/:id',auth[_0xee40('0x7')](),controller[_0xee40('0x3e')]);router[_0xee40('0x3d')](_0xee40('0xc'),auth['isAuthenticated'](),controller[_0xee40('0x3f')]);router[_0xee40('0x3d')](_0xee40('0xe'),auth[_0xee40('0x7')](),controller[_0xee40('0x40')]);router[_0xee40('0x3d')](_0xee40('0x3b'),auth[_0xee40('0x7')](),controller[_0xee40('0x41')]);module[_0xee40('0x42')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 4ce662f..dc288b1 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 _0x37dd=['Router','env','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment'];(function(_0x3dd567,_0x276ca9){var _0x415024=function(_0x3ae159){while(--_0x3ae159){_0x3dd567['push'](_0x3dd567['shift']());}};_0x415024(++_0x276ca9);}(_0x37dd,0x1c0));var _0xd37d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37dd[_0x3dd15e];return _0x231fd0;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd37d('0x0'));var auth=require(_0xd37d('0x1'));var config=require(_0xd37d('0x2'));var router=express[_0xd37d('0x3')]();var isProduction=config[_0xd37d('0x4')]==='production'||![];function clientSideLogs(_0x2cc0d2,_0x3b2b7c,_0xcc5874){var _0x4f24a1=_0x2cc0d2['app']['get']('client-side-logger');if(!_0x4f24a1){throw new Error(_0xd37d('0x5'));}return beaverLogger[_0xd37d('0x6')]({'uri':_0xd37d('0x7'),'logger':_0x4f24a1,'enableCors':!isProduction})(_0x2cc0d2,_0x3b2b7c,_0xcc5874);}router[_0xd37d('0x8')](auth[_0xd37d('0x9')](),clientSideLogs);module[_0xd37d('0xa')]=router;
\ No newline at end of file
+var _0x4b9a=['express','../components/auth/service','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports'];(function(_0x2343d2,_0x6628bc){var _0x28a66e=function(_0x46beae){while(--_0x46beae){_0x2343d2['push'](_0x2343d2['shift']());}};_0x28a66e(++_0x6628bc);}(_0x4b9a,0x168));var _0xa4b9=function(_0x4b862d,_0x13b157){_0x4b862d=_0x4b862d-0x0;var _0x5e009d=_0x4b9a[_0x4b862d];return _0x5e009d;};var beaverLogger=require('beaver-logger/server');var express=require(_0xa4b9('0x0'));var auth=require(_0xa4b9('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']===_0xa4b9('0x2')||![];function clientSideLogs(_0xbcd6a4,_0x516859,_0x1edf4a){var _0x3b6a02=_0xbcd6a4[_0xa4b9('0x3')]['get'](_0xa4b9('0x4'));if(!_0x3b6a02){throw new Error(_0xa4b9('0x5'));}return beaverLogger[_0xa4b9('0x6')]({'uri':'/client-logs','logger':_0x3b6a02,'enableCors':!isProduction})(_0xbcd6a4,_0x516859,_0x1edf4a);}router[_0xa4b9('0x7')](auth[_0xa4b9('0x8')](),clientSideLogs);module[_0xa4b9('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 04e334d..9027451 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 _0xc338=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x3b2eab,_0xb81b6){var _0x14ba2a=function(_0x59a817){while(--_0x59a817){_0x3b2eab['push'](_0x3b2eab['shift']());}};_0x14ba2a(++_0xb81b6);}(_0xc338,0x16d));var _0x8c33=function(_0x326241,_0x5120b4){_0x326241=_0x326241-0x0;var _0x4b05a=_0xc338[_0x326241];return _0x4b05a;};'use strict';var Sequelize=require(_0x8c33('0x0'));module[_0x8c33('0x1')]={'name':{'type':Sequelize[_0x8c33('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8c33('0x3')]('AmazonAWS',_0x8c33('0x4'),_0x8c33('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8c33('0x3')](_0x8c33('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x8c33('0x2')],'comment':_0x8c33('0x7')},'data2':{'type':Sequelize[_0x8c33('0x2')],'comment':_0x8c33('0x8')},'data3':{'type':Sequelize[_0x8c33('0x2')],'comment':_0x8c33('0x9')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x8c33('0xa')],'comment':_0x8c33('0xb')},'data6':{'type':Sequelize[_0x8c33('0xa')],'comment':_0x8c33('0xc')},'data7':{'type':Sequelize[_0x8c33('0xa')],'comment':_0x8c33('0xd')}};
\ No newline at end of file
+var _0xac9e=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xac9e,0x1e6));var _0xeac9=function(_0x593111,_0x539f7d){_0x593111=_0x593111-0x0;var _0x3a7a1f=_0xac9e[_0x593111];return _0x3a7a1f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeac9('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xeac9('0x1')](_0xeac9('0x2'),'Google',_0xeac9('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xeac9('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0xeac9('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xeac9('0x0')],'comment':_0xeac9('0x5')},'data3':{'type':Sequelize['STRING'],'comment':_0xeac9('0x6')},'data4':{'type':Sequelize[_0xeac9('0x0')],'comment':_0xeac9('0x7')},'data5':{'type':Sequelize[_0xeac9('0x8')],'comment':_0xeac9('0x9')},'data6':{'type':Sequelize[_0xeac9('0x8')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0xeac9('0xa')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 09ef5e3..7e8e1db 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 _0x9bdc=['nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','find','Name\x20parameter\x20not\x20specified','values','includes','body','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../config/environment','api','defaults','redis','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','name','send','padEnd','index','CloudProvider','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x18fbcc,_0x1ec91a){var _0x50c414=function(_0x2b44e4){while(--_0x2b44e4){_0x18fbcc['push'](_0x18fbcc['shift']());}};_0x50c414(++_0x1ec91a);}(_0x9bdc,0xe7));var _0xc9bd=function(_0xb94436,_0x4e3089){_0xb94436=_0xb94436-0x0;var _0x3c7dee=_0x9bdc[_0xb94436];return _0x3c7dee;};'use strict';var _=require('lodash');var Redis=require(_0xc9bd('0x0'));var qs=require(_0xc9bd('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xc9bd('0x2'));var logger=require('../../config/logger')(_0xc9bd('0x3'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xc9bd('0x4')](config[_0xc9bd('0x5')],{'host':_0xc9bd('0x6'),'port':0x18eb});var socket=require(_0xc9bd('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xc9bd('0x5')]);function respondWithStatusCode(_0x255338,_0x2d539e){_0x2d539e=_0x2d539e||0xcc;return function(_0x13a37f){if(_0x13a37f){return _0x255338['sendStatus'](_0x2d539e);}return _0x255338['status'](_0x2d539e)[_0xc9bd('0x8')]();};}function respondWithResult(_0x114d63,_0x22bf1d){_0x22bf1d=_0x22bf1d||0xc8;return function(_0xfcc61d){if(_0xfcc61d){return _0x114d63[_0xc9bd('0x9')](_0x22bf1d)[_0xc9bd('0xa')](_0xfcc61d);}};}function respondWithFilteredResult(_0x24b5ff,_0x30976e){return function(_0x5e6dcb){if(_0x5e6dcb){var _0x50864a=typeof _0x30976e[_0xc9bd('0xb')]===_0xc9bd('0xc')&&typeof _0x30976e[_0xc9bd('0xd')]===_0xc9bd('0xc');var _0x54731a=_0x5e6dcb[_0xc9bd('0xe')];var _0x131192=_0x50864a?0x0:_0x30976e['offset'];var _0xb0ded1=_0x50864a?_0x5e6dcb[_0xc9bd('0xe')]:_0x30976e[_0xc9bd('0xb')]+_0x30976e[_0xc9bd('0xd')];var _0x3a24c3;if(_0xb0ded1>=_0x54731a){_0xb0ded1=_0x54731a;_0x3a24c3=0xc8;}else{_0x3a24c3=0xce;}_0x24b5ff[_0xc9bd('0x9')](_0x3a24c3);return _0x24b5ff[_0xc9bd('0xf')](_0xc9bd('0x10'),_0x131192+'-'+_0xb0ded1+'/'+_0x54731a)[_0xc9bd('0xa')](_0x5e6dcb);}return null;};}function saveUpdates(_0x3d5728){return function(_0x146933){if(_0x146933){return _0x146933['update'](_0x3d5728)['then'](function(_0x211e28){return _0x211e28;});}return null;};}function removeEntity(_0x1b2429){return function(_0x2249d3){if(_0x2249d3){return _0x2249d3['destroy']()[_0xc9bd('0x11')](function(){_0x1b2429[_0xc9bd('0x9')](0xcc)[_0xc9bd('0x8')]();});}};}function handleEntityNotFound(_0xbb731){return function(_0x4697cd){if(!_0x4697cd){_0xbb731[_0xc9bd('0x12')](0x194);}return _0x4697cd;};}function handleError(_0x25f06a,_0x27e60d){_0x27e60d=_0x27e60d||0x1f4;return function(_0x9a35ba){logger[_0xc9bd('0x13')](_0x9a35ba['stack']);if(_0x9a35ba[_0xc9bd('0x14')]){delete _0x9a35ba[_0xc9bd('0x14')];}_0x25f06a['status'](_0x27e60d)[_0xc9bd('0x15')](_0x9a35ba);};}function maskClientSecret(_0x29f2be){return _[_0xc9bd('0x16')](_0x29f2be['slice'](0x0,0x3),0x14,'*');}exports[_0xc9bd('0x17')]=function(_0x8e02da,_0x419e90){var _0x335241={},_0x26283b={},_0x20c914={'count':0x0,'rows':[]};var _0x172a66=_['map'](db[_0xc9bd('0x18')][_0xc9bd('0x19')],function(_0xb14e60){return{'name':_0xb14e60[_0xc9bd('0x1a')],'type':_0xb14e60['type']['key']};});_0x26283b['model']=_[_0xc9bd('0x1b')](_0x172a66,'name');_0x26283b['query']=_['keys'](_0x8e02da[_0xc9bd('0x1c')]);_0x26283b[_0xc9bd('0x1d')]=_[_0xc9bd('0x1e')](_0x26283b[_0xc9bd('0x1f')],_0x26283b[_0xc9bd('0x1c')]);_0x335241[_0xc9bd('0x20')]=_[_0xc9bd('0x1e')](_0x26283b[_0xc9bd('0x1f')],qs[_0xc9bd('0x21')](_0x8e02da[_0xc9bd('0x1c')][_0xc9bd('0x21')]));_0x335241['attributes']=_0x335241[_0xc9bd('0x20')][_0xc9bd('0x22')]?_0x335241[_0xc9bd('0x20')]:_0x26283b[_0xc9bd('0x1f')];if(!_0x8e02da['query'][_0xc9bd('0x23')](_0xc9bd('0x24'))){_0x335241['limit']=qs[_0xc9bd('0xd')](_0x8e02da[_0xc9bd('0x1c')]['limit']);_0x335241[_0xc9bd('0xb')]=qs[_0xc9bd('0xb')](_0x8e02da[_0xc9bd('0x1c')][_0xc9bd('0xb')]);}_0x335241[_0xc9bd('0x25')]=qs[_0xc9bd('0x26')](_0x8e02da['query'][_0xc9bd('0x26')]);_0x335241['where']=qs[_0xc9bd('0x1d')](_['pick'](_0x8e02da['query'],_0x26283b[_0xc9bd('0x1d')]),_0x172a66);if(_0x8e02da['query'][_0xc9bd('0x27')]){_0x335241['where']=_[_0xc9bd('0x28')](_0x335241[_0xc9bd('0x29')],{'$or':_['map'](_0x172a66,function(_0x2a0775){if(_0x2a0775['type']!==_0xc9bd('0x2a')){var _0x2aaa59={};_0x2aaa59[_0x2a0775[_0xc9bd('0x14')]]={'$like':'%'+_0x8e02da[_0xc9bd('0x1c')][_0xc9bd('0x27')]+'%'};return _0x2aaa59;}})});}_0x335241=_['merge']({},_0x335241,_0x8e02da[_0xc9bd('0x2b')]);var _0x2bb8c1={'where':_0x335241[_0xc9bd('0x29')]};return db[_0xc9bd('0x18')][_0xc9bd('0xe')](_0x2bb8c1)['then'](function(_0x2ab679){_0x20c914[_0xc9bd('0xe')]=_0x2ab679;if(_0x8e02da[_0xc9bd('0x1c')][_0xc9bd('0x2c')]){_0x335241[_0xc9bd('0x2d')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x335241);})[_0xc9bd('0x11')](function(_0x59e374){_0x20c914['rows']=_[_0xc9bd('0x1b')](_0x59e374,function(_0x5dc530){if(_0x5dc530[_0xc9bd('0x2e')]===_0xc9bd('0x2f')){var _0x1de56a=encryptor[_0xc9bd('0x30')](_0x5dc530[_0xc9bd('0x31')]);_0x5dc530[_0xc9bd('0x31')]=maskClientSecret(_0x1de56a);}return _0x5dc530;});return _0x20c914;})['then'](respondWithFilteredResult(_0x419e90,_0x335241))[_0xc9bd('0x32')](handleError(_0x419e90,null));};exports[_0xc9bd('0x33')]=function(_0x43a038,_0x109c70){var _0x39ec78={'raw':!![],'where':{'id':_0x43a038[_0xc9bd('0x34')]['id']}},_0x382531={};_0x382531[_0xc9bd('0x1f')]=_[_0xc9bd('0x35')](db[_0xc9bd('0x18')]['rawAttributes']);_0x382531[_0xc9bd('0x1c')]=_[_0xc9bd('0x35')](_0x43a038[_0xc9bd('0x1c')]);_0x382531[_0xc9bd('0x1d')]=_[_0xc9bd('0x1e')](_0x382531[_0xc9bd('0x1f')],_0x382531[_0xc9bd('0x1c')]);_0x39ec78['attributes']=_[_0xc9bd('0x1e')](_0x382531[_0xc9bd('0x1f')],qs['fields'](_0x43a038[_0xc9bd('0x1c')][_0xc9bd('0x21')]));_0x39ec78[_0xc9bd('0x20')]=_0x39ec78['attributes'][_0xc9bd('0x22')]?_0x39ec78[_0xc9bd('0x20')]:_0x382531[_0xc9bd('0x1f')];if(_0x43a038['query'][_0xc9bd('0x2c')]){_0x39ec78['include']=[{'all':!![]}];}_0x39ec78=_['merge']({},_0x39ec78,_0x43a038[_0xc9bd('0x2b')]);return db[_0xc9bd('0x18')][_0xc9bd('0x36')](_0x39ec78)[_0xc9bd('0x11')](handleEntityNotFound(_0x109c70,null))[_0xc9bd('0x11')](function(_0x199229){if(_0x199229[_0xc9bd('0x2e')]===_0xc9bd('0x2f')){var _0x1a4f69=encryptor[_0xc9bd('0x30')](_0x199229['data3']);_0x199229[_0xc9bd('0x31')]=maskClientSecret(_0x1a4f69);}return _0x199229;})[_0xc9bd('0x11')](respondWithResult(_0x109c70,null))[_0xc9bd('0x32')](handleError(_0x109c70,null));};exports['create']=function(_0x1385e8,_0x350ac6){if(!_0x1385e8['body']['name'])throw new Error(_0xc9bd('0x37'));if(!_0x1385e8['body'][_0xc9bd('0x2e')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3100fc=db[_0xc9bd('0x18')][_0xc9bd('0x19')][_0xc9bd('0x2e')][_0xc9bd('0x38')];if(!_0x3100fc[_0xc9bd('0x39')](_0x1385e8[_0xc9bd('0x3a')][_0xc9bd('0x2e')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3100fc[_0xc9bd('0x3b')](',\x20'));if(_0x1385e8[_0xc9bd('0x3a')][_0xc9bd('0x2e')]==='MicrosoftAzure'&&_0x1385e8['body'][_0xc9bd('0x31')]){_0x1385e8[_0xc9bd('0x3a')][_0xc9bd('0x31')]=encryptor[_0xc9bd('0x3c')](_0x1385e8[_0xc9bd('0x3a')][_0xc9bd('0x31')]);}return db[_0xc9bd('0x18')]['create'](_0x1385e8['body'],{})['then'](respondWithResult(_0x350ac6,0xc9))[_0xc9bd('0x32')](handleError(_0x350ac6,null));};exports[_0xc9bd('0x3d')]=function(_0x4e8b7e,_0x102f98){if(_0x4e8b7e[_0xc9bd('0x3a')]['id']){delete _0x4e8b7e[_0xc9bd('0x3a')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x4e8b7e[_0xc9bd('0x34')]['id']}})[_0xc9bd('0x11')](handleEntityNotFound(_0x102f98,null))[_0xc9bd('0x11')](function(_0x5aca7f){if(_0x5aca7f[_0xc9bd('0x2e')]==='MicrosoftAzure'&&_0x4e8b7e[_0xc9bd('0x3a')][_0xc9bd('0x31')]){_0x4e8b7e[_0xc9bd('0x3a')][_0xc9bd('0x31')]=encryptor[_0xc9bd('0x3c')](_0x4e8b7e[_0xc9bd('0x3a')][_0xc9bd('0x31')]);}return _0x5aca7f;})['then'](saveUpdates(_0x4e8b7e[_0xc9bd('0x3a')],null))['then'](respondWithResult(_0x102f98,null))['catch'](handleError(_0x102f98,null));};exports[_0xc9bd('0x3e')]=function(_0x4c84d6,_0x3e793e){return db[_0xc9bd('0x18')][_0xc9bd('0x36')]({'where':{'id':_0x4c84d6[_0xc9bd('0x34')]['id']}})[_0xc9bd('0x11')](handleEntityNotFound(_0x3e793e,null))[_0xc9bd('0x11')](removeEntity(_0x3e793e,null))[_0xc9bd('0x32')](handleError(_0x3e793e,null));};exports[_0xc9bd('0x3f')]=function(_0x359608,_0x544de6){return db[_0xc9bd('0x18')][_0xc9bd('0x40')]({'where':{'id':_0x359608[_0xc9bd('0x34')]['id']},'raw':!![]})['then'](function(_0xbf4550){if(!_0xbf4550)return _0x544de6['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0xbf4550,_0x359608['user']['id'])};})['then'](respondWithResult(_0x544de6,null))[_0xc9bd('0x32')](handleError(_0x544de6,null));};exports[_0xc9bd('0x41')]=function(_0x4c368a,_0x17ea3d){var _0x2eb855=_0x4c368a['body'];var _0x375b3f;var _0x538a0f;if(_0x2eb855['error'])throw _0x2eb855;redis['get'](_0x2eb855[_0xc9bd('0x42')])['then'](function(_0x1fe63b){if(!_0x1fe63b)throw new Error(_0xc9bd('0x43'));_0x375b3f=JSON['parse'](_0x1fe63b);var _0x507af8=Buffer[_0xc9bd('0x44')](_0x2eb855[_0xc9bd('0x42')],_0xc9bd('0x45'))[_0xc9bd('0x46')](_0xc9bd('0x47'));_0x538a0f=JSON[_0xc9bd('0x48')](_0x507af8);if(!oauth[_0xc9bd('0x49')](_0x2eb855[_0xc9bd('0x4a')],_0x375b3f[_0xc9bd('0x4b')]))throw new Error(_0xc9bd('0x4c'));redis[_0xc9bd('0x4d')](_0x2eb855[_0xc9bd('0x42')]);return oauth['getOauth2MicrosoftAccessToken'](_0x2eb855[_0xc9bd('0x4e')],_0x375b3f);})[_0xc9bd('0x11')](function(_0x1e0aa1){_0x375b3f[_0xc9bd('0x4f')]=_0x1e0aa1[_0xc9bd('0x50')];_0x375b3f[_0xc9bd('0x51')]=_0x1e0aa1[_0xc9bd('0x52')];return db[_0xc9bd('0x18')][_0xc9bd('0x3d')]({'data5':_0x375b3f[_0xc9bd('0x4f')],'data6':_0x375b3f[_0xc9bd('0x51')]},{'where':{'id':_0x375b3f['id']}});})[_0xc9bd('0x11')](function(){oauth[_0xc9bd('0x53')](_0x375b3f);socket[_0xc9bd('0x54')](_0xc9bd('0x55'),{'id':_0x538a0f['id']});return;})[_0xc9bd('0x11')](respondWithStatusCode(_0x17ea3d,null))[_0xc9bd('0x32')](function(_0x557abf){if(_0x538a0f){socket[_0xc9bd('0x54')]('microsoftAuthorization:error',{'id':_0x538a0f['id']});}if(!_0x375b3f){logger[_0xc9bd('0x13')](_0xc9bd('0x56'),_0x557abf);return _0x17ea3d[_0xc9bd('0x9')](0x1f4)[_0xc9bd('0x15')](_0x557abf[_0xc9bd('0x57')]);}logger[_0xc9bd('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x375b3f['id'],JSON[_0xc9bd('0x58')](_0x557abf));});};
\ No newline at end of file
+var _0x722a=['query','keys','filters','model','attributes','intersection','fields','length','sort','where','filter','merge','name','includeAll','rows','MicrosoftAzure','decryptString','data3','catch','params','options','find','service','create','Name\x20parameter\x20not\x20specified','body','values','join','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x722a,0x135));var _0xa722=function(_0x431ad5,_0x38de4b){_0x431ad5=_0x431ad5-0x0;var _0x2fad1a=_0x722a[_0x431ad5];return _0x2fad1a;};'use strict';var _=require(_0xa722('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xa722('0x1'))(_0xa722('0x2'));var db=require(_0xa722('0x3'))['db'];var oauth=require(_0xa722('0x4'));config[_0xa722('0x5')]=_[_0xa722('0x6')](config[_0xa722('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xa722('0x7'))(new Redis(config[_0xa722('0x5')]));var redis=new Redis(config[_0xa722('0x5')]);function respondWithStatusCode(_0x484453,_0x4f088b){_0x4f088b=_0x4f088b||0xcc;return function(_0x11daac){if(_0x11daac){return _0x484453[_0xa722('0x8')](_0x4f088b);}return _0x484453[_0xa722('0x9')](_0x4f088b)['end']();};}function respondWithResult(_0x2b33d1,_0x111e3d){_0x111e3d=_0x111e3d||0xc8;return function(_0x51b3d5){if(_0x51b3d5){return _0x2b33d1[_0xa722('0x9')](_0x111e3d)[_0xa722('0xa')](_0x51b3d5);}};}function respondWithFilteredResult(_0x267e3e,_0x51a71e){return function(_0x8dae81){if(_0x8dae81){var _0x18e3da=typeof _0x51a71e[_0xa722('0xb')]===_0xa722('0xc')&&typeof _0x51a71e['limit']===_0xa722('0xc');var _0x41a293=_0x8dae81[_0xa722('0xd')];var _0x81a3e1=_0x18e3da?0x0:_0x51a71e[_0xa722('0xb')];var _0x1d1889=_0x18e3da?_0x8dae81[_0xa722('0xd')]:_0x51a71e[_0xa722('0xb')]+_0x51a71e[_0xa722('0xe')];var _0x5422c6;if(_0x1d1889>=_0x41a293){_0x1d1889=_0x41a293;_0x5422c6=0xc8;}else{_0x5422c6=0xce;}_0x267e3e[_0xa722('0x9')](_0x5422c6);return _0x267e3e[_0xa722('0xf')](_0xa722('0x10'),_0x81a3e1+'-'+_0x1d1889+'/'+_0x41a293)[_0xa722('0xa')](_0x8dae81);}return null;};}function saveUpdates(_0xd37df6){return function(_0x383111){if(_0x383111){return _0x383111[_0xa722('0x11')](_0xd37df6)[_0xa722('0x12')](function(_0x376e57){return _0x376e57;});}return null;};}function removeEntity(_0x2df8d4){return function(_0x32c3f2){if(_0x32c3f2){return _0x32c3f2[_0xa722('0x13')]()[_0xa722('0x12')](function(){_0x2df8d4[_0xa722('0x9')](0xcc)[_0xa722('0x14')]();});}};}function handleEntityNotFound(_0x100d2f){return function(_0x675eb5){if(!_0x675eb5){_0x100d2f[_0xa722('0x8')](0x194);}return _0x675eb5;};}function handleError(_0x2d2c13,_0x40643c){_0x40643c=_0x40643c||0x1f4;return function(_0x3d8366){logger[_0xa722('0x15')](_0x3d8366[_0xa722('0x16')]);if(_0x3d8366['name']){delete _0x3d8366['name'];}_0x2d2c13[_0xa722('0x9')](_0x40643c)[_0xa722('0x17')](_0x3d8366);};}function maskClientSecret(_0xedb807){return _['padEnd'](_0xedb807[_0xa722('0x18')](0x0,0x3),0x14,'*');}exports[_0xa722('0x19')]=function(_0x5ee8ce,_0x4a8c27){var _0x2577a2={},_0x2309a9={},_0x1df111={'count':0x0,'rows':[]};var _0x8f17c6=_[_0xa722('0x1a')](db[_0xa722('0x1b')][_0xa722('0x1c')],function(_0x2501a9){return{'name':_0x2501a9[_0xa722('0x1d')],'type':_0x2501a9[_0xa722('0x1e')]['key']};});_0x2309a9['model']=_['map'](_0x8f17c6,'name');_0x2309a9[_0xa722('0x1f')]=_[_0xa722('0x20')](_0x5ee8ce[_0xa722('0x1f')]);_0x2309a9[_0xa722('0x21')]=_['intersection'](_0x2309a9[_0xa722('0x22')],_0x2309a9[_0xa722('0x1f')]);_0x2577a2[_0xa722('0x23')]=_[_0xa722('0x24')](_0x2309a9[_0xa722('0x22')],qs[_0xa722('0x25')](_0x5ee8ce[_0xa722('0x1f')][_0xa722('0x25')]));_0x2577a2[_0xa722('0x23')]=_0x2577a2[_0xa722('0x23')][_0xa722('0x26')]?_0x2577a2['attributes']:_0x2309a9[_0xa722('0x22')];if(!_0x5ee8ce[_0xa722('0x1f')]['hasOwnProperty']('nolimit')){_0x2577a2[_0xa722('0xe')]=qs['limit'](_0x5ee8ce[_0xa722('0x1f')][_0xa722('0xe')]);_0x2577a2['offset']=qs[_0xa722('0xb')](_0x5ee8ce[_0xa722('0x1f')]['offset']);}_0x2577a2['order']=qs['sort'](_0x5ee8ce[_0xa722('0x1f')][_0xa722('0x27')]);_0x2577a2[_0xa722('0x28')]=qs['filters'](_['pick'](_0x5ee8ce[_0xa722('0x1f')],_0x2309a9[_0xa722('0x21')]),_0x8f17c6);if(_0x5ee8ce['query'][_0xa722('0x29')]){_0x2577a2[_0xa722('0x28')]=_[_0xa722('0x2a')](_0x2577a2[_0xa722('0x28')],{'$or':_[_0xa722('0x1a')](_0x8f17c6,function(_0xadc720){if(_0xadc720[_0xa722('0x1e')]!=='VIRTUAL'){var _0x4349c9={};_0x4349c9[_0xadc720[_0xa722('0x2b')]]={'$like':'%'+_0x5ee8ce[_0xa722('0x1f')][_0xa722('0x29')]+'%'};return _0x4349c9;}})});}_0x2577a2=_[_0xa722('0x2a')]({},_0x2577a2,_0x5ee8ce['options']);var _0xbc1be={'where':_0x2577a2['where']};return db[_0xa722('0x1b')][_0xa722('0xd')](_0xbc1be)[_0xa722('0x12')](function(_0x276218){_0x1df111[_0xa722('0xd')]=_0x276218;if(_0x5ee8ce[_0xa722('0x1f')][_0xa722('0x2c')]){_0x2577a2['include']=[{'all':!![]}];}return db[_0xa722('0x1b')]['findAll'](_0x2577a2);})['then'](function(_0x5aceb7){_0x1df111[_0xa722('0x2d')]=_['map'](_0x5aceb7,function(_0x372b89){if(_0x372b89['service']===_0xa722('0x2e')){var _0x2a58bd=encryptor[_0xa722('0x2f')](_0x372b89[_0xa722('0x30')]);_0x372b89[_0xa722('0x30')]=maskClientSecret(_0x2a58bd);}return _0x372b89;});return _0x1df111;})['then'](respondWithFilteredResult(_0x4a8c27,_0x2577a2))[_0xa722('0x31')](handleError(_0x4a8c27,null));};exports['show']=function(_0x58e3d3,_0x5d2129){var _0x5b2fa8={'raw':!![],'where':{'id':_0x58e3d3[_0xa722('0x32')]['id']}},_0x1906cf={};_0x1906cf['model']=_[_0xa722('0x20')](db[_0xa722('0x1b')][_0xa722('0x1c')]);_0x1906cf[_0xa722('0x1f')]=_[_0xa722('0x20')](_0x58e3d3[_0xa722('0x1f')]);_0x1906cf[_0xa722('0x21')]=_[_0xa722('0x24')](_0x1906cf[_0xa722('0x22')],_0x1906cf['query']);_0x5b2fa8[_0xa722('0x23')]=_[_0xa722('0x24')](_0x1906cf['model'],qs[_0xa722('0x25')](_0x58e3d3['query'][_0xa722('0x25')]));_0x5b2fa8['attributes']=_0x5b2fa8[_0xa722('0x23')][_0xa722('0x26')]?_0x5b2fa8['attributes']:_0x1906cf[_0xa722('0x22')];if(_0x58e3d3[_0xa722('0x1f')][_0xa722('0x2c')]){_0x5b2fa8['include']=[{'all':!![]}];}_0x5b2fa8=_[_0xa722('0x2a')]({},_0x5b2fa8,_0x58e3d3[_0xa722('0x33')]);return db[_0xa722('0x1b')][_0xa722('0x34')](_0x5b2fa8)[_0xa722('0x12')](handleEntityNotFound(_0x5d2129,null))[_0xa722('0x12')](function(_0x23d56f){if(_0x23d56f[_0xa722('0x35')]==='MicrosoftAzure'){var _0x1ca56f=encryptor[_0xa722('0x2f')](_0x23d56f[_0xa722('0x30')]);_0x23d56f[_0xa722('0x30')]=maskClientSecret(_0x1ca56f);}return _0x23d56f;})['then'](respondWithResult(_0x5d2129,null))[_0xa722('0x31')](handleError(_0x5d2129,null));};exports[_0xa722('0x36')]=function(_0x7af41a,_0x127ac1){if(!_0x7af41a['body'][_0xa722('0x2b')])throw new Error(_0xa722('0x37'));if(!_0x7af41a[_0xa722('0x38')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4b9c0b=db[_0xa722('0x1b')][_0xa722('0x1c')][_0xa722('0x35')][_0xa722('0x39')];if(!_0x4b9c0b['includes'](_0x7af41a[_0xa722('0x38')][_0xa722('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x4b9c0b[_0xa722('0x3a')](',\x20'));if(_0x7af41a[_0xa722('0x38')][_0xa722('0x35')]===_0xa722('0x2e')&&_0x7af41a['body'][_0xa722('0x30')]){_0x7af41a[_0xa722('0x38')][_0xa722('0x30')]=encryptor['encryptString'](_0x7af41a['body'][_0xa722('0x30')]);}return db[_0xa722('0x1b')][_0xa722('0x36')](_0x7af41a[_0xa722('0x38')],{})['then'](respondWithResult(_0x127ac1,0xc9))[_0xa722('0x31')](handleError(_0x127ac1,null));};exports[_0xa722('0x11')]=function(_0x11fadd,_0x2f5dce){if(_0x11fadd[_0xa722('0x38')]['id']){delete _0x11fadd[_0xa722('0x38')]['id'];}return db[_0xa722('0x1b')]['find']({'where':{'id':_0x11fadd['params']['id']}})[_0xa722('0x12')](handleEntityNotFound(_0x2f5dce,null))['then'](function(_0x5bda3e){if(_0x5bda3e[_0xa722('0x35')]===_0xa722('0x2e')&&_0x11fadd[_0xa722('0x38')][_0xa722('0x30')]){_0x11fadd[_0xa722('0x38')][_0xa722('0x30')]=encryptor['encryptString'](_0x11fadd['body']['data3']);}return _0x5bda3e;})[_0xa722('0x12')](saveUpdates(_0x11fadd['body'],null))[_0xa722('0x12')](respondWithResult(_0x2f5dce,null))[_0xa722('0x31')](handleError(_0x2f5dce,null));};exports[_0xa722('0x13')]=function(_0x581ad6,_0x2259e1){return db[_0xa722('0x1b')][_0xa722('0x34')]({'where':{'id':_0x581ad6[_0xa722('0x32')]['id']}})[_0xa722('0x12')](handleEntityNotFound(_0x2259e1,null))[_0xa722('0x12')](removeEntity(_0x2259e1,null))[_0xa722('0x31')](handleError(_0x2259e1,null));};exports[_0xa722('0x3b')]=function(_0x14ef14,_0x3c1442){return db[_0xa722('0x1b')][_0xa722('0x3c')]({'where':{'id':_0x14ef14['params']['id']},'raw':!![]})['then'](function(_0x4aacbe){if(!_0x4aacbe)return _0x3c1442[_0xa722('0x8')](0x194);return{'url':oauth[_0xa722('0x3d')](_0x4aacbe,_0x14ef14['user']['id'])};})['then'](respondWithResult(_0x3c1442,null))[_0xa722('0x31')](handleError(_0x3c1442,null));};exports[_0xa722('0x3e')]=function(_0x70b871,_0x1f620c){var _0x159555=_0x70b871[_0xa722('0x38')];var _0x4be7ef;var _0x129a9c;if(_0x159555[_0xa722('0x15')])throw _0x159555;redis[_0xa722('0x3f')](_0x159555[_0xa722('0x40')])[_0xa722('0x12')](function(_0x5961a2){if(!_0x5961a2)throw new Error(_0xa722('0x41'));_0x4be7ef=JSON[_0xa722('0x42')](_0x5961a2);var _0x49df3c=Buffer['from'](_0x159555[_0xa722('0x40')],_0xa722('0x43'))[_0xa722('0x44')](_0xa722('0x45'));_0x129a9c=JSON[_0xa722('0x42')](_0x49df3c);if(!oauth['isValidIdToken'](_0x159555[_0xa722('0x46')],_0x4be7ef[_0xa722('0x47')]))throw new Error(_0xa722('0x48'));redis[_0xa722('0x49')](_0x159555[_0xa722('0x40')]);return oauth[_0xa722('0x4a')](_0x159555[_0xa722('0x4b')],_0x4be7ef);})[_0xa722('0x12')](function(_0x22407a){_0x4be7ef[_0xa722('0x4c')]=_0x22407a[_0xa722('0x4d')];_0x4be7ef[_0xa722('0x4e')]=_0x22407a[_0xa722('0x4f')];return db[_0xa722('0x1b')]['update']({'data5':_0x4be7ef[_0xa722('0x4c')],'data6':_0x4be7ef[_0xa722('0x4e')]},{'where':{'id':_0x4be7ef['id']}});})[_0xa722('0x12')](function(){oauth[_0xa722('0x50')](_0x4be7ef);socket[_0xa722('0x51')]('microsoftAuthorization:success',{'id':_0x129a9c['id']});return;})[_0xa722('0x12')](respondWithStatusCode(_0x1f620c,null))[_0xa722('0x31')](function(_0x1e96d7){if(_0x129a9c){socket[_0xa722('0x51')](_0xa722('0x52'),{'id':_0x129a9c['id']});}if(!_0x4be7ef){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x1e96d7);return _0x1f620c[_0xa722('0x9')](0x1f4)[_0xa722('0x17')](_0x1e96d7['message']);}logger[_0xa722('0x15')](_0xa722('0x53'),_0x4be7ef['id'],JSON[_0xa722('0x54')](_0x1e96d7));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 4bf332f..84e4e7a 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 _0x47ee=['path','rimraf','../../config/environment','exports','define','cloud_providers','lodash','util','api','moment','request-promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x47ee,0x74));var _0xe47e=function(_0xbb3aa6,_0x5549d3){_0xbb3aa6=_0xbb3aa6-0x0;var _0x21038a=_0x47ee[_0xbb3aa6];return _0x21038a;};'use strict';var _=require(_0xe47e('0x0'));var util=require(_0xe47e('0x1'));var logger=require('../../config/logger')(_0xe47e('0x2'));var moment=require(_0xe47e('0x3'));var BPromise=require('bluebird');var rp=require(_0xe47e('0x4'));var fs=require('fs');var path=require(_0xe47e('0x5'));var rimraf=require(_0xe47e('0x6'));var config=require(_0xe47e('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xe47e('0x8')]=function(_0x51631a,_0x2c854b){return _0x51631a[_0xe47e('0x9')]('CloudProvider',attributes,{'tableName':_0xe47e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf54=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','util'];(function(_0x52a619,_0x35bf3e){var _0x2a78d5=function(_0xe884f0){while(--_0xe884f0){_0x52a619['push'](_0x52a619['shift']());}};_0x2a78d5(++_0x35bf3e);}(_0xbf54,0x1a3));var _0x4bf5=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xbf54[_0x99868f];return _0x27a71b;};'use strict';var _=require('lodash');var util=require(_0x4bf5('0x0'));var logger=require(_0x4bf5('0x1'))('api');var moment=require(_0x4bf5('0x2'));var BPromise=require(_0x4bf5('0x3'));var rp=require(_0x4bf5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4bf5('0x5'));var config=require(_0x4bf5('0x6'));var attributes=require(_0x4bf5('0x7'));module[_0x4bf5('0x8')]=function(_0x3cd75b,_0x43831e){return _0x3cd75b['define'](_0x4bf5('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index c29404a..f9697a1 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 _0xe3dd=['oauth2Claims','oauth2/','decode','payload','aud','audience','nonce','isAfter','unix','resolve','then','CloudProvider','findOne','refresh_token','decryptString','data3','POST','access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','openid','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','id_token','stringify','base64','randomBytes','toString','client_id','data1','join','redirect_uri','data4','form_post','state','prompt','login','key','value'];(function(_0x2b5b63,_0x4cb9e9){var _0x1591b3=function(_0x126d92){while(--_0x126d92){_0x2b5b63['push'](_0x2b5b63['shift']());}};_0x1591b3(++_0x4cb9e9);}(_0xe3dd,0x6a));var _0xde3d=function(_0x544ec8,_0x543e34){_0x544ec8=_0x544ec8-0x0;var _0x2b95a7=_0xe3dd[_0x544ec8];return _0x2b95a7;};'use strict';var _=require('lodash');var crypto=require(_0xde3d('0x0'));var jwt=require(_0xde3d('0x1'));var moment=require(_0xde3d('0x2'));var Redis=require(_0xde3d('0x3'));var rp=require(_0xde3d('0x4'));var util=require(_0xde3d('0x5'));var encryptor=require(_0xde3d('0x6'));var config=require('../../config/environment');var logger=require(_0xde3d('0x7'))(_0xde3d('0x8'));var schedule=require(_0xde3d('0x9'));var db=require('../../mysqldb')['db'];config[_0xde3d('0xa')]=_['defaults'](config[_0xde3d('0xa')],{'host':_0xde3d('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xde3d('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xde3d('0xd'),_0xde3d('0xe'),_0xde3d('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xde3d('0x10'),_0xde3d('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xde3d('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xde3d('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x328930){var _0xa04bab=_[_0xde3d('0x13')](AZURE_AUTH_SCOPES[_0x328930[_0xde3d('0x14')]]);if(_0x328930[_0xde3d('0x14')]===_0xde3d('0x15'))_0xa04bab['push'](_0x328930[_0xde3d('0x16')]+_0xde3d('0x17'));return _0xa04bab['join']('\x20');}function getAccessTokenScope(_0x3e2d5c){if(_0x3e2d5c['type']===_0xde3d('0x18'))return _0xde3d('0x19');if(_0x3e2d5c[_0xde3d('0x14')]===_0xde3d('0x15'))return _0x3e2d5c['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4f1e7c,_0x28d996){var _0x2d8c5a=MICROSOFT_AUTH_URL[_0xde3d('0x1a')](_0xde3d('0x1b'),_0x4f1e7c[_0xde3d('0x1c')]);var _0x2de1c6=[_0xde3d('0x1d'),_0xde3d('0x1e')];var _0x587814=Buffer['from'](JSON[_0xde3d('0x1f')]({'id':_0x28d996}))['toString'](_0xde3d('0x20'));var _0x172935=crypto[_0xde3d('0x21')](0x10)[_0xde3d('0x22')]('hex');var _0x393276=getAuthorizationScopes(_0x4f1e7c);var _0x4e0473=[{'key':_0xde3d('0x23'),'value':_0x4f1e7c[_0xde3d('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x2de1c6[_0xde3d('0x25')]('\x20'))},{'key':_0xde3d('0x26'),'value':_0x4f1e7c[_0xde3d('0x27')]},{'key':'response_mode','value':_0xde3d('0x28')},{'key':'scope','value':encodeURIComponent(_0x393276)},{'key':_0xde3d('0x29'),'value':_0x587814},{'key':'nonce','value':_0x172935},{'key':_0xde3d('0x2a'),'value':_0xde3d('0x2b')}];var _0xf1405=_0x2d8c5a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xde3d('0x13')](_0x4e0473,function(_0x47bb46){return _0x47bb46[_0xde3d('0x2c')]+'='+_0x47bb46[_0xde3d('0x2d')];})[_0xde3d('0x25')]('&');_0x4f1e7c[_0xde3d('0x2e')]={'issuer':_0x2d8c5a['replace'](_0xde3d('0x2f'),''),'audience':_0x4f1e7c[_0xde3d('0x24')],'state':_0x587814,'nonce':_0x172935};redis['set'](_0x587814,JSON[_0xde3d('0x1f')](_0x4f1e7c));return _0xf1405;}function isValidIdToken(_0x1e541b,_0x1c972b){try{var _0xcae7b4=jwt[_0xde3d('0x30')](_0x1e541b,{'complete':!![]});var _0x20943e=_0xcae7b4[_0xde3d('0x31')];if(_0x20943e['iss']!==_0x1c972b['issuer'])return![];if(_0x20943e[_0xde3d('0x32')]!==_0x1c972b[_0xde3d('0x33')])return![];if(_0x20943e['nonce']!==_0x1c972b[_0xde3d('0x34')])return![];if(moment()[_0xde3d('0x35')](moment[_0xde3d('0x36')](_0x20943e['exp'])))return![];return!![];}catch(_0x10e01e){throw _0x10e01e;}}function refreshOauth2MicrosoftAccessToken(_0x6b410){return Promise[_0xde3d('0x37')]()[_0xde3d('0x38')](function(){if(_0x6b410['data3'])return _0x6b410;return db[_0xde3d('0x39')][_0xde3d('0x3a')]({'where':{'id':_0x6b410['id']},'raw':!![]});})['then'](function(_0x351341){var _0x34880e={'grant_type':_0xde3d('0x3b'),'refresh_token':_0x351341['data6'],'scope':getAccessTokenScope(_0x351341),'redirect_uri':_0x351341[_0xde3d('0x27')],'client_id':_0x351341[_0xde3d('0x24')],'client_secret':encryptor[_0xde3d('0x3c')](_0x351341[_0xde3d('0x3d')])};var _0x1b561b={'method':_0xde3d('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0xde3d('0x1b'),_0x351341[_0xde3d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x34880e,'json':!![]};return rp(_0x1b561b);})[_0xde3d('0x38')](function(_0x3024b0){_0x6b410['data5']=_0x3024b0[_0xde3d('0x3f')];_0x6b410[_0xde3d('0x40')]=_0x3024b0[_0xde3d('0x3b')];return db[_0xde3d('0x39')][_0xde3d('0x41')]({'data5':_0x6b410[_0xde3d('0x42')],'data6':_0x6b410[_0xde3d('0x40')]},{'where':{'id':_0x6b410['id']}});})['then'](function(){return _0x6b410;})[_0xde3d('0x43')](function(_0xe400ec){logger[_0xde3d('0x44')](_0xde3d('0x45'),_0x6b410['id'],_0xe400ec);});}function getOauth2MicrosoftAccessToken(_0x36e242,_0x6c6227){var _0x367ac9={'grant_type':'authorization_code','code':_0x36e242,'scope':getAccessTokenScope(_0x6c6227),'redirect_uri':_0x6c6227[_0xde3d('0x27')],'client_id':_0x6c6227[_0xde3d('0x24')],'client_secret':encryptor[_0xde3d('0x3c')](_0x6c6227[_0xde3d('0x3d')])};var _0x465d08={'method':_0xde3d('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xde3d('0x1a')]('{TENANT_ID}',_0x6c6227[_0xde3d('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x367ac9,'json':!![]};return rp(_0x465d08);}function startRefreshInterval(_0x2252d8){var _0x547889=schedule[_0xde3d('0x46')];if(_0x547889[_0x2252d8['id']])clearInterval(_0x547889[_0x2252d8['id']]);_0x547889[_0x2252d8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xde3d('0x47')](this,{'id':_0x2252d8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xde3d('0x46')]=_0x547889;}function startAllRefreshIntervals(){return db[_0xde3d('0x39')][_0xde3d('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xde3d('0x38')](function(_0x3b184e){var _0x55ec3b=_0x3b184e['map'](function(_0x479bae){return refreshOauth2MicrosoftAccessToken(_0x479bae)['then'](function(_0x53477e){startRefreshInterval(_0x53477e);});});return Promise[_0xde3d('0x49')](_0x55ec3b);})[_0xde3d('0x43')](function(_0x4b65b0){var _0x4ad6b6=_0x4b65b0?util[_0xde3d('0x4a')](_0x4b65b0,{'showHidden':![],'depth':null}):'';logger[_0xde3d('0x44')](_0xde3d('0x4b'),_0x4ad6b6);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xe9f0=['data1','response_type','form_post','scope','state','login','key','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','nonce','unix','exp','resolve','then','CloudProvider','findOne','data6','decryptString','data3','POST','refresh_token','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','intervals','bind','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','moment','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','hex','client_id'];(function(_0x330a92,_0x18e955){var _0xe1bf98=function(_0xb39f66){while(--_0xb39f66){_0x330a92['push'](_0x330a92['shift']());}};_0xe1bf98(++_0x18e955);}(_0xe9f0,0x71));var _0x0e9f=function(_0x12e7a4,_0x4b2da3){_0x12e7a4=_0x12e7a4-0x0;var _0x1a9701=_0xe9f0[_0x12e7a4];return _0x1a9701;};'use strict';var _=require('lodash');var crypto=require(_0x0e9f('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x0e9f('0x1'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x0e9f('0x2'));var logger=require(_0x0e9f('0x3'))('api');var schedule=require(_0x0e9f('0x4'));var db=require('../../mysqldb')['db'];config[_0x0e9f('0x5')]=_[_0x0e9f('0x6')](config[_0x0e9f('0x5')],{'host':_0x0e9f('0x7'),'port':0x18eb});var redis=new Redis(config[_0x0e9f('0x5')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x0e9f('0x8'),_0x0e9f('0x9'),_0x0e9f('0xa'),_0x0e9f('0xb'),_0x0e9f('0xc'),'https://outlook.office.com/POP.AccessAsUser.All',_0x0e9f('0xd')],'Dynamics365':[_0x0e9f('0x8'),_0x0e9f('0xb')]};var MICROSOFT_AUTH_ENDPOINT=_0x0e9f('0xe');var MICROSOFT_TOKEN_ENDPOINT=_0x0e9f('0xf');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x44f01a){var _0x32017a=_[_0x0e9f('0x10')](AZURE_AUTH_SCOPES[_0x44f01a[_0x0e9f('0x11')]]);if(_0x44f01a['type']===_0x0e9f('0x12'))_0x32017a[_0x0e9f('0x13')](_0x44f01a[_0x0e9f('0x14')]+_0x0e9f('0x15'));return _0x32017a[_0x0e9f('0x16')]('\x20');}function getAccessTokenScope(_0x15cb31){if(_0x15cb31[_0x0e9f('0x11')]===_0x0e9f('0x17'))return _0x0e9f('0xc');if(_0x15cb31['type']===_0x0e9f('0x12'))return _0x15cb31[_0x0e9f('0x14')]+_0x0e9f('0x15');}function generateMicrosoftAuthorizationUrl(_0x55e3f0,_0x44e400){var _0x13353d=MICROSOFT_AUTH_URL[_0x0e9f('0x18')](_0x0e9f('0x19'),_0x55e3f0[_0x0e9f('0x1a')]);var _0x503872=[_0x0e9f('0x1b'),'id_token'];var _0x384e1e=Buffer[_0x0e9f('0x1c')](JSON[_0x0e9f('0x1d')]({'id':_0x44e400}))[_0x0e9f('0x1e')](_0x0e9f('0x1f'));var _0x490ce1=crypto[_0x0e9f('0x20')](0x10)['toString'](_0x0e9f('0x21'));var _0x5bc54c=getAuthorizationScopes(_0x55e3f0);var _0x399a09=[{'key':_0x0e9f('0x22'),'value':_0x55e3f0[_0x0e9f('0x23')]},{'key':_0x0e9f('0x24'),'value':encodeURIComponent(_0x503872[_0x0e9f('0x16')]('\x20'))},{'key':'redirect_uri','value':_0x55e3f0['data4']},{'key':'response_mode','value':_0x0e9f('0x25')},{'key':_0x0e9f('0x26'),'value':encodeURIComponent(_0x5bc54c)},{'key':_0x0e9f('0x27'),'value':_0x384e1e},{'key':'nonce','value':_0x490ce1},{'key':'prompt','value':_0x0e9f('0x28')}];var _0x4fe737=_0x13353d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0e9f('0x10')](_0x399a09,function(_0x3ff7d4){return _0x3ff7d4[_0x0e9f('0x29')]+'='+_0x3ff7d4['value'];})[_0x0e9f('0x16')]('&');_0x55e3f0[_0x0e9f('0x2a')]={'issuer':_0x13353d['replace'](_0x0e9f('0x2b'),''),'audience':_0x55e3f0[_0x0e9f('0x23')],'state':_0x384e1e,'nonce':_0x490ce1};redis[_0x0e9f('0x2c')](_0x384e1e,JSON[_0x0e9f('0x1d')](_0x55e3f0));return _0x4fe737;}function isValidIdToken(_0x597730,_0x4310d7){try{var _0x376c64=jwt[_0x0e9f('0x2d')](_0x597730,{'complete':!![]});var _0x532267=_0x376c64[_0x0e9f('0x2e')];if(_0x532267[_0x0e9f('0x2f')]!==_0x4310d7['issuer'])return![];if(_0x532267[_0x0e9f('0x30')]!==_0x4310d7[_0x0e9f('0x31')])return![];if(_0x532267[_0x0e9f('0x32')]!==_0x4310d7[_0x0e9f('0x32')])return![];if(moment()['isAfter'](moment[_0x0e9f('0x33')](_0x532267[_0x0e9f('0x34')])))return![];return!![];}catch(_0x593306){throw _0x593306;}}function refreshOauth2MicrosoftAccessToken(_0x4d454d){return Promise[_0x0e9f('0x35')]()[_0x0e9f('0x36')](function(){if(_0x4d454d['data3'])return _0x4d454d;return db[_0x0e9f('0x37')][_0x0e9f('0x38')]({'where':{'id':_0x4d454d['id']},'raw':!![]});})[_0x0e9f('0x36')](function(_0x567c2e){var _0x2ac43c={'grant_type':'refresh_token','refresh_token':_0x567c2e[_0x0e9f('0x39')],'scope':getAccessTokenScope(_0x567c2e),'redirect_uri':_0x567c2e['data4'],'client_id':_0x567c2e[_0x0e9f('0x23')],'client_secret':encryptor[_0x0e9f('0x3a')](_0x567c2e[_0x0e9f('0x3b')])};var _0x200ce5={'method':_0x0e9f('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x0e9f('0x18')](_0x0e9f('0x19'),_0x567c2e[_0x0e9f('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2ac43c,'json':!![]};return rp(_0x200ce5);})[_0x0e9f('0x36')](function(_0xc50bfb){_0x4d454d['data5']=_0xc50bfb['access_token'];_0x4d454d[_0x0e9f('0x39')]=_0xc50bfb[_0x0e9f('0x3d')];return db[_0x0e9f('0x37')][_0x0e9f('0x3e')]({'data5':_0x4d454d[_0x0e9f('0x3f')],'data6':_0x4d454d[_0x0e9f('0x39')]},{'where':{'id':_0x4d454d['id']}});})['then'](function(){return _0x4d454d;})['catch'](function(_0x30a066){logger[_0x0e9f('0x40')](_0x0e9f('0x41'),_0x4d454d['id'],_0x30a066);});}function getOauth2MicrosoftAccessToken(_0x1c932b,_0x359c48){var _0x5dad88={'grant_type':'authorization_code','code':_0x1c932b,'scope':getAccessTokenScope(_0x359c48),'redirect_uri':_0x359c48[_0x0e9f('0x42')],'client_id':_0x359c48[_0x0e9f('0x23')],'client_secret':encryptor[_0x0e9f('0x3a')](_0x359c48[_0x0e9f('0x3b')])};var _0x43e71b={'method':_0x0e9f('0x3c'),'uri':MICROSOFT_AUTH_URL[_0x0e9f('0x18')](_0x0e9f('0x19'),_0x359c48['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5dad88,'json':!![]};return rp(_0x43e71b);}function startRefreshInterval(_0x461dc0){var _0x459125=schedule[_0x0e9f('0x43')];if(_0x459125[_0x461dc0['id']])clearInterval(_0x459125[_0x461dc0['id']]);_0x459125[_0x461dc0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0e9f('0x44')](this,{'id':_0x461dc0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x459125;}function startAllRefreshIntervals(){return db[_0x0e9f('0x37')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0e9f('0x36')](function(_0x20e0fe){var _0x498581=_0x20e0fe['map'](function(_0x55882f){return refreshOauth2MicrosoftAccessToken(_0x55882f)[_0x0e9f('0x36')](function(_0xa0637e){startRefreshInterval(_0xa0637e);});});return Promise[_0x0e9f('0x45')](_0x498581);})[_0x0e9f('0x46')](function(_0x13e190){var _0x21286f=_0x13e190?util[_0x0e9f('0x47')](_0x13e190,{'showHidden':![],'depth':null}):'';logger[_0x0e9f('0x40')](_0x0e9f('0x48'),_0x21286f);});}module[_0x0e9f('0x49')]={'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 a03d1ad..7cd39a0 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 _0xf34f=['code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf34f,0x64));var _0xff34=function(_0x1ff38f,_0x4ccdf8){_0x1ff38f=_0x1ff38f-0x0;var _0xf575ad=_0xf34f[_0x1ff38f];return _0xf575ad;};'use strict';var _=require(_0xff34('0x0'));var util=require('util');var moment=require(_0xff34('0x1'));var BPromise=require('bluebird');var rs=require(_0xff34('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff34('0x3'))['db'];var utils=require(_0xff34('0x4'));var logger=require(_0xff34('0x5'))('rpc');var config=require(_0xff34('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xff34('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x444e6a,_0x5e6f92,_0x45036f){return new BPromise(function(_0x46d761,_0x5c1668){return client['request'](_0x444e6a,_0x45036f)[_0xff34('0x8')](function(_0xe76c05){logger[_0xff34('0x9')]('CloudProvider,\x20%s,\x20%s',_0x5e6f92,_0xff34('0xa'));logger[_0xff34('0xb')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5e6f92,_0xff34('0xa'),JSON[_0xff34('0xc')](_0xe76c05));if(_0xe76c05[_0xff34('0xd')]){if(_0xe76c05['error'][_0xff34('0xe')]===0x1f4){logger[_0xff34('0xd')](_0xff34('0xf'),_0x5e6f92,_0xe76c05[_0xff34('0xd')][_0xff34('0x10')]);return _0x5c1668(_0xe76c05[_0xff34('0xd')][_0xff34('0x10')]);}logger[_0xff34('0xd')](_0xff34('0xf'),_0x5e6f92,_0xe76c05[_0xff34('0xd')][_0xff34('0x10')]);return _0x46d761(_0xe76c05[_0xff34('0xd')][_0xff34('0x10')]);}else{logger[_0xff34('0x9')](_0xff34('0xf'),_0x5e6f92,_0xff34('0xa'));_0x46d761(_0xe76c05[_0xff34('0x11')][_0xff34('0x10')]);}})[_0xff34('0x12')](function(_0xf5e0ec){logger['error'](_0xff34('0xf'),_0x5e6f92,_0xf5e0ec);_0x5c1668(_0xf5e0ec);});});}
\ No newline at end of file
+var _0x235b=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info'];(function(_0xe090db,_0x3a8919){var _0x23f998=function(_0x22f84a){while(--_0x22f84a){_0xe090db['push'](_0xe090db['shift']());}};_0x23f998(++_0x3a8919);}(_0x235b,0x1ed));var _0xb235=function(_0x18cf19,_0x5cf12d){_0x18cf19=_0x18cf19-0x0;var _0x473383=_0x235b[_0x18cf19];return _0x473383;};'use strict';var _=require(_0xb235('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb235('0x1'));var rs=require(_0xb235('0x2'));var fs=require('fs');var Redis=require(_0xb235('0x3'));var db=require(_0xb235('0x4'))['db'];var utils=require(_0xb235('0x5'));var logger=require(_0xb235('0x6'))('rpc');var config=require(_0xb235('0x7'));var jayson=require(_0xb235('0x8'));var client=jayson[_0xb235('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d0ae,_0x44559a,_0x2affe8){return new BPromise(function(_0x436d63,_0x3241b4){return client['request'](_0x12d0ae,_0x2affe8)['then'](function(_0xecf759){logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));logger[_0xb235('0xd')](_0xb235('0xe'),_0x44559a,_0xb235('0xc'),JSON[_0xb235('0xf')](_0xecf759));if(_0xecf759['error']){if(_0xecf759[_0xb235('0x10')][_0xb235('0x11')]===0x1f4){logger[_0xb235('0x10')]('CloudProvider,\x20%s,\x20%s',_0x44559a,_0xecf759[_0xb235('0x10')]['message']);return _0x3241b4(_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);}logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);return _0x436d63(_0xecf759[_0xb235('0x10')]['message']);}else{logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));_0x436d63(_0xecf759[_0xb235('0x13')][_0xb235('0x12')]);}})[_0xb235('0x14')](function(_0x16f044){logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0x16f044);_0x3241b4(_0x16f044);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 554559d..dbf227c 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x430494,_0xc6a09e){var _0x7a25a2=function(_0x91579e){while(--_0x91579e){_0x430494['push'](_0x430494['shift']());}};_0x7a25a2(++_0xc6a09e);}(_0x2ef3,0xba));var _0x32ef=function(_0x19e388,_0x53f579){_0x19e388=_0x19e388-0x0;var _0xc0b2=_0x2ef3[_0x19e388];return _0xc0b2;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x5c32f9,_0xdf7983){var _0x19cb04=function(_0x47fc9e){while(--_0x47fc9e){_0x5c32f9['push'](_0x5c32f9['shift']());}};_0x19cb04(++_0xdf7983);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fd109,_0x38304){_0x3fd109=_0x3fd109-0x0;var _0x2b64bf=_0x2ef3[_0x3fd109];return _0x2b64bf;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 10ea859..8bc66e8 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 _0xb63f=['exports','name','STRING','sequelize'];(function(_0x561c10,_0xe9cb){var _0x1c5d24=function(_0x566e57){while(--_0x566e57){_0x561c10['push'](_0x561c10['shift']());}};_0x1c5d24(++_0xe9cb);}(_0xb63f,0x193));var _0xfb63=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0xb63f[_0x3c2166];return _0x30ccc3;};'use strict';var Sequelize=require(_0xfb63('0x0'));module[_0xfb63('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb63('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfb63('0x3')]},'companyId':{'type':Sequelize[_0xfb63('0x3')]},'website':{'type':Sequelize[_0xfb63('0x3')]},'phone':{'type':Sequelize[_0xfb63('0x3')]},'fax':{'type':Sequelize[_0xfb63('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfb63('0x3')]},'postalCode':{'type':Sequelize[_0xfb63('0x3')]},'city':{'type':Sequelize[_0xfb63('0x3')]},'country':{'type':Sequelize[_0xfb63('0x3')]},'email':{'type':Sequelize[_0xfb63('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfb63('0x3')]},'sStreet':{'type':Sequelize[_0xfb63('0x3')]},'sPostalCode':{'type':Sequelize[_0xfb63('0x3')]},'sCity':{'type':Sequelize[_0xfb63('0x3')]},'sCountry':{'type':Sequelize[_0xfb63('0x3')]},'description':{'type':Sequelize[_0xfb63('0x3')]}};
\ No newline at end of file
+var _0xad68=['STRING','name','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xad68,0x102));var _0x8ad6=function(_0x40fede,_0x203a11){_0x40fede=_0x40fede-0x0;var _0x482694=_0xad68[_0x40fede];return _0x482694;};'use strict';var Sequelize=require(_0x8ad6('0x0'));module[_0x8ad6('0x1')]={'name':{'type':Sequelize[_0x8ad6('0x2')],'unique':_0x8ad6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x8ad6('0x2')]},'website':{'type':Sequelize[_0x8ad6('0x2')]},'phone':{'type':Sequelize[_0x8ad6('0x2')]},'fax':{'type':Sequelize[_0x8ad6('0x2')]},'type':{'type':Sequelize[_0x8ad6('0x2')]},'street':{'type':Sequelize[_0x8ad6('0x2')]},'postalCode':{'type':Sequelize[_0x8ad6('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8ad6('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x8ad6('0x2')]},'sCity':{'type':Sequelize[_0x8ad6('0x2')]},'sCountry':{'type':Sequelize[_0x8ad6('0x2')]},'description':{'type':Sequelize[_0x8ad6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b90bd2e..f008dec 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 _0xacee=['ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','CmCompany','filters','intersection','model','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','includeAll','include','findAll','rows','catch','keys','rawAttributes','options','find','create','body','Companies','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','params','omit','ids','findOne','CmContact','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacee,0x1e9));var _0xeace=function(_0x21ace9,_0x5a5f59){_0x21ace9=_0x21ace9-0x0;var _0xcc4404=_0xacee[_0x21ace9];return _0xcc4404;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeace('0x0'));var zipdir=require(_0xeace('0x1'));var jsonpatch=require(_0xeace('0x2'));var rp=require('request-promise');var moment=require(_0xeace('0x3'));var BPromise=require(_0xeace('0x4'));var Mustache=require(_0xeace('0x5'));var util=require(_0xeace('0x6'));var path=require(_0xeace('0x7'));var sox=require(_0xeace('0x8'));var csv=require(_0xeace('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeace('0xa'));var squel=require('squel');var crypto=require(_0xeace('0xb'));var jsforce=require(_0xeace('0xc'));var deskjs=require(_0xeace('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeace('0xe'));var Papa=require('papaparse');var Redis=require(_0xeace('0xf'));var authService=require(_0xeace('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeace('0x11'))('api');var utils=require(_0xeace('0x12'));var config=require(_0xeace('0x13'));var licenseUtil=require(_0xeace('0x14'));var db=require(_0xeace('0x15'))['db'];function respondWithStatusCode(_0x1fc68f,_0x1353a0){_0x1353a0=_0x1353a0||0xcc;return function(_0x1ff912){if(_0x1ff912){return _0x1fc68f['sendStatus'](_0x1353a0);}return _0x1fc68f['status'](_0x1353a0)[_0xeace('0x16')]();};}function respondWithResult(_0x2acce4,_0x2da742){_0x2da742=_0x2da742||0xc8;return function(_0x98da51){if(_0x98da51){return _0x2acce4[_0xeace('0x17')](_0x2da742)[_0xeace('0x18')](_0x98da51);}};}function respondWithFilteredResult(_0x5543d0,_0x5dc451){return function(_0x379f6e){if(_0x379f6e){var _0x46a540=typeof _0x5dc451[_0xeace('0x19')]===_0xeace('0x1a')&&typeof _0x5dc451[_0xeace('0x1b')]===_0xeace('0x1a');var _0x303fd2=_0x379f6e[_0xeace('0x1c')];var _0x556829=_0x46a540?0x0:_0x5dc451[_0xeace('0x19')];var _0x4e5afc=_0x46a540?_0x379f6e[_0xeace('0x1c')]:_0x5dc451[_0xeace('0x19')]+_0x5dc451[_0xeace('0x1b')];var _0x90ad51;if(_0x4e5afc>=_0x303fd2){_0x4e5afc=_0x303fd2;_0x90ad51=0xc8;}else{_0x90ad51=0xce;}_0x5543d0[_0xeace('0x17')](_0x90ad51);return _0x5543d0[_0xeace('0x1d')](_0xeace('0x1e'),_0x556829+'-'+_0x4e5afc+'/'+_0x303fd2)['json'](_0x379f6e);}return null;};}function patchUpdates(_0x49a4e8){return function(_0x1cae49){try{jsonpatch[_0xeace('0x1f')](_0x1cae49,_0x49a4e8,!![]);}catch(_0x4e74a2){return BPromise['reject'](_0x4e74a2);}return _0x1cae49[_0xeace('0x20')]();};}function saveUpdates(_0x4a2766,_0x25357b){return function(_0xc9411d){if(_0xc9411d){return _0xc9411d[_0xeace('0x21')](_0x4a2766)[_0xeace('0x22')](function(_0x2fc842){return _0x2fc842;});}return null;};}function removeEntity(_0x391a3e,_0x386c6e){return function(_0x133b45){if(_0x133b45){return _0x133b45['destroy']()[_0xeace('0x22')](function(){var _0x24eee8=_0x133b45[_0xeace('0x23')]({'plain':!![]});var _0x6423b3='Companies';return db[_0xeace('0x24')][_0xeace('0x25')]({'where':{'type':_0x6423b3,'resourceId':_0x24eee8['id']}})[_0xeace('0x22')](function(){return _0x133b45;});})[_0xeace('0x22')](function(){_0x391a3e[_0xeace('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12e814,_0x499948){return function(_0x9b745f){if(!_0x9b745f){_0x12e814[_0xeace('0x26')](0x194);}return _0x9b745f;};}function handleError(_0x26b791,_0x22b047){_0x22b047=_0x22b047||0x1f4;return function(_0x312678){logger['error'](_0x312678[_0xeace('0x27')]);if(_0x312678[_0xeace('0x28')]){delete _0x312678[_0xeace('0x28')];}_0x26b791[_0xeace('0x17')](_0x22b047)[_0xeace('0x29')](_0x312678);};}exports[_0xeace('0x2a')]=function(_0x35a0ea,_0xaa2fcb){var _0x12bea5={},_0x33c0cc={},_0x5493da={'count':0x0,'rows':[]};return db[_0xeace('0x2b')]['describe']()[_0xeace('0x22')](function(_0x12bc1b){_0x33c0cc['model']=_['keys'](_0x12bc1b);_0x33c0cc['query']=_['keys'](_0x35a0ea['query']);_0x33c0cc[_0xeace('0x2c')]=_[_0xeace('0x2d')](_0x33c0cc[_0xeace('0x2e')],_0x33c0cc['query']);_0x12bea5['attributes']=_[_0xeace('0x2d')](_0x33c0cc['model'],qs[_0xeace('0x2f')](_0x35a0ea[_0xeace('0x30')][_0xeace('0x2f')]));_0x12bea5['attributes']=_0x12bea5[_0xeace('0x31')][_0xeace('0x32')]?_0x12bea5[_0xeace('0x31')]:_0x33c0cc[_0xeace('0x2e')];if(!_0x35a0ea['query'][_0xeace('0x33')](_0xeace('0x34'))){_0x12bea5['limit']=qs[_0xeace('0x1b')](_0x35a0ea[_0xeace('0x30')][_0xeace('0x1b')]);_0x12bea5['offset']=qs[_0xeace('0x19')](_0x35a0ea[_0xeace('0x30')][_0xeace('0x19')]);}_0x12bea5[_0xeace('0x35')]=qs['sort'](_0x35a0ea[_0xeace('0x30')][_0xeace('0x36')]);_0x12bea5['where']=qs[_0xeace('0x2c')](_[_0xeace('0x37')](_0x35a0ea['query'],_0x33c0cc['filters']),_0x12bc1b);if(_0x35a0ea[_0xeace('0x30')][_0xeace('0x38')]){_0x12bea5[_0xeace('0x39')]=_[_0xeace('0x3a')](_0x12bea5['where'],{'$or':_[_0xeace('0x3b')](_0x12bea5[_0xeace('0x31')],function(_0x3fad3f){var _0x1ca222={};_0x1ca222[_0x3fad3f]={'$like':'%'+_0x35a0ea[_0xeace('0x30')][_0xeace('0x38')]+'%'};return _0x1ca222;})});}_0x12bea5=_[_0xeace('0x3a')]({},_0x12bea5,_0x35a0ea['options']);var _0x36ddfb={'where':_0x12bea5[_0xeace('0x39')]};return db[_0xeace('0x2b')][_0xeace('0x1c')](_0x36ddfb)[_0xeace('0x22')](function(_0x108976){_0x5493da[_0xeace('0x1c')]=_0x108976;if(_0x35a0ea[_0xeace('0x30')][_0xeace('0x3c')]){_0x12bea5[_0xeace('0x3d')]=[{'all':!![]}];}return db[_0xeace('0x2b')][_0xeace('0x3e')](_0x12bea5);})[_0xeace('0x22')](function(_0x4ab8a5){_0x5493da[_0xeace('0x3f')]=_0x4ab8a5;return _0x5493da;})[_0xeace('0x22')](respondWithFilteredResult(_0xaa2fcb,_0x12bea5))['catch'](handleError(_0xaa2fcb,null));})[_0xeace('0x40')](handleError(_0xaa2fcb,null));};exports['show']=function(_0x23ae9d,_0xba93f6){var _0x260764={'raw':![],'where':{'id':_0x23ae9d['params']['id']}},_0x2a464c={};_0x2a464c[_0xeace('0x2e')]=_[_0xeace('0x41')](db[_0xeace('0x2b')][_0xeace('0x42')]);_0x2a464c[_0xeace('0x30')]=_['keys'](_0x23ae9d[_0xeace('0x30')]);_0x2a464c[_0xeace('0x2c')]=_['intersection'](_0x2a464c['model'],_0x2a464c[_0xeace('0x30')]);_0x260764[_0xeace('0x31')]=_['intersection'](_0x2a464c[_0xeace('0x2e')],qs[_0xeace('0x2f')](_0x23ae9d[_0xeace('0x30')][_0xeace('0x2f')]));_0x260764[_0xeace('0x31')]=_0x260764[_0xeace('0x31')]['length']?_0x260764['attributes']:_0x2a464c[_0xeace('0x2e')];if(_0x23ae9d[_0xeace('0x30')]['includeAll']){_0x260764[_0xeace('0x3d')]=[{'all':!![]}];}_0x260764=_[_0xeace('0x3a')]({},_0x260764,_0x23ae9d[_0xeace('0x43')]);return db[_0xeace('0x2b')][_0xeace('0x44')](_0x260764)[_0xeace('0x22')](handleEntityNotFound(_0xba93f6,null))['then'](respondWithResult(_0xba93f6,null))[_0xeace('0x40')](handleError(_0xba93f6,null));};exports[_0xeace('0x45')]=function(_0x29b8d1,_0xd35cc2){return db[_0xeace('0x2b')]['create'](_0x29b8d1[_0xeace('0x46')],{})['then'](function(_0x33c40c){var _0x1d2b7a=_0x29b8d1['user'][_0xeace('0x23')]({'plain':!![]});if(!_0x1d2b7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d2b7a['role']==='user'){var _0x1db994=_0x33c40c[_0xeace('0x23')]({'plain':!![]});var _0x545c13=_0xeace('0x47');return db[_0xeace('0x48')]['find']({'where':{'name':_0x545c13,'userProfileId':_0x1d2b7a['userProfileId']},'raw':!![]})[_0xeace('0x22')](function(_0x4f9fd9){if(_0x4f9fd9&&_0x4f9fd9[_0xeace('0x49')]===0x0){return db[_0xeace('0x24')][_0xeace('0x45')]({'name':_0x1db994['name'],'resourceId':_0x1db994['id'],'type':_0x4f9fd9[_0xeace('0x28')],'sectionId':_0x4f9fd9['id']},{})[_0xeace('0x22')](function(){return _0x33c40c;});}else{return _0x33c40c;}})['catch'](function(_0x5cc71b){logger[_0xeace('0x4a')](_0xeace('0x4b'),_0x5cc71b);throw _0x5cc71b;});}return _0x33c40c;})[_0xeace('0x22')](respondWithResult(_0xd35cc2,0xc9))[_0xeace('0x40')](handleError(_0xd35cc2,null));};exports[_0xeace('0x21')]=function(_0x3b2638,_0x35750c){if(_0x3b2638[_0xeace('0x46')]['id']){delete _0x3b2638[_0xeace('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x3b2638['params']['id']}})[_0xeace('0x22')](handleEntityNotFound(_0x35750c,null))[_0xeace('0x22')](saveUpdates(_0x3b2638[_0xeace('0x46')],null))[_0xeace('0x22')](respondWithResult(_0x35750c,null))[_0xeace('0x40')](handleError(_0x35750c,null));};exports[_0xeace('0x25')]=function(_0x28f2ec,_0x41a143){return db[_0xeace('0x2b')][_0xeace('0x44')]({'where':{'id':_0x28f2ec['params']['id']}})[_0xeace('0x22')](handleEntityNotFound(_0x41a143,null))[_0xeace('0x22')](removeEntity(_0x41a143,null))[_0xeace('0x40')](handleError(_0x41a143,null));};exports[_0xeace('0x4c')]=function(_0x1a765f,_0x153b4e){return db['CmCompany'][_0xeace('0x4c')]()[_0xeace('0x22')](respondWithResult(_0x153b4e,null))[_0xeace('0x40')](handleError(_0x153b4e,null));};exports[_0xeace('0x4d')]=function(_0x5a5272,_0x6b1b80,_0x1ee698){return db['CmContact'][_0xeace('0x44')]({'where':{'id':_0x5a5272[_0xeace('0x4e')]['id']}})['then'](handleEntityNotFound(_0x6b1b80,null))[_0xeace('0x22')](function(_0x196093){if(_0x196093){return _0x196093[_0xeace('0x4d')](_0x5a5272[_0xeace('0x46')]['ids'],_[_0xeace('0x4f')](_0x5a5272[_0xeace('0x46')],[_0xeace('0x50'),'id'])||{});}})[_0xeace('0x22')](respondWithResult(_0x6b1b80,null))['catch'](handleError(_0x6b1b80,null));};exports['getContacts']=function(_0x49440d,_0xacf3cf,_0x4ce599){var _0x1f0554={};var _0x559eb9={};var _0x25c3fa;var _0x286b7f;return db[_0xeace('0x2b')][_0xeace('0x51')]({'where':{'id':_0x49440d[_0xeace('0x4e')]['id']}})[_0xeace('0x22')](handleEntityNotFound(_0xacf3cf,null))[_0xeace('0x22')](function(_0x7150b5){if(_0x7150b5){_0x25c3fa=_0x7150b5;_0x559eb9[_0xeace('0x2e')]=_[_0xeace('0x41')](db[_0xeace('0x52')][_0xeace('0x42')]);_0x559eb9['query']=_[_0xeace('0x41')](_0x49440d[_0xeace('0x30')]);_0x559eb9[_0xeace('0x2c')]=_[_0xeace('0x2d')](_0x559eb9[_0xeace('0x2e')],_0x559eb9['query']);_0x1f0554[_0xeace('0x31')]=_[_0xeace('0x2d')](_0x559eb9['model'],qs[_0xeace('0x2f')](_0x49440d[_0xeace('0x30')][_0xeace('0x2f')]));_0x1f0554[_0xeace('0x31')]=_0x1f0554[_0xeace('0x31')][_0xeace('0x32')]?_0x1f0554[_0xeace('0x31')]:_0x559eb9[_0xeace('0x2e')];_0x1f0554[_0xeace('0x35')]=qs[_0xeace('0x36')](_0x49440d[_0xeace('0x30')][_0xeace('0x36')]);_0x1f0554[_0xeace('0x39')]=qs[_0xeace('0x2c')](_[_0xeace('0x37')](_0x49440d[_0xeace('0x30')],_0x559eb9[_0xeace('0x2c')]));if(_0x49440d[_0xeace('0x30')][_0xeace('0x38')]){_0x1f0554['where']=_[_0xeace('0x3a')](_0x1f0554['where'],{'$or':_[_0xeace('0x3b')](_0x1f0554['attributes'],function(_0x175e9d){var _0x7d45e5={};_0x7d45e5[_0x175e9d]={'$like':'%'+_0x49440d['query']['filter']+'%'};return _0x7d45e5;})});}_0x1f0554=_[_0xeace('0x3a')]({},_0x1f0554,_0x49440d[_0xeace('0x43')]);return _0x25c3fa[_0xeace('0x53')](_0x1f0554);}})[_0xeace('0x22')](function(_0x43c353){if(_0x43c353){_0x286b7f=_0x43c353[_0xeace('0x32')];if(!_0x49440d['query'][_0xeace('0x33')](_0xeace('0x34'))){_0x1f0554[_0xeace('0x1b')]=qs['limit'](_0x49440d[_0xeace('0x30')][_0xeace('0x1b')]);_0x1f0554[_0xeace('0x19')]=qs[_0xeace('0x19')](_0x49440d['query']['offset']);}return _0x25c3fa[_0xeace('0x53')](_0x1f0554);}})[_0xeace('0x22')](function(_0x4c76ed){if(_0x4c76ed){return _0x4c76ed?{'count':_0x286b7f,'rows':_0x4c76ed}:null;}})['then'](respondWithResult(_0xacf3cf,null))[_0xeace('0x40')](handleError(_0xacf3cf,null));};
\ No newline at end of file
+var _0x11ac=['intersection','attributes','order','sort','where','filter','merge','include','findAll','rows','catch','show','params','fields','length','includeAll','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','CmContact','rawAttributes','pick','map','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','Companies','end','error','name','send','index','CmCompany','describe','model','keys','query','filters'];(function(_0x22a8c4,_0x51c09a){var _0x104c6d=function(_0x4d4d3d){while(--_0x4d4d3d){_0x22a8c4['push'](_0x22a8c4['shift']());}};_0x104c6d(++_0x51c09a);}(_0x11ac,0xcc));var _0xc11a=function(_0x5ac600,_0x12f652){_0x5ac600=_0x5ac600-0x0;var _0x37e050=_0x11ac[_0x5ac600];return _0x37e050;};'use strict';var emlformat=require(_0xc11a('0x0'));var rimraf=require(_0xc11a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc11a('0x2'));var rp=require('request-promise');var moment=require(_0xc11a('0x3'));var BPromise=require(_0xc11a('0x4'));var Mustache=require(_0xc11a('0x5'));var util=require(_0xc11a('0x6'));var path=require('path');var sox=require(_0xc11a('0x7'));var csv=require(_0xc11a('0x8'));var ejs=require(_0xc11a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc11a('0xa'));var crypto=require(_0xc11a('0xb'));var jsforce=require(_0xc11a('0xc'));var deskjs=require(_0xc11a('0xd'));var toCsv=require(_0xc11a('0x8'));var querystring=require('querystring');var Papa=require(_0xc11a('0xe'));var Redis=require('ioredis');var authService=require(_0xc11a('0xf'));var qs=require(_0xc11a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc11a('0x11'));var logger=require(_0xc11a('0x12'))(_0xc11a('0x13'));var utils=require(_0xc11a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc11a('0x15'));var db=require(_0xc11a('0x16'))['db'];function respondWithStatusCode(_0x183ab4,_0x2c8aae){_0x2c8aae=_0x2c8aae||0xcc;return function(_0x3d3c1e){if(_0x3d3c1e){return _0x183ab4[_0xc11a('0x17')](_0x2c8aae);}return _0x183ab4['status'](_0x2c8aae)['end']();};}function respondWithResult(_0x926356,_0x3acc5c){_0x3acc5c=_0x3acc5c||0xc8;return function(_0x38a17d){if(_0x38a17d){return _0x926356[_0xc11a('0x18')](_0x3acc5c)[_0xc11a('0x19')](_0x38a17d);}};}function respondWithFilteredResult(_0x3b91b4,_0x230c57){return function(_0x351793){if(_0x351793){var _0x2a902b=typeof _0x230c57[_0xc11a('0x1a')]===_0xc11a('0x1b')&&typeof _0x230c57[_0xc11a('0x1c')]===_0xc11a('0x1b');var _0x5775aa=_0x351793[_0xc11a('0x1d')];var _0x32eff4=_0x2a902b?0x0:_0x230c57[_0xc11a('0x1a')];var _0x5196f6=_0x2a902b?_0x351793[_0xc11a('0x1d')]:_0x230c57['offset']+_0x230c57[_0xc11a('0x1c')];var _0x2cd49d;if(_0x5196f6>=_0x5775aa){_0x5196f6=_0x5775aa;_0x2cd49d=0xc8;}else{_0x2cd49d=0xce;}_0x3b91b4[_0xc11a('0x18')](_0x2cd49d);return _0x3b91b4[_0xc11a('0x1e')]('Content-Range',_0x32eff4+'-'+_0x5196f6+'/'+_0x5775aa)[_0xc11a('0x19')](_0x351793);}return null;};}function patchUpdates(_0x5caf02){return function(_0x2379de){try{jsonpatch['apply'](_0x2379de,_0x5caf02,!![]);}catch(_0x14a0d3){return BPromise[_0xc11a('0x1f')](_0x14a0d3);}return _0x2379de[_0xc11a('0x20')]();};}function saveUpdates(_0x32b3f0,_0x4abbc6){return function(_0x48d52a){if(_0x48d52a){return _0x48d52a[_0xc11a('0x21')](_0x32b3f0)[_0xc11a('0x22')](function(_0x4cdb48){return _0x4cdb48;});}return null;};}function removeEntity(_0x1ea22d,_0x4fbc45){return function(_0x33bb3b){if(_0x33bb3b){return _0x33bb3b[_0xc11a('0x23')]()[_0xc11a('0x22')](function(){var _0xdd5666=_0x33bb3b['get']({'plain':!![]});var _0x4ace4c=_0xc11a('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x4ace4c,'resourceId':_0xdd5666['id']}})[_0xc11a('0x22')](function(){return _0x33bb3b;});})[_0xc11a('0x22')](function(){_0x1ea22d[_0xc11a('0x18')](0xcc)[_0xc11a('0x25')]();});}};}function handleEntityNotFound(_0x34bbd8,_0x4377c3){return function(_0x557cdc){if(!_0x557cdc){_0x34bbd8[_0xc11a('0x17')](0x194);}return _0x557cdc;};}function handleError(_0x535e2f,_0x3093d9){_0x3093d9=_0x3093d9||0x1f4;return function(_0x47d988){logger[_0xc11a('0x26')](_0x47d988['stack']);if(_0x47d988[_0xc11a('0x27')]){delete _0x47d988[_0xc11a('0x27')];}_0x535e2f['status'](_0x3093d9)[_0xc11a('0x28')](_0x47d988);};}exports[_0xc11a('0x29')]=function(_0x2f717f,_0x1e32d7){var _0x740b43={},_0x5afcff={},_0x8cd072={'count':0x0,'rows':[]};return db[_0xc11a('0x2a')][_0xc11a('0x2b')]()[_0xc11a('0x22')](function(_0x3c37da){_0x5afcff[_0xc11a('0x2c')]=_[_0xc11a('0x2d')](_0x3c37da);_0x5afcff[_0xc11a('0x2e')]=_[_0xc11a('0x2d')](_0x2f717f[_0xc11a('0x2e')]);_0x5afcff[_0xc11a('0x2f')]=_['intersection'](_0x5afcff[_0xc11a('0x2c')],_0x5afcff[_0xc11a('0x2e')]);_0x740b43['attributes']=_[_0xc11a('0x30')](_0x5afcff[_0xc11a('0x2c')],qs['fields'](_0x2f717f['query']['fields']));_0x740b43[_0xc11a('0x31')]=_0x740b43[_0xc11a('0x31')]['length']?_0x740b43['attributes']:_0x5afcff[_0xc11a('0x2c')];if(!_0x2f717f['query']['hasOwnProperty']('nolimit')){_0x740b43[_0xc11a('0x1c')]=qs['limit'](_0x2f717f['query'][_0xc11a('0x1c')]);_0x740b43[_0xc11a('0x1a')]=qs[_0xc11a('0x1a')](_0x2f717f[_0xc11a('0x2e')][_0xc11a('0x1a')]);}_0x740b43[_0xc11a('0x32')]=qs['sort'](_0x2f717f[_0xc11a('0x2e')][_0xc11a('0x33')]);_0x740b43[_0xc11a('0x34')]=qs[_0xc11a('0x2f')](_['pick'](_0x2f717f[_0xc11a('0x2e')],_0x5afcff['filters']),_0x3c37da);if(_0x2f717f['query'][_0xc11a('0x35')]){_0x740b43[_0xc11a('0x34')]=_[_0xc11a('0x36')](_0x740b43[_0xc11a('0x34')],{'$or':_['map'](_0x740b43['attributes'],function(_0x300418){var _0x166973={};_0x166973[_0x300418]={'$like':'%'+_0x2f717f[_0xc11a('0x2e')][_0xc11a('0x35')]+'%'};return _0x166973;})});}_0x740b43=_[_0xc11a('0x36')]({},_0x740b43,_0x2f717f['options']);var _0x59f84f={'where':_0x740b43[_0xc11a('0x34')]};return db[_0xc11a('0x2a')][_0xc11a('0x1d')](_0x59f84f)[_0xc11a('0x22')](function(_0x68d1b4){_0x8cd072['count']=_0x68d1b4;if(_0x2f717f[_0xc11a('0x2e')]['includeAll']){_0x740b43[_0xc11a('0x37')]=[{'all':!![]}];}return db[_0xc11a('0x2a')][_0xc11a('0x38')](_0x740b43);})[_0xc11a('0x22')](function(_0x3bc813){_0x8cd072[_0xc11a('0x39')]=_0x3bc813;return _0x8cd072;})[_0xc11a('0x22')](respondWithFilteredResult(_0x1e32d7,_0x740b43))['catch'](handleError(_0x1e32d7,null));})[_0xc11a('0x3a')](handleError(_0x1e32d7,null));};exports[_0xc11a('0x3b')]=function(_0x2beae9,_0x10bd48){var _0x21a773={'raw':![],'where':{'id':_0x2beae9[_0xc11a('0x3c')]['id']}},_0x59c63b={};_0x59c63b['model']=_[_0xc11a('0x2d')](db[_0xc11a('0x2a')]['rawAttributes']);_0x59c63b[_0xc11a('0x2e')]=_['keys'](_0x2beae9['query']);_0x59c63b[_0xc11a('0x2f')]=_[_0xc11a('0x30')](_0x59c63b[_0xc11a('0x2c')],_0x59c63b[_0xc11a('0x2e')]);_0x21a773[_0xc11a('0x31')]=_[_0xc11a('0x30')](_0x59c63b[_0xc11a('0x2c')],qs['fields'](_0x2beae9['query'][_0xc11a('0x3d')]));_0x21a773[_0xc11a('0x31')]=_0x21a773[_0xc11a('0x31')][_0xc11a('0x3e')]?_0x21a773[_0xc11a('0x31')]:_0x59c63b[_0xc11a('0x2c')];if(_0x2beae9[_0xc11a('0x2e')][_0xc11a('0x3f')]){_0x21a773[_0xc11a('0x37')]=[{'all':!![]}];}_0x21a773=_[_0xc11a('0x36')]({},_0x21a773,_0x2beae9[_0xc11a('0x40')]);return db['CmCompany'][_0xc11a('0x41')](_0x21a773)[_0xc11a('0x22')](handleEntityNotFound(_0x10bd48,null))['then'](respondWithResult(_0x10bd48,null))[_0xc11a('0x3a')](handleError(_0x10bd48,null));};exports['create']=function(_0x58d902,_0xcee34c){return db[_0xc11a('0x2a')]['create'](_0x58d902[_0xc11a('0x42')],{})[_0xc11a('0x22')](function(_0x5792da){var _0x1a7f99=_0x58d902['user'][_0xc11a('0x43')]({'plain':!![]});if(!_0x1a7f99)throw new Error(_0xc11a('0x44'));if(_0x1a7f99['role']===_0xc11a('0x45')){var _0x3c85e3=_0x5792da[_0xc11a('0x43')]({'plain':!![]});var _0xcf1f33=_0xc11a('0x24');return db[_0xc11a('0x46')][_0xc11a('0x41')]({'where':{'name':_0xcf1f33,'userProfileId':_0x1a7f99[_0xc11a('0x47')]},'raw':!![]})[_0xc11a('0x22')](function(_0x3f9a99){if(_0x3f9a99&&_0x3f9a99[_0xc11a('0x48')]===0x0){return db['UserProfileResource'][_0xc11a('0x49')]({'name':_0x3c85e3['name'],'resourceId':_0x3c85e3['id'],'type':_0x3f9a99[_0xc11a('0x27')],'sectionId':_0x3f9a99['id']},{})[_0xc11a('0x22')](function(){return _0x5792da;});}else{return _0x5792da;}})[_0xc11a('0x3a')](function(_0x123071){logger['error'](_0xc11a('0x4a'),_0x123071);throw _0x123071;});}return _0x5792da;})['then'](respondWithResult(_0xcee34c,0xc9))[_0xc11a('0x3a')](handleError(_0xcee34c,null));};exports['update']=function(_0xd440db,_0x1be2de){if(_0xd440db[_0xc11a('0x42')]['id']){delete _0xd440db[_0xc11a('0x42')]['id'];}return db['CmCompany'][_0xc11a('0x41')]({'where':{'id':_0xd440db[_0xc11a('0x3c')]['id']}})[_0xc11a('0x22')](handleEntityNotFound(_0x1be2de,null))[_0xc11a('0x22')](saveUpdates(_0xd440db[_0xc11a('0x42')],null))[_0xc11a('0x22')](respondWithResult(_0x1be2de,null))[_0xc11a('0x3a')](handleError(_0x1be2de,null));};exports[_0xc11a('0x23')]=function(_0xfe71ef,_0x4a52b6){return db[_0xc11a('0x2a')][_0xc11a('0x41')]({'where':{'id':_0xfe71ef[_0xc11a('0x3c')]['id']}})[_0xc11a('0x22')](handleEntityNotFound(_0x4a52b6,null))['then'](removeEntity(_0x4a52b6,null))[_0xc11a('0x3a')](handleError(_0x4a52b6,null));};exports[_0xc11a('0x2b')]=function(_0x1565ea,_0x3afd3d){return db['CmCompany'][_0xc11a('0x2b')]()[_0xc11a('0x22')](respondWithResult(_0x3afd3d,null))[_0xc11a('0x3a')](handleError(_0x3afd3d,null));};exports[_0xc11a('0x4b')]=function(_0x495230,_0x3a467e,_0x499f43){return db['CmContact'][_0xc11a('0x41')]({'where':{'id':_0x495230[_0xc11a('0x3c')]['id']}})[_0xc11a('0x22')](handleEntityNotFound(_0x3a467e,null))['then'](function(_0x54ce8f){if(_0x54ce8f){return _0x54ce8f[_0xc11a('0x4b')](_0x495230[_0xc11a('0x42')][_0xc11a('0x4c')],_[_0xc11a('0x4d')](_0x495230[_0xc11a('0x42')],['ids','id'])||{});}})[_0xc11a('0x22')](respondWithResult(_0x3a467e,null))['catch'](handleError(_0x3a467e,null));};exports[_0xc11a('0x4e')]=function(_0x26fa2f,_0x5bc6e8,_0x48561e){var _0x519339={};var _0x2ff36b={};var _0x46944b;var _0x2d0ef6;return db['CmCompany']['findOne']({'where':{'id':_0x26fa2f['params']['id']}})[_0xc11a('0x22')](handleEntityNotFound(_0x5bc6e8,null))[_0xc11a('0x22')](function(_0x310672){if(_0x310672){_0x46944b=_0x310672;_0x2ff36b[_0xc11a('0x2c')]=_[_0xc11a('0x2d')](db[_0xc11a('0x4f')][_0xc11a('0x50')]);_0x2ff36b[_0xc11a('0x2e')]=_[_0xc11a('0x2d')](_0x26fa2f[_0xc11a('0x2e')]);_0x2ff36b[_0xc11a('0x2f')]=_[_0xc11a('0x30')](_0x2ff36b[_0xc11a('0x2c')],_0x2ff36b[_0xc11a('0x2e')]);_0x519339['attributes']=_[_0xc11a('0x30')](_0x2ff36b['model'],qs[_0xc11a('0x3d')](_0x26fa2f[_0xc11a('0x2e')][_0xc11a('0x3d')]));_0x519339['attributes']=_0x519339[_0xc11a('0x31')][_0xc11a('0x3e')]?_0x519339['attributes']:_0x2ff36b[_0xc11a('0x2c')];_0x519339[_0xc11a('0x32')]=qs['sort'](_0x26fa2f[_0xc11a('0x2e')]['sort']);_0x519339[_0xc11a('0x34')]=qs[_0xc11a('0x2f')](_[_0xc11a('0x51')](_0x26fa2f[_0xc11a('0x2e')],_0x2ff36b[_0xc11a('0x2f')]));if(_0x26fa2f[_0xc11a('0x2e')]['filter']){_0x519339['where']=_['merge'](_0x519339[_0xc11a('0x34')],{'$or':_[_0xc11a('0x52')](_0x519339[_0xc11a('0x31')],function(_0x1d1c37){var _0x3ef785={};_0x3ef785[_0x1d1c37]={'$like':'%'+_0x26fa2f[_0xc11a('0x2e')][_0xc11a('0x35')]+'%'};return _0x3ef785;})});}_0x519339=_[_0xc11a('0x36')]({},_0x519339,_0x26fa2f['options']);return _0x46944b[_0xc11a('0x4e')](_0x519339);}})[_0xc11a('0x22')](function(_0x4aae78){if(_0x4aae78){_0x2d0ef6=_0x4aae78[_0xc11a('0x3e')];if(!_0x26fa2f[_0xc11a('0x2e')][_0xc11a('0x53')]('nolimit')){_0x519339[_0xc11a('0x1c')]=qs[_0xc11a('0x1c')](_0x26fa2f[_0xc11a('0x2e')][_0xc11a('0x1c')]);_0x519339[_0xc11a('0x1a')]=qs[_0xc11a('0x1a')](_0x26fa2f[_0xc11a('0x2e')][_0xc11a('0x1a')]);}return _0x46944b[_0xc11a('0x4e')](_0x519339);}})['then'](function(_0x346b40){if(_0x346b40){return _0x346b40?{'count':_0x2d0ef6,'rows':_0x346b40}:null;}})['then'](respondWithResult(_0x5bc6e8,null))['catch'](handleError(_0x5bc6e8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index eff62ce..385a310 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 _0x4339=['cm_companies','lodash','util','../../config/logger','request-promise','path','rimraf','define','CmCompany'];(function(_0x5073e7,_0x23ce87){var _0x2cf716=function(_0x24a1f6){while(--_0x24a1f6){_0x5073e7['push'](_0x5073e7['shift']());}};_0x2cf716(++_0x23ce87);}(_0x4339,0x14e));var _0x9433=function(_0x34f9cf,_0x1eedfc){_0x34f9cf=_0x34f9cf-0x0;var _0x3fbcd3=_0x4339[_0x34f9cf];return _0x3fbcd3;};'use strict';var _=require(_0x9433('0x0'));var util=require(_0x9433('0x1'));var logger=require(_0x9433('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9433('0x3'));var fs=require('fs');var path=require(_0x9433('0x4'));var rimraf=require(_0x9433('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x8781a5,_0x1f67d6){return _0x8781a5[_0x9433('0x6')](_0x9433('0x7'),attributes,{'tableName':_0x9433('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa52=['../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e6875,_0x392cbf){var _0x1971af=function(_0x2345a0){while(--_0x2345a0){_0x3e6875['push'](_0x3e6875['shift']());}};_0x1971af(++_0x392cbf);}(_0xfa52,0xe5));var _0x2fa5=function(_0x3a2642,_0x28233f){_0x3a2642=_0x3a2642-0x0;var _0x5931fe=_0xfa52[_0x3a2642];return _0x5931fe;};'use strict';var _=require(_0x2fa5('0x0'));var util=require(_0x2fa5('0x1'));var logger=require(_0x2fa5('0x2'))(_0x2fa5('0x3'));var moment=require(_0x2fa5('0x4'));var BPromise=require(_0x2fa5('0x5'));var rp=require(_0x2fa5('0x6'));var fs=require('fs');var path=require(_0x2fa5('0x7'));var rimraf=require(_0x2fa5('0x8'));var config=require(_0x2fa5('0x9'));var attributes=require('./cmCompany.attributes');module[_0x2fa5('0xa')]=function(_0x1ce680,_0x55b078){return _0x1ce680[_0x2fa5('0xb')](_0x2fa5('0xc'),attributes,{'tableName':_0x2fa5('0xd'),'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 3d23fc0..6f75b95 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 _0x8738=['ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','randomstring'];(function(_0x1f469a,_0x521f1f){var _0x5417dd=function(_0x120c6c){while(--_0x120c6c){_0x1f469a['push'](_0x1f469a['shift']());}};_0x5417dd(++_0x521f1f);}(_0x8738,0xc4));var _0x8873=function(_0x195e54,_0x1553ea){_0x195e54=_0x195e54-0x0;var _0x45abab=_0x8738[_0x195e54];return _0x45abab;};'use strict';var _=require(_0x8873('0x0'));var util=require(_0x8873('0x1'));var moment=require(_0x8873('0x2'));var BPromise=require('bluebird');var rs=require(_0x8873('0x3'));var fs=require('fs');var Redis=require(_0x8873('0x4'));var db=require(_0x8873('0x5'))['db'];var utils=require(_0x8873('0x6'));var logger=require(_0x8873('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8873('0x8')][_0x8873('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a7e4d,_0x3c4949,_0x56d7aa){return new BPromise(function(_0x1860ab,_0x5201b4){return client[_0x8873('0xa')](_0x5a7e4d,_0x56d7aa)[_0x8873('0xb')](function(_0x294840){logger[_0x8873('0xc')](_0x8873('0xd'),_0x3c4949,_0x8873('0xe'));logger[_0x8873('0xf')](_0x8873('0x10'),_0x3c4949,_0x8873('0xe'),JSON['stringify'](_0x294840));if(_0x294840[_0x8873('0x11')]){if(_0x294840[_0x8873('0x11')]['code']===0x1f4){logger[_0x8873('0x11')](_0x8873('0xd'),_0x3c4949,_0x294840[_0x8873('0x11')][_0x8873('0x12')]);return _0x5201b4(_0x294840[_0x8873('0x11')][_0x8873('0x12')]);}logger[_0x8873('0x11')]('CmCompany,\x20%s,\x20%s',_0x3c4949,_0x294840[_0x8873('0x11')][_0x8873('0x12')]);return _0x1860ab(_0x294840[_0x8873('0x11')][_0x8873('0x12')]);}else{logger[_0x8873('0xc')](_0x8873('0xd'),_0x3c4949,_0x8873('0xe'));_0x1860ab(_0x294840[_0x8873('0x13')][_0x8873('0x12')]);}})['catch'](function(_0x146790){logger[_0x8873('0x11')](_0x8873('0xd'),_0x3c4949,_0x146790);_0x5201b4(_0x146790);});});}
\ No newline at end of file
+var _0x829c=['jayson/promise','client','http','request','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2e56a6,_0x1ba53a){var _0xec744c=function(_0x4d62ff){while(--_0x4d62ff){_0x2e56a6['push'](_0x2e56a6['shift']());}};_0xec744c(++_0x1ba53a);}(_0x829c,0x184));var _0xc829=function(_0x590f7a,_0x52a408){_0x590f7a=_0x590f7a-0x0;var _0x232356=_0x829c[_0x590f7a];return _0x232356;};'use strict';var _=require(_0xc829('0x0'));var util=require(_0xc829('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc829('0x2'));var fs=require('fs');var Redis=require(_0xc829('0x3'));var db=require(_0xc829('0x4'))['db'];var utils=require(_0xc829('0x5'));var logger=require(_0xc829('0x6'))('rpc');var config=require(_0xc829('0x7'));var jayson=require(_0xc829('0x8'));var client=jayson[_0xc829('0x9')][_0xc829('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1673ff,_0x5c41f9,_0x2d8e73){return new BPromise(function(_0x13e3fd,_0x56753b){return client[_0xc829('0xb')](_0x1673ff,_0x2d8e73)[_0xc829('0xc')](function(_0x219f4b){logger['info']('CmCompany,\x20%s,\x20%s',_0x5c41f9,_0xc829('0xd'));logger[_0xc829('0xe')](_0xc829('0xf'),_0x5c41f9,'request\x20sent',JSON[_0xc829('0x10')](_0x219f4b));if(_0x219f4b[_0xc829('0x11')]){if(_0x219f4b['error'][_0xc829('0x12')]===0x1f4){logger[_0xc829('0x11')](_0xc829('0x13'),_0x5c41f9,_0x219f4b[_0xc829('0x11')][_0xc829('0x14')]);return _0x56753b(_0x219f4b[_0xc829('0x11')][_0xc829('0x14')]);}logger['error'](_0xc829('0x13'),_0x5c41f9,_0x219f4b[_0xc829('0x11')]['message']);return _0x13e3fd(_0x219f4b[_0xc829('0x11')]['message']);}else{logger[_0xc829('0x15')](_0xc829('0x13'),_0x5c41f9,'request\x20sent');_0x13e3fd(_0x219f4b['result'][_0xc829('0x14')]);}})['catch'](function(_0x277fd9){logger[_0xc829('0x11')](_0xc829('0x13'),_0x5c41f9,_0x277fd9);_0x56753b(_0x277fd9);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 5b43e8b..da50e1c 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 _0x5c60=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','post','create','update','delete','destroy','exports','util','path'];(function(_0x28d2ec,_0x48c60e){var _0x5ac7d3=function(_0x568a16){while(--_0x568a16){_0x28d2ec['push'](_0x28d2ec['shift']());}};_0x5ac7d3(++_0x48c60e);}(_0x5c60,0x19c));var _0x05c6=function(_0x1ec355,_0x312bb4){_0x1ec355=_0x1ec355-0x0;var _0x13fdd8=_0x5c60[_0x1ec355];return _0x13fdd8;};'use strict';var multer=require('multer');var util=require(_0x05c6('0x0'));var path=require(_0x05c6('0x1'));var timeout=require(_0x05c6('0x2'));var express=require(_0x05c6('0x3'));var router=express[_0x05c6('0x4')]();var fs_extra=require(_0x05c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x05c6('0x6'));var config=require(_0x05c6('0x7'));var controller=require(_0x05c6('0x8'));router[_0x05c6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x05c6('0xa'),auth['isAuthenticated'](),controller[_0x05c6('0xb')]);router[_0x05c6('0x9')](_0x05c6('0xc'),auth[_0x05c6('0xd')](),controller[_0x05c6('0xe')]);router['get'](_0x05c6('0xf'),auth[_0x05c6('0xd')](),controller[_0x05c6('0x10')]);router[_0x05c6('0x11')]('/',auth['isAuthenticated'](),controller[_0x05c6('0x12')]);router[_0x05c6('0x11')](_0x05c6('0xf'),auth[_0x05c6('0xd')](),controller['addContacts']);router['put'](_0x05c6('0xc'),auth['isAuthenticated'](),controller[_0x05c6('0x13')]);router[_0x05c6('0x14')](_0x05c6('0xc'),auth['isAuthenticated'](),controller[_0x05c6('0x15')]);module[_0x05c6('0x16')]=router;
\ No newline at end of file
+var _0x07ac=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports'];(function(_0x4c29f9,_0x5bddd4){var _0x4e17b8=function(_0x12e055){while(--_0x12e055){_0x4c29f9['push'](_0x4c29f9['shift']());}};_0x4e17b8(++_0x5bddd4);}(_0x07ac,0x104));var _0xc07a=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x07ac[_0x220afa];return _0x1b79d1;};'use strict';var multer=require('multer');var util=require(_0xc07a('0x0'));var path=require(_0xc07a('0x1'));var timeout=require(_0xc07a('0x2'));var express=require(_0xc07a('0x3'));var router=express[_0xc07a('0x4')]();var fs_extra=require(_0xc07a('0x5'));var auth=require(_0xc07a('0x6'));var interaction=require(_0xc07a('0x7'));var config=require(_0xc07a('0x8'));var controller=require(_0xc07a('0x9'));router[_0xc07a('0xa')]('/',auth[_0xc07a('0xb')](),controller[_0xc07a('0xc')]);router[_0xc07a('0xa')]('/describe',auth[_0xc07a('0xb')](),controller[_0xc07a('0xd')]);router[_0xc07a('0xa')](_0xc07a('0xe'),auth[_0xc07a('0xb')](),controller[_0xc07a('0xf')]);router[_0xc07a('0xa')](_0xc07a('0x10'),auth['isAuthenticated'](),controller[_0xc07a('0x11')]);router[_0xc07a('0x12')]('/',auth[_0xc07a('0xb')](),controller[_0xc07a('0x13')]);router['post']('/:id/contacts',auth[_0xc07a('0xb')](),controller[_0xc07a('0x14')]);router[_0xc07a('0x15')](_0xc07a('0xe'),auth['isAuthenticated'](),controller[_0xc07a('0x16')]);router[_0xc07a('0x17')](_0xc07a('0xe'),auth['isAuthenticated'](),controller[_0xc07a('0x18')]);module[_0xc07a('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index fc009c9..711bd17 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 _0x04ff=['UNSIGNED','DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x44c82b,_0x5d25d9){var _0x57a90a=function(_0x49dd98){while(--_0x49dd98){_0x44c82b['push'](_0x44c82b['shift']());}};_0x57a90a(++_0x5d25d9);}(_0x04ff,0x193));var _0xf04f=function(_0x2e1ef2,_0xcc4033){_0x2e1ef2=_0x2e1ef2-0x0;var _0x1aa955=_0x04ff[_0x2e1ef2];return _0x1aa955;};'use strict';var _=require('lodash');var Sequelize=require(_0xf04f('0x0'));module[_0xf04f('0x1')]={'firstName':{'type':Sequelize[_0xf04f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf04f('0x2')]},'street':{'type':Sequelize[_0xf04f('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf04f('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf04f('0x3')]},'phone':{'type':Sequelize[_0xf04f('0x2')]},'mobile':{'type':Sequelize[_0xf04f('0x2')]},'fax':{'type':Sequelize[_0xf04f('0x2')]},'email':{'type':Sequelize[_0xf04f('0x2')]},'url':{'type':Sequelize[_0xf04f('0x2')]},'facebook':{'type':Sequelize[_0xf04f('0x2')]},'fb_data':{'type':Sequelize[_0xf04f('0x2')]},'twitter':{'type':Sequelize[_0xf04f('0x2')]},'skype':{'type':Sequelize[_0xf04f('0x2')]},'teams':{'type':Sequelize[_0xf04f('0x2')]},'viber':{'type':Sequelize[_0xf04f('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xf04f('0x2')]},'UserId':{'type':Sequelize[_0xf04f('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xf04f('0x2')]},'priority':{'type':Sequelize[_0xf04f('0x4')](0x2)[_0xf04f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf04f('0x6')],'defaultValue':Sequelize[_0xf04f('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xf04f('0x4')]}};
\ No newline at end of file
+var _0x1b5d=['NOW','INTEGER','sequelize','STRING','TEXT','UNSIGNED','DATE'];(function(_0x2adb1c,_0xf054a3){var _0xb1db14=function(_0x32a57a){while(--_0x32a57a){_0x2adb1c['push'](_0x2adb1c['shift']());}};_0xb1db14(++_0xf054a3);}(_0x1b5d,0x17c));var _0xd1b5=function(_0x243fda,_0x4047fb){_0x243fda=_0x243fda-0x0;var _0x2f1c94=_0x1b5d[_0x243fda];return _0x2f1c94;};'use strict';var _=require('lodash');var Sequelize=require(_0xd1b5('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xd1b5('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd1b5('0x1')]},'street':{'type':Sequelize[_0xd1b5('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xd1b5('0x1')]},'country':{'type':Sequelize[_0xd1b5('0x1')]},'dateOfBirth':{'type':Sequelize[_0xd1b5('0x1')]},'description':{'type':Sequelize[_0xd1b5('0x2')]},'phone':{'type':Sequelize[_0xd1b5('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd1b5('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xd1b5('0x1')]},'twitter':{'type':Sequelize[_0xd1b5('0x1')]},'skype':{'type':Sequelize[_0xd1b5('0x1')]},'teams':{'type':Sequelize[_0xd1b5('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xd1b5('0x1')]},'wechat':{'type':Sequelize[_0xd1b5('0x1')]},'telegram':{'type':Sequelize[_0xd1b5('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xd1b5('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xd1b5('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd1b5('0x4')],'defaultValue':Sequelize[_0xd1b5('0x5')]},'dialTimezone':{'type':Sequelize[_0xd1b5('0x1')]},'utcOffset':{'type':Sequelize[_0xd1b5('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index db851bf..cdb51c7 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 _0xa02b=['source','destination','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','range','startCase','chat','Website','key','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','Owner','reverse','value','slice','bluebird','util','path','squel','ioredis','../../components/contacts','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','undefined','limit','offset','count','set','Content-Range','json','update','then','end','sendStatus','error','stack','name','send','index','describe','query','user','destroy','CmContact','find','params','catch','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','alias','custom','type','values','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','push','ListId','spread','contact','all','show','Tag','Tags','color','tag','CmContactHasItem','Phones','ContactItemType','sequelize','omit','format','$and','pickBy','map','cf_%d','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','text','getTags','findOne','rawAttributes','intersection','model','attributes','fields','order','sort','filters','pick','filter','options','nolimit','setTags','ids','items','item_types','ItemTypeId','description','phone','OrderBy','contact\x20phone\x20exists','CmHopperAdditionalPhone','PHONE','CmHopperId','ItemType','getAdditionalPhones','literal','`ItemType`.OrderBy','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','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','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','CompanyId','createReadStream','parse','file','import','User','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','child_process','fork','mail','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid'];(function(_0x400b64,_0x5eb1bf){var _0x1d615d=function(_0x57e8ac){while(--_0x57e8ac){_0x400b64['push'](_0x400b64['shift']());}};_0x1d615d(++_0x5eb1bf);}(_0xa02b,0x121));var _0xba02=function(_0x524234,_0x42161c){_0x524234=_0x524234-0x0;var _0x5bc9aa=_0xa02b[_0x524234];return _0x5bc9aa;};'use strict';var moment=require('moment');var BPromise=require(_0xba02('0x0'));var util=require(_0xba02('0x1'));var path=require(_0xba02('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xba02('0x3'));var Papa=require('papaparse');var Redis=require(_0xba02('0x4'));var contacts=require(_0xba02('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xba02('0x6'))(_0xba02('0x7'));var config=require(_0xba02('0x8'));var shared=require(_0xba02('0x9'));var db=require(_0xba02('0xa'))['db'];config[_0xba02('0xb')]=_[_0xba02('0xc')](config[_0xba02('0xb')],{'host':_0xba02('0xd'),'port':0x18eb});var socket=require(_0xba02('0xe'))(new Redis(config[_0xba02('0xb')]));require(_0xba02('0xf'))['register'](socket);function respondWithResult(_0x101a96,_0x14e823){_0x14e823=_0x14e823||0xc8;return function(_0x215709){if(_0x215709){return _0x101a96[_0xba02('0x10')](_0x14e823)['json'](_0x215709);}};}function respondWithFilteredResult(_0x485e17,_0x55c06b){return function(_0x3d414d){if(_0x3d414d){var _0x2ea4d9=typeof _0x55c06b['offset']===_0xba02('0x11')&&typeof _0x55c06b[_0xba02('0x12')]===_0xba02('0x11');var _0x135c2f=_0x3d414d['count'];var _0x5e904f=_0x2ea4d9?0x0:_0x55c06b[_0xba02('0x13')];var _0x6ef0ff=_0x2ea4d9?_0x3d414d[_0xba02('0x14')]:_0x55c06b[_0xba02('0x13')]+_0x55c06b[_0xba02('0x12')];var _0x4e89bc;if(_0x6ef0ff>=_0x135c2f){_0x6ef0ff=_0x135c2f;_0x4e89bc=0xc8;}else{_0x4e89bc=0xce;}_0x485e17['status'](_0x4e89bc);return _0x485e17[_0xba02('0x15')](_0xba02('0x16'),_0x5e904f+'-'+_0x6ef0ff+'/'+_0x135c2f)[_0xba02('0x17')](_0x3d414d);}return null;};}function saveUpdates(_0x231314){return function(_0x354c53){if(_0x354c53){return _0x354c53[_0xba02('0x18')](_0x231314)[_0xba02('0x19')](function(_0x3ae167){return _0x3ae167;});}return null;};}function removeEntity(_0xe0e21c){return function(_0x1ab8ee){if(_0x1ab8ee){return _0x1ab8ee['destroy']()[_0xba02('0x19')](function(){_0xe0e21c[_0xba02('0x10')](0xcc)[_0xba02('0x1a')]();});}};}function handleEntityNotFound(_0x30d80b){return function(_0x5c20d8){if(!_0x5c20d8){_0x30d80b[_0xba02('0x1b')](0x194);}return _0x5c20d8;};}function handleError(_0x576e7b,_0x5325ae){_0x5325ae=_0x5325ae||0x1f4;return function(_0x5e4784){logger[_0xba02('0x1c')](_0x5e4784[_0xba02('0x1d')]);if(_0x5e4784[_0xba02('0x1e')]){delete _0x5e4784[_0xba02('0x1e')];}_0x576e7b[_0xba02('0x10')](_0x5325ae)[_0xba02('0x1f')](_0x5e4784);};}exports[_0xba02('0x20')]=function(_0x5e0516,_0x30568c){var _0x2255cd={};return contacts[_0xba02('0x21')]()['then'](function(_0x5ad5a2){_0x2255cd=qs['getOptions'](_0x5ad5a2,_0x5e0516);return contacts['findAll'](_0x5e0516[_0xba02('0x22')],_0x5e0516[_0xba02('0x23')],_0x2255cd,_0x5ad5a2);})['then'](respondWithFilteredResult(_0x30568c,_0x2255cd))['catch'](handleError(_0x30568c,null));};exports[_0xba02('0x24')]=function(_0x26bd68,_0x54926e){return db[_0xba02('0x25')][_0xba02('0x26')]({'where':{'id':_0x26bd68[_0xba02('0x27')]['id']}})[_0xba02('0x19')](handleEntityNotFound(_0x54926e,null))['then'](removeEntity(_0x54926e,null))[_0xba02('0x28')](handleError(_0x54926e,null));};exports[_0xba02('0x21')]=function(_0x1feff5,_0x1e2786){return db[_0xba02('0x25')]['describe']()[_0xba02('0x19')](function(_0x2aa2c3){delete _0x2aa2c3[_0xba02('0x29')];for(var _0x48a363=0x0;_0x48a363
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','value','address','generate','@xcally.com','head','name','substring','indexOf','split','slice','join','length','isEmpty','anonymous','test','html','includes','attachments','forEach','push','filename','_SRC','replace','_IMG','\x20]','body','textAsHtml','0x1?_0x34e507[_0xb495('0x10')](0x0,-0x1)[_0xb495('0x11')]('\x20'):_0x2a667e[_0xb495('0xc')];}return'Anonymous';}function getLastName(_0x57e816){var _0x444a50=_[_0xb495('0xb')](_0x57e816['value']);if(_0x444a50&&_0x444a50['name']){var _0x32a1f4=_0x444a50[_0xb495('0xc')][_0xb495('0xf')](/\s+/);return _0x32a1f4['length']>0x1?_0x32a1f4['pop']():'';}return'';}function getMails(_0x3aceb9,_0x248f52){var _0x38ef4e='';for(var _0x70c392=0x0;_0x70c392<_0x248f52[_0xb495('0x7')][_0xb495('0x12')];_0x70c392+=0x1){if(_0x248f52[_0xb495('0x7')][_0x70c392][_0xb495('0x8')]!==_0x3aceb9){if(!_[_0xb495('0x13')](_0x38ef4e)){_0x38ef4e+=',';}_0x38ef4e+=_0x248f52['value'][_0x70c392][_0xb495('0xc')]||_0x248f52[_0xb495('0x7')][_0x70c392][_0xb495('0x8')]||'';_0x38ef4e+='\x20<';_0x38ef4e+=_0x248f52[_0xb495('0x7')][_0x70c392][_0xb495('0x8')]?_0x248f52['value'][_0x70c392]['address']:_0xb495('0x14')+random[_0xb495('0x9')](0x6)+'@xcally.com';_0x38ef4e+='>';}}return _0x38ef4e;}function parseEmail(_0x4c1be2,_0x36daf2,_0x5354e8){if(_0x36daf2['html']){var _0x3cc95b=/