From: support
Date: Mon, 27 Mar 2023 16:01:23 +0000 (+0000)
Subject: Built motion from commit a8c4dd89.|2.6.33
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=3d532920379767b510d2b61bc83c97d9b1f6d2b5;p=motion2.git
Built motion from commit a8c4dd89.|2.6.33
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 9ca8756..71a49a3 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.31",
+ "version": "2.6.33",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-27T07:22:02.593Z",
+ "time": "2023-03-27T15:51:14.173Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 467234a..9896e72 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.31",
+ "version": "2.6.33",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-27T07:22:02.593Z",
+ "time": "2023-03-27T15:51:14.173Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index b5730ae..22e1ad1 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.31",
+ "version": "2.6.33",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index 5e87c80..b4c0db1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.31",
+ "version": "2.6.33",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index b8b3b5d..a9e22a9 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 _0xa004=['urlForward[body]','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa004,0x13c));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4a00('0x0')],'get':function(_0x1650f8){return this[_0x4a00('0x1')](_0x4a00('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x4a00('0x3'),_0x4a00('0x4'),_0x4a00('0x5'),_0x4a00('0x6'),_0x4a00('0x7'),_0x4a00('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4a00('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x4a00('0xa')},'data2':{'type':Sequelize[_0x4a00('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x4a00('0xb')](0x1000),'comment':_0x4a00('0xc')},'data4':{'type':Sequelize[_0x4a00('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x4a00('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x4a00('0xb')],'comments':_0x4a00('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':_0x4a00('0xe')}};
\ No newline at end of file
+var _0x6877=['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','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x758e7f,_0x128061){var _0x1ad1e6=function(_0x1c1e6d){while(--_0x1c1e6d){_0x758e7f['push'](_0x758e7f['shift']());}};_0x1ad1e6(++_0x128061);}(_0x6877,0xb5));var _0x7687=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x6877[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0x7687('0x0'));module[_0x7687('0x1')]={'name':{'type':Sequelize[_0x7687('0x2')],'get':function(_0x3e8c55){return this[_0x7687('0x3')](_0x7687('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7687('0x5'),_0x7687('0x6'),_0x7687('0x7'),_0x7687('0x8'),_0x7687('0x9'),_0x7687('0xa'),_0x7687('0xb'),_0x7687('0xc')]],'msg':_0x7687('0xd')}},'comment':_0x7687('0xd')},'data1':{'type':Sequelize[_0x7687('0xe')](0x1000),'comment':_0x7687('0xf')},'data2':{'type':Sequelize[_0x7687('0xe')](0x1000),'comment':_0x7687('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x7687('0x11')},'data5':{'type':Sequelize[_0x7687('0xe')](0x1000),'comments':_0x7687('0x12')},'data6':{'type':Sequelize['STRING'],'comments':_0x7687('0x13')},'data7':{'type':Sequelize[_0x7687('0x14')],'comments':_0x7687('0x15')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2252a92..811263a 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 _0xb8be=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','find','params','catch','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d6bab,_0x3242db){var _0x348415=function(_0x324f3b){while(--_0x324f3b){_0x3d6bab['push'](_0x3d6bab['shift']());}};_0x348415(++_0x3242db);}(_0xb8be,0x112));var _0xeb8b=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0xb8be[_0xb83ec2];return _0x4d2fbf;};'use strict';var emlformat=require(_0xeb8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb8b('0x1'));var jsonpatch=require(_0xeb8b('0x2'));var rp=require(_0xeb8b('0x3'));var moment=require(_0xeb8b('0x4'));var BPromise=require(_0xeb8b('0x5'));var Mustache=require(_0xeb8b('0x6'));var util=require(_0xeb8b('0x7'));var path=require(_0xeb8b('0x8'));var sox=require(_0xeb8b('0x9'));var csv=require(_0xeb8b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb8b('0xb'));var _=require(_0xeb8b('0xc'));var squel=require('squel');var crypto=require(_0xeb8b('0xd'));var jsforce=require(_0xeb8b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xeb8b('0xa'));var querystring=require(_0xeb8b('0xf'));var Papa=require(_0xeb8b('0x10'));var Redis=require(_0xeb8b('0x11'));var authService=require(_0xeb8b('0x12'));var qs=require(_0xeb8b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb8b('0x14'));var logger=require(_0xeb8b('0x15'))(_0xeb8b('0x16'));var utils=require(_0xeb8b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xeb8b('0x18'));var db=require(_0xeb8b('0x19'))['db'];function respondWithStatusCode(_0x14b315,_0x53fc8a){_0x53fc8a=_0x53fc8a||0xcc;return function(_0x2fa880){if(_0x2fa880){return _0x14b315[_0xeb8b('0x1a')](_0x53fc8a);}return _0x14b315[_0xeb8b('0x1b')](_0x53fc8a)[_0xeb8b('0x1c')]();};}function respondWithResult(_0x2cc08c,_0x923f68){_0x923f68=_0x923f68||0xc8;return function(_0x4a99f0){if(_0x4a99f0){return _0x2cc08c[_0xeb8b('0x1b')](_0x923f68)[_0xeb8b('0x1d')](_0x4a99f0);}};}function respondWithFilteredResult(_0xa6a6d3,_0x2f5e86){return function(_0x174f35){if(_0x174f35){var _0x5e944e=typeof _0x2f5e86[_0xeb8b('0x1e')]===_0xeb8b('0x1f')&&typeof _0x2f5e86[_0xeb8b('0x20')]===_0xeb8b('0x1f');var _0x4d242b=_0x174f35[_0xeb8b('0x21')];var _0x5cc01b=_0x5e944e?0x0:_0x2f5e86[_0xeb8b('0x1e')];var _0x4dbb3a=_0x5e944e?_0x174f35[_0xeb8b('0x21')]:_0x2f5e86['offset']+_0x2f5e86['limit'];var _0x358a60;if(_0x4dbb3a>=_0x4d242b){_0x4dbb3a=_0x4d242b;_0x358a60=0xc8;}else{_0x358a60=0xce;}_0xa6a6d3[_0xeb8b('0x1b')](_0x358a60);return _0xa6a6d3['set'](_0xeb8b('0x22'),_0x5cc01b+'-'+_0x4dbb3a+'/'+_0x4d242b)['json'](_0x174f35);}return null;};}function patchUpdates(_0x5180c4){return function(_0x531642){try{jsonpatch[_0xeb8b('0x23')](_0x531642,_0x5180c4,!![]);}catch(_0x5796ed){return BPromise[_0xeb8b('0x24')](_0x5796ed);}return _0x531642['save']();};}function saveUpdates(_0x10aae0,_0x52140b){return function(_0x2c1692){if(_0x2c1692){return _0x2c1692[_0xeb8b('0x25')](_0x10aae0)[_0xeb8b('0x26')](function(_0x5f428f){return _0x5f428f;});}return null;};}function removeEntity(_0x5bf474,_0x399e5b){return function(_0x2e81a4){if(_0x2e81a4){return _0x2e81a4[_0xeb8b('0x27')]()[_0xeb8b('0x26')](function(){_0x5bf474['status'](0xcc)[_0xeb8b('0x1c')]();});}};}function handleEntityNotFound(_0x7249e9,_0xef8c2){return function(_0x16ef5f){if(!_0x16ef5f){_0x7249e9[_0xeb8b('0x1a')](0x194);}return _0x16ef5f;};}function handleError(_0x686637,_0x4a5342){_0x4a5342=_0x4a5342||0x1f4;return function(_0xd29ff1){logger[_0xeb8b('0x28')](_0xd29ff1[_0xeb8b('0x29')]);if(_0xd29ff1[_0xeb8b('0x2a')]){delete _0xd29ff1[_0xeb8b('0x2a')];}_0x686637['status'](_0x4a5342)[_0xeb8b('0x2b')](_0xd29ff1);};}exports[_0xeb8b('0x25')]=function(_0x1f57cf,_0xd8b4e2){if(_0x1f57cf[_0xeb8b('0x2c')]['id']){delete _0x1f57cf[_0xeb8b('0x2c')]['id'];}return db['Action'][_0xeb8b('0x2d')]({'where':{'id':_0x1f57cf[_0xeb8b('0x2e')]['id']}})[_0xeb8b('0x26')](handleEntityNotFound(_0xd8b4e2,null))[_0xeb8b('0x26')](saveUpdates(_0x1f57cf[_0xeb8b('0x2c')],null))['then'](respondWithResult(_0xd8b4e2,null))[_0xeb8b('0x2f')](handleError(_0xd8b4e2,null));};exports[_0xeb8b('0x27')]=function(_0x4dc512,_0x53ccc4){return db[_0xeb8b('0x30')][_0xeb8b('0x2d')]({'where':{'id':_0x4dc512[_0xeb8b('0x2e')]['id']}})['then'](handleEntityNotFound(_0x53ccc4,null))[_0xeb8b('0x26')](removeEntity(_0x53ccc4,null))[_0xeb8b('0x2f')](handleError(_0x53ccc4,null));};
\ No newline at end of file
+var _0x9322=['limit','undefined','count','set','Content-Range','reject','then','destroy','end','error','stack','name','send','body','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x1098bf,_0x1adfc5){var _0x1e130a=function(_0x55e577){while(--_0x55e577){_0x1098bf['push'](_0x1098bf['shift']());}};_0x1e130a(++_0x1adfc5);}(_0x9322,0x1c0));var _0x2932=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9322[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x2932('0x0'));var rimraf=require(_0x2932('0x1'));var zipdir=require(_0x2932('0x2'));var jsonpatch=require(_0x2932('0x3'));var rp=require(_0x2932('0x4'));var moment=require(_0x2932('0x5'));var BPromise=require(_0x2932('0x6'));var Mustache=require(_0x2932('0x7'));var util=require('util');var path=require(_0x2932('0x8'));var sox=require(_0x2932('0x9'));var csv=require('to-csv');var ejs=require(_0x2932('0xa'));var fs=require('fs');var fs_extra=require(_0x2932('0xb'));var _=require('lodash');var squel=require(_0x2932('0xc'));var crypto=require('crypto');var jsforce=require(_0x2932('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2932('0xe'));var querystring=require(_0x2932('0xf'));var Papa=require(_0x2932('0x10'));var Redis=require(_0x2932('0x11'));var authService=require(_0x2932('0x12'));var qs=require(_0x2932('0x13'));var as=require(_0x2932('0x14'));var hardwareService=require(_0x2932('0x15'));var logger=require(_0x2932('0x16'))(_0x2932('0x17'));var utils=require(_0x2932('0x18'));var config=require(_0x2932('0x19'));var licenseUtil=require(_0x2932('0x1a'));var db=require(_0x2932('0x1b'))['db'];function respondWithStatusCode(_0x4dda2a,_0x4b233c){_0x4b233c=_0x4b233c||0xcc;return function(_0x407dde){if(_0x407dde){return _0x4dda2a[_0x2932('0x1c')](_0x4b233c);}return _0x4dda2a[_0x2932('0x1d')](_0x4b233c)['end']();};}function respondWithResult(_0x465df5,_0x299b97){_0x299b97=_0x299b97||0xc8;return function(_0x13b5b9){if(_0x13b5b9){return _0x465df5[_0x2932('0x1d')](_0x299b97)[_0x2932('0x1e')](_0x13b5b9);}};}function respondWithFilteredResult(_0xf9cc74,_0xcfc2a1){return function(_0x238a76){if(_0x238a76){var _0x4a1d21=typeof _0xcfc2a1[_0x2932('0x1f')]==='undefined'&&typeof _0xcfc2a1[_0x2932('0x20')]===_0x2932('0x21');var _0x5c89e7=_0x238a76[_0x2932('0x22')];var _0x3f8387=_0x4a1d21?0x0:_0xcfc2a1[_0x2932('0x1f')];var _0x4eb3ee=_0x4a1d21?_0x238a76[_0x2932('0x22')]:_0xcfc2a1['offset']+_0xcfc2a1[_0x2932('0x20')];var _0x2147ee;if(_0x4eb3ee>=_0x5c89e7){_0x4eb3ee=_0x5c89e7;_0x2147ee=0xc8;}else{_0x2147ee=0xce;}_0xf9cc74['status'](_0x2147ee);return _0xf9cc74[_0x2932('0x23')](_0x2932('0x24'),_0x3f8387+'-'+_0x4eb3ee+'/'+_0x5c89e7)[_0x2932('0x1e')](_0x238a76);}return null;};}function patchUpdates(_0x181126){return function(_0x326012){try{jsonpatch['apply'](_0x326012,_0x181126,!![]);}catch(_0x8018a7){return BPromise[_0x2932('0x25')](_0x8018a7);}return _0x326012['save']();};}function saveUpdates(_0x587598,_0x5cf397){return function(_0x3765ea){if(_0x3765ea){return _0x3765ea['update'](_0x587598)[_0x2932('0x26')](function(_0x5df732){return _0x5df732;});}return null;};}function removeEntity(_0x289d68,_0x3deb36){return function(_0x57b872){if(_0x57b872){return _0x57b872[_0x2932('0x27')]()[_0x2932('0x26')](function(){_0x289d68['status'](0xcc)[_0x2932('0x28')]();});}};}function handleEntityNotFound(_0x2e5b52,_0x2d971c){return function(_0x329c7c){if(!_0x329c7c){_0x2e5b52[_0x2932('0x1c')](0x194);}return _0x329c7c;};}function handleError(_0x4e9951,_0x1c4711){_0x1c4711=_0x1c4711||0x1f4;return function(_0x1047b2){logger[_0x2932('0x29')](_0x1047b2[_0x2932('0x2a')]);if(_0x1047b2[_0x2932('0x2b')]){delete _0x1047b2['name'];}_0x4e9951[_0x2932('0x1d')](_0x1c4711)[_0x2932('0x2c')](_0x1047b2);};}exports['update']=function(_0x4efe19,_0x3a1070){if(_0x4efe19[_0x2932('0x2d')]['id']){delete _0x4efe19[_0x2932('0x2d')]['id'];}return db[_0x2932('0x2e')]['find']({'where':{'id':_0x4efe19[_0x2932('0x2f')]['id']}})[_0x2932('0x26')](handleEntityNotFound(_0x3a1070,null))[_0x2932('0x26')](saveUpdates(_0x4efe19[_0x2932('0x2d')],null))[_0x2932('0x26')](respondWithResult(_0x3a1070,null))['catch'](handleError(_0x3a1070,null));};exports[_0x2932('0x27')]=function(_0x4f2767,_0xf50b6f){return db[_0x2932('0x2e')]['find']({'where':{'id':_0x4f2767[_0x2932('0x2f')]['id']}})[_0x2932('0x26')](handleEntityNotFound(_0xf50b6f,null))['then'](removeEntity(_0xf50b6f,null))['catch'](handleError(_0xf50b6f,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d12d693..dad8473 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 _0x1572=['./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5845db,_0x562571){var _0x79f401=function(_0x39eee1){while(--_0x39eee1){_0x5845db['push'](_0x5845db['shift']());}};_0x79f401(++_0x562571);}(_0x1572,0xf5));var _0x2157=function(_0x3967e3,_0x173410){_0x3967e3=_0x3967e3-0x0;var _0x572629=_0x1572[_0x3967e3];return _0x572629;};'use strict';var _=require(_0x2157('0x0'));var util=require(_0x2157('0x1'));var logger=require(_0x2157('0x2'))(_0x2157('0x3'));var moment=require(_0x2157('0x4'));var BPromise=require(_0x2157('0x5'));var rp=require(_0x2157('0x6'));var fs=require('fs');var path=require(_0x2157('0x7'));var rimraf=require(_0x2157('0x8'));var config=require(_0x2157('0x9'));var attributes=require(_0x2157('0xa'));module[_0x2157('0xb')]=function(_0x2f13ab,_0x9e1c46){return _0x2f13ab[_0x2157('0xc')](_0x2157('0xd'),attributes,{'tableName':_0x2157('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6208=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','util'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x6208,0x192));var _0x8620=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x6208[_0x44c768];return _0x55daf5;};'use strict';var _=require('lodash');var util=require(_0x8620('0x0'));var logger=require(_0x8620('0x1'))(_0x8620('0x2'));var moment=require(_0x8620('0x3'));var BPromise=require(_0x8620('0x4'));var rp=require(_0x8620('0x5'));var fs=require('fs');var path=require(_0x8620('0x6'));var rimraf=require(_0x8620('0x7'));var config=require(_0x8620('0x8'));var attributes=require(_0x8620('0x9'));module['exports']=function(_0x1069e7,_0x431cfc){return _0x1069e7[_0x8620('0xa')](_0x8620('0xb'),attributes,{'tableName':_0x8620('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 61e6511..b11187b 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1aa10b,_0x1fdaeb){var _0x2ec705=function(_0x34fde7){while(--_0x34fde7){_0x1aa10b['push'](_0x1aa10b['shift']());}};_0x2ec705(++_0x1fdaeb);}(_0xabce,0x103));var _0xeabc=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xabce[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x65a7d8,_0x481040){var _0x3207bf=function(_0x199b26){while(--_0x199b26){_0x65a7d8['push'](_0x65a7d8['shift']());}};_0x3207bf(++_0x481040);}(_0xe14b,0x93));var _0xbe14=function(_0x492bf9,_0x3494c9){_0x492bf9=_0x492bf9-0x0;var _0x2df282=_0xe14b[_0x492bf9];return _0x2df282;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 040a294..b9a6156 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 _0xad0f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','multer','util'];(function(_0x267fa6,_0x12d275){var _0xd93bde=function(_0xe8a28d){while(--_0xe8a28d){_0x267fa6['push'](_0x267fa6['shift']());}};_0xd93bde(++_0x12d275);}(_0xad0f,0x1b8));var _0xfad0=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0xad0f[_0x427217];return _0x5b28fb;};'use strict';var multer=require(_0xfad0('0x0'));var util=require(_0xfad0('0x1'));var path=require('path');var timeout=require(_0xfad0('0x2'));var express=require('express');var router=express[_0xfad0('0x3')]();var fs_extra=require(_0xfad0('0x4'));var auth=require(_0xfad0('0x5'));var interaction=require(_0xfad0('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xfad0('0x7')](_0xfad0('0x8'),auth[_0xfad0('0x9')](),controller[_0xfad0('0xa')]);router[_0xfad0('0xb')](_0xfad0('0x8'),auth[_0xfad0('0x9')](),controller[_0xfad0('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xad91=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x4c538c,_0x46c4dc){var _0x236796=function(_0x10c34f){while(--_0x10c34f){_0x4c538c['push'](_0x4c538c['shift']());}};_0x236796(++_0x46c4dc);}(_0xad91,0x91));var _0x1ad9=function(_0x593b33,_0x1ea034){_0x593b33=_0x593b33-0x0;var _0x2f17a2=_0xad91[_0x593b33];return _0x2f17a2;};'use strict';var multer=require('multer');var util=require(_0x1ad9('0x0'));var path=require(_0x1ad9('0x1'));var timeout=require(_0x1ad9('0x2'));var express=require(_0x1ad9('0x3'));var router=express[_0x1ad9('0x4')]();var fs_extra=require(_0x1ad9('0x5'));var auth=require(_0x1ad9('0x6'));var interaction=require(_0x1ad9('0x7'));var config=require(_0x1ad9('0x8'));var controller=require(_0x1ad9('0x9'));router[_0x1ad9('0xa')](_0x1ad9('0xb'),auth[_0x1ad9('0xc')](),controller['update']);router['delete'](_0x1ad9('0xb'),auth[_0x1ad9('0xc')](),controller[_0x1ad9('0xd')]);module[_0x1ad9('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 c4854eb..c6166d1 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x408acc,_0x33c9ae){var _0x4208c5=function(_0xa1ffbe){while(--_0xa1ffbe){_0x408acc['push'](_0x408acc['shift']());}};_0x4208c5(++_0x33c9ae);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x3b38fc,_0x381fac){_0x3b38fc=_0x3b38fc-0x0;var _0x5b7b96=_0x3eea[_0x3b38fc];return _0x5b7b96;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x340d49,_0x4ee2b4){var _0x2cf1ec=function(_0x12f166){while(--_0x12f166){_0x340d49['push'](_0x340d49['shift']());}};_0x2cf1ec(++_0x4ee2b4);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 622b57f..762a761 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 _0x8967=['../../mysqldb','dbH','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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\x20NOT\x20EMPTY','rules','group','field','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','IS\x20NULL','IS\x20EMPTY','operator','condition','value','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','runReport','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4304b0,_0x2a83af){var _0x3e303a=function(_0x2df888){while(--_0x2df888){_0x4304b0['push'](_0x4304b0['shift']());}};_0x3e303a(++_0x2a83af);}(_0x8967,0x13b));var _0x7896=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x8967[_0x39772f];return _0xc9edbf;};'use strict';var emlformat=require(_0x7896('0x0'));var rimraf=require(_0x7896('0x1'));var zipdir=require(_0x7896('0x2'));var jsonpatch=require(_0x7896('0x3'));var rp=require(_0x7896('0x4'));var moment=require(_0x7896('0x5'));var BPromise=require(_0x7896('0x6'));var Mustache=require(_0x7896('0x7'));var util=require(_0x7896('0x8'));var path=require(_0x7896('0x9'));var sox=require(_0x7896('0xa'));var csv=require(_0x7896('0xb'));var ejs=require(_0x7896('0xc'));var fs=require('fs');var fs_extra=require(_0x7896('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7896('0xe'));var deskjs=require(_0x7896('0xf'));var toCsv=require(_0x7896('0xb'));var querystring=require(_0x7896('0x10'));var Papa=require('papaparse');var Redis=require(_0x7896('0x11'));var authService=require(_0x7896('0x12'));var qs=require(_0x7896('0x13'));var as=require(_0x7896('0x14'));var hardwareService=require(_0x7896('0x15'));var logger=require(_0x7896('0x16'))(_0x7896('0x17'));var utils=require(_0x7896('0x18'));var config=require(_0x7896('0x19'));var licenseUtil=require(_0x7896('0x1a'));var db=require(_0x7896('0x1b'))['db'];var dbH=require(_0x7896('0x1b'))[_0x7896('0x1c')];function respondWithStatusCode(_0x3c84fc,_0x1942c6){_0x1942c6=_0x1942c6||0xcc;return function(_0x26215d){if(_0x26215d){return _0x3c84fc[_0x7896('0x1d')](_0x1942c6);}return _0x3c84fc[_0x7896('0x1e')](_0x1942c6)[_0x7896('0x1f')]();};}function respondWithResult(_0x4c8213,_0x36c2d6){_0x36c2d6=_0x36c2d6||0xc8;return function(_0x54b6ae){if(_0x54b6ae){return _0x4c8213[_0x7896('0x1e')](_0x36c2d6)['json'](_0x54b6ae);}};}function respondWithFilteredResult(_0x5bb3f0,_0x5db57c){return function(_0x308263){if(_0x308263){var _0x90348f=typeof _0x5db57c[_0x7896('0x20')]==='undefined'&&typeof _0x5db57c['limit']===_0x7896('0x21');var _0x3a1821=_0x308263[_0x7896('0x22')];var _0x14375c=_0x90348f?0x0:_0x5db57c[_0x7896('0x20')];var _0x2af1d3=_0x90348f?_0x308263[_0x7896('0x22')]:_0x5db57c['offset']+_0x5db57c[_0x7896('0x23')];var _0x348295;if(_0x2af1d3>=_0x3a1821){_0x2af1d3=_0x3a1821;_0x348295=0xc8;}else{_0x348295=0xce;}_0x5bb3f0[_0x7896('0x1e')](_0x348295);return _0x5bb3f0[_0x7896('0x24')](_0x7896('0x25'),_0x14375c+'-'+_0x2af1d3+'/'+_0x3a1821)[_0x7896('0x26')](_0x308263);}return null;};}function patchUpdates(_0x1fc8a1){return function(_0x46d94a){try{jsonpatch[_0x7896('0x27')](_0x46d94a,_0x1fc8a1,!![]);}catch(_0x439029){return BPromise[_0x7896('0x28')](_0x439029);}return _0x46d94a[_0x7896('0x29')]();};}function saveUpdates(_0x1d9086,_0x510315){return function(_0x287cd6){if(_0x287cd6){return _0x287cd6[_0x7896('0x2a')](_0x1d9086)[_0x7896('0x2b')](function(_0x34c89c){return _0x34c89c;});}return null;};}function removeEntity(_0x283b12,_0x1c1018){return function(_0x2a652a){if(_0x2a652a){return _0x2a652a[_0x7896('0x2c')]()[_0x7896('0x2b')](function(){var _0x4c90e5=_0x2a652a[_0x7896('0x2d')]({'plain':!![]});var _0xbb87b0=_0x7896('0x2e');return db[_0x7896('0x2f')][_0x7896('0x2c')]({'where':{'type':_0xbb87b0,'resourceId':_0x4c90e5['id']}})[_0x7896('0x2b')](function(){return _0x2a652a;});})['then'](function(){_0x283b12[_0x7896('0x1e')](0xcc)[_0x7896('0x1f')]();});}};}function handleEntityNotFound(_0xa14a44,_0x5261dc){return function(_0x3697bf){if(!_0x3697bf){_0xa14a44[_0x7896('0x1d')](0x194);}return _0x3697bf;};}function handleError(_0xdfa8b0,_0x187f29){_0x187f29=_0x187f29||0x1f4;return function(_0x32deb9){logger[_0x7896('0x30')](_0x32deb9[_0x7896('0x31')]);if(_0x32deb9['name']){delete _0x32deb9[_0x7896('0x32')];}_0xdfa8b0['status'](_0x187f29)[_0x7896('0x33')](_0x32deb9);};}exports[_0x7896('0x34')]=function(_0x11844e,_0x48c992){var _0x5d4edf={},_0xc69d54={},_0x470f1f={'count':0x0,'rows':[]};var _0x3f3599=_[_0x7896('0x35')](db[_0x7896('0x36')][_0x7896('0x37')],function(_0xd08776){return{'name':_0xd08776[_0x7896('0x38')],'type':_0xd08776[_0x7896('0x39')]['key']};});_0xc69d54[_0x7896('0x3a')]=_['map'](_0x3f3599,_0x7896('0x32'));_0xc69d54[_0x7896('0x3b')]=_[_0x7896('0x3c')](_0x11844e['query']);_0xc69d54['filters']=_[_0x7896('0x3d')](_0xc69d54[_0x7896('0x3a')],_0xc69d54[_0x7896('0x3b')]);_0x5d4edf[_0x7896('0x3e')]=_[_0x7896('0x3d')](_0xc69d54[_0x7896('0x3a')],qs[_0x7896('0x3f')](_0x11844e[_0x7896('0x3b')][_0x7896('0x3f')]));_0x5d4edf['attributes']=_0x5d4edf[_0x7896('0x3e')][_0x7896('0x40')]?_0x5d4edf[_0x7896('0x3e')]:_0xc69d54[_0x7896('0x3a')];if(!_0x11844e[_0x7896('0x3b')][_0x7896('0x41')](_0x7896('0x42'))){_0x5d4edf[_0x7896('0x23')]=qs[_0x7896('0x23')](_0x11844e[_0x7896('0x3b')][_0x7896('0x23')]);_0x5d4edf['offset']=qs[_0x7896('0x20')](_0x11844e[_0x7896('0x3b')][_0x7896('0x20')]);}_0x5d4edf[_0x7896('0x43')]=qs[_0x7896('0x44')](_0x11844e[_0x7896('0x3b')]['sort']);_0x5d4edf[_0x7896('0x45')]=qs[_0x7896('0x46')](_[_0x7896('0x47')](_0x11844e[_0x7896('0x3b')],_0xc69d54['filters']),_0x3f3599);if(_0x11844e[_0x7896('0x3b')]['filter']){_0x5d4edf[_0x7896('0x45')]=_[_0x7896('0x48')](_0x5d4edf['where'],{'$or':_['map'](_0x3f3599,function(_0x36c029){if(_0x36c029['type']!==_0x7896('0x49')){var _0xdbdeef={};_0xdbdeef[_0x36c029['name']]={'$like':'%'+_0x11844e[_0x7896('0x3b')]['filter']+'%'};return _0xdbdeef;}})});}_0x5d4edf=_['merge']({},_0x5d4edf,_0x11844e[_0x7896('0x4a')]);var _0x478071={'where':_0x5d4edf[_0x7896('0x45')]};return db[_0x7896('0x36')]['count'](_0x478071)[_0x7896('0x2b')](function(_0x1b59db){_0x470f1f[_0x7896('0x22')]=_0x1b59db;if(_0x11844e[_0x7896('0x3b')][_0x7896('0x4b')]){_0x5d4edf[_0x7896('0x4c')]=[{'all':!![]}];}return db[_0x7896('0x36')]['findAll'](_0x5d4edf);})[_0x7896('0x2b')](function(_0x24fdc6){_0x470f1f[_0x7896('0x4d')]=_0x24fdc6;return _0x470f1f;})[_0x7896('0x2b')](respondWithFilteredResult(_0x48c992,_0x5d4edf))['catch'](handleError(_0x48c992,null));};exports[_0x7896('0x4e')]=function(_0x29f21b,_0x1d9db5){var _0x4ef3de={'raw':![],'where':{'id':_0x29f21b[_0x7896('0x4f')]['id']}},_0xed06b={};_0xed06b['model']=_[_0x7896('0x3c')](db[_0x7896('0x36')]['rawAttributes']);_0xed06b[_0x7896('0x3b')]=_[_0x7896('0x3c')](_0x29f21b[_0x7896('0x3b')]);_0xed06b['filters']=_[_0x7896('0x3d')](_0xed06b['model'],_0xed06b[_0x7896('0x3b')]);_0x4ef3de[_0x7896('0x3e')]=_['intersection'](_0xed06b[_0x7896('0x3a')],qs[_0x7896('0x3f')](_0x29f21b[_0x7896('0x3b')][_0x7896('0x3f')]));_0x4ef3de[_0x7896('0x3e')]=_0x4ef3de[_0x7896('0x3e')]['length']?_0x4ef3de['attributes']:_0xed06b['model'];if(_0x29f21b[_0x7896('0x3b')][_0x7896('0x4b')]){_0x4ef3de[_0x7896('0x4c')]=[{'all':!![]}];}_0x4ef3de=_[_0x7896('0x48')]({},_0x4ef3de,_0x29f21b[_0x7896('0x4a')]);return db[_0x7896('0x36')][_0x7896('0x50')](_0x4ef3de)[_0x7896('0x2b')](handleEntityNotFound(_0x1d9db5,null))[_0x7896('0x2b')](respondWithResult(_0x1d9db5,null))[_0x7896('0x51')](handleError(_0x1d9db5,null));};exports[_0x7896('0x52')]=function(_0x422d29,_0x4265a1){return db['AnalyticCustomReport'][_0x7896('0x52')](_0x422d29[_0x7896('0x53')],{})[_0x7896('0x2b')](function(_0x142361){var _0x2991bf=_0x422d29[_0x7896('0x54')][_0x7896('0x2d')]({'plain':!![]});if(!_0x2991bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2991bf['role']==='user'){var _0x54f9e9=_0x142361['get']({'plain':!![]});var _0x50b3d5='Reports';return db[_0x7896('0x55')][_0x7896('0x50')]({'where':{'name':_0x50b3d5,'userProfileId':_0x2991bf['userProfileId']},'raw':!![]})[_0x7896('0x2b')](function(_0x24431e){if(_0x24431e&&_0x24431e[_0x7896('0x56')]===0x0){return db[_0x7896('0x2f')][_0x7896('0x52')]({'name':_0x54f9e9['name'],'resourceId':_0x54f9e9['id'],'type':_0x7896('0x2e'),'sectionId':_0x24431e['id']},{})[_0x7896('0x2b')](function(){return _0x142361;});}else{return _0x142361;}})['catch'](function(_0x3dfe78){logger[_0x7896('0x30')](_0x7896('0x57'),_0x3dfe78);throw _0x3dfe78;});}return _0x142361;})['then'](respondWithResult(_0x4265a1,0xc9))[_0x7896('0x51')](handleError(_0x4265a1,null));};exports[_0x7896('0x2a')]=function(_0xc97ebd,_0x5d9a45){if(_0xc97ebd[_0x7896('0x53')]['id']){delete _0xc97ebd['body']['id'];}return db[_0x7896('0x36')]['find']({'where':{'id':_0xc97ebd[_0x7896('0x4f')]['id']}})[_0x7896('0x2b')](handleEntityNotFound(_0x5d9a45,null))[_0x7896('0x2b')](saveUpdates(_0xc97ebd[_0x7896('0x53')],null))['then'](respondWithResult(_0x5d9a45,null))[_0x7896('0x51')](handleError(_0x5d9a45,null));};exports[_0x7896('0x2c')]=function(_0x582734,_0x5eb072){return db[_0x7896('0x36')][_0x7896('0x50')]({'where':{'id':_0x582734[_0x7896('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5eb072,null))[_0x7896('0x2b')](removeEntity(_0x5eb072,null))[_0x7896('0x51')](handleError(_0x5eb072,null));};exports['preview']=function(_0x37a2bb,_0x24336c){var _0x353d10=0xa;var _0x207fe4=[_0x7896('0x58'),_0x7896('0x59'),_0x7896('0x5a'),_0x7896('0x5b')];var _0x4cd9cb={'SUM':_0x7896('0x5c'),'COUNT':_0x7896('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7896('0x5e'),'MIN':_0x7896('0x5f'),'AVG':_0x7896('0x60'),'GROUP_CONCAT':_0x7896('0x61'),'GROUP_CONCAT ASC':_0x7896('0x62'),'GROUP_CONCAT DESC':_0x7896('0x63')};var _0x312795={'SEC_TO_TIME':_0x7896('0x64'),'DATE':_0x7896('0x65'),'HOUR':_0x7896('0x66'),'ROUND':_0x7896('0x67'),'UNIX_TIMESTAMP':_0x7896('0x68')};var _0x3f3d2a=function(_0x443747){return!_[_0x7896('0x69')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x7896('0x6a')],_0x443747);};var _0x4ad86b=function(_0x3b95d0){if(!_0x3b95d0||!_0x3b95d0[_0x7896('0x6b')][_0x7896('0x40')]){return'';}for(var _0x17c0c5='(',_0x1e4a50=0x0;_0x1e4a50<_0x3b95d0[_0x7896('0x6b')][_0x7896('0x40')];_0x1e4a50+=0x1){_0x1e4a50>0x0&&(_0x17c0c5+='\x20'+_0x3b95d0['operator']+'\x20');_0x17c0c5+=_0x3b95d0[_0x7896('0x6b')][_0x1e4a50][_0x7896('0x6c')]?_0x4ad86b(_0x3b95d0[_0x7896('0x6b')][_0x1e4a50]['group']):_0x3b95d0[_0x7896('0x6b')][_0x1e4a50][_0x7896('0x6d')]+'\x20'+_0x3b95d0[_0x7896('0x6b')][_0x1e4a50]['condition']+(_0x3f3d2a(_0x3b95d0['rules'][_0x1e4a50]['condition'])?'\x20'+_0x3b95d0[_0x7896('0x6b')][_0x1e4a50]['value']:'');}return _0x17c0c5+')';};var _0x28fb43={'where':{'id':_0x37a2bb['params']['id']}},_0x16c8fa,_0xf7ca4,_0x23fa4b,_0x5a1bf0,_0x4b368a;_0x28fb43=_['merge']({},_0x28fb43,_0x37a2bb['options']);return db[_0x7896('0x36')]['find'](_0x28fb43)['then'](function(_0x335f39){if(_0x335f39){_0x16c8fa=_0x335f39;return _0x335f39[_0x7896('0x6e')]();}return null;})['then'](function(_0x121ca9){if(_0x121ca9){if(!_0x121ca9['length']){throw new db[(_0x7896('0x6f'))][(_0x7896('0x70'))](_0x7896('0x71'),0x193);}_0xf7ca4=_0x121ca9;return db[_0x7896('0x72')][_0x7896('0x73')]({'raw':!![]});}return null;})[_0x7896('0x2b')](function(_0x2f89f1){if(_0x2f89f1){_0x23fa4b=_[_0x7896('0x74')](_0x2f89f1,'id');var _0x2959bd;var _0x2c4b8b=squel[_0x7896('0x75')]();_0x2c4b8b['from'](_0x16c8fa[_0x7896('0x76')]);for(var _0x169444=0x0;_0x169444<_0xf7ca4[_0x7896('0x40')];_0x169444+=0x1){_0x2959bd=_0xf7ca4[_0x169444][_0x7896('0x77')]?_0x23fa4b[_0xf7ca4[_0x169444]['MetricId']][_0x7896('0x78')]:_0xf7ca4[_0x169444][_0x7896('0x6d')];_0x2959bd=_0xf7ca4[_0x169444]['function']?_[_0x7896('0x79')](_0x4cd9cb[_0xf7ca4[_0x169444][_0x7896('0x7a')]],'%s',_0x2959bd):_0x2959bd;_0x2959bd=_0xf7ca4[_0x169444][_0x7896('0x7b')]?_[_0x7896('0x79')](_0x312795[_0xf7ca4[_0x169444][_0x7896('0x7b')]],'%s',_0x2959bd):_0x2959bd;if(_0xf7ca4[_0x169444][_0x7896('0x7c')]){_0x2c4b8b[_0x7896('0x6c')](_0x2959bd);}_0xf7ca4[_0x169444][_0x7896('0x7d')]&&_0x2c4b8b[_0x7896('0x43')](_0x2959bd,_0xf7ca4[_0x169444][_0x7896('0x7d')]===_0x7896('0x7e')?![]:!![]);_0x2c4b8b[_0x7896('0x6d')](_0x2959bd,_0xf7ca4[_0x169444][_0x7896('0x7f')]||_0x2959bd);}if(_0x16c8fa[_0x7896('0x80')]){_0x16c8fa['joins']=JSON[_0x7896('0x81')](_0x16c8fa[_0x7896('0x80')]);for(var _0x54d0b=0x0;_0x54d0b<_0x16c8fa[_0x7896('0x80')]['length'];_0x54d0b+=0x1){if(_0x16c8fa[_0x7896('0x80')][_0x54d0b][_0x7896('0x39')]&&_[_0x7896('0x69')](_0x207fe4,_0x16c8fa[_0x7896('0x80')][_0x54d0b][_0x7896('0x39')])&&_0x16c8fa[_0x7896('0x80')][_0x54d0b][_0x7896('0x82')]&&_0x16c8fa['joins'][_0x54d0b][_0x7896('0x83')]&&_0x16c8fa[_0x7896('0x80')][_0x54d0b]['foreignKey']){_0x2c4b8b[_0x16c8fa[_0x7896('0x80')][_0x54d0b]['type']](_0x16c8fa[_0x7896('0x80')][_0x54d0b][_0x7896('0x83')],null,util[_0x7896('0x7b')](_0x7896('0x84'),_0x16c8fa[_0x7896('0x76')],_0x16c8fa['joins'][_0x54d0b][_0x7896('0x82')],_0x16c8fa[_0x7896('0x80')][_0x54d0b][_0x7896('0x83')],_0x16c8fa[_0x7896('0x80')][_0x54d0b][_0x7896('0x85')]));}}}if(_0x16c8fa[_0x7896('0x86')]){_0x16c8fa[_0x7896('0x86')]=JSON['parse'](_0x16c8fa['conditions']);_0x2c4b8b['where'](_0x4ad86b(_0x16c8fa[_0x7896('0x86')][_0x7896('0x6c')]));}_0x4b368a=_0x2c4b8b[_0x7896('0x87')]();_0x2c4b8b[_0x7896('0x23')](_0x353d10);_0x2c4b8b['offset'](0x0);logger[_0x7896('0x88')](_0x7896('0x89'),_0x2c4b8b[_0x7896('0x8a')]());return dbH['sequelize']['query'](_0x2c4b8b['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x7896('0x8b')]});}})[_0x7896('0x2b')](respondWithResult(_0x24336c,null))['catch'](handleError(_0x24336c,null));};function runReport(_0x21ec8c,_0x363c93,_0x565049){var _0x57721d=_0x363c93[_0x7896('0x32')];var _0x29e3dc=0xa;var _0x462a3f=[_0x7896('0x58'),_0x7896('0x59'),_0x7896('0x5a'),'cross_join'];var _0x28807b={'SUM':'SUM(%s)','COUNT':_0x7896('0x5d'),'COUNT DISTINCT':_0x7896('0x8c'),'MAX':_0x7896('0x5e'),'MIN':_0x7896('0x5f'),'AVG':_0x7896('0x60'),'GROUP_CONCAT':_0x7896('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7896('0x63')};var _0x122285={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x7896('0x66'),'ROUND':_0x7896('0x67'),'UNIX_TIMESTAMP':_0x7896('0x68')};var _0x4b2209=function(_0x3a781a){return!_[_0x7896('0x69')]([_0x7896('0x8d'),'IS\x20NOT\x20NULL',_0x7896('0x8e'),_0x7896('0x6a')],_0x3a781a);};var _0x223de2=function(_0x27218e){if(!_0x27218e||!_0x27218e['rules']['length']){return'';}for(var _0x36021a='(',_0x3097b3=0x0;_0x3097b3<_0x27218e[_0x7896('0x6b')][_0x7896('0x40')];_0x3097b3+=0x1){_0x3097b3>0x0&&(_0x36021a+='\x20'+_0x27218e[_0x7896('0x8f')]+'\x20');_0x36021a+=_0x27218e[_0x7896('0x6b')][_0x3097b3][_0x7896('0x6c')]?_0x223de2(_0x27218e[_0x7896('0x6b')][_0x3097b3]['group']):_0x27218e['rules'][_0x3097b3]['field']+'\x20'+_0x27218e['rules'][_0x3097b3][_0x7896('0x90')]+(_0x4b2209(_0x27218e[_0x7896('0x6b')][_0x3097b3]['condition'])?'\x20'+_0x27218e[_0x7896('0x6b')][_0x3097b3][_0x7896('0x91')]:'');}return _0x36021a+')';};var _0x53a6e9={'where':{'id':_0x21ec8c['id']}},_0x359189,_0xe24a8e,_0x36bb60,_0x177502,_0x126095;_0x53a6e9=_['merge']({},_0x53a6e9,_0x565049);return db[_0x7896('0x36')][_0x7896('0x50')](_0x53a6e9)[_0x7896('0x2b')](function(_0x313d64){if(_0x313d64){_0x359189=_0x313d64;return _0x313d64[_0x7896('0x6e')]();}return null;})[_0x7896('0x2b')](function(_0x273ca6){if(_0x273ca6){if(!_0x273ca6[_0x7896('0x40')]){throw new db[(_0x7896('0x6f'))]['ValidationErrorItem'](_0x7896('0x71'),0x193);}_0xe24a8e=_0x273ca6;return db[_0x7896('0x72')][_0x7896('0x73')]({'raw':!![]});}return null;})['then'](function(_0x1d5618){if(_0x1d5618){_0x36bb60=_[_0x7896('0x74')](_0x1d5618,'id');var _0x5995ad;var _0x28f5f2=squel[_0x7896('0x75')]();_0x28f5f2['from'](_0x359189[_0x7896('0x76')]);for(var _0x183ef8=0x0;_0x183ef8<_0xe24a8e[_0x7896('0x40')];_0x183ef8+=0x1){_0x5995ad=_0xe24a8e[_0x183ef8][_0x7896('0x77')]?_0x36bb60[_0xe24a8e[_0x183ef8]['MetricId']][_0x7896('0x78')]:_0xe24a8e[_0x183ef8][_0x7896('0x6d')];_0x5995ad=_0xe24a8e[_0x183ef8][_0x7896('0x7a')]?_[_0x7896('0x79')](_0x28807b[_0xe24a8e[_0x183ef8][_0x7896('0x7a')]],'%s',_0x5995ad):_0x5995ad;_0x5995ad=_0xe24a8e[_0x183ef8][_0x7896('0x7b')]?_[_0x7896('0x79')](_0x122285[_0xe24a8e[_0x183ef8]['format']],'%s',_0x5995ad):_0x5995ad;if(_0xe24a8e[_0x183ef8][_0x7896('0x7c')]){_0x28f5f2[_0x7896('0x6c')](_0x5995ad);}_0xe24a8e[_0x183ef8][_0x7896('0x7d')]&&_0x28f5f2['order'](_0x5995ad,_0xe24a8e[_0x183ef8]['orderBy']===_0x7896('0x7e')?![]:!![]);_0x28f5f2[_0x7896('0x6d')](_0x5995ad,_0xe24a8e[_0x183ef8][_0x7896('0x7f')]||_0x5995ad);}if(_0x359189[_0x7896('0x80')]){_0x359189[_0x7896('0x80')]=JSON[_0x7896('0x81')](_0x359189[_0x7896('0x80')]);for(var _0x3620e4=0x0;_0x3620e4<_0x359189[_0x7896('0x80')]['length'];_0x3620e4+=0x1){if(_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x39')]&&_[_0x7896('0x69')](_0x462a3f,_0x359189['joins'][_0x3620e4][_0x7896('0x39')])&&_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x82')]&&_0x359189['joins'][_0x3620e4][_0x7896('0x83')]&&_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x85')]){_0x28f5f2[_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x39')]](_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x83')],null,util[_0x7896('0x7b')](_0x7896('0x84'),_0x359189[_0x7896('0x76')],_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x82')],_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x83')],_0x359189[_0x7896('0x80')][_0x3620e4][_0x7896('0x85')]));}}}if(_0x359189[_0x7896('0x86')]){_0x359189[_0x7896('0x86')]=JSON[_0x7896('0x81')](_0x359189[_0x7896('0x86')]);_0x28f5f2['where'](_0x223de2(_0x359189[_0x7896('0x86')][_0x7896('0x6c')]));}_0x126095=_0x28f5f2[_0x7896('0x87')]();_0x28f5f2['limit'](_0x29e3dc);_0x28f5f2[_0x7896('0x20')](0x0);return;}})[_0x7896('0x2b')](function(){if(_0x363c93['output']===_0x7896('0x92')){return null;}var _0x3fb03a=_[_0x7896('0x48')](_0x363c93,{'name':_0x363c93[_0x7896('0x93')]||_0x363c93['name']||_0x359189[_0x7896('0x32')],'basename':_0x57721d,'savename':util[_0x7896('0x7b')](_0x7896('0x94'),_0x363c93['name']||_0x359189[_0x7896('0x32')],require(_0x7896('0x95'))[_0x7896('0x96')](0x4),_0x363c93[_0x7896('0x97')]||_0x7896('0x98')),'reportId':_0x359189['id'],'reportType':_0x7896('0x99')});return db[_0x7896('0x9a')][_0x7896('0x52')](_0x3fb03a,{'raw':!![]});})['then'](function(_0x1e990c){if(_0x359189[_0x7896('0x76')]===_0x7896('0x9b')){_0x126095[_0x7896('0x45')](_0x359189[_0x7896('0x76')]+_0x7896('0x9c'),_0x363c93[_0x7896('0x9d')],_0x363c93['endDate']);}else{_0x126095[_0x7896('0x45')](_0x359189[_0x7896('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x363c93[_0x7896('0x9d')],_0x363c93[_0x7896('0x9e')]);}if(_0x1e990c){logger['info'](_0x7896('0x9f'),_0x126095[_0x7896('0x8a')]());require(_0x7896('0xa0'))[_0x7896('0xa1')](path[_0x7896('0x58')](__dirname,_0x7896('0xa2'),_0x1e990c[_0x7896('0x97')]),[_0x1e990c['id'],_0x126095['toString'](),path[_0x7896('0x58')](__dirname,_0x7896('0xa3'),_0x1e990c[_0x7896('0xa4')]),_0x57721d]);return _0x1e990c;}else{var _0x5b59fb=squel[_0x7896('0x75')]();_0x5b59fb['from']('('+_0x126095[_0x7896('0x8a')]()+')',_0x7896('0xa5'));_0x5b59fb[_0x7896('0x6d')](_0x7896('0xa6'),_0x7896('0x22'));_0x126095['limit'](_0x363c93[_0x7896('0x23')]||_0x29e3dc);_0x126095[_0x7896('0x20')](_0x363c93[_0x7896('0x20')]||0x0);return dbH[_0x7896('0xa7')][_0x7896('0x3b')](_0x5b59fb['toString'](),{'type':dbH[_0x7896('0xa7')][_0x7896('0xa8')][_0x7896('0x8b')]})['then'](function(_0x6f979e){if(!_0x6f979e[_0x7896('0x40')]){_0x177502=0x0;}else{_0x177502=_0x6f979e[0x0][_0x7896('0x22')]||0x0;}return dbH[_0x7896('0xa7')][_0x7896('0x3b')](_0x126095[_0x7896('0x8a')](),{'type':dbH[_0x7896('0xa7')][_0x7896('0xa8')][_0x7896('0x8b')]});})[_0x7896('0x2b')](function(_0x27131c){return{'rows':_0x27131c||[],'count':_0x177502};});}});}exports['run']=function(_0x5d4872,_0x2d1e58){return runReport(_0x5d4872[_0x7896('0x4f')],_0x5d4872[_0x7896('0x3b')],_0x5d4872['options'])[_0x7896('0x2b')](respondWithResult(_0x2d1e58,null))['catch'](handleError(_0x2d1e58,null));};exports[_0x7896('0xa9')]=runReport;exports[_0x7896('0x3b')]=function(_0xcfea26,_0x4ff5a4){var _0x407c3a=0xa;var _0x5ed7bf=[_0x7896('0x58'),_0x7896('0x59'),_0x7896('0x5a'),_0x7896('0x5b')];var _0x354c43={'SUM':_0x7896('0x5c'),'COUNT':_0x7896('0x5d'),'COUNT DISTINCT':_0x7896('0x8c'),'MAX':_0x7896('0x5e'),'MIN':_0x7896('0x5f'),'AVG':_0x7896('0x60'),'GROUP_CONCAT':_0x7896('0x61'),'GROUP_CONCAT ASC':_0x7896('0x62'),'GROUP_CONCAT DESC':_0x7896('0x63')};var _0x1c2d5b={'SEC_TO_TIME':_0x7896('0x64'),'DATE':_0x7896('0x65'),'HOUR':_0x7896('0x66'),'ROUND':_0x7896('0x67'),'UNIX_TIMESTAMP':_0x7896('0x68')};var _0xadcacb=function(_0x4451e4){return!_[_0x7896('0x69')](['IS\x20NULL',_0x7896('0xaa'),'IS\x20EMPTY',_0x7896('0x6a')],_0x4451e4);};var _0x2edb26=function(_0x3a5288){if(!_0x3a5288||!_0x3a5288[_0x7896('0x6b')][_0x7896('0x40')]){return'';}for(var _0x5da00a='(',_0x56dc37=0x0;_0x56dc37<_0x3a5288[_0x7896('0x6b')]['length'];_0x56dc37+=0x1){_0x56dc37>0x0&&(_0x5da00a+='\x20'+_0x3a5288[_0x7896('0x8f')]+'\x20');_0x5da00a+=_0x3a5288[_0x7896('0x6b')][_0x56dc37][_0x7896('0x6c')]?_0x2edb26(_0x3a5288[_0x7896('0x6b')][_0x56dc37][_0x7896('0x6c')]):_0x3a5288['rules'][_0x56dc37][_0x7896('0x6d')]+'\x20'+_0x3a5288['rules'][_0x56dc37][_0x7896('0x90')]+(_0xadcacb(_0x3a5288[_0x7896('0x6b')][_0x56dc37][_0x7896('0x90')])?'\x20'+_0x3a5288['rules'][_0x56dc37][_0x7896('0x91')]:'');}return _0x5da00a+')';};var _0x1f4619={'where':{'id':_0xcfea26['params']['id']}},_0x301374,_0x556e2b,_0x26372f,_0x1056c0,_0x48570d;_0x1f4619=_[_0x7896('0x48')]({},_0x1f4619,_0xcfea26[_0x7896('0x4a')]);return db[_0x7896('0x36')]['find'](_0x1f4619)[_0x7896('0x2b')](function(_0x4a5c24){if(_0x4a5c24){_0x301374=_0x4a5c24;return _0x4a5c24[_0x7896('0x6e')]();}return null;})[_0x7896('0x2b')](function(_0x43c6a0){if(_0x43c6a0){if(!_0x43c6a0[_0x7896('0x40')]){throw new db[(_0x7896('0x6f'))]['ValidationErrorItem'](_0x7896('0x71'),0x193);}_0x556e2b=_0x43c6a0;return db['AnalyticMetric'][_0x7896('0x73')]({'raw':!![]});}return null;})[_0x7896('0x2b')](function(_0x53742d){if(_0x53742d){_0x26372f=_[_0x7896('0x74')](_0x53742d,'id');var _0x4d7b3a;var _0x4b1f07=squel[_0x7896('0x75')]();_0x4b1f07['from'](_0x301374[_0x7896('0x76')]);for(var _0x1c9262=0x0;_0x1c9262<_0x556e2b[_0x7896('0x40')];_0x1c9262+=0x1){_0x4d7b3a=_0x556e2b[_0x1c9262][_0x7896('0x77')]?_0x26372f[_0x556e2b[_0x1c9262]['MetricId']][_0x7896('0x78')]:_0x556e2b[_0x1c9262][_0x7896('0x6d')];_0x4d7b3a=_0x556e2b[_0x1c9262][_0x7896('0x7a')]?_[_0x7896('0x79')](_0x354c43[_0x556e2b[_0x1c9262][_0x7896('0x7a')]],'%s',_0x4d7b3a):_0x4d7b3a;_0x4d7b3a=_0x556e2b[_0x1c9262][_0x7896('0x7b')]?_[_0x7896('0x79')](_0x1c2d5b[_0x556e2b[_0x1c9262]['format']],'%s',_0x4d7b3a):_0x4d7b3a;if(_0x556e2b[_0x1c9262]['groupBy']){_0x4b1f07[_0x7896('0x6c')](_0x4d7b3a);}_0x556e2b[_0x1c9262][_0x7896('0x7d')]&&_0x4b1f07['order'](_0x4d7b3a,_0x556e2b[_0x1c9262][_0x7896('0x7d')]===_0x7896('0x7e')?![]:!![]);_0x4b1f07[_0x7896('0x6d')](_0x4d7b3a,_0x556e2b[_0x1c9262][_0x7896('0x7f')]||_0x4d7b3a);}if(_0x301374['joins']){_0x301374[_0x7896('0x80')]=JSON[_0x7896('0x81')](_0x301374[_0x7896('0x80')]);for(var _0x4de4af=0x0;_0x4de4af<_0x301374[_0x7896('0x80')]['length'];_0x4de4af+=0x1){if(_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x39')]&&_[_0x7896('0x69')](_0x5ed7bf,_0x301374[_0x7896('0x80')][_0x4de4af]['type'])&&_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x82')]&&_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x83')]&&_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x85')]){_0x4b1f07[_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x39')]](_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x83')],null,util[_0x7896('0x7b')](_0x7896('0x84'),_0x301374[_0x7896('0x76')],_0x301374[_0x7896('0x80')][_0x4de4af]['parentKey'],_0x301374[_0x7896('0x80')][_0x4de4af][_0x7896('0x83')],_0x301374['joins'][_0x4de4af][_0x7896('0x85')]));}}}if(_0x301374[_0x7896('0x86')]){_0x301374[_0x7896('0x86')]=JSON['parse'](_0x301374[_0x7896('0x86')]);_0x4b1f07[_0x7896('0x45')](_0x2edb26(_0x301374[_0x7896('0x86')][_0x7896('0x6c')]));}_0x48570d=_0x4b1f07[_0x7896('0x87')]();_0x4b1f07[_0x7896('0x23')](_0x407c3a);_0x4b1f07[_0x7896('0x20')](0x0);logger['debug'](_0x7896('0x89'),_0x4b1f07['toString']());return dbH['sequelize'][_0x7896('0x3b')](_0x4b1f07[_0x7896('0x8a')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x48570d[_0x7896('0x8a')]()};})[_0x7896('0x2b')](respondWithResult(_0x4ff5a4,null))[_0x7896('0x51')](handleError(_0x4ff5a4,null));};
\ No newline at end of file
+var _0xb39f=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%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)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','select','replace','DESC','web','fullPath','%s-%s.%s','randomstring','output','csv','AnalyticExtractedReport','cdr','endDate','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','clone','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','order','sort'];(function(_0x212f52,_0x8241e8){var _0x3c912f=function(_0x51d5ef){while(--_0x51d5ef){_0x212f52['push'](_0x212f52['shift']());}};_0x3c912f(++_0x8241e8);}(_0xb39f,0x66));var _0xfb39=function(_0xda8baa,_0x52664d){_0xda8baa=_0xda8baa-0x0;var _0x339249=_0xb39f[_0xda8baa];return _0x339249;};'use strict';var emlformat=require(_0xfb39('0x0'));var rimraf=require(_0xfb39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfb39('0x2'));var moment=require(_0xfb39('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfb39('0x4'));var util=require(_0xfb39('0x5'));var path=require(_0xfb39('0x6'));var sox=require(_0xfb39('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb39('0x8'));var squel=require('squel');var crypto=require(_0xfb39('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfb39('0xa'));var toCsv=require(_0xfb39('0xb'));var querystring=require(_0xfb39('0xc'));var Papa=require(_0xfb39('0xd'));var Redis=require(_0xfb39('0xe'));var authService=require(_0xfb39('0xf'));var qs=require(_0xfb39('0x10'));var as=require(_0xfb39('0x11'));var hardwareService=require(_0xfb39('0x12'));var logger=require(_0xfb39('0x13'))(_0xfb39('0x14'));var utils=require(_0xfb39('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfb39('0x16'));var db=require(_0xfb39('0x17'))['db'];var dbH=require(_0xfb39('0x17'))[_0xfb39('0x18')];function respondWithStatusCode(_0x16b436,_0x588e7e){_0x588e7e=_0x588e7e||0xcc;return function(_0x14dfdd){if(_0x14dfdd){return _0x16b436['sendStatus'](_0x588e7e);}return _0x16b436[_0xfb39('0x19')](_0x588e7e)[_0xfb39('0x1a')]();};}function respondWithResult(_0x18d7ce,_0x464b35){_0x464b35=_0x464b35||0xc8;return function(_0x29c4fb){if(_0x29c4fb){return _0x18d7ce['status'](_0x464b35)[_0xfb39('0x1b')](_0x29c4fb);}};}function respondWithFilteredResult(_0x58fece,_0xfcc91f){return function(_0x2b08bb){if(_0x2b08bb){var _0x133edf=typeof _0xfcc91f[_0xfb39('0x1c')]===_0xfb39('0x1d')&&typeof _0xfcc91f[_0xfb39('0x1e')]===_0xfb39('0x1d');var _0x57edbc=_0x2b08bb[_0xfb39('0x1f')];var _0x8c28b=_0x133edf?0x0:_0xfcc91f[_0xfb39('0x1c')];var _0x12465b=_0x133edf?_0x2b08bb[_0xfb39('0x1f')]:_0xfcc91f['offset']+_0xfcc91f['limit'];var _0xfc03ea;if(_0x12465b>=_0x57edbc){_0x12465b=_0x57edbc;_0xfc03ea=0xc8;}else{_0xfc03ea=0xce;}_0x58fece[_0xfb39('0x19')](_0xfc03ea);return _0x58fece[_0xfb39('0x20')](_0xfb39('0x21'),_0x8c28b+'-'+_0x12465b+'/'+_0x57edbc)['json'](_0x2b08bb);}return null;};}function patchUpdates(_0x7e837e){return function(_0x99239b){try{jsonpatch[_0xfb39('0x22')](_0x99239b,_0x7e837e,!![]);}catch(_0x1bac02){return BPromise['reject'](_0x1bac02);}return _0x99239b['save']();};}function saveUpdates(_0x3d59a2,_0x4451f5){return function(_0x29f1ea){if(_0x29f1ea){return _0x29f1ea[_0xfb39('0x23')](_0x3d59a2)[_0xfb39('0x24')](function(_0x2a276e){return _0x2a276e;});}return null;};}function removeEntity(_0x1e1d7f,_0x235449){return function(_0x6551af){if(_0x6551af){return _0x6551af[_0xfb39('0x25')]()[_0xfb39('0x24')](function(){var _0x44e515=_0x6551af[_0xfb39('0x26')]({'plain':!![]});var _0x8bce2d='CustomReports';return db[_0xfb39('0x27')][_0xfb39('0x25')]({'where':{'type':_0x8bce2d,'resourceId':_0x44e515['id']}})[_0xfb39('0x24')](function(){return _0x6551af;});})[_0xfb39('0x24')](function(){_0x1e1d7f[_0xfb39('0x19')](0xcc)[_0xfb39('0x1a')]();});}};}function handleEntityNotFound(_0x460e00,_0x2f6879){return function(_0x549911){if(!_0x549911){_0x460e00[_0xfb39('0x28')](0x194);}return _0x549911;};}function handleError(_0x1b95d3,_0x42d220){_0x42d220=_0x42d220||0x1f4;return function(_0x520ebf){logger[_0xfb39('0x29')](_0x520ebf[_0xfb39('0x2a')]);if(_0x520ebf[_0xfb39('0x2b')]){delete _0x520ebf[_0xfb39('0x2b')];}_0x1b95d3['status'](_0x42d220)[_0xfb39('0x2c')](_0x520ebf);};}exports[_0xfb39('0x2d')]=function(_0x3804a6,_0x1eb1b3){var _0x1fd532={},_0x51a9f4={},_0x811993={'count':0x0,'rows':[]};var _0x1fd560=_[_0xfb39('0x2e')](db[_0xfb39('0x2f')]['rawAttributes'],function(_0x4c2ab5){return{'name':_0x4c2ab5[_0xfb39('0x30')],'type':_0x4c2ab5[_0xfb39('0x31')][_0xfb39('0x32')]};});_0x51a9f4[_0xfb39('0x33')]=_[_0xfb39('0x2e')](_0x1fd560,_0xfb39('0x2b'));_0x51a9f4['query']=_[_0xfb39('0x34')](_0x3804a6[_0xfb39('0x35')]);_0x51a9f4[_0xfb39('0x36')]=_[_0xfb39('0x37')](_0x51a9f4['model'],_0x51a9f4[_0xfb39('0x35')]);_0x1fd532[_0xfb39('0x38')]=_[_0xfb39('0x37')](_0x51a9f4[_0xfb39('0x33')],qs[_0xfb39('0x39')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x39')]));_0x1fd532[_0xfb39('0x38')]=_0x1fd532[_0xfb39('0x38')]['length']?_0x1fd532[_0xfb39('0x38')]:_0x51a9f4[_0xfb39('0x33')];if(!_0x3804a6['query']['hasOwnProperty']('nolimit')){_0x1fd532[_0xfb39('0x1e')]=qs[_0xfb39('0x1e')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x1e')]);_0x1fd532[_0xfb39('0x1c')]=qs[_0xfb39('0x1c')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x1c')]);}_0x1fd532[_0xfb39('0x3a')]=qs[_0xfb39('0x3b')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x3b')]);_0x1fd532[_0xfb39('0x3c')]=qs[_0xfb39('0x36')](_[_0xfb39('0x3d')](_0x3804a6['query'],_0x51a9f4['filters']),_0x1fd560);if(_0x3804a6[_0xfb39('0x35')][_0xfb39('0x3e')]){_0x1fd532[_0xfb39('0x3c')]=_['merge'](_0x1fd532[_0xfb39('0x3c')],{'$or':_[_0xfb39('0x2e')](_0x1fd560,function(_0x5bebf0){if(_0x5bebf0[_0xfb39('0x31')]!==_0xfb39('0x3f')){var _0x449525={};_0x449525[_0x5bebf0[_0xfb39('0x2b')]]={'$like':'%'+_0x3804a6['query'][_0xfb39('0x3e')]+'%'};return _0x449525;}})});}_0x1fd532=_[_0xfb39('0x40')]({},_0x1fd532,_0x3804a6[_0xfb39('0x41')]);var _0x5abc5a={'where':_0x1fd532[_0xfb39('0x3c')]};return db[_0xfb39('0x2f')][_0xfb39('0x1f')](_0x5abc5a)[_0xfb39('0x24')](function(_0x428bfc){_0x811993['count']=_0x428bfc;if(_0x3804a6[_0xfb39('0x35')]['includeAll']){_0x1fd532[_0xfb39('0x42')]=[{'all':!![]}];}return db[_0xfb39('0x2f')][_0xfb39('0x43')](_0x1fd532);})['then'](function(_0x369964){_0x811993[_0xfb39('0x44')]=_0x369964;return _0x811993;})[_0xfb39('0x24')](respondWithFilteredResult(_0x1eb1b3,_0x1fd532))['catch'](handleError(_0x1eb1b3,null));};exports[_0xfb39('0x45')]=function(_0x48d612,_0x1a1271){var _0x5f56ea={'raw':![],'where':{'id':_0x48d612[_0xfb39('0x46')]['id']}},_0x54125e={};_0x54125e['model']=_[_0xfb39('0x34')](db[_0xfb39('0x2f')][_0xfb39('0x47')]);_0x54125e[_0xfb39('0x35')]=_[_0xfb39('0x34')](_0x48d612[_0xfb39('0x35')]);_0x54125e[_0xfb39('0x36')]=_[_0xfb39('0x37')](_0x54125e['model'],_0x54125e['query']);_0x5f56ea[_0xfb39('0x38')]=_[_0xfb39('0x37')](_0x54125e[_0xfb39('0x33')],qs[_0xfb39('0x39')](_0x48d612[_0xfb39('0x35')][_0xfb39('0x39')]));_0x5f56ea[_0xfb39('0x38')]=_0x5f56ea[_0xfb39('0x38')][_0xfb39('0x48')]?_0x5f56ea[_0xfb39('0x38')]:_0x54125e[_0xfb39('0x33')];if(_0x48d612[_0xfb39('0x35')][_0xfb39('0x49')]){_0x5f56ea[_0xfb39('0x42')]=[{'all':!![]}];}_0x5f56ea=_[_0xfb39('0x40')]({},_0x5f56ea,_0x48d612[_0xfb39('0x41')]);return db[_0xfb39('0x2f')][_0xfb39('0x4a')](_0x5f56ea)['then'](handleEntityNotFound(_0x1a1271,null))['then'](respondWithResult(_0x1a1271,null))['catch'](handleError(_0x1a1271,null));};exports[_0xfb39('0x4b')]=function(_0x91671f,_0x32e869){return db[_0xfb39('0x2f')][_0xfb39('0x4b')](_0x91671f[_0xfb39('0x4c')],{})[_0xfb39('0x24')](function(_0x11ca18){var _0x373c3e=_0x91671f[_0xfb39('0x4d')]['get']({'plain':!![]});if(!_0x373c3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x373c3e['role']===_0xfb39('0x4d')){var _0x17cf88=_0x11ca18[_0xfb39('0x26')]({'plain':!![]});var _0xd6d6e7=_0xfb39('0x4e');return db[_0xfb39('0x4f')][_0xfb39('0x4a')]({'where':{'name':_0xd6d6e7,'userProfileId':_0x373c3e[_0xfb39('0x50')]},'raw':!![]})[_0xfb39('0x24')](function(_0xab2cf2){if(_0xab2cf2&&_0xab2cf2[_0xfb39('0x51')]===0x0){return db[_0xfb39('0x27')][_0xfb39('0x4b')]({'name':_0x17cf88[_0xfb39('0x2b')],'resourceId':_0x17cf88['id'],'type':'CustomReports','sectionId':_0xab2cf2['id']},{})[_0xfb39('0x24')](function(){return _0x11ca18;});}else{return _0x11ca18;}})[_0xfb39('0x52')](function(_0x37fb70){logger[_0xfb39('0x29')](_0xfb39('0x53'),_0x37fb70);throw _0x37fb70;});}return _0x11ca18;})[_0xfb39('0x24')](respondWithResult(_0x32e869,0xc9))['catch'](handleError(_0x32e869,null));};exports[_0xfb39('0x23')]=function(_0x1bd26f,_0x308f6e){if(_0x1bd26f[_0xfb39('0x4c')]['id']){delete _0x1bd26f[_0xfb39('0x4c')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x1bd26f[_0xfb39('0x46')]['id']}})[_0xfb39('0x24')](handleEntityNotFound(_0x308f6e,null))[_0xfb39('0x24')](saveUpdates(_0x1bd26f['body'],null))['then'](respondWithResult(_0x308f6e,null))[_0xfb39('0x52')](handleError(_0x308f6e,null));};exports['destroy']=function(_0x31bb04,_0x1f0123){return db['AnalyticCustomReport'][_0xfb39('0x4a')]({'where':{'id':_0x31bb04['params']['id']}})['then'](handleEntityNotFound(_0x1f0123,null))[_0xfb39('0x24')](removeEntity(_0x1f0123,null))[_0xfb39('0x52')](handleError(_0x1f0123,null));};exports['preview']=function(_0x54292e,_0x307517){var _0x34ef1a=0xa;var _0xfc6653=[_0xfb39('0x54'),_0xfb39('0x55'),_0xfb39('0x56'),_0xfb39('0x57')];var _0x2dfb1c={'SUM':_0xfb39('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfb39('0x59'),'MAX':_0xfb39('0x5a'),'MIN':_0xfb39('0x5b'),'AVG':_0xfb39('0x5c'),'GROUP_CONCAT':_0xfb39('0x5d'),'GROUP_CONCAT ASC':_0xfb39('0x5e'),'GROUP_CONCAT DESC':_0xfb39('0x5f')};var _0x2c57cd={'SEC_TO_TIME':_0xfb39('0x60'),'DATE':_0xfb39('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xfb39('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3ba86a=function(_0x48fcad){return!_[_0xfb39('0x63')](['IS\x20NULL',_0xfb39('0x64'),_0xfb39('0x65'),_0xfb39('0x66')],_0x48fcad);};var _0xb97dbd=function(_0x5b12ae){if(!_0x5b12ae||!_0x5b12ae[_0xfb39('0x67')][_0xfb39('0x48')]){return'';}for(var _0x4297a7='(',_0x28eadd=0x0;_0x28eadd<_0x5b12ae[_0xfb39('0x67')]['length'];_0x28eadd+=0x1){_0x28eadd>0x0&&(_0x4297a7+='\x20'+_0x5b12ae[_0xfb39('0x68')]+'\x20');_0x4297a7+=_0x5b12ae['rules'][_0x28eadd][_0xfb39('0x69')]?_0xb97dbd(_0x5b12ae[_0xfb39('0x67')][_0x28eadd][_0xfb39('0x69')]):_0x5b12ae[_0xfb39('0x67')][_0x28eadd][_0xfb39('0x6a')]+'\x20'+_0x5b12ae[_0xfb39('0x67')][_0x28eadd]['condition']+(_0x3ba86a(_0x5b12ae['rules'][_0x28eadd][_0xfb39('0x6b')])?'\x20'+_0x5b12ae[_0xfb39('0x67')][_0x28eadd][_0xfb39('0x6c')]:'');}return _0x4297a7+')';};var _0xf1f612={'where':{'id':_0x54292e[_0xfb39('0x46')]['id']}},_0x529851,_0x534b80,_0x4ff81e,_0x3d4539,_0x6fec66;_0xf1f612=_['merge']({},_0xf1f612,_0x54292e[_0xfb39('0x41')]);return db[_0xfb39('0x2f')]['find'](_0xf1f612)[_0xfb39('0x24')](function(_0x400c54){if(_0x400c54){_0x529851=_0x400c54;return _0x400c54[_0xfb39('0x6d')]();}return null;})[_0xfb39('0x24')](function(_0x226193){if(_0x226193){if(!_0x226193['length']){throw new db['Sequelize'][(_0xfb39('0x6e'))](_0xfb39('0x6f'),0x193);}_0x534b80=_0x226193;return db[_0xfb39('0x70')][_0xfb39('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5eee12){if(_0x5eee12){_0x4ff81e=_[_0xfb39('0x71')](_0x5eee12,'id');var _0x1c2296;var _0x584065=squel['select']();_0x584065[_0xfb39('0x72')](_0x529851[_0xfb39('0x73')]);for(var _0x56a9f8=0x0;_0x56a9f8<_0x534b80[_0xfb39('0x48')];_0x56a9f8+=0x1){_0x1c2296=_0x534b80[_0x56a9f8][_0xfb39('0x74')]?_0x4ff81e[_0x534b80[_0x56a9f8][_0xfb39('0x74')]][_0xfb39('0x75')]:_0x534b80[_0x56a9f8][_0xfb39('0x6a')];_0x1c2296=_0x534b80[_0x56a9f8][_0xfb39('0x76')]?_['replace'](_0x2dfb1c[_0x534b80[_0x56a9f8]['function']],'%s',_0x1c2296):_0x1c2296;_0x1c2296=_0x534b80[_0x56a9f8]['format']?_['replace'](_0x2c57cd[_0x534b80[_0x56a9f8][_0xfb39('0x77')]],'%s',_0x1c2296):_0x1c2296;if(_0x534b80[_0x56a9f8][_0xfb39('0x78')]){_0x584065['group'](_0x1c2296);}_0x534b80[_0x56a9f8][_0xfb39('0x79')]&&_0x584065['order'](_0x1c2296,_0x534b80[_0x56a9f8][_0xfb39('0x79')]==='DESC'?![]:!![]);_0x584065[_0xfb39('0x6a')](_0x1c2296,_0x534b80[_0x56a9f8][_0xfb39('0x7a')]||_0x1c2296);}if(_0x529851[_0xfb39('0x7b')]){_0x529851[_0xfb39('0x7b')]=JSON[_0xfb39('0x7c')](_0x529851[_0xfb39('0x7b')]);for(var _0x55f2dc=0x0;_0x55f2dc<_0x529851[_0xfb39('0x7b')][_0xfb39('0x48')];_0x55f2dc+=0x1){if(_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x31')]&&_[_0xfb39('0x63')](_0xfc6653,_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x31')])&&_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7d')]&&_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7e')]&&_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7f')]){_0x584065[_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x31')]](_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7e')],null,util[_0xfb39('0x77')]('%s.%s\x20=\x20%s.%s',_0x529851['table'],_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7d')],_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7e')],_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7f')]));}}}if(_0x529851[_0xfb39('0x80')]){_0x529851[_0xfb39('0x80')]=JSON['parse'](_0x529851[_0xfb39('0x80')]);_0x584065[_0xfb39('0x3c')](_0xb97dbd(_0x529851[_0xfb39('0x80')][_0xfb39('0x69')]));}_0x6fec66=_0x584065['clone']();_0x584065[_0xfb39('0x1e')](_0x34ef1a);_0x584065[_0xfb39('0x1c')](0x0);logger[_0xfb39('0x81')](_0xfb39('0x82'),_0x584065[_0xfb39('0x83')]());return dbH[_0xfb39('0x84')][_0xfb39('0x35')](_0x584065[_0xfb39('0x83')](),{'type':dbH[_0xfb39('0x84')][_0xfb39('0x85')][_0xfb39('0x86')]});}})[_0xfb39('0x24')](respondWithResult(_0x307517,null))[_0xfb39('0x52')](handleError(_0x307517,null));};function runReport(_0x221165,_0x315f88,_0x1750ad){var _0x359995=_0x315f88[_0xfb39('0x2b')];var _0x3c08ea=0xa;var _0x1e0837=[_0xfb39('0x54'),_0xfb39('0x55'),_0xfb39('0x56'),_0xfb39('0x57')];var _0x3753c6={'SUM':_0xfb39('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfb39('0x5a'),'MIN':'MIN(%s)','AVG':_0xfb39('0x5c'),'GROUP_CONCAT':_0xfb39('0x5d'),'GROUP_CONCAT ASC':_0xfb39('0x5e'),'GROUP_CONCAT DESC':_0xfb39('0x5f')};var _0x3b0251={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfb39('0x61'),'HOUR':_0xfb39('0x87'),'ROUND':_0xfb39('0x62'),'UNIX_TIMESTAMP':_0xfb39('0x88')};var _0x2b9c0d=function(_0x339177){return!_[_0xfb39('0x63')]([_0xfb39('0x89'),'IS\x20NOT\x20NULL',_0xfb39('0x65'),_0xfb39('0x66')],_0x339177);};var _0xf26627=function(_0x590718){if(!_0x590718||!_0x590718['rules'][_0xfb39('0x48')]){return'';}for(var _0x1d6cf7='(',_0x31006d=0x0;_0x31006d<_0x590718['rules'][_0xfb39('0x48')];_0x31006d+=0x1){_0x31006d>0x0&&(_0x1d6cf7+='\x20'+_0x590718[_0xfb39('0x68')]+'\x20');_0x1d6cf7+=_0x590718[_0xfb39('0x67')][_0x31006d]['group']?_0xf26627(_0x590718[_0xfb39('0x67')][_0x31006d][_0xfb39('0x69')]):_0x590718[_0xfb39('0x67')][_0x31006d][_0xfb39('0x6a')]+'\x20'+_0x590718[_0xfb39('0x67')][_0x31006d]['condition']+(_0x2b9c0d(_0x590718[_0xfb39('0x67')][_0x31006d][_0xfb39('0x6b')])?'\x20'+_0x590718['rules'][_0x31006d]['value']:'');}return _0x1d6cf7+')';};var _0x11f252={'where':{'id':_0x221165['id']}},_0x2e01c7,_0x2198f4,_0x57e81d,_0x451418,_0xce83ac;_0x11f252=_[_0xfb39('0x40')]({},_0x11f252,_0x1750ad);return db[_0xfb39('0x2f')][_0xfb39('0x4a')](_0x11f252)['then'](function(_0x26f1da){if(_0x26f1da){_0x2e01c7=_0x26f1da;return _0x26f1da[_0xfb39('0x6d')]();}return null;})[_0xfb39('0x24')](function(_0x345bc5){if(_0x345bc5){if(!_0x345bc5[_0xfb39('0x48')]){throw new db['Sequelize'][(_0xfb39('0x6e'))](_0xfb39('0x6f'),0x193);}_0x2198f4=_0x345bc5;return db[_0xfb39('0x70')][_0xfb39('0x43')]({'raw':!![]});}return null;})[_0xfb39('0x24')](function(_0x3e2d5e){if(_0x3e2d5e){_0x57e81d=_['keyBy'](_0x3e2d5e,'id');var _0x19ce10;var _0x337cac=squel[_0xfb39('0x8a')]();_0x337cac[_0xfb39('0x72')](_0x2e01c7[_0xfb39('0x73')]);for(var _0x53a218=0x0;_0x53a218<_0x2198f4[_0xfb39('0x48')];_0x53a218+=0x1){_0x19ce10=_0x2198f4[_0x53a218][_0xfb39('0x74')]?_0x57e81d[_0x2198f4[_0x53a218]['MetricId']][_0xfb39('0x75')]:_0x2198f4[_0x53a218][_0xfb39('0x6a')];_0x19ce10=_0x2198f4[_0x53a218][_0xfb39('0x76')]?_[_0xfb39('0x8b')](_0x3753c6[_0x2198f4[_0x53a218]['function']],'%s',_0x19ce10):_0x19ce10;_0x19ce10=_0x2198f4[_0x53a218][_0xfb39('0x77')]?_[_0xfb39('0x8b')](_0x3b0251[_0x2198f4[_0x53a218][_0xfb39('0x77')]],'%s',_0x19ce10):_0x19ce10;if(_0x2198f4[_0x53a218][_0xfb39('0x78')]){_0x337cac[_0xfb39('0x69')](_0x19ce10);}_0x2198f4[_0x53a218][_0xfb39('0x79')]&&_0x337cac['order'](_0x19ce10,_0x2198f4[_0x53a218][_0xfb39('0x79')]===_0xfb39('0x8c')?![]:!![]);_0x337cac[_0xfb39('0x6a')](_0x19ce10,_0x2198f4[_0x53a218]['alias']||_0x19ce10);}if(_0x2e01c7[_0xfb39('0x7b')]){_0x2e01c7[_0xfb39('0x7b')]=JSON[_0xfb39('0x7c')](_0x2e01c7[_0xfb39('0x7b')]);for(var _0xa4dbd2=0x0;_0xa4dbd2<_0x2e01c7[_0xfb39('0x7b')][_0xfb39('0x48')];_0xa4dbd2+=0x1){if(_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x31')]&&_[_0xfb39('0x63')](_0x1e0837,_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x31')])&&_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7d')]&&_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7e')]&&_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x7f')]){_0x337cac[_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x31')]](_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7e')],null,util[_0xfb39('0x77')]('%s.%s\x20=\x20%s.%s',_0x2e01c7['table'],_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7d')],_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x7e')],_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7f')]));}}}if(_0x2e01c7['conditions']){_0x2e01c7[_0xfb39('0x80')]=JSON[_0xfb39('0x7c')](_0x2e01c7[_0xfb39('0x80')]);_0x337cac['where'](_0xf26627(_0x2e01c7['conditions'][_0xfb39('0x69')]));}_0xce83ac=_0x337cac['clone']();_0x337cac[_0xfb39('0x1e')](_0x3c08ea);_0x337cac['offset'](0x0);return;}})['then'](function(){if(_0x315f88['output']===_0xfb39('0x8d')){return null;}var _0x533c82=_['merge'](_0x315f88,{'name':_0x315f88[_0xfb39('0x8e')]||_0x315f88['name']||_0x2e01c7[_0xfb39('0x2b')],'basename':_0x359995,'savename':util[_0xfb39('0x77')](_0xfb39('0x8f'),_0x315f88[_0xfb39('0x2b')]||_0x2e01c7[_0xfb39('0x2b')],require(_0xfb39('0x90'))['generate'](0x4),_0x315f88[_0xfb39('0x91')]||_0xfb39('0x92')),'reportId':_0x2e01c7['id'],'reportType':'custom'});return db[_0xfb39('0x93')][_0xfb39('0x4b')](_0x533c82,{'raw':!![]});})[_0xfb39('0x24')](function(_0x12e8d1){if(_0x2e01c7[_0xfb39('0x73')]===_0xfb39('0x94')){_0xce83ac[_0xfb39('0x3c')](_0x2e01c7['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x315f88['startDate'],_0x315f88[_0xfb39('0x95')]);}else{_0xce83ac['where'](_0x2e01c7[_0xfb39('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x315f88[_0xfb39('0x96')],_0x315f88['endDate']);}if(_0x12e8d1){logger[_0xfb39('0x97')](_0xfb39('0x98'),_0xce83ac[_0xfb39('0x83')]());require(_0xfb39('0x99'))['fork'](path[_0xfb39('0x54')](__dirname,_0xfb39('0x9a'),_0x12e8d1[_0xfb39('0x91')]),[_0x12e8d1['id'],_0xce83ac[_0xfb39('0x83')](),path[_0xfb39('0x54')](__dirname,_0xfb39('0x9b'),_0x12e8d1[_0xfb39('0x9c')]),_0x359995]);return _0x12e8d1;}else{var _0x5403e6=squel[_0xfb39('0x8a')]();_0x5403e6[_0xfb39('0x72')]('('+_0xce83ac[_0xfb39('0x83')]()+')',_0xfb39('0x9d'));_0x5403e6[_0xfb39('0x6a')](_0xfb39('0x9e'),_0xfb39('0x1f'));_0xce83ac[_0xfb39('0x1e')](_0x315f88[_0xfb39('0x1e')]||_0x3c08ea);_0xce83ac[_0xfb39('0x1c')](_0x315f88[_0xfb39('0x1c')]||0x0);return dbH['sequelize'][_0xfb39('0x35')](_0x5403e6['toString'](),{'type':dbH[_0xfb39('0x84')][_0xfb39('0x85')][_0xfb39('0x86')]})[_0xfb39('0x24')](function(_0x41972c){if(!_0x41972c[_0xfb39('0x48')]){_0x451418=0x0;}else{_0x451418=_0x41972c[0x0]['count']||0x0;}return dbH[_0xfb39('0x84')]['query'](_0xce83ac[_0xfb39('0x83')](),{'type':dbH[_0xfb39('0x84')]['QueryTypes'][_0xfb39('0x86')]});})[_0xfb39('0x24')](function(_0x283d9d){return{'rows':_0x283d9d||[],'count':_0x451418};});}});}exports[_0xfb39('0x9f')]=function(_0x920abf,_0x15c5f0){return runReport(_0x920abf[_0xfb39('0x46')],_0x920abf[_0xfb39('0x35')],_0x920abf['options'])[_0xfb39('0x24')](respondWithResult(_0x15c5f0,null))[_0xfb39('0x52')](handleError(_0x15c5f0,null));};exports[_0xfb39('0xa0')]=runReport;exports['query']=function(_0xbab3d1,_0x5b8750){var _0x2b7e42=0xa;var _0x18f47a=[_0xfb39('0x54'),_0xfb39('0x55'),_0xfb39('0x56'),'cross_join'];var _0x3c8928={'SUM':_0xfb39('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfb39('0x5a'),'MIN':_0xfb39('0x5b'),'AVG':_0xfb39('0x5c'),'GROUP_CONCAT':_0xfb39('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1d2280={'SEC_TO_TIME':_0xfb39('0x60'),'DATE':'DATE(%s)','HOUR':_0xfb39('0x87'),'ROUND':_0xfb39('0x62'),'UNIX_TIMESTAMP':_0xfb39('0x88')};var _0x3c825c=function(_0x15375d){return!_[_0xfb39('0x63')]([_0xfb39('0x89'),_0xfb39('0x64'),_0xfb39('0x65'),_0xfb39('0x66')],_0x15375d);};var _0x2830e6=function(_0x386641){if(!_0x386641||!_0x386641[_0xfb39('0x67')]['length']){return'';}for(var _0x78c6e1='(',_0x241528=0x0;_0x241528<_0x386641[_0xfb39('0x67')][_0xfb39('0x48')];_0x241528+=0x1){_0x241528>0x0&&(_0x78c6e1+='\x20'+_0x386641[_0xfb39('0x68')]+'\x20');_0x78c6e1+=_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x69')]?_0x2830e6(_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x69')]):_0x386641[_0xfb39('0x67')][_0x241528]['field']+'\x20'+_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x6b')]+(_0x3c825c(_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x6b')])?'\x20'+_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x6c')]:'');}return _0x78c6e1+')';};var _0x2dc8ab={'where':{'id':_0xbab3d1[_0xfb39('0x46')]['id']}},_0x33f556,_0x2f11ef,_0x2a78fd,_0x339bfc,_0x5e8e6b;_0x2dc8ab=_[_0xfb39('0x40')]({},_0x2dc8ab,_0xbab3d1[_0xfb39('0x41')]);return db['AnalyticCustomReport'][_0xfb39('0x4a')](_0x2dc8ab)[_0xfb39('0x24')](function(_0x8bc759){if(_0x8bc759){_0x33f556=_0x8bc759;return _0x8bc759[_0xfb39('0x6d')]();}return null;})['then'](function(_0x342298){if(_0x342298){if(!_0x342298['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xfb39('0x6f'),0x193);}_0x2f11ef=_0x342298;return db[_0xfb39('0x70')][_0xfb39('0x43')]({'raw':!![]});}return null;})[_0xfb39('0x24')](function(_0x474f9b){if(_0x474f9b){_0x2a78fd=_['keyBy'](_0x474f9b,'id');var _0x188a0f;var _0x3efef9=squel['select']();_0x3efef9['from'](_0x33f556[_0xfb39('0x73')]);for(var _0x5e4b33=0x0;_0x5e4b33<_0x2f11ef[_0xfb39('0x48')];_0x5e4b33+=0x1){_0x188a0f=_0x2f11ef[_0x5e4b33][_0xfb39('0x74')]?_0x2a78fd[_0x2f11ef[_0x5e4b33][_0xfb39('0x74')]][_0xfb39('0x75')]:_0x2f11ef[_0x5e4b33][_0xfb39('0x6a')];_0x188a0f=_0x2f11ef[_0x5e4b33][_0xfb39('0x76')]?_[_0xfb39('0x8b')](_0x3c8928[_0x2f11ef[_0x5e4b33][_0xfb39('0x76')]],'%s',_0x188a0f):_0x188a0f;_0x188a0f=_0x2f11ef[_0x5e4b33][_0xfb39('0x77')]?_[_0xfb39('0x8b')](_0x1d2280[_0x2f11ef[_0x5e4b33]['format']],'%s',_0x188a0f):_0x188a0f;if(_0x2f11ef[_0x5e4b33][_0xfb39('0x78')]){_0x3efef9['group'](_0x188a0f);}_0x2f11ef[_0x5e4b33][_0xfb39('0x79')]&&_0x3efef9['order'](_0x188a0f,_0x2f11ef[_0x5e4b33][_0xfb39('0x79')]===_0xfb39('0x8c')?![]:!![]);_0x3efef9[_0xfb39('0x6a')](_0x188a0f,_0x2f11ef[_0x5e4b33][_0xfb39('0x7a')]||_0x188a0f);}if(_0x33f556[_0xfb39('0x7b')]){_0x33f556['joins']=JSON[_0xfb39('0x7c')](_0x33f556[_0xfb39('0x7b')]);for(var _0x51eee5=0x0;_0x51eee5<_0x33f556[_0xfb39('0x7b')][_0xfb39('0x48')];_0x51eee5+=0x1){if(_0x33f556[_0xfb39('0x7b')][_0x51eee5]['type']&&_[_0xfb39('0x63')](_0x18f47a,_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x31')])&&_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7d')]&&_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7e')]&&_0x33f556['joins'][_0x51eee5]['foreignKey']){_0x3efef9[_0x33f556['joins'][_0x51eee5][_0xfb39('0x31')]](_0x33f556[_0xfb39('0x7b')][_0x51eee5]['foreignTable'],null,util[_0xfb39('0x77')]('%s.%s\x20=\x20%s.%s',_0x33f556[_0xfb39('0x73')],_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7d')],_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7e')],_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7f')]));}}}if(_0x33f556['conditions']){_0x33f556['conditions']=JSON[_0xfb39('0x7c')](_0x33f556[_0xfb39('0x80')]);_0x3efef9[_0xfb39('0x3c')](_0x2830e6(_0x33f556[_0xfb39('0x80')]['group']));}_0x5e8e6b=_0x3efef9[_0xfb39('0xa1')]();_0x3efef9[_0xfb39('0x1e')](_0x2b7e42);_0x3efef9[_0xfb39('0x1c')](0x0);logger[_0xfb39('0x81')](_0xfb39('0x82'),_0x3efef9[_0xfb39('0x83')]());return dbH[_0xfb39('0x84')]['query'](_0x3efef9[_0xfb39('0x83')](),{'type':dbH[_0xfb39('0x84')][_0xfb39('0x85')]['SELECT']});}})[_0xfb39('0x24')](function(){return{'sql':_0x5e8e6b['toString']()};})['then'](respondWithResult(_0x5b8750,null))['catch'](handleError(_0x5b8750,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d9af2ff..94b0705 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 _0xe037=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','moment','bluebird','request-promise'];(function(_0x524171,_0x355841){var _0x14529b=function(_0x2e8261){while(--_0x2e8261){_0x524171['push'](_0x524171['shift']());}};_0x14529b(++_0x355841);}(_0xe037,0x146));var _0x7e03=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xe037[_0x54defc];return _0x1955d3;};'use strict';var _=require(_0x7e03('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7e03('0x1'));var BPromise=require(_0x7e03('0x2'));var rp=require(_0x7e03('0x3'));var fs=require('fs');var path=require(_0x7e03('0x4'));var rimraf=require(_0x7e03('0x5'));var config=require('../../config/environment');var attributes=require(_0x7e03('0x6'));module[_0x7e03('0x7')]=function(_0x5f0f52,_0x43ef69){return _0x5f0f52[_0x7e03('0x8')](_0x7e03('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdcaf=['exports','define','analytics_custom_reports','lodash','util','moment','bluebird'];(function(_0x434d68,_0xcbdfed){var _0x56f3ce=function(_0x3553ab){while(--_0x3553ab){_0x434d68['push'](_0x434d68['shift']());}};_0x56f3ce(++_0xcbdfed);}(_0xdcaf,0x88));var _0xfdca=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdcaf[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfdca('0x0'));var util=require(_0xfdca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfdca('0x2'));var BPromise=require(_0xfdca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xfdca('0x4')]=function(_0x31558c,_0x3b54bc){return _0x31558c[_0xfdca('0x5')]('AnalyticCustomReport',attributes,{'tableName':_0xfdca('0x6'),'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 2f93ec3..272b455 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 _0xf044=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf044,0xf4));var _0x4f04=function(_0x50dba7,_0x3f5da9){_0x50dba7=_0x50dba7-0x0;var _0x12974b=_0xf044[_0x50dba7];return _0x12974b;};'use strict';var _=require(_0x4f04('0x0'));var util=require('util');var moment=require(_0x4f04('0x1'));var BPromise=require(_0x4f04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f04('0x3'))['db'];var utils=require(_0x4f04('0x4'));var logger=require('../../config/logger')(_0x4f04('0x5'));var config=require(_0x4f04('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4f04('0x7')][_0x4f04('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aa989,_0x755985,_0x1cff1f){return new BPromise(function(_0x50e079,_0x469e42){return client[_0x4f04('0x9')](_0x5aa989,_0x1cff1f)[_0x4f04('0xa')](function(_0x55cc23){logger[_0x4f04('0xb')](_0x4f04('0xc'),_0x755985,_0x4f04('0xd'));logger['debug'](_0x4f04('0xe'),_0x755985,_0x4f04('0xd'),JSON[_0x4f04('0xf')](_0x55cc23));if(_0x55cc23['error']){if(_0x55cc23['error'][_0x4f04('0x10')]===0x1f4){logger[_0x4f04('0x11')](_0x4f04('0xc'),_0x755985,_0x55cc23[_0x4f04('0x11')]['message']);return _0x469e42(_0x55cc23[_0x4f04('0x11')][_0x4f04('0x12')]);}logger[_0x4f04('0x11')](_0x4f04('0xc'),_0x755985,_0x55cc23[_0x4f04('0x11')][_0x4f04('0x12')]);return _0x50e079(_0x55cc23[_0x4f04('0x11')][_0x4f04('0x12')]);}else{logger[_0x4f04('0xb')](_0x4f04('0xc'),_0x755985,'request\x20sent');_0x50e079(_0x55cc23[_0x4f04('0x13')][_0x4f04('0x12')]);}})[_0x4f04('0x14')](function(_0x1f04a5){logger[_0x4f04('0x11')](_0x4f04('0xc'),_0x755985,_0x1f04a5);_0x469e42(_0x1f04a5);});});}
\ No newline at end of file
+var _0x74db=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','lodash','bluebird','randomstring','ioredis'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x74db,0x165));var _0xb74d=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x74db[_0x2fdf82];return _0x2382f5;};'use strict';var _=require(_0xb74d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb74d('0x1'));var rs=require(_0xb74d('0x2'));var fs=require('fs');var Redis=require(_0xb74d('0x3'));var db=require(_0xb74d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb74d('0x5'))(_0xb74d('0x6'));var config=require(_0xb74d('0x7'));var jayson=require(_0xb74d('0x8'));var client=jayson['client'][_0xb74d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19ba6f,_0x401180,_0x2b5728){return new BPromise(function(_0x1a1d4a,_0x2d6c4f){return client[_0xb74d('0xa')](_0x19ba6f,_0x2b5728)['then'](function(_0x3e7a76){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x401180,_0xb74d('0xb'));logger['debug'](_0xb74d('0xc'),_0x401180,'request\x20sent',JSON[_0xb74d('0xd')](_0x3e7a76));if(_0x3e7a76[_0xb74d('0xe')]){if(_0x3e7a76['error'][_0xb74d('0xf')]===0x1f4){logger[_0xb74d('0xe')](_0xb74d('0x10'),_0x401180,_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);return _0x2d6c4f(_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);}logger[_0xb74d('0xe')](_0xb74d('0x10'),_0x401180,_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);return _0x1a1d4a(_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);}else{logger[_0xb74d('0x12')](_0xb74d('0x10'),_0x401180,'request\x20sent');_0x1a1d4a(_0x3e7a76['result']['message']);}})['catch'](function(_0x2d545f){logger[_0xb74d('0xe')](_0xb74d('0x10'),_0x401180,_0x2d545f);_0x2d6c4f(_0x2d545f);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 191e41f..4abc718 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 _0x9a40=['show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id'];(function(_0x4d6049,_0x6fa762){var _0x1d4f4c=function(_0x3280c3){while(--_0x3280c3){_0x4d6049['push'](_0x4d6049['shift']());}};_0x1d4f4c(++_0x6fa762);}(_0x9a40,0x138));var _0x09a4=function(_0x588fb7,_0x16c606){_0x588fb7=_0x588fb7-0x0;var _0x538362=_0x9a40[_0x588fb7];return _0x538362;};'use strict';var multer=require(_0x09a4('0x0'));var util=require(_0x09a4('0x1'));var path=require(_0x09a4('0x2'));var timeout=require('connect-timeout');var express=require(_0x09a4('0x3'));var router=express[_0x09a4('0x4')]();var fs_extra=require(_0x09a4('0x5'));var auth=require(_0x09a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x09a4('0x7'));var controller=require(_0x09a4('0x8'));router['get']('/',auth[_0x09a4('0x9')](),controller[_0x09a4('0xa')]);router[_0x09a4('0xb')](_0x09a4('0xc'),auth[_0x09a4('0x9')](),controller[_0x09a4('0xd')]);router[_0x09a4('0xb')](_0x09a4('0xe'),auth[_0x09a4('0x9')](),controller['preview']);router['get'](_0x09a4('0xf'),auth[_0x09a4('0x9')](),controller[_0x09a4('0x10')]);router[_0x09a4('0xb')](_0x09a4('0x11'),auth['isAuthenticated'](),controller[_0x09a4('0x12')]);router[_0x09a4('0x13')]('/',auth[_0x09a4('0x9')](),controller[_0x09a4('0x14')]);router[_0x09a4('0x15')](_0x09a4('0xc'),auth[_0x09a4('0x9')](),controller[_0x09a4('0x16')]);router[_0x09a4('0x17')]('/:id',auth[_0x09a4('0x9')](),controller['destroy']);module[_0x09a4('0x18')]=router;
\ No newline at end of file
+var _0x2bce=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','/:id/run','run','query','post','create','put','update','/:id'];(function(_0x37d1e4,_0x2eeb58){var _0x13155a=function(_0x435f88){while(--_0x435f88){_0x37d1e4['push'](_0x37d1e4['shift']());}};_0x13155a(++_0x2eeb58);}(_0x2bce,0x199));var _0xe2bc=function(_0x150667,_0x3bbe53){_0x150667=_0x150667-0x0;var _0x36f17e=_0x2bce[_0x150667];return _0x36f17e;};'use strict';var multer=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var path=require(_0xe2bc('0x2'));var timeout=require(_0xe2bc('0x3'));var express=require(_0xe2bc('0x4'));var router=express[_0xe2bc('0x5')]();var fs_extra=require(_0xe2bc('0x6'));var auth=require(_0xe2bc('0x7'));var interaction=require(_0xe2bc('0x8'));var config=require(_0xe2bc('0x9'));var controller=require(_0xe2bc('0xa'));router[_0xe2bc('0xb')]('/',auth[_0xe2bc('0xc')](),controller[_0xe2bc('0xd')]);router[_0xe2bc('0xb')]('/:id',auth[_0xe2bc('0xc')](),controller['show']);router[_0xe2bc('0xb')](_0xe2bc('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0xe2bc('0xb')](_0xe2bc('0xf'),auth[_0xe2bc('0xc')](),controller[_0xe2bc('0x10')]);router[_0xe2bc('0xb')]('/:id/query',auth[_0xe2bc('0xc')](),controller[_0xe2bc('0x11')]);router[_0xe2bc('0x12')]('/',auth['isAuthenticated'](),controller[_0xe2bc('0x13')]);router[_0xe2bc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe2bc('0x15')]);router['delete'](_0xe2bc('0x16'),auth[_0xe2bc('0xc')](),controller[_0xe2bc('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6669f06..e3b3f17 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x26e726,_0x47c779){var _0xa6f34=function(_0x1a3368){while(--_0x1a3368){_0x26e726['push'](_0x26e726['shift']());}};_0xa6f34(++_0x47c779);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xeec6[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xfdbd[_0x2a390b];return _0x5df10a;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index ac4a67c..57ae404 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x3c0a30,_0x1ca8e6){var _0x5f582b=function(_0x438b4d){while(--_0x438b4d){_0x3c0a30['push'](_0x3c0a30['shift']());}};_0x5f582b(++_0x1ca8e6);}(_0x0295,0x1f0));var _0x5029=function(_0x2b3087,_0x5bad3a){_0x2b3087=_0x2b3087-0x0;var _0x39bb6a=_0x0295[_0x2b3087];return _0x39bb6a;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x220909,_0x4fa78a){_0x220909=_0x220909-0x0;var _0x1119ae=_0xc6ac[_0x220909];return _0x1119ae;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index cb29de5..b76627b 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 _0xc7e8=['AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x1cd3e3,_0xbeb106){var _0x4a3336=function(_0x2a385d){while(--_0x2a385d){_0x1cd3e3['push'](_0x1cd3e3['shift']());}};_0x4a3336(++_0xbeb106);}(_0xc7e8,0x11a));var _0x8c7e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc7e8[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x8c7e('0x0'));var util=require(_0x8c7e('0x1'));var logger=require('../../config/logger')(_0x8c7e('0x2'));var moment=require(_0x8c7e('0x3'));var BPromise=require(_0x8c7e('0x4'));var rp=require(_0x8c7e('0x5'));var fs=require('fs');var path=require(_0x8c7e('0x6'));var rimraf=require(_0x8c7e('0x7'));var config=require(_0x8c7e('0x8'));var attributes=require(_0x8c7e('0x9'));module[_0x8c7e('0xa')]=function(_0x7596d0,_0x3d90f8){return _0x7596d0[_0x8c7e('0xb')](_0x8c7e('0xc'),attributes,{'tableName':_0x8c7e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30d6=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x30d6,0x192));var _0x630d=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0x30d6[_0x8e7772];return _0x408200;};'use strict';var _=require('lodash');var util=require(_0x630d('0x0'));var logger=require(_0x630d('0x1'))(_0x630d('0x2'));var moment=require(_0x630d('0x3'));var BPromise=require('bluebird');var rp=require(_0x630d('0x4'));var fs=require('fs');var path=require(_0x630d('0x5'));var rimraf=require(_0x630d('0x6'));var config=require(_0x630d('0x7'));var attributes=require(_0x630d('0x8'));module[_0x630d('0x9')]=function(_0x1bb227,_0x40b96b){return _0x1bb227[_0x630d('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x630d('0xb'),'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 c2f10db..90dbb89 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 _0x1980=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x17cbae,_0x75ebc8){var _0x325ef8=function(_0x3eef6b){while(--_0x3eef6b){_0x17cbae['push'](_0x17cbae['shift']());}};_0x325ef8(++_0x75ebc8);}(_0x1980,0xe4));var _0x0198=function(_0x14ca5e,_0x42d3da){_0x14ca5e=_0x14ca5e-0x0;var _0x3c5337=_0x1980[_0x14ca5e];return _0x3c5337;};'use strict';var _=require(_0x0198('0x0'));var util=require(_0x0198('0x1'));var moment=require(_0x0198('0x2'));var BPromise=require('bluebird');var rs=require(_0x0198('0x3'));var fs=require('fs');var Redis=require(_0x0198('0x4'));var db=require(_0x0198('0x5'))['db'];var utils=require(_0x0198('0x6'));var logger=require(_0x0198('0x7'))('rpc');var config=require(_0x0198('0x8'));var jayson=require(_0x0198('0x9'));var client=jayson['client'][_0x0198('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b3b5,_0x162696,_0x373a9a){return new BPromise(function(_0x384f6a,_0x2255f7){return client[_0x0198('0xb')](_0x17b3b5,_0x373a9a)[_0x0198('0xc')](function(_0x3235cf){logger['info'](_0x0198('0xd'),_0x162696,_0x0198('0xe'));logger['debug'](_0x0198('0xf'),_0x162696,_0x0198('0xe'),JSON['stringify'](_0x3235cf));if(_0x3235cf[_0x0198('0x10')]){if(_0x3235cf[_0x0198('0x10')][_0x0198('0x11')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x162696,_0x3235cf[_0x0198('0x10')][_0x0198('0x12')]);return _0x2255f7(_0x3235cf[_0x0198('0x10')][_0x0198('0x12')]);}logger[_0x0198('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x162696,_0x3235cf['error'][_0x0198('0x12')]);return _0x384f6a(_0x3235cf['error']['message']);}else{logger[_0x0198('0x13')](_0x0198('0xd'),_0x162696,_0x0198('0xe'));_0x384f6a(_0x3235cf[_0x0198('0x14')]['message']);}})[_0x0198('0x15')](function(_0x24fb7b){logger[_0x0198('0x10')](_0x0198('0xd'),_0x162696,_0x24fb7b);_0x2255f7(_0x24fb7b);});});}
\ No newline at end of file
+var _0x8db8=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info'];(function(_0x162def,_0x4fdb79){var _0x2e19f1=function(_0x446f98){while(--_0x446f98){_0x162def['push'](_0x162def['shift']());}};_0x2e19f1(++_0x4fdb79);}(_0x8db8,0xb1));var _0x88db=function(_0x4501fe,_0x5727e9){_0x4501fe=_0x4501fe-0x0;var _0x170487=_0x8db8[_0x4501fe];return _0x170487;};'use strict';var _=require(_0x88db('0x0'));var util=require(_0x88db('0x1'));var moment=require(_0x88db('0x2'));var BPromise=require(_0x88db('0x3'));var rs=require(_0x88db('0x4'));var fs=require('fs');var Redis=require(_0x88db('0x5'));var db=require(_0x88db('0x6'))['db'];var utils=require(_0x88db('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x88db('0x8'));var client=jayson['client'][_0x88db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a7794,_0x2d31a6,_0x23388b){return new BPromise(function(_0x2eafe0,_0x318d5b){return client['request'](_0x3a7794,_0x23388b)[_0x88db('0xa')](function(_0x3175c8){logger[_0x88db('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d31a6,_0x88db('0xc'));logger['debug'](_0x88db('0xd'),_0x2d31a6,_0x88db('0xc'),JSON[_0x88db('0xe')](_0x3175c8));if(_0x3175c8[_0x88db('0xf')]){if(_0x3175c8['error'][_0x88db('0x10')]===0x1f4){logger[_0x88db('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d31a6,_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);return _0x318d5b(_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);}logger[_0x88db('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d31a6,_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);return _0x2eafe0(_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);}else{logger[_0x88db('0xb')](_0x88db('0x12'),_0x2d31a6,_0x88db('0xc'));_0x2eafe0(_0x3175c8[_0x88db('0x13')][_0x88db('0x11')]);}})[_0x88db('0x14')](function(_0x127e20){logger[_0x88db('0xf')](_0x88db('0x12'),_0x2d31a6,_0x127e20);_0x318d5b(_0x127e20);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index d7b0164..deffc97 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 _0x287e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','put','delete','/:id','destroy','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x287e,0x1e3));var _0xe287=function(_0x868831,_0x1ae29a){_0x868831=_0x868831-0x0;var _0x11e1fa=_0x287e[_0x868831];return _0x11e1fa;};'use strict';var multer=require(_0xe287('0x0'));var util=require(_0xe287('0x1'));var path=require(_0xe287('0x2'));var timeout=require(_0xe287('0x3'));var express=require(_0xe287('0x4'));var router=express[_0xe287('0x5')]();var fs_extra=require(_0xe287('0x6'));var auth=require(_0xe287('0x7'));var interaction=require(_0xe287('0x8'));var config=require('../../config/environment');var controller=require(_0xe287('0x9'));router[_0xe287('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe287('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe287('0xa')](_0xe287('0xb'),auth[_0xe287('0xc')](),controller[_0xe287('0xd')]);router[_0xe287('0xa')](_0xe287('0xe'),auth[_0xe287('0xc')](),controller[_0xe287('0xf')]);router[_0xe287('0xa')](_0xe287('0x10'),auth[_0xe287('0xc')](),controller[_0xe287('0x11')]);router['post']('/',auth[_0xe287('0xc')](),controller['create']);router[_0xe287('0x12')]('/:id',auth[_0xe287('0xc')](),controller['update']);router[_0xe287('0x13')](_0xe287('0x14'),auth[_0xe287('0xc')](),controller[_0xe287('0x15')]);module[_0xe287('0x16')]=router;
\ No newline at end of file
+var _0xe321=['preview','run','/:id/query','query','post','put','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x4a6702,_0x405e77){var _0x3c5e45=function(_0x2e841f){while(--_0x2e841f){_0x4a6702['push'](_0x4a6702['shift']());}};_0x3c5e45(++_0x405e77);}(_0xe321,0x194));var _0x1e32=function(_0x2e67a4,_0x281041){_0x2e67a4=_0x2e67a4-0x0;var _0x4cb738=_0xe321[_0x2e67a4];return _0x4cb738;};'use strict';var multer=require('multer');var util=require(_0x1e32('0x0'));var path=require(_0x1e32('0x1'));var timeout=require(_0x1e32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e32('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e32('0x4'));var controller=require(_0x1e32('0x5'));router[_0x1e32('0x6')]('/',auth[_0x1e32('0x7')](),controller[_0x1e32('0x8')]);router[_0x1e32('0x6')](_0x1e32('0x9'),auth[_0x1e32('0x7')](),controller['show']);router[_0x1e32('0x6')]('/:id/preview',auth[_0x1e32('0x7')](),controller[_0x1e32('0xa')]);router['get']('/:id/run',auth[_0x1e32('0x7')](),controller[_0x1e32('0xb')]);router['get'](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0xd')]);router[_0x1e32('0xe')]('/',auth[_0x1e32('0x7')](),controller['create']);router[_0x1e32('0xf')]('/:id',auth[_0x1e32('0x7')](),controller['update']);router['delete'](_0x1e32('0x9'),auth[_0x1e32('0x7')](),controller[_0x1e32('0x10')]);module[_0x1e32('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index b60d23b..ad197ae 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 _0xa442=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','UNSIGNED'];(function(_0x593211,_0x271794){var _0x65c6b3=function(_0x1a318b){while(--_0x1a318b){_0x593211['push'](_0x593211['shift']());}};_0x65c6b3(++_0x271794);}(_0xa442,0x114));var _0x2a44=function(_0x2aac51,_0x2dbc51){_0x2aac51=_0x2aac51-0x0;var _0x4ba79b=_0xa442[_0x2aac51];return _0x4ba79b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2a44('0x0'));module[_0x2a44('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x2a44('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2a44('0x3')](_0x2a44('0x4'),_0x2a44('0x5'),_0x2a44('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2a44('0x7')]},'endDate':{'type':Sequelize[_0x2a44('0x7')]},'status':{'type':Sequelize[_0x2a44('0x2')],'defaultValue':_0x2a44('0x8')},'type':{'type':Sequelize[_0x2a44('0x3')]('manual',_0x2a44('0x9')),'allowNull':![],'defaultValue':_0x2a44('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2a44('0xb')]},'reportType':{'type':Sequelize[_0x2a44('0x2')]}};
\ No newline at end of file
+var _0x04d1=['Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x04d1,0x1d9));var _0x104d=function(_0x33fb6c,_0xdf875b){_0x33fb6c=_0x33fb6c-0x0;var _0x291370=_0x04d1[_0x33fb6c];return _0x291370;};'use strict';var Sequelize=require(_0x104d('0x0'));var moment=require('moment');module[_0x104d('0x1')]={'name':{'type':Sequelize[_0x104d('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x104d('0x3')](_0x104d('0x4'),_0x104d('0x5'),_0x104d('0x6')),'allowNull':![],'defaultValue':_0x104d('0x4')},'savename':{'type':Sequelize[_0x104d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x104d('0x7')]},'status':{'type':Sequelize[_0x104d('0x2')],'defaultValue':_0x104d('0x8')},'type':{'type':Sequelize[_0x104d('0x3')]('manual',_0x104d('0x9')),'allowNull':![],'defaultValue':_0x104d('0xa')},'reportId':{'type':Sequelize[_0x104d('0xb')](0xb)[_0x104d('0xc')]},'reportType':{'type':Sequelize[_0x104d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index dddd545..fdbfc6e 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 _0x6589=['squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','update','download','savename','output','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','join','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xefdc1c,_0x10f40b){var _0x48581c=function(_0x5cad7f){while(--_0x5cad7f){_0xefdc1c['push'](_0xefdc1c['shift']());}};_0x48581c(++_0x10f40b);}(_0x6589,0x166));var _0x9658=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x6589[_0x5c7a85];return _0x35290f;};'use strict';var emlformat=require(_0x9658('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9658('0x1'));var jsonpatch=require(_0x9658('0x2'));var rp=require(_0x9658('0x3'));var moment=require(_0x9658('0x4'));var BPromise=require(_0x9658('0x5'));var Mustache=require(_0x9658('0x6'));var util=require(_0x9658('0x7'));var path=require(_0x9658('0x8'));var sox=require(_0x9658('0x9'));var csv=require(_0x9658('0xa'));var ejs=require(_0x9658('0xb'));var fs=require('fs');var fs_extra=require(_0x9658('0xc'));var _=require(_0x9658('0xd'));var squel=require(_0x9658('0xe'));var crypto=require('crypto');var jsforce=require(_0x9658('0xf'));var deskjs=require(_0x9658('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9658('0x11'));var authService=require(_0x9658('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9658('0x13'));var logger=require(_0x9658('0x14'))(_0x9658('0x15'));var utils=require(_0x9658('0x16'));var config=require(_0x9658('0x17'));var licenseUtil=require(_0x9658('0x18'));var db=require(_0x9658('0x19'))['db'];function respondWithStatusCode(_0x228bc3,_0x49e6a8){_0x49e6a8=_0x49e6a8||0xcc;return function(_0x709ea){if(_0x709ea){return _0x228bc3[_0x9658('0x1a')](_0x49e6a8);}return _0x228bc3[_0x9658('0x1b')](_0x49e6a8)[_0x9658('0x1c')]();};}function respondWithResult(_0x208301,_0x4a324c){_0x4a324c=_0x4a324c||0xc8;return function(_0x2deeb8){if(_0x2deeb8){return _0x208301[_0x9658('0x1b')](_0x4a324c)['json'](_0x2deeb8);}};}function respondWithFilteredResult(_0x2edc0e,_0x36afe2){return function(_0x199dfe){if(_0x199dfe){var _0x207235=typeof _0x36afe2[_0x9658('0x1d')]===_0x9658('0x1e')&&typeof _0x36afe2[_0x9658('0x1f')]==='undefined';var _0x57d7cf=_0x199dfe[_0x9658('0x20')];var _0x6487d6=_0x207235?0x0:_0x36afe2[_0x9658('0x1d')];var _0x169ce4=_0x207235?_0x199dfe[_0x9658('0x20')]:_0x36afe2[_0x9658('0x1d')]+_0x36afe2[_0x9658('0x1f')];var _0x301e2c;if(_0x169ce4>=_0x57d7cf){_0x169ce4=_0x57d7cf;_0x301e2c=0xc8;}else{_0x301e2c=0xce;}_0x2edc0e[_0x9658('0x1b')](_0x301e2c);return _0x2edc0e[_0x9658('0x21')](_0x9658('0x22'),_0x6487d6+'-'+_0x169ce4+'/'+_0x57d7cf)['json'](_0x199dfe);}return null;};}function patchUpdates(_0x49b170){return function(_0x15faaa){try{jsonpatch[_0x9658('0x23')](_0x15faaa,_0x49b170,!![]);}catch(_0x301d77){return BPromise[_0x9658('0x24')](_0x301d77);}return _0x15faaa[_0x9658('0x25')]();};}function saveUpdates(_0x589626,_0xe37801){return function(_0x4945ae){if(_0x4945ae){return _0x4945ae['update'](_0x589626)[_0x9658('0x26')](function(_0x34d4ce){return _0x34d4ce;});}return null;};}function removeEntity(_0x4e6a1e,_0x4b82d7){return function(_0x36ba4a){if(_0x36ba4a){return _0x36ba4a[_0x9658('0x27')]()[_0x9658('0x26')](function(){var _0x2b3b46=_0x36ba4a[_0x9658('0x28')]({'plain':!![]});var _0x32f8e5=_0x9658('0x29');return db[_0x9658('0x2a')][_0x9658('0x27')]({'where':{'type':_0x32f8e5,'resourceId':_0x2b3b46['id']}})['then'](function(){return _0x36ba4a;});})[_0x9658('0x26')](function(){_0x4e6a1e[_0x9658('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ea86,_0x5c33dd){return function(_0x4ce39f){if(!_0x4ce39f){_0x28ea86['sendStatus'](0x194);}return _0x4ce39f;};}function handleError(_0x4ecae9,_0x5dcb03){_0x5dcb03=_0x5dcb03||0x1f4;return function(_0x17e1cc){logger[_0x9658('0x2b')](_0x17e1cc[_0x9658('0x2c')]);if(_0x17e1cc[_0x9658('0x2d')]){delete _0x17e1cc['name'];}_0x4ecae9[_0x9658('0x1b')](_0x5dcb03)['send'](_0x17e1cc);};}exports[_0x9658('0x2e')]=function(_0xff80f3,_0x5eac48){var _0x39464a={},_0x55afea={},_0x2f8aef={'count':0x0,'rows':[]};var _0xb3c34a=_[_0x9658('0x2f')](db['AnalyticExtractedReport'][_0x9658('0x30')],function(_0x5622cc){return{'name':_0x5622cc[_0x9658('0x31')],'type':_0x5622cc['type']['key']};});_0x55afea['model']=_[_0x9658('0x2f')](_0xb3c34a,_0x9658('0x2d'));_0x55afea[_0x9658('0x32')]=_['keys'](_0xff80f3['query']);_0x55afea['filters']=_[_0x9658('0x33')](_0x55afea[_0x9658('0x34')],_0x55afea['query']);_0x39464a[_0x9658('0x35')]=_[_0x9658('0x33')](_0x55afea['model'],qs[_0x9658('0x36')](_0xff80f3['query'][_0x9658('0x36')]));_0x39464a[_0x9658('0x35')]=_0x39464a[_0x9658('0x35')][_0x9658('0x37')]?_0x39464a['attributes']:_0x55afea[_0x9658('0x34')];if(!_0xff80f3[_0x9658('0x32')][_0x9658('0x38')]('nolimit')){_0x39464a[_0x9658('0x1f')]=qs['limit'](_0xff80f3[_0x9658('0x32')][_0x9658('0x1f')]);_0x39464a[_0x9658('0x1d')]=qs[_0x9658('0x1d')](_0xff80f3['query'][_0x9658('0x1d')]);}_0x39464a[_0x9658('0x39')]=qs[_0x9658('0x3a')](_0xff80f3['query']['sort']);_0x39464a[_0x9658('0x3b')]=qs[_0x9658('0x3c')](_[_0x9658('0x3d')](_0xff80f3[_0x9658('0x32')],_0x55afea[_0x9658('0x3c')]),_0xb3c34a);if(_0xff80f3[_0x9658('0x32')][_0x9658('0x3e')]){_0x39464a[_0x9658('0x3b')]=_[_0x9658('0x3f')](_0x39464a[_0x9658('0x3b')],{'$or':_[_0x9658('0x2f')](_0xb3c34a,function(_0x3d8efc){if(_0x3d8efc['type']!==_0x9658('0x40')){var _0x5ef8dd={};_0x5ef8dd[_0x3d8efc[_0x9658('0x2d')]]={'$like':'%'+_0xff80f3[_0x9658('0x32')]['filter']+'%'};return _0x5ef8dd;}})});}_0x39464a=_[_0x9658('0x3f')]({},_0x39464a,_0xff80f3[_0x9658('0x41')]);var _0x56fe62={'where':_0x39464a[_0x9658('0x3b')]};return db[_0x9658('0x42')][_0x9658('0x20')](_0x56fe62)[_0x9658('0x26')](function(_0x19981c){_0x2f8aef[_0x9658('0x20')]=_0x19981c;if(_0xff80f3[_0x9658('0x32')][_0x9658('0x43')]){_0x39464a[_0x9658('0x44')]=[{'all':!![]}];}return db[_0x9658('0x42')]['findAll'](_0x39464a);})[_0x9658('0x26')](function(_0x5cbd68){_0x2f8aef[_0x9658('0x45')]=_0x5cbd68;return _0x2f8aef;})['then'](respondWithFilteredResult(_0x5eac48,_0x39464a))['catch'](handleError(_0x5eac48,null));};exports[_0x9658('0x46')]=function(_0x8115e5,_0x207a4d){var _0x560ce0={'raw':!![],'where':{'id':_0x8115e5[_0x9658('0x47')]['id']}},_0x44c065={};_0x44c065[_0x9658('0x34')]=_[_0x9658('0x48')](db[_0x9658('0x42')][_0x9658('0x30')]);_0x44c065[_0x9658('0x32')]=_[_0x9658('0x48')](_0x8115e5['query']);_0x44c065[_0x9658('0x3c')]=_[_0x9658('0x33')](_0x44c065[_0x9658('0x34')],_0x44c065[_0x9658('0x32')]);_0x560ce0['attributes']=_[_0x9658('0x33')](_0x44c065[_0x9658('0x34')],qs[_0x9658('0x36')](_0x8115e5[_0x9658('0x32')]['fields']));_0x560ce0[_0x9658('0x35')]=_0x560ce0[_0x9658('0x35')][_0x9658('0x37')]?_0x560ce0[_0x9658('0x35')]:_0x44c065['model'];if(_0x8115e5[_0x9658('0x32')][_0x9658('0x43')]){_0x560ce0['include']=[{'all':!![]}];}_0x560ce0=_[_0x9658('0x3f')]({},_0x560ce0,_0x8115e5['options']);return db[_0x9658('0x42')][_0x9658('0x49')](_0x560ce0)[_0x9658('0x26')](handleEntityNotFound(_0x207a4d,null))[_0x9658('0x26')](respondWithResult(_0x207a4d,null))[_0x9658('0x4a')](handleError(_0x207a4d,null));};exports[_0x9658('0x4b')]=function(_0x2141c4,_0x149486){return db['AnalyticExtractedReport'][_0x9658('0x4b')](_0x2141c4[_0x9658('0x4c')],{})[_0x9658('0x26')](function(_0x3758c8){var _0x1e3456=_0x2141c4[_0x9658('0x4d')][_0x9658('0x28')]({'plain':!![]});if(!_0x1e3456)throw new Error(_0x9658('0x4e'));if(_0x1e3456['role']===_0x9658('0x4d')){var _0x39c590=_0x3758c8[_0x9658('0x28')]({'plain':!![]});var _0x3a88f1='ExtractedReports';return db['UserProfileSection'][_0x9658('0x49')]({'where':{'name':_0x3a88f1,'userProfileId':_0x1e3456[_0x9658('0x4f')]},'raw':!![]})[_0x9658('0x26')](function(_0x46ab5b){if(_0x46ab5b&&_0x46ab5b[_0x9658('0x50')]===0x0){return db[_0x9658('0x2a')][_0x9658('0x4b')]({'name':_0x39c590[_0x9658('0x2d')],'resourceId':_0x39c590['id'],'type':_0x46ab5b[_0x9658('0x2d')],'sectionId':_0x46ab5b['id']},{})['then'](function(){return _0x3758c8;});}else{return _0x3758c8;}})[_0x9658('0x4a')](function(_0x18131c){logger[_0x9658('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18131c);throw _0x18131c;});}return _0x3758c8;})[_0x9658('0x26')](respondWithResult(_0x149486,0xc9))[_0x9658('0x4a')](handleError(_0x149486,null));};exports[_0x9658('0x51')]=function(_0x5a385d,_0x5d6e93){if(_0x5a385d[_0x9658('0x4c')]['id']){delete _0x5a385d[_0x9658('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0x9658('0x49')]({'where':{'id':_0x5a385d[_0x9658('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d6e93,null))['then'](saveUpdates(_0x5a385d['body'],null))[_0x9658('0x26')](respondWithResult(_0x5d6e93,null))['catch'](handleError(_0x5d6e93,null));};exports[_0x9658('0x27')]=function(_0x5eb748,_0x344a09){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5eb748[_0x9658('0x47')]['id']}})[_0x9658('0x26')](handleEntityNotFound(_0x344a09,null))[_0x9658('0x26')](removeEntity(_0x344a09,null))[_0x9658('0x4a')](handleError(_0x344a09,null));};exports[_0x9658('0x52')]=function(_0x5403f7,_0xcd00f,_0x13eee0){return db['AnalyticExtractedReport'][_0x9658('0x49')]({'where':{'id':_0x5403f7[_0x9658('0x47')]['id']},'attributes':[_0x9658('0x2d'),'basename',_0x9658('0x53'),_0x9658('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0xcd00f,null))[_0x9658('0x26')](function(_0x34d883){if(_0x34d883){if(!fs['existsSync'](path['join'](config[_0x9658('0x55')],_0x9658('0x56'),_0x34d883[_0x9658('0x53')]))){throw new db['Sequelize'][(_0x9658('0x57'))](_0x9658('0x58'));}if(_0x5403f7[_0x9658('0x32')]['exists']){return _0xcd00f[_0x9658('0x1a')](0xc8);}return _0xcd00f[_0x9658('0x52')](path[_0x9658('0x59')](config[_0x9658('0x55')],_0x9658('0x56'),_0x34d883[_0x9658('0x53')]),util[_0x9658('0x5a')](_0x9658('0x5b'),_0x34d883['basename']||_0x34d883['name'],_0x34d883[_0x9658('0x54')][_0x9658('0x5c')]()));}})['catch'](handleError(_0xcd00f,null));};
\ No newline at end of file
+var _0xbc07=['status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','name','send','AnalyticExtractedReport','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','savename','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','end'];(function(_0x11cd67,_0x5402e2){var _0x4f1f3b=function(_0x308392){while(--_0x308392){_0x11cd67['push'](_0x11cd67['shift']());}};_0x4f1f3b(++_0x5402e2);}(_0xbc07,0xf3));var _0x7bc0=function(_0x17f12e,_0x3621e6){_0x17f12e=_0x17f12e-0x0;var _0x286ca2=_0xbc07[_0x17f12e];return _0x286ca2;};'use strict';var emlformat=require(_0x7bc0('0x0'));var rimraf=require(_0x7bc0('0x1'));var zipdir=require(_0x7bc0('0x2'));var jsonpatch=require(_0x7bc0('0x3'));var rp=require(_0x7bc0('0x4'));var moment=require(_0x7bc0('0x5'));var BPromise=require(_0x7bc0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7bc0('0x7'));var csv=require(_0x7bc0('0x8'));var ejs=require(_0x7bc0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bc0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bc0('0xb'));var deskjs=require(_0x7bc0('0xc'));var toCsv=require(_0x7bc0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7bc0('0xd'));var authService=require(_0x7bc0('0xe'));var qs=require(_0x7bc0('0xf'));var as=require(_0x7bc0('0x10'));var hardwareService=require(_0x7bc0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7bc0('0x12'));var config=require(_0x7bc0('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48cd37,_0x170a84){_0x170a84=_0x170a84||0xcc;return function(_0x34ce1e){if(_0x34ce1e){return _0x48cd37['sendStatus'](_0x170a84);}return _0x48cd37['status'](_0x170a84)[_0x7bc0('0x14')]();};}function respondWithResult(_0x554189,_0x1bba64){_0x1bba64=_0x1bba64||0xc8;return function(_0x30d2f3){if(_0x30d2f3){return _0x554189[_0x7bc0('0x15')](_0x1bba64)['json'](_0x30d2f3);}};}function respondWithFilteredResult(_0x24e610,_0x4107f1){return function(_0xcddba7){if(_0xcddba7){var _0x1c512e=typeof _0x4107f1[_0x7bc0('0x16')]===_0x7bc0('0x17')&&typeof _0x4107f1[_0x7bc0('0x18')]===_0x7bc0('0x17');var _0x2c6752=_0xcddba7[_0x7bc0('0x19')];var _0x150245=_0x1c512e?0x0:_0x4107f1[_0x7bc0('0x16')];var _0x9271c4=_0x1c512e?_0xcddba7[_0x7bc0('0x19')]:_0x4107f1['offset']+_0x4107f1['limit'];var _0x5275d8;if(_0x9271c4>=_0x2c6752){_0x9271c4=_0x2c6752;_0x5275d8=0xc8;}else{_0x5275d8=0xce;}_0x24e610[_0x7bc0('0x15')](_0x5275d8);return _0x24e610[_0x7bc0('0x1a')]('Content-Range',_0x150245+'-'+_0x9271c4+'/'+_0x2c6752)[_0x7bc0('0x1b')](_0xcddba7);}return null;};}function patchUpdates(_0x3179a8){return function(_0x1ba038){try{jsonpatch[_0x7bc0('0x1c')](_0x1ba038,_0x3179a8,!![]);}catch(_0x5d2100){return BPromise['reject'](_0x5d2100);}return _0x1ba038[_0x7bc0('0x1d')]();};}function saveUpdates(_0x48c9a8,_0x16c784){return function(_0x3d54a9){if(_0x3d54a9){return _0x3d54a9[_0x7bc0('0x1e')](_0x48c9a8)[_0x7bc0('0x1f')](function(_0x3a47ba){return _0x3a47ba;});}return null;};}function removeEntity(_0x45a66e,_0x2f3f62){return function(_0x110094){if(_0x110094){return _0x110094[_0x7bc0('0x20')]()[_0x7bc0('0x1f')](function(){var _0x1bc121=_0x110094[_0x7bc0('0x21')]({'plain':!![]});var _0x1ab057=_0x7bc0('0x22');return db[_0x7bc0('0x23')][_0x7bc0('0x20')]({'where':{'type':_0x1ab057,'resourceId':_0x1bc121['id']}})[_0x7bc0('0x1f')](function(){return _0x110094;});})[_0x7bc0('0x1f')](function(){_0x45a66e['status'](0xcc)[_0x7bc0('0x14')]();});}};}function handleEntityNotFound(_0x475b52,_0x1e884c){return function(_0x4216cc){if(!_0x4216cc){_0x475b52[_0x7bc0('0x24')](0x194);}return _0x4216cc;};}function handleError(_0x307895,_0x5d090c){_0x5d090c=_0x5d090c||0x1f4;return function(_0x46b941){logger[_0x7bc0('0x25')](_0x46b941['stack']);if(_0x46b941[_0x7bc0('0x26')]){delete _0x46b941['name'];}_0x307895[_0x7bc0('0x15')](_0x5d090c)[_0x7bc0('0x27')](_0x46b941);};}exports['index']=function(_0x1ba845,_0x3ba533){var _0x2f841f={},_0x63acc3={},_0x1b3bd2={'count':0x0,'rows':[]};var _0x4c9817=_['map'](db[_0x7bc0('0x28')]['rawAttributes'],function(_0x393cc6){return{'name':_0x393cc6['fieldName'],'type':_0x393cc6[_0x7bc0('0x29')][_0x7bc0('0x2a')]};});_0x63acc3[_0x7bc0('0x2b')]=_['map'](_0x4c9817,_0x7bc0('0x26'));_0x63acc3[_0x7bc0('0x2c')]=_['keys'](_0x1ba845[_0x7bc0('0x2c')]);_0x63acc3[_0x7bc0('0x2d')]=_[_0x7bc0('0x2e')](_0x63acc3[_0x7bc0('0x2b')],_0x63acc3[_0x7bc0('0x2c')]);_0x2f841f['attributes']=_['intersection'](_0x63acc3['model'],qs[_0x7bc0('0x2f')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x2f')]));_0x2f841f['attributes']=_0x2f841f[_0x7bc0('0x30')][_0x7bc0('0x31')]?_0x2f841f['attributes']:_0x63acc3[_0x7bc0('0x2b')];if(!_0x1ba845[_0x7bc0('0x2c')]['hasOwnProperty'](_0x7bc0('0x32'))){_0x2f841f[_0x7bc0('0x18')]=qs[_0x7bc0('0x18')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x18')]);_0x2f841f[_0x7bc0('0x16')]=qs[_0x7bc0('0x16')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x16')]);}_0x2f841f[_0x7bc0('0x33')]=qs[_0x7bc0('0x34')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x34')]);_0x2f841f[_0x7bc0('0x35')]=qs[_0x7bc0('0x2d')](_[_0x7bc0('0x36')](_0x1ba845[_0x7bc0('0x2c')],_0x63acc3[_0x7bc0('0x2d')]),_0x4c9817);if(_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x37')]){_0x2f841f[_0x7bc0('0x35')]=_[_0x7bc0('0x38')](_0x2f841f[_0x7bc0('0x35')],{'$or':_[_0x7bc0('0x39')](_0x4c9817,function(_0x549973){if(_0x549973['type']!==_0x7bc0('0x3a')){var _0x3ded29={};_0x3ded29[_0x549973[_0x7bc0('0x26')]]={'$like':'%'+_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x37')]+'%'};return _0x3ded29;}})});}_0x2f841f=_['merge']({},_0x2f841f,_0x1ba845[_0x7bc0('0x3b')]);var _0x34ad15={'where':_0x2f841f[_0x7bc0('0x35')]};return db[_0x7bc0('0x28')][_0x7bc0('0x19')](_0x34ad15)[_0x7bc0('0x1f')](function(_0x497dd7){_0x1b3bd2[_0x7bc0('0x19')]=_0x497dd7;if(_0x1ba845['query'][_0x7bc0('0x3c')]){_0x2f841f[_0x7bc0('0x3d')]=[{'all':!![]}];}return db[_0x7bc0('0x28')]['findAll'](_0x2f841f);})[_0x7bc0('0x1f')](function(_0x5ebd5e){_0x1b3bd2[_0x7bc0('0x3e')]=_0x5ebd5e;return _0x1b3bd2;})['then'](respondWithFilteredResult(_0x3ba533,_0x2f841f))['catch'](handleError(_0x3ba533,null));};exports['show']=function(_0x12ba49,_0x572ae9){var _0x2ce726={'raw':!![],'where':{'id':_0x12ba49['params']['id']}},_0x643185={};_0x643185['model']=_[_0x7bc0('0x3f')](db[_0x7bc0('0x28')][_0x7bc0('0x40')]);_0x643185[_0x7bc0('0x2c')]=_[_0x7bc0('0x3f')](_0x12ba49['query']);_0x643185[_0x7bc0('0x2d')]=_[_0x7bc0('0x2e')](_0x643185[_0x7bc0('0x2b')],_0x643185[_0x7bc0('0x2c')]);_0x2ce726[_0x7bc0('0x30')]=_['intersection'](_0x643185[_0x7bc0('0x2b')],qs[_0x7bc0('0x2f')](_0x12ba49[_0x7bc0('0x2c')][_0x7bc0('0x2f')]));_0x2ce726[_0x7bc0('0x30')]=_0x2ce726[_0x7bc0('0x30')][_0x7bc0('0x31')]?_0x2ce726[_0x7bc0('0x30')]:_0x643185[_0x7bc0('0x2b')];if(_0x12ba49[_0x7bc0('0x2c')][_0x7bc0('0x3c')]){_0x2ce726['include']=[{'all':!![]}];}_0x2ce726=_[_0x7bc0('0x38')]({},_0x2ce726,_0x12ba49[_0x7bc0('0x3b')]);return db[_0x7bc0('0x28')][_0x7bc0('0x41')](_0x2ce726)[_0x7bc0('0x1f')](handleEntityNotFound(_0x572ae9,null))[_0x7bc0('0x1f')](respondWithResult(_0x572ae9,null))[_0x7bc0('0x42')](handleError(_0x572ae9,null));};exports[_0x7bc0('0x43')]=function(_0x551174,_0x4d20e2){return db[_0x7bc0('0x28')][_0x7bc0('0x43')](_0x551174[_0x7bc0('0x44')],{})['then'](function(_0x4e563e){var _0x4b8f90=_0x551174[_0x7bc0('0x45')][_0x7bc0('0x21')]({'plain':!![]});if(!_0x4b8f90)throw new Error(_0x7bc0('0x46'));if(_0x4b8f90['role']===_0x7bc0('0x45')){var _0x281cc8=_0x4e563e['get']({'plain':!![]});var _0x18137e=_0x7bc0('0x22');return db[_0x7bc0('0x47')]['find']({'where':{'name':_0x18137e,'userProfileId':_0x4b8f90[_0x7bc0('0x48')]},'raw':!![]})[_0x7bc0('0x1f')](function(_0xfa168f){if(_0xfa168f&&_0xfa168f[_0x7bc0('0x49')]===0x0){return db[_0x7bc0('0x23')][_0x7bc0('0x43')]({'name':_0x281cc8['name'],'resourceId':_0x281cc8['id'],'type':_0xfa168f[_0x7bc0('0x26')],'sectionId':_0xfa168f['id']},{})[_0x7bc0('0x1f')](function(){return _0x4e563e;});}else{return _0x4e563e;}})[_0x7bc0('0x42')](function(_0x5cddc8){logger[_0x7bc0('0x25')](_0x7bc0('0x4a'),_0x5cddc8);throw _0x5cddc8;});}return _0x4e563e;})[_0x7bc0('0x1f')](respondWithResult(_0x4d20e2,0xc9))[_0x7bc0('0x42')](handleError(_0x4d20e2,null));};exports[_0x7bc0('0x1e')]=function(_0xe78c1e,_0x5e9042){if(_0xe78c1e[_0x7bc0('0x44')]['id']){delete _0xe78c1e[_0x7bc0('0x44')]['id'];}return db[_0x7bc0('0x28')][_0x7bc0('0x41')]({'where':{'id':_0xe78c1e[_0x7bc0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e9042,null))[_0x7bc0('0x1f')](saveUpdates(_0xe78c1e[_0x7bc0('0x44')],null))['then'](respondWithResult(_0x5e9042,null))[_0x7bc0('0x42')](handleError(_0x5e9042,null));};exports[_0x7bc0('0x20')]=function(_0x315774,_0x3bbda3){return db[_0x7bc0('0x28')][_0x7bc0('0x41')]({'where':{'id':_0x315774[_0x7bc0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bbda3,null))['then'](removeEntity(_0x3bbda3,null))['catch'](handleError(_0x3bbda3,null));};exports[_0x7bc0('0x4c')]=function(_0x551481,_0x4fb3da,_0x33b42e){return db[_0x7bc0('0x28')][_0x7bc0('0x41')]({'where':{'id':_0x551481['params']['id']},'attributes':['name',_0x7bc0('0x4d'),'savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x4fb3da,null))[_0x7bc0('0x1f')](function(_0x1db9fa){if(_0x1db9fa){if(!fs[_0x7bc0('0x4e')](path[_0x7bc0('0x4f')](config[_0x7bc0('0x50')],_0x7bc0('0x51'),_0x1db9fa['savename']))){throw new db[(_0x7bc0('0x52'))][(_0x7bc0('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x551481[_0x7bc0('0x2c')][_0x7bc0('0x54')]){return _0x4fb3da[_0x7bc0('0x24')](0xc8);}return _0x4fb3da[_0x7bc0('0x4c')](path[_0x7bc0('0x4f')](config['root'],'server/files/reports',_0x1db9fa[_0x7bc0('0x55')]),util['format'](_0x7bc0('0x56'),_0x1db9fa[_0x7bc0('0x4d')]||_0x1db9fa[_0x7bc0('0x26')],_0x1db9fa['output'][_0x7bc0('0x57')]()));}})[_0x7bc0('0x42')](handleError(_0x4fb3da,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index fd534d9..ce74c02 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 _0x5fd1=['lodash','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x4d0da9,_0x5cee7d){var _0x5055e0=function(_0xcc8555){while(--_0xcc8555){_0x4d0da9['push'](_0x4d0da9['shift']());}};_0x5055e0(++_0x5cee7d);}(_0x5fd1,0x15e));var _0x15fd=function(_0x2784f4,_0x30c425){_0x2784f4=_0x2784f4-0x0;var _0x7214a2=_0x5fd1[_0x2784f4];return _0x7214a2;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require('rimraf');var config=require(_0x15fd('0x5'));var attributes=require(_0x15fd('0x6'));module[_0x15fd('0x7')]=function(_0x13d48e,_0x3ea089){return _0x13d48e['define'](_0x15fd('0x8'),attributes,{'tableName':_0x15fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1955=['define','AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x277d73,_0x3f7311){var _0x5b0a43=function(_0x54b1b1){while(--_0x54b1b1){_0x277d73['push'](_0x277d73['shift']());}};_0x5b0a43(++_0x3f7311);}(_0x1955,0xca));var _0x5195=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1955[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x5195('0x0'));var util=require(_0x5195('0x1'));var logger=require(_0x5195('0x2'))(_0x5195('0x3'));var moment=require('moment');var BPromise=require(_0x5195('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5195('0x5'));var config=require('../../config/environment');var attributes=require(_0x5195('0x6'));module[_0x5195('0x7')]=function(_0x2ec9b8,_0x1a7ab9){return _0x2ec9b8[_0x5195('0x8')](_0x5195('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 1214cb7..9d718a4 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 _0xba94=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xba94,0xe3));var _0x4ba9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xba94[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x4ba9('0x0'));var util=require(_0x4ba9('0x1'));var moment=require(_0x4ba9('0x2'));var BPromise=require(_0x4ba9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ba9('0x4'));var db=require(_0x4ba9('0x5'))['db'];var utils=require(_0x4ba9('0x6'));var logger=require(_0x4ba9('0x7'))('rpc');var config=require(_0x4ba9('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4458e7,_0x4b9cc1,_0x5f426d){return new BPromise(function(_0x380439,_0x4f1a3a){return client[_0x4ba9('0x9')](_0x4458e7,_0x5f426d)[_0x4ba9('0xa')](function(_0x5e58f0){logger[_0x4ba9('0xb')](_0x4ba9('0xc'),_0x4b9cc1,_0x4ba9('0xd'));logger[_0x4ba9('0xe')](_0x4ba9('0xf'),_0x4b9cc1,_0x4ba9('0xd'),JSON[_0x4ba9('0x10')](_0x5e58f0));if(_0x5e58f0[_0x4ba9('0x11')]){if(_0x5e58f0[_0x4ba9('0x11')][_0x4ba9('0x12')]===0x1f4){logger[_0x4ba9('0x11')](_0x4ba9('0xc'),_0x4b9cc1,_0x5e58f0[_0x4ba9('0x11')][_0x4ba9('0x13')]);return _0x4f1a3a(_0x5e58f0[_0x4ba9('0x11')][_0x4ba9('0x13')]);}logger[_0x4ba9('0x11')](_0x4ba9('0xc'),_0x4b9cc1,_0x5e58f0[_0x4ba9('0x11')]['message']);return _0x380439(_0x5e58f0[_0x4ba9('0x11')][_0x4ba9('0x13')]);}else{logger[_0x4ba9('0xb')](_0x4ba9('0xc'),_0x4b9cc1,_0x4ba9('0xd'));_0x380439(_0x5e58f0[_0x4ba9('0x14')]['message']);}})['catch'](function(_0x31510e){logger[_0x4ba9('0x11')](_0x4ba9('0xc'),_0x4b9cc1,_0x31510e);_0x4f1a3a(_0x31510e);});});}
\ No newline at end of file
+var _0x4189=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1fb2e9,_0x240de2){var _0x327c7c=function(_0x361e94){while(--_0x361e94){_0x1fb2e9['push'](_0x1fb2e9['shift']());}};_0x327c7c(++_0x240de2);}(_0x4189,0x160));var _0x9418=function(_0x2a22b8,_0x228cdf){_0x2a22b8=_0x2a22b8-0x0;var _0x2715fd=_0x4189[_0x2a22b8];return _0x2715fd;};'use strict';var _=require(_0x9418('0x0'));var util=require('util');var moment=require(_0x9418('0x1'));var BPromise=require(_0x9418('0x2'));var rs=require(_0x9418('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9418('0x4'))['db'];var utils=require(_0x9418('0x5'));var logger=require('../../config/logger')(_0x9418('0x6'));var config=require(_0x9418('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9418('0x8')][_0x9418('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3134,_0x215e21,_0x7cd70d){return new BPromise(function(_0x2ac01b,_0x1e902e){return client[_0x9418('0xa')](_0x4c3134,_0x7cd70d)[_0x9418('0xb')](function(_0x3d59dd){logger[_0x9418('0xc')](_0x9418('0xd'),_0x215e21,_0x9418('0xe'));logger['debug'](_0x9418('0xf'),_0x215e21,'request\x20sent',JSON[_0x9418('0x10')](_0x3d59dd));if(_0x3d59dd[_0x9418('0x11')]){if(_0x3d59dd[_0x9418('0x11')]['code']===0x1f4){logger[_0x9418('0x11')](_0x9418('0xd'),_0x215e21,_0x3d59dd[_0x9418('0x11')][_0x9418('0x12')]);return _0x1e902e(_0x3d59dd[_0x9418('0x11')][_0x9418('0x12')]);}logger[_0x9418('0x11')](_0x9418('0xd'),_0x215e21,_0x3d59dd[_0x9418('0x11')]['message']);return _0x2ac01b(_0x3d59dd[_0x9418('0x11')]['message']);}else{logger[_0x9418('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x215e21,'request\x20sent');_0x2ac01b(_0x3d59dd[_0x9418('0x13')][_0x9418('0x12')]);}})[_0x9418('0x14')](function(_0x1fdbfa){logger[_0x9418('0x11')](_0x9418('0xd'),_0x215e21,_0x1fdbfa);_0x1e902e(_0x1fdbfa);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index dd95dd0..0b28e22 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 _0x0a70=['/:id','show','/:id/download','download','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x276b4a,_0x31eba0){var _0x5a7949=function(_0x3b1925){while(--_0x3b1925){_0x276b4a['push'](_0x276b4a['shift']());}};_0x5a7949(++_0x31eba0);}(_0x0a70,0x7e));var _0x00a7=function(_0x6b4261,_0x379297){_0x6b4261=_0x6b4261-0x0;var _0x5a8a67=_0x0a70[_0x6b4261];return _0x5a8a67;};'use strict';var multer=require(_0x00a7('0x0'));var util=require(_0x00a7('0x1'));var path=require(_0x00a7('0x2'));var timeout=require('connect-timeout');var express=require(_0x00a7('0x3'));var router=express[_0x00a7('0x4')]();var fs_extra=require(_0x00a7('0x5'));var auth=require(_0x00a7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x00a7('0x7'));router[_0x00a7('0x8')]('/',auth[_0x00a7('0x9')](),controller['index']);router[_0x00a7('0x8')](_0x00a7('0xa'),auth[_0x00a7('0x9')](),controller[_0x00a7('0xb')]);router['get'](_0x00a7('0xc'),auth[_0x00a7('0x9')](),controller[_0x00a7('0xd')]);router['post']('/',auth[_0x00a7('0x9')](),controller['create']);router['put'](_0x00a7('0xa'),auth[_0x00a7('0x9')](),controller[_0x00a7('0xe')]);router[_0x00a7('0xf')](_0x00a7('0xa'),auth[_0x00a7('0x9')](),controller[_0x00a7('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x1c09=['get','isAuthenticated','index','/:id','show','/:id/download','post','create','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbaf5c4,_0x162678){var _0x531a72=function(_0x1705e0){while(--_0x1705e0){_0xbaf5c4['push'](_0xbaf5c4['shift']());}};_0x531a72(++_0x162678);}(_0x1c09,0xf3));var _0x91c0=function(_0x3f8ab6,_0x428986){_0x3f8ab6=_0x3f8ab6-0x0;var _0x4a977c=_0x1c09[_0x3f8ab6];return _0x4a977c;};'use strict';var multer=require(_0x91c0('0x0'));var util=require(_0x91c0('0x1'));var path=require(_0x91c0('0x2'));var timeout=require(_0x91c0('0x3'));var express=require('express');var router=express[_0x91c0('0x4')]();var fs_extra=require(_0x91c0('0x5'));var auth=require(_0x91c0('0x6'));var interaction=require(_0x91c0('0x7'));var config=require(_0x91c0('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x91c0('0x9')]('/',auth[_0x91c0('0xa')](),controller[_0x91c0('0xb')]);router[_0x91c0('0x9')](_0x91c0('0xc'),auth['isAuthenticated'](),controller[_0x91c0('0xd')]);router[_0x91c0('0x9')](_0x91c0('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x91c0('0xf')]('/',auth[_0x91c0('0xa')](),controller[_0x91c0('0x10')]);router['put']('/:id',auth[_0x91c0('0xa')](),controller[_0x91c0('0x11')]);router['delete'](_0x91c0('0xc'),auth[_0x91c0('0xa')](),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 091e787..9f027bd 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 _0xe212=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x46f700,_0x2b36d8){var _0x22f3ed=function(_0x113de9){while(--_0x113de9){_0x46f700['push'](_0x46f700['shift']());}};_0x22f3ed(++_0x2b36d8);}(_0xe212,0x178));var _0x2e21=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xe212[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require(_0x2e21('0x0'));module[_0x2e21('0x1')]={'field':{'type':Sequelize[_0x2e21('0x2')]},'alias':{'type':Sequelize[_0x2e21('0x3')]},'function':{'type':Sequelize[_0x2e21('0x3')]},'format':{'type':Sequelize[_0x2e21('0x3')]},'groupBy':{'type':Sequelize[_0x2e21('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2e21('0x3')]},'custom':{'type':Sequelize[_0x2e21('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf766=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x14feb2,_0x59bdae){var _0x4a7e1c=function(_0x45a51e){while(--_0x45a51e){_0x14feb2['push'](_0x14feb2['shift']());}};_0x4a7e1c(++_0x59bdae);}(_0xf766,0x1b0));var _0x6f76=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0xf766[_0xbbfe59];return _0x28a2a4;};'use strict';var Sequelize=require(_0x6f76('0x0'));module[_0x6f76('0x1')]={'field':{'type':Sequelize[_0x6f76('0x2')]},'alias':{'type':Sequelize[_0x6f76('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x6f76('0x3')]},'groupBy':{'type':Sequelize[_0x6f76('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 079369e..60fbb8a 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 _0xc7a3=['fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','AnalyticFieldReport','includeAll','include','findAll','catch','show','params','options','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','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','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes'];(function(_0x26c4e1,_0xc419c2){var _0xf8943d=function(_0xb1d621){while(--_0xb1d621){_0x26c4e1['push'](_0x26c4e1['shift']());}};_0xf8943d(++_0xc419c2);}(_0xc7a3,0xc4));var _0x3c7a=function(_0x351fe2,_0x1afed8){_0x351fe2=_0x351fe2-0x0;var _0x19d900=_0xc7a3[_0x351fe2];return _0x19d900;};'use strict';var emlformat=require(_0x3c7a('0x0'));var rimraf=require(_0x3c7a('0x1'));var zipdir=require(_0x3c7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c7a('0x3'));var Mustache=require(_0x3c7a('0x4'));var util=require(_0x3c7a('0x5'));var path=require(_0x3c7a('0x6'));var sox=require(_0x3c7a('0x7'));var csv=require('to-csv');var ejs=require(_0x3c7a('0x8'));var fs=require('fs');var fs_extra=require(_0x3c7a('0x9'));var _=require(_0x3c7a('0xa'));var squel=require('squel');var crypto=require(_0x3c7a('0xb'));var jsforce=require(_0x3c7a('0xc'));var deskjs=require(_0x3c7a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3c7a('0xe'));var Papa=require(_0x3c7a('0xf'));var Redis=require(_0x3c7a('0x10'));var authService=require(_0x3c7a('0x11'));var qs=require(_0x3c7a('0x12'));var as=require(_0x3c7a('0x13'));var hardwareService=require(_0x3c7a('0x14'));var logger=require(_0x3c7a('0x15'))(_0x3c7a('0x16'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x17'));var licenseUtil=require(_0x3c7a('0x18'));var db=require(_0x3c7a('0x19'))['db'];function respondWithStatusCode(_0xefa929,_0x1c825a){_0x1c825a=_0x1c825a||0xcc;return function(_0x33442e){if(_0x33442e){return _0xefa929['sendStatus'](_0x1c825a);}return _0xefa929[_0x3c7a('0x1a')](_0x1c825a)[_0x3c7a('0x1b')]();};}function respondWithResult(_0x18e2b4,_0x3192a5){_0x3192a5=_0x3192a5||0xc8;return function(_0x45ca40){if(_0x45ca40){return _0x18e2b4['status'](_0x3192a5)['json'](_0x45ca40);}};}function respondWithFilteredResult(_0x32dfe2,_0x360309){return function(_0x1ee8b2){if(_0x1ee8b2){var _0xf20236=typeof _0x360309[_0x3c7a('0x1c')]===_0x3c7a('0x1d')&&typeof _0x360309[_0x3c7a('0x1e')]===_0x3c7a('0x1d');var _0x1074c4=_0x1ee8b2['count'];var _0x3d1e94=_0xf20236?0x0:_0x360309[_0x3c7a('0x1c')];var _0x3554bb=_0xf20236?_0x1ee8b2[_0x3c7a('0x1f')]:_0x360309[_0x3c7a('0x1c')]+_0x360309['limit'];var _0x58b9a2;if(_0x3554bb>=_0x1074c4){_0x3554bb=_0x1074c4;_0x58b9a2=0xc8;}else{_0x58b9a2=0xce;}_0x32dfe2[_0x3c7a('0x1a')](_0x58b9a2);return _0x32dfe2[_0x3c7a('0x20')](_0x3c7a('0x21'),_0x3d1e94+'-'+_0x3554bb+'/'+_0x1074c4)[_0x3c7a('0x22')](_0x1ee8b2);}return null;};}function patchUpdates(_0x5c5a65){return function(_0x3c6ec6){try{jsonpatch[_0x3c7a('0x23')](_0x3c6ec6,_0x5c5a65,!![]);}catch(_0x451973){return BPromise[_0x3c7a('0x24')](_0x451973);}return _0x3c6ec6['save']();};}function saveUpdates(_0x107613,_0x3c840f){return function(_0x370d6c){if(_0x370d6c){return _0x370d6c[_0x3c7a('0x25')](_0x107613)[_0x3c7a('0x26')](function(_0x348c17){return _0x348c17;});}return null;};}function removeEntity(_0x2a834b,_0x4b0bf3){return function(_0x2af400){if(_0x2af400){return _0x2af400[_0x3c7a('0x27')]()['then'](function(){_0x2a834b[_0x3c7a('0x1a')](0xcc)[_0x3c7a('0x1b')]();});}};}function handleEntityNotFound(_0x635433,_0x7de046){return function(_0x470ab6){if(!_0x470ab6){_0x635433[_0x3c7a('0x28')](0x194);}return _0x470ab6;};}function handleError(_0x54347e,_0x4d9123){_0x4d9123=_0x4d9123||0x1f4;return function(_0x58a073){logger[_0x3c7a('0x29')](_0x58a073[_0x3c7a('0x2a')]);if(_0x58a073['name']){delete _0x58a073['name'];}_0x54347e[_0x3c7a('0x1a')](_0x4d9123)[_0x3c7a('0x2b')](_0x58a073);};}exports[_0x3c7a('0x2c')]=function(_0x4fca70,_0x96161e){var _0x28d01f={},_0x49ef68={},_0x494d03={'count':0x0,'rows':[]};var _0x4be5a4=_[_0x3c7a('0x2d')](db['AnalyticFieldReport'][_0x3c7a('0x2e')],function(_0x287bc6){return{'name':_0x287bc6['fieldName'],'type':_0x287bc6[_0x3c7a('0x2f')][_0x3c7a('0x30')]};});_0x49ef68[_0x3c7a('0x31')]=_[_0x3c7a('0x2d')](_0x4be5a4,_0x3c7a('0x32'));_0x49ef68[_0x3c7a('0x33')]=_[_0x3c7a('0x34')](_0x4fca70[_0x3c7a('0x33')]);_0x49ef68[_0x3c7a('0x35')]=_[_0x3c7a('0x36')](_0x49ef68[_0x3c7a('0x31')],_0x49ef68['query']);_0x28d01f[_0x3c7a('0x37')]=_[_0x3c7a('0x36')](_0x49ef68[_0x3c7a('0x31')],qs['fields'](_0x4fca70[_0x3c7a('0x33')][_0x3c7a('0x38')]));_0x28d01f[_0x3c7a('0x37')]=_0x28d01f['attributes'][_0x3c7a('0x39')]?_0x28d01f[_0x3c7a('0x37')]:_0x49ef68['model'];if(!_0x4fca70[_0x3c7a('0x33')][_0x3c7a('0x3a')](_0x3c7a('0x3b'))){_0x28d01f[_0x3c7a('0x1e')]=qs[_0x3c7a('0x1e')](_0x4fca70[_0x3c7a('0x33')]['limit']);_0x28d01f[_0x3c7a('0x1c')]=qs[_0x3c7a('0x1c')](_0x4fca70[_0x3c7a('0x33')]['offset']);}_0x28d01f[_0x3c7a('0x3c')]=qs[_0x3c7a('0x3d')](_0x4fca70[_0x3c7a('0x33')][_0x3c7a('0x3d')]);_0x28d01f[_0x3c7a('0x3e')]=qs['filters'](_['pick'](_0x4fca70[_0x3c7a('0x33')],_0x49ef68['filters']),_0x4be5a4);if(_0x4fca70[_0x3c7a('0x33')]['filter']){_0x28d01f['where']=_[_0x3c7a('0x3f')](_0x28d01f[_0x3c7a('0x3e')],{'$or':_['map'](_0x4be5a4,function(_0x400b30){if(_0x400b30[_0x3c7a('0x2f')]!==_0x3c7a('0x40')){var _0x350abd={};_0x350abd[_0x400b30[_0x3c7a('0x32')]]={'$like':'%'+_0x4fca70[_0x3c7a('0x33')]['filter']+'%'};return _0x350abd;}})});}_0x28d01f=_[_0x3c7a('0x3f')]({},_0x28d01f,_0x4fca70['options']);var _0x455872={'where':_0x28d01f[_0x3c7a('0x3e')]};return db[_0x3c7a('0x41')][_0x3c7a('0x1f')](_0x455872)[_0x3c7a('0x26')](function(_0x256302){_0x494d03['count']=_0x256302;if(_0x4fca70[_0x3c7a('0x33')][_0x3c7a('0x42')]){_0x28d01f[_0x3c7a('0x43')]=[{'all':!![]}];}return db[_0x3c7a('0x41')][_0x3c7a('0x44')](_0x28d01f);})[_0x3c7a('0x26')](function(_0x35259c){_0x494d03['rows']=_0x35259c;return _0x494d03;})[_0x3c7a('0x26')](respondWithFilteredResult(_0x96161e,_0x28d01f))[_0x3c7a('0x45')](handleError(_0x96161e,null));};exports[_0x3c7a('0x46')]=function(_0x3fda40,_0x24af9d){var _0x39eb90={'raw':![],'where':{'id':_0x3fda40[_0x3c7a('0x47')]['id']}},_0x585841={};_0x585841['model']=_['keys'](db['AnalyticFieldReport'][_0x3c7a('0x2e')]);_0x585841[_0x3c7a('0x33')]=_['keys'](_0x3fda40[_0x3c7a('0x33')]);_0x585841[_0x3c7a('0x35')]=_['intersection'](_0x585841[_0x3c7a('0x31')],_0x585841[_0x3c7a('0x33')]);_0x39eb90['attributes']=_['intersection'](_0x585841[_0x3c7a('0x31')],qs['fields'](_0x3fda40[_0x3c7a('0x33')]['fields']));_0x39eb90[_0x3c7a('0x37')]=_0x39eb90['attributes'][_0x3c7a('0x39')]?_0x39eb90['attributes']:_0x585841[_0x3c7a('0x31')];if(_0x3fda40[_0x3c7a('0x33')][_0x3c7a('0x42')]){_0x39eb90[_0x3c7a('0x43')]=[{'all':!![]}];}_0x39eb90=_[_0x3c7a('0x3f')]({},_0x39eb90,_0x3fda40[_0x3c7a('0x48')]);return db[_0x3c7a('0x41')][_0x3c7a('0x49')](_0x39eb90)[_0x3c7a('0x26')](handleEntityNotFound(_0x24af9d,null))[_0x3c7a('0x26')](respondWithResult(_0x24af9d,null))[_0x3c7a('0x45')](handleError(_0x24af9d,null));};exports[_0x3c7a('0x4a')]=function(_0xb16c31,_0x3899cf){return db[_0x3c7a('0x41')][_0x3c7a('0x4a')](_0xb16c31['body'],{})[_0x3c7a('0x26')](respondWithResult(_0x3899cf,0xc9))['catch'](handleError(_0x3899cf,null));};exports[_0x3c7a('0x4b')]=function(_0x207d1e,_0x2df36d){return db[_0x3c7a('0x41')][_0x3c7a('0x4b')](_0x207d1e['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2df36d,0xc9))[_0x3c7a('0x45')](handleError(_0x2df36d,null));};exports[_0x3c7a('0x25')]=function(_0x4ad13f,_0x43fcf1){if(_0x4ad13f[_0x3c7a('0x4c')]['id']){delete _0x4ad13f['body']['id'];}return db['AnalyticFieldReport'][_0x3c7a('0x49')]({'where':{'id':_0x4ad13f[_0x3c7a('0x47')]['id']}})[_0x3c7a('0x26')](handleEntityNotFound(_0x43fcf1,null))[_0x3c7a('0x26')](saveUpdates(_0x4ad13f[_0x3c7a('0x4c')],null))[_0x3c7a('0x26')](respondWithResult(_0x43fcf1,null))[_0x3c7a('0x45')](handleError(_0x43fcf1,null));};exports['destroy']=function(_0x37d603,_0x7a50b5){return db[_0x3c7a('0x41')][_0x3c7a('0x49')]({'where':{'id':_0x37d603[_0x3c7a('0x47')]['id']}})[_0x3c7a('0x26')](handleEntityNotFound(_0x7a50b5,null))['then'](removeEntity(_0x7a50b5,null))[_0x3c7a('0x45')](handleError(_0x7a50b5,null));};exports[_0x3c7a('0x4d')]=function(_0x475bec,_0x4881df){return db[_0x3c7a('0x41')][_0x3c7a('0x27')]({'where':{'id':_0x475bec['query'][_0x3c7a('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4881df,0xcc))[_0x3c7a('0x45')](handleError(_0x4881df,null));};exports[_0x3c7a('0x4f')]=function(_0x97381b,_0x367edc,_0x14d421){return db[_0x3c7a('0x50')][_0x3c7a('0x51')]({'where':{'id':_0x97381b[_0x3c7a('0x47')]['id']}})['then'](handleEntityNotFound(_0x367edc,null))[_0x3c7a('0x26')](function(_0x53f19f){if(_0x53f19f){return db[_0x3c7a('0x52')]['transaction'](function(_0x3592db){return db['AnalyticFieldReport'][_0x3c7a('0x27')]({'where':{'CustomReportId':_0x97381b[_0x3c7a('0x47')]['id']},'transaction':_0x3592db})[_0x3c7a('0x26')](function(_0x3108e3){var _0x1a19f7=_[_0x3c7a('0x2d')](_0x97381b[_0x3c7a('0x4c')],function(_0x5d89fe){delete _0x5d89fe['id'];_0x5d89fe[_0x3c7a('0x53')]=_0x97381b['params']['id'];return _0x5d89fe;});return db[_0x3c7a('0x41')][_0x3c7a('0x4b')](_0x1a19f7,{'transaction':_0x3592db});});})[_0x3c7a('0x26')](function(){return db[_0x3c7a('0x41')][_0x3c7a('0x44')]({'where':{'CustomReportId':_0x97381b['params']['id']}});});}})['then'](respondWithResult(_0x367edc,null))[_0x3c7a('0x45')](handleError(_0x367edc,null));};
\ No newline at end of file
+var _0xb92a=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','AnalyticFieldReport','include','findAll','rows','show','rawAttributes','includeAll','options','find','catch','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','fieldName','type','key','map','query'];(function(_0x187839,_0x2fe76b){var _0x2cdebd=function(_0x28de5e){while(--_0x28de5e){_0x187839['push'](_0x187839['shift']());}};_0x2cdebd(++_0x2fe76b);}(_0xb92a,0x76));var _0xab92=function(_0x50ac6d,_0x1c15b){_0x50ac6d=_0x50ac6d-0x0;var _0x1c39a2=_0xb92a[_0x50ac6d];return _0x1c39a2;};'use strict';var emlformat=require(_0xab92('0x0'));var rimraf=require(_0xab92('0x1'));var zipdir=require(_0xab92('0x2'));var jsonpatch=require(_0xab92('0x3'));var rp=require('request-promise');var moment=require(_0xab92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xab92('0x5'));var util=require(_0xab92('0x6'));var path=require(_0xab92('0x7'));var sox=require('sox');var csv=require(_0xab92('0x8'));var ejs=require(_0xab92('0x9'));var fs=require('fs');var fs_extra=require(_0xab92('0xa'));var _=require('lodash');var squel=require(_0xab92('0xb'));var crypto=require(_0xab92('0xc'));var jsforce=require(_0xab92('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab92('0xe'));var Papa=require('papaparse');var Redis=require(_0xab92('0xf'));var authService=require(_0xab92('0x10'));var qs=require(_0xab92('0x11'));var as=require(_0xab92('0x12'));var hardwareService=require(_0xab92('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xab92('0x14'));var config=require(_0xab92('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xab92('0x16'))['db'];function respondWithStatusCode(_0x1fc5aa,_0x1cb1d3){_0x1cb1d3=_0x1cb1d3||0xcc;return function(_0x25fffa){if(_0x25fffa){return _0x1fc5aa[_0xab92('0x17')](_0x1cb1d3);}return _0x1fc5aa[_0xab92('0x18')](_0x1cb1d3)[_0xab92('0x19')]();};}function respondWithResult(_0x5b8743,_0x1d8e17){_0x1d8e17=_0x1d8e17||0xc8;return function(_0x245f42){if(_0x245f42){return _0x5b8743[_0xab92('0x18')](_0x1d8e17)['json'](_0x245f42);}};}function respondWithFilteredResult(_0x4fc4a4,_0x477acf){return function(_0x33c095){if(_0x33c095){var _0x15654f=typeof _0x477acf[_0xab92('0x1a')]===_0xab92('0x1b')&&typeof _0x477acf[_0xab92('0x1c')]===_0xab92('0x1b');var _0x202fa7=_0x33c095['count'];var _0x4cdec9=_0x15654f?0x0:_0x477acf['offset'];var _0x2ae7c8=_0x15654f?_0x33c095[_0xab92('0x1d')]:_0x477acf['offset']+_0x477acf[_0xab92('0x1c')];var _0xe6a211;if(_0x2ae7c8>=_0x202fa7){_0x2ae7c8=_0x202fa7;_0xe6a211=0xc8;}else{_0xe6a211=0xce;}_0x4fc4a4[_0xab92('0x18')](_0xe6a211);return _0x4fc4a4[_0xab92('0x1e')](_0xab92('0x1f'),_0x4cdec9+'-'+_0x2ae7c8+'/'+_0x202fa7)['json'](_0x33c095);}return null;};}function patchUpdates(_0x156d68){return function(_0x2e6872){try{jsonpatch[_0xab92('0x20')](_0x2e6872,_0x156d68,!![]);}catch(_0x58bb41){return BPromise[_0xab92('0x21')](_0x58bb41);}return _0x2e6872[_0xab92('0x22')]();};}function saveUpdates(_0x3a2d4e,_0x25f6cb){return function(_0x3a287d){if(_0x3a287d){return _0x3a287d['update'](_0x3a2d4e)['then'](function(_0x8cc438){return _0x8cc438;});}return null;};}function removeEntity(_0x51731e,_0x114f0c){return function(_0x666a55){if(_0x666a55){return _0x666a55[_0xab92('0x23')]()[_0xab92('0x24')](function(){_0x51731e['status'](0xcc)[_0xab92('0x19')]();});}};}function handleEntityNotFound(_0x1f4326,_0x36c5f8){return function(_0x48a662){if(!_0x48a662){_0x1f4326[_0xab92('0x17')](0x194);}return _0x48a662;};}function handleError(_0x3bfd66,_0x45e871){_0x45e871=_0x45e871||0x1f4;return function(_0xb386e4){logger['error'](_0xb386e4[_0xab92('0x25')]);if(_0xb386e4[_0xab92('0x26')]){delete _0xb386e4[_0xab92('0x26')];}_0x3bfd66[_0xab92('0x18')](_0x45e871)[_0xab92('0x27')](_0xb386e4);};}exports[_0xab92('0x28')]=function(_0x21b0ca,_0x2fc461){var _0x537038={},_0x29f060={},_0x2217cb={'count':0x0,'rows':[]};var _0x46b2c5=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x3fb0b7){return{'name':_0x3fb0b7[_0xab92('0x29')],'type':_0x3fb0b7[_0xab92('0x2a')][_0xab92('0x2b')]};});_0x29f060['model']=_[_0xab92('0x2c')](_0x46b2c5,_0xab92('0x26'));_0x29f060[_0xab92('0x2d')]=_[_0xab92('0x2e')](_0x21b0ca['query']);_0x29f060[_0xab92('0x2f')]=_[_0xab92('0x30')](_0x29f060[_0xab92('0x31')],_0x29f060[_0xab92('0x2d')]);_0x537038[_0xab92('0x32')]=_[_0xab92('0x30')](_0x29f060[_0xab92('0x31')],qs[_0xab92('0x33')](_0x21b0ca[_0xab92('0x2d')][_0xab92('0x33')]));_0x537038['attributes']=_0x537038[_0xab92('0x32')][_0xab92('0x34')]?_0x537038['attributes']:_0x29f060[_0xab92('0x31')];if(!_0x21b0ca[_0xab92('0x2d')][_0xab92('0x35')](_0xab92('0x36'))){_0x537038[_0xab92('0x1c')]=qs[_0xab92('0x1c')](_0x21b0ca['query'][_0xab92('0x1c')]);_0x537038[_0xab92('0x1a')]=qs['offset'](_0x21b0ca[_0xab92('0x2d')][_0xab92('0x1a')]);}_0x537038['order']=qs[_0xab92('0x37')](_0x21b0ca[_0xab92('0x2d')][_0xab92('0x37')]);_0x537038[_0xab92('0x38')]=qs[_0xab92('0x2f')](_[_0xab92('0x39')](_0x21b0ca['query'],_0x29f060[_0xab92('0x2f')]),_0x46b2c5);if(_0x21b0ca[_0xab92('0x2d')][_0xab92('0x3a')]){_0x537038['where']=_[_0xab92('0x3b')](_0x537038[_0xab92('0x38')],{'$or':_[_0xab92('0x2c')](_0x46b2c5,function(_0x3b2d19){if(_0x3b2d19[_0xab92('0x2a')]!==_0xab92('0x3c')){var _0x397288={};_0x397288[_0x3b2d19[_0xab92('0x26')]]={'$like':'%'+_0x21b0ca[_0xab92('0x2d')][_0xab92('0x3a')]+'%'};return _0x397288;}})});}_0x537038=_[_0xab92('0x3b')]({},_0x537038,_0x21b0ca['options']);var _0x3dc8c7={'where':_0x537038[_0xab92('0x38')]};return db[_0xab92('0x3d')][_0xab92('0x1d')](_0x3dc8c7)[_0xab92('0x24')](function(_0x544410){_0x2217cb['count']=_0x544410;if(_0x21b0ca[_0xab92('0x2d')]['includeAll']){_0x537038[_0xab92('0x3e')]=[{'all':!![]}];}return db[_0xab92('0x3d')][_0xab92('0x3f')](_0x537038);})[_0xab92('0x24')](function(_0x5cfbd6){_0x2217cb[_0xab92('0x40')]=_0x5cfbd6;return _0x2217cb;})[_0xab92('0x24')](respondWithFilteredResult(_0x2fc461,_0x537038))['catch'](handleError(_0x2fc461,null));};exports[_0xab92('0x41')]=function(_0x2f2a4d,_0x190012){var _0x238dfc={'raw':![],'where':{'id':_0x2f2a4d['params']['id']}},_0x2ee560={};_0x2ee560[_0xab92('0x31')]=_['keys'](db[_0xab92('0x3d')][_0xab92('0x42')]);_0x2ee560[_0xab92('0x2d')]=_['keys'](_0x2f2a4d[_0xab92('0x2d')]);_0x2ee560[_0xab92('0x2f')]=_[_0xab92('0x30')](_0x2ee560[_0xab92('0x31')],_0x2ee560[_0xab92('0x2d')]);_0x238dfc[_0xab92('0x32')]=_[_0xab92('0x30')](_0x2ee560[_0xab92('0x31')],qs[_0xab92('0x33')](_0x2f2a4d[_0xab92('0x2d')][_0xab92('0x33')]));_0x238dfc['attributes']=_0x238dfc[_0xab92('0x32')]['length']?_0x238dfc[_0xab92('0x32')]:_0x2ee560[_0xab92('0x31')];if(_0x2f2a4d['query'][_0xab92('0x43')]){_0x238dfc[_0xab92('0x3e')]=[{'all':!![]}];}_0x238dfc=_['merge']({},_0x238dfc,_0x2f2a4d[_0xab92('0x44')]);return db[_0xab92('0x3d')][_0xab92('0x45')](_0x238dfc)[_0xab92('0x24')](handleEntityNotFound(_0x190012,null))[_0xab92('0x24')](respondWithResult(_0x190012,null))[_0xab92('0x46')](handleError(_0x190012,null));};exports['create']=function(_0x121d24,_0x4d3c41){return db['AnalyticFieldReport'][_0xab92('0x47')](_0x121d24[_0xab92('0x48')],{})[_0xab92('0x24')](respondWithResult(_0x4d3c41,0xc9))['catch'](handleError(_0x4d3c41,null));};exports['bulkCreate']=function(_0x324f6b,_0xf1f1f9){return db[_0xab92('0x3d')][_0xab92('0x49')](_0x324f6b[_0xab92('0x48')],{'raw':![],'individualHooks':!![]})[_0xab92('0x24')](respondWithResult(_0xf1f1f9,0xc9))[_0xab92('0x46')](handleError(_0xf1f1f9,null));};exports[_0xab92('0x4a')]=function(_0x40258b,_0x40e84d){if(_0x40258b[_0xab92('0x48')]['id']){delete _0x40258b[_0xab92('0x48')]['id'];}return db['AnalyticFieldReport'][_0xab92('0x45')]({'where':{'id':_0x40258b[_0xab92('0x4b')]['id']}})[_0xab92('0x24')](handleEntityNotFound(_0x40e84d,null))[_0xab92('0x24')](saveUpdates(_0x40258b['body'],null))[_0xab92('0x24')](respondWithResult(_0x40e84d,null))[_0xab92('0x46')](handleError(_0x40e84d,null));};exports[_0xab92('0x23')]=function(_0x3ee5bd,_0x475c99){return db[_0xab92('0x3d')][_0xab92('0x45')]({'where':{'id':_0x3ee5bd[_0xab92('0x4b')]['id']}})['then'](handleEntityNotFound(_0x475c99,null))[_0xab92('0x24')](removeEntity(_0x475c99,null))[_0xab92('0x46')](handleError(_0x475c99,null));};exports[_0xab92('0x4c')]=function(_0x14956a,_0x558265){return db[_0xab92('0x3d')][_0xab92('0x23')]({'where':{'id':_0x14956a[_0xab92('0x2d')][_0xab92('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xab92('0x24')](respondWithResult(_0x558265,0xcc))[_0xab92('0x46')](handleError(_0x558265,null));};exports[_0xab92('0x4e')]=function(_0xf0fd98,_0x45ad47,_0x4af58b){return db[_0xab92('0x4f')]['findOne']({'where':{'id':_0xf0fd98[_0xab92('0x4b')]['id']}})[_0xab92('0x24')](handleEntityNotFound(_0x45ad47,null))[_0xab92('0x24')](function(_0x43dfaf){if(_0x43dfaf){return db[_0xab92('0x50')]['transaction'](function(_0x3b6d46){return db[_0xab92('0x3d')][_0xab92('0x23')]({'where':{'CustomReportId':_0xf0fd98[_0xab92('0x4b')]['id']},'transaction':_0x3b6d46})['then'](function(_0x3af75c){var _0x3c5ea0=_[_0xab92('0x2c')](_0xf0fd98[_0xab92('0x48')],function(_0x3e818c){delete _0x3e818c['id'];_0x3e818c[_0xab92('0x51')]=_0xf0fd98[_0xab92('0x4b')]['id'];return _0x3e818c;});return db[_0xab92('0x3d')][_0xab92('0x49')](_0x3c5ea0,{'transaction':_0x3b6d46});});})['then'](function(){return db[_0xab92('0x3d')][_0xab92('0x3f')]({'where':{'CustomReportId':_0xf0fd98['params']['id']}});});}})['then'](respondWithResult(_0x45ad47,null))[_0xab92('0x46')](handleError(_0x45ad47,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 98ba3aa..e359645 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 _0x1179=['rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x1179,0x89));var _0x9117=function(_0x5190e3,_0x5aa3f6){_0x5190e3=_0x5190e3-0x0;var _0x12d24c=_0x1179[_0x5190e3];return _0x12d24c;};'use strict';var _=require('lodash');var util=require(_0x9117('0x0'));var logger=require(_0x9117('0x1'))(_0x9117('0x2'));var moment=require(_0x9117('0x3'));var BPromise=require(_0x9117('0x4'));var rp=require(_0x9117('0x5'));var fs=require('fs');var path=require(_0x9117('0x6'));var rimraf=require(_0x9117('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x9117('0x8')]=function(_0x1bb4f9,_0x3f62ab){return _0x1bb4f9[_0x9117('0x9')](_0x9117('0xa'),attributes,{'tableName':_0x9117('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cc0=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x450b91,_0x2589a9){var _0x42a2d0=function(_0x41b9a4){while(--_0x41b9a4){_0x450b91['push'](_0x450b91['shift']());}};_0x42a2d0(++_0x2589a9);}(_0x1cc0,0x15f));var _0x01cc=function(_0x14e892,_0x3a9e8a){_0x14e892=_0x14e892-0x0;var _0x3593b4=_0x1cc0[_0x14e892];return _0x3593b4;};'use strict';var _=require(_0x01cc('0x0'));var util=require(_0x01cc('0x1'));var logger=require(_0x01cc('0x2'))(_0x01cc('0x3'));var moment=require(_0x01cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x01cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01cc('0x6'));var attributes=require(_0x01cc('0x7'));module[_0x01cc('0x8')]=function(_0xc9f9c0,_0x134466){return _0xc9f9c0[_0x01cc('0x9')](_0x01cc('0xa'),attributes,{'tableName':_0x01cc('0xb'),'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 5afbce2..641fd67 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 _0x41d9=['client','http','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x41d9,0x85));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var moment=require(_0x941d('0x2'));var BPromise=require(_0x941d('0x3'));var rs=require(_0x941d('0x4'));var fs=require('fs');var Redis=require(_0x941d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x941d('0x6'));var logger=require(_0x941d('0x7'))(_0x941d('0x8'));var config=require(_0x941d('0x9'));var jayson=require(_0x941d('0xa'));var client=jayson[_0x941d('0xb')][_0x941d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c844e,_0xcf6226,_0x287bf0){return new BPromise(function(_0x5a5fdc,_0xf114d1){return client[_0x941d('0xd')](_0x1c844e,_0x287bf0)[_0x941d('0xe')](function(_0x501aa1){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xcf6226,_0x941d('0xf'));logger[_0x941d('0x10')](_0x941d('0x11'),_0xcf6226,_0x941d('0xf'),JSON[_0x941d('0x12')](_0x501aa1));if(_0x501aa1[_0x941d('0x13')]){if(_0x501aa1[_0x941d('0x13')]['code']===0x1f4){logger['error'](_0x941d('0x14'),_0xcf6226,_0x501aa1[_0x941d('0x13')]['message']);return _0xf114d1(_0x501aa1[_0x941d('0x13')][_0x941d('0x15')]);}logger[_0x941d('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0xcf6226,_0x501aa1['error'][_0x941d('0x15')]);return _0x5a5fdc(_0x501aa1[_0x941d('0x13')][_0x941d('0x15')]);}else{logger[_0x941d('0x16')](_0x941d('0x14'),_0xcf6226,_0x941d('0xf'));_0x5a5fdc(_0x501aa1['result'][_0x941d('0x15')]);}})[_0x941d('0x17')](function(_0x171415){logger[_0x941d('0x13')](_0x941d('0x14'),_0xcf6226,_0x171415);_0xf114d1(_0x171415);});});}
\ No newline at end of file
+var _0x2077=['code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x287ab7,_0x5f2d08){var _0x13c959=function(_0x44a45c){while(--_0x44a45c){_0x287ab7['push'](_0x287ab7['shift']());}};_0x13c959(++_0x5f2d08);}(_0x2077,0x180));var _0x7207=function(_0x93aa47,_0xaeb5f9){_0x93aa47=_0x93aa47-0x0;var _0x26d122=_0x2077[_0x93aa47];return _0x26d122;};'use strict';var _=require(_0x7207('0x0'));var util=require(_0x7207('0x1'));var moment=require(_0x7207('0x2'));var BPromise=require(_0x7207('0x3'));var rs=require(_0x7207('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7207('0x5'));var jayson=require(_0x7207('0x6'));var client=jayson[_0x7207('0x7')][_0x7207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a0d08,_0x5de24,_0x6ef448){return new BPromise(function(_0x358ce8,_0x4cb3d5){return client[_0x7207('0x9')](_0x4a0d08,_0x6ef448)[_0x7207('0xa')](function(_0x1d1615){logger['info'](_0x7207('0xb'),_0x5de24,'request\x20sent');logger[_0x7207('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5de24,_0x7207('0xd'),JSON[_0x7207('0xe')](_0x1d1615));if(_0x1d1615[_0x7207('0xf')]){if(_0x1d1615[_0x7207('0xf')][_0x7207('0x10')]===0x1f4){logger[_0x7207('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5de24,_0x1d1615[_0x7207('0xf')][_0x7207('0x11')]);return _0x4cb3d5(_0x1d1615[_0x7207('0xf')][_0x7207('0x11')]);}logger[_0x7207('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5de24,_0x1d1615[_0x7207('0xf')][_0x7207('0x11')]);return _0x358ce8(_0x1d1615['error'][_0x7207('0x11')]);}else{logger[_0x7207('0x12')](_0x7207('0xb'),_0x5de24,_0x7207('0xd'));_0x358ce8(_0x1d1615[_0x7207('0x13')]['message']);}})['catch'](function(_0x5a39ec){logger[_0x7207('0xf')](_0x7207('0xb'),_0x5de24,_0x5a39ec);_0x4cb3d5(_0x5a39ec);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4de0794..bc8e460 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(_0x58da2e,_0x2534bc){var _0x8f64a4=function(_0x1507b9){while(--_0x1507b9){_0x58da2e['push'](_0x58da2e['shift']());}};_0x8f64a4(++_0x2534bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x5bbabd,_0x987538){var _0x103712=function(_0x35b6){while(--_0x35b6){_0x5bbabd['push'](_0x5bbabd['shift']());}};_0x103712(++_0x987538);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 f8f38e0..5b63997 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 _0x115a=['name','sequelize','exports','STRING'];(function(_0x2d2fd5,_0x22aa04){var _0x5cf67e=function(_0xc76975){while(--_0xc76975){_0x2d2fd5['push'](_0x2d2fd5['shift']());}};_0x5cf67e(++_0x22aa04);}(_0x115a,0x91));var _0xa115=function(_0x35e471,_0x3a9b8c){_0x35e471=_0x35e471-0x0;var _0x173c2c=_0x115a[_0x35e471];return _0x173c2c;};'use strict';var Sequelize=require(_0xa115('0x0'));module[_0xa115('0x1')]={'name':{'type':Sequelize[_0xa115('0x2')],'allowNull':![],'unique':_0xa115('0x3')},'table':{'type':Sequelize[_0xa115('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xa115('0x2')]}};
\ No newline at end of file
+var _0x7b37=['STRING','sequelize','exports','name'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x7b37,0xd9));var _0x77b3=function(_0x4250b4,_0x3fd543){_0x4250b4=_0x4250b4-0x0;var _0x8a4807=_0x7b37[_0x4250b4];return _0x8a4807;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x77b3('0x2')},'table':{'type':Sequelize[_0x77b3('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 616bb0c..62dc01a 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','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','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x450f77,_0x527146){var _0x366bc1=function(_0x1f2a68){while(--_0x1f2a68){_0x450f77['push'](_0x450f77['shift']());}};_0x366bc1(++_0x527146);}(_0x425d,0x1e0));var _0xd425=function(_0x236ce3,_0xb8d03f){_0x236ce3=_0x236ce3-0x0;var _0x4a3f88=_0x425d[_0x236ce3];return _0x4a3f88;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x250a85,_0x49f110){var _0x216492=function(_0x5866c6){while(--_0x5866c6){_0x250a85['push'](_0x250a85['shift']());}};_0x216492(++_0x49f110);}(_0x00bb,0x1d8));var _0xb00b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x00bb[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e80af64..c2f0728 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 _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','analytics_metrics','lodash'];(function(_0x2629e5,_0x43a306){var _0x2e38c9=function(_0x4abd93){while(--_0x4abd93){_0x2629e5['push'](_0x2629e5['shift']());}};_0x2e38c9(++_0x43a306);}(_0x7da7,0x10d));var _0x77da=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0x7da7[_0x2c5340];return _0x3c505e;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('AnalyticMetric',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5bd7=['analytics_metrics','util','../../config/logger','api','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xf9b115,_0x499f75){var _0x2f3525=function(_0x6cec4a){while(--_0x6cec4a){_0xf9b115['push'](_0xf9b115['shift']());}};_0x2f3525(++_0x499f75);}(_0x5bd7,0x12a));var _0x75bd=function(_0x134019,_0x3a1963){_0x134019=_0x134019-0x0;var _0x1807e7=_0x5bd7[_0x134019];return _0x1807e7;};'use strict';var _=require('lodash');var util=require(_0x75bd('0x0'));var logger=require(_0x75bd('0x1'))(_0x75bd('0x2'));var moment=require('moment');var BPromise=require(_0x75bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75bd('0x4'));var rimraf=require(_0x75bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x75bd('0x6'));module[_0x75bd('0x7')]=function(_0x2aaa6a,_0x47c9c7){return _0x2aaa6a[_0x75bd('0x8')](_0x75bd('0x9'),attributes,{'tableName':_0x75bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index e42949e..7fce14d 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 _0x6de2=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfbae8f,_0x1784a3){var _0x1348d3=function(_0x31d673){while(--_0x31d673){_0xfbae8f['push'](_0xfbae8f['shift']());}};_0x1348d3(++_0x1784a3);}(_0x6de2,0x154));var _0x26de=function(_0x4646f6,_0x5983d8){_0x4646f6=_0x4646f6-0x0;var _0x44c181=_0x6de2[_0x4646f6];return _0x44c181;};'use strict';var _=require(_0x26de('0x0'));var util=require(_0x26de('0x1'));var moment=require(_0x26de('0x2'));var BPromise=require('bluebird');var rs=require(_0x26de('0x3'));var fs=require('fs');var Redis=require(_0x26de('0x4'));var db=require(_0x26de('0x5'))['db'];var utils=require(_0x26de('0x6'));var logger=require(_0x26de('0x7'))(_0x26de('0x8'));var config=require('../../config/environment');var jayson=require(_0x26de('0x9'));var client=jayson['client'][_0x26de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d75cd,_0x2356ae,_0x2b99fb){return new BPromise(function(_0x1c788c,_0x404384){return client['request'](_0x1d75cd,_0x2b99fb)['then'](function(_0x308f64){logger[_0x26de('0xb')](_0x26de('0xc'),_0x2356ae,_0x26de('0xd'));logger[_0x26de('0xe')](_0x26de('0xf'),_0x2356ae,_0x26de('0xd'),JSON[_0x26de('0x10')](_0x308f64));if(_0x308f64[_0x26de('0x11')]){if(_0x308f64['error']['code']===0x1f4){logger[_0x26de('0x11')](_0x26de('0xc'),_0x2356ae,_0x308f64[_0x26de('0x11')][_0x26de('0x12')]);return _0x404384(_0x308f64[_0x26de('0x11')][_0x26de('0x12')]);}logger[_0x26de('0x11')](_0x26de('0xc'),_0x2356ae,_0x308f64['error'][_0x26de('0x12')]);return _0x1c788c(_0x308f64[_0x26de('0x11')]['message']);}else{logger[_0x26de('0xb')](_0x26de('0xc'),_0x2356ae,_0x26de('0xd'));_0x1c788c(_0x308f64[_0x26de('0x13')][_0x26de('0x12')]);}})[_0x26de('0x14')](function(_0x4e8787){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x2356ae,_0x4e8787);_0x404384(_0x4e8787);});});}
\ No newline at end of file
+var _0x33b3=['AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x555164,_0x13e97c){var _0x541861=function(_0x55d3c3){while(--_0x55d3c3){_0x555164['push'](_0x555164['shift']());}};_0x541861(++_0x13e97c);}(_0x33b3,0x154));var _0x333b=function(_0x5388e4,_0x5eb0ad){_0x5388e4=_0x5388e4-0x0;var _0x208b64=_0x33b3[_0x5388e4];return _0x208b64;};'use strict';var _=require(_0x333b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x333b('0x1'));var rs=require(_0x333b('0x2'));var fs=require('fs');var Redis=require(_0x333b('0x3'));var db=require(_0x333b('0x4'))['db'];var utils=require(_0x333b('0x5'));var logger=require(_0x333b('0x6'))(_0x333b('0x7'));var config=require(_0x333b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x333b('0x9')][_0x333b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438890,_0x435a4b,_0x29efdb){return new BPromise(function(_0x48373b,_0x4c38c6){return client[_0x333b('0xb')](_0x438890,_0x29efdb)[_0x333b('0xc')](function(_0x3ff2e7){logger[_0x333b('0xd')](_0x333b('0xe'),_0x435a4b,_0x333b('0xf'));logger[_0x333b('0x10')](_0x333b('0x11'),_0x435a4b,_0x333b('0xf'),JSON['stringify'](_0x3ff2e7));if(_0x3ff2e7[_0x333b('0x12')]){if(_0x3ff2e7[_0x333b('0x12')][_0x333b('0x13')]===0x1f4){logger[_0x333b('0x12')](_0x333b('0xe'),_0x435a4b,_0x3ff2e7['error'][_0x333b('0x14')]);return _0x4c38c6(_0x3ff2e7[_0x333b('0x12')]['message']);}logger['error'](_0x333b('0xe'),_0x435a4b,_0x3ff2e7[_0x333b('0x12')][_0x333b('0x14')]);return _0x48373b(_0x3ff2e7['error'][_0x333b('0x14')]);}else{logger['info'](_0x333b('0xe'),_0x435a4b,_0x333b('0xf'));_0x48373b(_0x3ff2e7['result'][_0x333b('0x14')]);}})['catch'](function(_0x3af1ea){logger[_0x333b('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x435a4b,_0x3af1ea);_0x4c38c6(_0x3af1ea);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 905b8cd..cfe2c6b 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 _0x49fe=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x49fe,0x100));var _0xe49f=function(_0xbc245,_0xedee3){_0xbc245=_0xbc245-0x0;var _0x371e80=_0x49fe[_0xbc245];return _0x371e80;};'use strict';var multer=require(_0xe49f('0x0'));var util=require(_0xe49f('0x1'));var path=require(_0xe49f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe49f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe49f('0x4'));var interaction=require(_0xe49f('0x5'));var config=require(_0xe49f('0x6'));var controller=require(_0xe49f('0x7'));router['get']('/',auth[_0xe49f('0x8')](),controller[_0xe49f('0x9')]);router[_0xe49f('0xa')](_0xe49f('0xb'),auth['isAuthenticated'](),controller[_0xe49f('0xc')]);router[_0xe49f('0xd')]('/',auth[_0xe49f('0x8')](),controller[_0xe49f('0xe')]);router[_0xe49f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe49f('0x10')]);router[_0xe49f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe49f('0x12')]);module[_0xe49f('0x13')]=router;
\ No newline at end of file
+var _0xfa45=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x111283,_0x58ddcb){var _0x1e5f06=function(_0x2b30a4){while(--_0x2b30a4){_0x111283['push'](_0x111283['shift']());}};_0x1e5f06(++_0x58ddcb);}(_0xfa45,0x11b));var _0x5fa4=function(_0x2ff24c,_0x92e17f){_0x2ff24c=_0x2ff24c-0x0;var _0x373ecd=_0xfa45[_0x2ff24c];return _0x373ecd;};'use strict';var multer=require(_0x5fa4('0x0'));var util=require(_0x5fa4('0x1'));var path=require(_0x5fa4('0x2'));var timeout=require(_0x5fa4('0x3'));var express=require(_0x5fa4('0x4'));var router=express[_0x5fa4('0x5')]();var fs_extra=require(_0x5fa4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5fa4('0x7'));var config=require('../../config/environment');var controller=require(_0x5fa4('0x8'));router[_0x5fa4('0x9')]('/',auth[_0x5fa4('0xa')](),controller[_0x5fa4('0xb')]);router[_0x5fa4('0x9')](_0x5fa4('0xc'),auth[_0x5fa4('0xa')](),controller[_0x5fa4('0xd')]);router[_0x5fa4('0xe')]('/',auth[_0x5fa4('0xa')](),controller['create']);router[_0x5fa4('0xf')]('/:id',auth[_0x5fa4('0xa')](),controller[_0x5fa4('0x10')]);router[_0x5fa4('0x11')](_0x5fa4('0xc'),auth[_0x5fa4('0xa')](),controller[_0x5fa4('0x12')]);module[_0x5fa4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a86bbc4..a112de7 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 _0x510c=['sequelize','exports','TEXT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x510c,0x117));var _0xc510=function(_0x50f83e,_0x55b44e){_0x50f83e=_0x50f83e-0x0;var _0x5b22a9=_0x510c[_0x50f83e];return _0x5b22a9;};'use strict';var Sequelize=require(_0xc510('0x0'));module[_0xc510('0x1')]={'tree':{'type':Sequelize[_0xc510('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xed55=['exports','TEXT','sequelize'];(function(_0x3e2e1c,_0x182117){var _0x4c9c90=function(_0x54221c){while(--_0x54221c){_0x3e2e1c['push'](_0x3e2e1c['shift']());}};_0x4c9c90(++_0x182117);}(_0xed55,0x161));var _0x5ed5=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xed55[_0x3cb152];return _0x4f54c3;};'use strict';var Sequelize=require(_0x5ed5('0x0'));module[_0x5ed5('0x1')]={'tree':{'type':Sequelize[_0x5ed5('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 8752867..66de523 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 _0x644e=['index','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','AnalyticTreeReport','find','create','body','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x247992,_0x54ee9b){var _0x2cc17e=function(_0x5afe6b){while(--_0x5afe6b){_0x247992['push'](_0x247992['shift']());}};_0x2cc17e(++_0x54ee9b);}(_0x644e,0x109));var _0xe644=function(_0x2f3974,_0x3a6102){_0x2f3974=_0x2f3974-0x0;var _0x15edb7=_0x644e[_0x2f3974];return _0x15edb7;};'use strict';var emlformat=require(_0xe644('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe644('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe644('0x2'));var moment=require('moment');var BPromise=require(_0xe644('0x3'));var Mustache=require(_0xe644('0x4'));var util=require(_0xe644('0x5'));var path=require(_0xe644('0x6'));var sox=require(_0xe644('0x7'));var csv=require(_0xe644('0x8'));var ejs=require(_0xe644('0x9'));var fs=require('fs');var fs_extra=require(_0xe644('0xa'));var _=require(_0xe644('0xb'));var squel=require(_0xe644('0xc'));var crypto=require(_0xe644('0xd'));var jsforce=require(_0xe644('0xe'));var deskjs=require(_0xe644('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe644('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe644('0x11'));var hardwareService=require(_0xe644('0x12'));var logger=require(_0xe644('0x13'))(_0xe644('0x14'));var utils=require('../../config/utils');var config=require(_0xe644('0x15'));var licenseUtil=require(_0xe644('0x16'));var db=require(_0xe644('0x17'))['db'];function respondWithStatusCode(_0x18811c,_0x1cecf8){_0x1cecf8=_0x1cecf8||0xcc;return function(_0x3b3564){if(_0x3b3564){return _0x18811c[_0xe644('0x18')](_0x1cecf8);}return _0x18811c['status'](_0x1cecf8)[_0xe644('0x19')]();};}function respondWithResult(_0x568e23,_0xf23b29){_0xf23b29=_0xf23b29||0xc8;return function(_0x4dfb53){if(_0x4dfb53){return _0x568e23[_0xe644('0x1a')](_0xf23b29)['json'](_0x4dfb53);}};}function respondWithFilteredResult(_0x42e406,_0x5a7ab3){return function(_0x253aab){if(_0x253aab){var _0x557e80=typeof _0x5a7ab3[_0xe644('0x1b')]===_0xe644('0x1c')&&typeof _0x5a7ab3[_0xe644('0x1d')]===_0xe644('0x1c');var _0x4e3409=_0x253aab['count'];var _0x147059=_0x557e80?0x0:_0x5a7ab3['offset'];var _0x2ddc2b=_0x557e80?_0x253aab[_0xe644('0x1e')]:_0x5a7ab3[_0xe644('0x1b')]+_0x5a7ab3[_0xe644('0x1d')];var _0x29dd4b;if(_0x2ddc2b>=_0x4e3409){_0x2ddc2b=_0x4e3409;_0x29dd4b=0xc8;}else{_0x29dd4b=0xce;}_0x42e406[_0xe644('0x1a')](_0x29dd4b);return _0x42e406[_0xe644('0x1f')](_0xe644('0x20'),_0x147059+'-'+_0x2ddc2b+'/'+_0x4e3409)[_0xe644('0x21')](_0x253aab);}return null;};}function patchUpdates(_0x435474){return function(_0x10b6f6){try{jsonpatch[_0xe644('0x22')](_0x10b6f6,_0x435474,!![]);}catch(_0x4db352){return BPromise[_0xe644('0x23')](_0x4db352);}return _0x10b6f6[_0xe644('0x24')]();};}function saveUpdates(_0x3a138c,_0x17af34){return function(_0x37c28e){if(_0x37c28e){return _0x37c28e['update'](_0x3a138c)[_0xe644('0x25')](function(_0x4556b6){return _0x4556b6;});}return null;};}function removeEntity(_0x1ff48b,_0x5574dd){return function(_0x5d7124){if(_0x5d7124){return _0x5d7124[_0xe644('0x26')]()[_0xe644('0x25')](function(){_0x1ff48b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18427f,_0xc58464){return function(_0x2e6f16){if(!_0x2e6f16){_0x18427f[_0xe644('0x18')](0x194);}return _0x2e6f16;};}function handleError(_0x2a22af,_0x456e8a){_0x456e8a=_0x456e8a||0x1f4;return function(_0x3e745c){logger[_0xe644('0x27')](_0x3e745c[_0xe644('0x28')]);if(_0x3e745c[_0xe644('0x29')]){delete _0x3e745c[_0xe644('0x29')];}_0x2a22af[_0xe644('0x1a')](_0x456e8a)[_0xe644('0x2a')](_0x3e745c);};}exports[_0xe644('0x2b')]=function(_0x5ebeab,_0x110d3e){var _0x5ccd9f={},_0x4f358e={},_0x14f7d4={'count':0x0,'rows':[]};var _0x4b6ba6=_['map'](db['AnalyticTreeReport'][_0xe644('0x2c')],function(_0x10f81d){return{'name':_0x10f81d[_0xe644('0x2d')],'type':_0x10f81d[_0xe644('0x2e')][_0xe644('0x2f')]};});_0x4f358e['model']=_[_0xe644('0x30')](_0x4b6ba6,_0xe644('0x29'));_0x4f358e['query']=_['keys'](_0x5ebeab[_0xe644('0x31')]);_0x4f358e[_0xe644('0x32')]=_[_0xe644('0x33')](_0x4f358e['model'],_0x4f358e['query']);_0x5ccd9f[_0xe644('0x34')]=_[_0xe644('0x33')](_0x4f358e[_0xe644('0x35')],qs[_0xe644('0x36')](_0x5ebeab[_0xe644('0x31')][_0xe644('0x36')]));_0x5ccd9f['attributes']=_0x5ccd9f[_0xe644('0x34')][_0xe644('0x37')]?_0x5ccd9f[_0xe644('0x34')]:_0x4f358e[_0xe644('0x35')];if(!_0x5ebeab[_0xe644('0x31')][_0xe644('0x38')](_0xe644('0x39'))){_0x5ccd9f[_0xe644('0x1d')]=qs[_0xe644('0x1d')](_0x5ebeab['query'][_0xe644('0x1d')]);_0x5ccd9f[_0xe644('0x1b')]=qs[_0xe644('0x1b')](_0x5ebeab[_0xe644('0x31')][_0xe644('0x1b')]);}_0x5ccd9f[_0xe644('0x3a')]=qs[_0xe644('0x3b')](_0x5ebeab[_0xe644('0x31')]['sort']);_0x5ccd9f[_0xe644('0x3c')]=qs[_0xe644('0x32')](_[_0xe644('0x3d')](_0x5ebeab[_0xe644('0x31')],_0x4f358e[_0xe644('0x32')]),_0x4b6ba6);if(_0x5ebeab['query'][_0xe644('0x3e')]){_0x5ccd9f[_0xe644('0x3c')]=_[_0xe644('0x3f')](_0x5ccd9f['where'],{'$or':_[_0xe644('0x30')](_0x4b6ba6,function(_0x88d90e){if(_0x88d90e[_0xe644('0x2e')]!=='VIRTUAL'){var _0xa90d79={};_0xa90d79[_0x88d90e[_0xe644('0x29')]]={'$like':'%'+_0x5ebeab[_0xe644('0x31')][_0xe644('0x3e')]+'%'};return _0xa90d79;}})});}_0x5ccd9f=_[_0xe644('0x3f')]({},_0x5ccd9f,_0x5ebeab[_0xe644('0x40')]);var _0x26e71b={'where':_0x5ccd9f[_0xe644('0x3c')]};return db['AnalyticTreeReport'][_0xe644('0x1e')](_0x26e71b)[_0xe644('0x25')](function(_0x289423){_0x14f7d4['count']=_0x289423;if(_0x5ebeab[_0xe644('0x31')]['includeAll']){_0x5ccd9f[_0xe644('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xe644('0x42')](_0x5ccd9f);})[_0xe644('0x25')](function(_0x1c2755){_0x14f7d4[_0xe644('0x43')]=_0x1c2755;return _0x14f7d4;})[_0xe644('0x25')](respondWithFilteredResult(_0x110d3e,_0x5ccd9f))[_0xe644('0x44')](handleError(_0x110d3e,null));};exports[_0xe644('0x45')]=function(_0x1fe074,_0xd8a350){var _0x9ae7fb={'raw':!![],'where':{'id':_0x1fe074[_0xe644('0x46')]['id']}},_0x48f124={};_0x48f124[_0xe644('0x35')]=_['keys'](db['AnalyticTreeReport'][_0xe644('0x2c')]);_0x48f124[_0xe644('0x31')]=_[_0xe644('0x47')](_0x1fe074[_0xe644('0x31')]);_0x48f124[_0xe644('0x32')]=_[_0xe644('0x33')](_0x48f124[_0xe644('0x35')],_0x48f124[_0xe644('0x31')]);_0x9ae7fb['attributes']=_[_0xe644('0x33')](_0x48f124[_0xe644('0x35')],qs['fields'](_0x1fe074['query']['fields']));_0x9ae7fb['attributes']=_0x9ae7fb[_0xe644('0x34')]['length']?_0x9ae7fb[_0xe644('0x34')]:_0x48f124['model'];if(_0x1fe074[_0xe644('0x31')][_0xe644('0x48')]){_0x9ae7fb[_0xe644('0x41')]=[{'all':!![]}];}_0x9ae7fb=_[_0xe644('0x3f')]({},_0x9ae7fb,_0x1fe074[_0xe644('0x40')]);return db[_0xe644('0x49')][_0xe644('0x4a')](_0x9ae7fb)['then'](handleEntityNotFound(_0xd8a350,null))['then'](respondWithResult(_0xd8a350,null))[_0xe644('0x44')](handleError(_0xd8a350,null));};exports['create']=function(_0x4410f2,_0x1d5206){return db[_0xe644('0x49')][_0xe644('0x4b')](_0x4410f2['body'],{})[_0xe644('0x25')](respondWithResult(_0x1d5206,0xc9))['catch'](handleError(_0x1d5206,null));};exports['update']=function(_0x5e3f98,_0x1bf52c){if(_0x5e3f98['body']['id']){delete _0x5e3f98[_0xe644('0x4c')]['id'];}return db['AnalyticTreeReport'][_0xe644('0x4a')]({'where':{'id':_0x5e3f98[_0xe644('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bf52c,null))[_0xe644('0x25')](saveUpdates(_0x5e3f98['body'],null))[_0xe644('0x25')](respondWithResult(_0x1bf52c,null))[_0xe644('0x44')](handleError(_0x1bf52c,null));};exports[_0xe644('0x26')]=function(_0x2a5946,_0x33b54b){return db[_0xe644('0x49')][_0xe644('0x4a')]({'where':{'id':_0x2a5946['params']['id']}})[_0xe644('0x25')](handleEntityNotFound(_0x33b54b,null))[_0xe644('0x25')](removeEntity(_0x33b54b,null))[_0xe644('0x44')](handleError(_0x33b54b,null));};
\ No newline at end of file
+var _0x71f6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x39dd10,_0x134622){var _0x35bd8a=function(_0x156710){while(--_0x156710){_0x39dd10['push'](_0x39dd10['shift']());}};_0x35bd8a(++_0x134622);}(_0x71f6,0x1c9));var _0x671f=function(_0xfb09e6,_0x4f3696){_0xfb09e6=_0xfb09e6-0x0;var _0x3fe899=_0x71f6[_0xfb09e6];return _0x3fe899;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x671f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x671f('0x1'));var rp=require(_0x671f('0x2'));var moment=require(_0x671f('0x3'));var BPromise=require(_0x671f('0x4'));var Mustache=require('mustache');var util=require(_0x671f('0x5'));var path=require(_0x671f('0x6'));var sox=require(_0x671f('0x7'));var csv=require(_0x671f('0x8'));var ejs=require(_0x671f('0x9'));var fs=require('fs');var fs_extra=require(_0x671f('0xa'));var _=require(_0x671f('0xb'));var squel=require(_0x671f('0xc'));var crypto=require(_0x671f('0xd'));var jsforce=require(_0x671f('0xe'));var deskjs=require(_0x671f('0xf'));var toCsv=require(_0x671f('0x8'));var querystring=require(_0x671f('0x10'));var Papa=require(_0x671f('0x11'));var Redis=require('ioredis');var authService=require(_0x671f('0x12'));var qs=require(_0x671f('0x13'));var as=require(_0x671f('0x14'));var hardwareService=require(_0x671f('0x15'));var logger=require(_0x671f('0x16'))(_0x671f('0x17'));var utils=require('../../config/utils');var config=require(_0x671f('0x18'));var licenseUtil=require(_0x671f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55fab9,_0x2cda75){_0x2cda75=_0x2cda75||0xcc;return function(_0x26e290){if(_0x26e290){return _0x55fab9[_0x671f('0x1a')](_0x2cda75);}return _0x55fab9[_0x671f('0x1b')](_0x2cda75)['end']();};}function respondWithResult(_0x3819a2,_0x84fd65){_0x84fd65=_0x84fd65||0xc8;return function(_0x12237c){if(_0x12237c){return _0x3819a2[_0x671f('0x1b')](_0x84fd65)['json'](_0x12237c);}};}function respondWithFilteredResult(_0x3f281b,_0x27792b){return function(_0x257bc6){if(_0x257bc6){var _0x5dd12b=typeof _0x27792b[_0x671f('0x1c')]===_0x671f('0x1d')&&typeof _0x27792b[_0x671f('0x1e')]===_0x671f('0x1d');var _0x4d4840=_0x257bc6[_0x671f('0x1f')];var _0x82caa3=_0x5dd12b?0x0:_0x27792b[_0x671f('0x1c')];var _0x3263ee=_0x5dd12b?_0x257bc6[_0x671f('0x1f')]:_0x27792b['offset']+_0x27792b[_0x671f('0x1e')];var _0x5d5c74;if(_0x3263ee>=_0x4d4840){_0x3263ee=_0x4d4840;_0x5d5c74=0xc8;}else{_0x5d5c74=0xce;}_0x3f281b['status'](_0x5d5c74);return _0x3f281b[_0x671f('0x20')](_0x671f('0x21'),_0x82caa3+'-'+_0x3263ee+'/'+_0x4d4840)[_0x671f('0x22')](_0x257bc6);}return null;};}function patchUpdates(_0x2054e5){return function(_0x4b1d6d){try{jsonpatch['apply'](_0x4b1d6d,_0x2054e5,!![]);}catch(_0x3a0e83){return BPromise[_0x671f('0x23')](_0x3a0e83);}return _0x4b1d6d[_0x671f('0x24')]();};}function saveUpdates(_0x11b3fe,_0x7e276d){return function(_0x2b5850){if(_0x2b5850){return _0x2b5850[_0x671f('0x25')](_0x11b3fe)['then'](function(_0x2892e4){return _0x2892e4;});}return null;};}function removeEntity(_0x25fa98,_0x40be48){return function(_0x4a0c48){if(_0x4a0c48){return _0x4a0c48[_0x671f('0x26')]()[_0x671f('0x27')](function(){_0x25fa98[_0x671f('0x1b')](0xcc)[_0x671f('0x28')]();});}};}function handleEntityNotFound(_0x9d968f,_0x4f0130){return function(_0x15960b){if(!_0x15960b){_0x9d968f[_0x671f('0x1a')](0x194);}return _0x15960b;};}function handleError(_0xdc83dc,_0x5d7a8d){_0x5d7a8d=_0x5d7a8d||0x1f4;return function(_0x2a41ba){logger[_0x671f('0x29')](_0x2a41ba[_0x671f('0x2a')]);if(_0x2a41ba[_0x671f('0x2b')]){delete _0x2a41ba[_0x671f('0x2b')];}_0xdc83dc['status'](_0x5d7a8d)[_0x671f('0x2c')](_0x2a41ba);};}exports[_0x671f('0x2d')]=function(_0x15d1cf,_0x113bbb){var _0x9d21a6={},_0x13110c={},_0x5e9b63={'count':0x0,'rows':[]};var _0x19158e=_[_0x671f('0x2e')](db[_0x671f('0x2f')][_0x671f('0x30')],function(_0x397e70){return{'name':_0x397e70[_0x671f('0x31')],'type':_0x397e70[_0x671f('0x32')]['key']};});_0x13110c[_0x671f('0x33')]=_[_0x671f('0x2e')](_0x19158e,'name');_0x13110c[_0x671f('0x34')]=_[_0x671f('0x35')](_0x15d1cf['query']);_0x13110c[_0x671f('0x36')]=_[_0x671f('0x37')](_0x13110c[_0x671f('0x33')],_0x13110c[_0x671f('0x34')]);_0x9d21a6[_0x671f('0x38')]=_[_0x671f('0x37')](_0x13110c[_0x671f('0x33')],qs[_0x671f('0x39')](_0x15d1cf['query']['fields']));_0x9d21a6[_0x671f('0x38')]=_0x9d21a6[_0x671f('0x38')][_0x671f('0x3a')]?_0x9d21a6[_0x671f('0x38')]:_0x13110c[_0x671f('0x33')];if(!_0x15d1cf[_0x671f('0x34')][_0x671f('0x3b')](_0x671f('0x3c'))){_0x9d21a6['limit']=qs[_0x671f('0x1e')](_0x15d1cf[_0x671f('0x34')][_0x671f('0x1e')]);_0x9d21a6[_0x671f('0x1c')]=qs[_0x671f('0x1c')](_0x15d1cf[_0x671f('0x34')][_0x671f('0x1c')]);}_0x9d21a6[_0x671f('0x3d')]=qs[_0x671f('0x3e')](_0x15d1cf['query'][_0x671f('0x3e')]);_0x9d21a6[_0x671f('0x3f')]=qs[_0x671f('0x36')](_[_0x671f('0x40')](_0x15d1cf[_0x671f('0x34')],_0x13110c[_0x671f('0x36')]),_0x19158e);if(_0x15d1cf[_0x671f('0x34')][_0x671f('0x41')]){_0x9d21a6['where']=_['merge'](_0x9d21a6[_0x671f('0x3f')],{'$or':_['map'](_0x19158e,function(_0x30e5e8){if(_0x30e5e8[_0x671f('0x32')]!==_0x671f('0x42')){var _0x3e3a54={};_0x3e3a54[_0x30e5e8[_0x671f('0x2b')]]={'$like':'%'+_0x15d1cf['query'][_0x671f('0x41')]+'%'};return _0x3e3a54;}})});}_0x9d21a6=_[_0x671f('0x43')]({},_0x9d21a6,_0x15d1cf[_0x671f('0x44')]);var _0x1ae61e={'where':_0x9d21a6[_0x671f('0x3f')]};return db[_0x671f('0x2f')][_0x671f('0x1f')](_0x1ae61e)['then'](function(_0x224c78){_0x5e9b63[_0x671f('0x1f')]=_0x224c78;if(_0x15d1cf['query'][_0x671f('0x45')]){_0x9d21a6[_0x671f('0x46')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x671f('0x47')](_0x9d21a6);})['then'](function(_0x2f8c8b){_0x5e9b63[_0x671f('0x48')]=_0x2f8c8b;return _0x5e9b63;})[_0x671f('0x27')](respondWithFilteredResult(_0x113bbb,_0x9d21a6))[_0x671f('0x49')](handleError(_0x113bbb,null));};exports['show']=function(_0x1676b4,_0x1e9c27){var _0x287332={'raw':!![],'where':{'id':_0x1676b4['params']['id']}},_0x501aa5={};_0x501aa5[_0x671f('0x33')]=_['keys'](db[_0x671f('0x2f')]['rawAttributes']);_0x501aa5[_0x671f('0x34')]=_['keys'](_0x1676b4[_0x671f('0x34')]);_0x501aa5[_0x671f('0x36')]=_[_0x671f('0x37')](_0x501aa5[_0x671f('0x33')],_0x501aa5[_0x671f('0x34')]);_0x287332[_0x671f('0x38')]=_[_0x671f('0x37')](_0x501aa5[_0x671f('0x33')],qs[_0x671f('0x39')](_0x1676b4[_0x671f('0x34')][_0x671f('0x39')]));_0x287332[_0x671f('0x38')]=_0x287332[_0x671f('0x38')]['length']?_0x287332[_0x671f('0x38')]:_0x501aa5[_0x671f('0x33')];if(_0x1676b4[_0x671f('0x34')][_0x671f('0x45')]){_0x287332['include']=[{'all':!![]}];}_0x287332=_[_0x671f('0x43')]({},_0x287332,_0x1676b4[_0x671f('0x44')]);return db[_0x671f('0x2f')][_0x671f('0x4a')](_0x287332)[_0x671f('0x27')](handleEntityNotFound(_0x1e9c27,null))[_0x671f('0x27')](respondWithResult(_0x1e9c27,null))[_0x671f('0x49')](handleError(_0x1e9c27,null));};exports['create']=function(_0x465db5,_0x55c0fb){return db[_0x671f('0x2f')][_0x671f('0x4b')](_0x465db5[_0x671f('0x4c')],{})[_0x671f('0x27')](respondWithResult(_0x55c0fb,0xc9))[_0x671f('0x49')](handleError(_0x55c0fb,null));};exports['update']=function(_0x4925d5,_0x5e718a){if(_0x4925d5['body']['id']){delete _0x4925d5[_0x671f('0x4c')]['id'];}return db[_0x671f('0x2f')][_0x671f('0x4a')]({'where':{'id':_0x4925d5[_0x671f('0x4d')]['id']}})[_0x671f('0x27')](handleEntityNotFound(_0x5e718a,null))['then'](saveUpdates(_0x4925d5[_0x671f('0x4c')],null))[_0x671f('0x27')](respondWithResult(_0x5e718a,null))['catch'](handleError(_0x5e718a,null));};exports[_0x671f('0x26')]=function(_0x5eb327,_0x31f3ef){return db[_0x671f('0x2f')][_0x671f('0x4a')]({'where':{'id':_0x5eb327[_0x671f('0x4d')]['id']}})[_0x671f('0x27')](handleEntityNotFound(_0x31f3ef,null))[_0x671f('0x27')](removeEntity(_0x31f3ef,null))[_0x671f('0x49')](handleError(_0x31f3ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 014fee9..4ad8786 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 _0xa3dc=['../../config/environment','define','analytics_report_trees','lodash','util','api','moment','request-promise','path'];(function(_0x115b95,_0xa1f8b9){var _0x460b3d=function(_0x510c02){while(--_0x510c02){_0x115b95['push'](_0x115b95['shift']());}};_0x460b3d(++_0xa1f8b9);}(_0xa3dc,0x1c5));var _0xca3d=function(_0xf76ac7,_0x2cc42f){_0xf76ac7=_0xf76ac7-0x0;var _0x479a15=_0xa3dc[_0xf76ac7];return _0x479a15;};'use strict';var _=require(_0xca3d('0x0'));var util=require(_0xca3d('0x1'));var logger=require('../../config/logger')(_0xca3d('0x2'));var moment=require(_0xca3d('0x3'));var BPromise=require('bluebird');var rp=require(_0xca3d('0x4'));var fs=require('fs');var path=require(_0xca3d('0x5'));var rimraf=require('rimraf');var config=require(_0xca3d('0x6'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x417da2,_0x4438e8){return _0x417da2[_0xca3d('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0xca3d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84a6=['../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','../../config/logger','api','moment','path'];(function(_0x173488,_0x4b1b33){var _0x994dac=function(_0x53dfce){while(--_0x53dfce){_0x173488['push'](_0x173488['shift']());}};_0x994dac(++_0x4b1b33);}(_0x84a6,0x1ac));var _0x684a=function(_0x264755,_0x44b561){_0x264755=_0x264755-0x0;var _0x38db02=_0x84a6[_0x264755];return _0x38db02;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x684a('0x0'))(_0x684a('0x1'));var moment=require(_0x684a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x684a('0x3'));var rimraf=require('rimraf');var config=require(_0x684a('0x4'));var attributes=require(_0x684a('0x5'));module[_0x684a('0x6')]=function(_0x57b592,_0x22981f){return _0x57b592['define']('AnalyticTreeReport',attributes,{'tableName':_0x684a('0x7'),'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 cb4ffa0..5fd46de 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4acd65,_0x193e16){var _0x1e7c1d=function(_0x49ee80){while(--_0x49ee80){_0x4acd65['push'](_0x4acd65['shift']());}};_0x1e7c1d(++_0x193e16);}(_0xadb5,0xad));var _0x5adb=function(_0x3b38b8,_0x1c0d37){_0x3b38b8=_0x3b38b8-0x0;var _0x237892=_0xadb5[_0x3b38b8];return _0x237892;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x59ddfe,_0x486a4a){var _0x230651=function(_0x578125){while(--_0x578125){_0x59ddfe['push'](_0x59ddfe['shift']());}};_0x230651(++_0x486a4a);}(_0x1261,0x144));var _0x1126=function(_0x55d7b0,_0x2a82dc){_0x55d7b0=_0x55d7b0-0x0;var _0x2a376c=_0x1261[_0x55d7b0];return _0x2a376c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 43c3d3d..9e787a0 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 _0x942a=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','create','update'];(function(_0x39e4ec,_0x22f473){var _0x17434f=function(_0x5dd15a){while(--_0x5dd15a){_0x39e4ec['push'](_0x39e4ec['shift']());}};_0x17434f(++_0x22f473);}(_0x942a,0x93));var _0xa942=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x942a[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require('multer');var util=require(_0xa942('0x0'));var path=require(_0xa942('0x1'));var timeout=require('connect-timeout');var express=require(_0xa942('0x2'));var router=express[_0xa942('0x3')]();var fs_extra=require(_0xa942('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa942('0x5'));var config=require(_0xa942('0x6'));var controller=require(_0xa942('0x7'));router[_0xa942('0x8')]('/',auth[_0xa942('0x9')](),controller['index']);router[_0xa942('0x8')](_0xa942('0xa'),auth[_0xa942('0x9')](),controller['show']);router['post']('/',auth[_0xa942('0x9')](),controller[_0xa942('0xb')]);router['put']('/:id',auth[_0xa942('0x9')](),controller[_0xa942('0xc')]);router[_0xa942('0xd')]('/:id',auth[_0xa942('0x9')](),controller[_0xa942('0xe')]);module[_0xa942('0xf')]=router;
\ No newline at end of file
+var _0x9ecd=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x47d707,_0x2a0a8d){var _0x5f1b64=function(_0x5718d9){while(--_0x5718d9){_0x47d707['push'](_0x47d707['shift']());}};_0x5f1b64(++_0x2a0a8d);}(_0x9ecd,0xe9));var _0xd9ec=function(_0x59f9ba,_0x52aed5){_0x59f9ba=_0x59f9ba-0x0;var _0x4909bc=_0x9ecd[_0x59f9ba];return _0x4909bc;};'use strict';var multer=require('multer');var util=require(_0xd9ec('0x0'));var path=require('path');var timeout=require(_0xd9ec('0x1'));var express=require(_0xd9ec('0x2'));var router=express[_0xd9ec('0x3')]();var fs_extra=require(_0xd9ec('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9ec('0x5'));var controller=require(_0xd9ec('0x6'));router[_0xd9ec('0x7')]('/',auth[_0xd9ec('0x8')](),controller['index']);router[_0xd9ec('0x7')](_0xd9ec('0x9'),auth['isAuthenticated'](),controller[_0xd9ec('0xa')]);router[_0xd9ec('0xb')]('/',auth[_0xd9ec('0x8')](),controller[_0xd9ec('0xc')]);router[_0xd9ec('0xd')](_0xd9ec('0x9'),auth[_0xd9ec('0x8')](),controller[_0xd9ec('0xe')]);router[_0xd9ec('0xf')]('/:id',auth[_0xd9ec('0x8')](),controller['destroy']);module[_0xd9ec('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 622662a..e411f2a 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 _0xb18e=['STRING'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xb18e,0x181));var _0xeb18=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0xb18e[_0x216428];return _0x313dd4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeb18('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xeb18('0x0')]}};
\ No newline at end of file
+var _0xb8ca=['exports','STRING','sequelize'];(function(_0x44686d,_0x5f0e88){var _0xb85e98=function(_0x2aa27d){while(--_0x2aa27d){_0x44686d['push'](_0x44686d['shift']());}};_0xb85e98(++_0x5f0e88);}(_0xb8ca,0x89));var _0xab8c=function(_0x37b3ee,_0x41d16d){_0x37b3ee=_0x37b3ee-0x0;var _0x40f96d=_0xb8ca[_0x37b3ee];return _0x40f96d;};'use strict';var Sequelize=require(_0xab8c('0x0'));module[_0xab8c('0x1')]={'name':{'type':Sequelize[_0xab8c('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xab8c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 9d1b06b..ec2ec30 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 _0xc5aa=['fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','Attachment','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','omit','createdAt','body','updatedAt','create','catch','file','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs'];(function(_0x2e7d4f,_0x49c0d3){var _0x40a232=function(_0x2f5d58){while(--_0x2f5d58){_0x2e7d4f['push'](_0x2e7d4f['shift']());}};_0x40a232(++_0x49c0d3);}(_0xc5aa,0x99));var _0xac5a=function(_0xa52048,_0x1a3dd6){_0xa52048=_0xa52048-0x0;var _0x19d95c=_0xc5aa[_0xa52048];return _0x19d95c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac5a('0x0'));var jsonpatch=require(_0xac5a('0x1'));var rp=require(_0xac5a('0x2'));var moment=require('moment');var BPromise=require(_0xac5a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac5a('0x4'));var sox=require('sox');var csv=require(_0xac5a('0x5'));var ejs=require(_0xac5a('0x6'));var fs=require('fs');var fs_extra=require(_0xac5a('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xac5a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xac5a('0x9'));var toCsv=require(_0xac5a('0x5'));var querystring=require(_0xac5a('0xa'));var Papa=require(_0xac5a('0xb'));var Redis=require(_0xac5a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xac5a('0xd'));var as=require(_0xac5a('0xe'));var hardwareService=require(_0xac5a('0xf'));var logger=require(_0xac5a('0x10'))(_0xac5a('0x11'));var utils=require('../../config/utils');var config=require(_0xac5a('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bb17b,_0x2e708a){_0x2e708a=_0x2e708a||0xcc;return function(_0x1545bb){if(_0x1545bb){return _0x5bb17b[_0xac5a('0x13')](_0x2e708a);}return _0x5bb17b[_0xac5a('0x14')](_0x2e708a)[_0xac5a('0x15')]();};}function respondWithResult(_0x30bd00,_0x4ec6ee){_0x4ec6ee=_0x4ec6ee||0xc8;return function(_0x2e2b44){if(_0x2e2b44){return _0x30bd00[_0xac5a('0x14')](_0x4ec6ee)['json'](_0x2e2b44);}};}function respondWithFilteredResult(_0x5bbc3d,_0xc44db0){return function(_0x58dd00){if(_0x58dd00){var _0x36f1b6=typeof _0xc44db0[_0xac5a('0x16')]===_0xac5a('0x17')&&typeof _0xc44db0[_0xac5a('0x18')]===_0xac5a('0x17');var _0x402bd2=_0x58dd00[_0xac5a('0x19')];var _0x34b6d0=_0x36f1b6?0x0:_0xc44db0['offset'];var _0x25cf12=_0x36f1b6?_0x58dd00['count']:_0xc44db0[_0xac5a('0x16')]+_0xc44db0[_0xac5a('0x18')];var _0x1df6f4;if(_0x25cf12>=_0x402bd2){_0x25cf12=_0x402bd2;_0x1df6f4=0xc8;}else{_0x1df6f4=0xce;}_0x5bbc3d[_0xac5a('0x14')](_0x1df6f4);return _0x5bbc3d[_0xac5a('0x1a')](_0xac5a('0x1b'),_0x34b6d0+'-'+_0x25cf12+'/'+_0x402bd2)[_0xac5a('0x1c')](_0x58dd00);}return null;};}function patchUpdates(_0xf47965){return function(_0x14dc7e){try{jsonpatch[_0xac5a('0x1d')](_0x14dc7e,_0xf47965,!![]);}catch(_0x32962f){return BPromise[_0xac5a('0x1e')](_0x32962f);}return _0x14dc7e['save']();};}function saveUpdates(_0x4a98b2,_0x18b7a3){return function(_0x1ae317){if(_0x1ae317){return _0x1ae317[_0xac5a('0x1f')](_0x4a98b2)[_0xac5a('0x20')](function(_0x2035ad){return _0x2035ad;});}return null;};}function removeEntity(_0x2f38f2,_0x450dda){return function(_0xcae38a){if(_0xcae38a){return _0xcae38a[_0xac5a('0x21')]()['then'](function(){_0x2f38f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20df06,_0x9dc886){return function(_0x1739aa){if(!_0x1739aa){_0x20df06[_0xac5a('0x13')](0x194);}return _0x1739aa;};}function handleError(_0x4dc9bf,_0x3554a8){_0x3554a8=_0x3554a8||0x1f4;return function(_0x4c77f4){logger['error'](_0x4c77f4[_0xac5a('0x22')]);if(_0x4c77f4['name']){delete _0x4c77f4[_0xac5a('0x23')];}_0x4dc9bf[_0xac5a('0x14')](_0x3554a8)[_0xac5a('0x24')](_0x4c77f4);};}exports['index']=function(_0x4e4792,_0x5a5470){var _0x45fda9={},_0x491415={},_0x2ee677={'count':0x0,'rows':[]};var _0x42075a=_['map'](db[_0xac5a('0x25')]['rawAttributes'],function(_0x11415d){return{'name':_0x11415d['fieldName'],'type':_0x11415d[_0xac5a('0x26')]['key']};});_0x491415[_0xac5a('0x27')]=_['map'](_0x42075a,_0xac5a('0x23'));_0x491415[_0xac5a('0x28')]=_[_0xac5a('0x29')](_0x4e4792['query']);_0x491415['filters']=_[_0xac5a('0x2a')](_0x491415[_0xac5a('0x27')],_0x491415[_0xac5a('0x28')]);_0x45fda9['attributes']=_[_0xac5a('0x2a')](_0x491415[_0xac5a('0x27')],qs[_0xac5a('0x2b')](_0x4e4792[_0xac5a('0x28')][_0xac5a('0x2b')]));_0x45fda9[_0xac5a('0x2c')]=_0x45fda9['attributes'][_0xac5a('0x2d')]?_0x45fda9[_0xac5a('0x2c')]:_0x491415[_0xac5a('0x27')];if(!_0x4e4792['query'][_0xac5a('0x2e')](_0xac5a('0x2f'))){_0x45fda9[_0xac5a('0x18')]=qs[_0xac5a('0x18')](_0x4e4792['query'][_0xac5a('0x18')]);_0x45fda9['offset']=qs[_0xac5a('0x16')](_0x4e4792[_0xac5a('0x28')][_0xac5a('0x16')]);}_0x45fda9[_0xac5a('0x30')]=qs[_0xac5a('0x31')](_0x4e4792['query'][_0xac5a('0x31')]);_0x45fda9[_0xac5a('0x32')]=qs[_0xac5a('0x33')](_[_0xac5a('0x34')](_0x4e4792['query'],_0x491415[_0xac5a('0x33')]),_0x42075a);if(_0x4e4792[_0xac5a('0x28')][_0xac5a('0x35')]){_0x45fda9[_0xac5a('0x32')]=_['merge'](_0x45fda9['where'],{'$or':_[_0xac5a('0x36')](_0x42075a,function(_0x493427){if(_0x493427[_0xac5a('0x26')]!==_0xac5a('0x37')){var _0x3ec8c9={};_0x3ec8c9[_0x493427['name']]={'$like':'%'+_0x4e4792[_0xac5a('0x28')]['filter']+'%'};return _0x3ec8c9;}})});}_0x45fda9=_[_0xac5a('0x38')]({},_0x45fda9,_0x4e4792[_0xac5a('0x39')]);var _0x16107d={'where':_0x45fda9['where']};return db[_0xac5a('0x25')][_0xac5a('0x19')](_0x16107d)[_0xac5a('0x20')](function(_0x4ab9f3){_0x2ee677[_0xac5a('0x19')]=_0x4ab9f3;if(_0x4e4792[_0xac5a('0x28')][_0xac5a('0x3a')]){_0x45fda9[_0xac5a('0x3b')]=[{'all':!![]}];}return db['Attachment'][_0xac5a('0x3c')](_0x45fda9);})[_0xac5a('0x20')](function(_0xa9e08b){_0x2ee677['rows']=_0xa9e08b;return _0x2ee677;})['then'](respondWithFilteredResult(_0x5a5470,_0x45fda9))['catch'](handleError(_0x5a5470,null));};exports[_0xac5a('0x3d')]=function(_0x3e78c7,_0x50c079){var _0x31e333={'raw':!![],'where':{'id':_0x3e78c7[_0xac5a('0x3e')]['id']}},_0x4f32bf={};_0x4f32bf['model']=_[_0xac5a('0x29')](db['Attachment']['rawAttributes']);_0x4f32bf[_0xac5a('0x28')]=_[_0xac5a('0x29')](_0x3e78c7[_0xac5a('0x28')]);_0x4f32bf['filters']=_[_0xac5a('0x2a')](_0x4f32bf[_0xac5a('0x27')],_0x4f32bf[_0xac5a('0x28')]);_0x31e333[_0xac5a('0x2c')]=_[_0xac5a('0x2a')](_0x4f32bf[_0xac5a('0x27')],qs[_0xac5a('0x2b')](_0x3e78c7[_0xac5a('0x28')][_0xac5a('0x2b')]));_0x31e333[_0xac5a('0x2c')]=_0x31e333['attributes'][_0xac5a('0x2d')]?_0x31e333[_0xac5a('0x2c')]:_0x4f32bf[_0xac5a('0x27')];if(_0x3e78c7['query'][_0xac5a('0x3a')]){_0x31e333[_0xac5a('0x3b')]=[{'all':!![]}];}_0x31e333=_[_0xac5a('0x38')]({},_0x31e333,_0x3e78c7['options']);return db[_0xac5a('0x25')][_0xac5a('0x3f')](_0x31e333)[_0xac5a('0x20')](handleEntityNotFound(_0x50c079,null))['then'](respondWithResult(_0x50c079,null))['catch'](handleError(_0x50c079,null));};exports['clone']=function(_0x70b4cc,_0x18524){var _0x318228={'where':{'id':_0x70b4cc['params']['id']}},_0x4c8399={};_0x4c8399[_0xac5a('0x27')]=_[_0xac5a('0x29')](db[_0xac5a('0x25')]['rawAttributes']);_0x318228['attributes']=_['intersection'](_0x4c8399[_0xac5a('0x27')],qs[_0xac5a('0x2b')](_0x70b4cc[_0xac5a('0x28')][_0xac5a('0x2b')]));_0x318228[_0xac5a('0x2c')]=_0x318228['attributes'][_0xac5a('0x2d')]?_0x318228['attributes']:_0x4c8399[_0xac5a('0x27')];if(_0x70b4cc[_0xac5a('0x28')][_0xac5a('0x3a')]){_0x318228[_0xac5a('0x3b')]=[{'all':!![]}];}_0x318228=_[_0xac5a('0x38')]({},_0x318228,_0x70b4cc['options']);return db[_0xac5a('0x25')][_0xac5a('0x3f')](_0x318228)[_0xac5a('0x20')](handleEntityNotFound(_0x18524,null))['then'](function(_0x15ae01){if(_0x15ae01){var _0x9b0e30=_0x15ae01['get']({'plain':!![]});_0x9b0e30=qs[_0xac5a('0x40')](_0x9b0e30,['id',_0xac5a('0x41'),'updatedAt']);_0x70b4cc[_0xac5a('0x42')]=_[_0xac5a('0x40')](_0x70b4cc[_0xac5a('0x42')],['id','createdAt',_0xac5a('0x43')]);return db[_0xac5a('0x25')][_0xac5a('0x44')](_['merge'](_0x9b0e30,_0x70b4cc[_0xac5a('0x42')]),{'include':_0x70b4cc[_0xac5a('0x28')][_0xac5a('0x3a')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x18524,0xc9))[_0xac5a('0x45')](handleError(_0x18524,null));};exports[_0xac5a('0x1f')]=function(_0x13f165,_0x254c95){if(_0x13f165[_0xac5a('0x42')]['id']){delete _0x13f165[_0xac5a('0x42')]['id'];}return db[_0xac5a('0x25')]['find']({'where':{'id':_0x13f165['params']['id']}})[_0xac5a('0x20')](handleEntityNotFound(_0x254c95,null))[_0xac5a('0x20')](saveUpdates(_0x13f165[_0xac5a('0x42')],null))['then'](respondWithResult(_0x254c95,null))['catch'](handleError(_0x254c95,null));};exports[_0xac5a('0x21')]=function(_0x2ad068,_0x489175){return db[_0xac5a('0x25')][_0xac5a('0x3f')]({'where':{'id':_0x2ad068[_0xac5a('0x3e')]['id']}})[_0xac5a('0x20')](handleEntityNotFound(_0x489175,null))[_0xac5a('0x20')](removeEntity(_0x489175,null))[_0xac5a('0x45')](handleError(_0x489175,null));};exports['create']=function(_0x860bf1,_0x554d6f,_0x518b11){_0x860bf1[_0xac5a('0x42')][_0xac5a('0x23')]=_0x860bf1[_0xac5a('0x46')]['originalname'];_0x860bf1['body'][_0xac5a('0x47')]=_0x860bf1[_0xac5a('0x46')][_0xac5a('0x48')];_0x860bf1[_0xac5a('0x42')][_0xac5a('0x26')]=_0x860bf1[_0xac5a('0x46')][_0xac5a('0x49')];return db[_0xac5a('0x25')]['create'](_0x860bf1[_0xac5a('0x42')])[_0xac5a('0x20')](respondWithResult(_0x554d6f,0xc9))[_0xac5a('0x45')](handleError(_0x554d6f,null));};exports[_0xac5a('0x4a')]=function(_0x517064,_0x1d119b,_0x8c6d09){return db[_0xac5a('0x25')][_0xac5a('0x4b')]({'where':{'id':_0x517064[_0xac5a('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1d119b,null))[_0xac5a('0x20')](function(_0x63609a){if(_0x63609a){var _0x38b330=_0x63609a['ChatOfflineMessageId']!==null;var _0x39001b=path[_0xac5a('0x4c')](config[_0xac5a('0x4d')],_0xac5a('0x4e'));if(_0x38b330){_0x39001b=path[_0xac5a('0x4c')](_0x39001b,_0xac5a('0x4f'));}var _0x1c0dfb=path[_0xac5a('0x4c')](_0x39001b,_0x63609a[_0xac5a('0x47')]);return _0x1d119b[_0xac5a('0x4a')](_0x1c0dfb);}})[_0xac5a('0x45')](handleError(_0x1d119b,null));};
\ No newline at end of file
+var _0x4cf1=['body','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','get','omit','createdAt','updatedAt','create'];(function(_0x235c2d,_0x116b14){var _0x343c42=function(_0x46a52b){while(--_0x46a52b){_0x235c2d['push'](_0x235c2d['shift']());}};_0x343c42(++_0x116b14);}(_0x4cf1,0xbe));var _0x14cf=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x4cf1[_0x5d1044];return _0x3cd90e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14cf('0x0'));var jsonpatch=require(_0x14cf('0x1'));var rp=require(_0x14cf('0x2'));var moment=require(_0x14cf('0x3'));var BPromise=require(_0x14cf('0x4'));var Mustache=require(_0x14cf('0x5'));var util=require(_0x14cf('0x6'));var path=require(_0x14cf('0x7'));var sox=require(_0x14cf('0x8'));var csv=require(_0x14cf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x14cf('0xa'));var _=require(_0x14cf('0xb'));var squel=require(_0x14cf('0xc'));var crypto=require(_0x14cf('0xd'));var jsforce=require(_0x14cf('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x14cf('0xf'));var Papa=require(_0x14cf('0x10'));var Redis=require(_0x14cf('0x11'));var authService=require(_0x14cf('0x12'));var qs=require(_0x14cf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14cf('0x14'));var logger=require(_0x14cf('0x15'))(_0x14cf('0x16'));var utils=require('../../config/utils');var config=require(_0x14cf('0x17'));var licenseUtil=require(_0x14cf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28364a,_0x3d39b9){_0x3d39b9=_0x3d39b9||0xcc;return function(_0xdc2f6a){if(_0xdc2f6a){return _0x28364a[_0x14cf('0x19')](_0x3d39b9);}return _0x28364a[_0x14cf('0x1a')](_0x3d39b9)[_0x14cf('0x1b')]();};}function respondWithResult(_0x520fc1,_0x2d5037){_0x2d5037=_0x2d5037||0xc8;return function(_0x953241){if(_0x953241){return _0x520fc1[_0x14cf('0x1a')](_0x2d5037)['json'](_0x953241);}};}function respondWithFilteredResult(_0x232187,_0x55d6d0){return function(_0x398090){if(_0x398090){var _0x2b3612=typeof _0x55d6d0[_0x14cf('0x1c')]===_0x14cf('0x1d')&&typeof _0x55d6d0['limit']===_0x14cf('0x1d');var _0xa6a523=_0x398090[_0x14cf('0x1e')];var _0x7ca15=_0x2b3612?0x0:_0x55d6d0[_0x14cf('0x1c')];var _0x243bc4=_0x2b3612?_0x398090[_0x14cf('0x1e')]:_0x55d6d0[_0x14cf('0x1c')]+_0x55d6d0[_0x14cf('0x1f')];var _0x3be873;if(_0x243bc4>=_0xa6a523){_0x243bc4=_0xa6a523;_0x3be873=0xc8;}else{_0x3be873=0xce;}_0x232187[_0x14cf('0x1a')](_0x3be873);return _0x232187[_0x14cf('0x20')](_0x14cf('0x21'),_0x7ca15+'-'+_0x243bc4+'/'+_0xa6a523)[_0x14cf('0x22')](_0x398090);}return null;};}function patchUpdates(_0x59f44a){return function(_0x512b12){try{jsonpatch[_0x14cf('0x23')](_0x512b12,_0x59f44a,!![]);}catch(_0x4c519e){return BPromise['reject'](_0x4c519e);}return _0x512b12[_0x14cf('0x24')]();};}function saveUpdates(_0x5ec1aa,_0x111959){return function(_0x64d1b5){if(_0x64d1b5){return _0x64d1b5['update'](_0x5ec1aa)['then'](function(_0x258a07){return _0x258a07;});}return null;};}function removeEntity(_0x16871f,_0x4338c3){return function(_0x56aa57){if(_0x56aa57){return _0x56aa57[_0x14cf('0x25')]()[_0x14cf('0x26')](function(){_0x16871f[_0x14cf('0x1a')](0xcc)[_0x14cf('0x1b')]();});}};}function handleEntityNotFound(_0x5c870d,_0x1bc9ed){return function(_0x1d371b){if(!_0x1d371b){_0x5c870d[_0x14cf('0x19')](0x194);}return _0x1d371b;};}function handleError(_0x1ffcac,_0x3e730a){_0x3e730a=_0x3e730a||0x1f4;return function(_0x1c6708){logger[_0x14cf('0x27')](_0x1c6708[_0x14cf('0x28')]);if(_0x1c6708[_0x14cf('0x29')]){delete _0x1c6708[_0x14cf('0x29')];}_0x1ffcac['status'](_0x3e730a)[_0x14cf('0x2a')](_0x1c6708);};}exports[_0x14cf('0x2b')]=function(_0x2174aa,_0x4290b5){var _0x139a2d={},_0x5251e4={},_0x47fa7d={'count':0x0,'rows':[]};var _0x5e1513=_[_0x14cf('0x2c')](db[_0x14cf('0x2d')][_0x14cf('0x2e')],function(_0x19ec8b){return{'name':_0x19ec8b['fieldName'],'type':_0x19ec8b['type']['key']};});_0x5251e4[_0x14cf('0x2f')]=_['map'](_0x5e1513,_0x14cf('0x29'));_0x5251e4[_0x14cf('0x30')]=_['keys'](_0x2174aa[_0x14cf('0x30')]);_0x5251e4[_0x14cf('0x31')]=_[_0x14cf('0x32')](_0x5251e4[_0x14cf('0x2f')],_0x5251e4[_0x14cf('0x30')]);_0x139a2d[_0x14cf('0x33')]=_[_0x14cf('0x32')](_0x5251e4[_0x14cf('0x2f')],qs['fields'](_0x2174aa['query'][_0x14cf('0x34')]));_0x139a2d['attributes']=_0x139a2d[_0x14cf('0x33')][_0x14cf('0x35')]?_0x139a2d[_0x14cf('0x33')]:_0x5251e4[_0x14cf('0x2f')];if(!_0x2174aa[_0x14cf('0x30')]['hasOwnProperty'](_0x14cf('0x36'))){_0x139a2d[_0x14cf('0x1f')]=qs['limit'](_0x2174aa[_0x14cf('0x30')][_0x14cf('0x1f')]);_0x139a2d[_0x14cf('0x1c')]=qs[_0x14cf('0x1c')](_0x2174aa[_0x14cf('0x30')][_0x14cf('0x1c')]);}_0x139a2d['order']=qs[_0x14cf('0x37')](_0x2174aa[_0x14cf('0x30')][_0x14cf('0x37')]);_0x139a2d['where']=qs[_0x14cf('0x31')](_[_0x14cf('0x38')](_0x2174aa[_0x14cf('0x30')],_0x5251e4[_0x14cf('0x31')]),_0x5e1513);if(_0x2174aa[_0x14cf('0x30')][_0x14cf('0x39')]){_0x139a2d[_0x14cf('0x3a')]=_['merge'](_0x139a2d[_0x14cf('0x3a')],{'$or':_[_0x14cf('0x2c')](_0x5e1513,function(_0x17d6c6){if(_0x17d6c6[_0x14cf('0x3b')]!==_0x14cf('0x3c')){var _0x17cbb3={};_0x17cbb3[_0x17d6c6[_0x14cf('0x29')]]={'$like':'%'+_0x2174aa[_0x14cf('0x30')]['filter']+'%'};return _0x17cbb3;}})});}_0x139a2d=_[_0x14cf('0x3d')]({},_0x139a2d,_0x2174aa[_0x14cf('0x3e')]);var _0x36f511={'where':_0x139a2d['where']};return db[_0x14cf('0x2d')]['count'](_0x36f511)[_0x14cf('0x26')](function(_0x2077cb){_0x47fa7d['count']=_0x2077cb;if(_0x2174aa[_0x14cf('0x30')][_0x14cf('0x3f')]){_0x139a2d[_0x14cf('0x40')]=[{'all':!![]}];}return db[_0x14cf('0x2d')][_0x14cf('0x41')](_0x139a2d);})['then'](function(_0x3eb917){_0x47fa7d[_0x14cf('0x42')]=_0x3eb917;return _0x47fa7d;})[_0x14cf('0x26')](respondWithFilteredResult(_0x4290b5,_0x139a2d))[_0x14cf('0x43')](handleError(_0x4290b5,null));};exports[_0x14cf('0x44')]=function(_0x4d61a8,_0x1cc476){var _0x2064a0={'raw':!![],'where':{'id':_0x4d61a8[_0x14cf('0x45')]['id']}},_0x589588={};_0x589588[_0x14cf('0x2f')]=_[_0x14cf('0x46')](db[_0x14cf('0x2d')][_0x14cf('0x2e')]);_0x589588[_0x14cf('0x30')]=_[_0x14cf('0x46')](_0x4d61a8[_0x14cf('0x30')]);_0x589588['filters']=_['intersection'](_0x589588[_0x14cf('0x2f')],_0x589588[_0x14cf('0x30')]);_0x2064a0[_0x14cf('0x33')]=_[_0x14cf('0x32')](_0x589588[_0x14cf('0x2f')],qs[_0x14cf('0x34')](_0x4d61a8[_0x14cf('0x30')][_0x14cf('0x34')]));_0x2064a0['attributes']=_0x2064a0[_0x14cf('0x33')]['length']?_0x2064a0[_0x14cf('0x33')]:_0x589588[_0x14cf('0x2f')];if(_0x4d61a8['query'][_0x14cf('0x3f')]){_0x2064a0[_0x14cf('0x40')]=[{'all':!![]}];}_0x2064a0=_[_0x14cf('0x3d')]({},_0x2064a0,_0x4d61a8['options']);return db[_0x14cf('0x2d')][_0x14cf('0x47')](_0x2064a0)[_0x14cf('0x26')](handleEntityNotFound(_0x1cc476,null))['then'](respondWithResult(_0x1cc476,null))[_0x14cf('0x43')](handleError(_0x1cc476,null));};exports['clone']=function(_0x2de760,_0x3beeea){var _0x11f703={'where':{'id':_0x2de760[_0x14cf('0x45')]['id']}},_0x3e44ee={};_0x3e44ee[_0x14cf('0x2f')]=_['keys'](db[_0x14cf('0x2d')][_0x14cf('0x2e')]);_0x11f703['attributes']=_[_0x14cf('0x32')](_0x3e44ee[_0x14cf('0x2f')],qs['fields'](_0x2de760[_0x14cf('0x30')][_0x14cf('0x34')]));_0x11f703[_0x14cf('0x33')]=_0x11f703[_0x14cf('0x33')][_0x14cf('0x35')]?_0x11f703[_0x14cf('0x33')]:_0x3e44ee[_0x14cf('0x2f')];if(_0x2de760['query']['includeAll']){_0x11f703['include']=[{'all':!![]}];}_0x11f703=_[_0x14cf('0x3d')]({},_0x11f703,_0x2de760[_0x14cf('0x3e')]);return db['Attachment'][_0x14cf('0x47')](_0x11f703)[_0x14cf('0x26')](handleEntityNotFound(_0x3beeea,null))[_0x14cf('0x26')](function(_0x1caa55){if(_0x1caa55){var _0x195f69=_0x1caa55[_0x14cf('0x48')]({'plain':!![]});_0x195f69=qs[_0x14cf('0x49')](_0x195f69,['id',_0x14cf('0x4a'),'updatedAt']);_0x2de760['body']=_['omit'](_0x2de760['body'],['id',_0x14cf('0x4a'),_0x14cf('0x4b')]);return db['Attachment'][_0x14cf('0x4c')](_['merge'](_0x195f69,_0x2de760['body']),{'include':_0x2de760[_0x14cf('0x30')][_0x14cf('0x3f')]?[{'all':!![]}]:undefined});}})[_0x14cf('0x26')](respondWithResult(_0x3beeea,0xc9))[_0x14cf('0x43')](handleError(_0x3beeea,null));};exports['update']=function(_0x3fae93,_0x3d982d){if(_0x3fae93[_0x14cf('0x4d')]['id']){delete _0x3fae93[_0x14cf('0x4d')]['id'];}return db[_0x14cf('0x2d')]['find']({'where':{'id':_0x3fae93[_0x14cf('0x45')]['id']}})[_0x14cf('0x26')](handleEntityNotFound(_0x3d982d,null))['then'](saveUpdates(_0x3fae93['body'],null))['then'](respondWithResult(_0x3d982d,null))[_0x14cf('0x43')](handleError(_0x3d982d,null));};exports[_0x14cf('0x25')]=function(_0x4f56f6,_0x28dc97){return db[_0x14cf('0x2d')][_0x14cf('0x47')]({'where':{'id':_0x4f56f6[_0x14cf('0x45')]['id']}})[_0x14cf('0x26')](handleEntityNotFound(_0x28dc97,null))[_0x14cf('0x26')](removeEntity(_0x28dc97,null))[_0x14cf('0x43')](handleError(_0x28dc97,null));};exports[_0x14cf('0x4c')]=function(_0x589de8,_0x4b80c5,_0x27e44f){_0x589de8['body'][_0x14cf('0x29')]=_0x589de8[_0x14cf('0x4e')][_0x14cf('0x4f')];_0x589de8[_0x14cf('0x4d')]['basename']=_0x589de8[_0x14cf('0x4e')][_0x14cf('0x50')];_0x589de8[_0x14cf('0x4d')]['type']=_0x589de8[_0x14cf('0x4e')][_0x14cf('0x51')];return db['Attachment'][_0x14cf('0x4c')](_0x589de8['body'])[_0x14cf('0x26')](respondWithResult(_0x4b80c5,0xc9))[_0x14cf('0x43')](handleError(_0x4b80c5,null));};exports['download']=function(_0x2942ea,_0x19c89d,_0x485cce){return db[_0x14cf('0x2d')][_0x14cf('0x52')]({'where':{'id':_0x2942ea[_0x14cf('0x45')]['id']},'raw':!![]})[_0x14cf('0x26')](handleEntityNotFound(_0x19c89d,null))[_0x14cf('0x26')](function(_0x20426d){if(_0x20426d){var _0x3deb91=_0x20426d[_0x14cf('0x53')]!==null;var _0x12fc27=path[_0x14cf('0x54')](config[_0x14cf('0x55')],_0x14cf('0x56'));if(_0x3deb91){_0x12fc27=path[_0x14cf('0x54')](_0x12fc27,_0x14cf('0x57'));}var _0x4955f0=path[_0x14cf('0x54')](_0x12fc27,_0x20426d['basename']);return _0x19c89d[_0x14cf('0x58')](_0x4955f0);}})[_0x14cf('0x43')](handleError(_0x19c89d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 63850e4..f3317a5 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 _0xef65=['attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x24f673,_0x56b7cf){var _0xd18242=function(_0x275794){while(--_0x275794){_0x24f673['push'](_0x24f673['shift']());}};_0xd18242(++_0x56b7cf);}(_0xef65,0x85));var _0x5ef6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef65[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5ef6('0x0'));var util=require(_0x5ef6('0x1'));var logger=require(_0x5ef6('0x2'))('api');var moment=require(_0x5ef6('0x3'));var BPromise=require(_0x5ef6('0x4'));var rp=require(_0x5ef6('0x5'));var fs=require('fs');var path=require(_0x5ef6('0x6'));var rimraf=require(_0x5ef6('0x7'));var config=require(_0x5ef6('0x8'));var attributes=require(_0x5ef6('0x9'));module['exports']=function(_0x562a70,_0x2e4c13){return _0x562a70[_0x5ef6('0xa')]('Attachment',attributes,{'tableName':_0x5ef6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x82f0=['Attachment','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x1d8e83,_0x3a44be){var _0x30d861=function(_0xc4fd25){while(--_0xc4fd25){_0x1d8e83['push'](_0x1d8e83['shift']());}};_0x30d861(++_0x3a44be);}(_0x82f0,0x10b));var _0x082f=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x82f0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x082f('0x0'));var util=require(_0x082f('0x1'));var logger=require(_0x082f('0x2'))(_0x082f('0x3'));var moment=require(_0x082f('0x4'));var BPromise=require(_0x082f('0x5'));var rp=require(_0x082f('0x6'));var fs=require('fs');var path=require(_0x082f('0x7'));var rimraf=require(_0x082f('0x8'));var config=require(_0x082f('0x9'));var attributes=require(_0x082f('0xa'));module[_0x082f('0xb')]=function(_0x424804,_0x190fc4){return _0x424804[_0x082f('0xc')](_0x082f('0xd'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 5cba154..c7e682c 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 _0x402f=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','message','error','CreateAttachment','Attachment','create','options','raw','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x2bd9d7,_0x1362b8){var _0x58e769=function(_0x17344f){while(--_0x17344f){_0x2bd9d7['push'](_0x2bd9d7['shift']());}};_0x58e769(++_0x1362b8);}(_0x402f,0x6f));var _0xf402=function(_0x183298,_0x4c8a3e){_0x183298=_0x183298-0x0;var _0xe6459d=_0x402f[_0x183298];return _0xe6459d;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var moment=require(_0xf402('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf402('0x2'));var db=require(_0xf402('0x3'))['db'];var utils=require(_0xf402('0x4'));var logger=require('../../config/logger')(_0xf402('0x5'));var config=require('../../config/environment');var jayson=require(_0xf402('0x6'));var client=jayson[_0xf402('0x7')][_0xf402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8774,_0xa1b27d,_0x55c515){return new BPromise(function(_0x4d1771,_0x2f0ffe){return client[_0xf402('0x9')](_0x2a8774,_0x55c515)[_0xf402('0xa')](function(_0xdc18e0){logger[_0xf402('0xb')](_0xf402('0xc'),_0xa1b27d,_0xf402('0xd'));logger[_0xf402('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'),JSON['stringify'](_0xdc18e0));if(_0xdc18e0['error']){if(_0xdc18e0['error']['code']===0x1f4){logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0['error']['message']);return _0x2f0ffe(_0xdc18e0['error'][_0xf402('0xf')]);}logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0[_0xf402('0x10')][_0xf402('0xf')]);return _0x4d1771(_0xdc18e0[_0xf402('0x10')]['message']);}else{logger[_0xf402('0xb')]('Attachment,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'));_0x4d1771(_0xdc18e0['result']['message']);}})['catch'](function(_0xb45d00){logger[_0xf402('0x10')](_0xf402('0xc'),_0xa1b27d,_0xb45d00);_0x2f0ffe(_0xb45d00);});});}exports[_0xf402('0x11')]=function(_0x2fbe36){var _0x5d7236=this;return new Promise(function(_0x3ed3eb,_0x151166){return db[_0xf402('0x12')][_0xf402('0x13')](_0x2fbe36['body'],{'raw':_0x2fbe36[_0xf402('0x14')]?_0x2fbe36[_0xf402('0x14')][_0xf402('0x15')]===undefined?!![]:![]:!![]})[_0xf402('0xa')](function(_0x3d3ed4){logger[_0xf402('0xb')](_0xf402('0x11'),_0x2fbe36);logger[_0xf402('0xe')](_0xf402('0x11'),_0x2fbe36,JSON['stringify'](_0x3d3ed4));_0x3ed3eb(_0x3d3ed4);})[_0xf402('0x16')](function(_0x4ffe46){logger[_0xf402('0x10')](_0xf402('0x11'),_0x4ffe46[_0xf402('0xf')],_0x2fbe36);_0x151166(_0x5d7236[_0xf402('0x10')](0x1f4,_0x4ffe46[_0xf402('0xf')]));});});};
\ No newline at end of file
+var _0xf874=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Attachment','create','body','options','raw','CreateAttachment','moment','bluebird','randomstring'];(function(_0x11273e,_0x3821a6){var _0x1e8616=function(_0x439d86){while(--_0x439d86){_0x11273e['push'](_0x11273e['shift']());}};_0x1e8616(++_0x3821a6);}(_0xf874,0xed));var _0x4f87=function(_0x5bdd43,_0x1ba582){_0x5bdd43=_0x5bdd43-0x0;var _0x2df923=_0xf874[_0x5bdd43];return _0x2df923;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f87('0x0'));var BPromise=require(_0x4f87('0x1'));var rs=require(_0x4f87('0x2'));var fs=require('fs');var Redis=require(_0x4f87('0x3'));var db=require(_0x4f87('0x4'))['db'];var utils=require(_0x4f87('0x5'));var logger=require('../../config/logger')(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var jayson=require(_0x4f87('0x8'));var client=jayson[_0x4f87('0x9')][_0x4f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fea6,_0x4a0662,_0x3a89e3){return new BPromise(function(_0x194853,_0x592008){return client[_0x4f87('0xb')](_0x44fea6,_0x3a89e3)[_0x4f87('0xc')](function(_0x4d8354){logger[_0x4f87('0xd')](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));logger[_0x4f87('0x10')](_0x4f87('0x11'),_0x4a0662,_0x4f87('0xf'),JSON[_0x4f87('0x12')](_0x4d8354));if(_0x4d8354['error']){if(_0x4d8354['error'][_0x4f87('0x13')]===0x1f4){logger[_0x4f87('0x14')](_0x4f87('0xe'),_0x4a0662,_0x4d8354['error']['message']);return _0x592008(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}logger[_0x4f87('0x14')]('Attachment,\x20%s,\x20%s',_0x4a0662,_0x4d8354[_0x4f87('0x14')]['message']);return _0x194853(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}else{logger['info'](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));_0x194853(_0x4d8354[_0x4f87('0x16')][_0x4f87('0x15')]);}})[_0x4f87('0x17')](function(_0x3bd90f){logger['error'](_0x4f87('0xe'),_0x4a0662,_0x3bd90f);_0x592008(_0x3bd90f);});});}exports['CreateAttachment']=function(_0x10551e){var _0x6a3017=this;return new Promise(function(_0x46492d,_0x42c399){return db[_0x4f87('0x18')][_0x4f87('0x19')](_0x10551e[_0x4f87('0x1a')],{'raw':_0x10551e[_0x4f87('0x1b')]?_0x10551e[_0x4f87('0x1b')][_0x4f87('0x1c')]===undefined?!![]:![]:!![]})[_0x4f87('0xc')](function(_0x2c13a0){logger[_0x4f87('0xd')]('CreateAttachment',_0x10551e);logger['debug'](_0x4f87('0x1d'),_0x10551e,JSON[_0x4f87('0x12')](_0x2c13a0));_0x46492d(_0x2c13a0);})['catch'](function(_0x592edd){logger[_0x4f87('0x14')]('CreateAttachment',_0x592edd['message'],_0x10551e);_0x42c399(_0x6a3017[_0x4f87('0x14')](0x1f4,_0x592edd[_0x4f87('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 8739dc8..b288c5e 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 _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(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x0b0e[_0x243217];return _0x478029;};'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
+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(_0x4569f4,_0x30d93f){var _0x1421e5=function(_0x515aaa){while(--_0x515aaa){_0x4569f4['push'](_0x4569f4['shift']());}};_0x1421e5(++_0x30d93f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x584eed,_0x5ab3e8){_0x584eed=_0x584eed-0x0;var _0x112b46=_0x5f2f[_0x584eed];return _0x112b46;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index fb42d93..72257f8 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 _0x3bcf=['activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','online','admin','agent','domain','blockedAt','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment'];(function(_0x4e8f87,_0x1542b2){var _0x224194=function(_0xb0c6c8){while(--_0xb0c6c8){_0x4e8f87['push'](_0x4e8f87['shift']());}};_0x224194(++_0x1542b2);}(_0x3bcf,0xdd));var _0xf3bc=function(_0x2ad5b0,_0x6db245){_0x2ad5b0=_0x2ad5b0-0x0;var _0x235edb=_0x3bcf[_0x2ad5b0];return _0x235edb;};'use strict';var passport=require(_0xf3bc('0x0'));var LocalStrategy=require(_0xf3bc('0x1'))[_0xf3bc('0x2')];var moment=require(_0xf3bc('0x3'));var ActiveDirectory=require(_0xf3bc('0x4'));var BPromise=require(_0xf3bc('0x5'));var util=require('util');var db=require(_0xf3bc('0x6'))['db'];var authService=require(_0xf3bc('0x7'));var utils=require(_0xf3bc('0x8'));var config=require(_0xf3bc('0x9'));var logger=require('../../config/logger')(_0xf3bc('0xa'));function isActiveDirectoryConfigured(_0x3456d0){var _0x37bae7=![];if(typeof _0x3456d0[_0xf3bc('0xb')]!==_0xf3bc('0xc')){_0x37bae7=_0x3456d0[_0xf3bc('0xb')]['baseDN']&&_0x3456d0[_0xf3bc('0xb')][_0xf3bc('0xd')]&&_0x3456d0[_0xf3bc('0xb')]['domain'];}return _0x37bae7;}function adAuthenticate(_0x2849f6,_0x180001,_0x33235d){return new BPromise(function(_0x4d74ec,_0x41b436){try{var _0x2a9c12=new ActiveDirectory(_0x2849f6);_0x2a9c12[_0xf3bc('0xe')](_0x180001,_0x33235d,function(_0x2c063f,_0x2916d5){if(_0x2c063f){logger[_0xf3bc('0xf')](_0xf3bc('0x10'),_0x180001,util['inspect'](_0x2c063f,{'showHidden':![],'depth':null}));_0x41b436(_0xf3bc('0x11'));}else if(!_0x2916d5){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x180001);_0x41b436(_0xf3bc('0x11'));}else{_0x4d74ec(_0x2916d5);}});}catch(_0x198604){_0x41b436(_0x198604);}});}function ActiveDirectoryAuthenticate(_0x4cb138,_0x424063,_0x33b2ac,_0x378eed){var _0x4cb6a0,_0x2cc991;if(!isActiveDirectoryConfigured(config)){logger[_0xf3bc('0xf')](_0xf3bc('0x12'),_0x424063);return _0x378eed(null,![],{'message':_0xf3bc('0x11')});}return db[_0xf3bc('0x13')][_0xf3bc('0x14')]({'where':{'id':0x1},'attributes':[_0xf3bc('0x15'),_0xf3bc('0x16')],'raw':!![]})[_0xf3bc('0x17')](function(_0x54e1f0){_0x4cb6a0=_0x54e1f0;if(!_0x4cb6a0[_0xf3bc('0x15')]){logger[_0xf3bc('0xf')](_0xf3bc('0x18'),_0x424063);throw new Error(_0xf3bc('0x11'));}return _0x4cb138[_0xf3bc('0x14')]({'attributes':['id',_0xf3bc('0x19'),'password',_0xf3bc('0x1a'),_0xf3bc('0x1b'),_0xf3bc('0x1c'),_0xf3bc('0x1d'),'blockedAt',_0xf3bc('0x1e')],'where':{'name':_0x424063,'role':{'$or':[_0xf3bc('0x1f'),'user',_0xf3bc('0x20')]},'adSsoEnabled':!![]}});})[_0xf3bc('0x17')](function(_0x30e210){if(!_0x30e210||_0x30e210&&_0x30e210['name']!==_0x424063){throw new Error(_0xf3bc('0x11'));}_0x2cc991=_0x30e210;var _0x1ab9c5=_0x2cc991['name']+'@'+config['activedirectory'][_0xf3bc('0x21')];return adAuthenticate(config[_0xf3bc('0xb')],_0x1ab9c5,_0x33b2ac);})[_0xf3bc('0x17')](function(_0x42ad8e){if(_0x2cc991['disabled']){throw new Error(_0xf3bc('0x11'));}if(_0x4cb6a0[_0xf3bc('0x16')]>0x0){if(_0x2cc991[_0xf3bc('0x1d')]){if(moment(_0x2cc991[_0xf3bc('0x22')])['add'](_0x4cb6a0[_0xf3bc('0x16')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x2cc991,0x0,![],null)[_0xf3bc('0x17')](function(){return utils['getLicense'](_0x2cc991);})[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}else{return utils[_0xf3bc('0x23')](_0x2cc991)[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}}else{return utils['getLicense'](_0x2cc991)[_0xf3bc('0x17')](function(){return _0x378eed(null,_0x2cc991);});}})[_0xf3bc('0x24')](function(_0x15559f){return _0x378eed(null,![],_0x15559f);});}function handleError(_0x2f3916,_0x4cf46d,_0x333f87){return _0x2f3916['status'](_0x4cf46d||0x1f4)[_0xf3bc('0x25')]({'message':_0x333f87?_0x333f87[_0xf3bc('0x26')]||_0x333f87:''});}exports['login']=function(_0x4f6476,_0x1e0007,_0x5ca363){passport['authenticate']('ad-login',function(_0x5220e3,_0x558f82,_0x3f3d5a){var _0x2e31a4=_0x5220e3||_0x3f3d5a;if(_0x2e31a4){return handleError(_0x1e0007,0x191,_0x2e31a4);}if(!_0x558f82){return handleError(_0x1e0007,0x194,{'message':_0xf3bc('0x27')});}else{var _0x288f18={'payload':{'id':_0x558f82['id'],'role':_0x558f82[_0xf3bc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xf3bc('0x28')](_0x288f18)[_0xf3bc('0x17')](function(_0x6c1033){_0x1e0007[_0xf3bc('0x29')]({'id':_0x558f82['id'],'token':_0x6c1033,'statusCall':'','isAlreadyLogged':_0x558f82['online']});});}})(_0x4f6476,_0x1e0007,_0x5ca363);};passport[_0xf3bc('0x2a')](_0xf3bc('0x2b'),new LocalStrategy({'usernameField':_0xf3bc('0x19'),'passwordField':'password'},function(_0x1a7738,_0x572a9b,_0x1811a4){return ActiveDirectoryAuthenticate(db[_0xf3bc('0x2c')],_0x1a7738,_0x572a9b,_0x1811a4);}));
\ No newline at end of file
+var _0x0bae=['undefined','activedirectory','baseDN','url','domain','authenticate','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','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blockedAt','agent','then','blockDuration','blocked','add','clearBlockUser','getLicense','catch','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x0bae,0x146));var _0xe0ba=function(_0x18e1bf,_0x2fbc81){_0x18e1bf=_0x18e1bf-0x0;var _0x4bd981=_0x0bae[_0x18e1bf];return _0x4bd981;};'use strict';var passport=require(_0xe0ba('0x0'));var LocalStrategy=require(_0xe0ba('0x1'))[_0xe0ba('0x2')];var moment=require(_0xe0ba('0x3'));var ActiveDirectory=require(_0xe0ba('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xe0ba('0x5'));var utils=require(_0xe0ba('0x6'));var config=require(_0xe0ba('0x7'));var logger=require(_0xe0ba('0x8'))(_0xe0ba('0x9'));function isActiveDirectoryConfigured(_0x21ff6f){var _0x27e0d8=![];if(typeof _0x21ff6f['activedirectory']!==_0xe0ba('0xa')){_0x27e0d8=_0x21ff6f[_0xe0ba('0xb')][_0xe0ba('0xc')]&&_0x21ff6f[_0xe0ba('0xb')][_0xe0ba('0xd')]&&_0x21ff6f['activedirectory'][_0xe0ba('0xe')];}return _0x27e0d8;}function adAuthenticate(_0x2c9d7a,_0x48fb8e,_0x4538fd){return new BPromise(function(_0x8b5354,_0x3d8504){try{var _0x2d801b=new ActiveDirectory(_0x2c9d7a);_0x2d801b[_0xe0ba('0xf')](_0x48fb8e,_0x4538fd,function(_0x303911,_0x29167c){if(_0x303911){logger[_0xe0ba('0x10')](_0xe0ba('0x11'),_0x48fb8e,util['inspect'](_0x303911,{'showHidden':![],'depth':null}));_0x3d8504(_0xe0ba('0x12'));}else if(!_0x29167c){logger['error'](_0xe0ba('0x13'),_0x48fb8e);_0x3d8504(_0xe0ba('0x12'));}else{_0x8b5354(_0x29167c);}});}catch(_0x5c73fc){_0x3d8504(_0x5c73fc);}});}function ActiveDirectoryAuthenticate(_0x42a03c,_0x4f9f91,_0x1e2bf0,_0x1c4fef){var _0x54f21e,_0x3b019a;if(!isActiveDirectoryConfigured(config)){logger[_0xe0ba('0x10')](_0xe0ba('0x14'),_0x4f9f91);return _0x1c4fef(null,![],{'message':_0xe0ba('0x12')});}return db[_0xe0ba('0x15')][_0xe0ba('0x16')]({'where':{'id':0x1},'attributes':[_0xe0ba('0x17'),'blockDuration'],'raw':!![]})['then'](function(_0x26f5c3){_0x54f21e=_0x26f5c3;if(!_0x54f21e[_0xe0ba('0x17')]){logger[_0xe0ba('0x10')](_0xe0ba('0x18'),_0x4f9f91);throw new Error(_0xe0ba('0x12'));}return _0x42a03c[_0xe0ba('0x16')]({'attributes':['id',_0xe0ba('0x19'),_0xe0ba('0x1a'),'salt',_0xe0ba('0x1b'),_0xe0ba('0x1c'),'blocked',_0xe0ba('0x1d'),'online'],'where':{'name':_0x4f9f91,'role':{'$or':['admin','user',_0xe0ba('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x23efac){if(!_0x23efac||_0x23efac&&_0x23efac['name']!==_0x4f9f91){throw new Error(_0xe0ba('0x12'));}_0x3b019a=_0x23efac;var _0x1fe832=_0x3b019a[_0xe0ba('0x19')]+'@'+config[_0xe0ba('0xb')][_0xe0ba('0xe')];return adAuthenticate(config[_0xe0ba('0xb')],_0x1fe832,_0x1e2bf0);})[_0xe0ba('0x1f')](function(_0x152d6c){if(_0x3b019a[_0xe0ba('0x1c')]){throw new Error(_0xe0ba('0x12'));}if(_0x54f21e[_0xe0ba('0x20')]>0x0){if(_0x3b019a[_0xe0ba('0x21')]){if(moment(_0x3b019a[_0xe0ba('0x1d')])[_0xe0ba('0x22')](_0x54f21e['blockDuration'],'minutes')>moment()){throw new Error(_0xe0ba('0x12'));}return utils[_0xe0ba('0x23')](_0x3b019a,0x0,![],null)[_0xe0ba('0x1f')](function(){return utils[_0xe0ba('0x24')](_0x3b019a);})[_0xe0ba('0x1f')](function(){return _0x1c4fef(null,_0x3b019a);});}else{return utils[_0xe0ba('0x24')](_0x3b019a)[_0xe0ba('0x1f')](function(){return _0x1c4fef(null,_0x3b019a);});}}else{return utils[_0xe0ba('0x24')](_0x3b019a)[_0xe0ba('0x1f')](function(){return _0x1c4fef(null,_0x3b019a);});}})[_0xe0ba('0x25')](function(_0x53954f){return _0x1c4fef(null,![],_0x53954f);});}function handleError(_0x6d286a,_0x59fead,_0x5a2d2e){return _0x6d286a[_0xe0ba('0x26')](_0x59fead||0x1f4)[_0xe0ba('0x27')]({'message':_0x5a2d2e?_0x5a2d2e['message']||_0x5a2d2e:''});}exports[_0xe0ba('0x28')]=function(_0x507d57,_0x37d6ba,_0x3d5e62){passport[_0xe0ba('0xf')]('ad-login',function(_0x298fcd,_0x47576a,_0x2a9180){var _0x32cc58=_0x298fcd||_0x2a9180;if(_0x32cc58){return handleError(_0x37d6ba,0x191,_0x32cc58);}if(!_0x47576a){return handleError(_0x37d6ba,0x194,{'message':_0xe0ba('0x29')});}else{var _0x5cf830={'payload':{'id':_0x47576a['id'],'role':_0x47576a[_0xe0ba('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xe0ba('0x2a')](_0x5cf830)[_0xe0ba('0x1f')](function(_0x1fb069){_0x37d6ba[_0xe0ba('0x2b')]({'id':_0x47576a['id'],'token':_0x1fb069,'statusCall':'','isAlreadyLogged':_0x47576a[_0xe0ba('0x2c')]});});}})(_0x507d57,_0x37d6ba,_0x3d5e62);};passport[_0xe0ba('0x2d')](_0xe0ba('0x2e'),new LocalStrategy({'usernameField':_0xe0ba('0x19'),'passwordField':_0xe0ba('0x1a')},function(_0x392837,_0x1ee0b1,_0x4ee26d){return ActiveDirectoryAuthenticate(db[_0xe0ba('0x2f')],_0x392837,_0x1ee0b1,_0x4ee26d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e6400d0..469c386 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 _0x9613=['express','Router','post'];(function(_0x4c6d3d,_0x39c470){var _0x578c1a=function(_0x235079){while(--_0x235079){_0x4c6d3d['push'](_0x4c6d3d['shift']());}};_0x578c1a(++_0x39c470);}(_0x9613,0x17d));var _0x3961=function(_0x3e62b4,_0xfc4b03){_0x3e62b4=_0x3e62b4-0x0;var _0x176711=_0x9613[_0x3e62b4];return _0x176711;};'use strict';var express=require(_0x3961('0x0'));var router=express[_0x3961('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x3961('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x6c48=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c48,0x193));var _0x86c4=function(_0xce9f7b,_0x4e38f5){_0xce9f7b=_0xce9f7b-0x0;var _0x2379fd=_0x6c48[_0xce9f7b];return _0x2379fd;};'use strict';var express=require(_0x86c4('0x0'));var router=express[_0x86c4('0x1')]();var controller=require(_0x86c4('0x2'));router['post']('/',controller['login']);module[_0x86c4('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 56b469d..b8440fe 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7a54,0x106));var _0x47a5=function(_0x172095,_0x34ee25){_0x172095=_0x172095-0x0;var _0x2fb1aa=_0x7a54[_0x172095];return _0x2fb1aa;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5b3a,_0x3a1d9d){_0x4a5b3a=_0x4a5b3a-0x0;var _0x483e5c=_0x7a54[_0x4a5b3a];return _0x483e5c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 5c4046d..5d6ee1a 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 _0x1f10=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','login'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x1f10,0x69));var _0x01f1=function(_0x1cfb84,_0x17ceb4){_0x1cfb84=_0x1cfb84-0x0;var _0xdee636=_0x1f10[_0x1cfb84];return _0xdee636;};'use strict';var express=require(_0x01f1('0x0'));var passport=require(_0x01f1('0x1'));var router=express['Router']();var controller=require(_0x01f1('0x2'));var userController=require(_0x01f1('0x3'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x01f1('0x4')]);router['get'](_0x01f1('0x5'),controller[_0x01f1('0x6')],authService[_0x01f1('0x7')],userController['login'],authService[_0x01f1('0x8')]);module[_0x01f1('0x9')]=router;
\ No newline at end of file
+var _0xf78b=['isMiddleware','login','setTokenCookie','express','Router','./authGoogle.controller','get','/callback','callback'];(function(_0x4884bc,_0x315521){var _0xff9945=function(_0x59af0){while(--_0x59af0){_0x4884bc['push'](_0x4884bc['shift']());}};_0xff9945(++_0x315521);}(_0xf78b,0x78));var _0xbf78=function(_0x54edab,_0x49b7ad){_0x54edab=_0x54edab-0x0;var _0x35c7c9=_0xf78b[_0x54edab];return _0x35c7c9;};'use strict';var express=require(_0xbf78('0x0'));var passport=require('passport');var router=express[_0xbf78('0x1')]();var controller=require(_0xbf78('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xbf78('0x3')]('/',controller['login']);router[_0xbf78('0x3')](_0xbf78('0x4'),controller[_0xbf78('0x5')],authService[_0xbf78('0x6')],userController[_0xbf78('0x7')],authService[_0xbf78('0x8')]);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 a523108..966835f 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 _0xb000=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','User','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','authenticate','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','SendMail','error','message','stringify','status','login','local-login'];(function(_0x38e024,_0x3615aa){var _0x1e0118=function(_0x172e68){while(--_0x172e68){_0x38e024['push'](_0x38e024['shift']());}};_0x1e0118(++_0x3615aa);}(_0xb000,0xbd));var _0x0b00=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0xb000[_0x5ac84c];return _0x3c53d2;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x0b00('0x0'))[_0x0b00('0x1')];var jayson=require(_0x0b00('0x2'));var _=require('lodash');var rs=require(_0x0b00('0x3'));var moment=require(_0x0b00('0x4'));var db=require(_0x0b00('0x5'))['db'];var authService=require(_0x0b00('0x6'));var utils=require(_0x0b00('0x7'));var client=jayson[_0x0b00('0x8')][_0x0b00('0x9')]({'port':0x232b});function localAuthenticate(_0x3d6de7,_0x3a9380,_0x33254b,_0x58472e){var _0x111e42,_0x4a4d4c;return db[_0x0b00('0xa')][_0x0b00('0xb')]({'where':{'id':0x1},'attributes':[_0x0b00('0xc'),_0x0b00('0xd')],'raw':!![]})[_0x0b00('0xe')](function(_0x5e1b6b){_0x111e42=_0x5e1b6b;return _0x3d6de7[_0x0b00('0xb')]({'attributes':['id',_0x0b00('0xf'),_0x0b00('0x10'),_0x0b00('0x11'),_0x0b00('0x12'),_0x0b00('0x13'),'blocked',_0x0b00('0x14'),_0x0b00('0x15')],'where':{'name':_0x3a9380,'role':{'$or':[_0x0b00('0x16'),'user','agent']}}});})[_0x0b00('0xe')](function(_0x2e56b8){if(!_0x2e56b8||_0x2e56b8&&_0x2e56b8['name']!==_0x3a9380){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4a4d4c=_0x2e56b8;return _0x4a4d4c;}})[_0x0b00('0xe')](function(){_0x4a4d4c[_0x0b00('0x17')](_0x33254b,function(_0x397bd2,_0x54aaa1){var _0x16da93=_0x4a4d4c[_0x0b00('0x15')]+0x1;if(_0x397bd2){return _0x58472e(_0x397bd2);}else if(!_0x54aaa1){if(_0x4a4d4c['disabled']){return _0x58472e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x111e42['allowedLoginAttempts']>0x0){if(_0x4a4d4c[_0x0b00('0x18')]){if(_0x111e42[_0x0b00('0xd')]>0x0){if(moment(_0x4a4d4c[_0x0b00('0x14')])[_0x0b00('0x19')](_0x111e42[_0x0b00('0xd')],_0x0b00('0x1a'))>moment()){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}else{return utils[_0x0b00('0x1c')](_0x4a4d4c,_0x16da93,![],null)[_0x0b00('0xe')](function(){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});});}}else{return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}}else{if(_0x16da93>=_0x111e42[_0x0b00('0xc')]){return utils['clearBlockUser'](_0x4a4d4c,0x0,!![],moment())[_0x0b00('0xe')](function(){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});});}else{return utils[_0x0b00('0x1c')](_0x4a4d4c,_0x16da93,![],null)[_0x0b00('0xe')](function(){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});});}}}else{return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}}else{if(_0x4a4d4c[_0x0b00('0x13')]){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}else if(_0x111e42[_0x0b00('0xc')]>0x0){if(_0x4a4d4c[_0x0b00('0x18')]){if(_0x111e42[_0x0b00('0xd')]>0x0){if(moment(_0x4a4d4c[_0x0b00('0x14')])['add'](_0x111e42[_0x0b00('0xd')],'minutes')>moment()){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}else{return utils['clearBlockUser'](_0x4a4d4c,0x0,![],null)[_0x0b00('0xe')](function(){return utils[_0x0b00('0x1d')](_0x4a4d4c);})[_0x0b00('0xe')](function(){return _0x58472e(null,_0x4a4d4c);});}}else{return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}}else{return utils['clearBlockUser'](_0x4a4d4c,0x0,![],null)[_0x0b00('0xe')](function(){return utils[_0x0b00('0x1d')](_0x4a4d4c);})[_0x0b00('0xe')](function(){return _0x58472e(null,_0x4a4d4c);})[_0x0b00('0x1e')](function(_0x37e626){return _0x58472e(null,![],_0x37e626);});}}else{if(_0x4a4d4c['blocked']){return _0x58472e(null,![],{'message':_0x0b00('0x1b')});}else{return utils['getLicense'](_0x4a4d4c)['then'](function(){return _0x58472e(null,_0x4a4d4c);});}}}});})[_0x0b00('0x1e')](function(_0x3e9166){return _0x58472e(null,![],_0x3e9166);});}function sendServiceMail(_0x335bf2){return db[_0x0b00('0x1f')][_0x0b00('0x20')]({'where':{'service':!![]},'attributes':['id',_0x0b00('0xf'),_0x0b00('0x21')],'include':[{'model':db[_0x0b00('0x22')],'as':_0x0b00('0x23'),'include':[{'model':db[_0x0b00('0x24')],'as':_0x0b00('0x24')}]}]})[_0x0b00('0xe')](function(_0x59f702){if(!_0x59f702){throw new Error(_0x0b00('0x25'));}var _0xcd148b=_0x59f702['getSmtpOptions']();var _0x1beca7={'account':_0xcd148b,'message':_[_0x0b00('0x26')]({'from':util[_0x0b00('0x27')](_0x0b00('0x28'),_0x59f702[_0x0b00('0xf')],_0x59f702[_0x0b00('0x21')]||_0x59f702[_0x0b00('0x23')]['user'])},_0x335bf2)};return client['request'](_0x0b00('0x29'),_0x1beca7);})[_0x0b00('0xe')](function(_0x15cf61){if(_0x15cf61[_0x0b00('0x2a')]){throw new Error(util[_0x0b00('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x15cf61[_0x0b00('0x2a')][_0x0b00('0x2b')]||JSON[_0x0b00('0x2c')](_0x15cf61[_0x0b00('0x2a')])));}return!![];});}function handleError(_0x1b0863,_0x56351d,_0x1acdd1){return _0x1b0863[_0x0b00('0x2d')](_0x56351d||0x1f4)['send']({'message':_0x1acdd1?_0x1acdd1[_0x0b00('0x2b')]||_0x1acdd1:''});}exports[_0x0b00('0x2e')]=function(_0x57eca7,_0x4d4fe5,_0x564991){passport['authenticate'](_0x0b00('0x2f'),function(_0x136a57,_0x486552,_0x265e7a){var _0x27c997=_0x136a57||_0x265e7a;if(_0x27c997){return handleError(_0x4d4fe5,0x191,_0x27c997);}if(!_0x486552){return handleError(_0x4d4fe5,0x194,{'message':_0x0b00('0x30')});}else{var _0x451b03={'payload':{'id':_0x486552['id'],'role':_0x486552[_0x0b00('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x0b00('0x31')](_0x451b03)[_0x0b00('0xe')](function(_0x23334d){_0x4d4fe5[_0x0b00('0x32')]({'id':_0x486552['id'],'token':_0x23334d,'statusCall':'','isAlreadyLogged':_0x486552[_0x0b00('0x33')]});});}})(_0x57eca7,_0x4d4fe5,_0x564991);};exports[_0x0b00('0x34')]=function(_0x32a107,_0x5966d6){if(!_0x32a107[_0x0b00('0x35')][_0x0b00('0x21')]){return handleError(_0x5966d6,0x1f4,{'message':_0x0b00('0x36')});}var _0xccf004=rs[_0x0b00('0x37')]();_0x32a107['body']['email']=_0x32a107[_0x0b00('0x35')][_0x0b00('0x21')][_0x0b00('0x38')]()[_0x0b00('0x39')]();var _0x4d4e7d;return db[_0x0b00('0xa')][_0x0b00('0xb')]({'where':{'id':0x1},'attributes':[_0x0b00('0xc'),_0x0b00('0xd')],'raw':!![]})[_0x0b00('0xe')](function(_0x396845){_0x4d4e7d=_0x396845;return db['User'][_0x0b00('0x20')]({'where':{'email':_0x32a107['body'][_0x0b00('0x21')]}});})['then'](function(_0x2aede6){if(!_0x2aede6){throw new Error(_0x0b00('0x3a'));}if(_0x2aede6[_0x0b00('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2aede6[_0x0b00('0x18')]){if(moment(_0x2aede6['blockedAt'])[_0x0b00('0x19')](_0x4d4e7d['blockDuration'],_0x0b00('0x1a'))>moment()){throw new Error(_0x0b00('0x3b'));}else{_0x2aede6[_0x0b00('0x18')]=![];_0x2aede6['blockedAt']=null;}}_0x2aede6[_0x0b00('0x3c')]=_0xccf004;_0x2aede6[_0x0b00('0x3d')]=Date[_0x0b00('0x3e')]()+0x36ee80;return _0x2aede6[_0x0b00('0x3f')]();})[_0x0b00('0xe')](function(){return sendServiceMail({'to':_0x32a107[_0x0b00('0x35')][_0x0b00('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0b00('0x40')+_0x32a107[_0x0b00('0x41')]['host']+_0x0b00('0x42')+_0xccf004+'\x0a\x0a'+_0x0b00('0x43')});})[_0x0b00('0xe')](function(){_0x5966d6[_0x0b00('0x2d')](0xc8)[_0x0b00('0x44')]({'message':'Reset\x20Email\x20sent!'});})[_0x0b00('0x1e')](function(_0x326f5f){return handleError(_0x5966d6,0x1f4,_0x326f5f);});};exports['reset']=function(_0x2251c6,_0x549ed6){return db['User']['find']({'where':{'resetPasswordToken':_0x2251c6[_0x0b00('0x45')][_0x0b00('0x46')],'resetPasswordExpires':{'$gt':Date[_0x0b00('0x3e')]()}}})[_0x0b00('0xe')](function(_0x2b3a94){if(!_0x2b3a94){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x0b00('0xa')][_0x0b00('0xb')]({'attributes':['id',_0x0b00('0x47'),_0x0b00('0x48'),_0x0b00('0x49')]})[_0x0b00('0xe')](function(_0x19e0a4){if(_0x19e0a4[_0x0b00('0x47')])authService[_0x0b00('0x4a')](_0x2251c6[_0x0b00('0x35')][_0x0b00('0x10')]);if(!_0x19e0a4[_0x0b00('0x48')]||!_0x2b3a94[_0x0b00('0x4b')])return _0x2b3a94;authService[_0x0b00('0x4c')](_0x2251c6[_0x0b00('0x35')][_0x0b00('0x10')],_0x2b3a94['previousPasswords'],_0x19e0a4['passwordHistoryLimit']);return _0x2b3a94;})[_0x0b00('0xe')](function(){_0x2b3a94[_0x0b00('0x10')]=_0x2251c6[_0x0b00('0x35')]['password'];_0x2b3a94[_0x0b00('0x3c')]=null;_0x2b3a94['resetPasswordExpires']=null;return _0x2b3a94['save']();});})[_0x0b00('0xe')](function(){_0x549ed6[_0x0b00('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x0b00('0x1e')](function(_0x15ea94){return handleError(_0x549ed6,0x1f4,_0x15ea94);});};passport[_0x0b00('0x4d')](_0x0b00('0x2f'),new LocalStrategy({'usernameField':_0x0b00('0xf'),'passwordField':_0x0b00('0x10')},function(_0x279bc7,_0x157bc2,_0x331b53){return localAuthenticate(db[_0x0b00('0x4e')],_0x279bc7,_0x157bc2,_0x331b53);}));
\ No newline at end of file
+var _0x9795=['MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../components/auth/service','client','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','allowedLoginAttempts','add','clearBlockUser','catch'];(function(_0x2331f4,_0xe518c3){var _0x224d15=function(_0xa917c5){while(--_0xa917c5){_0x2331f4['push'](_0x2331f4['shift']());}};_0x224d15(++_0xe518c3);}(_0x9795,0x157));var _0x5979=function(_0x46344e,_0x516028){_0x46344e=_0x46344e-0x0;var _0x42a4f5=_0x9795[_0x46344e];return _0x42a4f5;};'use strict';var util=require(_0x5979('0x0'));var passport=require(_0x5979('0x1'));var LocalStrategy=require(_0x5979('0x2'))[_0x5979('0x3')];var jayson=require(_0x5979('0x4'));var _=require('lodash');var rs=require(_0x5979('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x5979('0x6'));var utils=require('../../config/utils');var client=jayson[_0x5979('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x2d74c9,_0xabd45a,_0x505829,_0x33b227){var _0x2bb3cd,_0x341f98;return db[_0x5979('0x8')][_0x5979('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5979('0xa')],'raw':!![]})['then'](function(_0x5d389e){_0x2bb3cd=_0x5d389e;return _0x2d74c9['findOne']({'attributes':['id',_0x5979('0xb'),_0x5979('0xc'),_0x5979('0xd'),_0x5979('0xe'),_0x5979('0xf'),_0x5979('0x10'),_0x5979('0x11'),_0x5979('0x12')],'where':{'name':_0xabd45a,'role':{'$or':['admin','user',_0x5979('0x13')]}}});})['then'](function(_0x15497e){if(!_0x15497e||_0x15497e&&_0x15497e['name']!==_0xabd45a){throw new Error(_0x5979('0x14'));}else{_0x341f98=_0x15497e;return _0x341f98;}})[_0x5979('0x15')](function(){_0x341f98[_0x5979('0x16')](_0x505829,function(_0x466f73,_0x6243ed){var _0x41275b=_0x341f98[_0x5979('0x12')]+0x1;if(_0x466f73){return _0x33b227(_0x466f73);}else if(!_0x6243ed){if(_0x341f98[_0x5979('0xf')]){return _0x33b227(null,![],{'message':_0x5979('0x14')});}else if(_0x2bb3cd['allowedLoginAttempts']>0x0){if(_0x341f98[_0x5979('0x10')]){if(_0x2bb3cd[_0x5979('0xa')]>0x0){if(moment(_0x341f98[_0x5979('0x11')])['add'](_0x2bb3cd[_0x5979('0xa')],'minutes')>moment()){return _0x33b227(null,![],{'message':_0x5979('0x14')});}else{return utils['clearBlockUser'](_0x341f98,_0x41275b,![],null)[_0x5979('0x15')](function(){return _0x33b227(null,![],{'message':_0x5979('0x14')});});}}else{return _0x33b227(null,![],{'message':_0x5979('0x14')});}}else{if(_0x41275b>=_0x2bb3cd[_0x5979('0x17')]){return utils['clearBlockUser'](_0x341f98,0x0,!![],moment())[_0x5979('0x15')](function(){return _0x33b227(null,![],{'message':_0x5979('0x14')});});}else{return utils['clearBlockUser'](_0x341f98,_0x41275b,![],null)[_0x5979('0x15')](function(){return _0x33b227(null,![],{'message':_0x5979('0x14')});});}}}else{return _0x33b227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x341f98['disabled']){return _0x33b227(null,![],{'message':_0x5979('0x14')});}else if(_0x2bb3cd[_0x5979('0x17')]>0x0){if(_0x341f98['blocked']){if(_0x2bb3cd[_0x5979('0xa')]>0x0){if(moment(_0x341f98[_0x5979('0x11')])[_0x5979('0x18')](_0x2bb3cd['blockDuration'],'minutes')>moment()){return _0x33b227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5979('0x19')](_0x341f98,0x0,![],null)['then'](function(){return utils['getLicense'](_0x341f98);})[_0x5979('0x15')](function(){return _0x33b227(null,_0x341f98);});}}else{return _0x33b227(null,![],{'message':_0x5979('0x14')});}}else{return utils[_0x5979('0x19')](_0x341f98,0x0,![],null)[_0x5979('0x15')](function(){return utils['getLicense'](_0x341f98);})[_0x5979('0x15')](function(){return _0x33b227(null,_0x341f98);})[_0x5979('0x1a')](function(_0x514b51){return _0x33b227(null,![],_0x514b51);});}}else{if(_0x341f98[_0x5979('0x10')]){return _0x33b227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x341f98)[_0x5979('0x15')](function(){return _0x33b227(null,_0x341f98);});}}}});})['catch'](function(_0x1478b7){return _0x33b227(null,![],_0x1478b7);});}function sendServiceMail(_0x5c0d5f){return db[_0x5979('0x1b')]['find']({'where':{'service':!![]},'attributes':['id',_0x5979('0xb'),_0x5979('0x1c')],'include':[{'model':db[_0x5979('0x1d')],'as':_0x5979('0x1e'),'include':[{'model':db[_0x5979('0x1f')],'as':_0x5979('0x1f')}]}]})[_0x5979('0x15')](function(_0x9b3932){if(!_0x9b3932){throw new Error(_0x5979('0x20'));}var _0x1adf1a=_0x9b3932[_0x5979('0x21')]();var _0x30421e={'account':_0x1adf1a,'message':_['merge']({'from':util[_0x5979('0x22')](_0x5979('0x23'),_0x9b3932[_0x5979('0xb')],_0x9b3932[_0x5979('0x1c')]||_0x9b3932[_0x5979('0x1e')][_0x5979('0x24')])},_0x5c0d5f)};return client[_0x5979('0x25')](_0x5979('0x26'),_0x30421e);})['then'](function(_0x3e06c0){if(_0x3e06c0[_0x5979('0x27')]){throw new Error(util[_0x5979('0x22')](_0x5979('0x28'),_0x3e06c0[_0x5979('0x27')]['message']||JSON[_0x5979('0x29')](_0x3e06c0[_0x5979('0x27')])));}return!![];});}function handleError(_0x4539b7,_0x449259,_0x3b9958){return _0x4539b7[_0x5979('0x2a')](_0x449259||0x1f4)[_0x5979('0x2b')]({'message':_0x3b9958?_0x3b9958[_0x5979('0x2c')]||_0x3b9958:''});}exports[_0x5979('0x2d')]=function(_0x539525,_0x42b317,_0x560fa3){passport[_0x5979('0x16')]('local-login',function(_0x452ba7,_0x1a9497,_0x24f00b){var _0x5c7203=_0x452ba7||_0x24f00b;if(_0x5c7203){return handleError(_0x42b317,0x191,_0x5c7203);}if(!_0x1a9497){return handleError(_0x42b317,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4443ac={'payload':{'id':_0x1a9497['id'],'role':_0x1a9497[_0x5979('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4443ac)[_0x5979('0x15')](function(_0x2935b6){_0x42b317[_0x5979('0x2e')]({'id':_0x1a9497['id'],'token':_0x2935b6,'statusCall':'','isAlreadyLogged':_0x1a9497[_0x5979('0x2f')]});});}})(_0x539525,_0x42b317,_0x560fa3);};exports[_0x5979('0x30')]=function(_0x36d130,_0x23e1d0){if(!_0x36d130['body']['email']){return handleError(_0x23e1d0,0x1f4,{'message':_0x5979('0x31')});}var _0xc72589=rs[_0x5979('0x32')]();_0x36d130['body']['email']=_0x36d130[_0x5979('0x33')][_0x5979('0x1c')]['trim']()[_0x5979('0x34')]();var _0x1eb186;return db[_0x5979('0x8')][_0x5979('0x9')]({'where':{'id':0x1},'attributes':[_0x5979('0x17'),_0x5979('0xa')],'raw':!![]})[_0x5979('0x15')](function(_0x8838b1){_0x1eb186=_0x8838b1;return db[_0x5979('0x35')][_0x5979('0x36')]({'where':{'email':_0x36d130[_0x5979('0x33')][_0x5979('0x1c')]}});})['then'](function(_0x54106f){if(!_0x54106f){throw new Error(_0x5979('0x37'));}if(_0x54106f[_0x5979('0xf')]){throw new Error(_0x5979('0x38'));}if(_0x54106f[_0x5979('0x10')]){if(moment(_0x54106f['blockedAt'])[_0x5979('0x18')](_0x1eb186['blockDuration'],_0x5979('0x39'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x54106f['blocked']=![];_0x54106f['blockedAt']=null;}}_0x54106f[_0x5979('0x3a')]=_0xc72589;_0x54106f[_0x5979('0x3b')]=Date['now']()+0x36ee80;return _0x54106f[_0x5979('0x3c')]();})[_0x5979('0x15')](function(){return sendServiceMail({'to':_0x36d130[_0x5979('0x33')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5979('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x36d130[_0x5979('0x3e')]['host']+_0x5979('0x3f')+_0xc72589+'\x0a\x0a'+_0x5979('0x40')});})[_0x5979('0x15')](function(){_0x23e1d0['status'](0xc8)[_0x5979('0x2b')]({'message':'Reset\x20Email\x20sent!'});})[_0x5979('0x1a')](function(_0x314691){return handleError(_0x23e1d0,0x1f4,_0x314691);});};exports[_0x5979('0x41')]=function(_0x46a5be,_0x532883){return db[_0x5979('0x35')][_0x5979('0x36')]({'where':{'resetPasswordToken':_0x46a5be[_0x5979('0x42')][_0x5979('0x43')],'resetPasswordExpires':{'$gt':Date[_0x5979('0x44')]()}}})[_0x5979('0x15')](function(_0x27ea76){if(!_0x27ea76){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x5979('0x9')]({'attributes':['id',_0x5979('0x45'),_0x5979('0x46'),_0x5979('0x47')]})['then'](function(_0x571d44){if(_0x571d44[_0x5979('0x45')])authService['validatePasswordPattern'](_0x46a5be[_0x5979('0x33')][_0x5979('0xc')]);if(!_0x571d44['enforcePasswordHistory']||!_0x27ea76['previousPasswords'])return _0x27ea76;authService['validatePasswordHistory'](_0x46a5be[_0x5979('0x33')][_0x5979('0xc')],_0x27ea76['previousPasswords'],_0x571d44[_0x5979('0x47')]);return _0x27ea76;})[_0x5979('0x15')](function(){_0x27ea76[_0x5979('0xc')]=_0x46a5be[_0x5979('0x33')]['password'];_0x27ea76[_0x5979('0x3a')]=null;_0x27ea76[_0x5979('0x3b')]=null;return _0x27ea76[_0x5979('0x3c')]();});})[_0x5979('0x15')](function(){_0x532883[_0x5979('0x2a')](0xc8)[_0x5979('0x2b')]({'message':'Password\x20reset!'});})[_0x5979('0x1a')](function(_0x5ef745){return handleError(_0x532883,0x1f4,_0x5ef745);});};passport[_0x5979('0x48')](_0x5979('0x49'),new LocalStrategy({'usernameField':_0x5979('0xb'),'passwordField':_0x5979('0xc')},function(_0x324610,_0x8649c4,_0x4edec4){return localAuthenticate(db[_0x5979('0x35')],_0x324610,_0x8649c4,_0x4edec4);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index fbb54cd..9825d85 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 _0x77d8=['/forgot','/reset/:token','exports','express','post','login'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x77d8,0x135));var _0x877d=function(_0x2c7f80,_0x5da68e){_0x2c7f80=_0x2c7f80-0x0;var _0x413d06=_0x77d8[_0x2c7f80];return _0x413d06;};'use strict';var express=require(_0x877d('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x877d('0x1')]('/',controller[_0x877d('0x2')]);router[_0x877d('0x1')](_0x877d('0x3'),controller['forgot']);router[_0x877d('0x1')](_0x877d('0x4'),controller['reset']);module[_0x877d('0x5')]=router;
\ No newline at end of file
+var _0xc115=['post','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller'];(function(_0x13e77a,_0xadf480){var _0x499845=function(_0x55cd3c){while(--_0x55cd3c){_0x13e77a['push'](_0x13e77a['shift']());}};_0x499845(++_0xadf480);}(_0xc115,0x145));var _0x5c11=function(_0x57a60f,_0x410a3a){_0x57a60f=_0x57a60f-0x0;var _0x19cfe3=_0xc115[_0x57a60f];return _0x19cfe3;};'use strict';var express=require(_0x5c11('0x0'));var router=express[_0x5c11('0x1')]();var controller=require(_0x5c11('0x2'));router[_0x5c11('0x3')]('/',controller['login']);router['post'](_0x5c11('0x4'),controller[_0x5c11('0x5')]);router[_0x5c11('0x3')](_0x5c11('0x6'),controller[_0x5c11('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 062ef8c..36c63d6 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 _0x3f3f=['INTEGER','exports','STRING'];(function(_0x9ac163,_0x29590d){var _0x3e550d=function(_0x2d938a){while(--_0x2d938a){_0x9ac163['push'](_0x9ac163['shift']());}};_0x3e550d(++_0x29590d);}(_0x3f3f,0xd9));var _0xf3f3=function(_0x549ffa,_0x4011d9){_0x549ffa=_0x549ffa-0x0;var _0x378324=_0x3f3f[_0x549ffa];return _0x378324;};'use strict';var Sequelize=require('sequelize');module[_0xf3f3('0x0')]={'name':{'type':Sequelize[_0xf3f3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xf3f3('0x1')]},'description':{'type':Sequelize[_0xf3f3('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf3f3('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa2b8=['INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2b8,0x177));var _0x8a2b=function(_0x5338dc,_0x529f8f){_0x5338dc=_0x5338dc-0x0;var _0x3b1f77=_0xa2b8[_0x5338dc];return _0x3b1f77;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a2b('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x8a2b('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8a2b('0x1')],'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 e817495..13af6ab 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 _0x1b7a=['apply','reject','save','update','then','error','stack','name','send','index','map','Automation','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','getActions','order','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','Content-Range','json'];(function(_0x183481,_0x26400f){var _0x421f0a=function(_0xa1ded3){while(--_0xa1ded3){_0x183481['push'](_0x183481['shift']());}};_0x421f0a(++_0x26400f);}(_0x1b7a,0x88));var _0xa1b7=function(_0xadd0ce,_0x1d8ca4){_0xadd0ce=_0xadd0ce-0x0;var _0x5b5ff4=_0x1b7a[_0xadd0ce];return _0x5b5ff4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1b7('0x0'));var zipdir=require(_0xa1b7('0x1'));var jsonpatch=require(_0xa1b7('0x2'));var rp=require('request-promise');var moment=require(_0xa1b7('0x3'));var BPromise=require(_0xa1b7('0x4'));var Mustache=require(_0xa1b7('0x5'));var util=require(_0xa1b7('0x6'));var path=require(_0xa1b7('0x7'));var sox=require(_0xa1b7('0x8'));var csv=require(_0xa1b7('0x9'));var ejs=require(_0xa1b7('0xa'));var fs=require('fs');var fs_extra=require(_0xa1b7('0xb'));var _=require(_0xa1b7('0xc'));var squel=require(_0xa1b7('0xd'));var crypto=require('crypto');var jsforce=require(_0xa1b7('0xe'));var deskjs=require(_0xa1b7('0xf'));var toCsv=require(_0xa1b7('0x9'));var querystring=require('querystring');var Papa=require(_0xa1b7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa1b7('0x11'));var as=require(_0xa1b7('0x12'));var hardwareService=require(_0xa1b7('0x13'));var logger=require(_0xa1b7('0x14'))(_0xa1b7('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1b7('0x16'));var db=require(_0xa1b7('0x17'))['db'];function respondWithStatusCode(_0xbb4851,_0x365c61){_0x365c61=_0x365c61||0xcc;return function(_0x59bb84){if(_0x59bb84){return _0xbb4851[_0xa1b7('0x18')](_0x365c61);}return _0xbb4851[_0xa1b7('0x19')](_0x365c61)[_0xa1b7('0x1a')]();};}function respondWithResult(_0x6f7613,_0x2f5c7f){_0x2f5c7f=_0x2f5c7f||0xc8;return function(_0xdaaef7){if(_0xdaaef7){return _0x6f7613[_0xa1b7('0x19')](_0x2f5c7f)['json'](_0xdaaef7);}};}function respondWithFilteredResult(_0x47b547,_0x2a40fd){return function(_0x1ff511){if(_0x1ff511){var _0x4042dd=typeof _0x2a40fd['offset']==='undefined'&&typeof _0x2a40fd[_0xa1b7('0x1b')]==='undefined';var _0xfd8cf5=_0x1ff511[_0xa1b7('0x1c')];var _0x5c0486=_0x4042dd?0x0:_0x2a40fd[_0xa1b7('0x1d')];var _0x43b5f4=_0x4042dd?_0x1ff511[_0xa1b7('0x1c')]:_0x2a40fd[_0xa1b7('0x1d')]+_0x2a40fd[_0xa1b7('0x1b')];var _0x1e0017;if(_0x43b5f4>=_0xfd8cf5){_0x43b5f4=_0xfd8cf5;_0x1e0017=0xc8;}else{_0x1e0017=0xce;}_0x47b547['status'](_0x1e0017);return _0x47b547['set'](_0xa1b7('0x1e'),_0x5c0486+'-'+_0x43b5f4+'/'+_0xfd8cf5)[_0xa1b7('0x1f')](_0x1ff511);}return null;};}function patchUpdates(_0x538db4){return function(_0x1a0c8f){try{jsonpatch[_0xa1b7('0x20')](_0x1a0c8f,_0x538db4,!![]);}catch(_0x525646){return BPromise[_0xa1b7('0x21')](_0x525646);}return _0x1a0c8f[_0xa1b7('0x22')]();};}function saveUpdates(_0x371098,_0x8e9215){return function(_0x355fc8){if(_0x355fc8){return _0x355fc8[_0xa1b7('0x23')](_0x371098)[_0xa1b7('0x24')](function(_0x5b260e){return _0x5b260e;});}return null;};}function removeEntity(_0x415ad6,_0xefb96d){return function(_0x2adcd7){if(_0x2adcd7){return _0x2adcd7['destroy']()['then'](function(){_0x415ad6[_0xa1b7('0x19')](0xcc)[_0xa1b7('0x1a')]();});}};}function handleEntityNotFound(_0x3a510e,_0x1cb0a5){return function(_0x1739bf){if(!_0x1739bf){_0x3a510e[_0xa1b7('0x18')](0x194);}return _0x1739bf;};}function handleError(_0x441b6f,_0x30b34d){_0x30b34d=_0x30b34d||0x1f4;return function(_0x55d2e4){logger[_0xa1b7('0x25')](_0x55d2e4[_0xa1b7('0x26')]);if(_0x55d2e4[_0xa1b7('0x27')]){delete _0x55d2e4[_0xa1b7('0x27')];}_0x441b6f[_0xa1b7('0x19')](_0x30b34d)[_0xa1b7('0x28')](_0x55d2e4);};}exports[_0xa1b7('0x29')]=function(_0x157523,_0x47ce3a){var _0x20ac8b={},_0xc2486c={},_0x160593={'count':0x0,'rows':[]};var _0x595da9=_[_0xa1b7('0x2a')](db[_0xa1b7('0x2b')]['rawAttributes'],function(_0x1d3dbc){return{'name':_0x1d3dbc['fieldName'],'type':_0x1d3dbc['type'][_0xa1b7('0x2c')]};});_0xc2486c['model']=_[_0xa1b7('0x2a')](_0x595da9,_0xa1b7('0x27'));_0xc2486c[_0xa1b7('0x2d')]=_['keys'](_0x157523[_0xa1b7('0x2d')]);_0xc2486c[_0xa1b7('0x2e')]=_[_0xa1b7('0x2f')](_0xc2486c[_0xa1b7('0x30')],_0xc2486c['query']);_0x20ac8b[_0xa1b7('0x31')]=_[_0xa1b7('0x2f')](_0xc2486c['model'],qs[_0xa1b7('0x32')](_0x157523[_0xa1b7('0x2d')][_0xa1b7('0x32')]));_0x20ac8b[_0xa1b7('0x31')]=_0x20ac8b[_0xa1b7('0x31')][_0xa1b7('0x33')]?_0x20ac8b[_0xa1b7('0x31')]:_0xc2486c[_0xa1b7('0x30')];if(!_0x157523[_0xa1b7('0x2d')][_0xa1b7('0x34')](_0xa1b7('0x35'))){_0x20ac8b[_0xa1b7('0x1b')]=qs[_0xa1b7('0x1b')](_0x157523['query'][_0xa1b7('0x1b')]);_0x20ac8b[_0xa1b7('0x1d')]=qs[_0xa1b7('0x1d')](_0x157523['query'][_0xa1b7('0x1d')]);}_0x20ac8b['order']=qs[_0xa1b7('0x36')](_0x157523[_0xa1b7('0x2d')][_0xa1b7('0x36')]);_0x20ac8b['where']=qs['filters'](_[_0xa1b7('0x37')](_0x157523[_0xa1b7('0x2d')],_0xc2486c[_0xa1b7('0x2e')]),_0x595da9);if(_0x157523['query'][_0xa1b7('0x38')]){_0x20ac8b[_0xa1b7('0x39')]=_[_0xa1b7('0x3a')](_0x20ac8b['where'],{'$or':_[_0xa1b7('0x2a')](_0x595da9,function(_0x3ac558){if(_0x3ac558[_0xa1b7('0x3b')]!==_0xa1b7('0x3c')){var _0x5c9c15={};_0x5c9c15[_0x3ac558[_0xa1b7('0x27')]]={'$like':'%'+_0x157523[_0xa1b7('0x2d')][_0xa1b7('0x38')]+'%'};return _0x5c9c15;}})});}_0x20ac8b=_[_0xa1b7('0x3a')]({},_0x20ac8b,_0x157523['options']);var _0x5abe9a={'where':_0x20ac8b[_0xa1b7('0x39')]};return db[_0xa1b7('0x2b')]['count'](_0x5abe9a)[_0xa1b7('0x24')](function(_0x33c9cb){_0x160593[_0xa1b7('0x1c')]=_0x33c9cb;if(_0x157523[_0xa1b7('0x2d')][_0xa1b7('0x3d')]){_0x20ac8b[_0xa1b7('0x3e')]=[{'all':!![]}];}return db[_0xa1b7('0x2b')][_0xa1b7('0x3f')](_0x20ac8b);})['then'](function(_0xd20c24){_0x160593[_0xa1b7('0x40')]=_0xd20c24;return _0x160593;})[_0xa1b7('0x24')](respondWithFilteredResult(_0x47ce3a,_0x20ac8b))[_0xa1b7('0x41')](handleError(_0x47ce3a,null));};exports[_0xa1b7('0x42')]=function(_0x326b5f,_0x53ecdf){var _0x266dbc={'raw':![],'where':{'id':_0x326b5f[_0xa1b7('0x43')]['id']}},_0x58d31d={};_0x58d31d[_0xa1b7('0x30')]=_[_0xa1b7('0x44')](db[_0xa1b7('0x2b')][_0xa1b7('0x45')]);_0x58d31d['query']=_['keys'](_0x326b5f['query']);_0x58d31d[_0xa1b7('0x2e')]=_[_0xa1b7('0x2f')](_0x58d31d['model'],_0x58d31d['query']);_0x266dbc['attributes']=_[_0xa1b7('0x2f')](_0x58d31d[_0xa1b7('0x30')],qs[_0xa1b7('0x32')](_0x326b5f['query'][_0xa1b7('0x32')]));_0x266dbc[_0xa1b7('0x31')]=_0x266dbc[_0xa1b7('0x31')][_0xa1b7('0x33')]?_0x266dbc[_0xa1b7('0x31')]:_0x58d31d[_0xa1b7('0x30')];if(_0x326b5f[_0xa1b7('0x2d')]['includeAll']){_0x266dbc[_0xa1b7('0x3e')]=[{'all':!![]}];}_0x266dbc=_[_0xa1b7('0x3a')]({},_0x266dbc,_0x326b5f[_0xa1b7('0x46')]);return db[_0xa1b7('0x2b')][_0xa1b7('0x47')](_0x266dbc)[_0xa1b7('0x24')](handleEntityNotFound(_0x53ecdf,null))[_0xa1b7('0x24')](respondWithResult(_0x53ecdf,null))[_0xa1b7('0x41')](handleError(_0x53ecdf,null));};exports[_0xa1b7('0x48')]=function(_0x44fab6,_0x43e8c0){return db[_0xa1b7('0x2b')][_0xa1b7('0x48')](_0x44fab6[_0xa1b7('0x49')],{})[_0xa1b7('0x24')](respondWithResult(_0x43e8c0,0xc9))[_0xa1b7('0x41')](handleError(_0x43e8c0,null));};exports['update']=function(_0x2abf5b,_0x26183f){if(_0x2abf5b[_0xa1b7('0x49')]['id']){delete _0x2abf5b[_0xa1b7('0x49')]['id'];}return db[_0xa1b7('0x2b')]['find']({'where':{'id':_0x2abf5b[_0xa1b7('0x43')]['id']}})[_0xa1b7('0x24')](handleEntityNotFound(_0x26183f,null))[_0xa1b7('0x24')](saveUpdates(_0x2abf5b['body'],null))[_0xa1b7('0x24')](respondWithResult(_0x26183f,null))['catch'](handleError(_0x26183f,null));};exports['destroy']=function(_0x569631,_0x172302){return db['Automation'][_0xa1b7('0x47')]({'where':{'id':_0x569631[_0xa1b7('0x43')]['id']}})[_0xa1b7('0x24')](handleEntityNotFound(_0x172302,null))[_0xa1b7('0x24')](removeEntity(_0x172302,null))['catch'](handleError(_0x172302,null));};exports[_0xa1b7('0x4a')]=function(_0x29a6e1,_0x508d5e,_0xf06a3d){return db[_0xa1b7('0x4b')][_0xa1b7('0x47')]({'where':{'id':_0x29a6e1[_0xa1b7('0x43')]['id']}})[_0xa1b7('0x24')](handleEntityNotFound(_0x508d5e,null))['then'](function(_0x47cbd6){if(_0x47cbd6){return _0x47cbd6[_0xa1b7('0x4a')](_0x29a6e1[_0xa1b7('0x49')]['ids'],_[_0xa1b7('0x4c')](_0x29a6e1[_0xa1b7('0x49')],[_0xa1b7('0x4d'),'id'])||{});}})[_0xa1b7('0x24')](respondWithResult(_0x508d5e,null))[_0xa1b7('0x41')](handleError(_0x508d5e,null));};exports[_0xa1b7('0x4e')]=function(_0x47f28e,_0x225dc7,_0x1512c2){var _0x15d9e9={};var _0x424105={};var _0x58cf75;var _0x1ec2ce;return db[_0xa1b7('0x2b')][_0xa1b7('0x4f')]({'where':{'id':_0x47f28e[_0xa1b7('0x43')]['id']}})[_0xa1b7('0x24')](handleEntityNotFound(_0x225dc7,null))[_0xa1b7('0x24')](function(_0x1f8e08){if(_0x1f8e08){_0x58cf75=_0x1f8e08;_0x424105[_0xa1b7('0x30')]=_[_0xa1b7('0x44')](db[_0xa1b7('0x4b')][_0xa1b7('0x45')]);_0x424105[_0xa1b7('0x2d')]=_['keys'](_0x47f28e['query']);_0x424105['filters']=_[_0xa1b7('0x2f')](_0x424105[_0xa1b7('0x30')],_0x424105[_0xa1b7('0x2d')]);_0x15d9e9[_0xa1b7('0x31')]=_[_0xa1b7('0x2f')](_0x424105[_0xa1b7('0x30')],qs['fields'](_0x47f28e[_0xa1b7('0x2d')][_0xa1b7('0x32')]));_0x15d9e9[_0xa1b7('0x31')]=_0x15d9e9[_0xa1b7('0x31')]['length']?_0x15d9e9[_0xa1b7('0x31')]:_0x424105[_0xa1b7('0x30')];_0x15d9e9['order']=qs[_0xa1b7('0x36')](_0x47f28e[_0xa1b7('0x2d')]['sort']);_0x15d9e9[_0xa1b7('0x39')]=qs[_0xa1b7('0x2e')](_[_0xa1b7('0x37')](_0x47f28e[_0xa1b7('0x2d')],_0x424105['filters']));if(_0x47f28e[_0xa1b7('0x2d')]['filter']){_0x15d9e9[_0xa1b7('0x39')]=_[_0xa1b7('0x3a')](_0x15d9e9[_0xa1b7('0x39')],{'$or':_['map'](_0x15d9e9[_0xa1b7('0x31')],function(_0xc2eb68){var _0x250777={};_0x250777[_0xc2eb68]={'$like':'%'+_0x47f28e[_0xa1b7('0x2d')]['filter']+'%'};return _0x250777;})});}_0x15d9e9=_[_0xa1b7('0x3a')]({},_0x15d9e9,_0x47f28e[_0xa1b7('0x46')]);return _0x58cf75[_0xa1b7('0x4e')](_0x15d9e9);}})[_0xa1b7('0x24')](function(_0x4d32d4){if(_0x4d32d4){_0x1ec2ce=_0x4d32d4[_0xa1b7('0x33')];if(!_0x47f28e[_0xa1b7('0x2d')]['hasOwnProperty']('nolimit')){_0x15d9e9[_0xa1b7('0x1b')]=qs[_0xa1b7('0x1b')](_0x47f28e[_0xa1b7('0x2d')][_0xa1b7('0x1b')]);_0x15d9e9['offset']=qs[_0xa1b7('0x1d')](_0x47f28e[_0xa1b7('0x2d')][_0xa1b7('0x1d')]);}return _0x58cf75[_0xa1b7('0x4e')](_0x15d9e9);}})[_0xa1b7('0x24')](function(_0x381118){if(_0x381118){return _0x381118?{'count':_0x1ec2ce,'rows':_0x381118}:null;}})[_0xa1b7('0x24')](respondWithResult(_0x225dc7,null))[_0xa1b7('0x41')](handleError(_0x225dc7,null));};exports[_0xa1b7('0x50')]=function(_0xeffb45,_0x153d11,_0x465475){return db[_0xa1b7('0x51')][_0xa1b7('0x47')]({'where':{'id':_0xeffb45[_0xa1b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x153d11,null))[_0xa1b7('0x24')](function(_0x53d57d){if(_0x53d57d){return _0x53d57d[_0xa1b7('0x50')](_0xeffb45[_0xa1b7('0x49')]['ids'],_[_0xa1b7('0x4c')](_0xeffb45[_0xa1b7('0x49')],[_0xa1b7('0x4d'),'id'])||{});}})[_0xa1b7('0x24')](respondWithResult(_0x153d11,null))[_0xa1b7('0x41')](handleError(_0x153d11,null));};exports[_0xa1b7('0x52')]=function(_0x11d71b,_0x2869ac,_0x5c5b3e){var _0x131910={};var _0x1d399f={};var _0xeaa5e9;var _0x4d07bc;return db['Automation'][_0xa1b7('0x4f')]({'where':{'id':_0x11d71b[_0xa1b7('0x43')]['id']}})[_0xa1b7('0x24')](handleEntityNotFound(_0x2869ac,null))['then'](function(_0x29454d){if(_0x29454d){_0xeaa5e9=_0x29454d;_0x1d399f[_0xa1b7('0x30')]=_[_0xa1b7('0x44')](db['Action'][_0xa1b7('0x45')]);_0x1d399f[_0xa1b7('0x2d')]=_[_0xa1b7('0x44')](_0x11d71b['query']);_0x1d399f[_0xa1b7('0x2e')]=_[_0xa1b7('0x2f')](_0x1d399f['model'],_0x1d399f[_0xa1b7('0x2d')]);_0x131910[_0xa1b7('0x31')]=_[_0xa1b7('0x2f')](_0x1d399f['model'],qs['fields'](_0x11d71b[_0xa1b7('0x2d')][_0xa1b7('0x32')]));_0x131910['attributes']=_0x131910[_0xa1b7('0x31')][_0xa1b7('0x33')]?_0x131910[_0xa1b7('0x31')]:_0x1d399f[_0xa1b7('0x30')];_0x131910[_0xa1b7('0x53')]=qs['sort'](_0x11d71b['query'][_0xa1b7('0x36')]);_0x131910[_0xa1b7('0x39')]=qs[_0xa1b7('0x2e')](_['pick'](_0x11d71b['query'],_0x1d399f['filters']));if(_0x11d71b[_0xa1b7('0x2d')][_0xa1b7('0x38')]){_0x131910[_0xa1b7('0x39')]=_[_0xa1b7('0x3a')](_0x131910[_0xa1b7('0x39')],{'$or':_['map'](_0x131910[_0xa1b7('0x31')],function(_0x48a8c2){var _0x52e4ca={};_0x52e4ca[_0x48a8c2]={'$like':'%'+_0x11d71b[_0xa1b7('0x2d')][_0xa1b7('0x38')]+'%'};return _0x52e4ca;})});}_0x131910=_[_0xa1b7('0x3a')]({},_0x131910,_0x11d71b[_0xa1b7('0x46')]);return _0xeaa5e9['getActions'](_0x131910);}})[_0xa1b7('0x24')](function(_0x3fea57){if(_0x3fea57){_0x4d07bc=_0x3fea57[_0xa1b7('0x33')];if(!_0x11d71b['query']['hasOwnProperty'](_0xa1b7('0x35'))){_0x131910[_0xa1b7('0x1b')]=qs['limit'](_0x11d71b[_0xa1b7('0x2d')][_0xa1b7('0x1b')]);_0x131910[_0xa1b7('0x1d')]=qs[_0xa1b7('0x1d')](_0x11d71b['query'][_0xa1b7('0x1d')]);}return _0xeaa5e9[_0xa1b7('0x52')](_0x131910);}})[_0xa1b7('0x24')](function(_0xb35e67){if(_0xb35e67){return _0xb35e67?{'count':_0x4d07bc,'rows':_0xb35e67}:null;}})[_0xa1b7('0x24')](respondWithResult(_0x2869ac,null))[_0xa1b7('0x41')](handleError(_0x2869ac,null));};
\ No newline at end of file
+var _0x44bd=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','apply','reject','save','update','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','findAll','rows','catch','params','includeAll','include','find','create','body','destroy','addConditions','Condition','omit','ids','getConditions','findOne','pick','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44bd,0x143));var _0xd44b=function(_0x4ae83e,_0x518979){_0x4ae83e=_0x4ae83e-0x0;var _0x5add5e=_0x44bd[_0x4ae83e];return _0x5add5e;};'use strict';var emlformat=require(_0xd44b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd44b('0x1'));var jsonpatch=require(_0xd44b('0x2'));var rp=require(_0xd44b('0x3'));var moment=require(_0xd44b('0x4'));var BPromise=require(_0xd44b('0x5'));var Mustache=require(_0xd44b('0x6'));var util=require('util');var path=require(_0xd44b('0x7'));var sox=require(_0xd44b('0x8'));var csv=require(_0xd44b('0x9'));var ejs=require(_0xd44b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd44b('0xb'));var squel=require(_0xd44b('0xc'));var crypto=require('crypto');var jsforce=require(_0xd44b('0xd'));var deskjs=require(_0xd44b('0xe'));var toCsv=require(_0xd44b('0x9'));var querystring=require(_0xd44b('0xf'));var Papa=require(_0xd44b('0x10'));var Redis=require(_0xd44b('0x11'));var authService=require(_0xd44b('0x12'));var qs=require(_0xd44b('0x13'));var as=require(_0xd44b('0x14'));var hardwareService=require(_0xd44b('0x15'));var logger=require(_0xd44b('0x16'))(_0xd44b('0x17'));var utils=require('../../config/utils');var config=require(_0xd44b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd44b('0x19'))['db'];function respondWithStatusCode(_0x4176dd,_0x43a0b9){_0x43a0b9=_0x43a0b9||0xcc;return function(_0x2980c9){if(_0x2980c9){return _0x4176dd[_0xd44b('0x1a')](_0x43a0b9);}return _0x4176dd['status'](_0x43a0b9)['end']();};}function respondWithResult(_0x37e371,_0x49645e){_0x49645e=_0x49645e||0xc8;return function(_0x41a7dc){if(_0x41a7dc){return _0x37e371[_0xd44b('0x1b')](_0x49645e)[_0xd44b('0x1c')](_0x41a7dc);}};}function respondWithFilteredResult(_0x3e1044,_0x2e2a67){return function(_0x5d7ff3){if(_0x5d7ff3){var _0x5e6d8b=typeof _0x2e2a67[_0xd44b('0x1d')]==='undefined'&&typeof _0x2e2a67[_0xd44b('0x1e')]===_0xd44b('0x1f');var _0x51402e=_0x5d7ff3['count'];var _0x12c86c=_0x5e6d8b?0x0:_0x2e2a67[_0xd44b('0x1d')];var _0x9fd116=_0x5e6d8b?_0x5d7ff3['count']:_0x2e2a67[_0xd44b('0x1d')]+_0x2e2a67[_0xd44b('0x1e')];var _0x48422d;if(_0x9fd116>=_0x51402e){_0x9fd116=_0x51402e;_0x48422d=0xc8;}else{_0x48422d=0xce;}_0x3e1044[_0xd44b('0x1b')](_0x48422d);return _0x3e1044['set']('Content-Range',_0x12c86c+'-'+_0x9fd116+'/'+_0x51402e)['json'](_0x5d7ff3);}return null;};}function patchUpdates(_0x41e8ef){return function(_0x1dc02b){try{jsonpatch[_0xd44b('0x20')](_0x1dc02b,_0x41e8ef,!![]);}catch(_0x166521){return BPromise[_0xd44b('0x21')](_0x166521);}return _0x1dc02b[_0xd44b('0x22')]();};}function saveUpdates(_0x2ea0cc,_0x2c8633){return function(_0x24bd4f){if(_0x24bd4f){return _0x24bd4f[_0xd44b('0x23')](_0x2ea0cc)[_0xd44b('0x24')](function(_0x3223d8){return _0x3223d8;});}return null;};}function removeEntity(_0x226aff,_0x46c108){return function(_0x3d2be9){if(_0x3d2be9){return _0x3d2be9['destroy']()[_0xd44b('0x24')](function(){_0x226aff[_0xd44b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10f825,_0x2b213a){return function(_0x14f23e){if(!_0x14f23e){_0x10f825['sendStatus'](0x194);}return _0x14f23e;};}function handleError(_0x219c4d,_0x4c343e){_0x4c343e=_0x4c343e||0x1f4;return function(_0x516356){logger[_0xd44b('0x25')](_0x516356[_0xd44b('0x26')]);if(_0x516356[_0xd44b('0x27')]){delete _0x516356[_0xd44b('0x27')];}_0x219c4d[_0xd44b('0x1b')](_0x4c343e)[_0xd44b('0x28')](_0x516356);};}exports[_0xd44b('0x29')]=function(_0x457b5d,_0x2b90c){var _0x21e3b5={},_0x293a98={},_0x5ec3d2={'count':0x0,'rows':[]};var _0x513484=_[_0xd44b('0x2a')](db[_0xd44b('0x2b')][_0xd44b('0x2c')],function(_0x1215db){return{'name':_0x1215db[_0xd44b('0x2d')],'type':_0x1215db[_0xd44b('0x2e')][_0xd44b('0x2f')]};});_0x293a98['model']=_[_0xd44b('0x2a')](_0x513484,'name');_0x293a98[_0xd44b('0x30')]=_[_0xd44b('0x31')](_0x457b5d[_0xd44b('0x30')]);_0x293a98['filters']=_[_0xd44b('0x32')](_0x293a98[_0xd44b('0x33')],_0x293a98['query']);_0x21e3b5['attributes']=_['intersection'](_0x293a98[_0xd44b('0x33')],qs['fields'](_0x457b5d['query'][_0xd44b('0x34')]));_0x21e3b5[_0xd44b('0x35')]=_0x21e3b5[_0xd44b('0x35')][_0xd44b('0x36')]?_0x21e3b5['attributes']:_0x293a98[_0xd44b('0x33')];if(!_0x457b5d[_0xd44b('0x30')][_0xd44b('0x37')](_0xd44b('0x38'))){_0x21e3b5['limit']=qs[_0xd44b('0x1e')](_0x457b5d['query'][_0xd44b('0x1e')]);_0x21e3b5[_0xd44b('0x1d')]=qs[_0xd44b('0x1d')](_0x457b5d[_0xd44b('0x30')]['offset']);}_0x21e3b5[_0xd44b('0x39')]=qs[_0xd44b('0x3a')](_0x457b5d[_0xd44b('0x30')][_0xd44b('0x3a')]);_0x21e3b5[_0xd44b('0x3b')]=qs['filters'](_['pick'](_0x457b5d[_0xd44b('0x30')],_0x293a98[_0xd44b('0x3c')]),_0x513484);if(_0x457b5d['query'][_0xd44b('0x3d')]){_0x21e3b5['where']=_['merge'](_0x21e3b5[_0xd44b('0x3b')],{'$or':_[_0xd44b('0x2a')](_0x513484,function(_0x273ccf){if(_0x273ccf[_0xd44b('0x2e')]!=='VIRTUAL'){var _0x34762c={};_0x34762c[_0x273ccf['name']]={'$like':'%'+_0x457b5d[_0xd44b('0x30')][_0xd44b('0x3d')]+'%'};return _0x34762c;}})});}_0x21e3b5=_[_0xd44b('0x3e')]({},_0x21e3b5,_0x457b5d[_0xd44b('0x3f')]);var _0x289739={'where':_0x21e3b5['where']};return db[_0xd44b('0x2b')][_0xd44b('0x40')](_0x289739)[_0xd44b('0x24')](function(_0x17618f){_0x5ec3d2['count']=_0x17618f;if(_0x457b5d['query']['includeAll']){_0x21e3b5['include']=[{'all':!![]}];}return db['Automation'][_0xd44b('0x41')](_0x21e3b5);})[_0xd44b('0x24')](function(_0x295068){_0x5ec3d2[_0xd44b('0x42')]=_0x295068;return _0x5ec3d2;})[_0xd44b('0x24')](respondWithFilteredResult(_0x2b90c,_0x21e3b5))[_0xd44b('0x43')](handleError(_0x2b90c,null));};exports['show']=function(_0x2be128,_0x3073db){var _0x3f5903={'raw':![],'where':{'id':_0x2be128[_0xd44b('0x44')]['id']}},_0x2519ea={};_0x2519ea[_0xd44b('0x33')]=_['keys'](db[_0xd44b('0x2b')]['rawAttributes']);_0x2519ea['query']=_[_0xd44b('0x31')](_0x2be128[_0xd44b('0x30')]);_0x2519ea['filters']=_['intersection'](_0x2519ea['model'],_0x2519ea[_0xd44b('0x30')]);_0x3f5903[_0xd44b('0x35')]=_[_0xd44b('0x32')](_0x2519ea[_0xd44b('0x33')],qs[_0xd44b('0x34')](_0x2be128[_0xd44b('0x30')][_0xd44b('0x34')]));_0x3f5903[_0xd44b('0x35')]=_0x3f5903[_0xd44b('0x35')][_0xd44b('0x36')]?_0x3f5903['attributes']:_0x2519ea['model'];if(_0x2be128['query'][_0xd44b('0x45')]){_0x3f5903[_0xd44b('0x46')]=[{'all':!![]}];}_0x3f5903=_[_0xd44b('0x3e')]({},_0x3f5903,_0x2be128[_0xd44b('0x3f')]);return db['Automation'][_0xd44b('0x47')](_0x3f5903)[_0xd44b('0x24')](handleEntityNotFound(_0x3073db,null))[_0xd44b('0x24')](respondWithResult(_0x3073db,null))[_0xd44b('0x43')](handleError(_0x3073db,null));};exports[_0xd44b('0x48')]=function(_0x274833,_0x2d17be){return db[_0xd44b('0x2b')]['create'](_0x274833[_0xd44b('0x49')],{})[_0xd44b('0x24')](respondWithResult(_0x2d17be,0xc9))[_0xd44b('0x43')](handleError(_0x2d17be,null));};exports[_0xd44b('0x23')]=function(_0x5d04a2,_0x27c800){if(_0x5d04a2[_0xd44b('0x49')]['id']){delete _0x5d04a2[_0xd44b('0x49')]['id'];}return db[_0xd44b('0x2b')][_0xd44b('0x47')]({'where':{'id':_0x5d04a2[_0xd44b('0x44')]['id']}})['then'](handleEntityNotFound(_0x27c800,null))[_0xd44b('0x24')](saveUpdates(_0x5d04a2[_0xd44b('0x49')],null))['then'](respondWithResult(_0x27c800,null))[_0xd44b('0x43')](handleError(_0x27c800,null));};exports[_0xd44b('0x4a')]=function(_0x2ce26a,_0x4b5dd2){return db[_0xd44b('0x2b')][_0xd44b('0x47')]({'where':{'id':_0x2ce26a[_0xd44b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b5dd2,null))[_0xd44b('0x24')](removeEntity(_0x4b5dd2,null))[_0xd44b('0x43')](handleError(_0x4b5dd2,null));};exports[_0xd44b('0x4b')]=function(_0xae08,_0x4ef50b,_0x133649){return db[_0xd44b('0x4c')]['find']({'where':{'id':_0xae08['params']['id']}})['then'](handleEntityNotFound(_0x4ef50b,null))[_0xd44b('0x24')](function(_0x55d5ce){if(_0x55d5ce){return _0x55d5ce[_0xd44b('0x4b')](_0xae08[_0xd44b('0x49')]['ids'],_[_0xd44b('0x4d')](_0xae08[_0xd44b('0x49')],[_0xd44b('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x4ef50b,null))['catch'](handleError(_0x4ef50b,null));};exports[_0xd44b('0x4f')]=function(_0x3ac6f4,_0x55fdc6,_0x5f3b52){var _0x481523={};var _0x25af26={};var _0xb2b393;var _0x2f5c5c;return db['Automation'][_0xd44b('0x50')]({'where':{'id':_0x3ac6f4['params']['id']}})[_0xd44b('0x24')](handleEntityNotFound(_0x55fdc6,null))[_0xd44b('0x24')](function(_0x426f7e){if(_0x426f7e){_0xb2b393=_0x426f7e;_0x25af26[_0xd44b('0x33')]=_[_0xd44b('0x31')](db[_0xd44b('0x4c')][_0xd44b('0x2c')]);_0x25af26['query']=_[_0xd44b('0x31')](_0x3ac6f4[_0xd44b('0x30')]);_0x25af26[_0xd44b('0x3c')]=_['intersection'](_0x25af26[_0xd44b('0x33')],_0x25af26[_0xd44b('0x30')]);_0x481523[_0xd44b('0x35')]=_[_0xd44b('0x32')](_0x25af26[_0xd44b('0x33')],qs[_0xd44b('0x34')](_0x3ac6f4['query'][_0xd44b('0x34')]));_0x481523['attributes']=_0x481523['attributes'][_0xd44b('0x36')]?_0x481523[_0xd44b('0x35')]:_0x25af26[_0xd44b('0x33')];_0x481523[_0xd44b('0x39')]=qs[_0xd44b('0x3a')](_0x3ac6f4[_0xd44b('0x30')]['sort']);_0x481523[_0xd44b('0x3b')]=qs['filters'](_[_0xd44b('0x51')](_0x3ac6f4[_0xd44b('0x30')],_0x25af26['filters']));if(_0x3ac6f4[_0xd44b('0x30')]['filter']){_0x481523['where']=_[_0xd44b('0x3e')](_0x481523[_0xd44b('0x3b')],{'$or':_[_0xd44b('0x2a')](_0x481523[_0xd44b('0x35')],function(_0x2e274b){var _0x41c0a9={};_0x41c0a9[_0x2e274b]={'$like':'%'+_0x3ac6f4[_0xd44b('0x30')][_0xd44b('0x3d')]+'%'};return _0x41c0a9;})});}_0x481523=_['merge']({},_0x481523,_0x3ac6f4[_0xd44b('0x3f')]);return _0xb2b393['getConditions'](_0x481523);}})[_0xd44b('0x24')](function(_0x2438fe){if(_0x2438fe){_0x2f5c5c=_0x2438fe['length'];if(!_0x3ac6f4[_0xd44b('0x30')]['hasOwnProperty']('nolimit')){_0x481523[_0xd44b('0x1e')]=qs[_0xd44b('0x1e')](_0x3ac6f4['query']['limit']);_0x481523['offset']=qs[_0xd44b('0x1d')](_0x3ac6f4[_0xd44b('0x30')][_0xd44b('0x1d')]);}return _0xb2b393[_0xd44b('0x4f')](_0x481523);}})[_0xd44b('0x24')](function(_0x6e8ede){if(_0x6e8ede){return _0x6e8ede?{'count':_0x2f5c5c,'rows':_0x6e8ede}:null;}})[_0xd44b('0x24')](respondWithResult(_0x55fdc6,null))[_0xd44b('0x43')](handleError(_0x55fdc6,null));};exports[_0xd44b('0x52')]=function(_0x5f4f66,_0x1d55b1,_0x3beaff){return db[_0xd44b('0x53')][_0xd44b('0x47')]({'where':{'id':_0x5f4f66['params']['id']}})[_0xd44b('0x24')](handleEntityNotFound(_0x1d55b1,null))['then'](function(_0x2b2036){if(_0x2b2036){return _0x2b2036[_0xd44b('0x52')](_0x5f4f66[_0xd44b('0x49')]['ids'],_[_0xd44b('0x4d')](_0x5f4f66['body'],['ids','id'])||{});}})[_0xd44b('0x24')](respondWithResult(_0x1d55b1,null))[_0xd44b('0x43')](handleError(_0x1d55b1,null));};exports[_0xd44b('0x54')]=function(_0x886cf8,_0x22ca85,_0xd9bb1c){var _0x29d234={};var _0x2db881={};var _0xef1de9;var _0x42df86;return db[_0xd44b('0x2b')]['findOne']({'where':{'id':_0x886cf8[_0xd44b('0x44')]['id']}})[_0xd44b('0x24')](handleEntityNotFound(_0x22ca85,null))[_0xd44b('0x24')](function(_0x434915){if(_0x434915){_0xef1de9=_0x434915;_0x2db881[_0xd44b('0x33')]=_['keys'](db[_0xd44b('0x53')][_0xd44b('0x2c')]);_0x2db881[_0xd44b('0x30')]=_[_0xd44b('0x31')](_0x886cf8[_0xd44b('0x30')]);_0x2db881[_0xd44b('0x3c')]=_[_0xd44b('0x32')](_0x2db881[_0xd44b('0x33')],_0x2db881['query']);_0x29d234['attributes']=_[_0xd44b('0x32')](_0x2db881['model'],qs[_0xd44b('0x34')](_0x886cf8['query'][_0xd44b('0x34')]));_0x29d234[_0xd44b('0x35')]=_0x29d234[_0xd44b('0x35')]['length']?_0x29d234['attributes']:_0x2db881[_0xd44b('0x33')];_0x29d234[_0xd44b('0x39')]=qs[_0xd44b('0x3a')](_0x886cf8[_0xd44b('0x30')][_0xd44b('0x3a')]);_0x29d234['where']=qs[_0xd44b('0x3c')](_[_0xd44b('0x51')](_0x886cf8[_0xd44b('0x30')],_0x2db881[_0xd44b('0x3c')]));if(_0x886cf8[_0xd44b('0x30')][_0xd44b('0x3d')]){_0x29d234[_0xd44b('0x3b')]=_[_0xd44b('0x3e')](_0x29d234['where'],{'$or':_['map'](_0x29d234[_0xd44b('0x35')],function(_0x204111){var _0x283e66={};_0x283e66[_0x204111]={'$like':'%'+_0x886cf8[_0xd44b('0x30')][_0xd44b('0x3d')]+'%'};return _0x283e66;})});}_0x29d234=_['merge']({},_0x29d234,_0x886cf8['options']);return _0xef1de9['getActions'](_0x29d234);}})[_0xd44b('0x24')](function(_0x3a86fe){if(_0x3a86fe){_0x42df86=_0x3a86fe[_0xd44b('0x36')];if(!_0x886cf8['query'][_0xd44b('0x37')](_0xd44b('0x38'))){_0x29d234['limit']=qs[_0xd44b('0x1e')](_0x886cf8[_0xd44b('0x30')][_0xd44b('0x1e')]);_0x29d234['offset']=qs[_0xd44b('0x1d')](_0x886cf8[_0xd44b('0x30')]['offset']);}return _0xef1de9[_0xd44b('0x54')](_0x29d234);}})['then'](function(_0x3f4377){if(_0x3f4377){return _0x3f4377?{'count':_0x42df86,'rows':_0x3f4377}:null;}})[_0xd44b('0x24')](respondWithResult(_0x22ca85,null))[_0xd44b('0x43')](handleError(_0x22ca85,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index eb5b591..72399be 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 _0x433a=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x1e0f8b,_0x5658d6){var _0xc27c9=function(_0x54f9b8){while(--_0x54f9b8){_0x1e0f8b['push'](_0x1e0f8b['shift']());}};_0xc27c9(++_0x5658d6);}(_0x433a,0x19b));var _0xa433=function(_0xda751d,_0x314084){_0xda751d=_0xda751d-0x0;var _0x6e2ff8=_0x433a[_0xda751d];return _0x6e2ff8;};'use strict';var _=require(_0xa433('0x0'));var util=require(_0xa433('0x1'));var logger=require(_0xa433('0x2'))(_0xa433('0x3'));var moment=require(_0xa433('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa433('0x5'));var config=require(_0xa433('0x6'));var attributes=require(_0xa433('0x7'));module[_0xa433('0x8')]=function(_0x403307,_0x38adc4){return _0x403307[_0xa433('0x9')](_0xa433('0xa'),attributes,{'tableName':_0xa433('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa59c=['Automation','tools_automations','lodash','util','request-promise','path','../../config/environment','./automation.attributes','define'];(function(_0x3aa88e,_0x4f2dc8){var _0x3bbdee=function(_0x459c2d){while(--_0x459c2d){_0x3aa88e['push'](_0x3aa88e['shift']());}};_0x3bbdee(++_0x4f2dc8);}(_0xa59c,0x14f));var _0xca59=function(_0x2c2616,_0x14ec49){_0x2c2616=_0x2c2616-0x0;var _0x327d21=_0xa59c[_0x2c2616];return _0x327d21;};'use strict';var _=require(_0xca59('0x0'));var util=require(_0xca59('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca59('0x2'));var fs=require('fs');var path=require(_0xca59('0x3'));var rimraf=require('rimraf');var config=require(_0xca59('0x4'));var attributes=require(_0xca59('0x5'));module['exports']=function(_0x4cdeaa,_0x161d65){return _0x4cdeaa[_0xca59('0x6')](_0xca59('0x7'),attributes,{'tableName':_0xca59('0x8'),'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 b00469a..5150ce8 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 _0xb1fa=['code','error','message','catch','moment','randomstring','../../config/environment','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19b4ce,_0x187040){var _0x180b52=function(_0x44c611){while(--_0x44c611){_0x19b4ce['push'](_0x19b4ce['shift']());}};_0x180b52(++_0x187040);}(_0xb1fa,0x9e));var _0xab1f=function(_0x650fad,_0x94912f){_0x650fad=_0x650fad-0x0;var _0x1b569e=_0xb1fa[_0x650fad];return _0x1b569e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab1f('0x0'));var BPromise=require('bluebird');var rs=require(_0xab1f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xab1f('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x463442,_0x54c5b0,_0x17e178){return new BPromise(function(_0x2fbc7e,_0x5213a4){return client[_0xab1f('0x3')](_0x463442,_0x17e178)['then'](function(_0x578cf7){logger[_0xab1f('0x4')](_0xab1f('0x5'),_0x54c5b0,_0xab1f('0x6'));logger[_0xab1f('0x7')](_0xab1f('0x8'),_0x54c5b0,'request\x20sent',JSON[_0xab1f('0x9')](_0x578cf7));if(_0x578cf7['error']){if(_0x578cf7['error'][_0xab1f('0xa')]===0x1f4){logger[_0xab1f('0xb')]('Automation,\x20%s,\x20%s',_0x54c5b0,_0x578cf7['error'][_0xab1f('0xc')]);return _0x5213a4(_0x578cf7['error'][_0xab1f('0xc')]);}logger[_0xab1f('0xb')](_0xab1f('0x5'),_0x54c5b0,_0x578cf7['error'][_0xab1f('0xc')]);return _0x2fbc7e(_0x578cf7[_0xab1f('0xb')][_0xab1f('0xc')]);}else{logger[_0xab1f('0x4')]('Automation,\x20%s,\x20%s',_0x54c5b0,_0xab1f('0x6'));_0x2fbc7e(_0x578cf7['result'][_0xab1f('0xc')]);}})[_0xab1f('0xd')](function(_0xcdba98){logger['error'](_0xab1f('0x5'),_0x54c5b0,_0xcdba98);_0x5213a4(_0xcdba98);});});}
\ No newline at end of file
+var _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2713e1,_0xfd4305){var _0x4bd714=function(_0x359529){while(--_0x359529){_0x2713e1['push'](_0x2713e1['shift']());}};_0x4bd714(++_0xfd4305);}(_0x958a,0x128));var _0xa958=function(_0x3aaa0b,_0xe53b50){_0x3aaa0b=_0x3aaa0b-0x0;var _0x29e865=_0x958a[_0x3aaa0b];return _0x29e865;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 4476df8..8a2f13e 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 _0x3937=['delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','getConditions','post','/:id/conditions','/:id/actions','addActions','put','update'];(function(_0x35c1db,_0xd75c15){var _0x4173ff=function(_0x5d6901){while(--_0x5d6901){_0x35c1db['push'](_0x35c1db['shift']());}};_0x4173ff(++_0xd75c15);}(_0x3937,0xbf));var _0x7393=function(_0x4afc56,_0x5c8d69){_0x4afc56=_0x4afc56-0x0;var _0xbb0c35=_0x3937[_0x4afc56];return _0xbb0c35;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',auth[_0x7393('0x8')](),controller[_0x7393('0x9')]);router[_0x7393('0x7')](_0x7393('0xa'),auth[_0x7393('0x8')](),controller[_0x7393('0xb')]);router['get']('/:id/conditions',auth[_0x7393('0x8')](),controller[_0x7393('0xc')]);router[_0x7393('0x7')]('/:id/actions',auth[_0x7393('0x8')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7393('0xd')](_0x7393('0xe'),auth[_0x7393('0x8')](),controller['addConditions']);router[_0x7393('0xd')](_0x7393('0xf'),auth[_0x7393('0x8')](),controller[_0x7393('0x10')]);router[_0x7393('0x11')](_0x7393('0xa'),auth[_0x7393('0x8')](),controller[_0x7393('0x12')]);router[_0x7393('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7393('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x074a=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x074a,0x97));var _0xa074=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x074a[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xa074('0x0'));var util=require(_0xa074('0x1'));var path=require(_0xa074('0x2'));var timeout=require(_0xa074('0x3'));var express=require('express');var router=express[_0xa074('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa074('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa074('0x6'));router[_0xa074('0x7')]('/',auth[_0xa074('0x8')](),controller[_0xa074('0x9')]);router[_0xa074('0x7')](_0xa074('0xa'),auth[_0xa074('0x8')](),controller[_0xa074('0xb')]);router[_0xa074('0x7')](_0xa074('0xc'),auth[_0xa074('0x8')](),controller[_0xa074('0xd')]);router[_0xa074('0x7')](_0xa074('0xe'),auth[_0xa074('0x8')](),controller[_0xa074('0xf')]);router[_0xa074('0x10')]('/',auth[_0xa074('0x8')](),controller[_0xa074('0x11')]);router[_0xa074('0x10')](_0xa074('0xc'),auth[_0xa074('0x8')](),controller[_0xa074('0x12')]);router[_0xa074('0x10')](_0xa074('0xe'),auth[_0xa074('0x8')](),controller[_0xa074('0x13')]);router[_0xa074('0x14')](_0xa074('0xa'),auth[_0xa074('0x8')](),controller[_0xa074('0x15')]);router[_0xa074('0x16')]('/:id',auth[_0xa074('0x8')](),controller[_0xa074('0x17')]);module[_0xa074('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5af21f9..475a2b3 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 _0x96cf=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\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','ivr','STRING','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x96cf,0x143));var _0xf96c=function(_0x411c7a,_0x449230){_0x411c7a=_0x411c7a-0x0;var _0x38479b=_0x96cf[_0x411c7a];return _0x38479b;};'use strict';var Sequelize=require(_0xf96c('0x0'));module[_0xf96c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf96c('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf96c('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf96c('0x4')},'limitCalls':{'type':Sequelize[_0xf96c('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf96c('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf96c('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf96c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf96c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf96c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf96c('0xd')},'dialTimezone':{'type':Sequelize[_0xf96c('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xf96c('0xe'),_0xf96c('0xf'),_0xf96c('0x10')),'defaultValue':_0xf96c('0xe')},'dialAMDActive':{'type':Sequelize[_0xf96c('0x11')],'defaultValue':0x0,'comment':_0xf96c('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xf96c('0x5')](0x9)[_0xf96c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf96c('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xf96c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf96c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf96c('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf96c('0x5')](0x9)[_0xf96c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xf96c('0x5')](0x9)[_0xf96c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf96c('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf96c('0x5')](0x9)[_0xf96c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf96c('0x5')](0x9)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf96c('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf96c('0x5')](0x5)[_0xf96c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf96c('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf96c('0x5')](0x9)[_0xf96c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf96c('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf96c('0x19')](_0xf96c('0x1a'),_0xf96c('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xf96c('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf96c('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf96c('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf96c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf96c('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf96c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf96c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf96c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf96c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf96c('0x5')](0x3)[_0xf96c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf96c('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf96c('0x26')}};
\ No newline at end of file
+var _0x42a1=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#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)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','INTEGER','UNSIGNED','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)'];(function(_0x115fdb,_0x338195){var _0x36edb7=function(_0xefbbe0){while(--_0xefbbe0){_0x115fdb['push'](_0x115fdb['shift']());}};_0x36edb7(++_0x338195);}(_0x42a1,0x123));var _0x142a=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x42a1[_0x4a5494];return _0x57cbb5;};'use strict';var Sequelize=require(_0x142a('0x0'));module[_0x142a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x142a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x142a('0x3')](_0x142a('0x4')),'allowNull':![],'defaultValue':_0x142a('0x4')},'description':{'type':Sequelize[_0x142a('0x5')]},'active':{'type':Sequelize[_0x142a('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x142a('0x7')](0x4)[_0x142a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x142a('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'comment':_0x142a('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x142a('0xd')},'dialTimezone':{'type':Sequelize[_0x142a('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x142a('0x5')],'defaultValue':_0x142a('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x142a('0x3')](_0x142a('0xf'),_0x142a('0x10'),_0x142a('0x11')),'defaultValue':_0x142a('0xf')},'dialAMDActive':{'type':Sequelize[_0x142a('0x6')],'defaultValue':0x0,'comment':_0x142a('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x142a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x142a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x142a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x142a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x142a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x142a('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x142a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x142a('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x142a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x142a('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x142a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x142a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x142a('0x3')](_0x142a('0x1b'),_0x142a('0x1c')),'defaultValue':_0x142a('0x1b')},'dialPrefix':{'type':Sequelize[_0x142a('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x142a('0x1d')},'dialCutDigit':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x142a('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 3cfd36b..4ddcb25 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 _0x58a7=['get','UserProfileResource','error','stack','name','map','Campaign','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','autoAssociation','clone','omit','createdAt','updatedAt','userProfileId','getHoppers','params','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId','NOW()','cmHopperId','ci.item','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then'];(function(_0x1792c6,_0x5e5f01){var _0x250b50=function(_0x54429b){while(--_0x54429b){_0x1792c6['push'](_0x1792c6['shift']());}};_0x250b50(++_0x5e5f01);}(_0x58a7,0xf7));var _0x758a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x58a7[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x758a('0x0'));var rimraf=require(_0x758a('0x1'));var zipdir=require(_0x758a('0x2'));var jsonpatch=require(_0x758a('0x3'));var rp=require(_0x758a('0x4'));var moment=require(_0x758a('0x5'));var BPromise=require(_0x758a('0x6'));var Mustache=require(_0x758a('0x7'));var util=require('util');var path=require(_0x758a('0x8'));var sox=require(_0x758a('0x9'));var csv=require(_0x758a('0xa'));var ejs=require(_0x758a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x758a('0xc'));var crypto=require('crypto');var jsforce=require(_0x758a('0xd'));var deskjs=require(_0x758a('0xe'));var toCsv=require(_0x758a('0xa'));var querystring=require(_0x758a('0xf'));var Papa=require(_0x758a('0x10'));var Redis=require(_0x758a('0x11'));var authService=require(_0x758a('0x12'));var qs=require(_0x758a('0x13'));var as=require(_0x758a('0x14'));var hardwareService=require(_0x758a('0x15'));var logger=require(_0x758a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x758a('0x17'));var licenseUtil=require(_0x758a('0x18'));var db=require(_0x758a('0x19'))['db'];function respondWithStatusCode(_0x4c2dfc,_0x3e1ee0){_0x3e1ee0=_0x3e1ee0||0xcc;return function(_0x2cc841){if(_0x2cc841){return _0x4c2dfc[_0x758a('0x1a')](_0x3e1ee0);}return _0x4c2dfc[_0x758a('0x1b')](_0x3e1ee0)[_0x758a('0x1c')]();};}function respondWithResult(_0x541d85,_0x4b0b39){_0x4b0b39=_0x4b0b39||0xc8;return function(_0x4581df){if(_0x4581df){return _0x541d85[_0x758a('0x1b')](_0x4b0b39)[_0x758a('0x1d')](_0x4581df);}};}function respondWithFilteredResult(_0x54dec5,_0x4e4aee){return function(_0x5a9512){if(_0x5a9512){var _0x5bdbfb=typeof _0x4e4aee[_0x758a('0x1e')]===_0x758a('0x1f')&&typeof _0x4e4aee['limit']===_0x758a('0x1f');var _0x2f28f3=_0x5a9512[_0x758a('0x20')];var _0x12dc48=_0x5bdbfb?0x0:_0x4e4aee[_0x758a('0x1e')];var _0x23a1c2=_0x5bdbfb?_0x5a9512[_0x758a('0x20')]:_0x4e4aee[_0x758a('0x1e')]+_0x4e4aee[_0x758a('0x21')];var _0x15653b;if(_0x23a1c2>=_0x2f28f3){_0x23a1c2=_0x2f28f3;_0x15653b=0xc8;}else{_0x15653b=0xce;}_0x54dec5[_0x758a('0x1b')](_0x15653b);return _0x54dec5[_0x758a('0x22')](_0x758a('0x23'),_0x12dc48+'-'+_0x23a1c2+'/'+_0x2f28f3)[_0x758a('0x1d')](_0x5a9512);}return null;};}function patchUpdates(_0x1f7a34){return function(_0x1effec){try{jsonpatch['apply'](_0x1effec,_0x1f7a34,!![]);}catch(_0xc3f455){return BPromise[_0x758a('0x24')](_0xc3f455);}return _0x1effec[_0x758a('0x25')]();};}function saveUpdates(_0x3ba95e,_0x239fd9){return function(_0x26acb8){if(_0x26acb8){return _0x26acb8[_0x758a('0x26')](_0x3ba95e)['then'](function(_0x1bc4e2){return _0x1bc4e2;});}return null;};}function removeEntity(_0x24d5cf,_0x56a99a){return function(_0x4b1e08){if(_0x4b1e08){return _0x4b1e08[_0x758a('0x27')]()[_0x758a('0x28')](function(){var _0x1a73d5=_0x4b1e08[_0x758a('0x29')]({'plain':!![]});var _0x3c1292='IvrCampaigns';return db[_0x758a('0x2a')]['destroy']({'where':{'type':_0x3c1292,'resourceId':_0x1a73d5['id']}})['then'](function(){return _0x4b1e08;});})[_0x758a('0x28')](function(){_0x24d5cf[_0x758a('0x1b')](0xcc)[_0x758a('0x1c')]();});}};}function handleEntityNotFound(_0x48eee8,_0x14600a){return function(_0x327082){if(!_0x327082){_0x48eee8[_0x758a('0x1a')](0x194);}return _0x327082;};}function handleError(_0x26e8b2,_0x46122e){_0x46122e=_0x46122e||0x1f4;return function(_0xcd4549){logger[_0x758a('0x2b')](_0xcd4549[_0x758a('0x2c')]);if(_0xcd4549[_0x758a('0x2d')]){delete _0xcd4549[_0x758a('0x2d')];}_0x26e8b2[_0x758a('0x1b')](_0x46122e)['send'](_0xcd4549);};}exports['index']=function(_0x10850b,_0x1cd222){var _0x150ce5={},_0x426d5e={},_0x26d18d={'count':0x0,'rows':[]};var _0x301508=_[_0x758a('0x2e')](db[_0x758a('0x2f')][_0x758a('0x30')],function(_0x316a67){return{'name':_0x316a67[_0x758a('0x31')],'type':_0x316a67[_0x758a('0x32')][_0x758a('0x33')]};});_0x426d5e['model']=_[_0x758a('0x2e')](_0x301508,_0x758a('0x2d'));_0x426d5e['query']=_[_0x758a('0x34')](_0x10850b[_0x758a('0x35')]);_0x426d5e[_0x758a('0x36')]=_[_0x758a('0x37')](_0x426d5e['model'],_0x426d5e['query']);_0x150ce5[_0x758a('0x38')]=_[_0x758a('0x37')](_0x426d5e['model'],qs['fields'](_0x10850b[_0x758a('0x35')][_0x758a('0x39')]));_0x150ce5[_0x758a('0x38')]=_0x150ce5[_0x758a('0x38')][_0x758a('0x3a')]?_0x150ce5['attributes']:_0x426d5e[_0x758a('0x3b')];if(!_0x10850b['query']['hasOwnProperty'](_0x758a('0x3c'))){_0x150ce5[_0x758a('0x21')]=qs[_0x758a('0x21')](_0x10850b[_0x758a('0x35')][_0x758a('0x21')]);_0x150ce5['offset']=qs[_0x758a('0x1e')](_0x10850b[_0x758a('0x35')][_0x758a('0x1e')]);}_0x150ce5[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0x10850b[_0x758a('0x35')][_0x758a('0x3e')]);_0x150ce5['where']=qs[_0x758a('0x36')](_[_0x758a('0x3f')](_0x10850b[_0x758a('0x35')],_0x426d5e[_0x758a('0x36')]),_0x301508);if(_0x10850b[_0x758a('0x35')]['filter']){_0x150ce5[_0x758a('0x40')]=_[_0x758a('0x41')](_0x150ce5[_0x758a('0x40')],{'$or':_['map'](_0x301508,function(_0xde498e){if(_0xde498e['type']!==_0x758a('0x42')){var _0x16eed5={};_0x16eed5[_0xde498e['name']]={'$like':'%'+_0x10850b[_0x758a('0x35')][_0x758a('0x43')]+'%'};return _0x16eed5;}})});}_0x150ce5=_[_0x758a('0x41')]({},_0x150ce5,_0x10850b[_0x758a('0x44')]);var _0x1fb698={'where':_0x150ce5[_0x758a('0x40')]};return db[_0x758a('0x2f')][_0x758a('0x20')](_0x1fb698)[_0x758a('0x28')](function(_0x18afc8){_0x26d18d[_0x758a('0x20')]=_0x18afc8;if(_0x10850b[_0x758a('0x35')][_0x758a('0x45')]){_0x150ce5[_0x758a('0x46')]=[{'all':!![]}];}return db[_0x758a('0x2f')][_0x758a('0x47')](_0x150ce5);})[_0x758a('0x28')](function(_0x3a7bca){_0x26d18d[_0x758a('0x48')]=_0x3a7bca;return _0x26d18d;})['then'](respondWithFilteredResult(_0x1cd222,_0x150ce5))[_0x758a('0x49')](handleError(_0x1cd222,null));};exports[_0x758a('0x4a')]=function(_0x558a2d,_0x5a347e){var _0x1a58f0={'raw':![],'where':{'id':_0x558a2d['params']['id']}},_0x5441ad={};_0x5441ad[_0x758a('0x3b')]=_[_0x758a('0x34')](db['Campaign'][_0x758a('0x30')]);_0x5441ad[_0x758a('0x35')]=_[_0x758a('0x34')](_0x558a2d[_0x758a('0x35')]);_0x5441ad[_0x758a('0x36')]=_[_0x758a('0x37')](_0x5441ad[_0x758a('0x3b')],_0x5441ad[_0x758a('0x35')]);_0x1a58f0['attributes']=_['intersection'](_0x5441ad[_0x758a('0x3b')],qs[_0x758a('0x39')](_0x558a2d[_0x758a('0x35')][_0x758a('0x39')]));_0x1a58f0[_0x758a('0x38')]=_0x1a58f0[_0x758a('0x38')][_0x758a('0x3a')]?_0x1a58f0[_0x758a('0x38')]:_0x5441ad[_0x758a('0x3b')];if(_0x558a2d['query'][_0x758a('0x45')]){_0x1a58f0['include']=[{'all':!![]}];}_0x1a58f0=_['merge']({},_0x1a58f0,_0x558a2d[_0x758a('0x44')]);return db[_0x758a('0x2f')]['find'](_0x1a58f0)[_0x758a('0x28')](handleEntityNotFound(_0x5a347e,null))[_0x758a('0x28')](respondWithResult(_0x5a347e,null))[_0x758a('0x49')](handleError(_0x5a347e,null));};exports[_0x758a('0x4b')]=function(_0xad36ac,_0x5c4645){return db[_0x758a('0x2f')][_0x758a('0x4b')](_0xad36ac[_0x758a('0x4c')],{})[_0x758a('0x28')](function(_0x7328f6){var _0x5df989=_0xad36ac[_0x758a('0x4d')]['get']({'plain':!![]});if(!_0x5df989)throw new Error(_0x758a('0x4e'));if(_0x5df989[_0x758a('0x4f')]===_0x758a('0x4d')){var _0x2537d5=_0x7328f6[_0x758a('0x29')]({'plain':!![]});var _0x130abf=_0x758a('0x50');return db[_0x758a('0x51')][_0x758a('0x52')]({'where':{'name':_0x130abf,'userProfileId':_0x5df989['userProfileId']},'raw':!![]})[_0x758a('0x28')](function(_0x406ca1){if(_0x406ca1&&_0x406ca1[_0x758a('0x53')]===0x0){return db[_0x758a('0x2a')]['create']({'name':_0x2537d5[_0x758a('0x2d')],'resourceId':_0x2537d5['id'],'type':_0x406ca1[_0x758a('0x2d')],'sectionId':_0x406ca1['id']},{})[_0x758a('0x28')](function(){return _0x7328f6;});}else{return _0x7328f6;}})[_0x758a('0x49')](function(_0x33c70a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33c70a);throw _0x33c70a;});}return _0x7328f6;})['then'](respondWithResult(_0x5c4645,0xc9))[_0x758a('0x49')](handleError(_0x5c4645,null));};exports[_0x758a('0x54')]=function(_0x80e8ef,_0x5134f1){var _0x5f3c5d={'where':{'id':_0x80e8ef['params']['id']}},_0x53f3b0={};_0x53f3b0[_0x758a('0x3b')]=_[_0x758a('0x34')](db[_0x758a('0x2f')][_0x758a('0x30')]);_0x5f3c5d[_0x758a('0x38')]=_[_0x758a('0x37')](_0x53f3b0[_0x758a('0x3b')],qs[_0x758a('0x39')](_0x80e8ef[_0x758a('0x35')][_0x758a('0x39')]));_0x5f3c5d[_0x758a('0x38')]=_0x5f3c5d[_0x758a('0x38')]['length']?_0x5f3c5d['attributes']:_0x53f3b0[_0x758a('0x3b')];if(_0x80e8ef[_0x758a('0x35')][_0x758a('0x45')]){_0x5f3c5d[_0x758a('0x46')]=[{'all':!![]}];}_0x5f3c5d=_['merge']({},_0x5f3c5d,_0x80e8ef[_0x758a('0x44')]);return db[_0x758a('0x2f')][_0x758a('0x52')](_0x5f3c5d)[_0x758a('0x28')](handleEntityNotFound(_0x5134f1,null))[_0x758a('0x28')](function(_0x3ab575){if(_0x3ab575){var _0x1275fb=_0x3ab575['get']({'plain':!![]});_0x1275fb=qs[_0x758a('0x55')](_0x1275fb,['id',_0x758a('0x56'),_0x758a('0x57')]);_0x80e8ef['body']=_[_0x758a('0x55')](_0x80e8ef[_0x758a('0x4c')],['id',_0x758a('0x56'),_0x758a('0x57')]);return db[_0x758a('0x2f')][_0x758a('0x4b')](_[_0x758a('0x41')](_0x1275fb,_0x80e8ef[_0x758a('0x4c')]),{'include':_0x80e8ef[_0x758a('0x35')][_0x758a('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x13ebf8){var _0x583e22=_0x80e8ef[_0x758a('0x4d')][_0x758a('0x29')]({'plain':!![]});if(!_0x583e22)throw new Error(_0x758a('0x4e'));if(_0x583e22[_0x758a('0x4f')]==='user'){var _0x20809a=_0x13ebf8[_0x758a('0x29')]({'plain':!![]});var _0x3543d0=_0x758a('0x50');return db[_0x758a('0x51')][_0x758a('0x52')]({'where':{'name':_0x3543d0,'userProfileId':_0x583e22[_0x758a('0x58')]},'raw':!![]})[_0x758a('0x28')](function(_0x25b99c){if(_0x25b99c&&_0x25b99c[_0x758a('0x53')]===0x0){return db[_0x758a('0x2a')]['create']({'name':_0x20809a[_0x758a('0x2d')],'resourceId':_0x20809a['id'],'type':_0x25b99c[_0x758a('0x2d')],'sectionId':_0x25b99c['id']},{})[_0x758a('0x28')](function(){return _0x13ebf8;});}else{return _0x13ebf8;}})[_0x758a('0x49')](function(_0x2ac8ec){logger[_0x758a('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ac8ec);throw _0x2ac8ec;});}return _0x13ebf8;});}})[_0x758a('0x28')](respondWithResult(_0x5134f1,0xc9))[_0x758a('0x49')](handleError(_0x5134f1,null));};exports['update']=function(_0x71073f,_0xe9c69e){if(_0x71073f[_0x758a('0x4c')]['id']){delete _0x71073f['body']['id'];}return db[_0x758a('0x2f')][_0x758a('0x52')]({'where':{'id':_0x71073f['params']['id']}})['then'](handleEntityNotFound(_0xe9c69e,null))[_0x758a('0x28')](saveUpdates(_0x71073f[_0x758a('0x4c')],null))['then'](respondWithResult(_0xe9c69e,null))[_0x758a('0x49')](handleError(_0xe9c69e,null));};exports['destroy']=function(_0x486167,_0x595451){return db['Campaign'][_0x758a('0x52')]({'where':{'id':_0x486167['params']['id']}})['then'](handleEntityNotFound(_0x595451,null))[_0x758a('0x28')](removeEntity(_0x595451,null))[_0x758a('0x49')](handleError(_0x595451,null));};exports[_0x758a('0x59')]=function(_0x4e5619,_0x3f734a,_0x4cc342){var _0x3036aa={'raw':!![],'where':{}};var _0x5b059c={};var _0x36a651={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4e5619[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x3f734a,null))['then'](function(_0x8460df){if(_0x8460df){_0x5b059c['model']=_['keys'](db[_0x758a('0x5b')][_0x758a('0x30')]);_0x5b059c[_0x758a('0x35')]=_['keys'](_0x4e5619[_0x758a('0x35')]);_0x5b059c[_0x758a('0x36')]=_[_0x758a('0x37')](_0x5b059c[_0x758a('0x3b')],_0x5b059c[_0x758a('0x35')]);_0x3036aa['attributes']=_['intersection'](_0x5b059c[_0x758a('0x3b')],qs[_0x758a('0x39')](_0x4e5619['query']['fields']));_0x3036aa[_0x758a('0x38')]=_0x3036aa[_0x758a('0x38')][_0x758a('0x3a')]?_0x3036aa[_0x758a('0x38')]:_0x5b059c['model'];if(!_0x4e5619[_0x758a('0x35')][_0x758a('0x5c')](_0x758a('0x3c'))){_0x3036aa['limit']=qs[_0x758a('0x21')](_0x4e5619[_0x758a('0x35')][_0x758a('0x21')]);_0x3036aa[_0x758a('0x1e')]=qs[_0x758a('0x1e')](_0x4e5619['query']['offset']);}_0x3036aa[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0x4e5619[_0x758a('0x35')]['sort']);_0x3036aa[_0x758a('0x40')]=qs[_0x758a('0x36')](_[_0x758a('0x3f')](_0x4e5619['query'],_0x5b059c[_0x758a('0x36')]));_0x3036aa[_0x758a('0x40')][_0x758a('0x5d')]=_0x8460df['id'];if(_0x4e5619[_0x758a('0x35')][_0x758a('0x43')]){_0x3036aa['where']=_[_0x758a('0x41')](_0x3036aa[_0x758a('0x40')],{'$or':_['map'](_0x3036aa[_0x758a('0x38')],function(_0x428667){var _0x47d105={};_0x47d105[_0x428667]={'$like':'%'+_0x4e5619[_0x758a('0x35')][_0x758a('0x43')]+'%'};return _0x47d105;})});}_0x3036aa=_['merge']({},_0x3036aa,_0x4e5619[_0x758a('0x44')]);return db[_0x758a('0x5b')]['count']({'where':_0x3036aa[_0x758a('0x40')]})['then'](function(_0x37f86b){_0x36a651[_0x758a('0x20')]=_0x37f86b;if(_0x4e5619[_0x758a('0x35')][_0x758a('0x45')]){_0x3036aa[_0x758a('0x46')]=[{'all':!![]}];}return db[_0x758a('0x5b')]['findAll'](_0x3036aa);})[_0x758a('0x28')](function(_0x1ef073){_0x36a651[_0x758a('0x48')]=_0x1ef073;return _0x36a651;});}})[_0x758a('0x28')](respondWithFilteredResult(_0x3f734a,_0x3036aa))[_0x758a('0x49')](handleError(_0x3f734a,null));};exports[_0x758a('0x5e')]=function(_0x430334,_0x350d15,_0x50f304){var _0x404560={'raw':!![],'where':{}};var _0x596857={};var _0x5e9953={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x430334[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x350d15,null))[_0x758a('0x28')](function(_0x4812aa){if(_0x4812aa){_0x596857[_0x758a('0x3b')]=_['keys'](db[_0x758a('0x5f')][_0x758a('0x30')]);_0x596857[_0x758a('0x35')]=_[_0x758a('0x34')](_0x430334[_0x758a('0x35')]);_0x596857[_0x758a('0x36')]=_[_0x758a('0x37')](_0x596857['model'],_0x596857[_0x758a('0x35')]);_0x404560[_0x758a('0x38')]=_['intersection'](_0x596857[_0x758a('0x3b')],qs[_0x758a('0x39')](_0x430334[_0x758a('0x35')][_0x758a('0x39')]));_0x404560[_0x758a('0x38')]=_0x404560[_0x758a('0x38')][_0x758a('0x3a')]?_0x404560[_0x758a('0x38')]:_0x596857['model'];if(!_0x430334[_0x758a('0x35')][_0x758a('0x5c')](_0x758a('0x3c'))){_0x404560[_0x758a('0x21')]=qs[_0x758a('0x21')](_0x430334[_0x758a('0x35')][_0x758a('0x21')]);_0x404560['offset']=qs[_0x758a('0x1e')](_0x430334[_0x758a('0x35')][_0x758a('0x1e')]);}_0x404560[_0x758a('0x3d')]=qs['sort'](_0x430334[_0x758a('0x35')][_0x758a('0x3e')]);_0x404560[_0x758a('0x40')]=qs[_0x758a('0x36')](_['pick'](_0x430334[_0x758a('0x35')],_0x596857[_0x758a('0x36')]));_0x404560[_0x758a('0x40')][_0x758a('0x5d')]=_0x4812aa['id'];if(_0x430334['query']['filter']){_0x404560[_0x758a('0x40')]=_[_0x758a('0x41')](_0x404560['where'],{'$or':_[_0x758a('0x2e')](_0x404560[_0x758a('0x38')],function(_0x320649){var _0x3115c6={};_0x3115c6[_0x320649]={'$like':'%'+_0x430334[_0x758a('0x35')][_0x758a('0x43')]+'%'};return _0x3115c6;})});}_0x404560=_[_0x758a('0x41')]({},_0x404560,_0x430334[_0x758a('0x44')]);return db[_0x758a('0x5f')][_0x758a('0x20')]({'where':_0x404560[_0x758a('0x40')]})['then'](function(_0x276abe){_0x5e9953[_0x758a('0x20')]=_0x276abe;if(_0x430334[_0x758a('0x35')][_0x758a('0x45')]){_0x404560[_0x758a('0x46')]=[{'all':!![]}];}return db[_0x758a('0x5f')][_0x758a('0x47')](_0x404560);})['then'](function(_0xb959fe){_0x5e9953[_0x758a('0x48')]=_0xb959fe;return _0x5e9953;});}})['then'](respondWithFilteredResult(_0x350d15,_0x404560))[_0x758a('0x49')](handleError(_0x350d15,null));};exports[_0x758a('0x60')]=function(_0x239791,_0x2abc65,_0x4003a5){var _0x533fe5={'raw':!![],'where':{}};var _0x25fddf={};var _0x466471={'count':0x0,'rows':[]};return db[_0x758a('0x2f')][_0x758a('0x61')]({'where':{'id':_0x239791['params']['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x2abc65,null))['then'](function(_0x5b9b7a){if(_0x5b9b7a){_0x25fddf['model']=_[_0x758a('0x34')](db[_0x758a('0x62')][_0x758a('0x30')]);_0x25fddf[_0x758a('0x35')]=_[_0x758a('0x34')](_0x239791[_0x758a('0x35')]);_0x25fddf[_0x758a('0x36')]=_[_0x758a('0x37')](_0x25fddf[_0x758a('0x3b')],_0x25fddf[_0x758a('0x35')]);_0x533fe5['attributes']=_['intersection'](_0x25fddf['model'],qs[_0x758a('0x39')](_0x239791[_0x758a('0x35')]['fields']));_0x533fe5[_0x758a('0x38')]=_0x533fe5[_0x758a('0x38')][_0x758a('0x3a')]?_0x533fe5['attributes']:_0x25fddf[_0x758a('0x3b')];if(!_0x239791[_0x758a('0x35')][_0x758a('0x5c')](_0x758a('0x3c'))){_0x533fe5[_0x758a('0x21')]=qs[_0x758a('0x21')](_0x239791[_0x758a('0x35')]['limit']);_0x533fe5[_0x758a('0x1e')]=qs['offset'](_0x239791[_0x758a('0x35')][_0x758a('0x1e')]);}_0x533fe5[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0x239791['query'][_0x758a('0x3e')]);_0x533fe5[_0x758a('0x40')]=qs[_0x758a('0x36')](_[_0x758a('0x3f')](_0x239791[_0x758a('0x35')],_0x25fddf[_0x758a('0x36')]));_0x533fe5[_0x758a('0x40')][_0x758a('0x5d')]=_0x5b9b7a['id'];if(_0x239791[_0x758a('0x35')][_0x758a('0x43')]){_0x533fe5[_0x758a('0x40')]=_[_0x758a('0x41')](_0x533fe5['where'],{'$or':_[_0x758a('0x2e')](_0x533fe5['attributes'],function(_0x309edb){var _0x5d506e={};_0x5d506e[_0x309edb]={'$like':'%'+_0x239791[_0x758a('0x35')][_0x758a('0x43')]+'%'};return _0x5d506e;})});}_0x533fe5=_[_0x758a('0x41')]({},_0x533fe5,_0x239791[_0x758a('0x44')]);return db[_0x758a('0x62')][_0x758a('0x20')]({'where':_0x533fe5[_0x758a('0x40')]})[_0x758a('0x28')](function(_0x584eaa){_0x466471['count']=_0x584eaa;if(_0x239791['query'][_0x758a('0x45')]){_0x533fe5[_0x758a('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x758a('0x47')](_0x533fe5);})[_0x758a('0x28')](function(_0x3ceba4){_0x466471[_0x758a('0x48')]=_0x3ceba4;return _0x466471;});}})[_0x758a('0x28')](respondWithFilteredResult(_0x2abc65,_0x533fe5))[_0x758a('0x49')](handleError(_0x2abc65,null));};exports['getHopperBlacks']=function(_0xeff6fc,_0x502c70,_0x300e5e){var _0x13339a={'raw':!![],'where':{}};var _0x53e6c2={};var _0x25a8af={'count':0x0,'rows':[]};return db['Campaign'][_0x758a('0x61')]({'where':{'id':_0xeff6fc[_0x758a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x502c70,null))['then'](function(_0x5577f6){if(_0x5577f6){_0x53e6c2[_0x758a('0x3b')]=_[_0x758a('0x34')](db[_0x758a('0x63')][_0x758a('0x30')]);_0x53e6c2[_0x758a('0x35')]=_[_0x758a('0x34')](_0xeff6fc['query']);_0x53e6c2[_0x758a('0x36')]=_[_0x758a('0x37')](_0x53e6c2[_0x758a('0x3b')],_0x53e6c2[_0x758a('0x35')]);_0x13339a[_0x758a('0x38')]=_[_0x758a('0x37')](_0x53e6c2[_0x758a('0x3b')],qs['fields'](_0xeff6fc[_0x758a('0x35')][_0x758a('0x39')]));_0x13339a[_0x758a('0x38')]=_0x13339a[_0x758a('0x38')][_0x758a('0x3a')]?_0x13339a[_0x758a('0x38')]:_0x53e6c2[_0x758a('0x3b')];if(!_0xeff6fc[_0x758a('0x35')][_0x758a('0x5c')](_0x758a('0x3c'))){_0x13339a[_0x758a('0x21')]=qs[_0x758a('0x21')](_0xeff6fc[_0x758a('0x35')][_0x758a('0x21')]);_0x13339a[_0x758a('0x1e')]=qs[_0x758a('0x1e')](_0xeff6fc[_0x758a('0x35')]['offset']);}_0x13339a[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0xeff6fc[_0x758a('0x35')][_0x758a('0x3e')]);_0x13339a[_0x758a('0x40')]=qs[_0x758a('0x36')](_[_0x758a('0x3f')](_0xeff6fc[_0x758a('0x35')],_0x53e6c2[_0x758a('0x36')]));_0x13339a['where'][_0x758a('0x5d')]=_0x5577f6['id'];if(_0xeff6fc[_0x758a('0x35')][_0x758a('0x43')]){_0x13339a[_0x758a('0x40')]=_[_0x758a('0x41')](_0x13339a[_0x758a('0x40')],{'$or':_[_0x758a('0x2e')](_0x13339a['attributes'],function(_0x43fa59){var _0x5459a8={};_0x5459a8[_0x43fa59]={'$like':'%'+_0xeff6fc[_0x758a('0x35')]['filter']+'%'};return _0x5459a8;})});}_0x13339a=_[_0x758a('0x41')]({},_0x13339a,_0xeff6fc[_0x758a('0x44')]);return db[_0x758a('0x63')][_0x758a('0x20')]({'where':_0x13339a[_0x758a('0x40')]})[_0x758a('0x28')](function(_0x2c3178){_0x25a8af['count']=_0x2c3178;if(_0xeff6fc['query'][_0x758a('0x45')]){_0x13339a[_0x758a('0x46')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x13339a);})['then'](function(_0x21d7a9){_0x25a8af['rows']=_0x21d7a9;return _0x25a8af;});}})[_0x758a('0x28')](respondWithFilteredResult(_0x502c70,_0x13339a))['catch'](handleError(_0x502c70,null));};exports[_0x758a('0x64')]=function(_0xbe5954,_0x37250c,_0x5887eb){var _0x428a2e={};var _0x8dde1b={};var _0x404175;var _0x32d266;return db['Campaign'][_0x758a('0x61')]({'where':{'id':_0xbe5954[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x37250c,null))['then'](function(_0x2a952e){if(_0x2a952e){_0x404175=_0x2a952e;_0x8dde1b[_0x758a('0x3b')]=_['keys'](db[_0x758a('0x65')][_0x758a('0x30')]);_0x8dde1b[_0x758a('0x35')]=_[_0x758a('0x34')](_0xbe5954['query']);_0x8dde1b['filters']=_[_0x758a('0x37')](_0x8dde1b['model'],_0x8dde1b[_0x758a('0x35')]);_0x428a2e[_0x758a('0x38')]=_['intersection'](_0x8dde1b['model'],qs[_0x758a('0x39')](_0xbe5954['query'][_0x758a('0x39')]));_0x428a2e[_0x758a('0x38')]=_0x428a2e[_0x758a('0x38')][_0x758a('0x3a')]?_0x428a2e[_0x758a('0x38')]:_0x8dde1b[_0x758a('0x3b')];_0x428a2e[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0xbe5954['query']['sort']);_0x428a2e['where']=qs[_0x758a('0x36')](_[_0x758a('0x3f')](_0xbe5954[_0x758a('0x35')],_0x8dde1b[_0x758a('0x36')]));if(_0xbe5954[_0x758a('0x35')][_0x758a('0x43')]){_0x428a2e[_0x758a('0x40')]=_['merge'](_0x428a2e['where'],{'$or':_['map'](_0x428a2e[_0x758a('0x38')],function(_0x4bbea1){var _0x4456e8={};_0x4456e8[_0x4bbea1]={'$like':'%'+_0xbe5954[_0x758a('0x35')][_0x758a('0x43')]+'%'};return _0x4456e8;})});}_0x428a2e=_[_0x758a('0x41')]({},_0x428a2e,_0xbe5954['options']);return _0x404175[_0x758a('0x64')](_0x428a2e);}})['then'](function(_0x4e4c4f){if(_0x4e4c4f){_0x32d266=_0x4e4c4f[_0x758a('0x3a')];if(!_0xbe5954[_0x758a('0x35')][_0x758a('0x5c')](_0x758a('0x3c'))){_0x428a2e[_0x758a('0x21')]=qs['limit'](_0xbe5954[_0x758a('0x35')][_0x758a('0x21')]);_0x428a2e[_0x758a('0x1e')]=qs[_0x758a('0x1e')](_0xbe5954[_0x758a('0x35')][_0x758a('0x1e')]);}return _0x404175[_0x758a('0x64')](_0x428a2e);}})[_0x758a('0x28')](function(_0x4b126e){if(_0x4b126e){return _0x4b126e?{'count':_0x32d266,'rows':_0x4b126e}:null;}})[_0x758a('0x28')](respondWithResult(_0x37250c,null))[_0x758a('0x49')](handleError(_0x37250c,null));};exports[_0x758a('0x66')]=function(_0x417580,_0x6da7cf,_0x419ec1){var _0xf89ed6,_0x5da3e1;var _0x38bab9=[];var _0x1fc5a1=moment()[_0x758a('0x67')](_0x758a('0x68'));return db[_0x758a('0x2f')][_0x758a('0x52')]({'where':{'id':_0x417580[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x6da7cf,null))['then'](function(_0xf7ff3c){if(_0xf7ff3c){_0x5da3e1=_0xf7ff3c;return _0xf7ff3c[_0x758a('0x66')](_0x417580['body'][_0x758a('0x69')],_[_0x758a('0x55')](_0x417580['body'],[_0x758a('0x69'),'id'])||{});}return null;})['spread'](function(_0x3b9901){var _0x1ef5be;var _0x39a442;_0xf89ed6=_0x3b9901||[];var _0x17a14e=[];if(_0x3b9901){for(var _0x4061bf=0x0;_0x4061bf<_0x3b9901[_0x758a('0x3a')];_0x4061bf+=0x1){var _0x5f3ea6=_0x3b9901[_0x4061bf]['get']({'plain':!![]});_0x5da3e1[_0x758a('0x6a')]=_0x417580[_0x758a('0x4c')]['dialCheckDuplicateType']?_0x417580[_0x758a('0x4c')][_0x758a('0x6a')]:_0x5da3e1[_0x758a('0x6a')];switch(_0x5da3e1[_0x758a('0x6a')]){case'always':_0x1ef5be=squel[_0x758a('0x6b')]()[_0x758a('0x6c')]('cm_hopper')[_0x758a('0x6d')]([_0x758a('0x6e'),_0x758a('0x6f'),_0x758a('0x70'),'ListId',_0x758a('0x5d'),_0x758a('0x56'),_0x758a('0x57')],squel[_0x758a('0x71')]()[_0x758a('0x72')](_0x758a('0x6e'),'phone')[_0x758a('0x72')]('NOW()',_0x758a('0x6f'))[_0x758a('0x72')]('id',_0x758a('0x70'))['field'](_0x5f3ea6[_0x758a('0x73')][_0x758a('0x74')](),'ListId')[_0x758a('0x72')](_0x417580['params']['id'][_0x758a('0x74')](),_0x758a('0x5d'))[_0x758a('0x72')]('\x27'+_0x1fc5a1+'\x27','createdAt')[_0x758a('0x72')]('\x27'+_0x1fc5a1+'\x27',_0x758a('0x57'))['from'](_0x758a('0x75'))[_0x758a('0x40')](_0x758a('0x76'))[_0x758a('0x40')](_0x758a('0x77'),_0x5f3ea6[_0x758a('0x73')][_0x758a('0x74')]())[_0x758a('0x40')](_0x758a('0x78'))[_0x758a('0x40')](_0x758a('0x79'),squel['select']()[_0x758a('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0x758a('0x7a')](_0x758a('0x7b'))[_0x758a('0x40')](_0x758a('0x7c'),_0x417580[_0x758a('0x5a')]['id']['toString']()))[_0x758a('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x758a('0x71')]()['field'](_0x758a('0x7d'))[_0x758a('0x7a')](_0x758a('0x7e'))[_0x758a('0x40')](_0x758a('0x7c'),_0x417580[_0x758a('0x5a')]['id'][_0x758a('0x74')]())))[_0x758a('0x74')]();break;case _0x758a('0x7f'):_0x1ef5be=squel['insert']()[_0x758a('0x6c')](_0x758a('0x7e'))[_0x758a('0x6d')]([_0x758a('0x6e'),_0x758a('0x6f'),'ContactId','ListId','CampaignId',_0x758a('0x56'),_0x758a('0x57')],squel['select']()[_0x758a('0x72')]('phone','phone')[_0x758a('0x72')]('NOW()',_0x758a('0x6f'))[_0x758a('0x72')]('id','ContactId')[_0x758a('0x72')](_0x5f3ea6[_0x758a('0x73')]['toString'](),'ListId')[_0x758a('0x72')](_0x417580['params']['id']['toString'](),'CampaignId')[_0x758a('0x72')]('\x27'+_0x1fc5a1+'\x27','createdAt')[_0x758a('0x72')]('\x27'+_0x1fc5a1+'\x27','updatedAt')[_0x758a('0x7a')](_0x758a('0x75'))[_0x758a('0x40')](_0x758a('0x76'))['where']('ListId\x20=\x20?',_0x5f3ea6[_0x758a('0x73')][_0x758a('0x74')]())[_0x758a('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x758a('0x40')](_0x758a('0x79'),squel[_0x758a('0x71')]()[_0x758a('0x72')](_0x758a('0x7d'))[_0x758a('0x7a')]('cm_hopper')[_0x758a('0x40')](_0x758a('0x7c'),_0x417580[_0x758a('0x5a')]['id'][_0x758a('0x74')]())))[_0x758a('0x74')]();break;default:_0x1ef5be=squel[_0x758a('0x6b')]()[_0x758a('0x6c')](_0x758a('0x7e'))['fromQuery']([_0x758a('0x6e'),_0x758a('0x6f'),_0x758a('0x70'),_0x758a('0x80'),_0x758a('0x5d'),'createdAt','updatedAt'],squel[_0x758a('0x71')]()[_0x758a('0x72')](_0x758a('0x6e'),_0x758a('0x6e'))[_0x758a('0x72')](_0x758a('0x81'),_0x758a('0x6f'))[_0x758a('0x72')]('id',_0x758a('0x70'))[_0x758a('0x72')](_0x5f3ea6[_0x758a('0x73')][_0x758a('0x74')](),_0x758a('0x80'))[_0x758a('0x72')](_0x417580[_0x758a('0x5a')]['id']['toString'](),_0x758a('0x5d'))[_0x758a('0x72')]('\x27'+_0x1fc5a1+'\x27',_0x758a('0x56'))['field']('\x27'+_0x1fc5a1+'\x27',_0x758a('0x57'))['from'](_0x758a('0x75'))[_0x758a('0x40')](_0x758a('0x76'))[_0x758a('0x40')](_0x758a('0x77'),_0x5f3ea6[_0x758a('0x73')][_0x758a('0x74')]())['where'](_0x758a('0x78')))['toString']();}_0x39a442=squel['insert']()[_0x758a('0x6c')]('cm_hopper_additional_phones')[_0x758a('0x6d')]([_0x758a('0x82'),_0x758a('0x6f'),'phone','OrderBy','createdAt',_0x758a('0x57')],squel[_0x758a('0x71')]()[_0x758a('0x72')]('h.id','id')[_0x758a('0x72')](_0x758a('0x81'),_0x758a('0x6f'))[_0x758a('0x72')](_0x758a('0x83'),_0x758a('0x6e'))['field']('ci.OrderBY',_0x758a('0x84'))['field']('\x27'+_0x1fc5a1+'\x27',_0x758a('0x56'))[_0x758a('0x72')]('\x27'+_0x1fc5a1+'\x27','updatedAt')['from'](_0x758a('0x85'),'ci')[_0x758a('0x86')](_0x758a('0x7e'),'h',_0x758a('0x87'))[_0x758a('0x40')]('h.ListId\x20=\x20?',_0x5f3ea6[_0x758a('0x73')][_0x758a('0x74')]())['where'](_0x758a('0x88'),_0x417580[_0x758a('0x5a')]['id'][_0x758a('0x74')]())[_0x758a('0x40')]('h.createdAt\x20=\x20?',_0x1fc5a1))[_0x758a('0x74')]();_0x17a14e[_0x758a('0x89')](db[_0x758a('0x8a')]['query'](_0x1ef5be));_0x38bab9[_0x758a('0x89')](db[_0x758a('0x8a')]['query'](_0x39a442));}return BPromise[_0x758a('0x8b')](_0x17a14e);}})[_0x758a('0x28')](function(){return BPromise[_0x758a('0x8b')](_0x38bab9);})[_0x758a('0x28')](function(){return _0xf89ed6;})[_0x758a('0x28')](respondWithResult(_0x6da7cf,null))[_0x758a('0x49')](handleError(_0x6da7cf,null));};exports[_0x758a('0x8c')]=function(_0x56e4bf,_0x596a3a,_0x1942e7){return db['Campaign']['find']({'where':{'id':_0x56e4bf[_0x758a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x596a3a,null))['then'](function(_0x3e9380){if(_0x3e9380){return _0x3e9380[_0x758a('0x8c')](_0x56e4bf[_0x758a('0x35')][_0x758a('0x69')]);}})[_0x758a('0x28')](function(_0x4f05c7){if(_0x4f05c7){return db[_0x758a('0x5b')]['destroy']({'where':{'ListId':_0x56e4bf[_0x758a('0x35')][_0x758a('0x69')],'CampaignId':_0x56e4bf['params']['id']}})[_0x758a('0x28')](function(){return _0x4f05c7;});}})[_0x758a('0x28')](respondWithStatusCode(_0x596a3a,null))[_0x758a('0x49')](handleError(_0x596a3a,null));};exports[_0x758a('0x8d')]=function(_0x51fe05,_0x50824e,_0x25018f){var _0xe19fe9={};var _0x580100={};var _0x2e99db;var _0x15931f;return db[_0x758a('0x2f')][_0x758a('0x61')]({'where':{'id':_0x51fe05[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x50824e,null))[_0x758a('0x28')](function(_0x2f960e){if(_0x2f960e){_0x2e99db=_0x2f960e;_0x580100['model']=_[_0x758a('0x34')](db[_0x758a('0x65')][_0x758a('0x30')]);_0x580100[_0x758a('0x35')]=_['keys'](_0x51fe05[_0x758a('0x35')]);_0x580100[_0x758a('0x36')]=_[_0x758a('0x37')](_0x580100['model'],_0x580100[_0x758a('0x35')]);_0xe19fe9[_0x758a('0x38')]=_[_0x758a('0x37')](_0x580100['model'],qs[_0x758a('0x39')](_0x51fe05['query'][_0x758a('0x39')]));_0xe19fe9[_0x758a('0x38')]=_0xe19fe9[_0x758a('0x38')][_0x758a('0x3a')]?_0xe19fe9[_0x758a('0x38')]:_0x580100[_0x758a('0x3b')];_0xe19fe9[_0x758a('0x3d')]=qs[_0x758a('0x3e')](_0x51fe05[_0x758a('0x35')]['sort']);_0xe19fe9[_0x758a('0x40')]=qs[_0x758a('0x36')](_[_0x758a('0x3f')](_0x51fe05[_0x758a('0x35')],_0x580100[_0x758a('0x36')]));if(_0x51fe05[_0x758a('0x35')][_0x758a('0x43')]){_0xe19fe9[_0x758a('0x40')]=_['merge'](_0xe19fe9[_0x758a('0x40')],{'$or':_[_0x758a('0x2e')](_0xe19fe9[_0x758a('0x38')],function(_0x3cc36d){var _0x1b29ae={};_0x1b29ae[_0x3cc36d]={'$like':'%'+_0x51fe05[_0x758a('0x35')][_0x758a('0x43')]+'%'};return _0x1b29ae;})});}_0xe19fe9=_[_0x758a('0x41')]({},_0xe19fe9,_0x51fe05[_0x758a('0x44')]);return _0x2e99db['getBlackLists'](_0xe19fe9);}})[_0x758a('0x28')](function(_0x508df7){if(_0x508df7){_0x15931f=_0x508df7[_0x758a('0x3a')];if(!_0x51fe05[_0x758a('0x35')][_0x758a('0x5c')](_0x758a('0x3c'))){_0xe19fe9[_0x758a('0x21')]=qs['limit'](_0x51fe05[_0x758a('0x35')]['limit']);_0xe19fe9[_0x758a('0x1e')]=qs['offset'](_0x51fe05[_0x758a('0x35')]['offset']);}return _0x2e99db[_0x758a('0x8d')](_0xe19fe9);}})['then'](function(_0x195067){if(_0x195067){return _0x195067?{'count':_0x15931f,'rows':_0x195067}:null;}})[_0x758a('0x28')](respondWithResult(_0x50824e,null))[_0x758a('0x49')](handleError(_0x50824e,null));};exports[_0x758a('0x8e')]=function(_0x57467d,_0x28e721,_0x14112a){var _0x4a337e,_0xbea609;var _0x459616=[];var _0x1a1382=moment()[_0x758a('0x67')](_0x758a('0x68'));return db[_0x758a('0x2f')][_0x758a('0x52')]({'where':{'id':_0x57467d[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x28e721,null))[_0x758a('0x28')](function(_0x193625){if(_0x193625){_0xbea609=_0x193625;return _0x193625['addBlackLists'](_0x57467d[_0x758a('0x4c')][_0x758a('0x69')],_[_0x758a('0x55')](_0x57467d[_0x758a('0x4c')],[_0x758a('0x69'),'id'])||{});}return null;})['spread'](function(_0x5aa63a){var _0x43155e;var _0x2d73d8;_0x4a337e=_0x5aa63a||[];var _0x1c54c8=[];if(_0x5aa63a){for(var _0x12efc8=0x0;_0x12efc8<_0x5aa63a['length'];_0x12efc8+=0x1){var _0x5460f1=_0x5aa63a[_0x12efc8][_0x758a('0x29')]({'plain':!![]});_0x43155e=squel[_0x758a('0x6b')]()[_0x758a('0x6c')](_0x758a('0x8f'))[_0x758a('0x6d')](['phone','ContactId','ListId','CampaignId',_0x758a('0x56'),_0x758a('0x57')],squel[_0x758a('0x71')]()[_0x758a('0x72')](_0x758a('0x6e'),_0x758a('0x6e'))[_0x758a('0x72')]('id',_0x758a('0x70'))[_0x758a('0x72')](_0x5460f1[_0x758a('0x73')]['toString'](),_0x758a('0x80'))[_0x758a('0x72')](_0x57467d['params']['id'][_0x758a('0x74')](),'CampaignId')[_0x758a('0x72')](_0x758a('0x81'),_0x758a('0x56'))[_0x758a('0x72')](_0x758a('0x81'),_0x758a('0x57'))[_0x758a('0x7a')](_0x758a('0x75'))[_0x758a('0x40')]('deletedAt\x20IS\x20NULL')[_0x758a('0x40')](_0x758a('0x77'),_0x5460f1[_0x758a('0x73')][_0x758a('0x74')]())[_0x758a('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x758a('0x74')]();_0x1c54c8[_0x758a('0x89')](db[_0x758a('0x8a')][_0x758a('0x35')](_0x43155e));}return BPromise[_0x758a('0x8b')](_0x1c54c8);}})[_0x758a('0x28')](function(){return _0x4a337e;})['then'](respondWithResult(_0x28e721,null))[_0x758a('0x49')](handleError(_0x28e721,null));};exports['removeBlackLists']=function(_0x3b10ea,_0x1122e2,_0x5d59e6){return db['Campaign'][_0x758a('0x52')]({'where':{'id':_0x3b10ea[_0x758a('0x5a')]['id']}})[_0x758a('0x28')](handleEntityNotFound(_0x1122e2,null))['then'](function(_0x16ad4c){if(_0x16ad4c){return _0x16ad4c['removeBlackLists'](_0x3b10ea[_0x758a('0x35')]['ids']);}})[_0x758a('0x28')](function(_0x5770eb){if(_0x5770eb){return db[_0x758a('0x63')][_0x758a('0x27')]({'where':{'ListId':_0x3b10ea['query'][_0x758a('0x69')],'CampaignId':_0x3b10ea['params']['id']}})['then'](function(){return _0x5770eb;});}})['then'](respondWithStatusCode(_0x1122e2,null))[_0x758a('0x49')](handleError(_0x1122e2,null));};
\ No newline at end of file
+var _0x8307=['getHopperHistories','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','select','field','scheduledAt','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','from','onlyIfOpen','fromQuery','NOW()','cm_contacts','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','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','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','rows'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8307,0xc4));var _0x7830=function(_0x2969f0,_0x11b411){_0x2969f0=_0x2969f0-0x0;var _0x2ca8c0=_0x8307[_0x2969f0];return _0x2ca8c0;};'use strict';var emlformat=require(_0x7830('0x0'));var rimraf=require(_0x7830('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7830('0x2'));var rp=require(_0x7830('0x3'));var moment=require(_0x7830('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7830('0x5'));var util=require(_0x7830('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7830('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7830('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7830('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7830('0xa'));var toCsv=require(_0x7830('0x7'));var querystring=require('querystring');var Papa=require(_0x7830('0xb'));var Redis=require(_0x7830('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7830('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7830('0xe'))(_0x7830('0xf'));var utils=require(_0x7830('0x10'));var config=require(_0x7830('0x11'));var licenseUtil=require(_0x7830('0x12'));var db=require(_0x7830('0x13'))['db'];function respondWithStatusCode(_0x36e303,_0x39450e){_0x39450e=_0x39450e||0xcc;return function(_0x4fdb60){if(_0x4fdb60){return _0x36e303[_0x7830('0x14')](_0x39450e);}return _0x36e303[_0x7830('0x15')](_0x39450e)[_0x7830('0x16')]();};}function respondWithResult(_0x5db865,_0x4dd3e0){_0x4dd3e0=_0x4dd3e0||0xc8;return function(_0x5818f6){if(_0x5818f6){return _0x5db865[_0x7830('0x15')](_0x4dd3e0)['json'](_0x5818f6);}};}function respondWithFilteredResult(_0x27d88a,_0x16b7e7){return function(_0x29a4bd){if(_0x29a4bd){var _0x38906b=typeof _0x16b7e7[_0x7830('0x17')]===_0x7830('0x18')&&typeof _0x16b7e7[_0x7830('0x19')]===_0x7830('0x18');var _0x355c4e=_0x29a4bd[_0x7830('0x1a')];var _0x3bc49a=_0x38906b?0x0:_0x16b7e7[_0x7830('0x17')];var _0xf5cda=_0x38906b?_0x29a4bd[_0x7830('0x1a')]:_0x16b7e7[_0x7830('0x17')]+_0x16b7e7['limit'];var _0x40674b;if(_0xf5cda>=_0x355c4e){_0xf5cda=_0x355c4e;_0x40674b=0xc8;}else{_0x40674b=0xce;}_0x27d88a[_0x7830('0x15')](_0x40674b);return _0x27d88a[_0x7830('0x1b')](_0x7830('0x1c'),_0x3bc49a+'-'+_0xf5cda+'/'+_0x355c4e)[_0x7830('0x1d')](_0x29a4bd);}return null;};}function patchUpdates(_0x3966bd){return function(_0x1eaf27){try{jsonpatch[_0x7830('0x1e')](_0x1eaf27,_0x3966bd,!![]);}catch(_0x492be9){return BPromise[_0x7830('0x1f')](_0x492be9);}return _0x1eaf27[_0x7830('0x20')]();};}function saveUpdates(_0x8d90af,_0x152213){return function(_0x3ab7d6){if(_0x3ab7d6){return _0x3ab7d6['update'](_0x8d90af)[_0x7830('0x21')](function(_0x168546){return _0x168546;});}return null;};}function removeEntity(_0x3da993,_0x56efc3){return function(_0x2f69d3){if(_0x2f69d3){return _0x2f69d3['destroy']()['then'](function(){var _0x11668a=_0x2f69d3[_0x7830('0x22')]({'plain':!![]});var _0x449d4b=_0x7830('0x23');return db[_0x7830('0x24')][_0x7830('0x25')]({'where':{'type':_0x449d4b,'resourceId':_0x11668a['id']}})[_0x7830('0x21')](function(){return _0x2f69d3;});})[_0x7830('0x21')](function(){_0x3da993[_0x7830('0x15')](0xcc)[_0x7830('0x16')]();});}};}function handleEntityNotFound(_0xc6ca8e,_0x17b1c6){return function(_0x5cbfc2){if(!_0x5cbfc2){_0xc6ca8e[_0x7830('0x14')](0x194);}return _0x5cbfc2;};}function handleError(_0x214f4b,_0x555eab){_0x555eab=_0x555eab||0x1f4;return function(_0x2a6018){logger[_0x7830('0x26')](_0x2a6018['stack']);if(_0x2a6018[_0x7830('0x27')]){delete _0x2a6018[_0x7830('0x27')];}_0x214f4b['status'](_0x555eab)[_0x7830('0x28')](_0x2a6018);};}exports[_0x7830('0x29')]=function(_0x14a345,_0x12debf){var _0x461fe={},_0x172bb7={},_0x4f798d={'count':0x0,'rows':[]};var _0x116fdd=_[_0x7830('0x2a')](db[_0x7830('0x2b')][_0x7830('0x2c')],function(_0x10baa5){return{'name':_0x10baa5[_0x7830('0x2d')],'type':_0x10baa5[_0x7830('0x2e')][_0x7830('0x2f')]};});_0x172bb7[_0x7830('0x30')]=_[_0x7830('0x2a')](_0x116fdd,_0x7830('0x27'));_0x172bb7[_0x7830('0x31')]=_[_0x7830('0x32')](_0x14a345[_0x7830('0x31')]);_0x172bb7[_0x7830('0x33')]=_['intersection'](_0x172bb7[_0x7830('0x30')],_0x172bb7[_0x7830('0x31')]);_0x461fe['attributes']=_[_0x7830('0x34')](_0x172bb7['model'],qs['fields'](_0x14a345[_0x7830('0x31')][_0x7830('0x35')]));_0x461fe[_0x7830('0x36')]=_0x461fe[_0x7830('0x36')][_0x7830('0x37')]?_0x461fe[_0x7830('0x36')]:_0x172bb7[_0x7830('0x30')];if(!_0x14a345['query'][_0x7830('0x38')](_0x7830('0x39'))){_0x461fe[_0x7830('0x19')]=qs[_0x7830('0x19')](_0x14a345[_0x7830('0x31')][_0x7830('0x19')]);_0x461fe['offset']=qs['offset'](_0x14a345[_0x7830('0x31')][_0x7830('0x17')]);}_0x461fe[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x14a345[_0x7830('0x31')][_0x7830('0x3b')]);_0x461fe[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x14a345[_0x7830('0x31')],_0x172bb7[_0x7830('0x33')]),_0x116fdd);if(_0x14a345[_0x7830('0x31')][_0x7830('0x3e')]){_0x461fe[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x461fe[_0x7830('0x3c')],{'$or':_['map'](_0x116fdd,function(_0x4cf61c){if(_0x4cf61c[_0x7830('0x2e')]!==_0x7830('0x40')){var _0x5487cf={};_0x5487cf[_0x4cf61c[_0x7830('0x27')]]={'$like':'%'+_0x14a345[_0x7830('0x31')]['filter']+'%'};return _0x5487cf;}})});}_0x461fe=_[_0x7830('0x3f')]({},_0x461fe,_0x14a345['options']);var _0x50579b={'where':_0x461fe[_0x7830('0x3c')]};return db['Campaign']['count'](_0x50579b)[_0x7830('0x21')](function(_0x623843){_0x4f798d[_0x7830('0x1a')]=_0x623843;if(_0x14a345['query'][_0x7830('0x41')]){_0x461fe[_0x7830('0x42')]=[{'all':!![]}];}return db['Campaign'][_0x7830('0x43')](_0x461fe);})[_0x7830('0x21')](function(_0xfb5857){_0x4f798d['rows']=_0xfb5857;return _0x4f798d;})[_0x7830('0x21')](respondWithFilteredResult(_0x12debf,_0x461fe))[_0x7830('0x44')](handleError(_0x12debf,null));};exports[_0x7830('0x45')]=function(_0x25b00d,_0x3bfaab){var _0x525fcc={'raw':![],'where':{'id':_0x25b00d[_0x7830('0x46')]['id']}},_0x3f2a4a={};_0x3f2a4a[_0x7830('0x30')]=_[_0x7830('0x32')](db['Campaign']['rawAttributes']);_0x3f2a4a[_0x7830('0x31')]=_[_0x7830('0x32')](_0x25b00d[_0x7830('0x31')]);_0x3f2a4a[_0x7830('0x33')]=_[_0x7830('0x34')](_0x3f2a4a[_0x7830('0x30')],_0x3f2a4a[_0x7830('0x31')]);_0x525fcc['attributes']=_[_0x7830('0x34')](_0x3f2a4a[_0x7830('0x30')],qs[_0x7830('0x35')](_0x25b00d[_0x7830('0x31')][_0x7830('0x35')]));_0x525fcc[_0x7830('0x36')]=_0x525fcc[_0x7830('0x36')]['length']?_0x525fcc[_0x7830('0x36')]:_0x3f2a4a[_0x7830('0x30')];if(_0x25b00d[_0x7830('0x31')][_0x7830('0x41')]){_0x525fcc[_0x7830('0x42')]=[{'all':!![]}];}_0x525fcc=_[_0x7830('0x3f')]({},_0x525fcc,_0x25b00d[_0x7830('0x47')]);return db['Campaign'][_0x7830('0x48')](_0x525fcc)[_0x7830('0x21')](handleEntityNotFound(_0x3bfaab,null))['then'](respondWithResult(_0x3bfaab,null))[_0x7830('0x44')](handleError(_0x3bfaab,null));};exports[_0x7830('0x49')]=function(_0x28c373,_0x1e74e0){return db[_0x7830('0x2b')][_0x7830('0x49')](_0x28c373[_0x7830('0x4a')],{})[_0x7830('0x21')](function(_0x3b03bb){var _0x357300=_0x28c373[_0x7830('0x4b')]['get']({'plain':!![]});if(!_0x357300)throw new Error(_0x7830('0x4c'));if(_0x357300[_0x7830('0x4d')]===_0x7830('0x4b')){var _0x3d789b=_0x3b03bb['get']({'plain':!![]});var _0x42ebde=_0x7830('0x23');return db[_0x7830('0x4e')][_0x7830('0x48')]({'where':{'name':_0x42ebde,'userProfileId':_0x357300[_0x7830('0x4f')]},'raw':!![]})[_0x7830('0x21')](function(_0x32e7bf){if(_0x32e7bf&&_0x32e7bf[_0x7830('0x50')]===0x0){return db['UserProfileResource'][_0x7830('0x49')]({'name':_0x3d789b[_0x7830('0x27')],'resourceId':_0x3d789b['id'],'type':_0x32e7bf[_0x7830('0x27')],'sectionId':_0x32e7bf['id']},{})[_0x7830('0x21')](function(){return _0x3b03bb;});}else{return _0x3b03bb;}})[_0x7830('0x44')](function(_0x341ca9){logger[_0x7830('0x26')](_0x7830('0x51'),_0x341ca9);throw _0x341ca9;});}return _0x3b03bb;})[_0x7830('0x21')](respondWithResult(_0x1e74e0,0xc9))[_0x7830('0x44')](handleError(_0x1e74e0,null));};exports[_0x7830('0x52')]=function(_0xc09d5a,_0x35f188){var _0x7985bb={'where':{'id':_0xc09d5a[_0x7830('0x46')]['id']}},_0x5a7b5c={};_0x5a7b5c[_0x7830('0x30')]=_['keys'](db[_0x7830('0x2b')]['rawAttributes']);_0x7985bb[_0x7830('0x36')]=_[_0x7830('0x34')](_0x5a7b5c['model'],qs[_0x7830('0x35')](_0xc09d5a['query']['fields']));_0x7985bb[_0x7830('0x36')]=_0x7985bb[_0x7830('0x36')][_0x7830('0x37')]?_0x7985bb[_0x7830('0x36')]:_0x5a7b5c[_0x7830('0x30')];if(_0xc09d5a[_0x7830('0x31')][_0x7830('0x41')]){_0x7985bb['include']=[{'all':!![]}];}_0x7985bb=_[_0x7830('0x3f')]({},_0x7985bb,_0xc09d5a[_0x7830('0x47')]);return db[_0x7830('0x2b')][_0x7830('0x48')](_0x7985bb)[_0x7830('0x21')](handleEntityNotFound(_0x35f188,null))[_0x7830('0x21')](function(_0x3e6d34){if(_0x3e6d34){var _0x139608=_0x3e6d34[_0x7830('0x22')]({'plain':!![]});_0x139608=qs[_0x7830('0x53')](_0x139608,['id',_0x7830('0x54'),_0x7830('0x55')]);_0xc09d5a[_0x7830('0x4a')]=_[_0x7830('0x53')](_0xc09d5a['body'],['id',_0x7830('0x54'),_0x7830('0x55')]);return db['Campaign'][_0x7830('0x49')](_['merge'](_0x139608,_0xc09d5a[_0x7830('0x4a')]),{'include':_0xc09d5a[_0x7830('0x31')][_0x7830('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x315df4){var _0x598f98=_0xc09d5a[_0x7830('0x4b')][_0x7830('0x22')]({'plain':!![]});if(!_0x598f98)throw new Error(_0x7830('0x4c'));if(_0x598f98[_0x7830('0x4d')]===_0x7830('0x4b')){var _0x4edc54=_0x315df4[_0x7830('0x22')]({'plain':!![]});var _0xced78a=_0x7830('0x23');return db[_0x7830('0x4e')][_0x7830('0x48')]({'where':{'name':_0xced78a,'userProfileId':_0x598f98[_0x7830('0x4f')]},'raw':!![]})['then'](function(_0x2f683e){if(_0x2f683e&&_0x2f683e['autoAssociation']===0x0){return db[_0x7830('0x24')][_0x7830('0x49')]({'name':_0x4edc54['name'],'resourceId':_0x4edc54['id'],'type':_0x2f683e[_0x7830('0x27')],'sectionId':_0x2f683e['id']},{})['then'](function(){return _0x315df4;});}else{return _0x315df4;}})[_0x7830('0x44')](function(_0x184883){logger[_0x7830('0x26')](_0x7830('0x51'),_0x184883);throw _0x184883;});}return _0x315df4;});}})[_0x7830('0x21')](respondWithResult(_0x35f188,0xc9))[_0x7830('0x44')](handleError(_0x35f188,null));};exports['update']=function(_0x407be0,_0x189009){if(_0x407be0[_0x7830('0x4a')]['id']){delete _0x407be0['body']['id'];}return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x407be0[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x189009,null))[_0x7830('0x21')](saveUpdates(_0x407be0[_0x7830('0x4a')],null))[_0x7830('0x21')](respondWithResult(_0x189009,null))[_0x7830('0x44')](handleError(_0x189009,null));};exports[_0x7830('0x25')]=function(_0xda6837,_0x4b1162){return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0xda6837[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x4b1162,null))['then'](removeEntity(_0x4b1162,null))[_0x7830('0x44')](handleError(_0x4b1162,null));};exports[_0x7830('0x56')]=function(_0x384da4,_0x590f92,_0x3c05ab){var _0xda1b4f={'raw':!![],'where':{}};var _0xde637c={};var _0x3a0b0b={'count':0x0,'rows':[]};return db['Campaign'][_0x7830('0x57')]({'where':{'id':_0x384da4[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x590f92,null))[_0x7830('0x21')](function(_0x8ed649){if(_0x8ed649){_0xde637c[_0x7830('0x30')]=_['keys'](db[_0x7830('0x58')][_0x7830('0x2c')]);_0xde637c[_0x7830('0x31')]=_[_0x7830('0x32')](_0x384da4[_0x7830('0x31')]);_0xde637c['filters']=_['intersection'](_0xde637c[_0x7830('0x30')],_0xde637c[_0x7830('0x31')]);_0xda1b4f[_0x7830('0x36')]=_['intersection'](_0xde637c[_0x7830('0x30')],qs['fields'](_0x384da4[_0x7830('0x31')][_0x7830('0x35')]));_0xda1b4f[_0x7830('0x36')]=_0xda1b4f[_0x7830('0x36')]['length']?_0xda1b4f[_0x7830('0x36')]:_0xde637c['model'];if(!_0x384da4[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0xda1b4f['limit']=qs[_0x7830('0x19')](_0x384da4[_0x7830('0x31')]['limit']);_0xda1b4f[_0x7830('0x17')]=qs['offset'](_0x384da4[_0x7830('0x31')][_0x7830('0x17')]);}_0xda1b4f[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x384da4[_0x7830('0x31')][_0x7830('0x3b')]);_0xda1b4f[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x384da4['query'],_0xde637c[_0x7830('0x33')]));_0xda1b4f[_0x7830('0x3c')]['CampaignId']=_0x8ed649['id'];if(_0x384da4['query']['filter']){_0xda1b4f[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0xda1b4f[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0xda1b4f[_0x7830('0x36')],function(_0x262c2c){var _0xf39aed={};_0xf39aed[_0x262c2c]={'$like':'%'+_0x384da4['query'][_0x7830('0x3e')]+'%'};return _0xf39aed;})});}_0xda1b4f=_['merge']({},_0xda1b4f,_0x384da4[_0x7830('0x47')]);return db['CmHopper'][_0x7830('0x1a')]({'where':_0xda1b4f[_0x7830('0x3c')]})[_0x7830('0x21')](function(_0x4787){_0x3a0b0b['count']=_0x4787;if(_0x384da4[_0x7830('0x31')][_0x7830('0x41')]){_0xda1b4f[_0x7830('0x42')]=[{'all':!![]}];}return db[_0x7830('0x58')][_0x7830('0x43')](_0xda1b4f);})['then'](function(_0x4d3b6f){_0x3a0b0b[_0x7830('0x59')]=_0x4d3b6f;return _0x3a0b0b;});}})['then'](respondWithFilteredResult(_0x590f92,_0xda1b4f))['catch'](handleError(_0x590f92,null));};exports[_0x7830('0x5a')]=function(_0x5a7400,_0x21e6be,_0x41843e){var _0x59ead9={'raw':!![],'where':{}};var _0x2f2289={};var _0x4b0559={'count':0x0,'rows':[]};return db[_0x7830('0x2b')]['findOne']({'where':{'id':_0x5a7400[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x21e6be,null))[_0x7830('0x21')](function(_0x4c8fea){if(_0x4c8fea){_0x2f2289[_0x7830('0x30')]=_[_0x7830('0x32')](db['CmHopperHistory'][_0x7830('0x2c')]);_0x2f2289['query']=_[_0x7830('0x32')](_0x5a7400[_0x7830('0x31')]);_0x2f2289[_0x7830('0x33')]=_['intersection'](_0x2f2289[_0x7830('0x30')],_0x2f2289[_0x7830('0x31')]);_0x59ead9[_0x7830('0x36')]=_[_0x7830('0x34')](_0x2f2289['model'],qs['fields'](_0x5a7400[_0x7830('0x31')][_0x7830('0x35')]));_0x59ead9[_0x7830('0x36')]=_0x59ead9['attributes'][_0x7830('0x37')]?_0x59ead9[_0x7830('0x36')]:_0x2f2289[_0x7830('0x30')];if(!_0x5a7400['query']['hasOwnProperty'](_0x7830('0x39'))){_0x59ead9[_0x7830('0x19')]=qs['limit'](_0x5a7400[_0x7830('0x31')]['limit']);_0x59ead9['offset']=qs[_0x7830('0x17')](_0x5a7400['query'][_0x7830('0x17')]);}_0x59ead9['order']=qs['sort'](_0x5a7400[_0x7830('0x31')][_0x7830('0x3b')]);_0x59ead9['where']=qs['filters'](_['pick'](_0x5a7400['query'],_0x2f2289[_0x7830('0x33')]));_0x59ead9[_0x7830('0x3c')][_0x7830('0x5b')]=_0x4c8fea['id'];if(_0x5a7400[_0x7830('0x31')]['filter']){_0x59ead9[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x59ead9[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x59ead9[_0x7830('0x36')],function(_0x3fedc0){var _0xecdac8={};_0xecdac8[_0x3fedc0]={'$like':'%'+_0x5a7400[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0xecdac8;})});}_0x59ead9=_['merge']({},_0x59ead9,_0x5a7400[_0x7830('0x47')]);return db[_0x7830('0x5c')][_0x7830('0x1a')]({'where':_0x59ead9[_0x7830('0x3c')]})[_0x7830('0x21')](function(_0x3ecf35){_0x4b0559[_0x7830('0x1a')]=_0x3ecf35;if(_0x5a7400[_0x7830('0x31')][_0x7830('0x41')]){_0x59ead9['include']=[{'all':!![]}];}return db[_0x7830('0x5c')][_0x7830('0x43')](_0x59ead9);})[_0x7830('0x21')](function(_0x2ec5d7){_0x4b0559[_0x7830('0x59')]=_0x2ec5d7;return _0x4b0559;});}})['then'](respondWithFilteredResult(_0x21e6be,_0x59ead9))[_0x7830('0x44')](handleError(_0x21e6be,null));};exports['getHopperFinals']=function(_0x2751ee,_0x31a950,_0x59008f){var _0x225aa3={'raw':!![],'where':{}};var _0xadfa94={};var _0x367f64={'count':0x0,'rows':[]};return db[_0x7830('0x2b')][_0x7830('0x57')]({'where':{'id':_0x2751ee[_0x7830('0x46')]['id']}})['then'](handleEntityNotFound(_0x31a950,null))[_0x7830('0x21')](function(_0x13c2fd){if(_0x13c2fd){_0xadfa94[_0x7830('0x30')]=_[_0x7830('0x32')](db[_0x7830('0x5d')]['rawAttributes']);_0xadfa94[_0x7830('0x31')]=_['keys'](_0x2751ee[_0x7830('0x31')]);_0xadfa94[_0x7830('0x33')]=_['intersection'](_0xadfa94['model'],_0xadfa94[_0x7830('0x31')]);_0x225aa3[_0x7830('0x36')]=_[_0x7830('0x34')](_0xadfa94[_0x7830('0x30')],qs[_0x7830('0x35')](_0x2751ee[_0x7830('0x31')][_0x7830('0x35')]));_0x225aa3[_0x7830('0x36')]=_0x225aa3[_0x7830('0x36')][_0x7830('0x37')]?_0x225aa3[_0x7830('0x36')]:_0xadfa94[_0x7830('0x30')];if(!_0x2751ee[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0x225aa3['limit']=qs[_0x7830('0x19')](_0x2751ee[_0x7830('0x31')][_0x7830('0x19')]);_0x225aa3[_0x7830('0x17')]=qs[_0x7830('0x17')](_0x2751ee[_0x7830('0x31')][_0x7830('0x17')]);}_0x225aa3[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x2751ee['query'][_0x7830('0x3b')]);_0x225aa3['where']=qs[_0x7830('0x33')](_['pick'](_0x2751ee[_0x7830('0x31')],_0xadfa94['filters']));_0x225aa3[_0x7830('0x3c')][_0x7830('0x5b')]=_0x13c2fd['id'];if(_0x2751ee[_0x7830('0x31')]['filter']){_0x225aa3[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x225aa3[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x225aa3[_0x7830('0x36')],function(_0xf28c68){var _0x27815d={};_0x27815d[_0xf28c68]={'$like':'%'+_0x2751ee[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x27815d;})});}_0x225aa3=_[_0x7830('0x3f')]({},_0x225aa3,_0x2751ee[_0x7830('0x47')]);return db[_0x7830('0x5d')][_0x7830('0x1a')]({'where':_0x225aa3[_0x7830('0x3c')]})[_0x7830('0x21')](function(_0x1c568a){_0x367f64[_0x7830('0x1a')]=_0x1c568a;if(_0x2751ee[_0x7830('0x31')]['includeAll']){_0x225aa3[_0x7830('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x225aa3);})[_0x7830('0x21')](function(_0x325b60){_0x367f64[_0x7830('0x59')]=_0x325b60;return _0x367f64;});}})['then'](respondWithFilteredResult(_0x31a950,_0x225aa3))[_0x7830('0x44')](handleError(_0x31a950,null));};exports[_0x7830('0x5e')]=function(_0x424175,_0x1a019d,_0x53b465){var _0x266888={'raw':!![],'where':{}};var _0x54bf0c={};var _0x386c1f={'count':0x0,'rows':[]};return db[_0x7830('0x2b')][_0x7830('0x57')]({'where':{'id':_0x424175[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x1a019d,null))[_0x7830('0x21')](function(_0xb1473b){if(_0xb1473b){_0x54bf0c[_0x7830('0x30')]=_[_0x7830('0x32')](db[_0x7830('0x5f')][_0x7830('0x2c')]);_0x54bf0c[_0x7830('0x31')]=_['keys'](_0x424175[_0x7830('0x31')]);_0x54bf0c[_0x7830('0x33')]=_[_0x7830('0x34')](_0x54bf0c[_0x7830('0x30')],_0x54bf0c[_0x7830('0x31')]);_0x266888[_0x7830('0x36')]=_['intersection'](_0x54bf0c[_0x7830('0x30')],qs[_0x7830('0x35')](_0x424175[_0x7830('0x31')][_0x7830('0x35')]));_0x266888['attributes']=_0x266888[_0x7830('0x36')][_0x7830('0x37')]?_0x266888[_0x7830('0x36')]:_0x54bf0c[_0x7830('0x30')];if(!_0x424175[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0x266888[_0x7830('0x19')]=qs[_0x7830('0x19')](_0x424175[_0x7830('0x31')][_0x7830('0x19')]);_0x266888[_0x7830('0x17')]=qs['offset'](_0x424175[_0x7830('0x31')][_0x7830('0x17')]);}_0x266888[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x424175[_0x7830('0x31')][_0x7830('0x3b')]);_0x266888[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x424175[_0x7830('0x31')],_0x54bf0c[_0x7830('0x33')]));_0x266888[_0x7830('0x3c')]['CampaignId']=_0xb1473b['id'];if(_0x424175[_0x7830('0x31')][_0x7830('0x3e')]){_0x266888[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x266888[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x266888[_0x7830('0x36')],function(_0x2e731b){var _0x45bdb0={};_0x45bdb0[_0x2e731b]={'$like':'%'+_0x424175[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x45bdb0;})});}_0x266888=_['merge']({},_0x266888,_0x424175[_0x7830('0x47')]);return db['CmHopperBlack']['count']({'where':_0x266888['where']})[_0x7830('0x21')](function(_0x5a6d81){_0x386c1f[_0x7830('0x1a')]=_0x5a6d81;if(_0x424175[_0x7830('0x31')][_0x7830('0x41')]){_0x266888['include']=[{'all':!![]}];}return db[_0x7830('0x5f')]['findAll'](_0x266888);})[_0x7830('0x21')](function(_0x59f8dd){_0x386c1f[_0x7830('0x59')]=_0x59f8dd;return _0x386c1f;});}})['then'](respondWithFilteredResult(_0x1a019d,_0x266888))['catch'](handleError(_0x1a019d,null));};exports['getLists']=function(_0x424bab,_0x51b20e,_0x366e0f){var _0x244a2d={};var _0x334a9e={};var _0x2b8074;var _0x51682a;return db['Campaign']['findOne']({'where':{'id':_0x424bab['params']['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x51b20e,null))[_0x7830('0x21')](function(_0x40332d){if(_0x40332d){_0x2b8074=_0x40332d;_0x334a9e[_0x7830('0x30')]=_[_0x7830('0x32')](db[_0x7830('0x60')][_0x7830('0x2c')]);_0x334a9e[_0x7830('0x31')]=_[_0x7830('0x32')](_0x424bab['query']);_0x334a9e[_0x7830('0x33')]=_[_0x7830('0x34')](_0x334a9e[_0x7830('0x30')],_0x334a9e[_0x7830('0x31')]);_0x244a2d['attributes']=_[_0x7830('0x34')](_0x334a9e[_0x7830('0x30')],qs[_0x7830('0x35')](_0x424bab[_0x7830('0x31')][_0x7830('0x35')]));_0x244a2d[_0x7830('0x36')]=_0x244a2d[_0x7830('0x36')][_0x7830('0x37')]?_0x244a2d[_0x7830('0x36')]:_0x334a9e[_0x7830('0x30')];_0x244a2d[_0x7830('0x3a')]=qs['sort'](_0x424bab[_0x7830('0x31')]['sort']);_0x244a2d[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x424bab[_0x7830('0x31')],_0x334a9e[_0x7830('0x33')]));if(_0x424bab[_0x7830('0x31')][_0x7830('0x3e')]){_0x244a2d['where']=_[_0x7830('0x3f')](_0x244a2d[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x244a2d['attributes'],function(_0x59ccff){var _0x13f0b2={};_0x13f0b2[_0x59ccff]={'$like':'%'+_0x424bab[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x13f0b2;})});}_0x244a2d=_[_0x7830('0x3f')]({},_0x244a2d,_0x424bab[_0x7830('0x47')]);return _0x2b8074[_0x7830('0x61')](_0x244a2d);}})['then'](function(_0x4e40a3){if(_0x4e40a3){_0x51682a=_0x4e40a3[_0x7830('0x37')];if(!_0x424bab[_0x7830('0x31')]['hasOwnProperty'](_0x7830('0x39'))){_0x244a2d['limit']=qs[_0x7830('0x19')](_0x424bab[_0x7830('0x31')][_0x7830('0x19')]);_0x244a2d[_0x7830('0x17')]=qs[_0x7830('0x17')](_0x424bab['query']['offset']);}return _0x2b8074[_0x7830('0x61')](_0x244a2d);}})[_0x7830('0x21')](function(_0x2235c7){if(_0x2235c7){return _0x2235c7?{'count':_0x51682a,'rows':_0x2235c7}:null;}})[_0x7830('0x21')](respondWithResult(_0x51b20e,null))['catch'](handleError(_0x51b20e,null));};exports[_0x7830('0x62')]=function(_0x1ac28f,_0x3a4614,_0x2477d4){var _0x242559,_0x5237df;var _0x25383b=[];var _0x192d31=moment()['format'](_0x7830('0x63'));return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x1ac28f[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x3a4614,null))[_0x7830('0x21')](function(_0x13e144){if(_0x13e144){_0x5237df=_0x13e144;return _0x13e144[_0x7830('0x62')](_0x1ac28f[_0x7830('0x4a')][_0x7830('0x64')],_['omit'](_0x1ac28f[_0x7830('0x4a')],[_0x7830('0x64'),'id'])||{});}return null;})['spread'](function(_0x765635){var _0xe9c1b5;var _0x4d404e;_0x242559=_0x765635||[];var _0x2d44a5=[];if(_0x765635){for(var _0x3ebfe6=0x0;_0x3ebfe6<_0x765635[_0x7830('0x37')];_0x3ebfe6+=0x1){var _0x5c67dd=_0x765635[_0x3ebfe6][_0x7830('0x22')]({'plain':!![]});_0x5237df[_0x7830('0x65')]=_0x1ac28f[_0x7830('0x4a')]['dialCheckDuplicateType']?_0x1ac28f['body'][_0x7830('0x65')]:_0x5237df[_0x7830('0x65')];switch(_0x5237df[_0x7830('0x65')]){case _0x7830('0x66'):_0xe9c1b5=squel[_0x7830('0x67')]()[_0x7830('0x68')](_0x7830('0x69'))['fromQuery']([_0x7830('0x6a'),'scheduledAt',_0x7830('0x6b'),_0x7830('0x6c'),_0x7830('0x5b'),_0x7830('0x54'),_0x7830('0x55')],squel[_0x7830('0x6d')]()[_0x7830('0x6e')](_0x7830('0x6a'),_0x7830('0x6a'))[_0x7830('0x6e')]('NOW()',_0x7830('0x6f'))[_0x7830('0x6e')]('id',_0x7830('0x6b'))[_0x7830('0x6e')](_0x5c67dd['CmListId'][_0x7830('0x70')](),_0x7830('0x6c'))['field'](_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')](),_0x7830('0x5b'))['field']('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x55'))['from']('cm_contacts')[_0x7830('0x3c')](_0x7830('0x71'))['where'](_0x7830('0x72'),_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')](_0x7830('0x74'))[_0x7830('0x3c')](_0x7830('0x75'),squel[_0x7830('0x6d')]()[_0x7830('0x6e')](_0x7830('0x76'))['from'](_0x7830('0x77'))[_0x7830('0x3c')](_0x7830('0x78'),_0x1ac28f['params']['id']['toString']()))[_0x7830('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7830('0x6d')]()[_0x7830('0x6e')]('COALESCE(phone,\x27\x27)')[_0x7830('0x79')](_0x7830('0x69'))[_0x7830('0x3c')](_0x7830('0x78'),_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')]())))[_0x7830('0x70')]();break;case _0x7830('0x7a'):_0xe9c1b5=squel['insert']()[_0x7830('0x68')](_0x7830('0x69'))[_0x7830('0x7b')](['phone',_0x7830('0x6f'),_0x7830('0x6b'),_0x7830('0x6c'),_0x7830('0x5b'),'createdAt',_0x7830('0x55')],squel[_0x7830('0x6d')]()['field'](_0x7830('0x6a'),_0x7830('0x6a'))[_0x7830('0x6e')](_0x7830('0x7c'),'scheduledAt')[_0x7830('0x6e')]('id',_0x7830('0x6b'))[_0x7830('0x6e')](_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')](),_0x7830('0x6c'))['field'](_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')](),_0x7830('0x5b'))['field']('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x55'))[_0x7830('0x79')](_0x7830('0x7d'))[_0x7830('0x3c')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')](_0x7830('0x74'))[_0x7830('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7830('0x6d')]()['field'](_0x7830('0x7e'))[_0x7830('0x79')](_0x7830('0x69'))[_0x7830('0x3c')]('CampaignId\x20=\x20?',_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')]())))[_0x7830('0x70')]();break;default:_0xe9c1b5=squel[_0x7830('0x67')]()[_0x7830('0x68')](_0x7830('0x69'))['fromQuery'](['phone','scheduledAt','ContactId',_0x7830('0x6c'),_0x7830('0x5b'),_0x7830('0x54'),_0x7830('0x55')],squel[_0x7830('0x6d')]()['field'](_0x7830('0x6a'),_0x7830('0x6a'))[_0x7830('0x6e')](_0x7830('0x7c'),_0x7830('0x6f'))['field']('id',_0x7830('0x6b'))['field'](_0x5c67dd[_0x7830('0x73')]['toString'](),'ListId')[_0x7830('0x6e')](_0x1ac28f['params']['id'][_0x7830('0x70')](),_0x7830('0x5b'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27','updatedAt')[_0x7830('0x79')](_0x7830('0x7d'))[_0x7830('0x3c')](_0x7830('0x71'))[_0x7830('0x3c')]('ListId\x20=\x20?',_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x7830('0x70')]();}_0x4d404e=squel[_0x7830('0x67')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x7830('0x7f'),_0x7830('0x6f'),'phone',_0x7830('0x80'),'createdAt',_0x7830('0x55')],squel[_0x7830('0x6d')]()[_0x7830('0x6e')](_0x7830('0x81'),'id')[_0x7830('0x6e')]('NOW()',_0x7830('0x6f'))['field'](_0x7830('0x82'),_0x7830('0x6a'))[_0x7830('0x6e')]('ci.OrderBY','OrderBy')[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x55'))['from'](_0x7830('0x83'),'ci')[_0x7830('0x84')](_0x7830('0x69'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x7830('0x85'),_0x5c67dd['CmListId'][_0x7830('0x70')]())['where']('h.CampaignId=?',_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')]())['where'](_0x7830('0x86'),_0x192d31))[_0x7830('0x70')]();_0x2d44a5[_0x7830('0x87')](db[_0x7830('0x88')][_0x7830('0x31')](_0xe9c1b5));_0x25383b[_0x7830('0x87')](db['sequelize'][_0x7830('0x31')](_0x4d404e));}return BPromise[_0x7830('0x89')](_0x2d44a5);}})['then'](function(){return BPromise[_0x7830('0x89')](_0x25383b);})['then'](function(){return _0x242559;})[_0x7830('0x21')](respondWithResult(_0x3a4614,null))[_0x7830('0x44')](handleError(_0x3a4614,null));};exports[_0x7830('0x8a')]=function(_0x23d9b3,_0xdb7cd6,_0x29bdbc){return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x23d9b3['params']['id']}})[_0x7830('0x21')](handleEntityNotFound(_0xdb7cd6,null))[_0x7830('0x21')](function(_0x3204f0){if(_0x3204f0){return _0x3204f0[_0x7830('0x8a')](_0x23d9b3[_0x7830('0x31')][_0x7830('0x64')]);}})[_0x7830('0x21')](function(_0xe0245e){if(_0xe0245e){return db['CmHopper'][_0x7830('0x25')]({'where':{'ListId':_0x23d9b3[_0x7830('0x31')][_0x7830('0x64')],'CampaignId':_0x23d9b3[_0x7830('0x46')]['id']}})[_0x7830('0x21')](function(){return _0xe0245e;});}})['then'](respondWithStatusCode(_0xdb7cd6,null))[_0x7830('0x44')](handleError(_0xdb7cd6,null));};exports[_0x7830('0x8b')]=function(_0x24318a,_0x3f82b3,_0x302aa4){var _0x3915e0={};var _0x11ddcd={};var _0x187a73;var _0x200870;return db['Campaign'][_0x7830('0x57')]({'where':{'id':_0x24318a['params']['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x3f82b3,null))['then'](function(_0x1534da){if(_0x1534da){_0x187a73=_0x1534da;_0x11ddcd[_0x7830('0x30')]=_[_0x7830('0x32')](db['CmList'][_0x7830('0x2c')]);_0x11ddcd[_0x7830('0x31')]=_[_0x7830('0x32')](_0x24318a[_0x7830('0x31')]);_0x11ddcd[_0x7830('0x33')]=_[_0x7830('0x34')](_0x11ddcd['model'],_0x11ddcd[_0x7830('0x31')]);_0x3915e0['attributes']=_[_0x7830('0x34')](_0x11ddcd[_0x7830('0x30')],qs[_0x7830('0x35')](_0x24318a[_0x7830('0x31')][_0x7830('0x35')]));_0x3915e0[_0x7830('0x36')]=_0x3915e0[_0x7830('0x36')][_0x7830('0x37')]?_0x3915e0[_0x7830('0x36')]:_0x11ddcd[_0x7830('0x30')];_0x3915e0[_0x7830('0x3a')]=qs['sort'](_0x24318a['query']['sort']);_0x3915e0[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x24318a['query'],_0x11ddcd[_0x7830('0x33')]));if(_0x24318a['query']['filter']){_0x3915e0[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x3915e0[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x3915e0['attributes'],function(_0x49da77){var _0x41e095={};_0x41e095[_0x49da77]={'$like':'%'+_0x24318a[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x41e095;})});}_0x3915e0=_[_0x7830('0x3f')]({},_0x3915e0,_0x24318a['options']);return _0x187a73[_0x7830('0x8b')](_0x3915e0);}})[_0x7830('0x21')](function(_0xf1ec90){if(_0xf1ec90){_0x200870=_0xf1ec90[_0x7830('0x37')];if(!_0x24318a[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0x3915e0[_0x7830('0x19')]=qs[_0x7830('0x19')](_0x24318a[_0x7830('0x31')][_0x7830('0x19')]);_0x3915e0['offset']=qs[_0x7830('0x17')](_0x24318a[_0x7830('0x31')]['offset']);}return _0x187a73[_0x7830('0x8b')](_0x3915e0);}})[_0x7830('0x21')](function(_0xf9532f){if(_0xf9532f){return _0xf9532f?{'count':_0x200870,'rows':_0xf9532f}:null;}})[_0x7830('0x21')](respondWithResult(_0x3f82b3,null))[_0x7830('0x44')](handleError(_0x3f82b3,null));};exports[_0x7830('0x8c')]=function(_0x16329c,_0x38e751,_0x4713af){var _0x599903,_0x59f7d1;var _0x3514df=[];var _0x164ccd=moment()[_0x7830('0x8d')](_0x7830('0x63'));return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x16329c[_0x7830('0x46')]['id']}})['then'](handleEntityNotFound(_0x38e751,null))[_0x7830('0x21')](function(_0xce6fbb){if(_0xce6fbb){_0x59f7d1=_0xce6fbb;return _0xce6fbb[_0x7830('0x8c')](_0x16329c[_0x7830('0x4a')][_0x7830('0x64')],_[_0x7830('0x53')](_0x16329c[_0x7830('0x4a')],['ids','id'])||{});}return null;})['spread'](function(_0xf9e8b){var _0x382886;var _0x48a5cf;_0x599903=_0xf9e8b||[];var _0x429a54=[];if(_0xf9e8b){for(var _0x417741=0x0;_0x417741<_0xf9e8b[_0x7830('0x37')];_0x417741+=0x1){var _0xa11841=_0xf9e8b[_0x417741][_0x7830('0x22')]({'plain':!![]});_0x382886=squel[_0x7830('0x67')]()['into']('cm_hopper_black')[_0x7830('0x7b')]([_0x7830('0x6a'),_0x7830('0x6b'),_0x7830('0x6c'),_0x7830('0x5b'),_0x7830('0x54'),_0x7830('0x55')],squel[_0x7830('0x6d')]()['field']('phone',_0x7830('0x6a'))[_0x7830('0x6e')]('id',_0x7830('0x6b'))[_0x7830('0x6e')](_0xa11841[_0x7830('0x73')][_0x7830('0x70')](),_0x7830('0x6c'))['field'](_0x16329c['params']['id']['toString'](),_0x7830('0x5b'))[_0x7830('0x6e')]('NOW()',_0x7830('0x54'))[_0x7830('0x6e')](_0x7830('0x7c'),_0x7830('0x55'))[_0x7830('0x79')](_0x7830('0x7d'))[_0x7830('0x3c')](_0x7830('0x71'))[_0x7830('0x3c')]('ListId\x20=\x20?',_0xa11841[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')](_0x7830('0x74')))[_0x7830('0x70')]();_0x429a54[_0x7830('0x87')](db[_0x7830('0x88')]['query'](_0x382886));}return BPromise[_0x7830('0x89')](_0x429a54);}})[_0x7830('0x21')](function(){return _0x599903;})[_0x7830('0x21')](respondWithResult(_0x38e751,null))[_0x7830('0x44')](handleError(_0x38e751,null));};exports[_0x7830('0x8e')]=function(_0x31cc6a,_0x4f81cb,_0x4aad4d){return db['Campaign'][_0x7830('0x48')]({'where':{'id':_0x31cc6a[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x4f81cb,null))[_0x7830('0x21')](function(_0x27213d){if(_0x27213d){return _0x27213d['removeBlackLists'](_0x31cc6a[_0x7830('0x31')][_0x7830('0x64')]);}})[_0x7830('0x21')](function(_0x2c5ce6){if(_0x2c5ce6){return db['CmHopperBlack'][_0x7830('0x25')]({'where':{'ListId':_0x31cc6a[_0x7830('0x31')]['ids'],'CampaignId':_0x31cc6a[_0x7830('0x46')]['id']}})[_0x7830('0x21')](function(){return _0x2c5ce6;});}})[_0x7830('0x21')](respondWithStatusCode(_0x4f81cb,null))[_0x7830('0x44')](handleError(_0x4f81cb,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f503d92..b8f080b 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 5bb76af..9a66789 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 _0x9ff4=['options','raw','where','attributes','limit','include','model','map','then','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCampaign','Campaign','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ff4,0x196));var _0x49ff=function(_0x46c809,_0x401fab){_0x46c809=_0x46c809-0x0;var _0x343f17=_0x9ff4[_0x46c809];return _0x343f17;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x49ff('0x0'));var rs=require(_0x49ff('0x1'));var fs=require('fs');var Redis=require(_0x49ff('0x2'));var db=require(_0x49ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ff('0x4'))(_0x49ff('0x5'));var config=require(_0x49ff('0x6'));var jayson=require(_0x49ff('0x7'));var client=jayson[_0x49ff('0x8')][_0x49ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe967d3,_0xd87903,_0x50f784){return new BPromise(function(_0x5478a6,_0x304f83){return client[_0x49ff('0xa')](_0xe967d3,_0x50f784)['then'](function(_0x4e845a){logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));logger[_0x49ff('0xe')](_0x49ff('0xf'),_0xd87903,_0x49ff('0xd'),JSON[_0x49ff('0x10')](_0x4e845a));if(_0x4e845a[_0x49ff('0x11')]){if(_0x4e845a['error']['code']===0x1f4){logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a[_0x49ff('0x11')]['message']);return _0x304f83(_0x4e845a[_0x49ff('0x11')]['message']);}logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a['error'][_0x49ff('0x12')]);return _0x5478a6(_0x4e845a[_0x49ff('0x11')][_0x49ff('0x12')]);}else{logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));_0x5478a6(_0x4e845a[_0x49ff('0x13')][_0x49ff('0x12')]);}})['catch'](function(_0x29fb22){logger['error'](_0x49ff('0xc'),_0xd87903,_0x29fb22);_0x304f83(_0x29fb22);});});}exports[_0x49ff('0x14')]=function(_0x1a0f17){var _0x29c5d9=this;return new Promise(function(_0x255229,_0x90480f){return db[_0x49ff('0x15')][_0x49ff('0x16')]({'raw':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x18')]===undefined?!![]:![]:!![],'where':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x19')]||null:null,'attributes':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1a')]||null:null,'limit':_0x1a0f17['options']?_0x1a0f17['options'][_0x49ff('0x1b')]||null:null,'include':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x1c')]?_['map'](_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1c')],function(_0xb1088){return{'model':db[_0xb1088[_0x49ff('0x1d')]],'as':_0xb1088['as'],'attributes':_0xb1088[_0x49ff('0x1a')],'include':_0xb1088[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0xb1088[_0x49ff('0x1c')],function(_0x3c214b){return{'model':db[_0x3c214b[_0x49ff('0x1d')]],'as':_0x3c214b['as'],'attributes':_0x3c214b[_0x49ff('0x1a')],'include':_0x3c214b[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0x3c214b['include'],function(_0x203853){return{'model':db[_0x203853[_0x49ff('0x1d')]],'as':_0x203853['as'],'attributes':_0x203853['attributes']};}):[]};}):[]};}):[]:[]})[_0x49ff('0x1f')](function(_0x1f651a){logger[_0x49ff('0xb')]('GetCampaign',_0x1a0f17);logger[_0x49ff('0xe')](_0x49ff('0x14'),_0x1a0f17,JSON[_0x49ff('0x10')](_0x1f651a));_0x255229(_0x1f651a);})[_0x49ff('0x20')](function(_0xf380ba){logger[_0x49ff('0x11')](_0x49ff('0x14'),_0xf380ba[_0x49ff('0x12')],_0x1a0f17);_0x90480f(_0x29c5d9[_0x49ff('0x11')](0x1f4,_0xf380ba[_0x49ff('0x12')]));});});};
\ No newline at end of file
+var _0x70e0=['findAll','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign'];(function(_0x760968,_0x2c607c){var _0x1c707b=function(_0x4cfd81){while(--_0x4cfd81){_0x760968['push'](_0x760968['shift']());}};_0x1c707b(++_0x2c607c);}(_0x70e0,0x17b));var _0x070e=function(_0x4a8e60,_0x59d8ec){_0x4a8e60=_0x4a8e60-0x0;var _0x5902f9=_0x70e0[_0x4a8e60];return _0x5902f9;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Campaign,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Campaign,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')]({'raw':_0x38f6e6[_0x070e('0x19')]?_0x38f6e6[_0x070e('0x19')][_0x070e('0x1a')]===undefined?!![]:![]:!![],'where':_0x38f6e6['options']?_0x38f6e6['options']['where']||null:null,'attributes':_0x38f6e6[_0x070e('0x19')]?_0x38f6e6[_0x070e('0x19')][_0x070e('0x1b')]||null:null,'limit':_0x38f6e6['options']?_0x38f6e6[_0x070e('0x19')]['limit']||null:null,'include':_0x38f6e6[_0x070e('0x19')]?_0x38f6e6[_0x070e('0x19')][_0x070e('0x1c')]?_[_0x070e('0x1d')](_0x38f6e6[_0x070e('0x19')][_0x070e('0x1c')],function(_0xe405e){return{'model':db[_0xe405e[_0x070e('0x1e')]],'as':_0xe405e['as'],'attributes':_0xe405e['attributes'],'include':_0xe405e[_0x070e('0x1c')]?_[_0x070e('0x1d')](_0xe405e[_0x070e('0x1c')],function(_0x503f4d){return{'model':db[_0x503f4d[_0x070e('0x1e')]],'as':_0x503f4d['as'],'attributes':_0x503f4d['attributes'],'include':_0x503f4d['include']?_[_0x070e('0x1d')](_0x503f4d[_0x070e('0x1c')],function(_0x41deb1){return{'model':db[_0x41deb1[_0x070e('0x1e')]],'as':_0x41deb1['as'],'attributes':_0x41deb1[_0x070e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x374c54){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')](_0x070e('0x16'),_0x38f6e6,JSON[_0x070e('0xf')](_0x374c54));_0x364b3f(_0x374c54);})[_0x070e('0x15')](function(_0x26373b){logger['error'](_0x070e('0x16'),_0x26373b[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0x26373b['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 8ee8d76..b19d9f2 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 _0x1dbd=['removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy'];(function(_0x35a101,_0x3859e1){var _0x18e3b4=function(_0x27c92d){while(--_0x27c92d){_0x35a101['push'](_0x35a101['shift']());}};_0x18e3b4(++_0x3859e1);}(_0x1dbd,0x1d7));var _0xd1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd1db('0x0'));var path=require('path');var timeout=require(_0xd1db('0x1'));var express=require(_0xd1db('0x2'));var router=express[_0xd1db('0x3')]();var fs_extra=require(_0xd1db('0x4'));var auth=require(_0xd1db('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd1db('0x6'));var controller=require(_0xd1db('0x7'));router[_0xd1db('0x8')]('/',auth[_0xd1db('0x9')](),controller[_0xd1db('0xa')]);router[_0xd1db('0x8')](_0xd1db('0xb'),auth[_0xd1db('0x9')](),controller[_0xd1db('0xc')]);router[_0xd1db('0x8')](_0xd1db('0xd'),auth['isAuthenticated'](),controller[_0xd1db('0xe')]);router[_0xd1db('0x8')](_0xd1db('0xf'),auth['isAuthenticated'](),controller[_0xd1db('0x10')]);router[_0xd1db('0x8')](_0xd1db('0x11'),auth[_0xd1db('0x9')](),controller[_0xd1db('0x12')]);router['get']('/:id/hopper_black',auth[_0xd1db('0x9')](),controller[_0xd1db('0x13')]);router[_0xd1db('0x8')](_0xd1db('0x14'),auth[_0xd1db('0x9')](),controller[_0xd1db('0x15')]);router[_0xd1db('0x8')](_0xd1db('0x16'),auth[_0xd1db('0x9')](),controller['getBlackLists']);router[_0xd1db('0x17')]('/',auth[_0xd1db('0x9')](),controller[_0xd1db('0x18')]);router[_0xd1db('0x17')](_0xd1db('0x19'),auth[_0xd1db('0x9')](),controller[_0xd1db('0x1a')]);router['post'](_0xd1db('0x14'),auth['isAuthenticated'](),controller[_0xd1db('0x1b')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd1db('0x1c')]);router[_0xd1db('0x1d')](_0xd1db('0xb'),auth[_0xd1db('0x9')](),controller[_0xd1db('0x1e')]);router[_0xd1db('0x1f')](_0xd1db('0xb'),auth[_0xd1db('0x9')](),controller[_0xd1db('0x20')]);router[_0xd1db('0x1f')]('/:id/lists',auth[_0xd1db('0x9')](),controller[_0xd1db('0x21')]);router['delete'](_0xd1db('0x16'),auth[_0xd1db('0x9')](),controller[_0xd1db('0x22')]);module[_0xd1db('0x23')]=router;
\ No newline at end of file
+var _0xff94=['addLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x3e16c0,_0x4fcb17){var _0x2abad6=function(_0x50c82d){while(--_0x50c82d){_0x3e16c0['push'](_0x3e16c0['shift']());}};_0x2abad6(++_0x4fcb17);}(_0xff94,0x130));var _0x4ff9=function(_0xf1e5da,_0x3ecd47){_0xf1e5da=_0xf1e5da-0x0;var _0x331120=_0xff94[_0xf1e5da];return _0x331120;};'use strict';var multer=require(_0x4ff9('0x0'));var util=require(_0x4ff9('0x1'));var path=require(_0x4ff9('0x2'));var timeout=require(_0x4ff9('0x3'));var express=require(_0x4ff9('0x4'));var router=express[_0x4ff9('0x5')]();var fs_extra=require(_0x4ff9('0x6'));var auth=require(_0x4ff9('0x7'));var interaction=require(_0x4ff9('0x8'));var config=require(_0x4ff9('0x9'));var controller=require(_0x4ff9('0xa'));router[_0x4ff9('0xb')]('/',auth[_0x4ff9('0xc')](),controller['index']);router[_0x4ff9('0xb')](_0x4ff9('0xd'),auth[_0x4ff9('0xc')](),controller['show']);router[_0x4ff9('0xb')](_0x4ff9('0xe'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0xf')]);router[_0x4ff9('0xb')]('/:id/hopper_histories',auth[_0x4ff9('0xc')](),controller['getHopperHistories']);router[_0x4ff9('0xb')]('/:id/hopper_finals',auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x10')]);router[_0x4ff9('0xb')](_0x4ff9('0x11'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x12')]);router['get'](_0x4ff9('0x13'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x14')]);router[_0x4ff9('0xb')](_0x4ff9('0x15'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x16')]);router[_0x4ff9('0x17')]('/',auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x18')]);router['post'](_0x4ff9('0x19'),auth[_0x4ff9('0xc')](),controller['clone']);router[_0x4ff9('0x17')](_0x4ff9('0x13'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1a')]);router['post'](_0x4ff9('0x15'),auth[_0x4ff9('0xc')](),controller['addBlackLists']);router[_0x4ff9('0x1b')](_0x4ff9('0xd'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1c')]);router['delete'](_0x4ff9('0xd'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1d')]);router[_0x4ff9('0x1e')](_0x4ff9('0x13'),auth[_0x4ff9('0xc')](),controller['removeLists']);router[_0x4ff9('0x1e')](_0x4ff9('0x15'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1f')]);module[_0x4ff9('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 9ec46aa..ddeac35 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 _0xa3d9=['VIRTUAL','key','TEXT'];(function(_0x182db3,_0x1d3698){var _0x271ec9=function(_0x5d89b0){while(--_0x5d89b0){_0x182db3['push'](_0x182db3['shift']());}};_0x271ec9(++_0x1d3698);}(_0xa3d9,0x7a));var _0x9a3d=function(_0x20a83b,_0xc6e626){_0x20a83b=_0x20a83b-0x0;var _0x4815e7=_0xa3d9[_0x20a83b];return _0x4815e7;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9a3d('0x0')],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9a3d('0x1')],'get':function(){return this['getDataValue'](_0x9a3d('0x2'));}}};
\ No newline at end of file
+var _0x6f06=['sequelize','STRING'];(function(_0x5e32f3,_0x3386c1){var _0x4d4e03=function(_0xe86f5){while(--_0xe86f5){_0x5e32f3['push'](_0x5e32f3['shift']());}};_0x4d4e03(++_0x3386c1);}(_0x6f06,0x1b2));var _0x66f0=function(_0x7342e,_0x1c3fe7){_0x7342e=_0x7342e-0x0;var _0x524ece=_0x6f06[_0x7342e];return _0x524ece;};'use strict';var Sequelize=require(_0x66f0('0x0'));module['exports']={'key':{'type':Sequelize[_0x66f0('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x66f0('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6b979ac..849e275 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 _0xb0d4=['findAll','catch','show','params','includeAll','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options'];(function(_0x36da2a,_0x139b77){var _0x457b21=function(_0x36eba8){while(--_0x36eba8){_0x36da2a['push'](_0x36da2a['shift']());}};_0x457b21(++_0x139b77);}(_0xb0d4,0x6b));var _0x4b0d=function(_0x43478c,_0x434288){_0x43478c=_0x43478c-0x0;var _0xc4e333=_0xb0d4[_0x43478c];return _0xc4e333;};'use strict';var emlformat=require(_0x4b0d('0x0'));var rimraf=require(_0x4b0d('0x1'));var zipdir=require(_0x4b0d('0x2'));var jsonpatch=require(_0x4b0d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4b0d('0x4'));var Mustache=require('mustache');var util=require(_0x4b0d('0x5'));var path=require(_0x4b0d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4b0d('0x7'));var fs=require('fs');var fs_extra=require(_0x4b0d('0x8'));var _=require(_0x4b0d('0x9'));var squel=require(_0x4b0d('0xa'));var crypto=require('crypto');var jsforce=require(_0x4b0d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4b0d('0xc'));var querystring=require(_0x4b0d('0xd'));var Papa=require(_0x4b0d('0xe'));var Redis=require(_0x4b0d('0xf'));var authService=require(_0x4b0d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4b0d('0x11'));var hardwareService=require(_0x4b0d('0x12'));var logger=require(_0x4b0d('0x13'))(_0x4b0d('0x14'));var utils=require(_0x4b0d('0x15'));var config=require(_0x4b0d('0x16'));var licenseUtil=require(_0x4b0d('0x17'));var db=require(_0x4b0d('0x18'))['db'];function respondWithStatusCode(_0x2ddbd0,_0x42b6a9){_0x42b6a9=_0x42b6a9||0xcc;return function(_0x2d115e){if(_0x2d115e){return _0x2ddbd0['sendStatus'](_0x42b6a9);}return _0x2ddbd0[_0x4b0d('0x19')](_0x42b6a9)[_0x4b0d('0x1a')]();};}function respondWithResult(_0x30ebe0,_0x2a1176){_0x2a1176=_0x2a1176||0xc8;return function(_0x5f3d66){if(_0x5f3d66){return _0x30ebe0[_0x4b0d('0x19')](_0x2a1176)[_0x4b0d('0x1b')](_0x5f3d66);}};}function respondWithFilteredResult(_0x16e233,_0x588f3c){return function(_0x533958){if(_0x533958){var _0x9705e7=typeof _0x588f3c['offset']===_0x4b0d('0x1c')&&typeof _0x588f3c[_0x4b0d('0x1d')]===_0x4b0d('0x1c');var _0x3ceaa1=_0x533958['count'];var _0x1d62ec=_0x9705e7?0x0:_0x588f3c[_0x4b0d('0x1e')];var _0x58962f=_0x9705e7?_0x533958[_0x4b0d('0x1f')]:_0x588f3c[_0x4b0d('0x1e')]+_0x588f3c['limit'];var _0x3a8e74;if(_0x58962f>=_0x3ceaa1){_0x58962f=_0x3ceaa1;_0x3a8e74=0xc8;}else{_0x3a8e74=0xce;}_0x16e233[_0x4b0d('0x19')](_0x3a8e74);return _0x16e233[_0x4b0d('0x20')](_0x4b0d('0x21'),_0x1d62ec+'-'+_0x58962f+'/'+_0x3ceaa1)['json'](_0x533958);}return null;};}function patchUpdates(_0x137aca){return function(_0x181d00){try{jsonpatch[_0x4b0d('0x22')](_0x181d00,_0x137aca,!![]);}catch(_0x3f18bb){return BPromise['reject'](_0x3f18bb);}return _0x181d00['save']();};}function saveUpdates(_0xc28ed4,_0x396f8d){return function(_0x1dd897){if(_0x1dd897){return _0x1dd897[_0x4b0d('0x23')](_0xc28ed4)[_0x4b0d('0x24')](function(_0x3265b0){return _0x3265b0;});}return null;};}function removeEntity(_0x29d44e,_0x17257e){return function(_0x2ffa5f){if(_0x2ffa5f){return _0x2ffa5f[_0x4b0d('0x25')]()[_0x4b0d('0x24')](function(){var _0x9ca288=_0x2ffa5f[_0x4b0d('0x26')]({'plain':!![]});var _0x260324=_0x4b0d('0x27');return db[_0x4b0d('0x28')][_0x4b0d('0x25')]({'where':{'type':_0x260324,'resourceId':_0x9ca288['id']}})[_0x4b0d('0x24')](function(){return _0x2ffa5f;});})[_0x4b0d('0x24')](function(){_0x29d44e[_0x4b0d('0x19')](0xcc)[_0x4b0d('0x1a')]();});}};}function handleEntityNotFound(_0xa63daa,_0x4ae6bb){return function(_0x5886cb){if(!_0x5886cb){_0xa63daa[_0x4b0d('0x29')](0x194);}return _0x5886cb;};}function handleError(_0x49001c,_0x6ae2f4){_0x6ae2f4=_0x6ae2f4||0x1f4;return function(_0x3fde6b){logger[_0x4b0d('0x2a')](_0x3fde6b['stack']);if(_0x3fde6b[_0x4b0d('0x2b')]){delete _0x3fde6b[_0x4b0d('0x2b')];}_0x49001c['status'](_0x6ae2f4)['send'](_0x3fde6b);};}exports[_0x4b0d('0x2c')]=function(_0x288b21,_0x144da8){var _0x53973b={},_0x43aaa8={},_0x2bcf41={'count':0x0,'rows':[]};var _0x490d0c=_['map'](db[_0x4b0d('0x2d')][_0x4b0d('0x2e')],function(_0x12a7bc){return{'name':_0x12a7bc[_0x4b0d('0x2f')],'type':_0x12a7bc[_0x4b0d('0x30')][_0x4b0d('0x31')]};});_0x43aaa8[_0x4b0d('0x32')]=_[_0x4b0d('0x33')](_0x490d0c,_0x4b0d('0x2b'));_0x43aaa8[_0x4b0d('0x34')]=_[_0x4b0d('0x35')](_0x288b21[_0x4b0d('0x34')]);_0x43aaa8['filters']=_[_0x4b0d('0x36')](_0x43aaa8[_0x4b0d('0x32')],_0x43aaa8[_0x4b0d('0x34')]);_0x53973b[_0x4b0d('0x37')]=_['intersection'](_0x43aaa8[_0x4b0d('0x32')],qs['fields'](_0x288b21['query'][_0x4b0d('0x38')]));_0x53973b['attributes']=_0x53973b['attributes'][_0x4b0d('0x39')]?_0x53973b[_0x4b0d('0x37')]:_0x43aaa8[_0x4b0d('0x32')];if(!_0x288b21[_0x4b0d('0x34')][_0x4b0d('0x3a')](_0x4b0d('0x3b'))){_0x53973b[_0x4b0d('0x1d')]=qs[_0x4b0d('0x1d')](_0x288b21['query'][_0x4b0d('0x1d')]);_0x53973b[_0x4b0d('0x1e')]=qs['offset'](_0x288b21['query'][_0x4b0d('0x1e')]);}_0x53973b[_0x4b0d('0x3c')]=qs[_0x4b0d('0x3d')](_0x288b21[_0x4b0d('0x34')][_0x4b0d('0x3d')]);_0x53973b[_0x4b0d('0x3e')]=qs[_0x4b0d('0x3f')](_['pick'](_0x288b21['query'],_0x43aaa8[_0x4b0d('0x3f')]),_0x490d0c);if(_0x288b21[_0x4b0d('0x34')][_0x4b0d('0x40')]){_0x53973b['where']=_[_0x4b0d('0x41')](_0x53973b['where'],{'$or':[{'key':{'$like':'%'+_0x288b21[_0x4b0d('0x34')][_0x4b0d('0x40')]+'%'}},{'value':{'$like':'%'+_0x288b21[_0x4b0d('0x34')][_0x4b0d('0x40')]+'%'}}]});}_0x53973b=_[_0x4b0d('0x41')]({},_0x53973b,_0x288b21[_0x4b0d('0x42')]);var _0xf8ab6d={'where':_0x53973b[_0x4b0d('0x3e')]};return db['CannedAnswer']['count'](_0xf8ab6d)[_0x4b0d('0x24')](function(_0x19edba){_0x2bcf41[_0x4b0d('0x1f')]=_0x19edba;if(_0x288b21[_0x4b0d('0x34')]['includeAll']){_0x53973b['include']=[{'all':!![]}];}return db[_0x4b0d('0x2d')][_0x4b0d('0x43')](_0x53973b);})[_0x4b0d('0x24')](function(_0x555139){_0x2bcf41['rows']=_0x555139;return _0x2bcf41;})['then'](respondWithFilteredResult(_0x144da8,_0x53973b))[_0x4b0d('0x44')](handleError(_0x144da8,null));};exports[_0x4b0d('0x45')]=function(_0x398db3,_0x324f62){var _0x4777b4={'raw':!![],'where':{'id':_0x398db3[_0x4b0d('0x46')]['id']}},_0x135d91={};_0x135d91[_0x4b0d('0x32')]=_[_0x4b0d('0x35')](db[_0x4b0d('0x2d')][_0x4b0d('0x2e')]);_0x135d91[_0x4b0d('0x34')]=_['keys'](_0x398db3['query']);_0x135d91[_0x4b0d('0x3f')]=_['intersection'](_0x135d91[_0x4b0d('0x32')],_0x135d91['query']);_0x4777b4[_0x4b0d('0x37')]=_[_0x4b0d('0x36')](_0x135d91[_0x4b0d('0x32')],qs[_0x4b0d('0x38')](_0x398db3[_0x4b0d('0x34')][_0x4b0d('0x38')]));_0x4777b4[_0x4b0d('0x37')]=_0x4777b4[_0x4b0d('0x37')][_0x4b0d('0x39')]?_0x4777b4['attributes']:_0x135d91[_0x4b0d('0x32')];if(_0x398db3[_0x4b0d('0x34')][_0x4b0d('0x47')]){_0x4777b4[_0x4b0d('0x48')]=[{'all':!![]}];}_0x4777b4=_[_0x4b0d('0x41')]({},_0x4777b4,_0x398db3[_0x4b0d('0x42')]);return db[_0x4b0d('0x2d')][_0x4b0d('0x49')](_0x4777b4)['then'](handleEntityNotFound(_0x324f62,null))[_0x4b0d('0x24')](respondWithResult(_0x324f62,null))['catch'](handleError(_0x324f62,null));};exports[_0x4b0d('0x23')]=function(_0x4a6d5f,_0x233b8a){if(_0x4a6d5f[_0x4b0d('0x4a')]['id']){delete _0x4a6d5f['body']['id'];}return db[_0x4b0d('0x2d')]['find']({'where':{'id':_0x4a6d5f[_0x4b0d('0x46')]['id']}})[_0x4b0d('0x24')](handleEntityNotFound(_0x233b8a,null))['then'](saveUpdates(_0x4a6d5f[_0x4b0d('0x4a')],null))['then'](respondWithResult(_0x233b8a,null))['catch'](handleError(_0x233b8a,null));};exports[_0x4b0d('0x25')]=function(_0x4e0e63,_0x4c753e){return db[_0x4b0d('0x2d')]['find']({'where':{'id':_0x4e0e63[_0x4b0d('0x46')]['id']}})[_0x4b0d('0x24')](handleEntityNotFound(_0x4c753e,null))['then'](removeEntity(_0x4c753e,null))[_0x4b0d('0x44')](handleError(_0x4c753e,null));};exports[_0x4b0d('0x4b')]=function(_0x21b94b,_0x11ece5){var _0x3f2d5b={'key':_0x21b94b[_0x4b0d('0x4a')]['key']};if(_0x21b94b['body'][_0x4b0d('0x4c')]){_0x3f2d5b['MailAccountId']=_0x21b94b[_0x4b0d('0x4a')][_0x4b0d('0x4c')];}else if(_0x21b94b[_0x4b0d('0x4a')][_0x4b0d('0x4d')]){_0x3f2d5b[_0x4b0d('0x4d')]=_0x21b94b[_0x4b0d('0x4a')]['SmsAccountId'];}else if(_0x21b94b['body'][_0x4b0d('0x4e')]){_0x3f2d5b[_0x4b0d('0x4e')]=_0x21b94b[_0x4b0d('0x4a')]['OpenchannelAccountId'];}else if(_0x21b94b[_0x4b0d('0x4a')][_0x4b0d('0x4f')]){_0x3f2d5b[_0x4b0d('0x4f')]=_0x21b94b[_0x4b0d('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x4b0d('0x49')]({'where':_0x3f2d5b})[_0x4b0d('0x24')](function(_0x54cba3){if(_0x54cba3){throw new db[(_0x4b0d('0x50'))][(_0x4b0d('0x51'))](_0x4b0d('0x52'));}return db[_0x4b0d('0x2d')][_0x4b0d('0x4b')](_0x21b94b[_0x4b0d('0x4a')]);})[_0x4b0d('0x24')](function(_0x1ef938){var _0x5add18=_0x21b94b[_0x4b0d('0x53')][_0x4b0d('0x26')]({'plain':!![]});if(!_0x5add18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5add18['role']===_0x4b0d('0x53')){var _0x592674=_0x1ef938[_0x4b0d('0x26')]({'plain':!![]});return db[_0x4b0d('0x54')][_0x4b0d('0x49')]({'where':{'name':_0x4b0d('0x27'),'userProfileId':_0x5add18[_0x4b0d('0x55')]},'raw':!![]})[_0x4b0d('0x24')](function(_0x3681d8){if(_0x3681d8&&_0x3681d8[_0x4b0d('0x56')]===0x0){return db[_0x4b0d('0x28')][_0x4b0d('0x4b')]({'name':_0x592674[_0x4b0d('0x2b')],'resourceId':_0x592674['id'],'type':_0x3681d8[_0x4b0d('0x2b')],'sectionId':_0x3681d8['id']},{})[_0x4b0d('0x24')](function(){return _0x1ef938;});}else{return _0x1ef938;}})[_0x4b0d('0x44')](function(_0x79ab38){logger[_0x4b0d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x79ab38);throw _0x79ab38;});}return _0x1ef938;})['then'](respondWithResult(_0x11ece5,0xc9))[_0x4b0d('0x44')](handleError(_0x11ece5,null));};
\ No newline at end of file
+var _0x69f7=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x5272e0,_0x169ce5){var _0xa4fc96=function(_0x4f359a){while(--_0x4f359a){_0x5272e0['push'](_0x5272e0['shift']());}};_0xa4fc96(++_0x169ce5);}(_0x69f7,0x10b));var _0x769f=function(_0x2b5520,_0x2d77b4){_0x2b5520=_0x2b5520-0x0;var _0x5873db=_0x69f7[_0x2b5520];return _0x5873db;};'use strict';var emlformat=require(_0x769f('0x0'));var rimraf=require(_0x769f('0x1'));var zipdir=require(_0x769f('0x2'));var jsonpatch=require(_0x769f('0x3'));var rp=require('request-promise');var moment=require(_0x769f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x769f('0x5'));var util=require(_0x769f('0x6'));var path=require(_0x769f('0x7'));var sox=require(_0x769f('0x8'));var csv=require('to-csv');var ejs=require(_0x769f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x769f('0xa'));var crypto=require(_0x769f('0xb'));var jsforce=require(_0x769f('0xc'));var deskjs=require(_0x769f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x769f('0xe'));var Papa=require(_0x769f('0xf'));var Redis=require(_0x769f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x769f('0x11'));var as=require(_0x769f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x769f('0x13'))(_0x769f('0x14'));var utils=require(_0x769f('0x15'));var config=require(_0x769f('0x16'));var licenseUtil=require(_0x769f('0x17'));var db=require(_0x769f('0x18'))['db'];function respondWithStatusCode(_0x31e7b8,_0x41c336){_0x41c336=_0x41c336||0xcc;return function(_0x4145cd){if(_0x4145cd){return _0x31e7b8[_0x769f('0x19')](_0x41c336);}return _0x31e7b8['status'](_0x41c336)[_0x769f('0x1a')]();};}function respondWithResult(_0x4a4f09,_0x5e4857){_0x5e4857=_0x5e4857||0xc8;return function(_0x12aa50){if(_0x12aa50){return _0x4a4f09[_0x769f('0x1b')](_0x5e4857)['json'](_0x12aa50);}};}function respondWithFilteredResult(_0x3d3279,_0x26ea7c){return function(_0x40074c){if(_0x40074c){var _0x45ba69=typeof _0x26ea7c['offset']===_0x769f('0x1c')&&typeof _0x26ea7c[_0x769f('0x1d')]==='undefined';var _0x2fc324=_0x40074c[_0x769f('0x1e')];var _0x49dacb=_0x45ba69?0x0:_0x26ea7c['offset'];var _0x47d7fd=_0x45ba69?_0x40074c[_0x769f('0x1e')]:_0x26ea7c[_0x769f('0x1f')]+_0x26ea7c[_0x769f('0x1d')];var _0x4a1b81;if(_0x47d7fd>=_0x2fc324){_0x47d7fd=_0x2fc324;_0x4a1b81=0xc8;}else{_0x4a1b81=0xce;}_0x3d3279['status'](_0x4a1b81);return _0x3d3279[_0x769f('0x20')](_0x769f('0x21'),_0x49dacb+'-'+_0x47d7fd+'/'+_0x2fc324)['json'](_0x40074c);}return null;};}function patchUpdates(_0x47e6a6){return function(_0x9ebcdd){try{jsonpatch[_0x769f('0x22')](_0x9ebcdd,_0x47e6a6,!![]);}catch(_0x74a59f){return BPromise['reject'](_0x74a59f);}return _0x9ebcdd['save']();};}function saveUpdates(_0x372dc7,_0x1d30eb){return function(_0x5f2197){if(_0x5f2197){return _0x5f2197[_0x769f('0x23')](_0x372dc7)['then'](function(_0x2bae5e){return _0x2bae5e;});}return null;};}function removeEntity(_0x427d26,_0x37592a){return function(_0x47774e){if(_0x47774e){return _0x47774e[_0x769f('0x24')]()[_0x769f('0x25')](function(){var _0x35a90d=_0x47774e[_0x769f('0x26')]({'plain':!![]});var _0x323f6c=_0x769f('0x27');return db[_0x769f('0x28')][_0x769f('0x24')]({'where':{'type':_0x323f6c,'resourceId':_0x35a90d['id']}})[_0x769f('0x25')](function(){return _0x47774e;});})[_0x769f('0x25')](function(){_0x427d26[_0x769f('0x1b')](0xcc)[_0x769f('0x1a')]();});}};}function handleEntityNotFound(_0x5c7b46,_0x3f056){return function(_0x33bb7c){if(!_0x33bb7c){_0x5c7b46[_0x769f('0x19')](0x194);}return _0x33bb7c;};}function handleError(_0x1610fa,_0x36ee61){_0x36ee61=_0x36ee61||0x1f4;return function(_0x35040a){logger['error'](_0x35040a[_0x769f('0x29')]);if(_0x35040a[_0x769f('0x2a')]){delete _0x35040a[_0x769f('0x2a')];}_0x1610fa[_0x769f('0x1b')](_0x36ee61)[_0x769f('0x2b')](_0x35040a);};}exports[_0x769f('0x2c')]=function(_0x5107d3,_0x5d831c){var _0x46fded={},_0x10dbaa={},_0x5c677b={'count':0x0,'rows':[]};var _0x3c1384=_[_0x769f('0x2d')](db[_0x769f('0x2e')][_0x769f('0x2f')],function(_0x35d7fb){return{'name':_0x35d7fb['fieldName'],'type':_0x35d7fb[_0x769f('0x30')][_0x769f('0x31')]};});_0x10dbaa['model']=_[_0x769f('0x2d')](_0x3c1384,_0x769f('0x2a'));_0x10dbaa['query']=_[_0x769f('0x32')](_0x5107d3[_0x769f('0x33')]);_0x10dbaa['filters']=_['intersection'](_0x10dbaa[_0x769f('0x34')],_0x10dbaa[_0x769f('0x33')]);_0x46fded[_0x769f('0x35')]=_[_0x769f('0x36')](_0x10dbaa[_0x769f('0x34')],qs[_0x769f('0x37')](_0x5107d3['query']['fields']));_0x46fded[_0x769f('0x35')]=_0x46fded['attributes'][_0x769f('0x38')]?_0x46fded[_0x769f('0x35')]:_0x10dbaa[_0x769f('0x34')];if(!_0x5107d3['query'][_0x769f('0x39')]('nolimit')){_0x46fded[_0x769f('0x1d')]=qs['limit'](_0x5107d3[_0x769f('0x33')][_0x769f('0x1d')]);_0x46fded['offset']=qs[_0x769f('0x1f')](_0x5107d3[_0x769f('0x33')][_0x769f('0x1f')]);}_0x46fded[_0x769f('0x3a')]=qs['sort'](_0x5107d3[_0x769f('0x33')][_0x769f('0x3b')]);_0x46fded[_0x769f('0x3c')]=qs[_0x769f('0x3d')](_['pick'](_0x5107d3[_0x769f('0x33')],_0x10dbaa[_0x769f('0x3d')]),_0x3c1384);if(_0x5107d3[_0x769f('0x33')][_0x769f('0x3e')]){_0x46fded[_0x769f('0x3c')]=_[_0x769f('0x3f')](_0x46fded['where'],{'$or':[{'key':{'$like':'%'+_0x5107d3[_0x769f('0x33')][_0x769f('0x3e')]+'%'}},{'value':{'$like':'%'+_0x5107d3[_0x769f('0x33')]['filter']+'%'}}]});}_0x46fded=_[_0x769f('0x3f')]({},_0x46fded,_0x5107d3['options']);var _0x5f6251={'where':_0x46fded[_0x769f('0x3c')]};return db[_0x769f('0x2e')]['count'](_0x5f6251)[_0x769f('0x25')](function(_0x3792ec){_0x5c677b[_0x769f('0x1e')]=_0x3792ec;if(_0x5107d3[_0x769f('0x33')][_0x769f('0x40')]){_0x46fded[_0x769f('0x41')]=[{'all':!![]}];}return db[_0x769f('0x2e')][_0x769f('0x42')](_0x46fded);})['then'](function(_0x4f8a5b){_0x5c677b[_0x769f('0x43')]=_0x4f8a5b;return _0x5c677b;})[_0x769f('0x25')](respondWithFilteredResult(_0x5d831c,_0x46fded))[_0x769f('0x44')](handleError(_0x5d831c,null));};exports[_0x769f('0x45')]=function(_0x593712,_0x5a7822){var _0x43af02={'raw':!![],'where':{'id':_0x593712[_0x769f('0x46')]['id']}},_0x57d17e={};_0x57d17e[_0x769f('0x34')]=_['keys'](db[_0x769f('0x2e')][_0x769f('0x2f')]);_0x57d17e['query']=_[_0x769f('0x32')](_0x593712['query']);_0x57d17e[_0x769f('0x3d')]=_[_0x769f('0x36')](_0x57d17e[_0x769f('0x34')],_0x57d17e[_0x769f('0x33')]);_0x43af02[_0x769f('0x35')]=_[_0x769f('0x36')](_0x57d17e[_0x769f('0x34')],qs[_0x769f('0x37')](_0x593712[_0x769f('0x33')][_0x769f('0x37')]));_0x43af02['attributes']=_0x43af02['attributes']['length']?_0x43af02[_0x769f('0x35')]:_0x57d17e[_0x769f('0x34')];if(_0x593712[_0x769f('0x33')][_0x769f('0x40')]){_0x43af02[_0x769f('0x41')]=[{'all':!![]}];}_0x43af02=_[_0x769f('0x3f')]({},_0x43af02,_0x593712[_0x769f('0x47')]);return db[_0x769f('0x2e')][_0x769f('0x48')](_0x43af02)[_0x769f('0x25')](handleEntityNotFound(_0x5a7822,null))['then'](respondWithResult(_0x5a7822,null))['catch'](handleError(_0x5a7822,null));};exports[_0x769f('0x23')]=function(_0x5e35f9,_0x4b3fe6){if(_0x5e35f9[_0x769f('0x49')]['id']){delete _0x5e35f9[_0x769f('0x49')]['id'];}return db[_0x769f('0x2e')][_0x769f('0x48')]({'where':{'id':_0x5e35f9[_0x769f('0x46')]['id']}})[_0x769f('0x25')](handleEntityNotFound(_0x4b3fe6,null))[_0x769f('0x25')](saveUpdates(_0x5e35f9[_0x769f('0x49')],null))[_0x769f('0x25')](respondWithResult(_0x4b3fe6,null))[_0x769f('0x44')](handleError(_0x4b3fe6,null));};exports[_0x769f('0x24')]=function(_0x171240,_0xf411f0){return db[_0x769f('0x2e')][_0x769f('0x48')]({'where':{'id':_0x171240[_0x769f('0x46')]['id']}})[_0x769f('0x25')](handleEntityNotFound(_0xf411f0,null))[_0x769f('0x25')](removeEntity(_0xf411f0,null))[_0x769f('0x44')](handleError(_0xf411f0,null));};exports[_0x769f('0x4a')]=function(_0x36cb80,_0xf80bba){var _0x53ab9a={'key':_0x36cb80[_0x769f('0x49')][_0x769f('0x31')]};if(_0x36cb80[_0x769f('0x49')][_0x769f('0x4b')]){_0x53ab9a['MailAccountId']=_0x36cb80[_0x769f('0x49')][_0x769f('0x4b')];}else if(_0x36cb80[_0x769f('0x49')][_0x769f('0x4c')]){_0x53ab9a[_0x769f('0x4c')]=_0x36cb80[_0x769f('0x49')][_0x769f('0x4c')];}else if(_0x36cb80[_0x769f('0x49')][_0x769f('0x4d')]){_0x53ab9a['OpenchannelAccountId']=_0x36cb80[_0x769f('0x49')]['OpenchannelAccountId'];}else if(_0x36cb80[_0x769f('0x49')]['ChatWebsiteId']){_0x53ab9a[_0x769f('0x4e')]=_0x36cb80[_0x769f('0x49')]['ChatWebsiteId'];}return db[_0x769f('0x2e')][_0x769f('0x48')]({'where':_0x53ab9a})[_0x769f('0x25')](function(_0x377176){if(_0x377176){throw new db[(_0x769f('0x4f'))][(_0x769f('0x50'))](_0x769f('0x51'));}return db[_0x769f('0x2e')][_0x769f('0x4a')](_0x36cb80[_0x769f('0x49')]);})[_0x769f('0x25')](function(_0x1b1023){var _0x476a96=_0x36cb80['user'][_0x769f('0x26')]({'plain':!![]});if(!_0x476a96)throw new Error(_0x769f('0x52'));if(_0x476a96[_0x769f('0x53')]===_0x769f('0x54')){var _0x5f2487=_0x1b1023['get']({'plain':!![]});return db[_0x769f('0x55')][_0x769f('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x476a96[_0x769f('0x56')]},'raw':!![]})[_0x769f('0x25')](function(_0x6c3807){if(_0x6c3807&&_0x6c3807[_0x769f('0x57')]===0x0){return db[_0x769f('0x28')][_0x769f('0x4a')]({'name':_0x5f2487[_0x769f('0x2a')],'resourceId':_0x5f2487['id'],'type':_0x6c3807['name'],'sectionId':_0x6c3807['id']},{})[_0x769f('0x25')](function(){return _0x1b1023;});}else{return _0x1b1023;}})[_0x769f('0x44')](function(_0x36455c){logger[_0x769f('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36455c);throw _0x36455c;});}return _0x1b1023;})['then'](respondWithResult(_0xf80bba,0xc9))[_0x769f('0x44')](handleError(_0xf80bba,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 3c66f81..d6e4200 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 _0xbe54=['path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x21444f,_0x15f33f){var _0x5f43c3=function(_0x500ce8){while(--_0x500ce8){_0x21444f['push'](_0x21444f['shift']());}};_0x5f43c3(++_0x15f33f);}(_0xbe54,0xe8));var _0x4be5=function(_0x323adc,_0x2688c6){_0x323adc=_0x323adc-0x0;var _0x5ae824=_0xbe54[_0x323adc];return _0x5ae824;};'use strict';var _=require(_0x4be5('0x0'));var util=require(_0x4be5('0x1'));var logger=require(_0x4be5('0x2'))(_0x4be5('0x3'));var moment=require('moment');var BPromise=require(_0x4be5('0x4'));var rp=require(_0x4be5('0x5'));var fs=require('fs');var path=require(_0x4be5('0x6'));var rimraf=require(_0x4be5('0x7'));var config=require(_0x4be5('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x4be5('0x9')]=function(_0x4f8c72,_0x12b64c){return _0x4f8c72['define'](_0x4be5('0xa'),attributes,{'tableName':_0x4be5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4be5('0xc'),'collate':_0x4be5('0xd')});};
\ No newline at end of file
+var _0x5e32=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','path','rimraf','exports','define'];(function(_0x3a0228,_0x2725a6){var _0x5dc524=function(_0xc656fb){while(--_0xc656fb){_0x3a0228['push'](_0x3a0228['shift']());}};_0x5dc524(++_0x2725a6);}(_0x5e32,0x17f));var _0x25e3=function(_0xc0e2c4,_0xa4c81e){_0xc0e2c4=_0xc0e2c4-0x0;var _0x3e378c=_0x5e32[_0xc0e2c4];return _0x3e378c;};'use strict';var _=require(_0x25e3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x25e3('0x1'));var BPromise=require('bluebird');var rp=require(_0x25e3('0x2'));var fs=require('fs');var path=require(_0x25e3('0x3'));var rimraf=require(_0x25e3('0x4'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x25e3('0x5')]=function(_0x874d86,_0x4bc3e0){return _0x874d86[_0x25e3('0x6')](_0x25e3('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x25e3('0x8'),'collate':_0x25e3('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index f0dfba2..834b904 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(_0x4c203a,_0x11ed5c){var _0x3db15f=function(_0x1a7e0f){while(--_0x1a7e0f){_0x4c203a['push'](_0x4c203a['shift']());}};_0x3db15f(++_0x11ed5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x4ca0fe,_0x15679a){var _0x55fd76=function(_0x4ffb61){while(--_0x4ffb61){_0x4ca0fe['push'](_0x4ca0fe['shift']());}};_0x55fd76(++_0x15679a);}(_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 d16f922..c2451b6 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 _0xc155=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2cd077,_0x442246){var _0x483c19=function(_0x50a3bd){while(--_0x50a3bd){_0x2cd077['push'](_0x2cd077['shift']());}};_0x483c19(++_0x442246);}(_0xc155,0x196));var _0x5c15=function(_0x55cbb1,_0x3a5e3c){_0x55cbb1=_0x55cbb1-0x0;var _0x38b5e0=_0xc155[_0x55cbb1];return _0x38b5e0;};'use strict';var multer=require(_0x5c15('0x0'));var util=require(_0x5c15('0x1'));var path=require('path');var timeout=require(_0x5c15('0x2'));var express=require('express');var router=express[_0x5c15('0x3')]();var fs_extra=require(_0x5c15('0x4'));var auth=require(_0x5c15('0x5'));var interaction=require(_0x5c15('0x6'));var config=require(_0x5c15('0x7'));var controller=require(_0x5c15('0x8'));router[_0x5c15('0x9')]('/',auth[_0x5c15('0xa')](),controller[_0x5c15('0xb')]);router[_0x5c15('0x9')](_0x5c15('0xc'),auth[_0x5c15('0xa')](),controller[_0x5c15('0xd')]);router[_0x5c15('0xe')]('/',auth[_0x5c15('0xa')](),controller[_0x5c15('0xf')]);router[_0x5c15('0x10')](_0x5c15('0xc'),auth[_0x5c15('0xa')](),controller['update']);router[_0x5c15('0x11')]('/:id',auth[_0x5c15('0xa')](),controller[_0x5c15('0x12')]);module[_0x5c15('0x13')]=router;
\ No newline at end of file
+var _0x392b=['./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x392b,0xdc));var _0xb392=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x392b[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xb392('0x0'));var util=require('util');var path=require(_0xb392('0x1'));var timeout=require(_0xb392('0x2'));var express=require(_0xb392('0x3'));var router=express[_0xb392('0x4')]();var fs_extra=require(_0xb392('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb392('0x6'));var config=require(_0xb392('0x7'));var controller=require(_0xb392('0x8'));router[_0xb392('0x9')]('/',auth[_0xb392('0xa')](),controller['index']);router['get'](_0xb392('0xb'),auth['isAuthenticated'](),controller[_0xb392('0xc')]);router[_0xb392('0xd')]('/',auth[_0xb392('0xa')](),controller[_0xb392('0xe')]);router['put'](_0xb392('0xb'),auth[_0xb392('0xa')](),controller[_0xb392('0xf')]);router[_0xb392('0x10')](_0xb392('0xb'),auth[_0xb392('0xa')](),controller[_0xb392('0x11')]);module[_0xb392('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index ed2b080..84993b1 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 _0x1667=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1667,0xfd));var _0x7166=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x1667[_0x11f5ff];return _0x46eefb;};'use strict';var Sequelize=require(_0x7166('0x0'));module[_0x7166('0x1')]={'calldate':{'type':Sequelize[_0x7166('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x7166('0x3')]},'dst':{'type':Sequelize[_0x7166('0x3')]},'dcontext':{'type':Sequelize[_0x7166('0x3')]},'channel':{'type':Sequelize[_0x7166('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7166('0x3')]},'lastdata':{'type':Sequelize[_0x7166('0x3')]},'duration':{'type':Sequelize[_0x7166('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7166('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7166('0x3')]},'userfield':{'type':Sequelize[_0x7166('0x3')]},'uniqueid':{'type':Sequelize[_0x7166('0x3')]},'linkedid':{'type':Sequelize[_0x7166('0x3')]},'sequence':{'type':Sequelize[_0x7166('0x3')]},'peeraccount':{'type':Sequelize[_0x7166('0x3')]},'type':{'type':Sequelize[_0x7166('0x3')]},'tag':{'type':Sequelize[_0x7166('0x3')]}};
\ No newline at end of file
+var _0xde71=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xde71,0x1c1));var _0x1de7=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0xde71[_0x2ef8c1];return _0x288305;};'use strict';var Sequelize=require(_0x1de7('0x0'));module[_0x1de7('0x1')]={'calldate':{'type':Sequelize[_0x1de7('0x2')],'allowNull':![],'defaultValue':_0x1de7('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1de7('0x4')]},'dst':{'type':Sequelize[_0x1de7('0x4')]},'dcontext':{'type':Sequelize[_0x1de7('0x4')]},'channel':{'type':Sequelize[_0x1de7('0x4')]},'dstchannel':{'type':Sequelize[_0x1de7('0x4')]},'lastapp':{'type':Sequelize[_0x1de7('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1de7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1de7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1de7('0x4')]},'amaflags':{'type':Sequelize[_0x1de7('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1de7('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x1de7('0x4')]},'sequence':{'type':Sequelize[_0x1de7('0x4')]},'peeraccount':{'type':Sequelize[_0x1de7('0x4')]},'type':{'type':Sequelize[_0x1de7('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 dd63e46..1a6838f 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 _0x56e6=['keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','Cdr','rawAttributes','fieldName','model','map','name'];(function(_0x4f9522,_0x399e9f){var _0x5a89a7=function(_0x853a9a){while(--_0x853a9a){_0x4f9522['push'](_0x4f9522['shift']());}};_0x5a89a7(++_0x399e9f);}(_0x56e6,0x6b));var _0x656e=function(_0x379eb3,_0x42926e){_0x379eb3=_0x379eb3-0x0;var _0x5ce3cb=_0x56e6[_0x379eb3];return _0x5ce3cb;};'use strict';var emlformat=require(_0x656e('0x0'));var rimraf=require(_0x656e('0x1'));var zipdir=require(_0x656e('0x2'));var jsonpatch=require(_0x656e('0x3'));var rp=require(_0x656e('0x4'));var moment=require(_0x656e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x656e('0x6'));var util=require(_0x656e('0x7'));var path=require(_0x656e('0x8'));var sox=require(_0x656e('0x9'));var csv=require(_0x656e('0xa'));var ejs=require(_0x656e('0xb'));var fs=require('fs');var fs_extra=require(_0x656e('0xc'));var _=require('lodash');var squel=require(_0x656e('0xd'));var crypto=require(_0x656e('0xe'));var jsforce=require(_0x656e('0xf'));var deskjs=require(_0x656e('0x10'));var toCsv=require(_0x656e('0xa'));var querystring=require(_0x656e('0x11'));var Papa=require(_0x656e('0x12'));var Redis=require(_0x656e('0x13'));var authService=require(_0x656e('0x14'));var qs=require(_0x656e('0x15'));var as=require(_0x656e('0x16'));var hardwareService=require(_0x656e('0x17'));var logger=require(_0x656e('0x18'))(_0x656e('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x656e('0x1a'));var db=require(_0x656e('0x1b'))['db'];function respondWithStatusCode(_0x3cb3c8,_0x460aad){_0x460aad=_0x460aad||0xcc;return function(_0x581525){if(_0x581525){return _0x3cb3c8['sendStatus'](_0x460aad);}return _0x3cb3c8[_0x656e('0x1c')](_0x460aad)[_0x656e('0x1d')]();};}function respondWithResult(_0x53699e,_0x230249){_0x230249=_0x230249||0xc8;return function(_0x5059d9){if(_0x5059d9){return _0x53699e[_0x656e('0x1c')](_0x230249)[_0x656e('0x1e')](_0x5059d9);}};}function respondWithFilteredResult(_0x2a52f7,_0x1f839f){return function(_0x5a1fc3){if(_0x5a1fc3){var _0x3ab51b=typeof _0x1f839f[_0x656e('0x1f')]===_0x656e('0x20')&&typeof _0x1f839f[_0x656e('0x21')]===_0x656e('0x20');var _0x4fd12e=_0x5a1fc3['count'];var _0x526b83=_0x3ab51b?0x0:_0x1f839f[_0x656e('0x1f')];var _0x1b0fdd=_0x3ab51b?_0x5a1fc3['count']:_0x1f839f[_0x656e('0x1f')]+_0x1f839f['limit'];var _0x495f60;if(_0x1b0fdd>=_0x4fd12e){_0x1b0fdd=_0x4fd12e;_0x495f60=0xc8;}else{_0x495f60=0xce;}_0x2a52f7['status'](_0x495f60);return _0x2a52f7[_0x656e('0x22')](_0x656e('0x23'),_0x526b83+'-'+_0x1b0fdd+'/'+_0x4fd12e)[_0x656e('0x1e')](_0x5a1fc3);}return null;};}function patchUpdates(_0x141587){return function(_0x5532ee){try{jsonpatch[_0x656e('0x24')](_0x5532ee,_0x141587,!![]);}catch(_0x543338){return BPromise[_0x656e('0x25')](_0x543338);}return _0x5532ee['save']();};}function saveUpdates(_0x159e42,_0x1acca5){return function(_0x19ab77){if(_0x19ab77){return _0x19ab77[_0x656e('0x26')](_0x159e42)[_0x656e('0x27')](function(_0x38ea02){return _0x38ea02;});}return null;};}function removeEntity(_0x382a5f,_0x57ac6c){return function(_0x44551b){if(_0x44551b){return _0x44551b[_0x656e('0x28')]()['then'](function(){_0x382a5f['status'](0xcc)[_0x656e('0x1d')]();});}};}function handleEntityNotFound(_0x517021,_0x33fb09){return function(_0x5b492e){if(!_0x5b492e){_0x517021['sendStatus'](0x194);}return _0x5b492e;};}function handleError(_0xa834a5,_0x4e2a80){_0x4e2a80=_0x4e2a80||0x1f4;return function(_0x26870d){logger[_0x656e('0x29')](_0x26870d[_0x656e('0x2a')]);if(_0x26870d['name']){delete _0x26870d['name'];}_0xa834a5[_0x656e('0x1c')](_0x4e2a80)[_0x656e('0x2b')](_0x26870d);};}exports[_0x656e('0x2c')]=function(_0x469acf,_0xc2a01){var _0x264e88={},_0xfece84={},_0x58181e={'count':0x0,'rows':[]};var _0x84d034=_['map'](db[_0x656e('0x2d')][_0x656e('0x2e')],function(_0x58cf11){return{'name':_0x58cf11[_0x656e('0x2f')],'type':_0x58cf11['type']['key']};});_0xfece84[_0x656e('0x30')]=_[_0x656e('0x31')](_0x84d034,_0x656e('0x32'));_0xfece84['query']=_[_0x656e('0x33')](_0x469acf['query']);_0xfece84[_0x656e('0x34')]=_[_0x656e('0x35')](_0xfece84['model'],_0xfece84[_0x656e('0x36')]);_0x264e88['attributes']=_['intersection'](_0xfece84[_0x656e('0x30')],qs['fields'](_0x469acf[_0x656e('0x36')][_0x656e('0x37')]));_0x264e88[_0x656e('0x38')]=_0x264e88[_0x656e('0x38')]['length']?_0x264e88['attributes']:_0xfece84[_0x656e('0x30')];if(!_0x469acf['query'][_0x656e('0x39')](_0x656e('0x3a'))){_0x264e88[_0x656e('0x21')]=qs[_0x656e('0x21')](_0x469acf[_0x656e('0x36')][_0x656e('0x21')]);_0x264e88['offset']=qs['offset'](_0x469acf['query']['offset']);}_0x264e88['order']=qs[_0x656e('0x3b')](_0x469acf['query']['sort']);_0x264e88[_0x656e('0x3c')]=qs[_0x656e('0x34')](_[_0x656e('0x3d')](_0x469acf[_0x656e('0x36')],_0xfece84[_0x656e('0x34')]),_0x84d034);if(_0x469acf[_0x656e('0x36')][_0x656e('0x3e')]){_0x264e88[_0x656e('0x3c')]=_[_0x656e('0x3f')](_0x264e88[_0x656e('0x3c')],{'$or':_[_0x656e('0x31')](_0x84d034,function(_0x46306a){if(_0x46306a[_0x656e('0x40')]!=='VIRTUAL'){var _0x3c1a70={};_0x3c1a70[_0x46306a['name']]={'$like':'%'+_0x469acf['query'][_0x656e('0x3e')]+'%'};return _0x3c1a70;}})});}_0x264e88=_[_0x656e('0x3f')]({},_0x264e88,_0x469acf[_0x656e('0x41')]);var _0x5cd5e9={'where':_0x264e88['where']};return db['Cdr'][_0x656e('0x42')](_0x5cd5e9)[_0x656e('0x27')](function(_0x3e6266){_0x58181e[_0x656e('0x42')]=_0x3e6266;if(_0x469acf[_0x656e('0x36')][_0x656e('0x43')]){_0x264e88[_0x656e('0x44')]=[{'all':!![]}];}return db[_0x656e('0x2d')][_0x656e('0x45')](_0x264e88);})[_0x656e('0x27')](function(_0x3f81fa){_0x58181e[_0x656e('0x46')]=_0x3f81fa;return _0x58181e;})[_0x656e('0x27')](respondWithFilteredResult(_0xc2a01,_0x264e88))['catch'](handleError(_0xc2a01,null));};exports[_0x656e('0x47')]=function(_0x562482,_0x21af67){var _0x3f3d5e={'raw':!![],'where':{'id':_0x562482[_0x656e('0x48')]['id']}},_0x4045c4={};_0x4045c4[_0x656e('0x30')]=_[_0x656e('0x33')](db[_0x656e('0x2d')][_0x656e('0x2e')]);_0x4045c4[_0x656e('0x36')]=_[_0x656e('0x33')](_0x562482['query']);_0x4045c4[_0x656e('0x34')]=_[_0x656e('0x35')](_0x4045c4[_0x656e('0x30')],_0x4045c4['query']);_0x3f3d5e['attributes']=_[_0x656e('0x35')](_0x4045c4[_0x656e('0x30')],qs[_0x656e('0x37')](_0x562482[_0x656e('0x36')]['fields']));_0x3f3d5e[_0x656e('0x38')]=_0x3f3d5e[_0x656e('0x38')][_0x656e('0x49')]?_0x3f3d5e[_0x656e('0x38')]:_0x4045c4[_0x656e('0x30')];if(_0x562482['query'][_0x656e('0x43')]){_0x3f3d5e[_0x656e('0x44')]=[{'all':!![]}];}_0x3f3d5e=_[_0x656e('0x3f')]({},_0x3f3d5e,_0x562482[_0x656e('0x41')]);return db[_0x656e('0x2d')][_0x656e('0x4a')](_0x3f3d5e)['then'](handleEntityNotFound(_0x21af67,null))[_0x656e('0x27')](respondWithResult(_0x21af67,null))[_0x656e('0x4b')](handleError(_0x21af67,null));};exports[_0x656e('0x4c')]=function(_0x904b8a,_0x5dbcfb){return db['Cdr'][_0x656e('0x4c')](_0x904b8a['body'],{})['then'](respondWithResult(_0x5dbcfb,0xc9))['catch'](handleError(_0x5dbcfb,null));};exports[_0x656e('0x26')]=function(_0x2c648e,_0x59cb0f){if(_0x2c648e['body']['id']){delete _0x2c648e['body']['id'];}return db['Cdr'][_0x656e('0x4a')]({'where':{'id':_0x2c648e[_0x656e('0x48')]['id']}})['then'](handleEntityNotFound(_0x59cb0f,null))[_0x656e('0x27')](saveUpdates(_0x2c648e[_0x656e('0x4d')],null))[_0x656e('0x27')](respondWithResult(_0x59cb0f,null))[_0x656e('0x4b')](handleError(_0x59cb0f,null));};exports[_0x656e('0x28')]=function(_0x3e8d90,_0x2dac52){return db[_0x656e('0x2d')][_0x656e('0x4a')]({'where':{'id':_0x3e8d90[_0x656e('0x48')]['id']}})[_0x656e('0x27')](handleEntityNotFound(_0x2dac52,null))['then'](removeEntity(_0x2dac52,null))['catch'](handleError(_0x2dac52,null));};exports['describe']=function(_0x47e622,_0x464881){return db[_0x656e('0x2d')][_0x656e('0x4e')]()['then'](respondWithResult(_0x464881,null))['catch'](handleError(_0x464881,null));};
\ No newline at end of file
+var _0x0bde=['findAll','rows','create','body','catch','update','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];function respondWithStatusCode(_0x54d40e,_0xc492b4){_0xc492b4=_0xc492b4||0xcc;return function(_0x5272ca){if(_0x5272ca){return _0x54d40e[_0xe0bd('0x17')](_0xc492b4);}return _0x54d40e[_0xe0bd('0x18')](_0xc492b4)[_0xe0bd('0x19')]();};}function respondWithResult(_0x20ab47,_0x47664e){_0x47664e=_0x47664e||0xc8;return function(_0x335f17){if(_0x335f17){return _0x20ab47[_0xe0bd('0x18')](_0x47664e)[_0xe0bd('0x1a')](_0x335f17);}};}function respondWithFilteredResult(_0x4f63fa,_0x50891d){return function(_0x4fb006){if(_0x4fb006){var _0x2ff887=typeof _0x50891d[_0xe0bd('0x1b')]===_0xe0bd('0x1c')&&typeof _0x50891d[_0xe0bd('0x1d')]===_0xe0bd('0x1c');var _0x55f304=_0x4fb006['count'];var _0x1becc8=_0x2ff887?0x0:_0x50891d['offset'];var _0x4f36f7=_0x2ff887?_0x4fb006[_0xe0bd('0x1e')]:_0x50891d[_0xe0bd('0x1b')]+_0x50891d[_0xe0bd('0x1d')];var _0x5f22e2;if(_0x4f36f7>=_0x55f304){_0x4f36f7=_0x55f304;_0x5f22e2=0xc8;}else{_0x5f22e2=0xce;}_0x4f63fa[_0xe0bd('0x18')](_0x5f22e2);return _0x4f63fa[_0xe0bd('0x1f')](_0xe0bd('0x20'),_0x1becc8+'-'+_0x4f36f7+'/'+_0x55f304)['json'](_0x4fb006);}return null;};}function patchUpdates(_0x1bf742){return function(_0x25f595){try{jsonpatch[_0xe0bd('0x21')](_0x25f595,_0x1bf742,!![]);}catch(_0x532584){return BPromise[_0xe0bd('0x22')](_0x532584);}return _0x25f595[_0xe0bd('0x23')]();};}function saveUpdates(_0x2b4f7d,_0x5378d2){return function(_0x1d6a19){if(_0x1d6a19){return _0x1d6a19['update'](_0x2b4f7d)[_0xe0bd('0x24')](function(_0x2bcfcc){return _0x2bcfcc;});}return null;};}function removeEntity(_0x4bcd48,_0xa4a4e9){return function(_0xf6d956){if(_0xf6d956){return _0xf6d956[_0xe0bd('0x25')]()[_0xe0bd('0x24')](function(){_0x4bcd48[_0xe0bd('0x18')](0xcc)[_0xe0bd('0x19')]();});}};}function handleEntityNotFound(_0x2096a2,_0x162356){return function(_0x537708){if(!_0x537708){_0x2096a2['sendStatus'](0x194);}return _0x537708;};}function handleError(_0x275f14,_0x39c98e){_0x39c98e=_0x39c98e||0x1f4;return function(_0x47d171){logger['error'](_0x47d171[_0xe0bd('0x26')]);if(_0x47d171[_0xe0bd('0x27')]){delete _0x47d171[_0xe0bd('0x27')];}_0x275f14[_0xe0bd('0x18')](_0x39c98e)['send'](_0x47d171);};}exports[_0xe0bd('0x28')]=function(_0x4ef39b,_0x9146fe){var _0x170874={},_0x42bea7={},_0x1b857c={'count':0x0,'rows':[]};var _0x1e2020=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x25d515){return{'name':_0x25d515[_0xe0bd('0x2c')],'type':_0x25d515[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x42bea7[_0xe0bd('0x2f')]=_['map'](_0x1e2020,_0xe0bd('0x27'));_0x42bea7[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x4ef39b[_0xe0bd('0x30')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x42bea7['model'],_0x42bea7['query']);_0x170874[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x42bea7[_0xe0bd('0x2f')],qs[_0xe0bd('0x35')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x170874[_0xe0bd('0x34')]=_0x170874['attributes'][_0xe0bd('0x36')]?_0x170874[_0xe0bd('0x34')]:_0x42bea7[_0xe0bd('0x2f')];if(!_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x37')](_0xe0bd('0x38'))){_0x170874['limit']=qs[_0xe0bd('0x1d')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x1d')]);_0x170874[_0xe0bd('0x1b')]=qs[_0xe0bd('0x1b')](_0x4ef39b['query']['offset']);}_0x170874[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x4ef39b[_0xe0bd('0x30')]['sort']);_0x170874[_0xe0bd('0x3b')]=qs['filters'](_['pick'](_0x4ef39b[_0xe0bd('0x30')],_0x42bea7[_0xe0bd('0x32')]),_0x1e2020);if(_0x4ef39b['query']['filter']){_0x170874['where']=_[_0xe0bd('0x3c')](_0x170874[_0xe0bd('0x3b')],{'$or':_[_0xe0bd('0x29')](_0x1e2020,function(_0x5d2aff){if(_0x5d2aff[_0xe0bd('0x2d')]!==_0xe0bd('0x3d')){var _0x1e6823={};_0x1e6823[_0x5d2aff['name']]={'$like':'%'+_0x4ef39b['query'][_0xe0bd('0x3e')]+'%'};return _0x1e6823;}})});}_0x170874=_['merge']({},_0x170874,_0x4ef39b[_0xe0bd('0x3f')]);var _0x195f0f={'where':_0x170874['where']};return db[_0xe0bd('0x2a')][_0xe0bd('0x1e')](_0x195f0f)[_0xe0bd('0x24')](function(_0xb65059){_0x1b857c[_0xe0bd('0x1e')]=_0xb65059;if(_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x170874['include']=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x170874);})[_0xe0bd('0x24')](function(_0x3c138e){_0x1b857c[_0xe0bd('0x42')]=_0x3c138e;return _0x1b857c;})['then'](respondWithFilteredResult(_0x9146fe,_0x170874))['catch'](handleError(_0x9146fe,null));};exports['show']=function(_0x2b27b1,_0x1a121f){var _0x15de49={'raw':!![],'where':{'id':_0x2b27b1['params']['id']}},_0x32ed4f={};_0x32ed4f['model']=_[_0xe0bd('0x31')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x32ed4f[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x2b27b1[_0xe0bd('0x30')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x32ed4f[_0xe0bd('0x2f')],_0x32ed4f['query']);_0x15de49[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x32ed4f['model'],qs['fields'](_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x15de49[_0xe0bd('0x34')]=_0x15de49[_0xe0bd('0x34')][_0xe0bd('0x36')]?_0x15de49[_0xe0bd('0x34')]:_0x32ed4f[_0xe0bd('0x2f')];if(_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x15de49['include']=[{'all':!![]}];}_0x15de49=_[_0xe0bd('0x3c')]({},_0x15de49,_0x2b27b1[_0xe0bd('0x3f')]);return db[_0xe0bd('0x2a')]['find'](_0x15de49)[_0xe0bd('0x24')](handleEntityNotFound(_0x1a121f,null))[_0xe0bd('0x24')](respondWithResult(_0x1a121f,null))['catch'](handleError(_0x1a121f,null));};exports[_0xe0bd('0x43')]=function(_0x136ac6,_0x578792){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')](_0x136ac6[_0xe0bd('0x44')],{})['then'](respondWithResult(_0x578792,0xc9))[_0xe0bd('0x45')](handleError(_0x578792,null));};exports[_0xe0bd('0x46')]=function(_0x147438,_0x21ae20){if(_0x147438[_0xe0bd('0x44')]['id']){delete _0x147438[_0xe0bd('0x44')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0x147438[_0xe0bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](saveUpdates(_0x147438['body'],null))[_0xe0bd('0x24')](respondWithResult(_0x21ae20,null))[_0xe0bd('0x45')](handleError(_0x21ae20,null));};exports['destroy']=function(_0xacd120,_0x284ea3){return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0xacd120[_0xe0bd('0x48')]['id']}})[_0xe0bd('0x24')](handleEntityNotFound(_0x284ea3,null))[_0xe0bd('0x24')](removeEntity(_0x284ea3,null))[_0xe0bd('0x45')](handleError(_0x284ea3,null));};exports[_0xe0bd('0x49')]=function(_0x2631f5,_0x503939){return db[_0xe0bd('0x2a')][_0xe0bd('0x49')]()[_0xe0bd('0x24')](respondWithResult(_0x503939,null))['catch'](handleError(_0x503939,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b67ed01..9a848d3 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x47dc31,_0x1b909c){var _0x1a43d0=function(_0x382e23){while(--_0x382e23){_0x47dc31['push'](_0x47dc31['shift']());}};_0x1a43d0(++_0x1b909c);}(_0x7a54,0x106));var _0x47a5=function(_0x5f1eda,_0x31127f){_0x5f1eda=_0x5f1eda-0x0;var _0x13e399=_0x7a54[_0x5f1eda];return _0x13e399;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xc1385f,_0x9c0bea){var _0x2d1bee=function(_0x4b5d8d){while(--_0x4b5d8d){_0xc1385f['push'](_0xc1385f['shift']());}};_0x2d1bee(++_0x9c0bea);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 48b731c..bdde1a6 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 _0xe248=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','Cdr,\x20%s,\x20%s','message','catch','lodash','moment'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe248,0x1e1));var _0x8e24=function(_0x30aeb6,_0x1832ed){_0x30aeb6=_0x30aeb6-0x0;var _0x1ca9fa=_0xe248[_0x30aeb6];return _0x1ca9fa;};'use strict';var _=require(_0x8e24('0x0'));var util=require('util');var moment=require(_0x8e24('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e24('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e24('0x3'));var logger=require(_0x8e24('0x4'))(_0x8e24('0x5'));var config=require(_0x8e24('0x6'));var jayson=require(_0x8e24('0x7'));var client=jayson[_0x8e24('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a61cf,_0x4ae089,_0x4b36bd){return new BPromise(function(_0x4be706,_0xabb84c){return client[_0x8e24('0x9')](_0x4a61cf,_0x4b36bd)[_0x8e24('0xa')](function(_0x25068e){logger[_0x8e24('0xb')]('Cdr,\x20%s,\x20%s',_0x4ae089,_0x8e24('0xc'));logger[_0x8e24('0xd')](_0x8e24('0xe'),_0x4ae089,_0x8e24('0xc'),JSON[_0x8e24('0xf')](_0x25068e));if(_0x25068e['error']){if(_0x25068e['error'][_0x8e24('0x10')]===0x1f4){logger[_0x8e24('0x11')](_0x8e24('0x12'),_0x4ae089,_0x25068e[_0x8e24('0x11')][_0x8e24('0x13')]);return _0xabb84c(_0x25068e['error']['message']);}logger[_0x8e24('0x11')](_0x8e24('0x12'),_0x4ae089,_0x25068e[_0x8e24('0x11')][_0x8e24('0x13')]);return _0x4be706(_0x25068e[_0x8e24('0x11')][_0x8e24('0x13')]);}else{logger[_0x8e24('0xb')]('Cdr,\x20%s,\x20%s',_0x4ae089,_0x8e24('0xc'));_0x4be706(_0x25068e['result'][_0x8e24('0x13')]);}})[_0x8e24('0x14')](function(_0x267fb6){logger[_0x8e24('0x11')](_0x8e24('0x12'),_0x4ae089,_0x267fb6);_0xabb84c(_0x267fb6);});});}
\ No newline at end of file
+var _0x88d7=['Cdr,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5bc1fe,_0x458299){var _0x482b91=function(_0xeb37d0){while(--_0xeb37d0){_0x5bc1fe['push'](_0x5bc1fe['shift']());}};_0x482b91(++_0x458299);}(_0x88d7,0x107));var _0x788d=function(_0xd9d17d,_0x3f089b){_0xd9d17d=_0xd9d17d-0x0;var _0x487156=_0x88d7[_0xd9d17d];return _0x487156;};'use strict';var _=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var moment=require('moment');var BPromise=require(_0x788d('0x2'));var rs=require(_0x788d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x788d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x788d('0x5'))(_0x788d('0x6'));var config=require(_0x788d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x788d('0x8')][_0x788d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2679d0,_0x3497b6,_0x4babe1){return new BPromise(function(_0x100dc7,_0x50dbfa){return client['request'](_0x2679d0,_0x4babe1)[_0x788d('0xa')](function(_0x4af167){logger[_0x788d('0xb')]('Cdr,\x20%s,\x20%s',_0x3497b6,'request\x20sent');logger['debug'](_0x788d('0xc'),_0x3497b6,_0x788d('0xd'),JSON[_0x788d('0xe')](_0x4af167));if(_0x4af167[_0x788d('0xf')]){if(_0x4af167[_0x788d('0xf')][_0x788d('0x10')]===0x1f4){logger[_0x788d('0xf')](_0x788d('0x11'),_0x3497b6,_0x4af167['error'][_0x788d('0x12')]);return _0x50dbfa(_0x4af167['error']['message']);}logger[_0x788d('0xf')](_0x788d('0x11'),_0x3497b6,_0x4af167['error'][_0x788d('0x12')]);return _0x100dc7(_0x4af167[_0x788d('0xf')][_0x788d('0x12')]);}else{logger[_0x788d('0xb')]('Cdr,\x20%s,\x20%s',_0x3497b6,_0x788d('0xd'));_0x100dc7(_0x4af167['result']['message']);}})[_0x788d('0x13')](function(_0x113d90){logger[_0x788d('0xf')]('Cdr,\x20%s,\x20%s',_0x3497b6,_0x113d90);_0x50dbfa(_0x113d90);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index a51063e..9e01cdf 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(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 1b61683..49d83e5 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 _0x1722=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1722,0x85));var _0x2172=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1722[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x2172('0x0'));module[_0x2172('0x1')]={'priority':{'type':Sequelize[_0x2172('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2172('0x3')],'allowNull':![],'defaultValue':_0x2172('0x4')},'appdata':{'type':Sequelize[_0x2172('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2172('0x6')}};
\ No newline at end of file
+var _0xd56d=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xd56d,0x15a));var _0xdd56=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0xd56d[_0x4b9dc9];return _0x57b302;};'use strict';var Sequelize=require(_0xdd56('0x0'));module['exports']={'priority':{'type':Sequelize[_0xdd56('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdd56('0x2')],'allowNull':![],'defaultValue':_0xdd56('0x3')},'appdata':{'type':Sequelize[_0xdd56('0x4')]()},'description':{'type':Sequelize[_0xdd56('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdd56('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f2f82cb..46eafdf 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 _0x5d86=['find','body','params','catch','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x5d86,0x76));var _0x65d8=function(_0x2e8889,_0xcd72f9){_0x2e8889=_0x2e8889-0x0;var _0x19dae6=_0x5d86[_0x2e8889];return _0x19dae6;};'use strict';var emlformat=require(_0x65d8('0x0'));var rimraf=require(_0x65d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x65d8('0x2'));var moment=require('moment');var BPromise=require(_0x65d8('0x3'));var Mustache=require(_0x65d8('0x4'));var util=require('util');var path=require(_0x65d8('0x5'));var sox=require('sox');var csv=require(_0x65d8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65d8('0x7'));var _=require(_0x65d8('0x8'));var squel=require('squel');var crypto=require(_0x65d8('0x9'));var jsforce=require(_0x65d8('0xa'));var deskjs=require(_0x65d8('0xb'));var toCsv=require(_0x65d8('0x6'));var querystring=require(_0x65d8('0xc'));var Papa=require(_0x65d8('0xd'));var Redis=require(_0x65d8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65d8('0xf'));var logger=require(_0x65d8('0x10'))(_0x65d8('0x11'));var utils=require(_0x65d8('0x12'));var config=require(_0x65d8('0x13'));var licenseUtil=require(_0x65d8('0x14'));var db=require(_0x65d8('0x15'))['db'];function respondWithStatusCode(_0x32c2ee,_0x5430c9){_0x5430c9=_0x5430c9||0xcc;return function(_0x2a7c1c){if(_0x2a7c1c){return _0x32c2ee[_0x65d8('0x16')](_0x5430c9);}return _0x32c2ee[_0x65d8('0x17')](_0x5430c9)[_0x65d8('0x18')]();};}function respondWithResult(_0x50997d,_0x26bc7d){_0x26bc7d=_0x26bc7d||0xc8;return function(_0xc02e5c){if(_0xc02e5c){return _0x50997d[_0x65d8('0x17')](_0x26bc7d)[_0x65d8('0x19')](_0xc02e5c);}};}function respondWithFilteredResult(_0x27fd83,_0x41a4e0){return function(_0x459676){if(_0x459676){var _0x374e10=typeof _0x41a4e0['offset']===_0x65d8('0x1a')&&typeof _0x41a4e0[_0x65d8('0x1b')]===_0x65d8('0x1a');var _0x1138df=_0x459676[_0x65d8('0x1c')];var _0x509036=_0x374e10?0x0:_0x41a4e0[_0x65d8('0x1d')];var _0xa15a5b=_0x374e10?_0x459676[_0x65d8('0x1c')]:_0x41a4e0[_0x65d8('0x1d')]+_0x41a4e0[_0x65d8('0x1b')];var _0x3782b8;if(_0xa15a5b>=_0x1138df){_0xa15a5b=_0x1138df;_0x3782b8=0xc8;}else{_0x3782b8=0xce;}_0x27fd83[_0x65d8('0x17')](_0x3782b8);return _0x27fd83['set'](_0x65d8('0x1e'),_0x509036+'-'+_0xa15a5b+'/'+_0x1138df)['json'](_0x459676);}return null;};}function patchUpdates(_0x3f88fc){return function(_0x565123){try{jsonpatch[_0x65d8('0x1f')](_0x565123,_0x3f88fc,!![]);}catch(_0x41d9b0){return BPromise[_0x65d8('0x20')](_0x41d9b0);}return _0x565123[_0x65d8('0x21')]();};}function saveUpdates(_0x4dbe5e,_0x559649){return function(_0x24861b){if(_0x24861b){return _0x24861b[_0x65d8('0x22')](_0x4dbe5e)[_0x65d8('0x23')](function(_0x1e56ed){return _0x1e56ed;});}return null;};}function removeEntity(_0x5c8282,_0x506e46){return function(_0x23c6e2){if(_0x23c6e2){return _0x23c6e2[_0x65d8('0x24')]()['then'](function(){_0x5c8282[_0x65d8('0x17')](0xcc)[_0x65d8('0x18')]();});}};}function handleEntityNotFound(_0x5daeb6,_0x2da44c){return function(_0x12493a){if(!_0x12493a){_0x5daeb6[_0x65d8('0x16')](0x194);}return _0x12493a;};}function handleError(_0x4e7958,_0x7779ad){_0x7779ad=_0x7779ad||0x1f4;return function(_0x5b5fe3){logger[_0x65d8('0x25')](_0x5b5fe3[_0x65d8('0x26')]);if(_0x5b5fe3[_0x65d8('0x27')]){delete _0x5b5fe3['name'];}_0x4e7958['status'](_0x7779ad)['send'](_0x5b5fe3);};}exports[_0x65d8('0x28')]=function(_0x29bafd,_0x1581a2){var _0x2d5ef2={'raw':!![],'where':{'id':_0x29bafd['params']['id']}},_0x128956={};_0x128956[_0x65d8('0x29')]=_[_0x65d8('0x2a')](db[_0x65d8('0x2b')][_0x65d8('0x2c')]);_0x128956[_0x65d8('0x2d')]=_[_0x65d8('0x2a')](_0x29bafd[_0x65d8('0x2d')]);_0x128956[_0x65d8('0x2e')]=_[_0x65d8('0x2f')](_0x128956[_0x65d8('0x29')],_0x128956['query']);_0x2d5ef2[_0x65d8('0x30')]=_[_0x65d8('0x2f')](_0x128956[_0x65d8('0x29')],qs['fields'](_0x29bafd[_0x65d8('0x2d')][_0x65d8('0x31')]));_0x2d5ef2['attributes']=_0x2d5ef2[_0x65d8('0x30')][_0x65d8('0x32')]?_0x2d5ef2[_0x65d8('0x30')]:_0x128956[_0x65d8('0x29')];if(_0x29bafd['query']['includeAll']){_0x2d5ef2['include']=[{'all':!![]}];}_0x2d5ef2=_[_0x65d8('0x33')]({},_0x2d5ef2,_0x29bafd[_0x65d8('0x34')]);return db['ChatApplication'][_0x65d8('0x35')](_0x2d5ef2)[_0x65d8('0x23')](handleEntityNotFound(_0x1581a2,null))[_0x65d8('0x23')](respondWithResult(_0x1581a2,null))['catch'](handleError(_0x1581a2,null));};exports[_0x65d8('0x22')]=function(_0x42a778,_0x11383f){if(_0x42a778[_0x65d8('0x36')]['id']){delete _0x42a778[_0x65d8('0x36')]['id'];}return db['ChatApplication'][_0x65d8('0x35')]({'where':{'id':_0x42a778[_0x65d8('0x37')]['id']}})['then'](handleEntityNotFound(_0x11383f,null))[_0x65d8('0x23')](saveUpdates(_0x42a778[_0x65d8('0x36')],null))[_0x65d8('0x23')](respondWithResult(_0x11383f,null))['catch'](handleError(_0x11383f,null));};exports[_0x65d8('0x24')]=function(_0x574908,_0x5ee9be){return db[_0x65d8('0x2b')][_0x65d8('0x35')]({'where':{'id':_0x574908[_0x65d8('0x37')]['id']}})['then'](handleEntityNotFound(_0x5ee9be,null))[_0x65d8('0x23')](removeEntity(_0x5ee9be,null))[_0x65d8('0x38')](handleError(_0x5ee9be,null));};
\ No newline at end of file
+var _0x6427=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','rimraf','zip-dir'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x6427,0xbe));var _0x7642=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x6427[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7642('0x0'));var zipdir=require(_0x7642('0x1'));var jsonpatch=require(_0x7642('0x2'));var rp=require(_0x7642('0x3'));var moment=require(_0x7642('0x4'));var BPromise=require(_0x7642('0x5'));var Mustache=require('mustache');var util=require(_0x7642('0x6'));var path=require(_0x7642('0x7'));var sox=require(_0x7642('0x8'));var csv=require(_0x7642('0x9'));var ejs=require(_0x7642('0xa'));var fs=require('fs');var fs_extra=require(_0x7642('0xb'));var _=require(_0x7642('0xc'));var squel=require(_0x7642('0xd'));var crypto=require(_0x7642('0xe'));var jsforce=require(_0x7642('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7642('0x10'));var Papa=require(_0x7642('0x11'));var Redis=require(_0x7642('0x12'));var authService=require(_0x7642('0x13'));var qs=require(_0x7642('0x14'));var as=require(_0x7642('0x15'));var hardwareService=require(_0x7642('0x16'));var logger=require(_0x7642('0x17'))(_0x7642('0x18'));var utils=require(_0x7642('0x19'));var config=require(_0x7642('0x1a'));var licenseUtil=require(_0x7642('0x1b'));var db=require(_0x7642('0x1c'))['db'];function respondWithStatusCode(_0x3e5f50,_0x3c1291){_0x3c1291=_0x3c1291||0xcc;return function(_0x32e5c9){if(_0x32e5c9){return _0x3e5f50[_0x7642('0x1d')](_0x3c1291);}return _0x3e5f50['status'](_0x3c1291)[_0x7642('0x1e')]();};}function respondWithResult(_0x3adb30,_0x4930f4){_0x4930f4=_0x4930f4||0xc8;return function(_0x146ef9){if(_0x146ef9){return _0x3adb30['status'](_0x4930f4)[_0x7642('0x1f')](_0x146ef9);}};}function respondWithFilteredResult(_0x506c94,_0x1aa890){return function(_0x37964a){if(_0x37964a){var _0x3b87aa=typeof _0x1aa890[_0x7642('0x20')]===_0x7642('0x21')&&typeof _0x1aa890[_0x7642('0x22')]===_0x7642('0x21');var _0x4b04a7=_0x37964a[_0x7642('0x23')];var _0x392686=_0x3b87aa?0x0:_0x1aa890[_0x7642('0x20')];var _0x96bc79=_0x3b87aa?_0x37964a['count']:_0x1aa890['offset']+_0x1aa890[_0x7642('0x22')];var _0x42db03;if(_0x96bc79>=_0x4b04a7){_0x96bc79=_0x4b04a7;_0x42db03=0xc8;}else{_0x42db03=0xce;}_0x506c94['status'](_0x42db03);return _0x506c94[_0x7642('0x24')](_0x7642('0x25'),_0x392686+'-'+_0x96bc79+'/'+_0x4b04a7)['json'](_0x37964a);}return null;};}function patchUpdates(_0x503c13){return function(_0xb6b0c4){try{jsonpatch[_0x7642('0x26')](_0xb6b0c4,_0x503c13,!![]);}catch(_0x580573){return BPromise['reject'](_0x580573);}return _0xb6b0c4[_0x7642('0x27')]();};}function saveUpdates(_0xc23c3,_0x37de2b){return function(_0x4f55d4){if(_0x4f55d4){return _0x4f55d4[_0x7642('0x28')](_0xc23c3)[_0x7642('0x29')](function(_0x508265){return _0x508265;});}return null;};}function removeEntity(_0x606a05,_0x812f9){return function(_0xf31489){if(_0xf31489){return _0xf31489[_0x7642('0x2a')]()['then'](function(){_0x606a05[_0x7642('0x2b')](0xcc)[_0x7642('0x1e')]();});}};}function handleEntityNotFound(_0x1b8eac,_0x15148a){return function(_0x5b74c3){if(!_0x5b74c3){_0x1b8eac[_0x7642('0x1d')](0x194);}return _0x5b74c3;};}function handleError(_0x5c2750,_0x1993e3){_0x1993e3=_0x1993e3||0x1f4;return function(_0x2083f6){logger['error'](_0x2083f6[_0x7642('0x2c')]);if(_0x2083f6[_0x7642('0x2d')]){delete _0x2083f6[_0x7642('0x2d')];}_0x5c2750['status'](_0x1993e3)[_0x7642('0x2e')](_0x2083f6);};}exports['show']=function(_0x3f4764,_0x6e04c5){var _0x4a4fee={'raw':!![],'where':{'id':_0x3f4764['params']['id']}},_0x788aa9={};_0x788aa9[_0x7642('0x2f')]=_[_0x7642('0x30')](db[_0x7642('0x31')][_0x7642('0x32')]);_0x788aa9[_0x7642('0x33')]=_[_0x7642('0x30')](_0x3f4764[_0x7642('0x33')]);_0x788aa9[_0x7642('0x34')]=_[_0x7642('0x35')](_0x788aa9[_0x7642('0x2f')],_0x788aa9[_0x7642('0x33')]);_0x4a4fee[_0x7642('0x36')]=_['intersection'](_0x788aa9['model'],qs[_0x7642('0x37')](_0x3f4764[_0x7642('0x33')][_0x7642('0x37')]));_0x4a4fee['attributes']=_0x4a4fee[_0x7642('0x36')][_0x7642('0x38')]?_0x4a4fee['attributes']:_0x788aa9[_0x7642('0x2f')];if(_0x3f4764['query'][_0x7642('0x39')]){_0x4a4fee[_0x7642('0x3a')]=[{'all':!![]}];}_0x4a4fee=_[_0x7642('0x3b')]({},_0x4a4fee,_0x3f4764['options']);return db['ChatApplication'][_0x7642('0x3c')](_0x4a4fee)['then'](handleEntityNotFound(_0x6e04c5,null))['then'](respondWithResult(_0x6e04c5,null))['catch'](handleError(_0x6e04c5,null));};exports['update']=function(_0x3dd01f,_0x160c10){if(_0x3dd01f[_0x7642('0x3d')]['id']){delete _0x3dd01f[_0x7642('0x3d')]['id'];}return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0x3dd01f[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x160c10,null))[_0x7642('0x29')](saveUpdates(_0x3dd01f[_0x7642('0x3d')],null))['then'](respondWithResult(_0x160c10,null))['catch'](handleError(_0x160c10,null));};exports['destroy']=function(_0xc5edf3,_0x22ed74){return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0xc5edf3[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x22ed74,null))[_0x7642('0x29')](removeEntity(_0x22ed74,null))[_0x7642('0x3f')](handleError(_0x22ed74,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7b36aa7..e571437 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 _0x1a8f=['request-promise','exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5497b9,_0x4217fd){var _0x1ec0cc=function(_0xd0cc8d){while(--_0xd0cc8d){_0x5497b9['push'](_0x5497b9['shift']());}};_0x1ec0cc(++_0x4217fd);}(_0x1a8f,0x87));var _0xf1a8=function(_0x17a9a4,_0x103238){_0x17a9a4=_0x17a9a4-0x0;var _0x148d98=_0x1a8f[_0x17a9a4];return _0x148d98;};'use strict';var _=require(_0xf1a8('0x0'));var util=require('util');var logger=require(_0xf1a8('0x1'))(_0xf1a8('0x2'));var moment=require(_0xf1a8('0x3'));var BPromise=require(_0xf1a8('0x4'));var rp=require(_0xf1a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xf1a8('0x6')]=function(_0x515ff3,_0x29dc33){return _0x515ff3['define'](_0xf1a8('0x7'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf1a8('0x8'),'collate':_0xf1a8('0x9')});};
\ No newline at end of file
+var _0x4971=['bluebird','request-promise','path','rimraf','../../config/environment','define','chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x27b095,_0x2ead9b){var _0x282066=function(_0x3ace01){while(--_0x3ace01){_0x27b095['push'](_0x27b095['shift']());}};_0x282066(++_0x2ead9b);}(_0x4971,0xa4));var _0x1497=function(_0x3120e6,_0x324456){_0x3120e6=_0x3120e6-0x0;var _0x5b739f=_0x4971[_0x3120e6];return _0x5b739f;};'use strict';var _=require(_0x1497('0x0'));var util=require('util');var logger=require(_0x1497('0x1'))(_0x1497('0x2'));var moment=require(_0x1497('0x3'));var BPromise=require(_0x1497('0x4'));var rp=require(_0x1497('0x5'));var fs=require('fs');var path=require(_0x1497('0x6'));var rimraf=require(_0x1497('0x7'));var config=require(_0x1497('0x8'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x57b934,_0x53edf1){return _0x57b934[_0x1497('0x9')]('ChatApplication',attributes,{'tableName':_0x1497('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1497('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index db768a2..305d974 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 _0xab18=['jayson/promise','client','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2b53b8,_0x10b2ef){var _0x4938ca=function(_0x29f100){while(--_0x29f100){_0x2b53b8['push'](_0x2b53b8['shift']());}};_0x4938ca(++_0x10b2ef);}(_0xab18,0x184));var _0x8ab1=function(_0x2dd312,_0x449783){_0x2dd312=_0x2dd312-0x0;var _0x2d9528=_0xab18[_0x2dd312];return _0x2d9528;};'use strict';var _=require(_0x8ab1('0x0'));var util=require(_0x8ab1('0x1'));var moment=require(_0x8ab1('0x2'));var BPromise=require(_0x8ab1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ab1('0x4'));var db=require(_0x8ab1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ab1('0x6'))(_0x8ab1('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ab1('0x8'));var client=jayson[_0x8ab1('0x9')][_0x8ab1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c0736,_0xbfdab2,_0x4c24cd){return new BPromise(function(_0x392cbf,_0x36e64e){return client[_0x8ab1('0xb')](_0x3c0736,_0x4c24cd)['then'](function(_0x38c6fc){logger['info'](_0x8ab1('0xc'),_0xbfdab2,_0x8ab1('0xd'));logger[_0x8ab1('0xe')](_0x8ab1('0xf'),_0xbfdab2,_0x8ab1('0xd'),JSON[_0x8ab1('0x10')](_0x38c6fc));if(_0x38c6fc[_0x8ab1('0x11')]){if(_0x38c6fc[_0x8ab1('0x11')]['code']===0x1f4){logger[_0x8ab1('0x11')](_0x8ab1('0xc'),_0xbfdab2,_0x38c6fc[_0x8ab1('0x11')][_0x8ab1('0x12')]);return _0x36e64e(_0x38c6fc[_0x8ab1('0x11')][_0x8ab1('0x12')]);}logger[_0x8ab1('0x11')](_0x8ab1('0xc'),_0xbfdab2,_0x38c6fc['error'][_0x8ab1('0x12')]);return _0x392cbf(_0x38c6fc[_0x8ab1('0x11')][_0x8ab1('0x12')]);}else{logger[_0x8ab1('0x13')](_0x8ab1('0xc'),_0xbfdab2,_0x8ab1('0xd'));_0x392cbf(_0x38c6fc[_0x8ab1('0x14')]['message']);}})[_0x8ab1('0x15')](function(_0x3eecea){logger[_0x8ab1('0x11')](_0x8ab1('0xc'),_0xbfdab2,_0x3eecea);_0x36e64e(_0x3eecea);});});}
\ No newline at end of file
+var _0x7bc8=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x23dabd,_0x577de7){var _0x3580a1=function(_0x39204e){while(--_0x39204e){_0x23dabd['push'](_0x23dabd['shift']());}};_0x3580a1(++_0x577de7);}(_0x7bc8,0x16a));var _0x87bc=function(_0x3a832f,_0x1de647){_0x3a832f=_0x3a832f-0x0;var _0x13f6c2=_0x7bc8[_0x3a832f];return _0x13f6c2;};'use strict';var _=require(_0x87bc('0x0'));var util=require(_0x87bc('0x1'));var moment=require('moment');var BPromise=require(_0x87bc('0x2'));var rs=require(_0x87bc('0x3'));var fs=require('fs');var Redis=require(_0x87bc('0x4'));var db=require(_0x87bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x87bc('0x6'))('rpc');var config=require(_0x87bc('0x7'));var jayson=require(_0x87bc('0x8'));var client=jayson[_0x87bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a2fa,_0x1329fe,_0xc2b90b){return new BPromise(function(_0x582fbb,_0x5038af){return client[_0x87bc('0xa')](_0x12a2fa,_0xc2b90b)[_0x87bc('0xb')](function(_0x211610){logger[_0x87bc('0xc')](_0x87bc('0xd'),_0x1329fe,_0x87bc('0xe'));logger[_0x87bc('0xf')](_0x87bc('0x10'),_0x1329fe,_0x87bc('0xe'),JSON[_0x87bc('0x11')](_0x211610));if(_0x211610[_0x87bc('0x12')]){if(_0x211610[_0x87bc('0x12')][_0x87bc('0x13')]===0x1f4){logger[_0x87bc('0x12')](_0x87bc('0xd'),_0x1329fe,_0x211610[_0x87bc('0x12')][_0x87bc('0x14')]);return _0x5038af(_0x211610['error']['message']);}logger[_0x87bc('0x12')](_0x87bc('0xd'),_0x1329fe,_0x211610[_0x87bc('0x12')]['message']);return _0x582fbb(_0x211610[_0x87bc('0x12')][_0x87bc('0x14')]);}else{logger[_0x87bc('0xc')](_0x87bc('0xd'),_0x1329fe,'request\x20sent');_0x582fbb(_0x211610[_0x87bc('0x15')][_0x87bc('0x14')]);}})[_0x87bc('0x16')](function(_0x22a6c4){logger[_0x87bc('0x12')](_0x87bc('0xd'),_0x1329fe,_0x22a6c4);_0x5038af(_0x22a6c4);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index b3fb076..8c272e4 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 _0x3dc5=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x58d247,_0x7b28a8){var _0x5c159e=function(_0x4768a6){while(--_0x4768a6){_0x58d247['push'](_0x58d247['shift']());}};_0x5c159e(++_0x7b28a8);}(_0x3dc5,0x19b));var _0x53dc=function(_0x4d4339,_0x3fe4cf){_0x4d4339=_0x4d4339-0x0;var _0x5a8d97=_0x3dc5[_0x4d4339];return _0x5a8d97;};'use strict';var multer=require(_0x53dc('0x0'));var util=require('util');var path=require(_0x53dc('0x1'));var timeout=require(_0x53dc('0x2'));var express=require(_0x53dc('0x3'));var router=express[_0x53dc('0x4')]();var fs_extra=require(_0x53dc('0x5'));var auth=require(_0x53dc('0x6'));var interaction=require(_0x53dc('0x7'));var config=require(_0x53dc('0x8'));var controller=require(_0x53dc('0x9'));router[_0x53dc('0xa')](_0x53dc('0xb'),auth['isAuthenticated'](),controller[_0x53dc('0xc')]);router[_0x53dc('0xd')]('/:id',auth[_0x53dc('0xe')](),controller[_0x53dc('0xf')]);router[_0x53dc('0x10')](_0x53dc('0xb'),auth[_0x53dc('0xe')](),controller[_0x53dc('0x11')]);module[_0x53dc('0x12')]=router;
\ No newline at end of file
+var _0x9001=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','put','isAuthenticated'];(function(_0x2074a3,_0x45500a){var _0x5562a2=function(_0x46323b){while(--_0x46323b){_0x2074a3['push'](_0x2074a3['shift']());}};_0x5562a2(++_0x45500a);}(_0x9001,0x154));var _0x1900=function(_0x1fda64,_0x440db3){_0x1fda64=_0x1fda64-0x0;var _0x377bfc=_0x9001[_0x1fda64];return _0x377bfc;};'use strict';var multer=require(_0x1900('0x0'));var util=require(_0x1900('0x1'));var path=require(_0x1900('0x2'));var timeout=require(_0x1900('0x3'));var express=require(_0x1900('0x4'));var router=express[_0x1900('0x5')]();var fs_extra=require(_0x1900('0x6'));var auth=require(_0x1900('0x7'));var interaction=require(_0x1900('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x1900('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1900('0xa')]('/:id',auth[_0x1900('0xb')](),controller[_0x1900('0xc')]);router[_0x1900('0xd')]('/:id',auth[_0x1900('0xb')](),controller[_0x1900('0xe')]);module[_0x1900('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index f3eb16d..37bdd1b 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 _0x089d=['STRING','BOOLEAN','exports'];(function(_0x277d5a,_0x5a5fbb){var _0x501348=function(_0x401179){while(--_0x401179){_0x277d5a['push'](_0x277d5a['shift']());}};_0x501348(++_0x5a5fbb);}(_0x089d,0x137));var _0xd089=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x089d[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require('sequelize');module[_0xd089('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd089('0x1')]},'write':{'type':Sequelize[_0xd089('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1f2e=['STRING','BOOLEAN'];(function(_0xb976c9,_0x5eb949){var _0x95a87e=function(_0x5d6e0c){while(--_0x5d6e0c){_0xb976c9['push'](_0xb976c9['shift']());}};_0x95a87e(++_0x5eb949);}(_0x1f2e,0x82));var _0xe1f2=function(_0x52cd03,_0x49f262){_0x52cd03=_0x52cd03-0x0;var _0x4ccba2=_0x1f2e[_0x52cd03];return _0x4ccba2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe1f2('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe1f2('0x0')]},'write':{'type':Sequelize[_0xe1f2('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index e037a6e..abceea9 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 _0x5452=['show','params','rawAttributes','keys','fields','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','order','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','limit','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','catch'];(function(_0x22b04a,_0x1e4009){var _0x2ba83d=function(_0x4bcc50){while(--_0x4bcc50){_0x22b04a['push'](_0x22b04a['shift']());}};_0x2ba83d(++_0x1e4009);}(_0x5452,0x1b7));var _0x2545=function(_0x3d5d06,_0x3b44f2){_0x3d5d06=_0x3d5d06-0x0;var _0x19844a=_0x5452[_0x3d5d06];return _0x19844a;};'use strict';var emlformat=require(_0x2545('0x0'));var rimraf=require(_0x2545('0x1'));var zipdir=require(_0x2545('0x2'));var jsonpatch=require(_0x2545('0x3'));var rp=require('request-promise');var moment=require(_0x2545('0x4'));var BPromise=require(_0x2545('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2545('0x6'));var sox=require(_0x2545('0x7'));var csv=require('to-csv');var ejs=require(_0x2545('0x8'));var fs=require('fs');var fs_extra=require(_0x2545('0x9'));var _=require('lodash');var squel=require(_0x2545('0xa'));var crypto=require('crypto');var jsforce=require(_0x2545('0xb'));var deskjs=require(_0x2545('0xc'));var toCsv=require(_0x2545('0xd'));var querystring=require(_0x2545('0xe'));var Papa=require(_0x2545('0xf'));var Redis=require(_0x2545('0x10'));var authService=require(_0x2545('0x11'));var qs=require(_0x2545('0x12'));var as=require(_0x2545('0x13'));var hardwareService=require(_0x2545('0x14'));var logger=require(_0x2545('0x15'))(_0x2545('0x16'));var utils=require(_0x2545('0x17'));var config=require(_0x2545('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2545('0x19'))['db'];config[_0x2545('0x1a')]=_[_0x2545('0x1b')](config['redis'],{'host':_0x2545('0x1c'),'port':0x18eb});var socket=require(_0x2545('0x1d'))(new Redis(config[_0x2545('0x1a')]));require(_0x2545('0x1e'))['register'](socket);function respondWithStatusCode(_0x1518ab,_0x3da30b){_0x3da30b=_0x3da30b||0xcc;return function(_0x1520e8){if(_0x1520e8){return _0x1518ab[_0x2545('0x1f')](_0x3da30b);}return _0x1518ab[_0x2545('0x20')](_0x3da30b)['end']();};}function respondWithResult(_0x49afa3,_0x544e55){_0x544e55=_0x544e55||0xc8;return function(_0x19d2fa){if(_0x19d2fa){return _0x49afa3[_0x2545('0x20')](_0x544e55)[_0x2545('0x21')](_0x19d2fa);}};}function respondWithFilteredResult(_0x2fc15f,_0x13fca2){return function(_0x1c9fb3){if(_0x1c9fb3){var _0x567744=typeof _0x13fca2['offset']==='undefined'&&typeof _0x13fca2['limit']===_0x2545('0x22');var _0x5438f4=_0x1c9fb3[_0x2545('0x23')];var _0x148c8f=_0x567744?0x0:_0x13fca2[_0x2545('0x24')];var _0x4387c1=_0x567744?_0x1c9fb3['count']:_0x13fca2[_0x2545('0x24')]+_0x13fca2['limit'];var _0x487a07;if(_0x4387c1>=_0x5438f4){_0x4387c1=_0x5438f4;_0x487a07=0xc8;}else{_0x487a07=0xce;}_0x2fc15f[_0x2545('0x20')](_0x487a07);return _0x2fc15f[_0x2545('0x25')](_0x2545('0x26'),_0x148c8f+'-'+_0x4387c1+'/'+_0x5438f4)[_0x2545('0x21')](_0x1c9fb3);}return null;};}function patchUpdates(_0x1c1264){return function(_0x4fd63e){try{jsonpatch[_0x2545('0x27')](_0x4fd63e,_0x1c1264,!![]);}catch(_0xf4b00d){return BPromise[_0x2545('0x28')](_0xf4b00d);}return _0x4fd63e[_0x2545('0x29')]();};}function saveUpdates(_0x236976,_0x233852){return function(_0x1ba6a5){if(_0x1ba6a5){return _0x1ba6a5[_0x2545('0x2a')](_0x236976)['then'](function(_0x1ae931){return _0x1ae931;});}return null;};}function removeEntity(_0x58e8d0,_0x5f4030){return function(_0x103855){if(_0x103855){return _0x103855[_0x2545('0x2b')]()[_0x2545('0x2c')](function(){_0x58e8d0[_0x2545('0x20')](0xcc)[_0x2545('0x2d')]();});}};}function handleEntityNotFound(_0x5a000b,_0x1c1885){return function(_0x3e1d94){if(!_0x3e1d94){_0x5a000b[_0x2545('0x1f')](0x194);}return _0x3e1d94;};}function handleError(_0x3ca6e8,_0x1cab52){_0x1cab52=_0x1cab52||0x1f4;return function(_0xa9ce8b){logger[_0x2545('0x2e')](_0xa9ce8b[_0x2545('0x2f')]);if(_0xa9ce8b[_0x2545('0x30')]){delete _0xa9ce8b[_0x2545('0x30')];}_0x3ca6e8['status'](_0x1cab52)[_0x2545('0x31')](_0xa9ce8b);};}exports[_0x2545('0x32')]=function(_0x52d999,_0x122502){var _0x28ddaf={},_0x11dde1={},_0x532466={'count':0x0,'rows':[]};var _0x137d8d=_[_0x2545('0x33')](db['ChatGroup']['rawAttributes'],function(_0x563ebd){return{'name':_0x563ebd[_0x2545('0x34')],'type':_0x563ebd['type'][_0x2545('0x35')]};});_0x11dde1[_0x2545('0x36')]=_['map'](_0x137d8d,_0x2545('0x30'));_0x11dde1['query']=_['keys'](_0x52d999[_0x2545('0x37')]);_0x11dde1[_0x2545('0x38')]=_[_0x2545('0x39')](_0x11dde1[_0x2545('0x36')],_0x11dde1[_0x2545('0x37')]);_0x28ddaf[_0x2545('0x3a')]=_[_0x2545('0x39')](_0x11dde1[_0x2545('0x36')],qs['fields'](_0x52d999[_0x2545('0x37')]['fields']));_0x28ddaf[_0x2545('0x3a')]=_0x28ddaf[_0x2545('0x3a')][_0x2545('0x3b')]?_0x28ddaf['attributes']:_0x11dde1[_0x2545('0x36')];if(!_0x52d999[_0x2545('0x37')][_0x2545('0x3c')]('nolimit')){_0x28ddaf[_0x2545('0x3d')]=qs['limit'](_0x52d999[_0x2545('0x37')][_0x2545('0x3d')]);_0x28ddaf[_0x2545('0x24')]=qs[_0x2545('0x24')](_0x52d999[_0x2545('0x37')][_0x2545('0x24')]);}_0x28ddaf['order']=qs[_0x2545('0x3e')](_0x52d999[_0x2545('0x37')][_0x2545('0x3e')]);_0x28ddaf['where']=qs['filters'](_[_0x2545('0x3f')](_0x52d999[_0x2545('0x37')],_0x11dde1[_0x2545('0x38')]),_0x137d8d);if(_0x52d999['query'][_0x2545('0x40')]){_0x28ddaf[_0x2545('0x41')]=_[_0x2545('0x42')](_0x28ddaf[_0x2545('0x41')],{'$or':_[_0x2545('0x33')](_0x137d8d,function(_0xd9a6df){if(_0xd9a6df[_0x2545('0x43')]!==_0x2545('0x44')){var _0x3023fe={};_0x3023fe[_0xd9a6df[_0x2545('0x30')]]={'$like':'%'+_0x52d999[_0x2545('0x37')][_0x2545('0x40')]+'%'};return _0x3023fe;}})});}_0x28ddaf=_[_0x2545('0x42')]({},_0x28ddaf,_0x52d999[_0x2545('0x45')]);var _0x5959e0={'where':_0x28ddaf[_0x2545('0x41')]};return db[_0x2545('0x46')][_0x2545('0x23')](_0x5959e0)[_0x2545('0x2c')](function(_0x4d2447){_0x532466[_0x2545('0x23')]=_0x4d2447;if(_0x52d999['query'][_0x2545('0x47')]){_0x28ddaf[_0x2545('0x48')]=[{'all':!![]}];}return db[_0x2545('0x46')][_0x2545('0x49')](_0x28ddaf);})[_0x2545('0x2c')](function(_0x4c54a3){_0x532466[_0x2545('0x4a')]=_0x4c54a3;return _0x532466;})[_0x2545('0x2c')](respondWithFilteredResult(_0x122502,_0x28ddaf))[_0x2545('0x4b')](handleError(_0x122502,null));};exports[_0x2545('0x4c')]=function(_0x57a2b0,_0x6734af){var _0x4a1440={'raw':!![],'where':{'id':_0x57a2b0[_0x2545('0x4d')]['id']}},_0x27ba49={};_0x27ba49[_0x2545('0x36')]=_['keys'](db[_0x2545('0x46')][_0x2545('0x4e')]);_0x27ba49[_0x2545('0x37')]=_[_0x2545('0x4f')](_0x57a2b0['query']);_0x27ba49['filters']=_[_0x2545('0x39')](_0x27ba49[_0x2545('0x36')],_0x27ba49['query']);_0x4a1440[_0x2545('0x3a')]=_[_0x2545('0x39')](_0x27ba49[_0x2545('0x36')],qs['fields'](_0x57a2b0[_0x2545('0x37')][_0x2545('0x50')]));_0x4a1440[_0x2545('0x3a')]=_0x4a1440[_0x2545('0x3a')][_0x2545('0x3b')]?_0x4a1440[_0x2545('0x3a')]:_0x27ba49[_0x2545('0x36')];if(_0x57a2b0[_0x2545('0x37')]['includeAll']){_0x4a1440[_0x2545('0x48')]=[{'all':!![]}];}_0x4a1440=_[_0x2545('0x42')]({},_0x4a1440,_0x57a2b0[_0x2545('0x45')]);return db[_0x2545('0x46')][_0x2545('0x51')](_0x4a1440)[_0x2545('0x2c')](handleEntityNotFound(_0x6734af,null))[_0x2545('0x2c')](respondWithResult(_0x6734af,null))[_0x2545('0x4b')](handleError(_0x6734af,null));};exports[_0x2545('0x52')]=function(_0x4c04f0,_0x1a3a0e){return db[_0x2545('0x46')][_0x2545('0x52')](_0x4c04f0[_0x2545('0x53')],{})['then'](respondWithResult(_0x1a3a0e,0xc9))[_0x2545('0x4b')](handleError(_0x1a3a0e,null));};exports[_0x2545('0x2a')]=function(_0x1c4fe2,_0x189370){if(_0x1c4fe2[_0x2545('0x53')]['id']){delete _0x1c4fe2['body']['id'];}return db[_0x2545('0x46')][_0x2545('0x51')]({'where':{'id':_0x1c4fe2[_0x2545('0x4d')]['id']}})['then'](handleEntityNotFound(_0x189370,null))[_0x2545('0x2c')](saveUpdates(_0x1c4fe2[_0x2545('0x53')],null))['then'](respondWithResult(_0x189370,null))[_0x2545('0x4b')](handleError(_0x189370,null));};exports[_0x2545('0x2b')]=function(_0x34257d,_0x4d29cf){return db['ChatGroup'][_0x2545('0x51')]({'where':{'id':_0x34257d[_0x2545('0x4d')]['id']}})[_0x2545('0x2c')](handleEntityNotFound(_0x4d29cf,null))['then'](removeEntity(_0x4d29cf,null))[_0x2545('0x4b')](handleError(_0x4d29cf,null));};exports[_0x2545('0x54')]=function(_0x1904f3,_0x968f88){return db[_0x2545('0x46')][_0x2545('0x54')]()['then'](respondWithResult(_0x968f88,null))[_0x2545('0x4b')](handleError(_0x968f88,null));};exports[_0x2545('0x55')]=function(_0x5f467f,_0x53d2ef,_0x12f8fb){return db[_0x2545('0x56')][_0x2545('0x23')]({'where':{'ChatGroupId':_0x5f467f[_0x2545('0x4d')]['id'],'ToId':_0x5f467f[_0x2545('0x57')]['id'],'read':![]}})[_0x2545('0x2c')](function(_0x3cc11d){return{'id':_[_0x2545('0x58')](_0x5f467f[_0x2545('0x4d')]['id']),'count':_0x3cc11d};})['then'](respondWithResult(_0x53d2ef,null))['catch'](handleError(_0x53d2ef,null));};exports['addMembers']=function(_0x377de2,_0x74210e,_0x3dc518){return db[_0x2545('0x46')][_0x2545('0x51')]({'where':{'id':_0x377de2['params']['id']}})['then'](handleEntityNotFound(_0x74210e,null))['then'](function(_0x58c0e4){if(_0x58c0e4){return _0x58c0e4[_0x2545('0x59')](_0x377de2['body'][_0x2545('0x5a')],_['omit'](_0x377de2['body'],['ids','id'])||{});}})[_0x2545('0x2c')](respondWithResult(_0x74210e,null))[_0x2545('0x4b')](handleError(_0x74210e,null));};exports[_0x2545('0x5b')]=function(_0x341641,_0x4f2842,_0x1f32e7){var _0x1e258d={};var _0x491b75={};var _0x43a93b;var _0x364b38;return db[_0x2545('0x46')][_0x2545('0x5c')]({'where':{'id':_0x341641[_0x2545('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f2842,null))['then'](function(_0x4e4f85){if(_0x4e4f85){_0x43a93b=_0x4e4f85;_0x491b75[_0x2545('0x36')]=_[_0x2545('0x4f')](db[_0x2545('0x5d')][_0x2545('0x4e')]);_0x491b75[_0x2545('0x37')]=_[_0x2545('0x4f')](_0x341641[_0x2545('0x37')]);_0x491b75['filters']=_[_0x2545('0x39')](_0x491b75[_0x2545('0x36')],_0x491b75[_0x2545('0x37')]);_0x1e258d[_0x2545('0x3a')]=_[_0x2545('0x39')](_0x491b75[_0x2545('0x36')],qs['fields'](_0x341641[_0x2545('0x37')][_0x2545('0x50')]));_0x1e258d['attributes']=_0x1e258d['attributes']['length']?_0x1e258d[_0x2545('0x3a')]:_0x491b75[_0x2545('0x36')];_0x1e258d['order']=qs[_0x2545('0x3e')](_0x341641['query']['sort']);_0x1e258d[_0x2545('0x41')]=qs['filters'](_[_0x2545('0x3f')](_0x341641[_0x2545('0x37')],_0x491b75['filters']));if(_0x341641[_0x2545('0x37')][_0x2545('0x40')]){_0x1e258d[_0x2545('0x41')]=_[_0x2545('0x42')](_0x1e258d[_0x2545('0x41')],{'$or':_['map'](_0x1e258d[_0x2545('0x3a')],function(_0x3ffa17){var _0x1f9f62={};_0x1f9f62[_0x3ffa17]={'$like':'%'+_0x341641['query'][_0x2545('0x40')]+'%'};return _0x1f9f62;})});}_0x1e258d=_['merge']({},_0x1e258d,_0x341641[_0x2545('0x45')]);return _0x43a93b[_0x2545('0x5b')](_0x1e258d);}})['then'](function(_0xcc4f78){if(_0xcc4f78){_0x364b38=_0xcc4f78[_0x2545('0x3b')];if(!_0x341641['query'][_0x2545('0x3c')](_0x2545('0x5e'))){_0x1e258d[_0x2545('0x3d')]=qs[_0x2545('0x3d')](_0x341641[_0x2545('0x37')]['limit']);_0x1e258d['offset']=qs[_0x2545('0x24')](_0x341641[_0x2545('0x37')][_0x2545('0x24')]);}return _0x43a93b[_0x2545('0x5b')](_0x1e258d);}})[_0x2545('0x2c')](function(_0x2b0e31){if(_0x2b0e31){return _0x2b0e31?{'count':_0x364b38,'rows':_0x2b0e31}:null;}})[_0x2545('0x2c')](respondWithResult(_0x4f2842,null))[_0x2545('0x4b')](handleError(_0x4f2842,null));};exports[_0x2545('0x5f')]=function(_0x59c9d8,_0x3ab828,_0x3ab9b1){return db['ChatGroup']['find']({'where':{'id':_0x59c9d8[_0x2545('0x4d')]['id']}})[_0x2545('0x2c')](handleEntityNotFound(_0x3ab828,null))[_0x2545('0x2c')](function(_0x96e7b4){if(_0x96e7b4){return _0x96e7b4[_0x2545('0x5f')](_0x59c9d8['query'][_0x2545('0x5a')]);}})[_0x2545('0x2c')](respondWithStatusCode(_0x3ab828,null))[_0x2545('0x4b')](handleError(_0x3ab828,null));};exports[_0x2545('0x60')]=function(_0x68d996,_0x4281e6,_0x4a129f){if(_0x68d996[_0x2545('0x53')]['id']){delete _0x68d996[_0x2545('0x53')]['id'];}return db['ChatGroup'][_0x2545('0x51')]({'where':{'id':_0x68d996[_0x2545('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4281e6,null))[_0x2545('0x2c')](function(_0x172a16){if(_0x172a16){_0x68d996['body'][_0x2545('0x61')]=_0x172a16['id'];return db[_0x2545('0x56')][_0x2545('0x52')](_0x68d996[_0x2545('0x53')]);}})[_0x2545('0x2c')](respondWithResult(_0x4281e6,null))[_0x2545('0x4b')](handleError(_0x4281e6,null));};exports[_0x2545('0x62')]=function(_0x45cf9f,_0x213219,_0x50795a){var _0x14f6f8={};var _0x54a260={};var _0x1575b6;var _0x4d723f;return db[_0x2545('0x46')][_0x2545('0x5c')]({'where':{'id':_0x45cf9f[_0x2545('0x4d')]['id']}})[_0x2545('0x2c')](handleEntityNotFound(_0x213219,null))['then'](function(_0x3c8389){if(_0x3c8389){_0x1575b6=_0x3c8389;_0x54a260['model']=_['keys'](db[_0x2545('0x56')][_0x2545('0x4e')]);_0x54a260['query']=_[_0x2545('0x4f')](_0x45cf9f[_0x2545('0x37')]);_0x54a260['filters']=_[_0x2545('0x39')](_0x54a260[_0x2545('0x36')],_0x54a260['query']);_0x14f6f8[_0x2545('0x3a')]=_[_0x2545('0x39')](_0x54a260[_0x2545('0x36')],qs[_0x2545('0x50')](_0x45cf9f['query'][_0x2545('0x50')]));_0x14f6f8[_0x2545('0x3a')]=_0x14f6f8[_0x2545('0x3a')]['length']?_0x14f6f8['attributes']:_0x54a260[_0x2545('0x36')];_0x14f6f8[_0x2545('0x63')]=qs[_0x2545('0x3e')](_0x45cf9f[_0x2545('0x37')][_0x2545('0x3e')]);_0x14f6f8['where']=qs[_0x2545('0x38')](_['pick'](_0x45cf9f[_0x2545('0x37')],_0x54a260[_0x2545('0x38')]));if(_0x45cf9f[_0x2545('0x37')]['filter']){_0x14f6f8[_0x2545('0x41')]=_[_0x2545('0x42')](_0x14f6f8[_0x2545('0x41')],{'$or':_[_0x2545('0x33')](_0x14f6f8[_0x2545('0x3a')],function(_0x4cfcbc){var _0x4febb8={};_0x4febb8[_0x4cfcbc]={'$like':'%'+_0x45cf9f[_0x2545('0x37')][_0x2545('0x40')]+'%'};return _0x4febb8;})});}if(_0x45cf9f[_0x2545('0x37')]['$gte']){var _0x24c3b5=_0x45cf9f['query'][_0x2545('0x64')][_0x2545('0x65')](',');var _0x5e5f11={};_0x5e5f11[_0x24c3b5[0x0]]={'$gte':moment(_0x24c3b5[0x1])[_0x2545('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14f6f8[_0x2545('0x41')]=_[_0x2545('0x42')](_0x14f6f8['where'],_0x5e5f11);}_0x14f6f8=_[_0x2545('0x42')]({},_0x14f6f8,_0x45cf9f['options']);return _0x1575b6['getMessages'](_0x14f6f8);}})[_0x2545('0x2c')](function(_0x225869){if(_0x225869){_0x4d723f=_0x225869[_0x2545('0x3b')];if(!_0x45cf9f[_0x2545('0x37')][_0x2545('0x3c')](_0x2545('0x5e'))){_0x14f6f8[_0x2545('0x3d')]=qs[_0x2545('0x3d')](_0x45cf9f['query'][_0x2545('0x3d')]);_0x14f6f8[_0x2545('0x24')]=qs[_0x2545('0x24')](_0x45cf9f[_0x2545('0x37')][_0x2545('0x24')]);}return _0x1575b6[_0x2545('0x62')](_0x14f6f8);}})[_0x2545('0x2c')](function(_0x53fc5d){if(_0x53fc5d){return _0x53fc5d?{'count':_0x4d723f,'rows':_0x53fc5d}:null;}})['then'](respondWithResult(_0x213219,null))[_0x2545('0x4b')](handleError(_0x213219,null));};
\ No newline at end of file
+var _0xc956=['includeAll','include','options','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','undefined','limit','count','offset','set','apply','save','update','then','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','catch','show','params'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xc956,0x7a));var _0x6c95=function(_0x5d3569,_0x2753b7){_0x5d3569=_0x5d3569-0x0;var _0x233fbb=_0xc956[_0x5d3569];return _0x233fbb;};'use strict';var emlformat=require(_0x6c95('0x0'));var rimraf=require(_0x6c95('0x1'));var zipdir=require(_0x6c95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c95('0x3'));var moment=require(_0x6c95('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c95('0x5'));var util=require('util');var path=require(_0x6c95('0x6'));var sox=require(_0x6c95('0x7'));var csv=require(_0x6c95('0x8'));var ejs=require(_0x6c95('0x9'));var fs=require('fs');var fs_extra=require(_0x6c95('0xa'));var _=require(_0x6c95('0xb'));var squel=require(_0x6c95('0xc'));var crypto=require(_0x6c95('0xd'));var jsforce=require(_0x6c95('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6c95('0x8'));var querystring=require(_0x6c95('0xf'));var Papa=require(_0x6c95('0x10'));var Redis=require(_0x6c95('0x11'));var authService=require(_0x6c95('0x12'));var qs=require(_0x6c95('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c95('0x14'));var logger=require('../../config/logger')(_0x6c95('0x15'));var utils=require(_0x6c95('0x16'));var config=require(_0x6c95('0x17'));var licenseUtil=require(_0x6c95('0x18'));var db=require(_0x6c95('0x19'))['db'];config[_0x6c95('0x1a')]=_[_0x6c95('0x1b')](config[_0x6c95('0x1a')],{'host':_0x6c95('0x1c'),'port':0x18eb});var socket=require(_0x6c95('0x1d'))(new Redis(config[_0x6c95('0x1a')]));require(_0x6c95('0x1e'))[_0x6c95('0x1f')](socket);function respondWithStatusCode(_0xb027a2,_0x524a15){_0x524a15=_0x524a15||0xcc;return function(_0x17c2c7){if(_0x17c2c7){return _0xb027a2['sendStatus'](_0x524a15);}return _0xb027a2[_0x6c95('0x20')](_0x524a15)['end']();};}function respondWithResult(_0x57469e,_0x2ce12c){_0x2ce12c=_0x2ce12c||0xc8;return function(_0x5e0ac4){if(_0x5e0ac4){return _0x57469e[_0x6c95('0x20')](_0x2ce12c)[_0x6c95('0x21')](_0x5e0ac4);}};}function respondWithFilteredResult(_0x59344a,_0x5394a1){return function(_0x48482f){if(_0x48482f){var _0x51fc8a=typeof _0x5394a1['offset']===_0x6c95('0x22')&&typeof _0x5394a1[_0x6c95('0x23')]===_0x6c95('0x22');var _0x51b2d6=_0x48482f[_0x6c95('0x24')];var _0x578b19=_0x51fc8a?0x0:_0x5394a1[_0x6c95('0x25')];var _0x48ede1=_0x51fc8a?_0x48482f[_0x6c95('0x24')]:_0x5394a1[_0x6c95('0x25')]+_0x5394a1[_0x6c95('0x23')];var _0x17df05;if(_0x48ede1>=_0x51b2d6){_0x48ede1=_0x51b2d6;_0x17df05=0xc8;}else{_0x17df05=0xce;}_0x59344a['status'](_0x17df05);return _0x59344a[_0x6c95('0x26')]('Content-Range',_0x578b19+'-'+_0x48ede1+'/'+_0x51b2d6)['json'](_0x48482f);}return null;};}function patchUpdates(_0x499fd3){return function(_0x2b3744){try{jsonpatch[_0x6c95('0x27')](_0x2b3744,_0x499fd3,!![]);}catch(_0x3c8c1c){return BPromise['reject'](_0x3c8c1c);}return _0x2b3744[_0x6c95('0x28')]();};}function saveUpdates(_0x421dca,_0x536c16){return function(_0x7b1c30){if(_0x7b1c30){return _0x7b1c30[_0x6c95('0x29')](_0x421dca)[_0x6c95('0x2a')](function(_0x2285aa){return _0x2285aa;});}return null;};}function removeEntity(_0xf55bdd,_0xc7a7e8){return function(_0x5c7475){if(_0x5c7475){return _0x5c7475['destroy']()['then'](function(){_0xf55bdd[_0x6c95('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a68e9,_0x162303){return function(_0x2a14a0){if(!_0x2a14a0){_0x3a68e9[_0x6c95('0x2b')](0x194);}return _0x2a14a0;};}function handleError(_0x1935af,_0x2af40a){_0x2af40a=_0x2af40a||0x1f4;return function(_0x38b615){logger[_0x6c95('0x2c')](_0x38b615['stack']);if(_0x38b615[_0x6c95('0x2d')]){delete _0x38b615[_0x6c95('0x2d')];}_0x1935af[_0x6c95('0x20')](_0x2af40a)[_0x6c95('0x2e')](_0x38b615);};}exports[_0x6c95('0x2f')]=function(_0x2c90cd,_0x43250f){var _0x1f244e={},_0x21ae40={},_0x2af7ba={'count':0x0,'rows':[]};var _0x4525c7=_[_0x6c95('0x30')](db[_0x6c95('0x31')][_0x6c95('0x32')],function(_0x6fa692){return{'name':_0x6fa692['fieldName'],'type':_0x6fa692['type'][_0x6c95('0x33')]};});_0x21ae40[_0x6c95('0x34')]=_[_0x6c95('0x30')](_0x4525c7,_0x6c95('0x2d'));_0x21ae40[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x2c90cd[_0x6c95('0x35')]);_0x21ae40[_0x6c95('0x37')]=_[_0x6c95('0x38')](_0x21ae40[_0x6c95('0x34')],_0x21ae40['query']);_0x1f244e['attributes']=_[_0x6c95('0x38')](_0x21ae40['model'],qs[_0x6c95('0x39')](_0x2c90cd[_0x6c95('0x35')][_0x6c95('0x39')]));_0x1f244e[_0x6c95('0x3a')]=_0x1f244e[_0x6c95('0x3a')][_0x6c95('0x3b')]?_0x1f244e[_0x6c95('0x3a')]:_0x21ae40[_0x6c95('0x34')];if(!_0x2c90cd[_0x6c95('0x35')]['hasOwnProperty'](_0x6c95('0x3c'))){_0x1f244e[_0x6c95('0x23')]=qs[_0x6c95('0x23')](_0x2c90cd[_0x6c95('0x35')][_0x6c95('0x23')]);_0x1f244e[_0x6c95('0x25')]=qs['offset'](_0x2c90cd[_0x6c95('0x35')]['offset']);}_0x1f244e[_0x6c95('0x3d')]=qs[_0x6c95('0x3e')](_0x2c90cd[_0x6c95('0x35')]['sort']);_0x1f244e['where']=qs[_0x6c95('0x37')](_[_0x6c95('0x3f')](_0x2c90cd[_0x6c95('0x35')],_0x21ae40[_0x6c95('0x37')]),_0x4525c7);if(_0x2c90cd[_0x6c95('0x35')][_0x6c95('0x40')]){_0x1f244e[_0x6c95('0x41')]=_[_0x6c95('0x42')](_0x1f244e[_0x6c95('0x41')],{'$or':_[_0x6c95('0x30')](_0x4525c7,function(_0x121f16){if(_0x121f16[_0x6c95('0x43')]!==_0x6c95('0x44')){var _0x3ca387={};_0x3ca387[_0x121f16[_0x6c95('0x2d')]]={'$like':'%'+_0x2c90cd['query'][_0x6c95('0x40')]+'%'};return _0x3ca387;}})});}_0x1f244e=_['merge']({},_0x1f244e,_0x2c90cd['options']);var _0x5ad004={'where':_0x1f244e[_0x6c95('0x41')]};return db['ChatGroup']['count'](_0x5ad004)[_0x6c95('0x2a')](function(_0xb8159e){_0x2af7ba[_0x6c95('0x24')]=_0xb8159e;if(_0x2c90cd[_0x6c95('0x35')]['includeAll']){_0x1f244e['include']=[{'all':!![]}];}return db[_0x6c95('0x31')]['findAll'](_0x1f244e);})[_0x6c95('0x2a')](function(_0x54a5fc){_0x2af7ba['rows']=_0x54a5fc;return _0x2af7ba;})[_0x6c95('0x2a')](respondWithFilteredResult(_0x43250f,_0x1f244e))[_0x6c95('0x45')](handleError(_0x43250f,null));};exports[_0x6c95('0x46')]=function(_0x254f95,_0x3daa2a){var _0x246417={'raw':!![],'where':{'id':_0x254f95[_0x6c95('0x47')]['id']}},_0x1dd579={};_0x1dd579[_0x6c95('0x34')]=_[_0x6c95('0x36')](db[_0x6c95('0x31')][_0x6c95('0x32')]);_0x1dd579[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x254f95[_0x6c95('0x35')]);_0x1dd579['filters']=_[_0x6c95('0x38')](_0x1dd579[_0x6c95('0x34')],_0x1dd579[_0x6c95('0x35')]);_0x246417['attributes']=_['intersection'](_0x1dd579[_0x6c95('0x34')],qs[_0x6c95('0x39')](_0x254f95[_0x6c95('0x35')][_0x6c95('0x39')]));_0x246417[_0x6c95('0x3a')]=_0x246417['attributes'][_0x6c95('0x3b')]?_0x246417[_0x6c95('0x3a')]:_0x1dd579[_0x6c95('0x34')];if(_0x254f95[_0x6c95('0x35')][_0x6c95('0x48')]){_0x246417[_0x6c95('0x49')]=[{'all':!![]}];}_0x246417=_['merge']({},_0x246417,_0x254f95[_0x6c95('0x4a')]);return db[_0x6c95('0x31')][_0x6c95('0x4b')](_0x246417)['then'](handleEntityNotFound(_0x3daa2a,null))[_0x6c95('0x2a')](respondWithResult(_0x3daa2a,null))[_0x6c95('0x45')](handleError(_0x3daa2a,null));};exports[_0x6c95('0x4c')]=function(_0x15c4e4,_0x18e802){return db[_0x6c95('0x31')][_0x6c95('0x4c')](_0x15c4e4[_0x6c95('0x4d')],{})[_0x6c95('0x2a')](respondWithResult(_0x18e802,0xc9))[_0x6c95('0x45')](handleError(_0x18e802,null));};exports[_0x6c95('0x29')]=function(_0x1a7ec1,_0x1ea200){if(_0x1a7ec1['body']['id']){delete _0x1a7ec1[_0x6c95('0x4d')]['id'];}return db['ChatGroup'][_0x6c95('0x4b')]({'where':{'id':_0x1a7ec1['params']['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x1ea200,null))[_0x6c95('0x2a')](saveUpdates(_0x1a7ec1[_0x6c95('0x4d')],null))['then'](respondWithResult(_0x1ea200,null))[_0x6c95('0x45')](handleError(_0x1ea200,null));};exports[_0x6c95('0x4e')]=function(_0x867fcf,_0x43b4bc){return db[_0x6c95('0x31')][_0x6c95('0x4b')]({'where':{'id':_0x867fcf[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x43b4bc,null))[_0x6c95('0x2a')](removeEntity(_0x43b4bc,null))['catch'](handleError(_0x43b4bc,null));};exports[_0x6c95('0x4f')]=function(_0x18af3e,_0x57f37e){return db[_0x6c95('0x31')][_0x6c95('0x4f')]()[_0x6c95('0x2a')](respondWithResult(_0x57f37e,null))['catch'](handleError(_0x57f37e,null));};exports[_0x6c95('0x50')]=function(_0x360102,_0x5b6187,_0x5d5985){return db[_0x6c95('0x51')][_0x6c95('0x24')]({'where':{'ChatGroupId':_0x360102[_0x6c95('0x47')]['id'],'ToId':_0x360102['user']['id'],'read':![]}})[_0x6c95('0x2a')](function(_0x402010){return{'id':_[_0x6c95('0x52')](_0x360102[_0x6c95('0x47')]['id']),'count':_0x402010};})[_0x6c95('0x2a')](respondWithResult(_0x5b6187,null))[_0x6c95('0x45')](handleError(_0x5b6187,null));};exports['addMembers']=function(_0x5dbd4b,_0x2ca4f9,_0x4adc88){return db[_0x6c95('0x31')][_0x6c95('0x4b')]({'where':{'id':_0x5dbd4b[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x2ca4f9,null))[_0x6c95('0x2a')](function(_0x2d0d2b){if(_0x2d0d2b){return _0x2d0d2b['addMembers'](_0x5dbd4b[_0x6c95('0x4d')][_0x6c95('0x53')],_[_0x6c95('0x54')](_0x5dbd4b['body'],[_0x6c95('0x53'),'id'])||{});}})['then'](respondWithResult(_0x2ca4f9,null))[_0x6c95('0x45')](handleError(_0x2ca4f9,null));};exports[_0x6c95('0x55')]=function(_0x390300,_0x461316,_0x4d30c3){var _0x775e37={};var _0x34b443={};var _0x196192;var _0x5b13ae;return db[_0x6c95('0x31')][_0x6c95('0x56')]({'where':{'id':_0x390300[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x461316,null))[_0x6c95('0x2a')](function(_0x3e3ab8){if(_0x3e3ab8){_0x196192=_0x3e3ab8;_0x34b443[_0x6c95('0x34')]=_[_0x6c95('0x36')](db[_0x6c95('0x57')][_0x6c95('0x32')]);_0x34b443[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x390300[_0x6c95('0x35')]);_0x34b443[_0x6c95('0x37')]=_[_0x6c95('0x38')](_0x34b443['model'],_0x34b443['query']);_0x775e37[_0x6c95('0x3a')]=_[_0x6c95('0x38')](_0x34b443[_0x6c95('0x34')],qs[_0x6c95('0x39')](_0x390300[_0x6c95('0x35')][_0x6c95('0x39')]));_0x775e37['attributes']=_0x775e37[_0x6c95('0x3a')][_0x6c95('0x3b')]?_0x775e37[_0x6c95('0x3a')]:_0x34b443['model'];_0x775e37[_0x6c95('0x3d')]=qs['sort'](_0x390300[_0x6c95('0x35')][_0x6c95('0x3e')]);_0x775e37[_0x6c95('0x41')]=qs[_0x6c95('0x37')](_[_0x6c95('0x3f')](_0x390300[_0x6c95('0x35')],_0x34b443[_0x6c95('0x37')]));if(_0x390300[_0x6c95('0x35')][_0x6c95('0x40')]){_0x775e37['where']=_[_0x6c95('0x42')](_0x775e37['where'],{'$or':_[_0x6c95('0x30')](_0x775e37[_0x6c95('0x3a')],function(_0x415acc){var _0x2f668f={};_0x2f668f[_0x415acc]={'$like':'%'+_0x390300[_0x6c95('0x35')]['filter']+'%'};return _0x2f668f;})});}_0x775e37=_[_0x6c95('0x42')]({},_0x775e37,_0x390300[_0x6c95('0x4a')]);return _0x196192[_0x6c95('0x55')](_0x775e37);}})[_0x6c95('0x2a')](function(_0x5a89ad){if(_0x5a89ad){_0x5b13ae=_0x5a89ad[_0x6c95('0x3b')];if(!_0x390300[_0x6c95('0x35')][_0x6c95('0x58')](_0x6c95('0x3c'))){_0x775e37[_0x6c95('0x23')]=qs[_0x6c95('0x23')](_0x390300[_0x6c95('0x35')][_0x6c95('0x23')]);_0x775e37[_0x6c95('0x25')]=qs[_0x6c95('0x25')](_0x390300['query'][_0x6c95('0x25')]);}return _0x196192['getMembers'](_0x775e37);}})[_0x6c95('0x2a')](function(_0x29a10a){if(_0x29a10a){return _0x29a10a?{'count':_0x5b13ae,'rows':_0x29a10a}:null;}})[_0x6c95('0x2a')](respondWithResult(_0x461316,null))[_0x6c95('0x45')](handleError(_0x461316,null));};exports['removeMembers']=function(_0x42a487,_0x515855,_0x3ae3f5){return db[_0x6c95('0x31')]['find']({'where':{'id':_0x42a487[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x515855,null))[_0x6c95('0x2a')](function(_0x42d001){if(_0x42d001){return _0x42d001[_0x6c95('0x59')](_0x42a487['query'][_0x6c95('0x53')]);}})[_0x6c95('0x2a')](respondWithStatusCode(_0x515855,null))[_0x6c95('0x45')](handleError(_0x515855,null));};exports[_0x6c95('0x5a')]=function(_0x21d4b4,_0x267649,_0x333e1e){if(_0x21d4b4[_0x6c95('0x4d')]['id']){delete _0x21d4b4[_0x6c95('0x4d')]['id'];}return db[_0x6c95('0x31')]['find']({'where':{'id':_0x21d4b4[_0x6c95('0x47')]['id']}})['then'](handleEntityNotFound(_0x267649,null))[_0x6c95('0x2a')](function(_0x5d4e37){if(_0x5d4e37){_0x21d4b4[_0x6c95('0x4d')][_0x6c95('0x5b')]=_0x5d4e37['id'];return db['ChatInternalMessage'][_0x6c95('0x4c')](_0x21d4b4[_0x6c95('0x4d')]);}})['then'](respondWithResult(_0x267649,null))[_0x6c95('0x45')](handleError(_0x267649,null));};exports[_0x6c95('0x5c')]=function(_0x38f735,_0x4f851a,_0x37bf36){var _0x4b942b={};var _0x505190={};var _0x4a1b6e;var _0x5ae177;return db['ChatGroup'][_0x6c95('0x56')]({'where':{'id':_0x38f735['params']['id']}})['then'](handleEntityNotFound(_0x4f851a,null))[_0x6c95('0x2a')](function(_0x317cb8){if(_0x317cb8){_0x4a1b6e=_0x317cb8;_0x505190[_0x6c95('0x34')]=_[_0x6c95('0x36')](db[_0x6c95('0x51')][_0x6c95('0x32')]);_0x505190[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x38f735[_0x6c95('0x35')]);_0x505190['filters']=_['intersection'](_0x505190[_0x6c95('0x34')],_0x505190[_0x6c95('0x35')]);_0x4b942b[_0x6c95('0x3a')]=_['intersection'](_0x505190[_0x6c95('0x34')],qs['fields'](_0x38f735['query'][_0x6c95('0x39')]));_0x4b942b[_0x6c95('0x3a')]=_0x4b942b[_0x6c95('0x3a')][_0x6c95('0x3b')]?_0x4b942b[_0x6c95('0x3a')]:_0x505190[_0x6c95('0x34')];_0x4b942b[_0x6c95('0x3d')]=qs[_0x6c95('0x3e')](_0x38f735[_0x6c95('0x35')][_0x6c95('0x3e')]);_0x4b942b[_0x6c95('0x41')]=qs[_0x6c95('0x37')](_['pick'](_0x38f735[_0x6c95('0x35')],_0x505190[_0x6c95('0x37')]));if(_0x38f735[_0x6c95('0x35')][_0x6c95('0x40')]){_0x4b942b[_0x6c95('0x41')]=_['merge'](_0x4b942b[_0x6c95('0x41')],{'$or':_[_0x6c95('0x30')](_0x4b942b['attributes'],function(_0x31c756){var _0x3294a8={};_0x3294a8[_0x31c756]={'$like':'%'+_0x38f735[_0x6c95('0x35')][_0x6c95('0x40')]+'%'};return _0x3294a8;})});}if(_0x38f735['query'][_0x6c95('0x5d')]){var _0x3e7803=_0x38f735[_0x6c95('0x35')][_0x6c95('0x5d')][_0x6c95('0x5e')](',');var _0x45b1d7={};_0x45b1d7[_0x3e7803[0x0]]={'$gte':moment(_0x3e7803[0x1])[_0x6c95('0x5f')](_0x6c95('0x60'))};_0x4b942b[_0x6c95('0x41')]=_[_0x6c95('0x42')](_0x4b942b[_0x6c95('0x41')],_0x45b1d7);}_0x4b942b=_[_0x6c95('0x42')]({},_0x4b942b,_0x38f735['options']);return _0x4a1b6e[_0x6c95('0x5c')](_0x4b942b);}})[_0x6c95('0x2a')](function(_0x2634e1){if(_0x2634e1){_0x5ae177=_0x2634e1[_0x6c95('0x3b')];if(!_0x38f735[_0x6c95('0x35')][_0x6c95('0x58')](_0x6c95('0x3c'))){_0x4b942b[_0x6c95('0x23')]=qs['limit'](_0x38f735[_0x6c95('0x35')][_0x6c95('0x23')]);_0x4b942b[_0x6c95('0x25')]=qs[_0x6c95('0x25')](_0x38f735[_0x6c95('0x35')][_0x6c95('0x25')]);}return _0x4a1b6e[_0x6c95('0x5c')](_0x4b942b);}})[_0x6c95('0x2a')](function(_0x4b53ae){if(_0x4b53ae){return _0x4b53ae?{'count':_0x5ae177,'rows':_0x4b53ae}:null;}})[_0x6c95('0x2a')](respondWithResult(_0x4f851a,null))['catch'](handleError(_0x4f851a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 50090e9..76040da 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 _0x03ff=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x58e324,_0x16c4eb){var _0x5326da=function(_0x5c3216){while(--_0x5c3216){_0x58e324['push'](_0x58e324['shift']());}};_0x5326da(++_0x16c4eb);}(_0x03ff,0x1a8));var _0xf03f=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x03ff[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0xf03f('0x0'));var ChatGroup=require(_0xf03f('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf03f('0x2')](0x0);var events={'afterCreate':_0xf03f('0x3'),'afterUpdate':_0xf03f('0x4'),'afterDestroy':_0xf03f('0x5')};function emitEvent(_0x12487b){return function(_0x222897,_0x2b4673,_0x1bac62){ChatGroupEvents['emit'](_0x12487b+':'+_0x222897['id'],_0x222897);ChatGroupEvents[_0xf03f('0x6')](_0x12487b,_0x222897);_0x1bac62(null);};}for(var e in events){if(events[_0xf03f('0x7')](e)){var event=events[e];ChatGroup[_0xf03f('0x8')](e,emitEvent(event));}}module[_0xf03f('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9b25=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','save'];(function(_0x55a8a0,_0x313c62){var _0x581017=function(_0x5cf328){while(--_0x5cf328){_0x55a8a0['push'](_0x55a8a0['shift']());}};_0x581017(++_0x313c62);}(_0x9b25,0x1be));var _0x59b2=function(_0x394d5a,_0x23c990){_0x394d5a=_0x394d5a-0x0;var _0x281461=_0x9b25[_0x394d5a];return _0x281461;};'use strict';var EventEmitter=require(_0x59b2('0x0'));var ChatGroup=require(_0x59b2('0x1'))['db'][_0x59b2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x59b2('0x3'),'afterUpdate':_0x59b2('0x4'),'afterDestroy':_0x59b2('0x5')};function emitEvent(_0x459769){return function(_0x72ea4a,_0x48e4ca,_0x4dd11d){ChatGroupEvents[_0x59b2('0x6')](_0x459769+':'+_0x72ea4a['id'],_0x72ea4a);ChatGroupEvents[_0x59b2('0x6')](_0x459769,_0x72ea4a);_0x4dd11d(null);};}for(var e in events){if(events[_0x59b2('0x7')](e)){var event=events[e];ChatGroup[_0x59b2('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 98b4e94..17919f2 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 _0xdd79=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','util'];(function(_0x4eb3d2,_0x9b19d){var _0xa16302=function(_0x3cdc43){while(--_0x3cdc43){_0x4eb3d2['push'](_0x4eb3d2['shift']());}};_0xa16302(++_0x9b19d);}(_0xdd79,0x1af));var _0x9dd7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xdd79[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x9dd7('0x0'));var logger=require('../../config/logger')(_0x9dd7('0x1'));var moment=require(_0x9dd7('0x2'));var BPromise=require(_0x9dd7('0x3'));var rp=require(_0x9dd7('0x4'));var fs=require('fs');var path=require(_0x9dd7('0x5'));var rimraf=require(_0x9dd7('0x6'));var config=require(_0x9dd7('0x7'));var attributes=require(_0x9dd7('0x8'));module['exports']=function(_0x2c2a03,_0x3c48db){return _0x2c2a03[_0x9dd7('0x9')](_0x9dd7('0xa'),attributes,{'tableName':_0x9dd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0044=['ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x5f2c4f,_0x413414){var _0x498c51=function(_0x3fb596){while(--_0x3fb596){_0x5f2c4f['push'](_0x5f2c4f['shift']());}};_0x498c51(++_0x413414);}(_0x0044,0x12a));var _0x4004=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0044[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x4004('0x0'));var util=require(_0x4004('0x1'));var logger=require(_0x4004('0x2'))(_0x4004('0x3'));var moment=require(_0x4004('0x4'));var BPromise=require(_0x4004('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4004('0x6'));var rimraf=require('rimraf');var config=require(_0x4004('0x7'));var attributes=require('./chatGroup.attributes');module[_0x4004('0x8')]=function(_0x3d6186,_0x1d85a7){return _0x3d6186[_0x4004('0x9')](_0x4004('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 8344a19..3c2e399 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 _0x2123=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','register','request','then'];(function(_0x5802a6,_0x47c09e){var _0x31e9ff=function(_0x29ed57){while(--_0x29ed57){_0x5802a6['push'](_0x5802a6['shift']());}};_0x31e9ff(++_0x47c09e);}(_0x2123,0x190));var _0x3212=function(_0x28cb92,_0x5117bd){_0x28cb92=_0x28cb92-0x0;var _0x3f1f75=_0x2123[_0x28cb92];return _0x3f1f75;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});config[_0x3212('0xd')]=_[_0x3212('0xe')](config['redis'],{'host':_0x3212('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3212('0xd')]));require(_0x3212('0x10'))[_0x3212('0x11')](socket);function respondWithRpcPromise(_0x1db498,_0x54f331,_0x4a46c2){return new BPromise(function(_0x3a1f28,_0xf166c2){return client[_0x3212('0x12')](_0x1db498,_0x4a46c2)[_0x3212('0x13')](function(_0x9c01c3){logger[_0x3212('0x14')](_0x3212('0x15'),_0x54f331,_0x3212('0x16'));logger[_0x3212('0x17')](_0x3212('0x18'),_0x54f331,_0x3212('0x16'),JSON[_0x3212('0x19')](_0x9c01c3));if(_0x9c01c3[_0x3212('0x1a')]){if(_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1b')]===0x1f4){logger[_0x3212('0x1a')](_0x3212('0x15'),_0x54f331,_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);return _0xf166c2(_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);}logger[_0x3212('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x54f331,_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);return _0x3a1f28(_0x9c01c3[_0x3212('0x1a')][_0x3212('0x1c')]);}else{logger[_0x3212('0x14')](_0x3212('0x15'),_0x54f331,_0x3212('0x16'));_0x3a1f28(_0x9c01c3['result']['message']);}})[_0x3212('0x1d')](function(_0x49f5c2){logger[_0x3212('0x1a')](_0x3212('0x15'),_0x54f331,_0x49f5c2);_0xf166c2(_0x49f5c2);});});}
\ No newline at end of file
+var _0xacc8=['request\x20sent','debug','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x182093,_0x19eca5){var _0x180469=function(_0x3ec641){while(--_0x3ec641){_0x182093['push'](_0x182093['shift']());}};_0x180469(++_0x19eca5);}(_0xacc8,0xc5));var _0x8acc=function(_0x5c8440,_0x262351){_0x5c8440=_0x5c8440-0x0;var _0x301008=_0xacc8[_0x5c8440];return _0x301008;};'use strict';var _=require(_0x8acc('0x0'));var util=require('util');var moment=require(_0x8acc('0x1'));var BPromise=require(_0x8acc('0x2'));var rs=require(_0x8acc('0x3'));var fs=require('fs');var Redis=require(_0x8acc('0x4'));var db=require(_0x8acc('0x5'))['db'];var utils=require(_0x8acc('0x6'));var logger=require('../../config/logger')(_0x8acc('0x7'));var config=require(_0x8acc('0x8'));var jayson=require(_0x8acc('0x9'));var client=jayson['client'][_0x8acc('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8acc('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8acc('0xc'))(new Redis(config['redis']));require(_0x8acc('0xd'))[_0x8acc('0xe')](socket);function respondWithRpcPromise(_0x5a7185,_0x3fd766,_0x1c0d87){return new BPromise(function(_0x3669fb,_0x2bf3ad){return client[_0x8acc('0xf')](_0x5a7185,_0x1c0d87)[_0x8acc('0x10')](function(_0x390080){logger[_0x8acc('0x11')](_0x8acc('0x12'),_0x3fd766,_0x8acc('0x13'));logger[_0x8acc('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3fd766,_0x8acc('0x13'),JSON['stringify'](_0x390080));if(_0x390080[_0x8acc('0x15')]){if(_0x390080[_0x8acc('0x15')]['code']===0x1f4){logger[_0x8acc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3fd766,_0x390080[_0x8acc('0x15')][_0x8acc('0x16')]);return _0x2bf3ad(_0x390080['error'][_0x8acc('0x16')]);}logger[_0x8acc('0x15')](_0x8acc('0x12'),_0x3fd766,_0x390080['error'][_0x8acc('0x16')]);return _0x3669fb(_0x390080[_0x8acc('0x15')][_0x8acc('0x16')]);}else{logger[_0x8acc('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3fd766,_0x8acc('0x13'));_0x3669fb(_0x390080['result']['message']);}})[_0x8acc('0x17')](function(_0x5c9f47){logger['error'](_0x8acc('0x12'),_0x3fd766,_0x5c9f47);_0x2bf3ad(_0x5c9f47);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 22eb2f9..0ff4292 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 _0xe5a7=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5a7,0x7b));var _0x7e5a=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xe5a7[_0x491a7f];return _0x3d8f44;};'use strict';var ChatGroupEvents=require(_0x7e5a('0x0'));var events=[_0x7e5a('0x1'),_0x7e5a('0x2'),_0x7e5a('0x3')];function createListener(_0x204192,_0x49d282){return function(_0x3e8a66){_0x49d282[_0x7e5a('0x4')](_0x204192,_0x3e8a66);};}function removeListener(_0x200097,_0x4e09cc){return function(){ChatGroupEvents[_0x7e5a('0x5')](_0x200097,_0x4e09cc);};}exports[_0x7e5a('0x6')]=function(_0xcc4118){for(var _0x5e5055=0x0,_0x3abde2=events[_0x7e5a('0x7')];_0x5e5055<_0x3abde2;_0x5e5055++){var _0x261af2=events[_0x5e5055];var _0x1f2985=createListener(_0x7e5a('0x8')+_0x261af2,_0xcc4118);ChatGroupEvents['on'](_0x261af2,_0x1f2985);}};
\ No newline at end of file
+var _0xe240=['emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x2d731f,_0x1a7db6){var _0x3bc2bf=function(_0x510010){while(--_0x510010){_0x2d731f['push'](_0x2d731f['shift']());}};_0x3bc2bf(++_0x1a7db6);}(_0xe240,0x135));var _0x0e24=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe240[_0x5c2e3e];return _0x53f64a;};'use strict';var ChatGroupEvents=require(_0x0e24('0x0'));var events=['save','remove','update'];function createListener(_0x4c5346,_0x1d68ea){return function(_0x2d3140){_0x1d68ea[_0x0e24('0x1')](_0x4c5346,_0x2d3140);};}function removeListener(_0x1f2955,_0x1e75ac){return function(){ChatGroupEvents[_0x0e24('0x2')](_0x1f2955,_0x1e75ac);};}exports['register']=function(_0x45ff05){for(var _0x464d74=0x0,_0x4a6690=events[_0x0e24('0x3')];_0x464d74<_0x4a6690;_0x464d74++){var _0x45f727=events[_0x464d74];var _0x106bee=createListener(_0x0e24('0x4')+_0x45f727,_0x45ff05);ChatGroupEvents['on'](_0x45f727,_0x106bee);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 349da70..afa761e 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 _0x92f8=['update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','/:id/members','addMessage'];(function(_0x4ad82b,_0x4a209b){var _0x5ee22d=function(_0x389c20){while(--_0x389c20){_0x4ad82b['push'](_0x4ad82b['shift']());}};_0x5ee22d(++_0x4a209b);}(_0x92f8,0x1e1));var _0x892f=function(_0x2f432e,_0x4945ed){_0x2f432e=_0x2f432e-0x0;var _0x198fe7=_0x92f8[_0x2f432e];return _0x198fe7;};'use strict';var multer=require('multer');var util=require(_0x892f('0x0'));var path=require(_0x892f('0x1'));var timeout=require(_0x892f('0x2'));var express=require(_0x892f('0x3'));var router=express[_0x892f('0x4')]();var fs_extra=require(_0x892f('0x5'));var auth=require(_0x892f('0x6'));var interaction=require(_0x892f('0x7'));var config=require(_0x892f('0x8'));var controller=require(_0x892f('0x9'));router['get']('/',auth[_0x892f('0xa')](),controller[_0x892f('0xb')]);router[_0x892f('0xc')]('/describe',auth[_0x892f('0xa')](),controller[_0x892f('0xd')]);router[_0x892f('0xc')](_0x892f('0xe'),auth[_0x892f('0xa')](),controller[_0x892f('0xf')]);router[_0x892f('0xc')](_0x892f('0x10'),auth['isAuthenticated'](),controller['getUnread']);router[_0x892f('0xc')]('/:id/members',auth[_0x892f('0xa')](),controller[_0x892f('0x11')]);router[_0x892f('0xc')](_0x892f('0x12'),auth[_0x892f('0xa')](),controller[_0x892f('0x13')]);router[_0x892f('0x14')]('/',auth[_0x892f('0xa')](),controller['create']);router['post'](_0x892f('0x15'),auth[_0x892f('0xa')](),controller['addMembers']);router[_0x892f('0x14')]('/:id/messages',auth[_0x892f('0xa')](),controller[_0x892f('0x16')]);router['put'](_0x892f('0xe'),auth[_0x892f('0xa')](),controller[_0x892f('0x17')]);router[_0x892f('0x18')](_0x892f('0xe'),auth[_0x892f('0xa')](),controller[_0x892f('0x19')]);router[_0x892f('0x18')](_0x892f('0x15'),auth['isAuthenticated'](),controller[_0x892f('0x1a')]);module[_0x892f('0x1b')]=router;
\ No newline at end of file
+var _0xd1b8=['/:id/members','getMembers','/:id/messages','post','create','put','update','delete','destroy','removeMembers','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread'];(function(_0xa4098e,_0x4c9e5c){var _0xeeffcb=function(_0x42b2ac){while(--_0x42b2ac){_0xa4098e['push'](_0xa4098e['shift']());}};_0xeeffcb(++_0x4c9e5c);}(_0xd1b8,0x1a8));var _0x8d1b=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xd1b8[_0x4de586];return _0x46baf5;};'use strict';var multer=require(_0x8d1b('0x0'));var util=require(_0x8d1b('0x1'));var path=require('path');var timeout=require(_0x8d1b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d1b('0x3'));var interaction=require(_0x8d1b('0x4'));var config=require(_0x8d1b('0x5'));var controller=require(_0x8d1b('0x6'));router[_0x8d1b('0x7')]('/',auth[_0x8d1b('0x8')](),controller['index']);router[_0x8d1b('0x7')]('/describe',auth[_0x8d1b('0x8')](),controller['describe']);router[_0x8d1b('0x7')](_0x8d1b('0x9'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0xa')]);router[_0x8d1b('0x7')](_0x8d1b('0xb'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0xc')]);router[_0x8d1b('0x7')](_0x8d1b('0xd'),auth['isAuthenticated'](),controller[_0x8d1b('0xe')]);router['get'](_0x8d1b('0xf'),auth[_0x8d1b('0x8')](),controller['getMessages']);router[_0x8d1b('0x10')]('/',auth['isAuthenticated'](),controller[_0x8d1b('0x11')]);router[_0x8d1b('0x10')](_0x8d1b('0xd'),auth['isAuthenticated'](),controller['addMembers']);router['post'](_0x8d1b('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8d1b('0x12')](_0x8d1b('0x9'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0x13')]);router[_0x8d1b('0x14')](_0x8d1b('0x9'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0x15')]);router[_0x8d1b('0x14')](_0x8d1b('0xd'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index bf3cfa7..ffb5e13 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 _0x15f5=['star','thumb','TEXT','STRING','DATE','BOOLEAN','sequelize','exports','INTEGER','ENUM'];(function(_0x4685fa,_0x5b616e){var _0xbff5d2=function(_0x4a006b){while(--_0x4a006b){_0x4685fa['push'](_0x4685fa['shift']());}};_0xbff5d2(++_0x5b616e);}(_0x15f5,0x6a));var _0x515f=function(_0x242581,_0x3149b3){_0x242581=_0x242581-0x0;var _0x4d63e5=_0x15f5[_0x242581];return _0x4d63e5;};'use strict';var Sequelize=require(_0x515f('0x0'));module[_0x515f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x515f('0x2')]},'ratingType':{'type':Sequelize[_0x515f('0x3')](_0x515f('0x4'),_0x515f('0x5')),'defaultValue':_0x515f('0x4')},'ratingMessage':{'type':Sequelize[_0x515f('0x6')]},'pathTranscript':{'type':Sequelize[_0x515f('0x6')]},'mailTranscript':{'type':Sequelize[_0x515f('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x515f('0x8')]},'disposition':{'type':Sequelize[_0x515f('0x7')]},'secondDisposition':{'type':Sequelize[_0x515f('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x515f('0x7')]},'browserName':{'type':Sequelize[_0x515f('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x515f('0x7')]},'osVersion':{'type':Sequelize[_0x515f('0x7')]},'deviceModel':{'type':Sequelize[_0x515f('0x7')]},'deviceVendor':{'type':Sequelize[_0x515f('0x7')]},'deviceType':{'type':Sequelize[_0x515f('0x7')]},'referer':{'type':Sequelize[_0x515f('0x6')]},'customerIp':{'type':Sequelize[_0x515f('0x7')]},'formData':{'type':Sequelize[_0x515f('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x515f('0x8')]},'lastMsgAt':{'type':Sequelize[_0x515f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x515f('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x515f('0x7')]},'customerPort':{'type':Sequelize[_0x515f('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x515f('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x515f('0x9')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x515f('0x2')]}};
\ No newline at end of file
+var _0x8fe4=['out','INTEGER','sequelize','exports','BOOLEAN','star','TEXT','STRING','DATE','long','ENUM'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x8fe4,0x14c));var _0x48fe=function(_0x35cd06,_0x577a99){_0x35cd06=_0x35cd06-0x0;var _0x5c4f34=_0x8fe4[_0x35cd06];return _0x5c4f34;};'use strict';var Sequelize=require(_0x48fe('0x0'));module[_0x48fe('0x1')]={'closed':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48fe('0x3'),'thumb'),'defaultValue':_0x48fe('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x48fe('0x4')]},'mailTranscript':{'type':Sequelize[_0x48fe('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48fe('0x6')]},'disposition':{'type':Sequelize[_0x48fe('0x5')]},'secondDisposition':{'type':Sequelize[_0x48fe('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48fe('0x5')]},'browserName':{'type':Sequelize[_0x48fe('0x5')]},'browserVersion':{'type':Sequelize[_0x48fe('0x5')]},'osName':{'type':Sequelize[_0x48fe('0x5')]},'osVersion':{'type':Sequelize[_0x48fe('0x5')]},'deviceModel':{'type':Sequelize[_0x48fe('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x48fe('0x5')]},'referer':{'type':Sequelize[_0x48fe('0x4')]},'customerIp':{'type':Sequelize[_0x48fe('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x48fe('0x7'))},'read1stAt':{'type':Sequelize[_0x48fe('0x6')]},'lastMsgAt':{'type':Sequelize[_0x48fe('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x48fe('0x8')]('in',_0x48fe('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48fe('0x5')]},'customerPort':{'type':Sequelize[_0x48fe('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x48fe('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x48fe('0xa')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index a5bdcd0..e06125d 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 _0x0c0c=['Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','filename','mimetype','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','CmContact','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','include','getMyMessages','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ioredis','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','query','show','params','keys','rawAttributes','filters','intersection','model','attributes','fields','length','includeAll','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0c0c,0x68));var _0xc0c0=function(_0x362851,_0x56bd04){_0x362851=_0x362851-0x0;var _0xadb39=_0x0c0c[_0x362851];return _0xadb39;};'use strict';var rimraf=require(_0xc0c0('0x0'));var zipdir=require(_0xc0c0('0x1'));var rp=require(_0xc0c0('0x2'));var moment=require(_0xc0c0('0x3'));var BPromise=require(_0xc0c0('0x4'));var Mustache=require(_0xc0c0('0x5'));var util=require(_0xc0c0('0x6'));var path=require(_0xc0c0('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xc0c0('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xc0c0('0x9'));var logger=require(_0xc0c0('0xa'))('api');var config=require(_0xc0c0('0xb'));var db=require(_0xc0c0('0xc'))['db'];config[_0xc0c0('0xd')]=_[_0xc0c0('0xe')](config['redis'],{'host':_0xc0c0('0xf'),'port':0x18eb});var socket=require(_0xc0c0('0x10'))(new Redis(config[_0xc0c0('0xd')]));require(_0xc0c0('0x11'))[_0xc0c0('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc0c0('0x13')][_0xc0c0('0x14')]({'port':0x232b});var client9004=jayson['client'][_0xc0c0('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x207a48,_0x13b07f,_0x2cdb5b,_0x4bcc00){return new BPromise(function(_0x3e6a5c,_0x358544){var _0x31c38e=_0x4bcc00||client;return _0x31c38e[_0xc0c0('0x15')](_0x207a48,_0x2cdb5b)[_0xc0c0('0x16')](function(_0x329217){logger['info'](_0xc0c0('0x17'),_0x13b07f,_0xc0c0('0x18'));logger[_0xc0c0('0x19')](_0xc0c0('0x1a'),_0x13b07f,'request\x20sent',JSON[_0xc0c0('0x1b')](_0x329217));if(_0x329217[_0xc0c0('0x1c')]){if(_0x329217[_0xc0c0('0x1c')][_0xc0c0('0x1d')]===0x1f4){logger[_0xc0c0('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x13b07f,_0x329217[_0xc0c0('0x1c')][_0xc0c0('0x1e')]);return _0x358544(_0x329217[_0xc0c0('0x1c')][_0xc0c0('0x1e')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x13b07f,_0x329217[_0xc0c0('0x1c')][_0xc0c0('0x1e')]);return _0x3e6a5c(_0x329217['error'][_0xc0c0('0x1e')]);}else{logger[_0xc0c0('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x13b07f,_0xc0c0('0x18'));_0x3e6a5c(_0x329217[_0xc0c0('0x20')][_0xc0c0('0x1e')]);}})[_0xc0c0('0x21')](function(_0x41daf6){logger[_0xc0c0('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x13b07f,_0x41daf6);_0x358544(_0x41daf6);});});}function respondWithStatusCode(_0x2f4cff,_0x1966df){_0x1966df=_0x1966df||0xcc;return function(_0x206f28){if(_0x206f28){return _0x2f4cff[_0xc0c0('0x22')](_0x1966df);}return _0x2f4cff[_0xc0c0('0x23')](_0x1966df)['end']();};}function respondWithResult(_0x5591be,_0x1f44b0){_0x1f44b0=_0x1f44b0||0xc8;return function(_0x25944a){if(_0x25944a){return _0x5591be['status'](_0x1f44b0)[_0xc0c0('0x24')](_0x25944a);}};}function respondWithFilteredResult(_0x241a7d,_0x57be68){return function(_0x51e99a){if(_0x51e99a){var _0x3a46e5=typeof _0x57be68[_0xc0c0('0x25')]===_0xc0c0('0x26')&&typeof _0x57be68['limit']==='undefined';var _0x56199b=_0x51e99a[_0xc0c0('0x27')];var _0x16fa0d=_0x3a46e5?0x0:_0x57be68[_0xc0c0('0x25')];var _0x587bf6=_0x3a46e5?_0x51e99a[_0xc0c0('0x27')]:_0x57be68[_0xc0c0('0x25')]+_0x57be68[_0xc0c0('0x28')];var _0x2c1f0f;if(_0x587bf6>=_0x56199b){_0x587bf6=_0x56199b;_0x2c1f0f=0xc8;}else{_0x2c1f0f=0xce;}_0x241a7d[_0xc0c0('0x23')](_0x2c1f0f);return _0x241a7d[_0xc0c0('0x29')](_0xc0c0('0x2a'),_0x16fa0d+'-'+_0x587bf6+'/'+_0x56199b)['json'](_0x51e99a);}return null;};}function saveUpdates(_0x183423){return function(_0x3d3aca){if(_0x3d3aca){return _0x3d3aca[_0xc0c0('0x2b')](_0x183423)[_0xc0c0('0x16')](function(_0x357f4c){return _0x357f4c;});}return null;};}function removeEntity(_0x272acf){return function(_0xe11880){if(_0xe11880){return _0xe11880[_0xc0c0('0x2c')]()[_0xc0c0('0x16')](function(){_0x272acf[_0xc0c0('0x23')](0xcc)[_0xc0c0('0x2d')]();});}};}function handleEntityNotFound(_0x2f596c){return function(_0x4ec545){if(!_0x4ec545){_0x2f596c[_0xc0c0('0x22')](0x194);}return _0x4ec545;};}function handleError(_0x12eff2,_0x2320a1){_0x2320a1=_0x2320a1||0x1f4;return function(_0x45ef75){logger['error'](_0x45ef75[_0xc0c0('0x2e')]);if(_0x45ef75['name']){delete _0x45ef75[_0xc0c0('0x2f')];}_0x12eff2[_0xc0c0('0x23')](_0x2320a1)[_0xc0c0('0x30')](_0x45ef75);};}function getMustacheRender(_0x1f7424,_0x15acff){return Mustache[_0xc0c0('0x31')](_0x1f7424,_[_0xc0c0('0x32')](_0x15acff[_0xc0c0('0x33')],{'contact':_0x15acff[_0xc0c0('0x34')],'message':_0x15acff['message'],'agent':_0x15acff[_0xc0c0('0x35')],'interaction':_0x15acff[_0xc0c0('0x36')],'account':_0x15acff[_0xc0c0('0x37')]}))||'';}exports[_0xc0c0('0x38')]=function(_0x4198ca,_0x317fa0){var _0x5b2a7a={};var _0xb8df0b=_[_0xc0c0('0x39')](db[_0xc0c0('0x3a')]['rawAttributes'],function(_0x2df8d6){return{'name':_0x2df8d6[_0xc0c0('0x3b')],'type':_0x2df8d6[_0xc0c0('0x3c')][_0xc0c0('0x3d')]};});_0x5b2a7a=qs[_0xc0c0('0x3e')](_0xb8df0b,_0x4198ca);return interaction[_0xc0c0('0x3f')](_0xc0c0('0x40'),_0x4198ca[_0xc0c0('0x41')],_0x4198ca['user'],_0x5b2a7a,_0xb8df0b)['then'](respondWithFilteredResult(_0x317fa0,_0x5b2a7a))['catch'](handleError(_0x317fa0,null));};exports[_0xc0c0('0x42')]=function(_0x3a9763,_0xbb92b6){var _0x3b2ad1={'raw':![],'where':{'id':_0x3a9763[_0xc0c0('0x43')]['id']}},_0x3d74f1={};_0x3d74f1['model']=_[_0xc0c0('0x44')](db[_0xc0c0('0x3a')][_0xc0c0('0x45')]);_0x3d74f1[_0xc0c0('0x41')]=_[_0xc0c0('0x44')](_0x3a9763[_0xc0c0('0x41')]);_0x3d74f1[_0xc0c0('0x46')]=_[_0xc0c0('0x47')](_0x3d74f1[_0xc0c0('0x48')],_0x3d74f1[_0xc0c0('0x41')]);_0x3b2ad1[_0xc0c0('0x49')]=_[_0xc0c0('0x47')](_0x3d74f1[_0xc0c0('0x48')],qs[_0xc0c0('0x4a')](_0x3a9763[_0xc0c0('0x41')]['fields']));_0x3b2ad1[_0xc0c0('0x49')]=_0x3b2ad1[_0xc0c0('0x49')][_0xc0c0('0x4b')]?_0x3b2ad1[_0xc0c0('0x49')]:_0x3d74f1[_0xc0c0('0x48')];if(_0x3a9763[_0xc0c0('0x41')][_0xc0c0('0x4c')]){_0x3b2ad1['include']=[{'all':!![]}];}_0x3b2ad1=_['merge']({},_0x3b2ad1,_0x3a9763[_0xc0c0('0x4d')]);return db[_0xc0c0('0x3a')][_0xc0c0('0x4e')](_0x3b2ad1)[_0xc0c0('0x16')](handleEntityNotFound(_0xbb92b6,null))[_0xc0c0('0x16')](respondWithResult(_0xbb92b6,null))['catch'](handleError(_0xbb92b6,null));};exports[_0xc0c0('0x4f')]=function(_0x258f61,_0x363a1b){return db['ChatInteraction'][_0xc0c0('0x4f')](_0x258f61[_0xc0c0('0x33')],{})['then'](respondWithResult(_0x363a1b,0xc9))[_0xc0c0('0x21')](handleError(_0x363a1b,null));};exports[_0xc0c0('0x2b')]=function(_0x2e9e68,_0x3751c4){if(_0x2e9e68[_0xc0c0('0x33')]['id']){delete _0x2e9e68[_0xc0c0('0x33')]['id'];}return db[_0xc0c0('0x3a')][_0xc0c0('0x4e')]({'where':{'id':_0x2e9e68[_0xc0c0('0x43')]['id']}})[_0xc0c0('0x16')](handleEntityNotFound(_0x3751c4,null))['then'](saveUpdates(_0x2e9e68[_0xc0c0('0x33')],null))[_0xc0c0('0x16')](respondWithResult(_0x3751c4,null))[_0xc0c0('0x21')](handleError(_0x3751c4,null));};exports[_0xc0c0('0x2c')]=function(_0x121f4f,_0x5beadc){return db['ChatInteraction'][_0xc0c0('0x4e')]({'where':{'id':_0x121f4f['params']['id']}})[_0xc0c0('0x16')](handleEntityNotFound(_0x5beadc,null))[_0xc0c0('0x16')](removeEntity(_0x5beadc,null))[_0xc0c0('0x21')](handleError(_0x5beadc,null));};exports['describe']=function(_0x2fd017,_0x2ad330){return db[_0xc0c0('0x3a')][_0xc0c0('0x50')]()[_0xc0c0('0x16')](respondWithResult(_0x2ad330,null))['catch'](handleError(_0x2ad330,null));};exports[_0xc0c0('0x51')]=function(_0x2bb6b2,_0x1cde6){var _0x4db9db=_0x2bb6b2[_0xc0c0('0x43')]['id'];var _0x42b8a1;var _0x1a7eb5;var _0x1c842e;return db[_0xc0c0('0x3a')][_0xc0c0('0x52')]({'where':{'id':_0x4db9db}})[_0xc0c0('0x16')](function(_0x2ba506){_0x42b8a1=_0x2ba506;return db[_0xc0c0('0x53')][_0xc0c0('0x52')]({'where':{'id':_0x2ba506[_0xc0c0('0x54')]},'attributes':['id',_0xc0c0('0x55'),'vidaooEscalation',_0xc0c0('0x56'),_0xc0c0('0x57'),_0xc0c0('0x58')],'raw':!![]});})[_0xc0c0('0x16')](function(_0x5ba11b){if(_0x5ba11b&&_0x5ba11b['vidaooApiKey']&&_0x5ba11b['vidaooEscalation']){_0x1a7eb5=_0x5ba11b;var _0x300f1a={'interaction':{'id':_0x4db9db},'agent':{'id':_0x2bb6b2[_0xc0c0('0x59')]['id'],'name':_0x2bb6b2[_0xc0c0('0x59')][_0xc0c0('0x2f')],'fullname':_0x2bb6b2[_0xc0c0('0x59')][_0xc0c0('0x5a')],'email':_0x2bb6b2[_0xc0c0('0x59')]['email']},'contact':_0x2bb6b2[_0xc0c0('0x33')][_0xc0c0('0x34')],'account':_0x2bb6b2[_0xc0c0('0x33')][_0xc0c0('0x37')]};var _0x22b7b0={'rejectUnauthorized':![],'method':'POST','url':_0xc0c0('0x5b'),'headers':{'X-APIKEY':_0x5ba11b[_0xc0c0('0x55')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2bb6b2[_0xc0c0('0x59')][_0xc0c0('0x5c')]],'buttons':null,'topic':_0x1a7eb5['vidaooTopic'],'note':_[_0xc0c0('0x5d')](_0x1a7eb5['vidaooNote'])?null:getMustacheRender(_0x1a7eb5['vidaooNote'],_0x300f1a),'metadata':null},'redirect':_0xc0c0('0x5e'),'json':!![]};try{if(!_[_0xc0c0('0x5d')](_0x1a7eb5[_0xc0c0('0x58')])){var _0x2a2ac0=getMustacheRender(_0x1a7eb5['vidaooMetadata'],_0x300f1a);var _0x45049d=JSON[_0xc0c0('0x5f')](_0x2a2ac0);_0x22b7b0[_0xc0c0('0x33')][_0xc0c0('0x60')]=_0x45049d;}}catch(_0x446c7f){throw new db[(_0xc0c0('0x61'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x22b7b0);}else{throw new db['Sequelize'][(_0xc0c0('0x62'))](_0xc0c0('0x63'));}})[_0xc0c0('0x16')](function(_0x455f73){_0x1c842e=_0x455f73;if(_0x1c842e['id']){var _0x14fe27={'body':_0x1c842e['join_url'],'ChatWebsiteId':_0x1a7eb5['id'],'ChatInteractionId':_0x42b8a1['id'],'direction':_0xc0c0('0x64'),'UserId':_0x2bb6b2[_0xc0c0('0x59')]['id']};return db[_0xc0c0('0x65')][_0xc0c0('0x4f')](_0x14fe27,{});}else{throw new db[(_0xc0c0('0x61'))][(_0xc0c0('0x62'))](_0xc0c0('0x66'));}})[_0xc0c0('0x16')](function(){return _0x42b8a1[_0xc0c0('0x67')]({'vidaooSessionId':_0x1c842e['id']});})['then'](respondWithResult(_0x1cde6,null))[_0xc0c0('0x21')](handleError(_0x1cde6,null));};exports[_0xc0c0('0x68')]=function(_0x36109d,_0x37ad8e){if(_0x36109d[_0xc0c0('0x33')]['id']){delete _0x36109d['body']['id'];}return db['ChatInteraction'][_0xc0c0('0x4e')]({'where':{'id':_0x36109d['params']['id']},'include':[{'model':db['CmContact'],'as':_0xc0c0('0x69')}]})[_0xc0c0('0x16')](handleEntityNotFound(_0x37ad8e,null))['then'](saveUpdates(_0x36109d[_0xc0c0('0x33')],null))[_0xc0c0('0x16')](respondWithResult(_0x37ad8e,null))[_0xc0c0('0x21')](handleError(_0x37ad8e,null));};exports[_0xc0c0('0x6a')]=function(_0x2545f6,_0x2ba54e){if(_0x2545f6[_0xc0c0('0x33')]['id']){delete _0x2545f6[_0xc0c0('0x33')]['id'];}return db['ChatInteraction'][_0xc0c0('0x4e')]({'where':{'id':_0x2545f6[_0xc0c0('0x43')]['id']}})['then'](function(_0x2021ef){if(!_0x2021ef){logger[_0xc0c0('0x1c')](_0xc0c0('0x6b'),_0xc0c0('0x6a'),0x194,_0xc0c0('0x6c'));_0x2ba54e[_0xc0c0('0x22')](0x194);}else{if(_0x2021ef[_0xc0c0('0x6d')]){throw new db[(_0xc0c0('0x61'))][(_0xc0c0('0x62'))](_0xc0c0('0x6e'));}}return _0x2021ef;})[_0xc0c0('0x16')](function(_0x270a0b){if(_0x270a0b){return _0x270a0b[_0xc0c0('0x2b')]({'closed':_0x2545f6['body']['closed'],'disposition':_0x2545f6[_0xc0c0('0x33')][_0xc0c0('0x6f')]})['then'](function(_0x3b4534){return _0x3b4534;});}})[_0xc0c0('0x16')](function(){return respondWithRpcPromise(_0xc0c0('0x70'),'abandon',_0x2545f6[_0xc0c0('0x33')],client9004);})[_0xc0c0('0x16')](respondWithResult(_0x2ba54e,null))[_0xc0c0('0x21')](handleError(_0x2ba54e,null));};exports[_0xc0c0('0x71')]=function(_0x3554ca,_0x3d9ef6){_0x3554ca[_0xc0c0('0x33')][_0xc0c0('0x2f')]=_0x3554ca[_0xc0c0('0x72')]['originalname'];_0x3554ca[_0xc0c0('0x33')]['basename']=_0x3554ca[_0xc0c0('0x72')][_0xc0c0('0x73')];_0x3554ca[_0xc0c0('0x33')][_0xc0c0('0x3c')]=_0x3554ca['file'][_0xc0c0('0x74')];return db[_0xc0c0('0x75')][_0xc0c0('0x4f')](_0x3554ca[_0xc0c0('0x33')])[_0xc0c0('0x16')](respondWithResult(_0x3d9ef6,0xc9))['catch'](handleError(_0x3d9ef6,null));};exports['attachmentDownload']=function(_0x2389f1,_0xd84189){return db['ChatInteraction'][_0xc0c0('0x52')]({'where':{'id':_0x2389f1[_0xc0c0('0x43')]['id']},'raw':!![]})[_0xc0c0('0x16')](handleEntityNotFound(_0xd84189,null))[_0xc0c0('0x16')](function(_0x47314e){if(_0x47314e){if(_0x47314e[_0xc0c0('0x76')]){return _0xd84189[_0xc0c0('0x23')](0x193)['json']({'status':0x193,'message':_0xc0c0('0x77')});}return db[_0xc0c0('0x75')][_0xc0c0('0x52')]({'where':{'id':_0x2389f1[_0xc0c0('0x41')][_0xc0c0('0x78')]},'raw':!![]})[_0xc0c0('0x16')](handleEntityNotFound(_0xd84189,null));}})[_0xc0c0('0x16')](function(_0x2934c0){if(_0x2934c0){var _0x39318d=_0x2934c0[_0xc0c0('0x79')]!==null;var _0x246996=path[_0xc0c0('0x7a')](config['root'],_0xc0c0('0x7b'));if(_0x39318d){_0x246996=path[_0xc0c0('0x7a')](_0x246996,_0xc0c0('0x7c'));}var _0x1e176f=path['join'](_0x246996,_0x2934c0[_0xc0c0('0x7d')]);return _0xd84189['download'](_0x1e176f);}})[_0xc0c0('0x21')](handleError(_0xd84189,null));};exports['close']=function(_0xc9c1c4,_0x7ed150){var _0x227e34=null;var _0x1aea7a=null;var _0x50b795=null;if(_0xc9c1c4['body']['id']){delete _0xc9c1c4['body']['id'];}if(_0xc9c1c4[_0xc0c0('0x33')]['mailTranscript']){_0x50b795=path[_0xc0c0('0x7a')](config[_0xc0c0('0x7e')],_0xc0c0('0x7f'),util[_0xc0c0('0x80')](_0xc0c0('0x81'),Date[_0xc0c0('0x82')]()));_0xc9c1c4[_0xc0c0('0x33')][_0xc0c0('0x83')]=_0x50b795;}return db[_0xc0c0('0x3a')][_0xc0c0('0x4e')]({'where':{'id':_0xc9c1c4[_0xc0c0('0x43')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xc0c0('0x84')],'as':_0xc0c0('0x84')}]}]})[_0xc0c0('0x16')](handleEntityNotFound(_0x7ed150,null))[_0xc0c0('0x16')](saveUpdates(_0xc9c1c4[_0xc0c0('0x33')],null))[_0xc0c0('0x16')](function(_0x1a823d){if(_0x1a823d){_0x227e34=_0x1a823d;return db['ChatWebsite'][_0xc0c0('0x4e')]({'where':{'id':_0x227e34[_0xc0c0('0x54')]}});}})['then'](function(_0x30656b){if(_0x30656b){_0x1aea7a=_0x30656b;return db[_0xc0c0('0x85')][_0xc0c0('0x4e')]({'where':{'id':_0x227e34[_0xc0c0('0x86')]}});}})[_0xc0c0('0x16')](function(_0x10c25f){if(_0x10c25f){if(_0x50b795){var _0x2c0324=null;for(var _0x4a218a=0x1;_0x4a218a<_0x227e34[_0xc0c0('0x87')][_0xc0c0('0x4b')];++_0x4a218a){_0x2c0324=_0x227e34[_0xc0c0('0x87')][_0x4a218a];var _0x5aac04=_0x2c0324['UserId']?util[_0xc0c0('0x80')](_0xc0c0('0x88'),_0x1aea7a[_0xc0c0('0x89')],_0x2c0324['UserId']):_0xc0c0('0x8a');var _0x258ea6=_0xc9c1c4[_0xc0c0('0x33')][_0xc0c0('0x8b')]||util[_0xc0c0('0x80')](_0xc0c0('0x88'),_0xc0c0('0x8c'),_0x2c0324[_0xc0c0('0x86')]);switch(_0x1aea7a[_0xc0c0('0x8d')]){case _0xc0c0('0x8e'):_0x5aac04=_0x2c0324[_0xc0c0('0x6d')]?util[_0xc0c0('0x80')](_0xc0c0('0x88'),_0x1aea7a[_0xc0c0('0x89')],_0x2c0324[_0xc0c0('0x6d')]):_0xc0c0('0x8a');break;case'agent_alias':_0x5aac04=_0x2c0324[_0xc0c0('0x6d')]?_0x2c0324[_0xc0c0('0x84')][_0xc0c0('0x8f')]||_0x2c0324['User'][_0xc0c0('0x5a')]:_0xc0c0('0x8a');break;case _0xc0c0('0x90'):_0x5aac04=_0x2c0324[_0xc0c0('0x6d')]?_0x2c0324[_0xc0c0('0x84')][_0xc0c0('0x5a')]:'System';break;default:_0x5aac04=_0x2c0324[_0xc0c0('0x6d')]?util[_0xc0c0('0x80')](_0xc0c0('0x88'),_0x1aea7a[_0xc0c0('0x89')],_0x2c0324[_0xc0c0('0x6d')]):'System';}var _0xb7bf39=util[_0xc0c0('0x80')](_0xc0c0('0x91'),moment(_0x2c0324[_0xc0c0('0x92')])[_0xc0c0('0x80')](_0xc0c0('0x93')),_0x2c0324[_0xc0c0('0x94')]==='in'?_0x258ea6:_0x5aac04,_0x2c0324[_0xc0c0('0x33')]);if(!_0x2c0324[_0xc0c0('0x95')]){fs[_0xc0c0('0x96')](_0x50b795,_0xb7bf39);}}return db['MailAccount'][_0xc0c0('0x52')]({'where':{'service':!![]},'include':[{'model':db[_0xc0c0('0x97')],'as':_0xc0c0('0x98'),'raw':!![],'include':[{'model':db[_0xc0c0('0x99')],'as':_0xc0c0('0x99'),'raw':!![]}]}]});}}})[_0xc0c0('0x16')](function(_0x3d3e9f){if(!_0x3d3e9f||!_0x3d3e9f[_0xc0c0('0x98')]||!_0xc9c1c4[_0xc0c0('0x33')])return _0x227e34;var _0xc62010=_0x3d3e9f['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0xc62010,'message':{'from':util[_0xc0c0('0x80')]('\x22%s\x22\x20<%s>',_0x3d3e9f[_0xc0c0('0x2f')],_0x3d3e9f[_0xc0c0('0x5c')]||_0x3d3e9f[_0xc0c0('0x98')]['user']),'to':_0xc9c1c4[_0xc0c0('0x33')][_0xc0c0('0x9a')],'subject':'Mail\x20Transcript','text':util[_0xc0c0('0x80')](_0xc0c0('0x9b'),_0xc9c1c4[_0xc0c0('0x33')][_0xc0c0('0x9a')]),'attachments':[{'path':_0x50b795}]}})[_0xc0c0('0x16')](function(){return _0x227e34;})['catch'](function(_0x11be3f){logger[_0xc0c0('0x1c')](_0x11be3f);});})['then'](respondWithStatusCode(_0x7ed150,0xc8))[_0xc0c0('0x21')](handleError(_0x7ed150,null));};exports[_0xc0c0('0x9c')]=function(_0x512e09,_0x1693a5){return db[_0xc0c0('0x65')]['find']({'where':{'id':_0x512e09[_0xc0c0('0x43')]['id']}})['then'](handleEntityNotFound(_0x1693a5,null))[_0xc0c0('0x16')](function(_0x2797f9){if(_0x2797f9){return _0x2797f9[_0xc0c0('0x9c')](_0x512e09[_0xc0c0('0x33')][_0xc0c0('0x9d')],_[_0xc0c0('0x9e')](_0x512e09[_0xc0c0('0x33')],[_0xc0c0('0x9d'),'id'])||{});}})[_0xc0c0('0x16')](respondWithResult(_0x1693a5,null))[_0xc0c0('0x21')](handleError(_0x1693a5,null));};exports[_0xc0c0('0x9f')]=function(_0x5f1eb2,_0x532a77){var _0x3ab0bd={'raw':![],'where':{}};var _0xec6ac6={};var _0x273c30={'count':0x0,'rows':[]};return db[_0xc0c0('0x3a')][_0xc0c0('0x52')]({'where':{'id':_0x5f1eb2[_0xc0c0('0x43')]['id']}})[_0xc0c0('0x16')](handleEntityNotFound(_0x532a77,null))[_0xc0c0('0x16')](function(_0x42d9d4){if(_0x42d9d4){_0xec6ac6[_0xc0c0('0x48')]=_['keys'](db[_0xc0c0('0x65')]['rawAttributes']);_0xec6ac6[_0xc0c0('0x41')]=_[_0xc0c0('0x44')](_0x5f1eb2[_0xc0c0('0x41')]);_0xec6ac6[_0xc0c0('0x46')]=_[_0xc0c0('0x47')](_0xec6ac6['model'],_0xec6ac6[_0xc0c0('0x41')]);_0x3ab0bd[_0xc0c0('0x49')]=_[_0xc0c0('0x47')](_0xec6ac6[_0xc0c0('0x48')],qs['fields'](_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0x4a')]));_0x3ab0bd['attributes']=_0x3ab0bd[_0xc0c0('0x49')][_0xc0c0('0x4b')]?_0x3ab0bd[_0xc0c0('0x49')]:_0xec6ac6[_0xc0c0('0x48')];if(!_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0xa0')](_0xc0c0('0xa1'))){_0x3ab0bd[_0xc0c0('0x28')]=qs['limit'](_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0x28')]);_0x3ab0bd[_0xc0c0('0x25')]=qs[_0xc0c0('0x25')](_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0x25')]);}_0x3ab0bd[_0xc0c0('0xa2')]=qs[_0xc0c0('0xa3')](_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0xa3')]);_0x3ab0bd[_0xc0c0('0xa4')]=qs[_0xc0c0('0x46')](_[_0xc0c0('0xa5')](_0x5f1eb2[_0xc0c0('0x41')],_0xec6ac6[_0xc0c0('0x46')]));_0x3ab0bd[_0xc0c0('0xa4')][_0xc0c0('0xa6')]=_0x42d9d4['id'];if(_0x5f1eb2['query'][_0xc0c0('0xa7')]){_0x3ab0bd['where']=_[_0xc0c0('0x32')](_0x3ab0bd[_0xc0c0('0xa4')],{'$or':_[_0xc0c0('0x39')](_0x3ab0bd[_0xc0c0('0x49')],function(_0x567366){var _0x3fb79a={};_0x3fb79a[_0x567366]={'$like':'%'+_0x5f1eb2[_0xc0c0('0x41')]['filter']+'%'};return _0x3fb79a;})});}if(_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0xa8')]){var _0x4f547a=_0x5f1eb2['query'][_0xc0c0('0xa8')][_0xc0c0('0xa9')](',');var _0x7dc3bb={};_0x7dc3bb[_0x4f547a[0x0]]={'$gte':moment(_0x4f547a[0x1])[_0xc0c0('0x80')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3ab0bd['where']=_[_0xc0c0('0x32')](_0x3ab0bd[_0xc0c0('0xa4')],_0x7dc3bb);}_0x3ab0bd=_[_0xc0c0('0x32')]({},_0x3ab0bd,_0x5f1eb2[_0xc0c0('0x4d')]);return db[_0xc0c0('0x65')]['count']({'where':_0x3ab0bd['where']})[_0xc0c0('0x16')](function(_0x34f59e){_0x273c30['count']=_0x34f59e;if(_0x5f1eb2[_0xc0c0('0x41')][_0xc0c0('0x4c')]){_0x3ab0bd[_0xc0c0('0xaa')]=[{'all':!![]}];}return db[_0xc0c0('0x65')][_0xc0c0('0x3f')](_0x3ab0bd);})[_0xc0c0('0x16')](function(_0x3116f2){_0x273c30['rows']=_0x3116f2;return _0x273c30;});}})['then'](respondWithFilteredResult(_0x532a77,_0x3ab0bd))[_0xc0c0('0x21')](handleError(_0x532a77,null));};exports[_0xc0c0('0xab')]=function(_0x2ffc42,_0x3e48a2){var _0x1b92ad={'where':{}},_0x234b4a={},_0x1b1777={'count':0x0,'rows':[]};return db[_0xc0c0('0x3a')][_0xc0c0('0x52')]({'where':{'id':_0x2ffc42['params']['id']}})[_0xc0c0('0x16')](handleEntityNotFound(_0x3e48a2,null))[_0xc0c0('0x16')](function(_0xe13baf){if(_0xe13baf){_0x234b4a[_0xc0c0('0x48')]=_[_0xc0c0('0x44')](db['ChatMessage'][_0xc0c0('0x45')]);_0x234b4a[_0xc0c0('0x41')]=_['keys'](_0x2ffc42[_0xc0c0('0x41')]);_0x234b4a[_0xc0c0('0x46')]=_['intersection'](_0x234b4a[_0xc0c0('0x48')],_0x234b4a[_0xc0c0('0x41')]);_0x1b92ad[_0xc0c0('0x49')]=_[_0xc0c0('0x47')](_0x234b4a[_0xc0c0('0x48')],qs['fields'](_0x2ffc42[_0xc0c0('0x41')][_0xc0c0('0x4a')]));_0x1b92ad[_0xc0c0('0x49')]=_0x1b92ad[_0xc0c0('0x49')][_0xc0c0('0x4b')]?_0x1b92ad[_0xc0c0('0x49')]:_0x234b4a[_0xc0c0('0x48')];if(!_0x2ffc42[_0xc0c0('0x41')][_0xc0c0('0xa0')](_0xc0c0('0xa1'))){_0x1b92ad['limit']=qs[_0xc0c0('0x28')](_0x2ffc42[_0xc0c0('0x41')][_0xc0c0('0x28')]);_0x1b92ad[_0xc0c0('0x25')]=qs[_0xc0c0('0x25')](_0x2ffc42[_0xc0c0('0x41')][_0xc0c0('0x25')]);}_0x1b92ad[_0xc0c0('0xa2')]=qs[_0xc0c0('0xa3')](_0x2ffc42[_0xc0c0('0x41')][_0xc0c0('0xa3')]);_0x1b92ad[_0xc0c0('0xa4')]=qs[_0xc0c0('0x46')](_[_0xc0c0('0xa5')](_0x2ffc42[_0xc0c0('0x41')],_0x234b4a['filters']));_0x1b92ad[_0xc0c0('0xa4')][_0xc0c0('0xa6')]=_0xe13baf['id'];if(_0x2ffc42['query'][_0xc0c0('0xa7')]){_0x1b92ad[_0xc0c0('0xa4')]=_[_0xc0c0('0x32')](_0x1b92ad['where'],{'$or':_[_0xc0c0('0x39')](_0x1b92ad[_0xc0c0('0x49')],function(_0x29f704){var _0x5b8aae={};_0x5b8aae[_0x29f704]={'$like':'%'+_0x2ffc42[_0xc0c0('0x41')][_0xc0c0('0xa7')]+'%'};return _0x5b8aae;})});}_0x1b92ad[_0xc0c0('0xa4')][_0xc0c0('0x95')]=![];if(_0x2ffc42['query']['id']){_0x1b92ad[_0xc0c0('0xa4')]['id']={'$gt':_0x2ffc42[_0xc0c0('0x41')]['id']};}_0x1b92ad=_[_0xc0c0('0x32')]({},_0x1b92ad,_0x2ffc42[_0xc0c0('0x4d')]);return db['ChatMessage']['count']({'where':_0x1b92ad[_0xc0c0('0xa4')]})[_0xc0c0('0x16')](function(_0x4570d4){_0x1b1777['count']=_0x4570d4;_0x1b92ad[_0xc0c0('0xaa')]=[];if(_0x2ffc42['query'][_0xc0c0('0xac')]){_0x1b92ad[_0xc0c0('0xaa')][_0xc0c0('0xad')]({'model':db[_0xc0c0('0x84')],'as':_0xc0c0('0x84'),'attributes':['id',_0xc0c0('0x5a'),_0xc0c0('0x8f')]});}if(_0x2ffc42['query']['includeAll']){_0x1b92ad['include']=[{'all':!![]}];}return db[_0xc0c0('0x65')]['findAll'](_0x1b92ad);})[_0xc0c0('0x16')](function(_0x577d2e){_0x1b1777[_0xc0c0('0xae')]=_0x577d2e;return _0x1b1777;});}})['then'](respondWithFilteredResult(_0x3e48a2,_0x1b92ad))[_0xc0c0('0x21')](handleError(_0x3e48a2,null));};exports[_0xc0c0('0xaf')]=function(_0x3137c6,_0x15d406){return db[_0xc0c0('0x3a')][_0xc0c0('0x4e')]({'where':{'id':_0x3137c6[_0xc0c0('0x43')]['id']}})['then'](handleEntityNotFound(_0x15d406,null))['then'](function(_0x2ec9bd){if(_0x2ec9bd){return _0x2ec9bd[_0xc0c0('0xb0')](_0x3137c6[_0xc0c0('0x33')]['ids'],_['omit'](_0x3137c6[_0xc0c0('0x33')],[_0xc0c0('0x9d'),'id'])||{})[_0xc0c0('0xb1')](function(){return db[_0xc0c0('0xb2')][_0xc0c0('0x3f')]({'attributes':['id',_0xc0c0('0x2f'),_0xc0c0('0xb3')],'where':{'id':_0x3137c6[_0xc0c0('0x33')][_0xc0c0('0x9d')]}});})['then'](function(_0xa92f03){socket[_0xc0c0('0xb4')](_0xc0c0('0xb5'),{'id':Number(_0x3137c6[_0xc0c0('0x43')]['id']),'tags':_0xa92f03||[]});return{'id':Number(_0x3137c6[_0xc0c0('0x43')]['id']),'tags':_0xa92f03||[]};});}})[_0xc0c0('0x16')](respondWithResult(_0x15d406,null))['catch'](handleError(_0x15d406,null));};exports['removeTags']=function(_0x185734,_0x317030){return db[_0xc0c0('0x3a')][_0xc0c0('0x4e')]({'where':{'id':_0x185734[_0xc0c0('0x43')]['id']}})[_0xc0c0('0x16')](handleEntityNotFound(_0x317030,null))['then'](function(_0x33b47c){if(_0x33b47c){return _0x33b47c['removeTags'](_0x185734['query'][_0xc0c0('0x9d')]);}})['then'](respondWithStatusCode(_0x317030,null))[_0xc0c0('0x21')](handleError(_0x317030,null));};exports['download']=function(_0x20282e,_0x58fc99){var _0x468e08=moment()[_0xc0c0('0xb6')]()[_0xc0c0('0xb7')]();var _0x12ee65=path[_0xc0c0('0x7a')](config['root'],_0xc0c0('0xb8'),_0xc0c0('0xb9'),'tmp');var _0x1c8956=path[_0xc0c0('0x7a')](config[_0xc0c0('0x7e')],'server','files',_0xc0c0('0xba'));var _0x3ea58c=path[_0xc0c0('0x7a')](_0x12ee65,_0x468e08);var _0x34df16=util[_0xc0c0('0x80')](_0xc0c0('0xbb'),_0x20282e[_0xc0c0('0x43')]['id'],_0x468e08);var _0x43eda4=path[_0xc0c0('0x7a')](_0x12ee65,_0x34df16);var _0x2275fd=[];_0x2275fd[_0xc0c0('0xad')]({'model':db['User'],'as':_0xc0c0('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x2275fd[_0xc0c0('0xad')]({'model':db[_0xc0c0('0x85')],'as':_0xc0c0('0x69'),'attributes':['id',_0xc0c0('0xbc'),_0xc0c0('0xbd')],'raw':!![]});if(_0x20282e[_0xc0c0('0x41')]['attachments']){_0x2275fd[_0xc0c0('0xad')]({'model':db[_0xc0c0('0x75')],'as':_0xc0c0('0x75'),'raw':!![]});}var _0x4264e3=[{'model':db[_0xc0c0('0x65')],'as':_0xc0c0('0x87'),'attributes':['id',_0xc0c0('0x33'),_0xc0c0('0x92'),_0xc0c0('0x94'),'secret',_0xc0c0('0xbe')],'include':_0x2275fd}];_0x4264e3[_0xc0c0('0xad')]({'model':db[_0xc0c0('0x53')],'as':_0xc0c0('0xbf'),'attributes':['id','name']});_0x4264e3[_0xc0c0('0xad')]({'model':db[_0xc0c0('0x84')],'as':_0xc0c0('0xc0'),'attributes':['id',_0xc0c0('0x5a')]});return db[_0xc0c0('0x3a')][_0xc0c0('0x4e')]({'where':{'id':_0x20282e[_0xc0c0('0x43')]['id']},'include':_0x4264e3})[_0xc0c0('0x16')](handleEntityNotFound(_0x58fc99,null))[_0xc0c0('0x16')](function(_0x51e4e6){if(_0x51e4e6){var _0x2a0f23=_0x51e4e6[_0xc0c0('0xc1')]({'plain':!![]});fs[_0xc0c0('0xc2')](_0x3ea58c);var _0x3ce4ad={'channel':_0xc0c0('0xc3'),'account':_0x2a0f23[_0xc0c0('0xbf')][_0xc0c0('0x2f')],'agent':_0x2a0f23['Owner']?_0x2a0f23['Owner'][_0xc0c0('0x5a')]:_0xc0c0('0xc4'),'createdAt':moment(_0x2a0f23[_0xc0c0('0x92')])[_0xc0c0('0x80')](_0xc0c0('0xc5'))['toString'](),'closedAt':_0x2a0f23[_0xc0c0('0x76')]?moment(_0x2a0f23['closedAt'])['format'](_0xc0c0('0xc5'))['toString']():'','disposition':_0x2a0f23[_0xc0c0('0x6f')],'chatInfo':{'browser':_0x2a0f23[_0xc0c0('0xc6')],'os':_0x2a0f23[_0xc0c0('0xc7')],'referer':_0x2a0f23[_0xc0c0('0xc8')],'customerIp':_0x2a0f23['customerIp'],'customerPort':_0x2a0f23[_0xc0c0('0xc9')]?_0x2a0f23[_0xc0c0('0xc9')]:_0xc0c0('0xc4')},'messages':_(_0x2a0f23[_0xc0c0('0x87')])[_0xc0c0('0xca')]()[_0xc0c0('0xa7')]({'secret':![]})[_0xc0c0('0x39')](function(_0x42a75b){if(_0x42a75b[_0xc0c0('0x75')]){var _0x38e6d0=path[_0xc0c0('0x7a')](_0x1c8956,_0x42a75b[_0xc0c0('0x75')]['basename']);if(fs[_0xc0c0('0xcb')](_0x38e6d0)){fs['createReadStream'](_0x38e6d0)[_0xc0c0('0xcc')](fs[_0xc0c0('0xcd')](path['join'](_0x3ea58c,_0x42a75b[_0xc0c0('0x75')][_0xc0c0('0x7d')])));}}return{'date':moment(_0x42a75b[_0xc0c0('0x92')])[_0xc0c0('0x80')](_0xc0c0('0xc5'))[_0xc0c0('0xb7')](),'sender':_0x42a75b[_0xc0c0('0x94')]===_0xc0c0('0x64')?_0x42a75b[_0xc0c0('0x84')]?_0x42a75b[_0xc0c0('0x84')]['fullname']:'System':_0x42a75b[_0xc0c0('0x69')][_0xc0c0('0xbc')]+(_0x42a75b['Contact'][_0xc0c0('0xbd')]?'\x20'+_0x42a75b['Contact'][_0xc0c0('0xbd')]:''),'body':_0x42a75b['Attachment']?_0x42a75b[_0xc0c0('0x75')][_0xc0c0('0x7d')]:_0x42a75b['body'],'direction':_0x42a75b[_0xc0c0('0x94')]===_0xc0c0('0x64')?'A':'C','secret':_0x42a75b[_0xc0c0('0x95')],'read':_0x42a75b[_0xc0c0('0xbe')],'attachment':_0x42a75b['Attachment']};})[_0xc0c0('0xce')]()};return ejs[_0xc0c0('0xcf')](path['join'](config['root'],_0xc0c0('0xb8'),'views',_0xc0c0('0xd0')),{'interaction':_0x3ce4ad})['then'](function(_0xd2c50){var _0x2c466e=path['join'](_0x3ea58c,_0xc0c0('0xd1')+_0x2a0f23['id']+'-'+_0x468e08+_0xc0c0('0xd2'));var _0x46b112={'path':_0x2c466e,'channel':'Chat','interactionId':_0x2a0f23['id']};return pdf[_0xc0c0('0xd3')](_0xd2c50,_0x46b112);})[_0xc0c0('0x16')](function(){return new Promise(function(_0x293aa1,_0x5f1765){zipdir(_0x3ea58c,{'saveTo':_0x43eda4},function(_0x4cf9f4,_0x3446a8){if(_0x4cf9f4)return _0x5f1765(_0x4cf9f4);return _0x293aa1(_0x3446a8);});})[_0xc0c0('0x16')](function(){return new BPromise(function(_0x452f1d,_0x52e87f){rimraf(_0x3ea58c,function(_0x28e5ba){if(_0x28e5ba)_0x52e87f(_0x28e5ba);return _0x452f1d();});});})[_0xc0c0('0x16')](function(){return _0x58fc99[_0xc0c0('0xd4')](_0x43eda4,_0x34df16,function(_0x10fe25){if(_0x10fe25){logger[_0xc0c0('0x1c')](_0xc0c0('0xd5'),_0x10fe25);}else{fs['unlinkSync'](_0x43eda4);}});});});}else{return _0x58fc99[_0xc0c0('0x22')](0xc8);}})['catch'](handleError(_0x58fc99,null));};
\ No newline at end of file
+var _0xa802=['mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','ContactId','UserId','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','order','sort','where','ChatInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','getMyMessages','hasOwnProperty','secret','includeAgent','alias','findAll','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','tmp','server','files','attachments','transcript-%d-%s.zip','push','direction','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','Contact','firstName','lastName','read','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','end','stack','name','render','body','contact','agent','interaction','account','index','map','ChatInteraction','type','key','getOptions','query','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','find','create','params','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','closed','attachmentUpload','file','originalname','basename'];(function(_0x342ebe,_0x459563){var _0x2898af=function(_0x4bf08d){while(--_0x4bf08d){_0x342ebe['push'](_0x342ebe['shift']());}};_0x2898af(++_0x459563);}(_0xa802,0x67));var _0x2a80=function(_0x18dfcf,_0x4709ca){_0x18dfcf=_0x18dfcf-0x0;var _0x422850=_0xa802[_0x18dfcf];return _0x422850;};'use strict';var rimraf=require(_0x2a80('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2a80('0x1'));var Mustache=require(_0x2a80('0x2'));var util=require(_0x2a80('0x3'));var path=require(_0x2a80('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a80('0x5'));var Redis=require(_0x2a80('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x2a80('0x7'));var pdf=require(_0x2a80('0x8'));var logger=require(_0x2a80('0x9'))('api');var config=require(_0x2a80('0xa'));var db=require(_0x2a80('0xb'))['db'];config[_0x2a80('0xc')]=_[_0x2a80('0xd')](config['redis'],{'host':_0x2a80('0xe'),'port':0x18eb});var socket=require(_0x2a80('0xf'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2a80('0x10')](socket);var jayson=require(_0x2a80('0x11'));var client=jayson[_0x2a80('0x12')][_0x2a80('0x13')]({'port':0x232b});var client9004=jayson[_0x2a80('0x12')][_0x2a80('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5819de,_0x3ade2c,_0x15b660,_0x56e43f){return new BPromise(function(_0xc17ce7,_0x449713){var _0x5d8f21=_0x56e43f||client;return _0x5d8f21[_0x2a80('0x14')](_0x5819de,_0x15b660)['then'](function(_0x1de562){logger[_0x2a80('0x15')](_0x2a80('0x16'),_0x3ade2c,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3ade2c,'request\x20sent',JSON[_0x2a80('0x17')](_0x1de562));if(_0x1de562['error']){if(_0x1de562[_0x2a80('0x18')][_0x2a80('0x19')]===0x1f4){logger[_0x2a80('0x18')](_0x2a80('0x16'),_0x3ade2c,_0x1de562['error'][_0x2a80('0x1a')]);return _0x449713(_0x1de562[_0x2a80('0x18')][_0x2a80('0x1a')]);}logger['error'](_0x2a80('0x16'),_0x3ade2c,_0x1de562['error']['message']);return _0xc17ce7(_0x1de562[_0x2a80('0x18')][_0x2a80('0x1a')]);}else{logger[_0x2a80('0x15')](_0x2a80('0x16'),_0x3ade2c,_0x2a80('0x1b'));_0xc17ce7(_0x1de562['result'][_0x2a80('0x1a')]);}})[_0x2a80('0x1c')](function(_0x20424b){logger[_0x2a80('0x18')](_0x2a80('0x16'),_0x3ade2c,_0x20424b);_0x449713(_0x20424b);});});}function respondWithStatusCode(_0x4f9185,_0x3a2d0e){_0x3a2d0e=_0x3a2d0e||0xcc;return function(_0x49c2c6){if(_0x49c2c6){return _0x4f9185[_0x2a80('0x1d')](_0x3a2d0e);}return _0x4f9185['status'](_0x3a2d0e)['end']();};}function respondWithResult(_0x16e922,_0x483f92){_0x483f92=_0x483f92||0xc8;return function(_0x39f2de){if(_0x39f2de){return _0x16e922[_0x2a80('0x1e')](_0x483f92)[_0x2a80('0x1f')](_0x39f2de);}};}function respondWithFilteredResult(_0x47bfb2,_0x2803e5){return function(_0xb4fdfa){if(_0xb4fdfa){var _0x15059d=typeof _0x2803e5[_0x2a80('0x20')]===_0x2a80('0x21')&&typeof _0x2803e5[_0x2a80('0x22')]==='undefined';var _0x2ef3b7=_0xb4fdfa['count'];var _0x5bfe69=_0x15059d?0x0:_0x2803e5[_0x2a80('0x20')];var _0x23c8a5=_0x15059d?_0xb4fdfa[_0x2a80('0x23')]:_0x2803e5[_0x2a80('0x20')]+_0x2803e5[_0x2a80('0x22')];var _0x1a4903;if(_0x23c8a5>=_0x2ef3b7){_0x23c8a5=_0x2ef3b7;_0x1a4903=0xc8;}else{_0x1a4903=0xce;}_0x47bfb2[_0x2a80('0x1e')](_0x1a4903);return _0x47bfb2[_0x2a80('0x24')](_0x2a80('0x25'),_0x5bfe69+'-'+_0x23c8a5+'/'+_0x2ef3b7)['json'](_0xb4fdfa);}return null;};}function saveUpdates(_0x58d46f){return function(_0x3ad276){if(_0x3ad276){return _0x3ad276[_0x2a80('0x26')](_0x58d46f)['then'](function(_0x1078c3){return _0x1078c3;});}return null;};}function removeEntity(_0x46c4b6){return function(_0xbde15a){if(_0xbde15a){return _0xbde15a[_0x2a80('0x27')]()[_0x2a80('0x28')](function(){_0x46c4b6[_0x2a80('0x1e')](0xcc)[_0x2a80('0x29')]();});}};}function handleEntityNotFound(_0x5afffb){return function(_0xf3b647){if(!_0xf3b647){_0x5afffb['sendStatus'](0x194);}return _0xf3b647;};}function handleError(_0x134638,_0x4ef250){_0x4ef250=_0x4ef250||0x1f4;return function(_0x136d71){logger['error'](_0x136d71[_0x2a80('0x2a')]);if(_0x136d71[_0x2a80('0x2b')]){delete _0x136d71[_0x2a80('0x2b')];}_0x134638[_0x2a80('0x1e')](_0x4ef250)['send'](_0x136d71);};}function getMustacheRender(_0xca47ac,_0x341d12){return Mustache[_0x2a80('0x2c')](_0xca47ac,_['merge'](_0x341d12[_0x2a80('0x2d')],{'contact':_0x341d12[_0x2a80('0x2e')],'message':_0x341d12[_0x2a80('0x1a')],'agent':_0x341d12[_0x2a80('0x2f')],'interaction':_0x341d12[_0x2a80('0x30')],'account':_0x341d12[_0x2a80('0x31')]}))||'';}exports[_0x2a80('0x32')]=function(_0x3ce1e6,_0x33115a){var _0x9edccb={};var _0x2f9a99=_[_0x2a80('0x33')](db[_0x2a80('0x34')]['rawAttributes'],function(_0x810e4a){return{'name':_0x810e4a['fieldName'],'type':_0x810e4a[_0x2a80('0x35')][_0x2a80('0x36')]};});_0x9edccb=qs[_0x2a80('0x37')](_0x2f9a99,_0x3ce1e6);return interaction['findAll']('chat',_0x3ce1e6[_0x2a80('0x38')],_0x3ce1e6['user'],_0x9edccb,_0x2f9a99)[_0x2a80('0x28')](respondWithFilteredResult(_0x33115a,_0x9edccb))[_0x2a80('0x1c')](handleError(_0x33115a,null));};exports[_0x2a80('0x39')]=function(_0x405982,_0xdb004f){var _0x18c957={'raw':![],'where':{'id':_0x405982['params']['id']}},_0x5e934b={};_0x5e934b[_0x2a80('0x3a')]=_[_0x2a80('0x3b')](db[_0x2a80('0x34')][_0x2a80('0x3c')]);_0x5e934b[_0x2a80('0x38')]=_[_0x2a80('0x3b')](_0x405982[_0x2a80('0x38')]);_0x5e934b[_0x2a80('0x3d')]=_[_0x2a80('0x3e')](_0x5e934b[_0x2a80('0x3a')],_0x5e934b[_0x2a80('0x38')]);_0x18c957[_0x2a80('0x3f')]=_[_0x2a80('0x3e')](_0x5e934b[_0x2a80('0x3a')],qs['fields'](_0x405982[_0x2a80('0x38')][_0x2a80('0x40')]));_0x18c957[_0x2a80('0x3f')]=_0x18c957[_0x2a80('0x3f')][_0x2a80('0x41')]?_0x18c957[_0x2a80('0x3f')]:_0x5e934b[_0x2a80('0x3a')];if(_0x405982[_0x2a80('0x38')][_0x2a80('0x42')]){_0x18c957['include']=[{'all':!![]}];}_0x18c957=_['merge']({},_0x18c957,_0x405982['options']);return db[_0x2a80('0x34')][_0x2a80('0x43')](_0x18c957)[_0x2a80('0x28')](handleEntityNotFound(_0xdb004f,null))['then'](respondWithResult(_0xdb004f,null))[_0x2a80('0x1c')](handleError(_0xdb004f,null));};exports[_0x2a80('0x44')]=function(_0x596960,_0x4a29a2){return db[_0x2a80('0x34')][_0x2a80('0x44')](_0x596960[_0x2a80('0x2d')],{})[_0x2a80('0x28')](respondWithResult(_0x4a29a2,0xc9))[_0x2a80('0x1c')](handleError(_0x4a29a2,null));};exports[_0x2a80('0x26')]=function(_0x1f4735,_0x166e60){if(_0x1f4735[_0x2a80('0x2d')]['id']){delete _0x1f4735['body']['id'];}return db['ChatInteraction'][_0x2a80('0x43')]({'where':{'id':_0x1f4735[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x166e60,null))[_0x2a80('0x28')](saveUpdates(_0x1f4735[_0x2a80('0x2d')],null))[_0x2a80('0x28')](respondWithResult(_0x166e60,null))[_0x2a80('0x1c')](handleError(_0x166e60,null));};exports[_0x2a80('0x27')]=function(_0x399513,_0x2380fe){return db[_0x2a80('0x34')]['find']({'where':{'id':_0x399513[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x2380fe,null))['then'](removeEntity(_0x2380fe,null))[_0x2a80('0x1c')](handleError(_0x2380fe,null));};exports[_0x2a80('0x46')]=function(_0x596ad7,_0x478d02){return db[_0x2a80('0x34')][_0x2a80('0x46')]()['then'](respondWithResult(_0x478d02,null))['catch'](handleError(_0x478d02,null));};exports[_0x2a80('0x47')]=function(_0x4653a1,_0x5eb007){var _0x35ec34=_0x4653a1[_0x2a80('0x45')]['id'];var _0x1e6ae8;var _0x5732b9;var _0x2410ae;return db[_0x2a80('0x34')][_0x2a80('0x48')]({'where':{'id':_0x35ec34}})['then'](function(_0x37a375){_0x1e6ae8=_0x37a375;return db['ChatWebsite'][_0x2a80('0x48')]({'where':{'id':_0x37a375[_0x2a80('0x49')]},'attributes':['id',_0x2a80('0x4a'),_0x2a80('0x4b'),_0x2a80('0x4c'),_0x2a80('0x4d'),_0x2a80('0x4e')],'raw':!![]});})[_0x2a80('0x28')](function(_0x285df3){if(_0x285df3&&_0x285df3[_0x2a80('0x4a')]&&_0x285df3[_0x2a80('0x4b')]){_0x5732b9=_0x285df3;var _0x5e354d={'interaction':{'id':_0x35ec34},'agent':{'id':_0x4653a1['user']['id'],'name':_0x4653a1[_0x2a80('0x4f')]['name'],'fullname':_0x4653a1[_0x2a80('0x4f')][_0x2a80('0x50')],'email':_0x4653a1[_0x2a80('0x4f')][_0x2a80('0x51')]},'contact':_0x4653a1[_0x2a80('0x2d')]['contact'],'account':_0x4653a1['body']['account']};var _0x49cbeb={'rejectUnauthorized':![],'method':_0x2a80('0x52'),'url':_0x2a80('0x53'),'headers':{'X-APIKEY':_0x285df3[_0x2a80('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4653a1[_0x2a80('0x4f')][_0x2a80('0x51')]],'buttons':null,'topic':_0x5732b9[_0x2a80('0x4c')],'note':_[_0x2a80('0x54')](_0x5732b9[_0x2a80('0x4d')])?null:getMustacheRender(_0x5732b9[_0x2a80('0x4d')],_0x5e354d),'metadata':null},'redirect':_0x2a80('0x55'),'json':!![]};try{if(!_['isNull'](_0x5732b9['vidaooMetadata'])){var _0x4bf632=getMustacheRender(_0x5732b9['vidaooMetadata'],_0x5e354d);var _0x269fc2=JSON[_0x2a80('0x56')](_0x4bf632);_0x49cbeb[_0x2a80('0x2d')][_0x2a80('0x57')]=_0x269fc2;}}catch(_0x4a938f){throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))](_0x2a80('0x5a'));}return rp(_0x49cbeb);}else{throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x15db2c){_0x2410ae=_0x15db2c;if(_0x2410ae['id']){var _0x4811da={'body':_0x2410ae['join_url'],'ChatWebsiteId':_0x5732b9['id'],'ChatInteractionId':_0x1e6ae8['id'],'direction':_0x2a80('0x5b'),'UserId':_0x4653a1[_0x2a80('0x4f')]['id']};return db[_0x2a80('0x5c')]['create'](_0x4811da,{});}else{throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x1e6ae8['updateAttributes']({'vidaooSessionId':_0x2410ae['id']});})['then'](respondWithResult(_0x5eb007,null))['catch'](handleError(_0x5eb007,null));};exports[_0x2a80('0x5d')]=function(_0x313fb1,_0x3022a1){if(_0x313fb1[_0x2a80('0x2d')]['id']){delete _0x313fb1['body']['id'];}return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x313fb1[_0x2a80('0x45')]['id']},'include':[{'model':db[_0x2a80('0x5e')],'as':'Contact'}]})[_0x2a80('0x28')](handleEntityNotFound(_0x3022a1,null))[_0x2a80('0x28')](saveUpdates(_0x313fb1[_0x2a80('0x2d')],null))[_0x2a80('0x28')](respondWithResult(_0x3022a1,null))['catch'](handleError(_0x3022a1,null));};exports[_0x2a80('0x5f')]=function(_0x3fdd1c,_0x432284){if(_0x3fdd1c['body']['id']){delete _0x3fdd1c['body']['id'];}return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x3fdd1c[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](function(_0x79a41c){if(!_0x79a41c){logger[_0x2a80('0x18')](_0x2a80('0x60'),_0x2a80('0x5f'),0x194,'entity\x20not\x20found');_0x432284['sendStatus'](0x194);}else{if(_0x79a41c['UserId']){throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))]('Interaction\x20already\x20assigned');}}return _0x79a41c;})[_0x2a80('0x28')](function(_0xd37d00){if(_0xd37d00){return _0xd37d00[_0x2a80('0x26')]({'closed':_0x3fdd1c[_0x2a80('0x2d')][_0x2a80('0x61')],'disposition':_0x3fdd1c[_0x2a80('0x2d')]['disposition']})[_0x2a80('0x28')](function(_0x747ebe){return _0x747ebe;});}})[_0x2a80('0x28')](function(){return respondWithRpcPromise('AbandonInteraction',_0x2a80('0x5f'),_0x3fdd1c[_0x2a80('0x2d')],client9004);})[_0x2a80('0x28')](respondWithResult(_0x432284,null))['catch'](handleError(_0x432284,null));};exports[_0x2a80('0x62')]=function(_0x55a432,_0x1e9f02){_0x55a432[_0x2a80('0x2d')][_0x2a80('0x2b')]=_0x55a432[_0x2a80('0x63')][_0x2a80('0x64')];_0x55a432['body'][_0x2a80('0x65')]=_0x55a432['file']['filename'];_0x55a432[_0x2a80('0x2d')][_0x2a80('0x35')]=_0x55a432[_0x2a80('0x63')][_0x2a80('0x66')];return db[_0x2a80('0x67')][_0x2a80('0x44')](_0x55a432[_0x2a80('0x2d')])[_0x2a80('0x28')](respondWithResult(_0x1e9f02,0xc9))['catch'](handleError(_0x1e9f02,null));};exports['attachmentDownload']=function(_0x2b9c7e,_0x55b52a){return db[_0x2a80('0x34')]['findOne']({'where':{'id':_0x2b9c7e[_0x2a80('0x45')]['id']},'raw':!![]})[_0x2a80('0x28')](handleEntityNotFound(_0x55b52a,null))[_0x2a80('0x28')](function(_0x56968c){if(_0x56968c){if(_0x56968c[_0x2a80('0x61')]){return _0x55b52a['status'](0x193)[_0x2a80('0x1f')]({'status':0x193,'message':_0x2a80('0x68')});}return db['Attachment'][_0x2a80('0x48')]({'where':{'id':_0x2b9c7e[_0x2a80('0x38')][_0x2a80('0x69')]},'raw':!![]})['then'](handleEntityNotFound(_0x55b52a,null));}})['then'](function(_0x1363dd){if(_0x1363dd){var _0x28771d=_0x1363dd[_0x2a80('0x6a')]!==null;var _0x2dd35f=path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],_0x2a80('0x6d'));if(_0x28771d){_0x2dd35f=path[_0x2a80('0x6b')](_0x2dd35f,_0x2a80('0x6e'));}var _0x170736=path['join'](_0x2dd35f,_0x1363dd['basename']);return _0x55b52a[_0x2a80('0x6f')](_0x170736);}})['catch'](handleError(_0x55b52a,null));};exports[_0x2a80('0x70')]=function(_0x2c843a,_0x4cdd96){var _0x5cb57b=null;var _0x24bd89=null;var _0x5d6511=null;if(_0x2c843a['body']['id']){delete _0x2c843a[_0x2a80('0x2d')]['id'];}if(_0x2c843a['body'][_0x2a80('0x71')]){_0x5d6511=path['join'](config['root'],'server/files/chat/upload/',util[_0x2a80('0x72')](_0x2a80('0x73'),Date['now']()));_0x2c843a[_0x2a80('0x2d')][_0x2a80('0x74')]=_0x5d6511;}return db['ChatInteraction'][_0x2a80('0x43')]({'where':{'id':_0x2c843a[_0x2a80('0x45')]['id']},'include':[{'model':db[_0x2a80('0x5c')],'as':_0x2a80('0x75'),'include':[{'model':db[_0x2a80('0x76')],'as':'User'}]}]})[_0x2a80('0x28')](handleEntityNotFound(_0x4cdd96,null))[_0x2a80('0x28')](saveUpdates(_0x2c843a[_0x2a80('0x2d')],null))[_0x2a80('0x28')](function(_0x3542fb){if(_0x3542fb){_0x5cb57b=_0x3542fb;return db[_0x2a80('0x77')][_0x2a80('0x43')]({'where':{'id':_0x5cb57b[_0x2a80('0x49')]}});}})[_0x2a80('0x28')](function(_0x499360){if(_0x499360){_0x24bd89=_0x499360;return db[_0x2a80('0x5e')][_0x2a80('0x43')]({'where':{'id':_0x5cb57b[_0x2a80('0x78')]}});}})[_0x2a80('0x28')](function(_0x2bdc5f){if(_0x2bdc5f){if(_0x5d6511){var _0x420c5a=null;for(var _0x327b83=0x1;_0x327b83<_0x5cb57b['Messages'][_0x2a80('0x41')];++_0x327b83){_0x420c5a=_0x5cb57b[_0x2a80('0x75')][_0x327b83];var _0x4e8382=_0x420c5a[_0x2a80('0x79')]?util['format'](_0x2a80('0x7a'),_0x24bd89[_0x2a80('0x7b')],_0x420c5a['UserId']):_0x2a80('0x7c');var _0x27f868=_0x2c843a[_0x2a80('0x2d')][_0x2a80('0x7d')]||util[_0x2a80('0x72')](_0x2a80('0x7a'),'Visitor',_0x420c5a[_0x2a80('0x78')]);switch(_0x24bd89[_0x2a80('0x7e')]){case _0x2a80('0x7f'):_0x4e8382=_0x420c5a[_0x2a80('0x79')]?util[_0x2a80('0x72')]('%s%d',_0x24bd89['agentAlias'],_0x420c5a[_0x2a80('0x79')]):_0x2a80('0x7c');break;case _0x2a80('0x80'):_0x4e8382=_0x420c5a[_0x2a80('0x79')]?_0x420c5a[_0x2a80('0x76')]['alias']||_0x420c5a[_0x2a80('0x76')]['fullname']:_0x2a80('0x7c');break;case'agent_fullname':_0x4e8382=_0x420c5a[_0x2a80('0x79')]?_0x420c5a[_0x2a80('0x76')]['fullname']:_0x2a80('0x7c');break;default:_0x4e8382=_0x420c5a[_0x2a80('0x79')]?util['format'](_0x2a80('0x7a'),_0x24bd89[_0x2a80('0x7b')],_0x420c5a[_0x2a80('0x79')]):_0x2a80('0x7c');}var _0x511070=util[_0x2a80('0x72')](_0x2a80('0x81'),moment(_0x420c5a[_0x2a80('0x82')])[_0x2a80('0x72')](_0x2a80('0x83')),_0x420c5a['direction']==='in'?_0x27f868:_0x4e8382,_0x420c5a[_0x2a80('0x2d')]);if(!_0x420c5a['secret']){fs[_0x2a80('0x84')](_0x5d6511,_0x511070);}}return db[_0x2a80('0x85')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2a80('0x86'),'raw':!![],'include':[{'model':db[_0x2a80('0x87')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x41370e){if(!_0x41370e||!_0x41370e[_0x2a80('0x86')]||!_0x2c843a[_0x2a80('0x2d')])return _0x5cb57b;var _0x10d27d=_0x41370e[_0x2a80('0x88')]();return respondWithRpcPromise(_0x2a80('0x89'),_0x2a80('0x8a'),{'account':_0x10d27d,'message':{'from':util[_0x2a80('0x72')](_0x2a80('0x8b'),_0x41370e[_0x2a80('0x2b')],_0x41370e[_0x2a80('0x51')]||_0x41370e[_0x2a80('0x86')][_0x2a80('0x4f')]),'to':_0x2c843a[_0x2a80('0x2d')]['mailTranscript'],'subject':_0x2a80('0x8c'),'text':util[_0x2a80('0x72')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2c843a['body'][_0x2a80('0x71')]),'attachments':[{'path':_0x5d6511}]}})[_0x2a80('0x28')](function(){return _0x5cb57b;})[_0x2a80('0x1c')](function(_0x265256){logger['error'](_0x265256);});})['then'](respondWithStatusCode(_0x4cdd96,0xc8))[_0x2a80('0x1c')](handleError(_0x4cdd96,null));};exports[_0x2a80('0x8d')]=function(_0x569a43,_0x1d5f6f){return db[_0x2a80('0x5c')][_0x2a80('0x43')]({'where':{'id':_0x569a43['params']['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x1d5f6f,null))[_0x2a80('0x28')](function(_0x840be0){if(_0x840be0){return _0x840be0['addMessage'](_0x569a43['body']['ids'],_[_0x2a80('0x8e')](_0x569a43[_0x2a80('0x2d')],[_0x2a80('0x8f'),'id'])||{});}})['then'](respondWithResult(_0x1d5f6f,null))['catch'](handleError(_0x1d5f6f,null));};exports['getMessages']=function(_0x2f851c,_0x52e202){var _0x2633bd={'raw':![],'where':{}};var _0x36bc88={};var _0x54b6a5={'count':0x0,'rows':[]};return db[_0x2a80('0x34')]['findOne']({'where':{'id':_0x2f851c[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x52e202,null))[_0x2a80('0x28')](function(_0x17dae5){if(_0x17dae5){_0x36bc88[_0x2a80('0x3a')]=_[_0x2a80('0x3b')](db['ChatMessage']['rawAttributes']);_0x36bc88[_0x2a80('0x38')]=_[_0x2a80('0x3b')](_0x2f851c['query']);_0x36bc88[_0x2a80('0x3d')]=_[_0x2a80('0x3e')](_0x36bc88[_0x2a80('0x3a')],_0x36bc88[_0x2a80('0x38')]);_0x2633bd[_0x2a80('0x3f')]=_[_0x2a80('0x3e')](_0x36bc88['model'],qs[_0x2a80('0x40')](_0x2f851c['query'][_0x2a80('0x40')]));_0x2633bd['attributes']=_0x2633bd[_0x2a80('0x3f')][_0x2a80('0x41')]?_0x2633bd[_0x2a80('0x3f')]:_0x36bc88[_0x2a80('0x3a')];if(!_0x2f851c[_0x2a80('0x38')]['hasOwnProperty']('nolimit')){_0x2633bd[_0x2a80('0x22')]=qs[_0x2a80('0x22')](_0x2f851c[_0x2a80('0x38')][_0x2a80('0x22')]);_0x2633bd[_0x2a80('0x20')]=qs[_0x2a80('0x20')](_0x2f851c[_0x2a80('0x38')][_0x2a80('0x20')]);}_0x2633bd[_0x2a80('0x90')]=qs[_0x2a80('0x91')](_0x2f851c[_0x2a80('0x38')][_0x2a80('0x91')]);_0x2633bd['where']=qs[_0x2a80('0x3d')](_['pick'](_0x2f851c['query'],_0x36bc88['filters']));_0x2633bd[_0x2a80('0x92')][_0x2a80('0x93')]=_0x17dae5['id'];if(_0x2f851c['query'][_0x2a80('0x94')]){_0x2633bd[_0x2a80('0x92')]=_[_0x2a80('0x95')](_0x2633bd[_0x2a80('0x92')],{'$or':_['map'](_0x2633bd[_0x2a80('0x3f')],function(_0x2aae8c){var _0x7d2b18={};_0x7d2b18[_0x2aae8c]={'$like':'%'+_0x2f851c[_0x2a80('0x38')][_0x2a80('0x94')]+'%'};return _0x7d2b18;})});}if(_0x2f851c[_0x2a80('0x38')]['$gte']){var _0x33d5d=_0x2f851c['query'][_0x2a80('0x96')][_0x2a80('0x97')](',');var _0x5e007f={};_0x5e007f[_0x33d5d[0x0]]={'$gte':moment(_0x33d5d[0x1])[_0x2a80('0x72')](_0x2a80('0x98'))};_0x2633bd[_0x2a80('0x92')]=_[_0x2a80('0x95')](_0x2633bd['where'],_0x5e007f);}_0x2633bd=_[_0x2a80('0x95')]({},_0x2633bd,_0x2f851c[_0x2a80('0x99')]);return db[_0x2a80('0x5c')][_0x2a80('0x23')]({'where':_0x2633bd[_0x2a80('0x92')]})[_0x2a80('0x28')](function(_0x342a29){_0x54b6a5[_0x2a80('0x23')]=_0x342a29;if(_0x2f851c[_0x2a80('0x38')][_0x2a80('0x42')]){_0x2633bd[_0x2a80('0x9a')]=[{'all':!![]}];}return db[_0x2a80('0x5c')]['findAll'](_0x2633bd);})[_0x2a80('0x28')](function(_0x19ccee){_0x54b6a5[_0x2a80('0x9b')]=_0x19ccee;return _0x54b6a5;});}})[_0x2a80('0x28')](respondWithFilteredResult(_0x52e202,_0x2633bd))[_0x2a80('0x1c')](handleError(_0x52e202,null));};exports[_0x2a80('0x9c')]=function(_0x5a218c,_0x4be3ec){var _0x58da3a={'where':{}},_0x2abf5c={},_0x2b40cc={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2a80('0x48')]({'where':{'id':_0x5a218c[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x4be3ec,null))[_0x2a80('0x28')](function(_0x34ee72){if(_0x34ee72){_0x2abf5c['model']=_[_0x2a80('0x3b')](db[_0x2a80('0x5c')]['rawAttributes']);_0x2abf5c['query']=_[_0x2a80('0x3b')](_0x5a218c[_0x2a80('0x38')]);_0x2abf5c[_0x2a80('0x3d')]=_['intersection'](_0x2abf5c[_0x2a80('0x3a')],_0x2abf5c['query']);_0x58da3a[_0x2a80('0x3f')]=_[_0x2a80('0x3e')](_0x2abf5c[_0x2a80('0x3a')],qs['fields'](_0x5a218c[_0x2a80('0x38')][_0x2a80('0x40')]));_0x58da3a['attributes']=_0x58da3a['attributes'][_0x2a80('0x41')]?_0x58da3a[_0x2a80('0x3f')]:_0x2abf5c[_0x2a80('0x3a')];if(!_0x5a218c['query'][_0x2a80('0x9d')]('nolimit')){_0x58da3a[_0x2a80('0x22')]=qs[_0x2a80('0x22')](_0x5a218c[_0x2a80('0x38')][_0x2a80('0x22')]);_0x58da3a[_0x2a80('0x20')]=qs['offset'](_0x5a218c['query']['offset']);}_0x58da3a[_0x2a80('0x90')]=qs['sort'](_0x5a218c[_0x2a80('0x38')]['sort']);_0x58da3a[_0x2a80('0x92')]=qs[_0x2a80('0x3d')](_['pick'](_0x5a218c[_0x2a80('0x38')],_0x2abf5c['filters']));_0x58da3a['where'][_0x2a80('0x93')]=_0x34ee72['id'];if(_0x5a218c[_0x2a80('0x38')][_0x2a80('0x94')]){_0x58da3a[_0x2a80('0x92')]=_['merge'](_0x58da3a[_0x2a80('0x92')],{'$or':_[_0x2a80('0x33')](_0x58da3a[_0x2a80('0x3f')],function(_0x3a4a2c){var _0xe73cf3={};_0xe73cf3[_0x3a4a2c]={'$like':'%'+_0x5a218c['query']['filter']+'%'};return _0xe73cf3;})});}_0x58da3a[_0x2a80('0x92')][_0x2a80('0x9e')]=![];if(_0x5a218c[_0x2a80('0x38')]['id']){_0x58da3a['where']['id']={'$gt':_0x5a218c[_0x2a80('0x38')]['id']};}_0x58da3a=_[_0x2a80('0x95')]({},_0x58da3a,_0x5a218c[_0x2a80('0x99')]);return db[_0x2a80('0x5c')][_0x2a80('0x23')]({'where':_0x58da3a[_0x2a80('0x92')]})[_0x2a80('0x28')](function(_0x21a697){_0x2b40cc[_0x2a80('0x23')]=_0x21a697;_0x58da3a[_0x2a80('0x9a')]=[];if(_0x5a218c[_0x2a80('0x38')][_0x2a80('0x9f')]){_0x58da3a[_0x2a80('0x9a')]['push']({'model':db['User'],'as':_0x2a80('0x76'),'attributes':['id',_0x2a80('0x50'),_0x2a80('0xa0')]});}if(_0x5a218c[_0x2a80('0x38')][_0x2a80('0x42')]){_0x58da3a['include']=[{'all':!![]}];}return db[_0x2a80('0x5c')][_0x2a80('0xa1')](_0x58da3a);})[_0x2a80('0x28')](function(_0x5afebe){_0x2b40cc[_0x2a80('0x9b')]=_0x5afebe;return _0x2b40cc;});}})[_0x2a80('0x28')](respondWithFilteredResult(_0x4be3ec,_0x58da3a))['catch'](handleError(_0x4be3ec,null));};exports[_0x2a80('0xa2')]=function(_0x69bc1d,_0xdbac0d){return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x69bc1d['params']['id']}})['then'](handleEntityNotFound(_0xdbac0d,null))[_0x2a80('0x28')](function(_0x3e0595){if(_0x3e0595){return _0x3e0595[_0x2a80('0xa3')](_0x69bc1d[_0x2a80('0x2d')]['ids'],_[_0x2a80('0x8e')](_0x69bc1d[_0x2a80('0x2d')],[_0x2a80('0x8f'),'id'])||{})[_0x2a80('0xa4')](function(){return db[_0x2a80('0xa5')][_0x2a80('0xa1')]({'attributes':['id',_0x2a80('0x2b'),_0x2a80('0xa6')],'where':{'id':_0x69bc1d[_0x2a80('0x2d')]['ids']}});})[_0x2a80('0x28')](function(_0x513eec){socket[_0x2a80('0xa7')](_0x2a80('0xa8'),{'id':Number(_0x69bc1d[_0x2a80('0x45')]['id']),'tags':_0x513eec||[]});return{'id':Number(_0x69bc1d['params']['id']),'tags':_0x513eec||[]};});}})[_0x2a80('0x28')](respondWithResult(_0xdbac0d,null))[_0x2a80('0x1c')](handleError(_0xdbac0d,null));};exports[_0x2a80('0xa9')]=function(_0x52a402,_0x4da365){return db['ChatInteraction'][_0x2a80('0x43')]({'where':{'id':_0x52a402[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x4da365,null))[_0x2a80('0x28')](function(_0x412093){if(_0x412093){return _0x412093[_0x2a80('0xa9')](_0x52a402[_0x2a80('0x38')]['ids']);}})[_0x2a80('0x28')](respondWithStatusCode(_0x4da365,null))[_0x2a80('0x1c')](handleError(_0x4da365,null));};exports[_0x2a80('0x6f')]=function(_0x59db0d,_0x2afa41){var _0x503f3d=moment()[_0x2a80('0xaa')]()[_0x2a80('0xab')]();var _0x69ffab=path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],'server','files',_0x2a80('0xac'));var _0x111dfe=path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],_0x2a80('0xad'),_0x2a80('0xae'),_0x2a80('0xaf'));var _0x988ee3=path['join'](_0x69ffab,_0x503f3d);var _0xa7224b=util[_0x2a80('0x72')](_0x2a80('0xb0'),_0x59db0d[_0x2a80('0x45')]['id'],_0x503f3d);var _0x46d2e2=path[_0x2a80('0x6b')](_0x69ffab,_0xa7224b);var _0x28002a=[];_0x28002a['push']({'model':db[_0x2a80('0x76')],'as':_0x2a80('0x76'),'attributes':['id','fullname'],'raw':!![]});_0x28002a[_0x2a80('0xb1')]({'model':db[_0x2a80('0x5e')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x59db0d['query'][_0x2a80('0xaf')]){_0x28002a[_0x2a80('0xb1')]({'model':db[_0x2a80('0x67')],'as':_0x2a80('0x67'),'raw':!![]});}var _0x3bc1fd=[{'model':db[_0x2a80('0x5c')],'as':_0x2a80('0x75'),'attributes':['id',_0x2a80('0x2d'),_0x2a80('0x82'),_0x2a80('0xb2'),'secret','read'],'include':_0x28002a}];_0x3bc1fd[_0x2a80('0xb1')]({'model':db[_0x2a80('0x77')],'as':_0x2a80('0xb3'),'attributes':['id',_0x2a80('0x2b')]});_0x3bc1fd[_0x2a80('0xb1')]({'model':db[_0x2a80('0x76')],'as':_0x2a80('0xb4'),'attributes':['id',_0x2a80('0x50')]});return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x59db0d[_0x2a80('0x45')]['id']},'include':_0x3bc1fd})[_0x2a80('0x28')](handleEntityNotFound(_0x2afa41,null))[_0x2a80('0x28')](function(_0x5ddf5c){if(_0x5ddf5c){var _0x4cc4ec=_0x5ddf5c[_0x2a80('0xb5')]({'plain':!![]});fs[_0x2a80('0xb6')](_0x988ee3);var _0x5d6ff2={'channel':_0x2a80('0xb7'),'account':_0x4cc4ec[_0x2a80('0xb3')][_0x2a80('0x2b')],'agent':_0x4cc4ec[_0x2a80('0xb4')]?_0x4cc4ec[_0x2a80('0xb4')][_0x2a80('0x50')]:_0x2a80('0xb8'),'createdAt':moment(_0x4cc4ec[_0x2a80('0x82')])[_0x2a80('0x72')](_0x2a80('0x98'))['toString'](),'closedAt':_0x4cc4ec[_0x2a80('0x61')]?moment(_0x4cc4ec[_0x2a80('0xb9')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4cc4ec[_0x2a80('0xba')],'chatInfo':{'browser':_0x4cc4ec['browserName'],'os':_0x4cc4ec['osName'],'referer':_0x4cc4ec['referer'],'customerIp':_0x4cc4ec[_0x2a80('0xbb')],'customerPort':_0x4cc4ec[_0x2a80('0xbc')]?_0x4cc4ec[_0x2a80('0xbc')]:'N.A.'},'messages':_(_0x4cc4ec[_0x2a80('0x75')])[_0x2a80('0xbd')]()['filter']({'secret':![]})[_0x2a80('0x33')](function(_0x3ec931){if(_0x3ec931[_0x2a80('0x67')]){var _0x1c5251=path[_0x2a80('0x6b')](_0x111dfe,_0x3ec931[_0x2a80('0x67')][_0x2a80('0x65')]);if(fs[_0x2a80('0xbe')](_0x1c5251)){fs[_0x2a80('0xbf')](_0x1c5251)[_0x2a80('0xc0')](fs[_0x2a80('0xc1')](path[_0x2a80('0x6b')](_0x988ee3,_0x3ec931['Attachment']['basename'])));}}return{'date':moment(_0x3ec931[_0x2a80('0x82')])[_0x2a80('0x72')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3ec931['direction']===_0x2a80('0x5b')?_0x3ec931[_0x2a80('0x76')]?_0x3ec931[_0x2a80('0x76')][_0x2a80('0x50')]:_0x2a80('0x7c'):_0x3ec931[_0x2a80('0xc2')][_0x2a80('0xc3')]+(_0x3ec931[_0x2a80('0xc2')][_0x2a80('0xc4')]?'\x20'+_0x3ec931[_0x2a80('0xc2')]['lastName']:''),'body':_0x3ec931[_0x2a80('0x67')]?_0x3ec931[_0x2a80('0x67')][_0x2a80('0x65')]:_0x3ec931[_0x2a80('0x2d')],'direction':_0x3ec931[_0x2a80('0xb2')]===_0x2a80('0x5b')?'A':'C','secret':_0x3ec931['secret'],'read':_0x3ec931[_0x2a80('0xc5')],'attachment':_0x3ec931[_0x2a80('0x67')]};})[_0x2a80('0xc6')]()};return ejs['renderFile'](path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],_0x2a80('0xad'),_0x2a80('0xc7'),_0x2a80('0xc8')),{'interaction':_0x5d6ff2})[_0x2a80('0x28')](function(_0x442201){var _0x5374e9=path[_0x2a80('0x6b')](_0x988ee3,_0x2a80('0xc9')+_0x4cc4ec['id']+'-'+_0x503f3d+_0x2a80('0xca'));var _0x15dc02={'path':_0x5374e9,'channel':_0x2a80('0xb7'),'interactionId':_0x4cc4ec['id']};return pdf[_0x2a80('0xcb')](_0x442201,_0x15dc02);})[_0x2a80('0x28')](function(){return new Promise(function(_0x1f9bf8,_0x3bd597){zipdir(_0x988ee3,{'saveTo':_0x46d2e2},function(_0x51ecb2,_0x4e524c){if(_0x51ecb2)return _0x3bd597(_0x51ecb2);return _0x1f9bf8(_0x4e524c);});})[_0x2a80('0x28')](function(){return new BPromise(function(_0x13a087,_0x1f77e2){rimraf(_0x988ee3,function(_0x3569d3){if(_0x3569d3)_0x1f77e2(_0x3569d3);return _0x13a087();});});})[_0x2a80('0x28')](function(){return _0x2afa41[_0x2a80('0x6f')](_0x46d2e2,_0xa7224b,function(_0x586217){if(_0x586217){logger[_0x2a80('0x18')](_0x2a80('0xcc'),_0x586217);}else{fs['unlinkSync'](_0x46d2e2);}});});});}else{return _0x2afa41[_0x2a80('0x1d')](0xc8);}})[_0x2a80('0x1c')](handleError(_0x2afa41,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index eee7c3c..daee97d 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 _0xc266=['save','update','remove','then','setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0xf9ca80,_0x2f344e){var _0x18b397=function(_0x4e5d5a){while(--_0x4e5d5a){_0xf9ca80['push'](_0xf9ca80['shift']());}};_0x18b397(++_0x2f344e);}(_0xc266,0xce));var _0x6c26=function(_0x36de9b,_0x5b9e9c){_0x36de9b=_0x36de9b-0x0;var _0x4baf2f=_0xc266[_0x36de9b];return _0x4baf2f;};'use strict';var EventEmitter=require(_0x6c26('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x6c26('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x6c26('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6c26('0x3')](0x0);var events={'afterCreate':_0x6c26('0x4'),'afterUpdate':_0x6c26('0x5'),'afterDestroy':_0x6c26('0x6')};function emitEvent(_0x1bbcbd){return function(_0x430ad5,_0x5409a9,_0x2a1c36){_0x430ad5['getUsers']({'attributes':['id'],'raw':!![]})[_0x6c26('0x7')](function(_0x491745){_0x430ad5[_0x6c26('0x8')]('Users',_0x491745['map'](function(_0x23f2f6){return{'id':_0x23f2f6['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x430ad5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x589d92){_0x430ad5[_0x6c26('0x8')](_0x6c26('0x9'),_0x589d92['length']);ChatInteractionEvents[_0x6c26('0xa')](_0x1bbcbd+':'+_0x430ad5['id'],_0x430ad5);ChatInteractionEvents[_0x6c26('0xa')](_0x1bbcbd,_0x430ad5);_0x2a1c36(null);})['catch'](_0x2a1c36(null));};}for(var e in events){if(events[_0x6c26('0xb')](e)){var event=events[e];ChatInteraction[_0x6c26('0xc')](e,emitEvent(event));}}module[_0x6c26('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x8b9b=['emit','hook','../../mysqldb','ChatInteraction','ChatMessage','save','update','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x14b72e,_0x3420ef){var _0x38fc95=function(_0x3a9c49){while(--_0x3a9c49){_0x14b72e['push'](_0x14b72e['shift']());}};_0x38fc95(++_0x3420ef);}(_0x8b9b,0x13a));var _0xb8b9=function(_0x31edbe,_0x34d231){_0x31edbe=_0x31edbe-0x0;var _0x37fcee=_0x8b9b[_0x31edbe];return _0x37fcee;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xb8b9('0x0'))['db'][_0xb8b9('0x1')];var ChatMessage=require(_0xb8b9('0x0'))['db'][_0xb8b9('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8b9('0x3'),'afterUpdate':_0xb8b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fae47){return function(_0x294d8a,_0x581e0a,_0x365739){_0x294d8a['getUsers']({'attributes':['id'],'raw':!![]})[_0xb8b9('0x5')](function(_0x281aca){_0x294d8a[_0xb8b9('0x6')]('Users',_0x281aca[_0xb8b9('0x7')](function(_0x3cae41){return{'id':_0x3cae41['id']};}));return ChatMessage[_0xb8b9('0x8')]({'where':{'ChatInteractionId':_0x294d8a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb8b9('0x5')](function(_0x3c5383){_0x294d8a['setDataValue'](_0xb8b9('0x9'),_0x3c5383[_0xb8b9('0xa')]);ChatInteractionEvents[_0xb8b9('0xb')](_0x2fae47+':'+_0x294d8a['id'],_0x294d8a);ChatInteractionEvents[_0xb8b9('0xb')](_0x2fae47,_0x294d8a);_0x365739(null);})['catch'](_0x365739(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xb8b9('0xc')](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 b32d101..e6023e9 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 _0xdc5b=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x5e44b2,_0x6e4873){var _0x268aa2=function(_0x55b3b0){while(--_0x55b3b0){_0x5e44b2['push'](_0x5e44b2['shift']());}};_0x268aa2(++_0x6e4873);}(_0xdc5b,0x14a));var _0xbdc5=function(_0x177515,_0x36b8bb){_0x177515=_0x177515-0x0;var _0xffbab4=_0xdc5b[_0x177515];return _0xffbab4;};'use strict';var _=require(_0xbdc5('0x0'));var util=require(_0xbdc5('0x1'));var logger=require(_0xbdc5('0x2'))(_0xbdc5('0x3'));var moment=require(_0xbdc5('0x4'));var BPromise=require(_0xbdc5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdc5('0x6'));var rimraf=require('rimraf');var config=require(_0xbdc5('0x7'));var attributes=require(_0xbdc5('0x8'));module[_0xbdc5('0x9')]=function(_0x147327,_0x122fdb){return _0x147327[_0xbdc5('0xa')](_0xbdc5('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a3d23,_0x51404c,_0x3ca856){if(_0x3a3d23[_0xbdc5('0xc')](_0xbdc5('0xd'))){_0x3a3d23[_0xbdc5('0xe')]=moment()['format'](_0xbdc5('0xf'));}_0x3ca856(null,_0x3a3d23);}},'charset':_0xbdc5('0x10'),'collate':_0xbdc5('0x11')});};
\ No newline at end of file
+var _0x7ce9=['define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x1155d7,_0x1cc6dd){var _0x5c2d4f=function(_0x437cac){while(--_0x437cac){_0x1155d7['push'](_0x1155d7['shift']());}};_0x5c2d4f(++_0x1cc6dd);}(_0x7ce9,0xd8));var _0x97ce=function(_0x21bad5,_0x23a39d){_0x21bad5=_0x21bad5-0x0;var _0x235106=_0x7ce9[_0x21bad5];return _0x235106;};'use strict';var _=require(_0x97ce('0x0'));var util=require(_0x97ce('0x1'));var logger=require('../../config/logger')(_0x97ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97ce('0x3'));var rimraf=require(_0x97ce('0x4'));var config=require(_0x97ce('0x5'));var attributes=require(_0x97ce('0x6'));module[_0x97ce('0x7')]=function(_0x3f37b9,_0x1894ec){return _0x3f37b9[_0x97ce('0x8')](_0x97ce('0x9'),attributes,{'tableName':_0x97ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24f548,_0xfa20e0,_0x344fc7){if(_0x24f548[_0x97ce('0xb')](_0x97ce('0xc'))){_0x24f548['closedAt']=moment()[_0x97ce('0xd')](_0x97ce('0xe'));}_0x344fc7(null,_0x24f548);}},'charset':'utf8mb4','collate':_0x97ce('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 38e40f2..90889b8 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 _0x0ec9=['ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','catch','lodash','util','moment'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x0ec9,0x78));var _0x90ec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ec9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x90ec('0x0'));var util=require(_0x90ec('0x1'));var moment=require(_0x90ec('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90ec('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90ec('0x4'));var config=require(_0x90ec('0x5'));var jayson=require(_0x90ec('0x6'));var client=jayson[_0x90ec('0x7')][_0x90ec('0x8')]({'port':0x232a});config[_0x90ec('0x9')]=_['defaults'](config[_0x90ec('0x9')],{'host':_0x90ec('0xa'),'port':0x18eb});var socket=require(_0x90ec('0xb'))(new Redis(config['redis']));require(_0x90ec('0xc'))[_0x90ec('0xd')](socket);function respondWithRpcPromise(_0x468339,_0x12f68f,_0x58d570){return new BPromise(function(_0x292b97,_0x1fa513){return client[_0x90ec('0xe')](_0x468339,_0x58d570)[_0x90ec('0xf')](function(_0x55c815){logger[_0x90ec('0x10')](_0x90ec('0x11'),_0x12f68f,_0x90ec('0x12'));logger[_0x90ec('0x13')](_0x90ec('0x14'),_0x12f68f,_0x90ec('0x12'),JSON['stringify'](_0x55c815));if(_0x55c815[_0x90ec('0x15')]){if(_0x55c815['error']['code']===0x1f4){logger[_0x90ec('0x15')](_0x90ec('0x11'),_0x12f68f,_0x55c815['error'][_0x90ec('0x16')]);return _0x1fa513(_0x55c815[_0x90ec('0x15')][_0x90ec('0x16')]);}logger[_0x90ec('0x15')](_0x90ec('0x11'),_0x12f68f,_0x55c815['error'][_0x90ec('0x16')]);return _0x292b97(_0x55c815[_0x90ec('0x15')][_0x90ec('0x16')]);}else{logger[_0x90ec('0x10')](_0x90ec('0x11'),_0x12f68f,'request\x20sent');_0x292b97(_0x55c815[_0x90ec('0x17')][_0x90ec('0x16')]);}})['catch'](function(_0x29e2da){logger[_0x90ec('0x15')](_0x90ec('0x11'),_0x12f68f,_0x29e2da);_0x1fa513(_0x29e2da);});});}exports[_0x90ec('0x18')]=function(_0xe57b9a){var _0x295d55=this;return new Promise(function(_0x5eb9b1,_0x3c8ef4){return db[_0x90ec('0x19')][_0x90ec('0x1a')](_0xe57b9a[_0x90ec('0x1b')],{'raw':_0xe57b9a['options']?_0xe57b9a[_0x90ec('0x1c')][_0x90ec('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe57b9a[_0x90ec('0x1c')]?_0xe57b9a[_0x90ec('0x1c')][_0x90ec('0x1e')]||null:null,'attributes':_0xe57b9a[_0x90ec('0x1c')]?_0xe57b9a[_0x90ec('0x1c')][_0x90ec('0x1f')]||null:null,'limit':_0xe57b9a[_0x90ec('0x1c')]?_0xe57b9a['options'][_0x90ec('0x20')]||null:null})[_0x90ec('0xf')](function(_0x3a91b1){logger['info'](_0x90ec('0x18'),_0xe57b9a);logger[_0x90ec('0x13')](_0x90ec('0x18'),_0xe57b9a,JSON[_0x90ec('0x21')](_0x3a91b1));_0x5eb9b1(_0x3a91b1);})['catch'](function(_0x16dd31){logger[_0x90ec('0x15')](_0x90ec('0x18'),_0x16dd31[_0x90ec('0x16')],_0xe57b9a);_0x3c8ef4(_0x295d55[_0x90ec('0x15')](0x1f4,_0x16dd31[_0x90ec('0x16')]));});});};exports[_0x90ec('0x22')]=function(_0x5ce21d){return new Promise(function(_0x21e09b,_0x2dc0d7){return db['ChatInteraction'][_0x90ec('0x23')]({'where':_0x5ce21d[_0x90ec('0x1c')]?_0x5ce21d[_0x90ec('0x1c')][_0x90ec('0x1e')]||null:null})['then'](function(_0x2f7e67){if(_0x2f7e67){return _0x2f7e67[_0x90ec('0x24')](_0x5ce21d[_0x90ec('0x1b')][_0x90ec('0x25')],_[_0x90ec('0x26')](_0x5ce21d[_0x90ec('0x1b')],[_0x90ec('0x25'),'id'])||{});}})['spread'](function(_0x2638fd){logger['info']('AddTags',_0x5ce21d);logger[_0x90ec('0x13')](_0x90ec('0x27'),_0x5ce21d,JSON[_0x90ec('0x21')](_0x2638fd));_0x21e09b(_0x2638fd);})[_0x90ec('0x28')](function(_0x3a9eb3){logger[_0x90ec('0x15')](_0x90ec('0x27'),_0x3a9eb3['message'],_0x5ce21d);_0x2dc0d7(_this['error'](0x1f4,_0x3a9eb3[_0x90ec('0x16')]));});});};
\ No newline at end of file
+var _0x0b76=['spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','ChatInteraction','update','raw','where','attributes','options','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','find','omit','body','ids'];(function(_0x33d22b,_0x30364b){var _0x2abcd5=function(_0x5d14da){while(--_0x5d14da){_0x33d22b['push'](_0x33d22b['shift']());}};_0x2abcd5(++_0x30364b);}(_0x0b76,0x1d6));var _0x60b7=function(_0x14682b,_0x32aa32){_0x14682b=_0x14682b-0x0;var _0x1fa061=_0x0b76[_0x14682b];return _0x1fa061;};'use strict';var _=require(_0x60b7('0x0'));var util=require(_0x60b7('0x1'));var moment=require(_0x60b7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x60b7('0x4'));var logger=require(_0x60b7('0x5'))('rpc');var config=require(_0x60b7('0x6'));var jayson=require(_0x60b7('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x60b7('0x8')]=_[_0x60b7('0x9')](config[_0x60b7('0x8')],{'host':_0x60b7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60b7('0x8')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x227b65,_0x2298a7,_0x2b9e56){return new BPromise(function(_0xff0a07,_0xc371e8){return client[_0x60b7('0xb')](_0x227b65,_0x2b9e56)[_0x60b7('0xc')](function(_0x56ab71){logger['info'](_0x60b7('0xd'),_0x2298a7,_0x60b7('0xe'));logger[_0x60b7('0xf')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2298a7,'request\x20sent',JSON['stringify'](_0x56ab71));if(_0x56ab71['error']){if(_0x56ab71[_0x60b7('0x10')][_0x60b7('0x11')]===0x1f4){logger[_0x60b7('0x10')](_0x60b7('0xd'),_0x2298a7,_0x56ab71[_0x60b7('0x10')][_0x60b7('0x12')]);return _0xc371e8(_0x56ab71[_0x60b7('0x10')]['message']);}logger[_0x60b7('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2298a7,_0x56ab71[_0x60b7('0x10')][_0x60b7('0x12')]);return _0xff0a07(_0x56ab71[_0x60b7('0x10')][_0x60b7('0x12')]);}else{logger['info'](_0x60b7('0xd'),_0x2298a7,_0x60b7('0xe'));_0xff0a07(_0x56ab71[_0x60b7('0x13')][_0x60b7('0x12')]);}})['catch'](function(_0x3414f3){logger[_0x60b7('0x10')](_0x60b7('0xd'),_0x2298a7,_0x3414f3);_0xc371e8(_0x3414f3);});});}exports['UpdateChatInteraction']=function(_0xc0f31){var _0x46a176=this;return new Promise(function(_0x1b59e7,_0x537605){return db[_0x60b7('0x14')][_0x60b7('0x15')](_0xc0f31['body'],{'raw':_0xc0f31['options']?_0xc0f31['options'][_0x60b7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc0f31['options']?_0xc0f31['options'][_0x60b7('0x17')]||null:null,'attributes':_0xc0f31['options']?_0xc0f31['options'][_0x60b7('0x18')]||null:null,'limit':_0xc0f31[_0x60b7('0x19')]?_0xc0f31[_0x60b7('0x19')]['limit']||null:null})[_0x60b7('0xc')](function(_0x1bdd64){logger['info'](_0x60b7('0x1a'),_0xc0f31);logger[_0x60b7('0xf')](_0x60b7('0x1a'),_0xc0f31,JSON[_0x60b7('0x1b')](_0x1bdd64));_0x1b59e7(_0x1bdd64);})[_0x60b7('0x1c')](function(_0x41a00b){logger[_0x60b7('0x10')](_0x60b7('0x1a'),_0x41a00b[_0x60b7('0x12')],_0xc0f31);_0x537605(_0x46a176[_0x60b7('0x10')](0x1f4,_0x41a00b[_0x60b7('0x12')]));});});};exports[_0x60b7('0x1d')]=function(_0x4aa7b4){return new Promise(function(_0x54a446,_0x522963){return db[_0x60b7('0x14')][_0x60b7('0x1e')]({'where':_0x4aa7b4[_0x60b7('0x19')]?_0x4aa7b4[_0x60b7('0x19')]['where']||null:null})[_0x60b7('0xc')](function(_0xce1570){if(_0xce1570){return _0xce1570['addTags'](_0x4aa7b4['body']['ids'],_[_0x60b7('0x1f')](_0x4aa7b4[_0x60b7('0x20')],[_0x60b7('0x21'),'id'])||{});}})[_0x60b7('0x22')](function(_0x1cb9bf){logger['info']('AddTags',_0x4aa7b4);logger[_0x60b7('0xf')](_0x60b7('0x23'),_0x4aa7b4,JSON['stringify'](_0x1cb9bf));_0x54a446(_0x1cb9bf);})['catch'](function(_0x2a5af0){logger['error']('AddTags',_0x2a5af0[_0x60b7('0x12')],_0x4aa7b4);_0x522963(_this[_0x60b7('0x10')](0x1f4,_0x2a5af0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 87519c4..864cce1 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 _0x06fb=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x44d0ae,_0x5448c1){var _0x1eb8ef=function(_0x5a31de){while(--_0x5a31de){_0x44d0ae['push'](_0x44d0ae['shift']());}};_0x1eb8ef(++_0x5448c1);}(_0x06fb,0xe9));var _0xb06f=function(_0x14bd32,_0x3ef7af){_0x14bd32=_0x14bd32-0x0;var _0x2dd6cb=_0x06fb[_0x14bd32];return _0x2dd6cb;};'use strict';var ChatInteractionEvents=require(_0xb06f('0x0'));var events=[_0xb06f('0x1'),_0xb06f('0x2'),_0xb06f('0x3')];function createListener(_0x5f6db4,_0x4d94c4){return function(_0x5646cf){_0x4d94c4[_0xb06f('0x4')](_0x5f6db4,_0x5646cf);};}function removeListener(_0x831385,_0x4fc6a5){return function(){ChatInteractionEvents[_0xb06f('0x5')](_0x831385,_0x4fc6a5);};}exports[_0xb06f('0x6')]=function(_0x4cf56d){for(var _0x25f1a3=0x0,_0x123fdd=events[_0xb06f('0x7')];_0x25f1a3<_0x123fdd;_0x25f1a3++){var _0x5910e8=events[_0x25f1a3];var _0x47a4b4=createListener(_0xb06f('0x8')+_0x5910e8,_0x4cf56d);ChatInteractionEvents['on'](_0x5910e8,_0x47a4b4);}};
\ No newline at end of file
+var _0x07ef=['save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x1aa825,_0x3c8504){var _0x18c654=function(_0x3aa5dc){while(--_0x3aa5dc){_0x1aa825['push'](_0x1aa825['shift']());}};_0x18c654(++_0x3c8504);}(_0x07ef,0x12d));var _0xf07e=function(_0x55c3d9,_0x3bf75c){_0x55c3d9=_0x55c3d9-0x0;var _0x19fd97=_0x07ef[_0x55c3d9];return _0x19fd97;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xf07e('0x0'),_0xf07e('0x1'),_0xf07e('0x2')];function createListener(_0x52d43b,_0x39aa77){return function(_0x245689){_0x39aa77[_0xf07e('0x3')](_0x52d43b,_0x245689);};}function removeListener(_0x1b282e,_0x1f8b13){return function(){ChatInteractionEvents[_0xf07e('0x4')](_0x1b282e,_0x1f8b13);};}exports['register']=function(_0x1cabd8){for(var _0x3f685a=0x0,_0x151a67=events[_0xf07e('0x5')];_0x3f685a<_0x151a67;_0x3f685a++){var _0x34c899=events[_0x3f685a];var _0x471e1d=createListener(_0xf07e('0x6')+_0x34c899,_0x1cabd8);ChatInteractionEvents['on'](_0x34c899,_0x471e1d);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 16b76be..943d114 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 _0x5796=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','chatinteraction:addtags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0x5796,0x13a));var _0x6579=function(_0x22eefc,_0x138cff){_0x22eefc=_0x22eefc-0x0;var _0x10597e=_0x5796[_0x22eefc];return _0x10597e;};'use strict';var multer=require('multer');var util=require(_0x6579('0x0'));var path=require('path');var timeout=require(_0x6579('0x1'));var express=require(_0x6579('0x2'));var router=express[_0x6579('0x3')]();var fs_extra=require(_0x6579('0x4'));var auth=require(_0x6579('0x5'));var interaction=require(_0x6579('0x6'));var config=require(_0x6579('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x6579('0x8')](),controller[_0x6579('0x9')]);router[_0x6579('0xa')](_0x6579('0xb'),auth[_0x6579('0x8')](),controller[_0x6579('0xc')]);router[_0x6579('0xa')](_0x6579('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x6579('0xe')]);router[_0x6579('0xa')]('/:id/attachment_download',auth[_0x6579('0xf')](),controller[_0x6579('0x10')]);router[_0x6579('0xa')](_0x6579('0x11'),auth[_0x6579('0x8')](),controller[_0x6579('0x12')]);router[_0x6579('0xa')](_0x6579('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x6579('0x14')]);router['get'](_0x6579('0x15'),auth[_0x6579('0x8')](),controller[_0x6579('0x16')]);router[_0x6579('0x17')]('/',auth[_0x6579('0x8')](),controller['create']);router[_0x6579('0x17')](_0x6579('0x18'),auth[_0x6579('0x8')](),controller[_0x6579('0x19')]);var upload=multer({'storage':multer[_0x6579('0x1a')]({'destination':function(_0x395e85,_0x5d0ff0,_0xb0a5c7){_0xb0a5c7(null,path['join'](config['root'],_0x6579('0x1b')));},'filename':function(_0x140665,_0x69688d,_0x22ae45){_0x22ae45(null,util[_0x6579('0x1c')](_0x6579('0x1d'),Date[_0x6579('0x1e')](),_0x69688d[_0x6579('0x1f')][_0x6579('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6579('0x17')](_0x6579('0x21'),upload[_0x6579('0x22')](_0x6579('0x23')),controller[_0x6579('0x24')]);router['post'](_0x6579('0x11'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x6579('0x17')](_0x6579('0x25'),auth[_0x6579('0x8')](),interaction['tracked']('chat',_0x6579('0x26')),controller['addTags']);router[_0x6579('0x27')]('/:id',auth[_0x6579('0x8')](),interaction[_0x6579('0x28')](_0x6579('0x29'),_0x6579('0x2a')),controller[_0x6579('0x2b')]);router[_0x6579('0x27')](_0x6579('0x2c'),controller[_0x6579('0x2d')]);router['put'](_0x6579('0x2e'),auth[_0x6579('0xf')](),controller[_0x6579('0x2f')]);router['put'](_0x6579('0x30'),controller[_0x6579('0x31')]);router[_0x6579('0x32')](_0x6579('0xd'),auth[_0x6579('0x8')](),interaction[_0x6579('0x28')]('chat','chatinteraction:destroy'),controller[_0x6579('0x33')]);router['delete']('/:id/tags',auth[_0x6579('0x8')](),controller['removeTags']);module[_0x6579('0x34')]=router;
\ No newline at end of file
+var _0xc03d=['path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chat','chatinteraction:update','update','customUpdate','abandon','delete','chatinteraction:destroy','destroy','removeTags','exports','util'];(function(_0x53be66,_0x9ec3be){var _0x9e5520=function(_0x5c4742){while(--_0x5c4742){_0x53be66['push'](_0x53be66['shift']());}};_0x9e5520(++_0x9ec3be);}(_0xc03d,0xf4));var _0xdc03=function(_0x38ef05,_0x39b256){_0x38ef05=_0x38ef05-0x0;var _0x4352a4=_0xc03d[_0x38ef05];return _0x4352a4;};'use strict';var multer=require('multer');var util=require(_0xdc03('0x0'));var path=require(_0xdc03('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc03('0x2'));var router=express[_0xdc03('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdc03('0x4'));var interaction=require(_0xdc03('0x5'));var config=require('../../config/environment');var controller=require(_0xdc03('0x6'));router[_0xdc03('0x7')]('/',auth[_0xdc03('0x8')](),controller['index']);router[_0xdc03('0x7')](_0xdc03('0x9'),auth['isAuthenticated'](),controller[_0xdc03('0xa')]);router[_0xdc03('0x7')]('/:id',auth[_0xdc03('0xb')](),controller['show']);router[_0xdc03('0x7')](_0xdc03('0xc'),auth[_0xdc03('0xb')](),controller['attachmentDownload']);router['get'](_0xdc03('0xd'),auth[_0xdc03('0x8')](),controller[_0xdc03('0xe')]);router[_0xdc03('0x7')]('/:id/my_messages',auth[_0xdc03('0xb')](),controller[_0xdc03('0xf')]);router[_0xdc03('0x7')](_0xdc03('0x10'),auth['isAuthenticated'](),controller[_0xdc03('0x11')]);router[_0xdc03('0x12')]('/',auth[_0xdc03('0x8')](),controller[_0xdc03('0x13')]);router[_0xdc03('0x12')](_0xdc03('0x14'),auth[_0xdc03('0x8')](),controller[_0xdc03('0x15')]);var upload=multer({'storage':multer[_0xdc03('0x16')]({'destination':function(_0x560650,_0x18035f,_0xa6b666){_0xa6b666(null,path[_0xdc03('0x17')](config[_0xdc03('0x18')],_0xdc03('0x19')));},'filename':function(_0x1b738b,_0x3c1899,_0x78c27b){_0x78c27b(null,util[_0xdc03('0x1a')](_0xdc03('0x1b'),Date[_0xdc03('0x1c')](),_0x3c1899['originalname'][_0xdc03('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdc03('0x12')](_0xdc03('0x1e'),upload[_0xdc03('0x1f')]('file'),controller[_0xdc03('0x20')]);router[_0xdc03('0x12')](_0xdc03('0xd'),auth[_0xdc03('0xb')](),controller[_0xdc03('0x21')]);router[_0xdc03('0x12')](_0xdc03('0x22'),auth['isAuthenticated'](),interaction[_0xdc03('0x23')]('chat',_0xdc03('0x24')),controller['addTags']);router[_0xdc03('0x25')](_0xdc03('0x26'),auth[_0xdc03('0x8')](),interaction[_0xdc03('0x23')](_0xdc03('0x27'),_0xdc03('0x28')),controller[_0xdc03('0x29')]);router['put']('/:id/custom_update',controller[_0xdc03('0x2a')]);router[_0xdc03('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xdc03('0x2b')]);router[_0xdc03('0x25')]('/:id/close',controller['close']);router[_0xdc03('0x2c')](_0xdc03('0x26'),auth[_0xdc03('0x8')](),interaction['tracked'](_0xdc03('0x27'),_0xdc03('0x2d')),controller[_0xdc03('0x2e')]);router[_0xdc03('0x2c')](_0xdc03('0x22'),auth[_0xdc03('0x8')](),controller[_0xdc03('0x2f')]);module[_0xdc03('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 521b2da..31c8b44 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 _0x8471=['BOOLEAN','INTEGER','exports','medium'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x8471,0x17a));var _0x1847=function(_0x2eabe6,_0x487ef6){_0x2eabe6=_0x2eabe6-0x0;var _0x3a5d65=_0x8471[_0x2eabe6];return _0x3a5d65;};'use strict';var Sequelize=require('sequelize');module[_0x1847('0x0')]={'body':{'type':Sequelize['TEXT'](_0x1847('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x1847('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1847('0x3')]}};
\ No newline at end of file
+var _0x8dc7=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x2b1d63,_0x143c51){var _0x56dec0=function(_0x5dad38){while(--_0x5dad38){_0x2b1d63['push'](_0x2b1d63['shift']());}};_0x56dec0(++_0x143c51);}(_0x8dc7,0x1b5));var _0x78dc=function(_0x1da56b,_0x356602){_0x1da56b=_0x1da56b-0x0;var _0x51e2ba=_0x8dc7[_0x1da56b];return _0x51e2ba;};'use strict';var Sequelize=require(_0x78dc('0x0'));module[_0x78dc('0x1')]={'body':{'type':Sequelize[_0x78dc('0x2')](_0x78dc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x78dc('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x78dc('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 5df6179..046bd8e 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 _0xbaa0=['online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','find','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','ChatInternalMessage','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','keys','rawAttributes','includeAll','create','body','update','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','userpic','internal'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0xbaa0,0x179));var _0x0baa=function(_0x35df91,_0x32a05a){_0x35df91=_0x35df91-0x0;var _0x17154a=_0xbaa0[_0x35df91];return _0x17154a;};'use strict';var emlformat=require(_0x0baa('0x0'));var rimraf=require(_0x0baa('0x1'));var zipdir=require(_0x0baa('0x2'));var jsonpatch=require(_0x0baa('0x3'));var rp=require(_0x0baa('0x4'));var moment=require(_0x0baa('0x5'));var BPromise=require(_0x0baa('0x6'));var Mustache=require(_0x0baa('0x7'));var util=require(_0x0baa('0x8'));var path=require(_0x0baa('0x9'));var sox=require(_0x0baa('0xa'));var csv=require(_0x0baa('0xb'));var ejs=require(_0x0baa('0xc'));var fs=require('fs');var fs_extra=require(_0x0baa('0xd'));var _=require(_0x0baa('0xe'));var squel=require('squel');var crypto=require(_0x0baa('0xf'));var jsforce=require(_0x0baa('0x10'));var deskjs=require(_0x0baa('0x11'));var toCsv=require(_0x0baa('0xb'));var querystring=require(_0x0baa('0x12'));var Papa=require('papaparse');var Redis=require(_0x0baa('0x13'));var authService=require(_0x0baa('0x14'));var qs=require(_0x0baa('0x15'));var as=require(_0x0baa('0x16'));var hardwareService=require(_0x0baa('0x17'));var logger=require(_0x0baa('0x18'))(_0x0baa('0x19'));var utils=require(_0x0baa('0x1a'));var config=require(_0x0baa('0x1b'));var licenseUtil=require(_0x0baa('0x1c'));var db=require('../../mysqldb')['db'];config[_0x0baa('0x1d')]=_[_0x0baa('0x1e')](config[_0x0baa('0x1d')],{'host':_0x0baa('0x1f'),'port':0x18eb});var socket=require(_0x0baa('0x20'))(new Redis(config[_0x0baa('0x1d')]));require(_0x0baa('0x21'))[_0x0baa('0x22')](socket);function respondWithStatusCode(_0x2513b1,_0x126193){_0x126193=_0x126193||0xcc;return function(_0x32f2f0){if(_0x32f2f0){return _0x2513b1[_0x0baa('0x23')](_0x126193);}return _0x2513b1['status'](_0x126193)[_0x0baa('0x24')]();};}function respondWithResult(_0x5bd72f,_0x125dd5){_0x125dd5=_0x125dd5||0xc8;return function(_0xfa0782){if(_0xfa0782){return _0x5bd72f['status'](_0x125dd5)[_0x0baa('0x25')](_0xfa0782);}};}function respondWithFilteredResult(_0x413403,_0x5efef8){return function(_0x4d637d){if(_0x4d637d){var _0x3ce01b=typeof _0x5efef8[_0x0baa('0x26')]===_0x0baa('0x27')&&typeof _0x5efef8[_0x0baa('0x28')]===_0x0baa('0x27');var _0x53b92a=_0x4d637d[_0x0baa('0x29')];var _0x50a4ad=_0x3ce01b?0x0:_0x5efef8[_0x0baa('0x26')];var _0x5b38ea=_0x3ce01b?_0x4d637d[_0x0baa('0x29')]:_0x5efef8[_0x0baa('0x26')]+_0x5efef8['limit'];var _0x3cf7c6;if(_0x5b38ea>=_0x53b92a){_0x5b38ea=_0x53b92a;_0x3cf7c6=0xc8;}else{_0x3cf7c6=0xce;}_0x413403[_0x0baa('0x2a')](_0x3cf7c6);return _0x413403[_0x0baa('0x2b')](_0x0baa('0x2c'),_0x50a4ad+'-'+_0x5b38ea+'/'+_0x53b92a)[_0x0baa('0x25')](_0x4d637d);}return null;};}function patchUpdates(_0x2257a1){return function(_0x1eee0c){try{jsonpatch[_0x0baa('0x2d')](_0x1eee0c,_0x2257a1,!![]);}catch(_0x29b305){return BPromise[_0x0baa('0x2e')](_0x29b305);}return _0x1eee0c[_0x0baa('0x2f')]();};}function saveUpdates(_0x9b0f7e,_0x1d29c2){return function(_0x1b6144){if(_0x1b6144){return _0x1b6144['update'](_0x9b0f7e)[_0x0baa('0x30')](function(_0x47b785){return _0x47b785;});}return null;};}function removeEntity(_0x5e0e68,_0x2f41d1){return function(_0x3695f4){if(_0x3695f4){return _0x3695f4[_0x0baa('0x31')]()[_0x0baa('0x30')](function(){_0x5e0e68[_0x0baa('0x2a')](0xcc)[_0x0baa('0x24')]();});}};}function handleEntityNotFound(_0xd0996f,_0x536470){return function(_0x16bed1){if(!_0x16bed1){_0xd0996f[_0x0baa('0x23')](0x194);}return _0x16bed1;};}function handleError(_0x285671,_0x1e197f){_0x1e197f=_0x1e197f||0x1f4;return function(_0x4daa86){logger['error'](_0x4daa86[_0x0baa('0x32')]);if(_0x4daa86[_0x0baa('0x33')]){delete _0x4daa86['name'];}_0x285671['status'](_0x1e197f)[_0x0baa('0x34')](_0x4daa86);};}exports['index']=function(_0x52df32,_0x538d7b){var _0x41e3fd={},_0xab4cff={},_0x359c87={'count':0x0,'rows':[]};var _0x3e5f16=_['map'](db[_0x0baa('0x35')]['rawAttributes'],function(_0xd62d31){return{'name':_0xd62d31['fieldName'],'type':_0xd62d31[_0x0baa('0x36')][_0x0baa('0x37')]};});_0xab4cff[_0x0baa('0x38')]=_[_0x0baa('0x39')](_0x3e5f16,_0x0baa('0x33'));_0xab4cff[_0x0baa('0x3a')]=_['keys'](_0x52df32[_0x0baa('0x3a')]);_0xab4cff[_0x0baa('0x3b')]=_['intersection'](_0xab4cff['model'],_0xab4cff[_0x0baa('0x3a')]);_0x41e3fd[_0x0baa('0x3c')]=_[_0x0baa('0x3d')](_0xab4cff['model'],qs[_0x0baa('0x3e')](_0x52df32[_0x0baa('0x3a')][_0x0baa('0x3e')]));_0x41e3fd[_0x0baa('0x3c')]=_0x41e3fd[_0x0baa('0x3c')][_0x0baa('0x3f')]?_0x41e3fd[_0x0baa('0x3c')]:_0xab4cff[_0x0baa('0x38')];if(!_0x52df32['query'][_0x0baa('0x40')](_0x0baa('0x41'))){_0x41e3fd['limit']=qs[_0x0baa('0x28')](_0x52df32[_0x0baa('0x3a')]['limit']);_0x41e3fd[_0x0baa('0x26')]=qs[_0x0baa('0x26')](_0x52df32[_0x0baa('0x3a')][_0x0baa('0x26')]);}_0x41e3fd[_0x0baa('0x42')]=qs[_0x0baa('0x43')](_0x52df32['query'][_0x0baa('0x43')]);_0x41e3fd[_0x0baa('0x44')]=qs[_0x0baa('0x3b')](_[_0x0baa('0x45')](_0x52df32[_0x0baa('0x3a')],_0xab4cff[_0x0baa('0x3b')]),_0x3e5f16);if(_0x52df32[_0x0baa('0x3a')][_0x0baa('0x46')]){_0x41e3fd['where']=_[_0x0baa('0x47')](_0x41e3fd[_0x0baa('0x44')],{'$or':_[_0x0baa('0x39')](_0x3e5f16,function(_0x12a1cd){if(_0x12a1cd[_0x0baa('0x36')]!=='VIRTUAL'){var _0x35911f={};_0x35911f[_0x12a1cd[_0x0baa('0x33')]]={'$like':'%'+_0x52df32[_0x0baa('0x3a')][_0x0baa('0x46')]+'%'};return _0x35911f;}})});}_0x41e3fd=_[_0x0baa('0x47')]({},_0x41e3fd,_0x52df32[_0x0baa('0x48')]);var _0x4c8953={'where':_0x41e3fd[_0x0baa('0x44')]};return db['ChatInternalMessage']['count'](_0x4c8953)[_0x0baa('0x30')](function(_0x99389f){_0x359c87[_0x0baa('0x29')]=_0x99389f;if(_0x52df32[_0x0baa('0x3a')]['includeAll']){_0x41e3fd[_0x0baa('0x49')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x0baa('0x4a')](_0x41e3fd);})[_0x0baa('0x30')](function(_0x403527){_0x359c87[_0x0baa('0x4b')]=_0x403527;return _0x359c87;})[_0x0baa('0x30')](respondWithFilteredResult(_0x538d7b,_0x41e3fd))[_0x0baa('0x4c')](handleError(_0x538d7b,null));};exports['show']=function(_0xf6a497,_0x2606d4){var _0x2e6e5e={'raw':!![],'where':{'id':_0xf6a497['params']['id']}},_0x195fcf={};_0x195fcf['model']=_[_0x0baa('0x4d')](db[_0x0baa('0x35')][_0x0baa('0x4e')]);_0x195fcf[_0x0baa('0x3a')]=_[_0x0baa('0x4d')](_0xf6a497[_0x0baa('0x3a')]);_0x195fcf[_0x0baa('0x3b')]=_[_0x0baa('0x3d')](_0x195fcf[_0x0baa('0x38')],_0x195fcf['query']);_0x2e6e5e[_0x0baa('0x3c')]=_[_0x0baa('0x3d')](_0x195fcf[_0x0baa('0x38')],qs[_0x0baa('0x3e')](_0xf6a497[_0x0baa('0x3a')][_0x0baa('0x3e')]));_0x2e6e5e[_0x0baa('0x3c')]=_0x2e6e5e[_0x0baa('0x3c')][_0x0baa('0x3f')]?_0x2e6e5e['attributes']:_0x195fcf[_0x0baa('0x38')];if(_0xf6a497[_0x0baa('0x3a')][_0x0baa('0x4f')]){_0x2e6e5e[_0x0baa('0x49')]=[{'all':!![]}];}_0x2e6e5e=_[_0x0baa('0x47')]({},_0x2e6e5e,_0xf6a497[_0x0baa('0x48')]);return db[_0x0baa('0x35')]['find'](_0x2e6e5e)[_0x0baa('0x30')](handleEntityNotFound(_0x2606d4,null))[_0x0baa('0x30')](respondWithResult(_0x2606d4,null))[_0x0baa('0x4c')](handleError(_0x2606d4,null));};exports['create']=function(_0xe2f007,_0x372f21){return db[_0x0baa('0x35')][_0x0baa('0x50')](_0xe2f007[_0x0baa('0x51')],{})['then'](respondWithResult(_0x372f21,0xc9))[_0x0baa('0x4c')](handleError(_0x372f21,null));};exports[_0x0baa('0x52')]=function(_0x4c1625,_0xd172d7){if(_0x4c1625['body']['id']){delete _0x4c1625[_0x0baa('0x51')]['id'];}return db[_0x0baa('0x35')]['find']({'where':{'id':_0x4c1625[_0x0baa('0x53')]['id']}})[_0x0baa('0x30')](handleEntityNotFound(_0xd172d7,null))['then'](saveUpdates(_0x4c1625[_0x0baa('0x51')],null))['then'](respondWithResult(_0xd172d7,null))['catch'](handleError(_0xd172d7,null));};exports['destroy']=function(_0x1770fc,_0x534c22){return db['ChatInternalMessage']['find']({'where':{'id':_0x1770fc[_0x0baa('0x53')]['id']}})[_0x0baa('0x30')](handleEntityNotFound(_0x534c22,null))[_0x0baa('0x30')](removeEntity(_0x534c22,null))[_0x0baa('0x4c')](handleError(_0x534c22,null));};exports[_0x0baa('0x54')]=function(_0x10b14a,_0x1a9bd2){return db['ChatInternalMessage'][_0x0baa('0x54')]()['then'](respondWithResult(_0x1a9bd2,null))[_0x0baa('0x4c')](handleError(_0x1a9bd2,null));};function wrapUser(_0x17918c){return function(_0x41656f){var _0x225dff=_0x17918c[_0x0baa('0x55')]({'plain':!![]});_0x225dff[_0x0baa('0x56')]=[];if(_0x41656f){_0x225dff[_0x0baa('0x57')]=_0x41656f[_0x0baa('0x58')];_0x225dff[_0x0baa('0x59')]=_0x41656f;}else{_0x225dff[_0x0baa('0x57')]=moment(0x0)[_0x0baa('0x5a')](_0x0baa('0x5b'));_0x225dff[_0x0baa('0x59')]={};}return _0x225dff;};}exports[_0x0baa('0x5c')]=function(_0x475e11,_0x45aa68,_0x2521ed){var _0x5bb59b=[];return db[_0x0baa('0x5d')]['findAll']({'where':{'role':[_0x0baa('0x5e'),'admin',_0x0baa('0x5f')]},'attributes':['id',_0x0baa('0x60'),'name','role',_0x0baa('0x61'),_0x0baa('0x62'),_0x0baa('0x63'),_0x0baa('0x64'),_0x0baa('0x65'),_0x0baa('0x66')],'order':qs[_0x0baa('0x43')](_0x0baa('0x67')),'include':[{'model':db[_0x0baa('0x68')],'as':_0x0baa('0x69'),'attributes':['id',_0x0baa('0x33'),_0x0baa('0x36')],'through':{'attributes':[]}}]})[_0x0baa('0x30')](function(_0x5a5ddd){if(_0x5a5ddd){var _0x47ad81=_0x475e11[_0x0baa('0x5f')][_0x0baa('0x55')]({'plain':!![]});if(!_0x47ad81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47ad81[_0x0baa('0x6a')]===_0x0baa('0x5f')){return db[_0x0baa('0x6b')]['find']({'where':{'name':_0x0baa('0x6c'),'userProfileId':_0x47ad81[_0x0baa('0x6d')]},'raw':!![]})[_0x0baa('0x30')](function(_0x2a50bb){if(_0x2a50bb){if(_0x2a50bb[_0x0baa('0x6e')]===0x0){return db['UserProfileResource'][_0x0baa('0x4a')]({'where':{'sectionId':_0x2a50bb['id']},'raw':!![]})[_0x0baa('0x30')](function(_0x201f86){var _0x447ad5=[];if(_[_0x0baa('0x6f')](_0x201f86)){_0x447ad5=_[_0x0baa('0x46')](_0x5a5ddd,function(_0x1fa910){if(_0x1fa910[_0x0baa('0x6a')]!==_0x0baa('0x5e')){return _0x1fa910;}});return _0x447ad5;}else{for(var _0x5df157=0x0;_0x5df157<_0x5a5ddd[_0x0baa('0x3f')];_0x5df157++){var _0x5c4eec=_0x5a5ddd[_0x5df157];if(_0x5c4eec['role']===_0x0baa('0x5e')){var _0x5e01db=_[_0x0baa('0x70')](_0x201f86,function(_0xee9f65){return _0xee9f65['resourceId']===_0x5c4eec['id'];});if(_0x5e01db)_0x447ad5['push'](_0x5c4eec);}else{_0x447ad5[_0x0baa('0x71')](_0x5c4eec);}}return _0x447ad5;}});}else{return _0x5a5ddd;}}else{var _0x2b3bb3=_['filter'](_0x5a5ddd,function(_0x1d962d){if(_0x1d962d[_0x0baa('0x6a')]!==_0x0baa('0x5e')){return _0x1d962d;}});return _0x2b3bb3;}});}else{return _0x5a5ddd;}}})[_0x0baa('0x30')](function(_0x18f425){var _0x250577=[];if(_0x18f425){_0x5bb59b=_0x18f425;for(var _0x4f656a=0x0;_0x4f656a<_0x18f425[_0x0baa('0x3f')];_0x4f656a+=0x1){_0x5bb59b[_0x4f656a][_0x0baa('0x56')]=[];_0x250577[_0x0baa('0x71')](db[_0x0baa('0x35')]['find']({'where':{'FromId':[_0x475e11[_0x0baa('0x5f')]['id'],_0x18f425[_0x4f656a]['id']],'ToId':[_0x475e11[_0x0baa('0x5f')]['id'],_0x18f425[_0x4f656a]['id']],'ChatGroupId':null},'attributes':['id',_0x0baa('0x58'),_0x0baa('0x72'),_0x0baa('0x73'),_0x0baa('0x74'),'body'],'order':qs['sort'](_0x0baa('0x75')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0baa('0x30')](wrapUser(_0x18f425[_0x4f656a])));}return BPromise[_0x0baa('0x76')](_0x250577);}return[];})[_0x0baa('0x30')](function(_0x153dfe){return{'rows':_0x153dfe,'count':_0x153dfe[_0x0baa('0x3f')]};})['then'](respondWithResult(_0x45aa68,null))[_0x0baa('0x4c')](handleError(_0x45aa68,null));};
\ No newline at end of file
+var _0x5a92=['UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x1a8b6f,_0x3aebf7){var _0x2f8ff2=function(_0x47f677){while(--_0x47f677){_0x1a8b6f['push'](_0x1a8b6f['shift']());}};_0x2f8ff2(++_0x3aebf7);}(_0x5a92,0x75));var _0x25a9=function(_0x591583,_0x255a3e){_0x591583=_0x591583-0x0;var _0x345ddd=_0x5a92[_0x591583];return _0x345ddd;};'use strict';var emlformat=require(_0x25a9('0x0'));var rimraf=require(_0x25a9('0x1'));var zipdir=require(_0x25a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25a9('0x3'));var moment=require(_0x25a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x25a9('0x5'));var util=require(_0x25a9('0x6'));var path=require('path');var sox=require(_0x25a9('0x7'));var csv=require(_0x25a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25a9('0x9'));var squel=require('squel');var crypto=require(_0x25a9('0xa'));var jsforce=require(_0x25a9('0xb'));var deskjs=require(_0x25a9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x25a9('0xd'));var Papa=require(_0x25a9('0xe'));var Redis=require(_0x25a9('0xf'));var authService=require(_0x25a9('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25a9('0x11'));var logger=require(_0x25a9('0x12'))(_0x25a9('0x13'));var utils=require(_0x25a9('0x14'));var config=require(_0x25a9('0x15'));var licenseUtil=require(_0x25a9('0x16'));var db=require('../../mysqldb')['db'];config[_0x25a9('0x17')]=_[_0x25a9('0x18')](config[_0x25a9('0x17')],{'host':_0x25a9('0x19'),'port':0x18eb});var socket=require(_0x25a9('0x1a'))(new Redis(config[_0x25a9('0x17')]));require(_0x25a9('0x1b'))['register'](socket);function respondWithStatusCode(_0x47e807,_0x3e0608){_0x3e0608=_0x3e0608||0xcc;return function(_0x19addf){if(_0x19addf){return _0x47e807[_0x25a9('0x1c')](_0x3e0608);}return _0x47e807[_0x25a9('0x1d')](_0x3e0608)[_0x25a9('0x1e')]();};}function respondWithResult(_0x714890,_0x99d906){_0x99d906=_0x99d906||0xc8;return function(_0x5f3cd0){if(_0x5f3cd0){return _0x714890['status'](_0x99d906)['json'](_0x5f3cd0);}};}function respondWithFilteredResult(_0x7e31e0,_0x346591){return function(_0x41ecf2){if(_0x41ecf2){var _0x544cda=typeof _0x346591[_0x25a9('0x1f')]===_0x25a9('0x20')&&typeof _0x346591[_0x25a9('0x21')]===_0x25a9('0x20');var _0x4b54b0=_0x41ecf2[_0x25a9('0x22')];var _0x3d0c31=_0x544cda?0x0:_0x346591[_0x25a9('0x1f')];var _0x3dd674=_0x544cda?_0x41ecf2['count']:_0x346591[_0x25a9('0x1f')]+_0x346591['limit'];var _0x1621f1;if(_0x3dd674>=_0x4b54b0){_0x3dd674=_0x4b54b0;_0x1621f1=0xc8;}else{_0x1621f1=0xce;}_0x7e31e0['status'](_0x1621f1);return _0x7e31e0[_0x25a9('0x23')](_0x25a9('0x24'),_0x3d0c31+'-'+_0x3dd674+'/'+_0x4b54b0)[_0x25a9('0x25')](_0x41ecf2);}return null;};}function patchUpdates(_0x53c73f){return function(_0x3998d7){try{jsonpatch['apply'](_0x3998d7,_0x53c73f,!![]);}catch(_0x436e48){return BPromise[_0x25a9('0x26')](_0x436e48);}return _0x3998d7[_0x25a9('0x27')]();};}function saveUpdates(_0x1ac89e,_0x17dac6){return function(_0x271586){if(_0x271586){return _0x271586['update'](_0x1ac89e)[_0x25a9('0x28')](function(_0x468964){return _0x468964;});}return null;};}function removeEntity(_0x360c74,_0x5e660a){return function(_0x515c2e){if(_0x515c2e){return _0x515c2e[_0x25a9('0x29')]()[_0x25a9('0x28')](function(){_0x360c74['status'](0xcc)[_0x25a9('0x1e')]();});}};}function handleEntityNotFound(_0x5b4931,_0x279672){return function(_0x2622f8){if(!_0x2622f8){_0x5b4931['sendStatus'](0x194);}return _0x2622f8;};}function handleError(_0x1c0641,_0x1e35ba){_0x1e35ba=_0x1e35ba||0x1f4;return function(_0x3c1d81){logger[_0x25a9('0x2a')](_0x3c1d81['stack']);if(_0x3c1d81[_0x25a9('0x2b')]){delete _0x3c1d81['name'];}_0x1c0641[_0x25a9('0x1d')](_0x1e35ba)[_0x25a9('0x2c')](_0x3c1d81);};}exports[_0x25a9('0x2d')]=function(_0x10166b,_0x308c5e){var _0x9a02a2={},_0x127987={},_0x132f5a={'count':0x0,'rows':[]};var _0x2e725d=_['map'](db[_0x25a9('0x2e')][_0x25a9('0x2f')],function(_0x1e605d){return{'name':_0x1e605d[_0x25a9('0x30')],'type':_0x1e605d[_0x25a9('0x31')][_0x25a9('0x32')]};});_0x127987[_0x25a9('0x33')]=_[_0x25a9('0x34')](_0x2e725d,_0x25a9('0x2b'));_0x127987[_0x25a9('0x35')]=_['keys'](_0x10166b[_0x25a9('0x35')]);_0x127987[_0x25a9('0x36')]=_[_0x25a9('0x37')](_0x127987[_0x25a9('0x33')],_0x127987[_0x25a9('0x35')]);_0x9a02a2[_0x25a9('0x38')]=_['intersection'](_0x127987[_0x25a9('0x33')],qs[_0x25a9('0x39')](_0x10166b[_0x25a9('0x35')][_0x25a9('0x39')]));_0x9a02a2['attributes']=_0x9a02a2[_0x25a9('0x38')][_0x25a9('0x3a')]?_0x9a02a2[_0x25a9('0x38')]:_0x127987[_0x25a9('0x33')];if(!_0x10166b[_0x25a9('0x35')]['hasOwnProperty'](_0x25a9('0x3b'))){_0x9a02a2[_0x25a9('0x21')]=qs[_0x25a9('0x21')](_0x10166b[_0x25a9('0x35')][_0x25a9('0x21')]);_0x9a02a2[_0x25a9('0x1f')]=qs[_0x25a9('0x1f')](_0x10166b[_0x25a9('0x35')]['offset']);}_0x9a02a2['order']=qs[_0x25a9('0x3c')](_0x10166b[_0x25a9('0x35')][_0x25a9('0x3c')]);_0x9a02a2[_0x25a9('0x3d')]=qs[_0x25a9('0x36')](_[_0x25a9('0x3e')](_0x10166b[_0x25a9('0x35')],_0x127987[_0x25a9('0x36')]),_0x2e725d);if(_0x10166b[_0x25a9('0x35')][_0x25a9('0x3f')]){_0x9a02a2['where']=_['merge'](_0x9a02a2[_0x25a9('0x3d')],{'$or':_['map'](_0x2e725d,function(_0x56207b){if(_0x56207b[_0x25a9('0x31')]!==_0x25a9('0x40')){var _0x4ab1e2={};_0x4ab1e2[_0x56207b[_0x25a9('0x2b')]]={'$like':'%'+_0x10166b[_0x25a9('0x35')]['filter']+'%'};return _0x4ab1e2;}})});}_0x9a02a2=_[_0x25a9('0x41')]({},_0x9a02a2,_0x10166b[_0x25a9('0x42')]);var _0x455888={'where':_0x9a02a2[_0x25a9('0x3d')]};return db[_0x25a9('0x2e')][_0x25a9('0x22')](_0x455888)['then'](function(_0x316b49){_0x132f5a[_0x25a9('0x22')]=_0x316b49;if(_0x10166b[_0x25a9('0x35')][_0x25a9('0x43')]){_0x9a02a2[_0x25a9('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x9a02a2);})['then'](function(_0xd51a5){_0x132f5a['rows']=_0xd51a5;return _0x132f5a;})[_0x25a9('0x28')](respondWithFilteredResult(_0x308c5e,_0x9a02a2))[_0x25a9('0x45')](handleError(_0x308c5e,null));};exports[_0x25a9('0x46')]=function(_0x3f23cc,_0xca7971){var _0x4c9766={'raw':!![],'where':{'id':_0x3f23cc[_0x25a9('0x47')]['id']}},_0x225810={};_0x225810[_0x25a9('0x33')]=_['keys'](db[_0x25a9('0x2e')][_0x25a9('0x2f')]);_0x225810[_0x25a9('0x35')]=_[_0x25a9('0x48')](_0x3f23cc['query']);_0x225810[_0x25a9('0x36')]=_[_0x25a9('0x37')](_0x225810[_0x25a9('0x33')],_0x225810['query']);_0x4c9766[_0x25a9('0x38')]=_[_0x25a9('0x37')](_0x225810[_0x25a9('0x33')],qs[_0x25a9('0x39')](_0x3f23cc[_0x25a9('0x35')][_0x25a9('0x39')]));_0x4c9766['attributes']=_0x4c9766[_0x25a9('0x38')][_0x25a9('0x3a')]?_0x4c9766[_0x25a9('0x38')]:_0x225810[_0x25a9('0x33')];if(_0x3f23cc['query']['includeAll']){_0x4c9766['include']=[{'all':!![]}];}_0x4c9766=_['merge']({},_0x4c9766,_0x3f23cc[_0x25a9('0x42')]);return db[_0x25a9('0x2e')][_0x25a9('0x49')](_0x4c9766)['then'](handleEntityNotFound(_0xca7971,null))[_0x25a9('0x28')](respondWithResult(_0xca7971,null))[_0x25a9('0x45')](handleError(_0xca7971,null));};exports['create']=function(_0x19e121,_0x2d8501){return db[_0x25a9('0x2e')][_0x25a9('0x4a')](_0x19e121['body'],{})[_0x25a9('0x28')](respondWithResult(_0x2d8501,0xc9))[_0x25a9('0x45')](handleError(_0x2d8501,null));};exports['update']=function(_0x5a33ba,_0x24cc32){if(_0x5a33ba[_0x25a9('0x4b')]['id']){delete _0x5a33ba[_0x25a9('0x4b')]['id'];}return db[_0x25a9('0x2e')][_0x25a9('0x49')]({'where':{'id':_0x5a33ba[_0x25a9('0x47')]['id']}})[_0x25a9('0x28')](handleEntityNotFound(_0x24cc32,null))['then'](saveUpdates(_0x5a33ba[_0x25a9('0x4b')],null))[_0x25a9('0x28')](respondWithResult(_0x24cc32,null))[_0x25a9('0x45')](handleError(_0x24cc32,null));};exports['destroy']=function(_0x49f038,_0x1623f1){return db[_0x25a9('0x2e')][_0x25a9('0x49')]({'where':{'id':_0x49f038['params']['id']}})['then'](handleEntityNotFound(_0x1623f1,null))[_0x25a9('0x28')](removeEntity(_0x1623f1,null))['catch'](handleError(_0x1623f1,null));};exports[_0x25a9('0x4c')]=function(_0xeac259,_0x90fd58){return db[_0x25a9('0x2e')]['describe']()['then'](respondWithResult(_0x90fd58,null))[_0x25a9('0x45')](handleError(_0x90fd58,null));};function wrapUser(_0x56b634){return function(_0x3ccd9e){var _0x140efe=_0x56b634[_0x25a9('0x4d')]({'plain':!![]});_0x140efe[_0x25a9('0x4e')]=[];if(_0x3ccd9e){_0x140efe[_0x25a9('0x4f')]=_0x3ccd9e[_0x25a9('0x50')];_0x140efe[_0x25a9('0x51')]=_0x3ccd9e;}else{_0x140efe['lastMessageAt']=moment(0x0)[_0x25a9('0x52')](_0x25a9('0x53'));_0x140efe['lastMessage']={};}return _0x140efe;};}exports['getUsers']=function(_0x4488bb,_0x2e9cab,_0x1d15f7){var _0xd645c4=[];return db[_0x25a9('0x54')][_0x25a9('0x55')]({'where':{'role':[_0x25a9('0x56'),_0x25a9('0x57'),'user']},'attributes':['id',_0x25a9('0x58'),'name','role',_0x25a9('0x59'),_0x25a9('0x5a'),_0x25a9('0x5b'),_0x25a9('0x5c'),_0x25a9('0x5d'),_0x25a9('0x5e')],'order':qs[_0x25a9('0x3c')](_0x25a9('0x5f')),'include':[{'model':db[_0x25a9('0x60')],'as':_0x25a9('0x61'),'attributes':['id',_0x25a9('0x2b'),_0x25a9('0x31')],'through':{'attributes':[]}}]})[_0x25a9('0x28')](function(_0x224a10){if(_0x224a10){var _0xf9102d=_0x4488bb[_0x25a9('0x62')][_0x25a9('0x4d')]({'plain':!![]});if(!_0xf9102d)throw new Error(_0x25a9('0x63'));if(_0xf9102d[_0x25a9('0x64')]==='user'){return db[_0x25a9('0x65')][_0x25a9('0x49')]({'where':{'name':'Agents','userProfileId':_0xf9102d[_0x25a9('0x66')]},'raw':!![]})[_0x25a9('0x28')](function(_0x41626e){if(_0x41626e){if(_0x41626e['autoAssociation']===0x0){return db[_0x25a9('0x67')][_0x25a9('0x55')]({'where':{'sectionId':_0x41626e['id']},'raw':!![]})[_0x25a9('0x28')](function(_0x2276eb){var _0x51c11f=[];if(_['isEmpty'](_0x2276eb)){_0x51c11f=_['filter'](_0x224a10,function(_0x166e99){if(_0x166e99[_0x25a9('0x64')]!==_0x25a9('0x56')){return _0x166e99;}});return _0x51c11f;}else{for(var _0x3b48ce=0x0;_0x3b48ce<_0x224a10['length'];_0x3b48ce++){var _0x3f8d5f=_0x224a10[_0x3b48ce];if(_0x3f8d5f[_0x25a9('0x64')]==='agent'){var _0x513580=_[_0x25a9('0x49')](_0x2276eb,function(_0x394734){return _0x394734[_0x25a9('0x68')]===_0x3f8d5f['id'];});if(_0x513580)_0x51c11f[_0x25a9('0x69')](_0x3f8d5f);}else{_0x51c11f[_0x25a9('0x69')](_0x3f8d5f);}}return _0x51c11f;}});}else{return _0x224a10;}}else{var _0x448155=_[_0x25a9('0x3f')](_0x224a10,function(_0x3c57ae){if(_0x3c57ae['role']!==_0x25a9('0x56')){return _0x3c57ae;}});return _0x448155;}});}else{return _0x224a10;}}})[_0x25a9('0x28')](function(_0x4cdaef){var _0x27ec58=[];if(_0x4cdaef){_0xd645c4=_0x4cdaef;for(var _0x4b560e=0x0;_0x4b560e<_0x4cdaef[_0x25a9('0x3a')];_0x4b560e+=0x1){_0xd645c4[_0x4b560e]['messages']=[];_0x27ec58[_0x25a9('0x69')](db[_0x25a9('0x2e')][_0x25a9('0x49')]({'where':{'FromId':[_0x4488bb[_0x25a9('0x62')]['id'],_0x4cdaef[_0x4b560e]['id']],'ToId':[_0x4488bb[_0x25a9('0x62')]['id'],_0x4cdaef[_0x4b560e]['id']],'ChatGroupId':null},'attributes':['id',_0x25a9('0x50'),_0x25a9('0x6a'),_0x25a9('0x6b'),_0x25a9('0x6c'),_0x25a9('0x4b')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x25a9('0x28')](wrapUser(_0x4cdaef[_0x4b560e])));}return BPromise[_0x25a9('0x6d')](_0x27ec58);}return[];})[_0x25a9('0x28')](function(_0x3ad143){return{'rows':_0x3ad143,'count':_0x3ad143[_0x25a9('0x3a')]};})[_0x25a9('0x28')](respondWithResult(_0x2e9cab,null))[_0x25a9('0x45')](handleError(_0x2e9cab,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index b94e411..dadb59d 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 _0x036d=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x3bc7a6,_0x3783f1){var _0x596ca0=function(_0x35f6f7){while(--_0x35f6f7){_0x3bc7a6['push'](_0x3bc7a6['shift']());}};_0x596ca0(++_0x3783f1);}(_0x036d,0x1a9));var _0xd036=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x036d[_0x3ff085];return _0x2b68c3;};'use strict';var EventEmitter=require(_0xd036('0x0'));var ChatInternalMessage=require(_0xd036('0x1'))['db'][_0xd036('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd036('0x3')](0x0);var events={'afterCreate':_0xd036('0x4'),'afterUpdate':_0xd036('0x5'),'afterDestroy':'remove'};function emitEvent(_0x576687){return function(_0x412d6e,_0x26f8fe,_0x3d435b){ChatInternalMessageEvents[_0xd036('0x6')](_0x576687+':'+_0x412d6e['id'],_0x412d6e);ChatInternalMessageEvents['emit'](_0x576687,_0x412d6e);_0x3d435b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xd036('0x7')](e,emitEvent(event));}}module[_0xd036('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x57e9=['update','remove','emit','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x5ed413,_0x4f26c0){var _0x3cca33=function(_0x214afe){while(--_0x214afe){_0x5ed413['push'](_0x5ed413['shift']());}};_0x3cca33(++_0x4f26c0);}(_0x57e9,0xce));var _0x957e=function(_0x5b7a0a,_0x4d62d5){_0x5b7a0a=_0x5b7a0a-0x0;var _0x3418b6=_0x57e9[_0x5b7a0a];return _0x3418b6;};'use strict';var EventEmitter=require(_0x957e('0x0'));var ChatInternalMessage=require(_0x957e('0x1'))['db'][_0x957e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x957e('0x3'),'afterUpdate':_0x957e('0x4'),'afterDestroy':_0x957e('0x5')};function emitEvent(_0x44410f){return function(_0x3a44d5,_0xee6b30,_0x581cf6){ChatInternalMessageEvents[_0x957e('0x6')](_0x44410f+':'+_0x3a44d5['id'],_0x3a44d5);ChatInternalMessageEvents['emit'](_0x44410f,_0x3a44d5);_0x581cf6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index de523d4..25ba955 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 _0x4cdf=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x567e5a,_0x2d143d){var _0xa17ebe=function(_0x292f7e){while(--_0x292f7e){_0x567e5a['push'](_0x567e5a['shift']());}};_0xa17ebe(++_0x2d143d);}(_0x4cdf,0xe9));var _0xf4cd=function(_0x4da0da,_0x54fdec){_0x4da0da=_0x4da0da-0x0;var _0x50fb2b=_0x4cdf[_0x4da0da];return _0x50fb2b;};'use strict';var _=require(_0xf4cd('0x0'));var util=require(_0xf4cd('0x1'));var logger=require(_0xf4cd('0x2'))(_0xf4cd('0x3'));var moment=require(_0xf4cd('0x4'));var BPromise=require(_0xf4cd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf4cd('0x6'));var config=require(_0xf4cd('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xf4cd('0x8')]=function(_0x4c4784,_0x4d9f74){return _0x4c4784[_0xf4cd('0x9')](_0xf4cd('0xa'),attributes,{'tableName':_0xf4cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf4cd('0xc')});};
\ No newline at end of file
+var _0x84ca=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x33acc2,_0x198db3){var _0x29f09d=function(_0x3c527e){while(--_0x3c527e){_0x33acc2['push'](_0x33acc2['shift']());}};_0x29f09d(++_0x198db3);}(_0x84ca,0xca));var _0xa84c=function(_0x5ec57a,_0x4fb107){_0x5ec57a=_0x5ec57a-0x0;var _0x2b717b=_0x84ca[_0x5ec57a];return _0x2b717b;};'use strict';var _=require(_0xa84c('0x0'));var util=require(_0xa84c('0x1'));var logger=require('../../config/logger')(_0xa84c('0x2'));var moment=require(_0xa84c('0x3'));var BPromise=require(_0xa84c('0x4'));var rp=require(_0xa84c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa84c('0x6'));var config=require(_0xa84c('0x7'));var attributes=require(_0xa84c('0x8'));module[_0xa84c('0x9')]=function(_0x522894,_0x13b07c){return _0x522894[_0xa84c('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa84c('0xb'),'collate':_0xa84c('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4084ab7..6bee3a7 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 _0x6467=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x2af5ec,_0x1b35cb){var _0x31919b=function(_0x44aa7f){while(--_0x44aa7f){_0x2af5ec['push'](_0x2af5ec['shift']());}};_0x31919b(++_0x1b35cb);}(_0x6467,0x110));var _0x7646=function(_0x1320bd,_0x41012c){_0x1320bd=_0x1320bd-0x0;var _0x27cb35=_0x6467[_0x1320bd];return _0x27cb35;};'use strict';var _=require(_0x7646('0x0'));var util=require(_0x7646('0x1'));var moment=require(_0x7646('0x2'));var BPromise=require(_0x7646('0x3'));var rs=require(_0x7646('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7646('0x5'));var logger=require(_0x7646('0x6'))(_0x7646('0x7'));var config=require(_0x7646('0x8'));var jayson=require(_0x7646('0x9'));var client=jayson[_0x7646('0xa')][_0x7646('0xb')]({'port':0x232a});config[_0x7646('0xc')]=_[_0x7646('0xd')](config['redis'],{'host':_0x7646('0xe'),'port':0x18eb});var socket=require(_0x7646('0xf'))(new Redis(config[_0x7646('0xc')]));require(_0x7646('0x10'))[_0x7646('0x11')](socket);function respondWithRpcPromise(_0x42b19e,_0x2ebec,_0x1a88d9){return new BPromise(function(_0x2acf4f,_0x23fcee){return client['request'](_0x42b19e,_0x1a88d9)['then'](function(_0x59ba3d){logger[_0x7646('0x12')](_0x7646('0x13'),_0x2ebec,'request\x20sent');logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2ebec,'request\x20sent',JSON[_0x7646('0x14')](_0x59ba3d));if(_0x59ba3d[_0x7646('0x15')]){if(_0x59ba3d[_0x7646('0x15')][_0x7646('0x16')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x2ebec,_0x59ba3d[_0x7646('0x15')][_0x7646('0x17')]);return _0x23fcee(_0x59ba3d['error'][_0x7646('0x17')]);}logger[_0x7646('0x15')](_0x7646('0x13'),_0x2ebec,_0x59ba3d['error']['message']);return _0x2acf4f(_0x59ba3d['error']['message']);}else{logger['info'](_0x7646('0x13'),_0x2ebec,_0x7646('0x18'));_0x2acf4f(_0x59ba3d[_0x7646('0x19')][_0x7646('0x17')]);}})[_0x7646('0x1a')](function(_0x108c46){logger[_0x7646('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2ebec,_0x108c46);_0x23fcee(_0x108c46);});});}
\ No newline at end of file
+var _0xb6a9=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb6a9,0xc4));var _0x9b6a=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xb6a9[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x9b6a('0x0'));var util=require(_0x9b6a('0x1'));var moment=require('moment');var BPromise=require(_0x9b6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b6a('0x3'));var db=require(_0x9b6a('0x4'))['db'];var utils=require(_0x9b6a('0x5'));var logger=require(_0x9b6a('0x6'))(_0x9b6a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9b6a('0x8'));var client=jayson[_0x9b6a('0x9')][_0x9b6a('0xa')]({'port':0x232a});config[_0x9b6a('0xb')]=_[_0x9b6a('0xc')](config[_0x9b6a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b6a('0xd'))(new Redis(config['redis']));require(_0x9b6a('0xe'))[_0x9b6a('0xf')](socket);function respondWithRpcPromise(_0x5efc13,_0x271ef4,_0x525480){return new BPromise(function(_0x55af0c,_0x222780){return client[_0x9b6a('0x10')](_0x5efc13,_0x525480)[_0x9b6a('0x11')](function(_0x2295f0){logger[_0x9b6a('0x12')](_0x9b6a('0x13'),_0x271ef4,_0x9b6a('0x14'));logger[_0x9b6a('0x15')](_0x9b6a('0x16'),_0x271ef4,_0x9b6a('0x14'),JSON[_0x9b6a('0x17')](_0x2295f0));if(_0x2295f0[_0x9b6a('0x18')]){if(_0x2295f0[_0x9b6a('0x18')]['code']===0x1f4){logger['error'](_0x9b6a('0x13'),_0x271ef4,_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);return _0x222780(_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);}logger[_0x9b6a('0x18')](_0x9b6a('0x13'),_0x271ef4,_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);return _0x55af0c(_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);}else{logger[_0x9b6a('0x12')](_0x9b6a('0x13'),_0x271ef4,_0x9b6a('0x14'));_0x55af0c(_0x2295f0[_0x9b6a('0x1a')][_0x9b6a('0x19')]);}})[_0x9b6a('0x1b')](function(_0xa8e9d6){logger[_0x9b6a('0x18')](_0x9b6a('0x13'),_0x271ef4,_0xa8e9d6);_0x222780(_0xa8e9d6);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 684ff7c..bb0f84f 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 _0x62d8=['chatInternalMessage:','./chatInternalMessage.events','remove','update','register','length'];(function(_0x40b7ec,_0x307707){var _0x72b976=function(_0x5bfcc3){while(--_0x5bfcc3){_0x40b7ec['push'](_0x40b7ec['shift']());}};_0x72b976(++_0x307707);}(_0x62d8,0x199));var _0x862d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x62d8[_0x501510];return _0x1e6ee5;};'use strict';var ChatInternalMessageEvents=require(_0x862d('0x0'));var events=['save',_0x862d('0x1'),_0x862d('0x2')];function createListener(_0x17e8b8,_0x52c62e){return function(_0xc0a6fe){_0x52c62e['emit'](_0x17e8b8,_0xc0a6fe);};}function removeListener(_0x32de59,_0x458e30){return function(){ChatInternalMessageEvents['removeListener'](_0x32de59,_0x458e30);};}exports[_0x862d('0x3')]=function(_0x3a99e8){for(var _0x2acf65=0x0,_0x2cb145=events[_0x862d('0x4')];_0x2acf65<_0x2cb145;_0x2acf65++){var _0x2117ba=events[_0x2acf65];var _0xc9f224=createListener(_0x862d('0x5')+_0x2117ba,_0x3a99e8);ChatInternalMessageEvents['on'](_0x2117ba,_0xc9f224);}};
\ No newline at end of file
+var _0xd6ec=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x4ecb61,_0xf4fe26){var _0x25eec8=function(_0xa0aeb){while(--_0xa0aeb){_0x4ecb61['push'](_0x4ecb61['shift']());}};_0x25eec8(++_0xf4fe26);}(_0xd6ec,0x18d));var _0xcd6e=function(_0x11f586,_0x1a11da){_0x11f586=_0x11f586-0x0;var _0x46b786=_0xd6ec[_0x11f586];return _0x46b786;};'use strict';var ChatInternalMessageEvents=require(_0xcd6e('0x0'));var events=['save',_0xcd6e('0x1'),_0xcd6e('0x2')];function createListener(_0x2269b6,_0x35f8b1){return function(_0x15bcf2){_0x35f8b1[_0xcd6e('0x3')](_0x2269b6,_0x15bcf2);};}function removeListener(_0x1ce042,_0x4f29f2){return function(){ChatInternalMessageEvents['removeListener'](_0x1ce042,_0x4f29f2);};}exports[_0xcd6e('0x4')]=function(_0x371d76){for(var _0x1f8c89=0x0,_0x176612=events[_0xcd6e('0x5')];_0x1f8c89<_0x176612;_0x1f8c89++){var _0xde523e=events[_0x1f8c89];var _0x8d3396=createListener(_0xcd6e('0x6')+_0xde523e,_0x371d76);ChatInternalMessageEvents['on'](_0xde523e,_0x8d3396);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e55dbb8..39c142c 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 _0x4f9d=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/users','getUsers','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1479fa,_0x315d83){var _0x2c13d5=function(_0x17b2d6){while(--_0x17b2d6){_0x1479fa['push'](_0x1479fa['shift']());}};_0x2c13d5(++_0x315d83);}(_0x4f9d,0x1b3));var _0xd4f9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4f9d[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xd4f9('0x0'));var util=require(_0xd4f9('0x1'));var path=require(_0xd4f9('0x2'));var timeout=require('connect-timeout');var express=require(_0xd4f9('0x3'));var router=express[_0xd4f9('0x4')]();var fs_extra=require(_0xd4f9('0x5'));var auth=require(_0xd4f9('0x6'));var interaction=require(_0xd4f9('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xd4f9('0x8')]('/',auth[_0xd4f9('0x9')](),controller['index']);router[_0xd4f9('0x8')](_0xd4f9('0xa'),auth[_0xd4f9('0x9')](),controller[_0xd4f9('0xb')]);router['get'](_0xd4f9('0xc'),auth[_0xd4f9('0x9')](),controller[_0xd4f9('0xd')]);router[_0xd4f9('0x8')]('/:id',auth[_0xd4f9('0x9')](),controller[_0xd4f9('0xe')]);router[_0xd4f9('0xf')]('/',auth[_0xd4f9('0x9')](),controller[_0xd4f9('0x10')]);router[_0xd4f9('0x11')]('/:id',controller[_0xd4f9('0x12')]);router[_0xd4f9('0x13')]('/:id',auth[_0xd4f9('0x9')](),controller[_0xd4f9('0x14')]);module[_0xd4f9('0x15')]=router;
\ No newline at end of file
+var _0x2ff7=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','show','create','put','update','delete','destroy','multer','util'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0x2ff7,0xbb));var _0x72ff=function(_0x5223de,_0xb0a127){_0x5223de=_0x5223de-0x0;var _0x4a52ee=_0x2ff7[_0x5223de];return _0x4a52ee;};'use strict';var multer=require(_0x72ff('0x0'));var util=require(_0x72ff('0x1'));var path=require('path');var timeout=require(_0x72ff('0x2'));var express=require(_0x72ff('0x3'));var router=express[_0x72ff('0x4')]();var fs_extra=require(_0x72ff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x72ff('0x6'));var config=require(_0x72ff('0x7'));var controller=require(_0x72ff('0x8'));router[_0x72ff('0x9')]('/',auth[_0x72ff('0xa')](),controller['index']);router[_0x72ff('0x9')](_0x72ff('0xb'),auth[_0x72ff('0xa')](),controller[_0x72ff('0xc')]);router[_0x72ff('0x9')]('/users',auth[_0x72ff('0xa')](),controller[_0x72ff('0xd')]);router[_0x72ff('0x9')](_0x72ff('0xe'),auth[_0x72ff('0xa')](),controller[_0x72ff('0xf')]);router['post']('/',auth[_0x72ff('0xa')](),controller[_0x72ff('0x10')]);router[_0x72ff('0x11')](_0x72ff('0xe'),controller[_0x72ff('0x12')]);router[_0x72ff('0x13')](_0x72ff('0xe'),auth[_0x72ff('0xa')](),controller[_0x72ff('0x14')]);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 cda2f42..ebe9587 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 _0x9c9b=['TEXT','medium','BOOLEAN','out','exports'];(function(_0x452144,_0x170931){var _0x37f223=function(_0x32d7b8){while(--_0x32d7b8){_0x452144['push'](_0x452144['shift']());}};_0x37f223(++_0x170931);}(_0x9c9b,0x194));var _0xb9c9=function(_0x2038d4,_0x393888){_0x2038d4=_0x2038d4-0x0;var _0x2d65dd=_0x9c9b[_0x2038d4];return _0x2d65dd;};'use strict';var Sequelize=require('sequelize');module[_0xb9c9('0x0')]={'body':{'type':Sequelize[_0xb9c9('0x1')](_0xb9c9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9c9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9c9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9c9('0x4')),'defaultValue':_0xb9c9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4849=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x52923d,_0x1c45a4){var _0x56ec0e=function(_0x27630c){while(--_0x27630c){_0x52923d['push'](_0x52923d['shift']());}};_0x56ec0e(++_0x1c45a4);}(_0x4849,0xf8));var _0x9484=function(_0x3db99c,_0xd75b6f){_0x3db99c=_0x3db99c-0x0;var _0xf5263b=_0x4849[_0x3db99c];return _0xf5263b;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'body':{'type':Sequelize[_0x9484('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9484('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9484('0x4')]('in',_0x9484('0x5')),'defaultValue':_0x9484('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9484('0x6')]},'providerName':{'type':Sequelize[_0x9484('0x7')]},'providerResponse':{'type':Sequelize[_0x9484('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 0f10a74..7905795 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 _0x753c=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','accept','chat','acceptMessage','reject','UserId','user','get','ChatInteractionId','role','RejectMessage','rejectMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','format','SIP/%s','channel','EventManager','parse','interaction','util','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','http','chat-interactions','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','status','json','undefined','count','offset','set','Content-Range','update','sendStatus','stack','name','send','index','ChatMessage','key','map'];(function(_0x5cfb75,_0x224a85){var _0x2613d6=function(_0x4f1a6b){while(--_0x4f1a6b){_0x5cfb75['push'](_0x5cfb75['shift']());}};_0x2613d6(++_0x224a85);}(_0x753c,0xfd));var _0xc753=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x753c[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0xc753('0x0'));var _=require(_0xc753('0x1'));var Redis=require(_0xc753('0x2'));var interactionService=require(_0xc753('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc753('0x4'));var config=require(_0xc753('0x5'));var db=require(_0xc753('0x6'))['db'];config[_0xc753('0x7')]=_[_0xc753('0x8')](config[_0xc753('0x7')],{'host':_0xc753('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc753('0x7')]));require(_0xc753('0xa'))[_0xc753('0xb')](socket);var jayson=require(_0xc753('0xc'));var client=jayson['client'][_0xc753('0xd')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var interaction_log=require('../../config/logger')(_0xc753('0xe'));function respondWithRpcPromise(_0x144afb,_0x334b9e,_0x175ed6,_0x2d7b08){return new Promise(function(_0x164290,_0x22f5c0){var _0x15967d=_0x2d7b08||client;return _0x15967d[_0xc753('0xf')](_0x144afb,_0x175ed6)[_0xc753('0x10')](function(_0x480139){logger[_0xc753('0x11')]('ChatMessage,\x20%s,\x20%s',_0x334b9e,_0xc753('0x12'));logger[_0xc753('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x334b9e,_0xc753('0x12'),JSON[_0xc753('0x14')](_0x480139));if(_0x480139[_0xc753('0x15')]){if(_0x480139['error'][_0xc753('0x16')]===0x1f4){logger[_0xc753('0x15')](_0xc753('0x17'),_0x334b9e,_0x480139[_0xc753('0x15')][_0xc753('0x18')]);return _0x22f5c0(_0x480139['error'][_0xc753('0x18')]);}logger[_0xc753('0x15')](_0xc753('0x17'),_0x334b9e,_0x480139[_0xc753('0x15')]['message']);return _0x164290(_0x480139[_0xc753('0x15')][_0xc753('0x18')]);}else{logger[_0xc753('0x11')](_0xc753('0x17'),_0x334b9e,_0xc753('0x12'));_0x164290(_0x480139['result'][_0xc753('0x18')]);}})['catch'](function(_0x5094f7){logger[_0xc753('0x15')](_0xc753('0x17'),_0x334b9e,_0x5094f7);_0x22f5c0(_0x5094f7);});});}function respondWithResult(_0x3cd0e5,_0x354e86){_0x354e86=_0x354e86||0xc8;return function(_0x426499){if(_0x426499){return _0x3cd0e5[_0xc753('0x19')](_0x354e86)[_0xc753('0x1a')](_0x426499);}};}function respondWithFilteredResult(_0xae7cdd,_0x35c9af){return function(_0x3a2797){if(_0x3a2797){var _0x242050=typeof _0x35c9af['offset']==='undefined'&&typeof _0x35c9af['limit']===_0xc753('0x1b');var _0x46512e=_0x3a2797[_0xc753('0x1c')];var _0xffdd44=_0x242050?0x0:_0x35c9af[_0xc753('0x1d')];var _0x54adb2=_0x242050?_0x3a2797['count']:_0x35c9af[_0xc753('0x1d')]+_0x35c9af['limit'];var _0x53d831;if(_0x54adb2>=_0x46512e){_0x54adb2=_0x46512e;_0x53d831=0xc8;}else{_0x53d831=0xce;}_0xae7cdd[_0xc753('0x19')](_0x53d831);return _0xae7cdd[_0xc753('0x1e')](_0xc753('0x1f'),_0xffdd44+'-'+_0x54adb2+'/'+_0x46512e)[_0xc753('0x1a')](_0x3a2797);}return null;};}function saveUpdates(_0x3a742e){return function(_0x2e6ede){if(_0x2e6ede){return _0x2e6ede[_0xc753('0x20')](_0x3a742e)['then'](function(_0x2f1544){return _0x2f1544;});}return null;};}function removeEntity(_0x35f51d){return function(_0x56a74f){if(_0x56a74f){return _0x56a74f['destroy']()['then'](function(){_0x35f51d[_0xc753('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501c31){return function(_0x2809d8){if(!_0x2809d8){_0x501c31[_0xc753('0x21')](0x194);}return _0x2809d8;};}function handleError(_0x562895,_0x4af7f7){_0x4af7f7=_0x4af7f7||0x1f4;return function(_0x24c15d){logger['error'](_0x24c15d[_0xc753('0x22')]);if(_0x24c15d[_0xc753('0x23')]){delete _0x24c15d['name'];}_0x562895[_0xc753('0x19')](_0x4af7f7)[_0xc753('0x24')](_0x24c15d);};}exports[_0xc753('0x25')]=function(_0x2c0d3c,_0x460bd8){var _0x387e66={},_0x48cbad={},_0x2808d1={'count':0x0,'rows':[]};var _0x5ebb4d=_['map'](db[_0xc753('0x26')]['rawAttributes'],function(_0x37c96b){return{'name':_0x37c96b['fieldName'],'type':_0x37c96b['type'][_0xc753('0x27')]};});_0x48cbad['model']=_[_0xc753('0x28')](_0x5ebb4d,_0xc753('0x23'));_0x48cbad[_0xc753('0x29')]=_[_0xc753('0x2a')](_0x2c0d3c['query']);_0x48cbad[_0xc753('0x2b')]=_[_0xc753('0x2c')](_0x48cbad[_0xc753('0x2d')],_0x48cbad[_0xc753('0x29')]);_0x387e66[_0xc753('0x2e')]=_[_0xc753('0x2c')](_0x48cbad[_0xc753('0x2d')],qs[_0xc753('0x2f')](_0x2c0d3c[_0xc753('0x29')][_0xc753('0x2f')]));_0x387e66[_0xc753('0x2e')]=_0x387e66[_0xc753('0x2e')][_0xc753('0x30')]?_0x387e66[_0xc753('0x2e')]:_0x48cbad[_0xc753('0x2d')];if(!_0x2c0d3c[_0xc753('0x29')][_0xc753('0x31')](_0xc753('0x32'))){_0x387e66[_0xc753('0x33')]=qs['limit'](_0x2c0d3c[_0xc753('0x29')]['limit']);_0x387e66[_0xc753('0x1d')]=qs[_0xc753('0x1d')](_0x2c0d3c[_0xc753('0x29')]['offset']);}_0x387e66[_0xc753('0x34')]=qs['sort'](_0x2c0d3c[_0xc753('0x29')][_0xc753('0x35')]);_0x387e66['where']=qs[_0xc753('0x2b')](_[_0xc753('0x36')](_0x2c0d3c[_0xc753('0x29')],_0x48cbad[_0xc753('0x2b')]),_0x5ebb4d);if(_0x2c0d3c['query'][_0xc753('0x37')]){_0x387e66[_0xc753('0x38')]=_[_0xc753('0x39')](_0x387e66['where'],{'$or':_[_0xc753('0x28')](_0x5ebb4d,function(_0x21c760){if(_0x21c760[_0xc753('0x3a')]!==_0xc753('0x3b')){var _0x56ee1a={};_0x56ee1a[_0x21c760[_0xc753('0x23')]]={'$like':'%'+_0x2c0d3c[_0xc753('0x29')][_0xc753('0x37')]+'%'};return _0x56ee1a;}})});}_0x387e66=_['merge']({},_0x387e66,_0x2c0d3c[_0xc753('0x3c')]);var _0x385193={'where':_0x387e66[_0xc753('0x38')]};return db['ChatMessage']['count'](_0x385193)[_0xc753('0x10')](function(_0x472f18){_0x2808d1[_0xc753('0x1c')]=_0x472f18;if(_0x2c0d3c[_0xc753('0x29')][_0xc753('0x3d')]){_0x387e66['include']=[{'all':!![]}];}return db[_0xc753('0x26')][_0xc753('0x3e')](_0x387e66);})[_0xc753('0x10')](function(_0x3c29ec){_0x2808d1[_0xc753('0x3f')]=_0x3c29ec;return _0x2808d1;})['then'](respondWithFilteredResult(_0x460bd8,_0x387e66))[_0xc753('0x40')](handleError(_0x460bd8,null));};exports[_0xc753('0x41')]=function(_0x1e1d05,_0x3b97f5){var _0x50b420={'raw':!![],'where':{'id':_0x1e1d05[_0xc753('0x42')]['id']}},_0x27d3f3={};_0x27d3f3['model']=_[_0xc753('0x2a')](db[_0xc753('0x26')][_0xc753('0x43')]);_0x27d3f3[_0xc753('0x29')]=_[_0xc753('0x2a')](_0x1e1d05[_0xc753('0x29')]);_0x27d3f3[_0xc753('0x2b')]=_[_0xc753('0x2c')](_0x27d3f3['model'],_0x27d3f3[_0xc753('0x29')]);_0x50b420[_0xc753('0x2e')]=_[_0xc753('0x2c')](_0x27d3f3['model'],qs[_0xc753('0x2f')](_0x1e1d05[_0xc753('0x29')]['fields']));_0x50b420['attributes']=_0x50b420[_0xc753('0x2e')]['length']?_0x50b420[_0xc753('0x2e')]:_0x27d3f3['model'];if(_0x1e1d05[_0xc753('0x29')][_0xc753('0x3d')]){_0x50b420['include']=[{'all':!![]}];}_0x50b420=_['merge']({},_0x50b420,_0x1e1d05[_0xc753('0x3c')]);return db[_0xc753('0x26')]['find'](_0x50b420)[_0xc753('0x10')](handleEntityNotFound(_0x3b97f5,null))[_0xc753('0x10')](respondWithResult(_0x3b97f5,null))['catch'](handleError(_0x3b97f5,null));};exports[_0xc753('0x44')]=function(_0x4fe238,_0x1b74f5){return db[_0xc753('0x26')][_0xc753('0x44')](_0x4fe238['body'],{})['then'](respondWithResult(_0x1b74f5,0xc9))[_0xc753('0x40')](handleError(_0x1b74f5,null));};exports['update']=function(_0x4309c9,_0x86ceb3){if(_0x4309c9[_0xc753('0x45')]['id']){delete _0x4309c9['body']['id'];}return db[_0xc753('0x26')][_0xc753('0x46')]({'where':{'id':_0x4309c9[_0xc753('0x42')]['id']}})['then'](handleEntityNotFound(_0x86ceb3,null))[_0xc753('0x10')](saveUpdates(_0x4309c9[_0xc753('0x45')],null))['then'](respondWithResult(_0x86ceb3,null))[_0xc753('0x40')](handleError(_0x86ceb3,null));};exports['destroy']=function(_0x36c5db,_0x518790){return db[_0xc753('0x26')][_0xc753('0x46')]({'where':{'id':_0x36c5db[_0xc753('0x42')]['id']}})['then'](handleEntityNotFound(_0x518790,null))[_0xc753('0x10')](removeEntity(_0x518790,null))[_0xc753('0x40')](handleError(_0x518790,null));};exports[_0xc753('0x47')]=function(_0x33ed94,_0x1bbdcc){return db['ChatMessage'][_0xc753('0x47')]()[_0xc753('0x10')](respondWithResult(_0x1bbdcc,null))[_0xc753('0x40')](handleError(_0x1bbdcc,null));};exports[_0xc753('0x48')]=function(_0x397ab4,_0x28a80f){var _0x38da44=_0xc753('0x49');return interactionService[_0xc753('0x4a')](_0x397ab4,_0x38da44)['then'](respondWithResult(_0x28a80f,null))[_0xc753('0x40')](handleError(_0x28a80f,null));};exports[_0xc753('0x4b')]=function(_0x212f33,_0x1229d2){var _0x5a619c={'agent':{},'channel':_0xc753('0x49')};if(_0x212f33[_0xc753('0x45')]['id']){delete _0x212f33['body']['id'];}_0x212f33[_0xc753('0x45')]['UserId']=_0x212f33[_0xc753('0x45')][_0xc753('0x4c')]||_0x212f33[_0xc753('0x4d')]['id'];_0x5a619c['agent']['id']=_0x212f33[_0xc753('0x45')]['UserId'];return db[_0xc753('0x26')][_0xc753('0x46')]({'where':{'id':_0x212f33['params']['id'],'UserId':null}})[_0xc753('0x10')](handleEntityNotFound(_0x1229d2,null))['then'](function(_0x14120){if(_0x14120){_0x5a619c['message']=_0x14120[_0xc753('0x4e')]({'plain':!![]});return db['ChatInteraction'][_0xc753('0x46')]({'where':{'id':_0x14120[_0xc753('0x4f')]}});}return null;})[_0xc753('0x10')](handleEntityNotFound(_0x1229d2,null))[_0xc753('0x10')](function(_0x2958bc){if(_0x2958bc){_0x5a619c['interaction']=_0x2958bc[_0xc753('0x4e')]({'plain':!![]});interaction_log[_0xc753('0x11')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x212f33[_0xc753('0x4d')]['id'],_0x212f33[_0xc753('0x4d')][_0xc753('0x23')],_0x212f33['user'][_0xc753('0x50')],_0x5a619c['interaction']['id'],_0x212f33[_0xc753('0x45')]?JSON['stringify'](_0x212f33['body']):'null');return respondWithRpcPromise(_0xc753('0x51'),_0xc753('0x52'),_0x5a619c);}return null;})['then'](function(_0x33f3e3){var _0x51747f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33f3e3[_0xc753('0x18')][_0xc753('0x53')];return db['sequelize']['query'](_0x51747f,{'type':db[_0xc753('0x54')][_0xc753('0x55')][_0xc753('0x56')],'raw':!![]})[_0xc753('0x10')](function(_0x3c59f3){return _0x3c59f3;});})[_0xc753('0x10')](function(_0x27a1fd){if(_0x27a1fd){_0x5a619c[_0xc753('0x18')][_0xc753('0x57')]=_0x27a1fd[0x0];if(!_0x212f33[_0xc753('0x45')][_0xc753('0x4c')])return;return db[_0xc753('0x58')]['find']({'where':{'id':_0x212f33[_0xc753('0x45')]['UserId'],'role':'agent'},'attributes':['id','name',_0xc753('0x59'),'email',_0xc753('0x5a')],'raw':!![]});}return null;})[_0xc753('0x10')](function(_0x53d577){if(!_0x53d577)return null;_0x5a619c[_0xc753('0x18')]['agent']=_0x53d577;return _0x5a619c;})['then'](function(_0x3ba3c9){if(_0x3ba3c9){_0x3ba3c9[_0xc753('0x18')][_0xc753('0x5b')]=util[_0xc753('0x5c')](_0xc753('0x5d'),_0x212f33[_0xc753('0x4d')]['name']);_0x3ba3c9[_0xc753('0x18')][_0xc753('0x5e')]=_0x5a619c[_0xc753('0x5e')];_0x3ba3c9['message']['motionChannel']=_0x5a619c[_0xc753('0x5e')];_0x3ba3c9[_0xc753('0x18')]['event']='reject';respondWithRpcPromise('EventManager',_0xc753('0x5f'),{'event':'rejectmessage','message':_[_0xc753('0x39')](_0x5a619c[_0xc753('0x18')],JSON[_0xc753('0x60')](_0x5a619c[_0xc753('0x61')]['formData']))},client9002);return _0x5a619c;}return null;})[_0xc753('0x10')](respondWithResult(_0x1229d2,null))['catch'](handleError(_0x1229d2,null));};
\ No newline at end of file
+var _0xf6c6=['find','create','update','body','destroy','describe','accept','acceptMessage','reject','chat','UserId','agent','get','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','format','SIP/%s','channel','event','EventManager','rejectmessage','interaction','formData','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','undefined','count','Content-Range','then','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys'];(function(_0x4f6173,_0xe63497){var _0x2eb711=function(_0x2b0c38){while(--_0x2b0c38){_0x4f6173['push'](_0x4f6173['shift']());}};_0x2eb711(++_0xe63497);}(_0xf6c6,0x8d));var _0x6f6c=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xf6c6[_0x44946b];return _0x249bc4;};'use strict';var util=require(_0x6f6c('0x0'));var _=require(_0x6f6c('0x1'));var Redis=require(_0x6f6c('0x2'));var interactionService=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x6f6c('0x3'))(_0x6f6c('0x4'));var config=require(_0x6f6c('0x5'));var db=require(_0x6f6c('0x6'))['db'];config['redis']=_[_0x6f6c('0x7')](config[_0x6f6c('0x8')],{'host':_0x6f6c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6f6c('0xa'))[_0x6f6c('0xb')](socket);var jayson=require(_0x6f6c('0xc'));var client=jayson['client'][_0x6f6c('0xd')]({'port':0x232c});var client9002=jayson[_0x6f6c('0xe')][_0x6f6c('0xd')]({'port':0x232a});var interaction_log=require(_0x6f6c('0x3'))('chat-interactions');function respondWithRpcPromise(_0x32bd1a,_0x5ec938,_0x2f352d,_0xe0b67f){return new Promise(function(_0x2bbeb9,_0xf79d2d){var _0x452a02=_0xe0b67f||client;return _0x452a02[_0x6f6c('0xf')](_0x32bd1a,_0x2f352d)['then'](function(_0x2cb519){logger[_0x6f6c('0x10')](_0x6f6c('0x11'),_0x5ec938,_0x6f6c('0x12'));logger['debug'](_0x6f6c('0x13'),_0x5ec938,_0x6f6c('0x12'),JSON[_0x6f6c('0x14')](_0x2cb519));if(_0x2cb519[_0x6f6c('0x15')]){if(_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x16')]===0x1f4){logger['error'](_0x6f6c('0x11'),_0x5ec938,_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x17')]);return _0xf79d2d(_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x17')]);}logger[_0x6f6c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5ec938,_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x17')]);return _0x2bbeb9(_0x2cb519[_0x6f6c('0x15')]['message']);}else{logger['info'](_0x6f6c('0x11'),_0x5ec938,_0x6f6c('0x12'));_0x2bbeb9(_0x2cb519[_0x6f6c('0x18')][_0x6f6c('0x17')]);}})[_0x6f6c('0x19')](function(_0x3bd6c0){logger[_0x6f6c('0x15')](_0x6f6c('0x11'),_0x5ec938,_0x3bd6c0);_0xf79d2d(_0x3bd6c0);});});}function respondWithResult(_0x3184d7,_0x43d288){_0x43d288=_0x43d288||0xc8;return function(_0x2ecf8a){if(_0x2ecf8a){return _0x3184d7[_0x6f6c('0x1a')](_0x43d288)[_0x6f6c('0x1b')](_0x2ecf8a);}};}function respondWithFilteredResult(_0x56ea08,_0x5f17da){return function(_0x4842ee){if(_0x4842ee){var _0x14f811=typeof _0x5f17da[_0x6f6c('0x1c')]==='undefined'&&typeof _0x5f17da[_0x6f6c('0x1d')]===_0x6f6c('0x1e');var _0x58fdaa=_0x4842ee[_0x6f6c('0x1f')];var _0x42a7f3=_0x14f811?0x0:_0x5f17da[_0x6f6c('0x1c')];var _0x47673e=_0x14f811?_0x4842ee[_0x6f6c('0x1f')]:_0x5f17da['offset']+_0x5f17da[_0x6f6c('0x1d')];var _0x1fa26a;if(_0x47673e>=_0x58fdaa){_0x47673e=_0x58fdaa;_0x1fa26a=0xc8;}else{_0x1fa26a=0xce;}_0x56ea08[_0x6f6c('0x1a')](_0x1fa26a);return _0x56ea08['set'](_0x6f6c('0x20'),_0x42a7f3+'-'+_0x47673e+'/'+_0x58fdaa)[_0x6f6c('0x1b')](_0x4842ee);}return null;};}function saveUpdates(_0xf39934){return function(_0x3c03b2){if(_0x3c03b2){return _0x3c03b2['update'](_0xf39934)[_0x6f6c('0x21')](function(_0x295fea){return _0x295fea;});}return null;};}function removeEntity(_0x5031f7){return function(_0x13496e){if(_0x13496e){return _0x13496e['destroy']()[_0x6f6c('0x21')](function(){_0x5031f7[_0x6f6c('0x1a')](0xcc)[_0x6f6c('0x22')]();});}};}function handleEntityNotFound(_0x12aff5){return function(_0x172a7a){if(!_0x172a7a){_0x12aff5[_0x6f6c('0x23')](0x194);}return _0x172a7a;};}function handleError(_0x21d80f,_0xaf4f){_0xaf4f=_0xaf4f||0x1f4;return function(_0x15212e){logger[_0x6f6c('0x15')](_0x15212e[_0x6f6c('0x24')]);if(_0x15212e[_0x6f6c('0x25')]){delete _0x15212e['name'];}_0x21d80f['status'](_0xaf4f)[_0x6f6c('0x26')](_0x15212e);};}exports[_0x6f6c('0x27')]=function(_0x4f5590,_0x1f55e3){var _0xdfcd78={},_0xe6f2b0={},_0x5b4156={'count':0x0,'rows':[]};var _0x150545=_[_0x6f6c('0x28')](db['ChatMessage'][_0x6f6c('0x29')],function(_0x5121b8){return{'name':_0x5121b8[_0x6f6c('0x2a')],'type':_0x5121b8[_0x6f6c('0x2b')][_0x6f6c('0x2c')]};});_0xe6f2b0['model']=_[_0x6f6c('0x28')](_0x150545,_0x6f6c('0x25'));_0xe6f2b0[_0x6f6c('0x2d')]=_['keys'](_0x4f5590[_0x6f6c('0x2d')]);_0xe6f2b0[_0x6f6c('0x2e')]=_[_0x6f6c('0x2f')](_0xe6f2b0[_0x6f6c('0x30')],_0xe6f2b0['query']);_0xdfcd78[_0x6f6c('0x31')]=_['intersection'](_0xe6f2b0[_0x6f6c('0x30')],qs[_0x6f6c('0x32')](_0x4f5590[_0x6f6c('0x2d')]['fields']));_0xdfcd78[_0x6f6c('0x31')]=_0xdfcd78['attributes'][_0x6f6c('0x33')]?_0xdfcd78[_0x6f6c('0x31')]:_0xe6f2b0[_0x6f6c('0x30')];if(!_0x4f5590['query'][_0x6f6c('0x34')]('nolimit')){_0xdfcd78['limit']=qs['limit'](_0x4f5590[_0x6f6c('0x2d')]['limit']);_0xdfcd78[_0x6f6c('0x1c')]=qs[_0x6f6c('0x1c')](_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x1c')]);}_0xdfcd78[_0x6f6c('0x35')]=qs[_0x6f6c('0x36')](_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x36')]);_0xdfcd78['where']=qs[_0x6f6c('0x2e')](_[_0x6f6c('0x37')](_0x4f5590[_0x6f6c('0x2d')],_0xe6f2b0['filters']),_0x150545);if(_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x38')]){_0xdfcd78[_0x6f6c('0x39')]=_[_0x6f6c('0x3a')](_0xdfcd78['where'],{'$or':_[_0x6f6c('0x28')](_0x150545,function(_0x15a03a){if(_0x15a03a[_0x6f6c('0x2b')]!==_0x6f6c('0x3b')){var _0xf31723={};_0xf31723[_0x15a03a[_0x6f6c('0x25')]]={'$like':'%'+_0x4f5590['query'][_0x6f6c('0x38')]+'%'};return _0xf31723;}})});}_0xdfcd78=_[_0x6f6c('0x3a')]({},_0xdfcd78,_0x4f5590[_0x6f6c('0x3c')]);var _0x3327d4={'where':_0xdfcd78[_0x6f6c('0x39')]};return db[_0x6f6c('0x3d')][_0x6f6c('0x1f')](_0x3327d4)['then'](function(_0x502f7d){_0x5b4156['count']=_0x502f7d;if(_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x3e')]){_0xdfcd78[_0x6f6c('0x3f')]=[{'all':!![]}];}return db['ChatMessage'][_0x6f6c('0x40')](_0xdfcd78);})[_0x6f6c('0x21')](function(_0x31eaea){_0x5b4156[_0x6f6c('0x41')]=_0x31eaea;return _0x5b4156;})[_0x6f6c('0x21')](respondWithFilteredResult(_0x1f55e3,_0xdfcd78))[_0x6f6c('0x19')](handleError(_0x1f55e3,null));};exports[_0x6f6c('0x42')]=function(_0x1ab6a3,_0x3e5b33){var _0xe8ee2c={'raw':!![],'where':{'id':_0x1ab6a3[_0x6f6c('0x43')]['id']}},_0x4f14d1={};_0x4f14d1['model']=_[_0x6f6c('0x44')](db[_0x6f6c('0x3d')][_0x6f6c('0x29')]);_0x4f14d1[_0x6f6c('0x2d')]=_[_0x6f6c('0x44')](_0x1ab6a3['query']);_0x4f14d1['filters']=_[_0x6f6c('0x2f')](_0x4f14d1[_0x6f6c('0x30')],_0x4f14d1[_0x6f6c('0x2d')]);_0xe8ee2c[_0x6f6c('0x31')]=_[_0x6f6c('0x2f')](_0x4f14d1[_0x6f6c('0x30')],qs['fields'](_0x1ab6a3[_0x6f6c('0x2d')]['fields']));_0xe8ee2c[_0x6f6c('0x31')]=_0xe8ee2c[_0x6f6c('0x31')]['length']?_0xe8ee2c['attributes']:_0x4f14d1['model'];if(_0x1ab6a3['query'][_0x6f6c('0x3e')]){_0xe8ee2c[_0x6f6c('0x3f')]=[{'all':!![]}];}_0xe8ee2c=_[_0x6f6c('0x3a')]({},_0xe8ee2c,_0x1ab6a3[_0x6f6c('0x3c')]);return db[_0x6f6c('0x3d')][_0x6f6c('0x45')](_0xe8ee2c)[_0x6f6c('0x21')](handleEntityNotFound(_0x3e5b33,null))[_0x6f6c('0x21')](respondWithResult(_0x3e5b33,null))[_0x6f6c('0x19')](handleError(_0x3e5b33,null));};exports[_0x6f6c('0x46')]=function(_0x163235,_0x37d181){return db[_0x6f6c('0x3d')]['create'](_0x163235['body'],{})['then'](respondWithResult(_0x37d181,0xc9))[_0x6f6c('0x19')](handleError(_0x37d181,null));};exports[_0x6f6c('0x47')]=function(_0x34f07e,_0x13ca9a){if(_0x34f07e[_0x6f6c('0x48')]['id']){delete _0x34f07e[_0x6f6c('0x48')]['id'];}return db[_0x6f6c('0x3d')][_0x6f6c('0x45')]({'where':{'id':_0x34f07e['params']['id']}})[_0x6f6c('0x21')](handleEntityNotFound(_0x13ca9a,null))[_0x6f6c('0x21')](saveUpdates(_0x34f07e[_0x6f6c('0x48')],null))['then'](respondWithResult(_0x13ca9a,null))[_0x6f6c('0x19')](handleError(_0x13ca9a,null));};exports[_0x6f6c('0x49')]=function(_0x141e54,_0x567356){return db[_0x6f6c('0x3d')][_0x6f6c('0x45')]({'where':{'id':_0x141e54[_0x6f6c('0x43')]['id']}})[_0x6f6c('0x21')](handleEntityNotFound(_0x567356,null))[_0x6f6c('0x21')](removeEntity(_0x567356,null))[_0x6f6c('0x19')](handleError(_0x567356,null));};exports[_0x6f6c('0x4a')]=function(_0x156061,_0x579672){return db[_0x6f6c('0x3d')]['describe']()[_0x6f6c('0x21')](respondWithResult(_0x579672,null))[_0x6f6c('0x19')](handleError(_0x579672,null));};exports[_0x6f6c('0x4b')]=function(_0x3f7c78,_0x241acc){var _0x5c18d3='chat';return interactionService[_0x6f6c('0x4c')](_0x3f7c78,_0x5c18d3)[_0x6f6c('0x21')](respondWithResult(_0x241acc,null))[_0x6f6c('0x19')](handleError(_0x241acc,null));};exports[_0x6f6c('0x4d')]=function(_0x49cb28,_0x310f6f){var _0x14efff={'agent':{},'channel':_0x6f6c('0x4e')};if(_0x49cb28[_0x6f6c('0x48')]['id']){delete _0x49cb28['body']['id'];}_0x49cb28['body']['UserId']=_0x49cb28[_0x6f6c('0x48')][_0x6f6c('0x4f')]||_0x49cb28['user']['id'];_0x14efff[_0x6f6c('0x50')]['id']=_0x49cb28['body'][_0x6f6c('0x4f')];return db[_0x6f6c('0x3d')][_0x6f6c('0x45')]({'where':{'id':_0x49cb28[_0x6f6c('0x43')]['id'],'UserId':null}})[_0x6f6c('0x21')](handleEntityNotFound(_0x310f6f,null))[_0x6f6c('0x21')](function(_0x1ef112){if(_0x1ef112){_0x14efff['message']=_0x1ef112[_0x6f6c('0x51')]({'plain':!![]});return db[_0x6f6c('0x52')][_0x6f6c('0x45')]({'where':{'id':_0x1ef112['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x310f6f,null))['then'](function(_0x44526f){if(_0x44526f){_0x14efff['interaction']=_0x44526f['get']({'plain':!![]});interaction_log[_0x6f6c('0x10')](_0x6f6c('0x53'),_0x49cb28[_0x6f6c('0x54')]['id'],_0x49cb28[_0x6f6c('0x54')][_0x6f6c('0x25')],_0x49cb28[_0x6f6c('0x54')][_0x6f6c('0x55')],_0x14efff['interaction']['id'],_0x49cb28[_0x6f6c('0x48')]?JSON['stringify'](_0x49cb28[_0x6f6c('0x48')]):_0x6f6c('0x56'));return respondWithRpcPromise(_0x6f6c('0x57'),_0x6f6c('0x58'),_0x14efff);}return null;})[_0x6f6c('0x21')](function(_0x23c02b){var _0x3e7aa0=_0x6f6c('0x59')+_0x23c02b['message'][_0x6f6c('0x5a')];return db[_0x6f6c('0x5b')][_0x6f6c('0x2d')](_0x3e7aa0,{'type':db['Sequelize'][_0x6f6c('0x5c')][_0x6f6c('0x5d')],'raw':!![]})['then'](function(_0x682fa){return _0x682fa;});})[_0x6f6c('0x21')](function(_0xcc6ced){if(_0xcc6ced){_0x14efff[_0x6f6c('0x17')]['contact']=_0xcc6ced[0x0];if(!_0x49cb28['body'][_0x6f6c('0x4f')])return;return db['User']['find']({'where':{'id':_0x49cb28[_0x6f6c('0x48')]['UserId'],'role':_0x6f6c('0x50')},'attributes':['id',_0x6f6c('0x25'),_0x6f6c('0x5e'),_0x6f6c('0x5f'),_0x6f6c('0x60')],'raw':!![]});}return null;})['then'](function(_0x29aa17){if(!_0x29aa17)return null;_0x14efff[_0x6f6c('0x17')][_0x6f6c('0x50')]=_0x29aa17;return _0x14efff;})[_0x6f6c('0x21')](function(_0x371760){if(_0x371760){_0x371760[_0x6f6c('0x17')]['interface']=util[_0x6f6c('0x61')](_0x6f6c('0x62'),_0x49cb28[_0x6f6c('0x54')]['name']);_0x371760[_0x6f6c('0x17')][_0x6f6c('0x63')]=_0x14efff[_0x6f6c('0x63')];_0x371760[_0x6f6c('0x17')]['motionChannel']=_0x14efff['channel'];_0x371760['message'][_0x6f6c('0x64')]=_0x6f6c('0x4d');respondWithRpcPromise(_0x6f6c('0x65'),_0x6f6c('0x65'),{'event':_0x6f6c('0x66'),'message':_[_0x6f6c('0x3a')](_0x14efff['message'],JSON['parse'](_0x14efff[_0x6f6c('0x67')][_0x6f6c('0x68')]))},client9002);return _0x14efff;}return null;})[_0x6f6c('0x21')](respondWithResult(_0x310f6f,null))[_0x6f6c('0x19')](handleError(_0x310f6f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c0a4105..c26a15d 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 _0xe33a=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x2b81be,_0x544bdf){var _0x8ed4a7=function(_0x4a7bf4){while(--_0x4a7bf4){_0x2b81be['push'](_0x2b81be['shift']());}};_0x8ed4a7(++_0x544bdf);}(_0xe33a,0x106));var _0xae33=function(_0x21e2e7,_0x5d28ae){_0x21e2e7=_0x21e2e7-0x0;var _0x4fb468=_0xe33a[_0x21e2e7];return _0x4fb468;};'use strict';var EventEmitter=require(_0xae33('0x0'));var ChatMessage=require(_0xae33('0x1'))['db'][_0xae33('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xae33('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xae33('0x4')};function emitEvent(_0xe56fd){return function(_0x1c1774,_0x2788a9,_0xab24d0){ChatMessageEvents[_0xae33('0x5')](_0xe56fd+':'+_0x1c1774['id'],_0x1c1774);ChatMessageEvents[_0xae33('0x5')](_0xe56fd,_0x1c1774);_0xab24d0(null);};}for(var e in events){if(events[_0xae33('0x6')](e)){var event=events[e];ChatMessage[_0xae33('0x7')](e,emitEvent(event));}}module[_0xae33('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x2a0a=['save','remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x5e7361,_0x31140d){var _0x248a05=function(_0x292e2c){while(--_0x292e2c){_0x5e7361['push'](_0x5e7361['shift']());}};_0x248a05(++_0x31140d);}(_0x2a0a,0x1e4));var _0xa2a0=function(_0x4a1b40,_0x3b0b46){_0x4a1b40=_0x4a1b40-0x0;var _0x268522=_0x2a0a[_0x4a1b40];return _0x268522;};'use strict';var EventEmitter=require(_0xa2a0('0x0'));var ChatMessage=require(_0xa2a0('0x1'))['db'][_0xa2a0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa2a0('0x3')](0x0);var events={'afterCreate':_0xa2a0('0x4'),'afterUpdate':'update','afterDestroy':_0xa2a0('0x5')};function emitEvent(_0x22012d){return function(_0x371d2f,_0x2b000a,_0x94948){ChatMessageEvents[_0xa2a0('0x6')](_0x22012d+':'+_0x371d2f['id'],_0x371d2f);ChatMessageEvents[_0xa2a0('0x6')](_0x22012d,_0x371d2f);_0x94948(null);};}for(var e in events){if(events[_0xa2a0('0x7')](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 eb5743c..f1674a7 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 _0xa157=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','ChatInteractionId','then','createdAt','catch','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xa157,0xf5));var _0x7a15=function(_0x81a64b,_0x1d5afd){_0x81a64b=_0x81a64b-0x0;var _0xd196a2=_0xa157[_0x81a64b];return _0xd196a2;};'use strict';var _=require(_0x7a15('0x0'));var util=require(_0x7a15('0x1'));var logger=require('../../config/logger')(_0x7a15('0x2'));var moment=require('moment');var BPromise=require(_0x7a15('0x3'));var rp=require(_0x7a15('0x4'));var fs=require('fs');var path=require(_0x7a15('0x5'));var rimraf=require(_0x7a15('0x6'));var config=require(_0x7a15('0x7'));var attributes=require(_0x7a15('0x8'));module[_0x7a15('0x9')]=function(_0x3b87be,_0xabbc28){return _0x3b87be[_0x7a15('0xa')](_0x7a15('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x7a15('0xc'),'fields':[_0x7a15('0xd')],'type':_0x7a15('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ce43c,_0x120771,_0x41733d){var _0x237947=_0x3b87be[_0x7a15('0xf')];var _0x196ded=_0x3ce43c[_0x7a15('0x10')]({'plain':!![]});if(_0x196ded[_0x7a15('0x11')]['toLowerCase']()==='in'||_0x196ded[_0x7a15('0x11')][_0x7a15('0x12')]()===_0x7a15('0x13')&&!_0x196ded[_0x7a15('0x14')]&&!_[_0x7a15('0x15')](_0x196ded['UserId'])){_0x237947[_0x7a15('0x16')]['findOne']({'where':{'id':_0x196ded[_0x7a15('0x17')]}})[_0x7a15('0x18')](function(_0x3669c5){if(_0x3669c5){_0x3669c5['update']({'lastMsgAt':_0x196ded[_0x7a15('0x19')],'lastMsgDirection':_0x196ded[_0x7a15('0x11')][_0x7a15('0x12')]()});}})[_0x7a15('0x1a')](function(_0xc2123f){console['error'](_0xc2123f);});}_0x41733d();}},'charset':'utf8mb4','collate':_0x7a15('0x1b')});};
\ No newline at end of file
+var _0x418a=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','isNil','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x4ab756,_0x4b4496){var _0x309a02=function(_0x22646f){while(--_0x22646f){_0x4ab756['push'](_0x4ab756['shift']());}};_0x309a02(++_0x4b4496);}(_0x418a,0xb7));var _0xa418=function(_0x41fe6c,_0xe9f85f){_0x41fe6c=_0x41fe6c-0x0;var _0x51f106=_0x418a[_0x41fe6c];return _0x51f106;};'use strict';var _=require(_0xa418('0x0'));var util=require(_0xa418('0x1'));var logger=require(_0xa418('0x2'))('api');var moment=require(_0xa418('0x3'));var BPromise=require('bluebird');var rp=require(_0xa418('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa418('0x5'));var config=require('../../config/environment');var attributes=require(_0xa418('0x6'));module[_0xa418('0x7')]=function(_0x5b1306,_0x10a8c8){return _0x5b1306[_0xa418('0x8')](_0xa418('0x9'),attributes,{'tableName':_0xa418('0xa'),'paranoid':![],'indexes':[{'name':_0xa418('0xb'),'fields':[_0xa418('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fed75,_0x5d15cb,_0x4d799f){var _0x29cf55=_0x5b1306[_0xa418('0xd')];var _0x43a0bc=_0x1fed75[_0xa418('0xe')]({'plain':!![]});if(_0x43a0bc[_0xa418('0xf')][_0xa418('0x10')]()==='in'||_0x43a0bc['direction']['toLowerCase']()===_0xa418('0x11')&&!_0x43a0bc['secret']&&!_[_0xa418('0x12')](_0x43a0bc['UserId'])){_0x29cf55[_0xa418('0x13')][_0xa418('0x14')]({'where':{'id':_0x43a0bc['ChatInteractionId']}})[_0xa418('0x15')](function(_0x543d2c){if(_0x543d2c){_0x543d2c[_0xa418('0x16')]({'lastMsgAt':_0x43a0bc[_0xa418('0x17')],'lastMsgDirection':_0x43a0bc[_0xa418('0xf')][_0xa418('0x10')]()});}})[_0xa418('0x18')](function(_0x5c6da7){console['error'](_0x5c6da7);});}_0x4d799f();}},'charset':_0xa418('0x19'),'collate':_0xa418('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index e347d01..4ac97eb 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 _0xfdc4=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','stringify','lodash','bluebird','randomstring'];(function(_0x8d3cd,_0x1ca7af){var _0x4fa90f=function(_0x14f599){while(--_0x14f599){_0x8d3cd['push'](_0x8d3cd['shift']());}};_0x4fa90f(++_0x1ca7af);}(_0xfdc4,0x81));var _0x4fdc=function(_0x3c783b,_0x43a9f6){_0x3c783b=_0x3c783b-0x0;var _0x3b2861=_0xfdc4[_0x3c783b];return _0x3b2861;};'use strict';var _=require(_0x4fdc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4fdc('0x1'));var rs=require(_0x4fdc('0x2'));var fs=require('fs');var Redis=require(_0x4fdc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fdc('0x4'));var logger=require(_0x4fdc('0x5'))(_0x4fdc('0x6'));var config=require(_0x4fdc('0x7'));var jayson=require(_0x4fdc('0x8'));var client=jayson[_0x4fdc('0x9')][_0x4fdc('0xa')]({'port':0x232a});config[_0x4fdc('0xb')]=_['defaults'](config[_0x4fdc('0xb')],{'host':_0x4fdc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4fdc('0xb')]));require(_0x4fdc('0xd'))[_0x4fdc('0xe')](socket);function respondWithRpcPromise(_0x3154c7,_0x562acb,_0x55f349){return new BPromise(function(_0x2fd1d9,_0x3c04bd){return client[_0x4fdc('0xf')](_0x3154c7,_0x55f349)[_0x4fdc('0x10')](function(_0x180536){logger[_0x4fdc('0x11')](_0x4fdc('0x12'),_0x562acb,_0x4fdc('0x13'));logger[_0x4fdc('0x14')](_0x4fdc('0x15'),_0x562acb,_0x4fdc('0x13'),JSON['stringify'](_0x180536));if(_0x180536[_0x4fdc('0x16')]){if(_0x180536[_0x4fdc('0x16')][_0x4fdc('0x17')]===0x1f4){logger[_0x4fdc('0x16')](_0x4fdc('0x12'),_0x562acb,_0x180536['error'][_0x4fdc('0x18')]);return _0x3c04bd(_0x180536['error'][_0x4fdc('0x18')]);}logger[_0x4fdc('0x16')](_0x4fdc('0x12'),_0x562acb,_0x180536[_0x4fdc('0x16')][_0x4fdc('0x18')]);return _0x2fd1d9(_0x180536['error'][_0x4fdc('0x18')]);}else{logger['info'](_0x4fdc('0x12'),_0x562acb,_0x4fdc('0x13'));_0x2fd1d9(_0x180536[_0x4fdc('0x19')][_0x4fdc('0x18')]);}})[_0x4fdc('0x1a')](function(_0x3969df){logger[_0x4fdc('0x16')](_0x4fdc('0x12'),_0x562acb,_0x3969df);_0x3c04bd(_0x3969df);});});}exports[_0x4fdc('0x1b')]=function(_0x2e8af0){var _0x2641b0=this;return new Promise(function(_0x12ce81,_0xd3f688){return db['ChatMessage'][_0x4fdc('0x1c')](_0x2e8af0[_0x4fdc('0x1d')],{'raw':_0x2e8af0[_0x4fdc('0x1e')]?_0x2e8af0[_0x4fdc('0x1e')][_0x4fdc('0x1f')]===undefined?!![]:![]:!![]})[_0x4fdc('0x10')](function(_0x25fa18){logger[_0x4fdc('0x11')]('CreateChatMessage',_0x2e8af0);logger[_0x4fdc('0x14')]('CreateChatMessage',_0x2e8af0,JSON[_0x4fdc('0x20')](_0x25fa18));_0x12ce81(_0x25fa18);})[_0x4fdc('0x1a')](function(_0x230541){logger[_0x4fdc('0x16')](_0x4fdc('0x1b'),_0x230541[_0x4fdc('0x18')],_0x2e8af0);_0xd3f688(_0x2641b0[_0x4fdc('0x16')](0x1f4,_0x230541[_0x4fdc('0x18')]));});});};
\ No newline at end of file
+var _0x5aae=['stringify','error','message','request\x20sent','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','redis','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0xf78a1e,_0x19af07){var _0xc72a=function(_0xf84ce5){while(--_0xf84ce5){_0xf78a1e['push'](_0xf78a1e['shift']());}};_0xc72a(++_0x19af07);}(_0x5aae,0xe5));var _0xe5aa=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x5aae[_0x41e8c4];return _0x54ffbe;};'use strict';var _=require(_0xe5aa('0x0'));var util=require(_0xe5aa('0x1'));var moment=require(_0xe5aa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5aa('0x3'))['db'];var utils=require(_0xe5aa('0x4'));var logger=require(_0xe5aa('0x5'))('rpc');var config=require(_0xe5aa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe5aa('0x7')][_0xe5aa('0x8')]({'port':0x232a});config['redis']=_[_0xe5aa('0x9')](config['redis'],{'host':_0xe5aa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5aa('0xb')]));require(_0xe5aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xfb2450,_0x42f6ff,_0x3197e2){return new BPromise(function(_0x232e1b,_0x5c3512){return client[_0xe5aa('0xd')](_0xfb2450,_0x3197e2)[_0xe5aa('0xe')](function(_0x498150){logger[_0xe5aa('0xf')](_0xe5aa('0x10'),_0x42f6ff,'request\x20sent');logger[_0xe5aa('0x11')](_0xe5aa('0x12'),_0x42f6ff,'request\x20sent',JSON[_0xe5aa('0x13')](_0x498150));if(_0x498150[_0xe5aa('0x14')]){if(_0x498150[_0xe5aa('0x14')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x42f6ff,_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);return _0x5c3512(_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);}logger[_0xe5aa('0x14')](_0xe5aa('0x10'),_0x42f6ff,_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);return _0x232e1b(_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);}else{logger[_0xe5aa('0xf')](_0xe5aa('0x10'),_0x42f6ff,_0xe5aa('0x16'));_0x232e1b(_0x498150[_0xe5aa('0x17')][_0xe5aa('0x15')]);}})[_0xe5aa('0x18')](function(_0x3e6021){logger[_0xe5aa('0x14')]('ChatMessage,\x20%s,\x20%s',_0x42f6ff,_0x3e6021);_0x5c3512(_0x3e6021);});});}exports['CreateChatMessage']=function(_0x18cca0){var _0x37b354=this;return new Promise(function(_0xdc3427,_0x3a3f11){return db[_0xe5aa('0x19')][_0xe5aa('0x1a')](_0x18cca0[_0xe5aa('0x1b')],{'raw':_0x18cca0[_0xe5aa('0x1c')]?_0x18cca0[_0xe5aa('0x1c')][_0xe5aa('0x1d')]===undefined?!![]:![]:!![]})[_0xe5aa('0xe')](function(_0x545376){logger[_0xe5aa('0xf')](_0xe5aa('0x1e'),_0x18cca0);logger[_0xe5aa('0x11')](_0xe5aa('0x1e'),_0x18cca0,JSON['stringify'](_0x545376));_0xdc3427(_0x545376);})[_0xe5aa('0x18')](function(_0x479537){logger[_0xe5aa('0x14')](_0xe5aa('0x1e'),_0x479537[_0xe5aa('0x15')],_0x18cca0);_0x3a3f11(_0x37b354[_0xe5aa('0x14')](0x1f4,_0x479537[_0xe5aa('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 52f7833..ccad792 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 _0x2a3a=['save','remove','update','emit','removeListener','register','length','./chatMessage.events'];(function(_0x5480fe,_0x2c0e51){var _0x4cd88d=function(_0x3c3c89){while(--_0x3c3c89){_0x5480fe['push'](_0x5480fe['shift']());}};_0x4cd88d(++_0x2c0e51);}(_0x2a3a,0x1bf));var _0xa2a3=function(_0x5870ae,_0x5ca9de){_0x5870ae=_0x5870ae-0x0;var _0x4f5d9e=_0x2a3a[_0x5870ae];return _0x4f5d9e;};'use strict';var ChatMessageEvents=require(_0xa2a3('0x0'));var events=[_0xa2a3('0x1'),_0xa2a3('0x2'),_0xa2a3('0x3')];function createListener(_0x45ba85,_0x4caf0f){return function(_0x531167){_0x4caf0f[_0xa2a3('0x4')](_0x45ba85,_0x531167);};}function removeListener(_0x34d7f9,_0x1e61b2){return function(){ChatMessageEvents[_0xa2a3('0x5')](_0x34d7f9,_0x1e61b2);};}exports[_0xa2a3('0x6')]=function(_0xf652d7){for(var _0x186655=0x0,_0x5e5e50=events[_0xa2a3('0x7')];_0x186655<_0x5e5e50;_0x186655++){var _0x196c96=events[_0x186655];var _0x2a3753=createListener('chatMessage:'+_0x196c96,_0xf652d7);ChatMessageEvents['on'](_0x196c96,_0x2a3753);}};
\ No newline at end of file
+var _0xcd59=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x31e16a,_0x210c6c){var _0x58e686=function(_0x2bb73c){while(--_0x2bb73c){_0x31e16a['push'](_0x31e16a['shift']());}};_0x58e686(++_0x210c6c);}(_0xcd59,0x14b));var _0x9cd5=function(_0x2df7c7,_0x5ec3eb){_0x2df7c7=_0x2df7c7-0x0;var _0x42995b=_0xcd59[_0x2df7c7];return _0x42995b;};'use strict';var ChatMessageEvents=require(_0x9cd5('0x0'));var events=[_0x9cd5('0x1'),_0x9cd5('0x2'),_0x9cd5('0x3')];function createListener(_0x271070,_0x302b21){return function(_0x4b93b9){_0x302b21[_0x9cd5('0x4')](_0x271070,_0x4b93b9);};}function removeListener(_0x191236,_0xf96efa){return function(){ChatMessageEvents[_0x9cd5('0x5')](_0x191236,_0xf96efa);};}exports[_0x9cd5('0x6')]=function(_0x2db192){for(var _0x46277c=0x0,_0x2cd19a=events[_0x9cd5('0x7')];_0x46277c<_0x2cd19a;_0x46277c++){var _0x3f888f=events[_0x46277c];var _0x545407=createListener(_0x9cd5('0x8')+_0x3f888f,_0x2db192);ChatMessageEvents['on'](_0x3f888f,_0x545407);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f6bf161..e59331e 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 _0xea04=['get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller'];(function(_0x25806f,_0x1b1392){var _0x56117d=function(_0x103383){while(--_0x103383){_0x25806f['push'](_0x25806f['shift']());}};_0x56117d(++_0x1b1392);}(_0xea04,0x7a));var _0x4ea0=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0xea04[_0x11fb16];return _0x343de1;};'use strict';var multer=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var path=require(_0x4ea0('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ea0('0x3'));var router=express['Router']();var fs_extra=require(_0x4ea0('0x4'));var auth=require(_0x4ea0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ea0('0x6'));var controller=require(_0x4ea0('0x7'));router[_0x4ea0('0x8')]('/',auth[_0x4ea0('0x9')](),controller[_0x4ea0('0xa')]);router['get'](_0x4ea0('0xb'),auth[_0x4ea0('0x9')](),controller[_0x4ea0('0xc')]);router[_0x4ea0('0x8')](_0x4ea0('0xd'),auth[_0x4ea0('0x9')](),controller[_0x4ea0('0xe')]);router[_0x4ea0('0xf')]('/',auth[_0x4ea0('0x9')](),interaction[_0x4ea0('0x10')](_0x4ea0('0x11'),_0x4ea0('0x12')),controller['create']);router[_0x4ea0('0x13')](_0x4ea0('0xd'),controller[_0x4ea0('0x14')]);router['put'](_0x4ea0('0x15'),auth['isAuthenticated'](),controller[_0x4ea0('0x16')]);router['put']('/:id/reject',auth[_0x4ea0('0x9')](),controller[_0x4ea0('0x17')]);router[_0x4ea0('0x18')](_0x4ea0('0xd'),auth[_0x4ea0('0x9')](),controller[_0x4ea0('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x6328=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','chat','create','put','update','/:id/accept','reject'];(function(_0xce8373,_0x2ad630){var _0xa5cd5f=function(_0x5e0be0){while(--_0x5e0be0){_0xce8373['push'](_0xce8373['shift']());}};_0xa5cd5f(++_0x2ad630);}(_0x6328,0x1d7));var _0x8632=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0x6328[_0xbf5e16];return _0x5975a5;};'use strict';var multer=require(_0x8632('0x0'));var util=require(_0x8632('0x1'));var path=require('path');var timeout=require(_0x8632('0x2'));var express=require(_0x8632('0x3'));var router=express[_0x8632('0x4')]();var fs_extra=require(_0x8632('0x5'));var auth=require(_0x8632('0x6'));var interaction=require(_0x8632('0x7'));var config=require(_0x8632('0x8'));var controller=require(_0x8632('0x9'));router[_0x8632('0xa')]('/',auth[_0x8632('0xb')](),controller['index']);router[_0x8632('0xa')](_0x8632('0xc'),auth['isAuthenticated'](),controller[_0x8632('0xd')]);router['get'](_0x8632('0xe'),auth['isAuthenticated'](),controller[_0x8632('0xf')]);router[_0x8632('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x8632('0x11'),'chatmessage:create'),controller[_0x8632('0x12')]);router[_0x8632('0x13')](_0x8632('0xe'),controller[_0x8632('0x14')]);router['put'](_0x8632('0x15'),auth[_0x8632('0xb')](),controller['accept']);router[_0x8632('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8632('0x16')]);router[_0x8632('0x17')](_0x8632('0xe'),auth[_0x8632('0xb')](),controller[_0x8632('0x18')]);module[_0x8632('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8eb86ff..bbabce2 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x5bddb8,_0x4062c5){var _0xcce5e4=function(_0x3e2238){while(--_0x3e2238){_0x5bddb8['push'](_0x5bddb8['shift']());}};_0xcce5e4(++_0x4062c5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x370b75,_0x1e8cf4){var _0x4605ed=function(_0x1de0c3){while(--_0x1de0c3){_0x370b75['push'](_0x370b75['shift']());}};_0x4605ed(++_0x1e8cf4);}(_0x2032,0xd9));var _0x2203=function(_0x3391e5,_0x76cc0d){_0x3391e5=_0x3391e5-0x0;var _0x24387b=_0x2032[_0x3391e5];return _0x24387b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 3cd8e16..acf874e 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(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x7a54,0x106));var _0x47a5=function(_0x3f50fb,_0x172f07){_0x3f50fb=_0x3f50fb-0x0;var _0x2ea639=_0x7a54[_0x3f50fb];return _0x2ea639;};'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(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x7a54,0x106));var _0x47a5=function(_0x48e390,_0x303e2c){_0x48e390=_0x48e390-0x0;var _0x326730=_0x7a54[_0x48e390];return _0x326730;};'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 0df3e39..186ddb1 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 _0x5f0e=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update'];(function(_0x517988,_0x3e3a63){var _0x2e9b5d=function(_0x4f3925){while(--_0x4f3925){_0x517988['push'](_0x517988['shift']());}};_0x2e9b5d(++_0x3e3a63);}(_0x5f0e,0x19a));var _0xe5f0=function(_0x45efa6,_0x14f10c){_0x45efa6=_0x45efa6-0x0;var _0x3535ea=_0x5f0e[_0x45efa6];return _0x3535ea;};'use strict';var EventEmitter=require(_0xe5f0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe5f0('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe5f0('0x2'),'afterDestroy':'remove'};function emitEvent(_0xdb626c){return function(_0x13c9d6,_0x5662ce,_0x4f6c9c){ChatOfflineMessageEvents['emit'](_0xdb626c+':'+_0x13c9d6['id'],_0x13c9d6);ChatOfflineMessageEvents[_0xe5f0('0x3')](_0xdb626c,_0x13c9d6);_0x4f6c9c(null);};}for(var e in events){if(events[_0xe5f0('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xe5f0('0x5')](e,emitEvent(event));}}module[_0xe5f0('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4984=['events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a1f0a,_0x564fcb){var _0x274c22=function(_0x463e1a){while(--_0x463e1a){_0x4a1f0a['push'](_0x4a1f0a['shift']());}};_0x274c22(++_0x564fcb);}(_0x4984,0x154));var _0x4498=function(_0x2f4aa2,_0xb72e14){_0x2f4aa2=_0x2f4aa2-0x0;var _0x4fdb16=_0x4984[_0x2f4aa2];return _0x4fdb16;};'use strict';var EventEmitter=require(_0x4498('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x4498('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4498('0x2')](0x0);var events={'afterCreate':_0x4498('0x3'),'afterUpdate':_0x4498('0x4'),'afterDestroy':_0x4498('0x5')};function emitEvent(_0x549cd5){return function(_0x35a60e,_0x3133a2,_0x7f3761){ChatOfflineMessageEvents[_0x4498('0x6')](_0x549cd5+':'+_0x35a60e['id'],_0x35a60e);ChatOfflineMessageEvents[_0x4498('0x6')](_0x549cd5,_0x35a60e);_0x7f3761(null);};}for(var e in events){if(events[_0x4498('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x4498('0x8')](e,emitEvent(event));}}module[_0x4498('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2b459fb..5d44339 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 _0x19d1=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','define','ChatOfflineMessage'];(function(_0x57f5f2,_0x24a6c9){var _0x1f9429=function(_0x1edb10){while(--_0x1edb10){_0x57f5f2['push'](_0x57f5f2['shift']());}};_0x1f9429(++_0x24a6c9);}(_0x19d1,0x76));var _0x119d=function(_0x424a83,_0x1b3f16){_0x424a83=_0x424a83-0x0;var _0xeefe49=_0x19d1[_0x424a83];return _0xeefe49;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x4a3619){return _0x4a3619[_0x119d('0x0')](_0x119d('0x1'),attributes,{'tableName':_0x119d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x119d('0x3'),'collate':_0x119d('0x4')});};
\ No newline at end of file
+var _0x798a=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage'];(function(_0x5e25d0,_0x15ece2){var _0x13fb23=function(_0xf27573){while(--_0xf27573){_0x5e25d0['push'](_0x5e25d0['shift']());}};_0x13fb23(++_0x15ece2);}(_0x798a,0x1a1));var _0xa798=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x798a[_0x7e2eb0];return _0xd92de4;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xa798('0x0')]=function(_0x20ee10){return _0x20ee10[_0xa798('0x1')](_0xa798('0x2'),attributes,{'tableName':_0xa798('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa798('0x4'),'collate':_0xa798('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index d6c54db..403609f 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 _0x5162=['jayson/promise','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5162,0x103));var _0x2516=function(_0x4179b3,_0x2eaff2){_0x4179b3=_0x4179b3-0x0;var _0x5b5c7e=_0x5162[_0x4179b3];return _0x5b5c7e;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var utils=require(_0x2516('0x3'));var logger=require(_0x2516('0x4'))(_0x2516('0x5'));var config=require(_0x2516('0x6'));var jayson=require(_0x2516('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5beeb3,_0x20a4a4,_0xba4b36){return new BPromise(function(_0xa1557,_0x3a8834){return client[_0x2516('0x8')](_0x5beeb3,_0xba4b36)[_0x2516('0x9')](function(_0x1cb817){logger['info'](_0x2516('0xa'),_0x20a4a4,_0x2516('0xb'));logger[_0x2516('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x20a4a4,'request\x20sent',JSON['stringify'](_0x1cb817));if(_0x1cb817['error']){if(_0x1cb817[_0x2516('0xd')][_0x2516('0xe')]===0x1f4){logger[_0x2516('0xd')](_0x2516('0xa'),_0x20a4a4,_0x1cb817['error'][_0x2516('0xf')]);return _0x3a8834(_0x1cb817[_0x2516('0xd')][_0x2516('0xf')]);}logger[_0x2516('0xd')](_0x2516('0xa'),_0x20a4a4,_0x1cb817[_0x2516('0xd')][_0x2516('0xf')]);return _0xa1557(_0x1cb817[_0x2516('0xd')][_0x2516('0xf')]);}else{logger[_0x2516('0x10')](_0x2516('0xa'),_0x20a4a4,_0x2516('0xb'));_0xa1557(_0x1cb817[_0x2516('0x11')][_0x2516('0xf')]);}})[_0x2516('0x12')](function(_0x5623be){logger[_0x2516('0xd')](_0x2516('0xa'),_0x20a4a4,_0x5623be);_0x3a8834(_0x5623be);});});}
\ No newline at end of file
+var _0x6b6d=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4c10e0,_0x2ef0d2){var _0x2aa24d=function(_0x475a06){while(--_0x475a06){_0x4c10e0['push'](_0x4c10e0['shift']());}};_0x2aa24d(++_0x2ef0d2);}(_0x6b6d,0xbd));var _0xd6b6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x6b6d[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var moment=require(_0xd6b6('0x2'));var BPromise=require(_0xd6b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6b6('0x4'));var db=require(_0xd6b6('0x5'))['db'];var utils=require(_0xd6b6('0x6'));var logger=require(_0xd6b6('0x7'))('rpc');var config=require(_0xd6b6('0x8'));var jayson=require(_0xd6b6('0x9'));var client=jayson[_0xd6b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4fa7,_0x151300,_0xee52b3){return new BPromise(function(_0xb796b4,_0xf48c95){return client[_0xd6b6('0xb')](_0x1d4fa7,_0xee52b3)['then'](function(_0x577101){logger[_0xd6b6('0xc')](_0xd6b6('0xd'),_0x151300,'request\x20sent');logger[_0xd6b6('0xe')](_0xd6b6('0xf'),_0x151300,_0xd6b6('0x10'),JSON[_0xd6b6('0x11')](_0x577101));if(_0x577101[_0xd6b6('0x12')]){if(_0x577101[_0xd6b6('0x12')][_0xd6b6('0x13')]===0x1f4){logger[_0xd6b6('0x12')](_0xd6b6('0xd'),_0x151300,_0x577101['error'][_0xd6b6('0x14')]);return _0xf48c95(_0x577101[_0xd6b6('0x12')][_0xd6b6('0x14')]);}logger[_0xd6b6('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x151300,_0x577101[_0xd6b6('0x12')][_0xd6b6('0x14')]);return _0xb796b4(_0x577101[_0xd6b6('0x12')][_0xd6b6('0x14')]);}else{logger[_0xd6b6('0xc')](_0xd6b6('0xd'),_0x151300,_0xd6b6('0x10'));_0xb796b4(_0x577101[_0xd6b6('0x15')][_0xd6b6('0x14')]);}})[_0xd6b6('0x16')](function(_0x2d3464){logger[_0xd6b6('0x12')](_0xd6b6('0xd'),_0x151300,_0x2d3464);_0xf48c95(_0x2d3464);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 754a881..f8f9316 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 _0x9c99=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','create','put','delete','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c99,0xa5));var _0x99c9=function(_0x454db7,_0x19898f){_0x454db7=_0x454db7-0x0;var _0x520d54=_0x9c99[_0x454db7];return _0x520d54;};'use strict';var multer=require('multer');var util=require(_0x99c9('0x0'));var path=require('path');var timeout=require(_0x99c9('0x1'));var express=require(_0x99c9('0x2'));var router=express['Router']();var fs_extra=require(_0x99c9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x99c9('0x4'));var config=require(_0x99c9('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x99c9('0x6')]('/',auth[_0x99c9('0x7')](),controller['index']);router['get'](_0x99c9('0x8'),auth[_0x99c9('0x7')](),controller['describe']);router[_0x99c9('0x6')](_0x99c9('0x9'),auth[_0x99c9('0x7')](),controller[_0x99c9('0xa')]);router['post']('/',auth[_0x99c9('0x7')](),controller[_0x99c9('0xb')]);router[_0x99c9('0xc')](_0x99c9('0x9'),auth[_0x99c9('0x7')](),controller['update']);router[_0x99c9('0xd')](_0x99c9('0x9'),auth[_0x99c9('0x7')](),controller['destroy']);module[_0x99c9('0xe')]=router;
\ No newline at end of file
+var _0x7a8d=['/:id','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','update'];(function(_0x1b502c,_0x251bbe){var _0x5f5561=function(_0x47bdf7){while(--_0x47bdf7){_0x1b502c['push'](_0x1b502c['shift']());}};_0x5f5561(++_0x251bbe);}(_0x7a8d,0xab));var _0xd7a8=function(_0x546ec1,_0x10b117){_0x546ec1=_0x546ec1-0x0;var _0x3031ef=_0x7a8d[_0x546ec1];return _0x3031ef;};'use strict';var multer=require(_0xd7a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd7a8('0x1'));var express=require(_0xd7a8('0x2'));var router=express['Router']();var fs_extra=require(_0xd7a8('0x3'));var auth=require(_0xd7a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a8('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xd7a8('0x6')]('/',auth[_0xd7a8('0x7')](),controller[_0xd7a8('0x8')]);router['get']('/describe',auth[_0xd7a8('0x7')](),controller['describe']);router[_0xd7a8('0x6')]('/:id',auth[_0xd7a8('0x7')](),controller['show']);router[_0xd7a8('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xd7a8('0x7')](),controller[_0xd7a8('0xa')]);router['delete'](_0xd7a8('0xb'),auth[_0xd7a8('0x7')](),controller[_0xd7a8('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a055965..876e290 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 _0x6533=['mouseOver','timeout','INTEGER','sequelize','ENUM'];(function(_0x46f1c5,_0x74e765){var _0x47230d=function(_0x37e36c){while(--_0x37e36c){_0x46f1c5['push'](_0x46f1c5['shift']());}};_0x47230d(++_0x74e765);}(_0x6533,0x198));var _0x3653=function(_0xece513,_0x252953){_0xece513=_0xece513-0x0;var _0x4f5f69=_0x6533[_0xece513];return _0x4f5f69;};'use strict';var Sequelize=require(_0x3653('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3653('0x1')](_0x3653('0x2'),_0x3653('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3653('0x4')]}};
\ No newline at end of file
+var _0xb2a8=['STRING','INTEGER','exports','ENUM','mouseOver'];(function(_0x4ab759,_0x552b39){var _0x3f3435=function(_0x14aac6){while(--_0x14aac6){_0x4ab759['push'](_0x4ab759['shift']());}};_0x3f3435(++_0x552b39);}(_0xb2a8,0x18d));var _0x8b2a=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xb2a8[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require('sequelize');module[_0x8b2a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8b2a('0x1')](_0x8b2a('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x8b2a('0x3')]},'timeout':{'type':Sequelize[_0x8b2a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 4706ca7..a574fb7 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 _0xb1a3=['limit','count','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x13e086,_0x56e64e){var _0x2efedb=function(_0x12a29a){while(--_0x12a29a){_0x13e086['push'](_0x13e086['shift']());}};_0x2efedb(++_0x56e64e);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xb1a3[_0x5d4f12];return _0x4eb577;};'use strict';var emlformat=require(_0x3b1a('0x0'));var rimraf=require(_0x3b1a('0x1'));var zipdir=require(_0x3b1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b1a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b1a('0x4'));var util=require(_0x3b1a('0x5'));var path=require(_0x3b1a('0x6'));var sox=require(_0x3b1a('0x7'));var csv=require(_0x3b1a('0x8'));var ejs=require(_0x3b1a('0x9'));var fs=require('fs');var fs_extra=require(_0x3b1a('0xa'));var _=require('lodash');var squel=require(_0x3b1a('0xb'));var crypto=require(_0x3b1a('0xc'));var jsforce=require(_0x3b1a('0xd'));var deskjs=require(_0x3b1a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b1a('0xf'));var Redis=require(_0x3b1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b1a('0x12'));var logger=require('../../config/logger')(_0x3b1a('0x13'));var utils=require(_0x3b1a('0x14'));var config=require(_0x3b1a('0x15'));var licenseUtil=require(_0x3b1a('0x16'));var db=require(_0x3b1a('0x17'))['db'];function respondWithStatusCode(_0x1fea99,_0x2bd423){_0x2bd423=_0x2bd423||0xcc;return function(_0x32e77a){if(_0x32e77a){return _0x1fea99[_0x3b1a('0x18')](_0x2bd423);}return _0x1fea99['status'](_0x2bd423)['end']();};}function respondWithResult(_0x8aad4b,_0x3dfeda){_0x3dfeda=_0x3dfeda||0xc8;return function(_0x19c135){if(_0x19c135){return _0x8aad4b[_0x3b1a('0x19')](_0x3dfeda)['json'](_0x19c135);}};}function respondWithFilteredResult(_0x1b175e,_0x2f0674){return function(_0x55ac06){if(_0x55ac06){var _0x19bbc1=typeof _0x2f0674[_0x3b1a('0x1a')]===_0x3b1a('0x1b')&&typeof _0x2f0674[_0x3b1a('0x1c')]===_0x3b1a('0x1b');var _0xf10b60=_0x55ac06[_0x3b1a('0x1d')];var _0x220869=_0x19bbc1?0x0:_0x2f0674['offset'];var _0x14996f=_0x19bbc1?_0x55ac06[_0x3b1a('0x1d')]:_0x2f0674['offset']+_0x2f0674[_0x3b1a('0x1c')];var _0x5758fd;if(_0x14996f>=_0xf10b60){_0x14996f=_0xf10b60;_0x5758fd=0xc8;}else{_0x5758fd=0xce;}_0x1b175e[_0x3b1a('0x19')](_0x5758fd);return _0x1b175e[_0x3b1a('0x1e')](_0x3b1a('0x1f'),_0x220869+'-'+_0x14996f+'/'+_0xf10b60)[_0x3b1a('0x20')](_0x55ac06);}return null;};}function patchUpdates(_0xe1113d){return function(_0x13eeec){try{jsonpatch['apply'](_0x13eeec,_0xe1113d,!![]);}catch(_0x2c0a87){return BPromise[_0x3b1a('0x21')](_0x2c0a87);}return _0x13eeec[_0x3b1a('0x22')]();};}function saveUpdates(_0x1a09f1,_0x42bdf6){return function(_0x4f5f52){if(_0x4f5f52){return _0x4f5f52['update'](_0x1a09f1)[_0x3b1a('0x23')](function(_0x447d94){return _0x447d94;});}return null;};}function removeEntity(_0x5829ea,_0x3af980){return function(_0x1728df){if(_0x1728df){return _0x1728df[_0x3b1a('0x24')]()[_0x3b1a('0x23')](function(){_0x5829ea['status'](0xcc)[_0x3b1a('0x25')]();});}};}function handleEntityNotFound(_0x417c2e,_0x2fbac5){return function(_0x482484){if(!_0x482484){_0x417c2e[_0x3b1a('0x18')](0x194);}return _0x482484;};}function handleError(_0x3744f0,_0x155d77){_0x155d77=_0x155d77||0x1f4;return function(_0x45ebfc){logger[_0x3b1a('0x26')](_0x45ebfc[_0x3b1a('0x27')]);if(_0x45ebfc['name']){delete _0x45ebfc[_0x3b1a('0x28')];}_0x3744f0[_0x3b1a('0x19')](_0x155d77)[_0x3b1a('0x29')](_0x45ebfc);};}exports[_0x3b1a('0x2a')]=function(_0x2ff415,_0x1c6399){var _0x5cb4d0={'raw':!![],'where':{'id':_0x2ff415[_0x3b1a('0x2b')]['id']}},_0x58aec7={};_0x58aec7[_0x3b1a('0x2c')]=_[_0x3b1a('0x2d')](db[_0x3b1a('0x2e')][_0x3b1a('0x2f')]);_0x58aec7[_0x3b1a('0x30')]=_[_0x3b1a('0x2d')](_0x2ff415[_0x3b1a('0x30')]);_0x58aec7[_0x3b1a('0x31')]=_['intersection'](_0x58aec7[_0x3b1a('0x2c')],_0x58aec7[_0x3b1a('0x30')]);_0x5cb4d0[_0x3b1a('0x32')]=_[_0x3b1a('0x33')](_0x58aec7[_0x3b1a('0x2c')],qs[_0x3b1a('0x34')](_0x2ff415[_0x3b1a('0x30')][_0x3b1a('0x34')]));_0x5cb4d0[_0x3b1a('0x32')]=_0x5cb4d0['attributes'][_0x3b1a('0x35')]?_0x5cb4d0[_0x3b1a('0x32')]:_0x58aec7[_0x3b1a('0x2c')];if(_0x2ff415[_0x3b1a('0x30')]['includeAll']){_0x5cb4d0[_0x3b1a('0x36')]=[{'all':!![]}];}_0x5cb4d0=_[_0x3b1a('0x37')]({},_0x5cb4d0,_0x2ff415[_0x3b1a('0x38')]);return db[_0x3b1a('0x2e')][_0x3b1a('0x39')](_0x5cb4d0)[_0x3b1a('0x23')](handleEntityNotFound(_0x1c6399,null))[_0x3b1a('0x23')](respondWithResult(_0x1c6399,null))[_0x3b1a('0x3a')](handleError(_0x1c6399,null));};exports['create']=function(_0x189e00,_0x2be45d){return db[_0x3b1a('0x2e')][_0x3b1a('0x3b')](_0x189e00[_0x3b1a('0x3c')],{})[_0x3b1a('0x23')](respondWithResult(_0x2be45d,0xc9))[_0x3b1a('0x3a')](handleError(_0x2be45d,null));};exports['update']=function(_0x3c2108,_0x420d13){if(_0x3c2108[_0x3b1a('0x3c')]['id']){delete _0x3c2108[_0x3b1a('0x3c')]['id'];}return db['ChatProactiveAction'][_0x3b1a('0x39')]({'where':{'id':_0x3c2108[_0x3b1a('0x2b')]['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x420d13,null))[_0x3b1a('0x23')](saveUpdates(_0x3c2108[_0x3b1a('0x3c')],null))[_0x3b1a('0x23')](respondWithResult(_0x420d13,null))[_0x3b1a('0x3a')](handleError(_0x420d13,null));};exports[_0x3b1a('0x24')]=function(_0x228667,_0x5277bb){return db[_0x3b1a('0x2e')][_0x3b1a('0x39')]({'where':{'id':_0x228667['params']['id']}})[_0x3b1a('0x23')](handleEntityNotFound(_0x5277bb,null))[_0x3b1a('0x23')](removeEntity(_0x5277bb,null))[_0x3b1a('0x3a')](handleError(_0x5277bb,null));};
\ No newline at end of file
+var _0x7722=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','show','params','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x252e9d,_0x4d938b){var _0x251f6d=function(_0x5c97e7){while(--_0x5c97e7){_0x252e9d['push'](_0x252e9d['shift']());}};_0x251f6d(++_0x4d938b);}(_0x7722,0x14e));var _0x2772=function(_0x3c85f1,_0x4cee02){_0x3c85f1=_0x3c85f1-0x0;var _0x22ad27=_0x7722[_0x3c85f1];return _0x22ad27;};'use strict';var emlformat=require(_0x2772('0x0'));var rimraf=require(_0x2772('0x1'));var zipdir=require(_0x2772('0x2'));var jsonpatch=require(_0x2772('0x3'));var rp=require(_0x2772('0x4'));var moment=require(_0x2772('0x5'));var BPromise=require(_0x2772('0x6'));var Mustache=require(_0x2772('0x7'));var util=require(_0x2772('0x8'));var path=require('path');var sox=require(_0x2772('0x9'));var csv=require('to-csv');var ejs=require(_0x2772('0xa'));var fs=require('fs');var fs_extra=require(_0x2772('0xb'));var _=require(_0x2772('0xc'));var squel=require(_0x2772('0xd'));var crypto=require(_0x2772('0xe'));var jsforce=require(_0x2772('0xf'));var deskjs=require(_0x2772('0x10'));var toCsv=require(_0x2772('0x11'));var querystring=require(_0x2772('0x12'));var Papa=require(_0x2772('0x13'));var Redis=require(_0x2772('0x14'));var authService=require(_0x2772('0x15'));var qs=require(_0x2772('0x16'));var as=require(_0x2772('0x17'));var hardwareService=require(_0x2772('0x18'));var logger=require(_0x2772('0x19'))('api');var utils=require(_0x2772('0x1a'));var config=require(_0x2772('0x1b'));var licenseUtil=require(_0x2772('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14b427,_0x35afaf){_0x35afaf=_0x35afaf||0xcc;return function(_0x3d1440){if(_0x3d1440){return _0x14b427[_0x2772('0x1d')](_0x35afaf);}return _0x14b427[_0x2772('0x1e')](_0x35afaf)['end']();};}function respondWithResult(_0x21443a,_0x286672){_0x286672=_0x286672||0xc8;return function(_0x38fa62){if(_0x38fa62){return _0x21443a[_0x2772('0x1e')](_0x286672)['json'](_0x38fa62);}};}function respondWithFilteredResult(_0x1aecec,_0x580a8b){return function(_0x245645){if(_0x245645){var _0x122628=typeof _0x580a8b[_0x2772('0x1f')]===_0x2772('0x20')&&typeof _0x580a8b[_0x2772('0x21')]===_0x2772('0x20');var _0x314ba1=_0x245645['count'];var _0x27868d=_0x122628?0x0:_0x580a8b[_0x2772('0x1f')];var _0x3dd1ed=_0x122628?_0x245645[_0x2772('0x22')]:_0x580a8b[_0x2772('0x1f')]+_0x580a8b[_0x2772('0x21')];var _0x34eb25;if(_0x3dd1ed>=_0x314ba1){_0x3dd1ed=_0x314ba1;_0x34eb25=0xc8;}else{_0x34eb25=0xce;}_0x1aecec[_0x2772('0x1e')](_0x34eb25);return _0x1aecec[_0x2772('0x23')](_0x2772('0x24'),_0x27868d+'-'+_0x3dd1ed+'/'+_0x314ba1)['json'](_0x245645);}return null;};}function patchUpdates(_0x51beac){return function(_0x123e62){try{jsonpatch[_0x2772('0x25')](_0x123e62,_0x51beac,!![]);}catch(_0x2ef869){return BPromise[_0x2772('0x26')](_0x2ef869);}return _0x123e62[_0x2772('0x27')]();};}function saveUpdates(_0x4a3e28,_0x35a0dd){return function(_0x11c1b8){if(_0x11c1b8){return _0x11c1b8['update'](_0x4a3e28)['then'](function(_0x499214){return _0x499214;});}return null;};}function removeEntity(_0x5bc8f7,_0x52c703){return function(_0x4147dc){if(_0x4147dc){return _0x4147dc['destroy']()[_0x2772('0x28')](function(){_0x5bc8f7[_0x2772('0x1e')](0xcc)[_0x2772('0x29')]();});}};}function handleEntityNotFound(_0x26ffc5,_0x3d4c2f){return function(_0x111fdd){if(!_0x111fdd){_0x26ffc5[_0x2772('0x1d')](0x194);}return _0x111fdd;};}function handleError(_0xd34b26,_0x43995a){_0x43995a=_0x43995a||0x1f4;return function(_0x2de9a4){logger[_0x2772('0x2a')](_0x2de9a4[_0x2772('0x2b')]);if(_0x2de9a4['name']){delete _0x2de9a4[_0x2772('0x2c')];}_0xd34b26[_0x2772('0x1e')](_0x43995a)[_0x2772('0x2d')](_0x2de9a4);};}exports[_0x2772('0x2e')]=function(_0x3c7dda,_0x4923b0){var _0x4583d4={'raw':!![],'where':{'id':_0x3c7dda[_0x2772('0x2f')]['id']}},_0x4323f0={};_0x4323f0['model']=_['keys'](db[_0x2772('0x30')][_0x2772('0x31')]);_0x4323f0[_0x2772('0x32')]=_[_0x2772('0x33')](_0x3c7dda['query']);_0x4323f0[_0x2772('0x34')]=_[_0x2772('0x35')](_0x4323f0[_0x2772('0x36')],_0x4323f0['query']);_0x4583d4[_0x2772('0x37')]=_[_0x2772('0x35')](_0x4323f0[_0x2772('0x36')],qs['fields'](_0x3c7dda['query'][_0x2772('0x38')]));_0x4583d4['attributes']=_0x4583d4['attributes'][_0x2772('0x39')]?_0x4583d4[_0x2772('0x37')]:_0x4323f0[_0x2772('0x36')];if(_0x3c7dda[_0x2772('0x32')][_0x2772('0x3a')]){_0x4583d4[_0x2772('0x3b')]=[{'all':!![]}];}_0x4583d4=_[_0x2772('0x3c')]({},_0x4583d4,_0x3c7dda[_0x2772('0x3d')]);return db[_0x2772('0x30')][_0x2772('0x3e')](_0x4583d4)[_0x2772('0x28')](handleEntityNotFound(_0x4923b0,null))[_0x2772('0x28')](respondWithResult(_0x4923b0,null))[_0x2772('0x3f')](handleError(_0x4923b0,null));};exports['create']=function(_0xef3a95,_0x3b3ef2){return db[_0x2772('0x30')][_0x2772('0x40')](_0xef3a95['body'],{})[_0x2772('0x28')](respondWithResult(_0x3b3ef2,0xc9))[_0x2772('0x3f')](handleError(_0x3b3ef2,null));};exports[_0x2772('0x41')]=function(_0x20aefd,_0x44ef94){if(_0x20aefd[_0x2772('0x42')]['id']){delete _0x20aefd[_0x2772('0x42')]['id'];}return db[_0x2772('0x30')]['find']({'where':{'id':_0x20aefd[_0x2772('0x2f')]['id']}})[_0x2772('0x28')](handleEntityNotFound(_0x44ef94,null))[_0x2772('0x28')](saveUpdates(_0x20aefd[_0x2772('0x42')],null))['then'](respondWithResult(_0x44ef94,null))[_0x2772('0x3f')](handleError(_0x44ef94,null));};exports[_0x2772('0x43')]=function(_0x488424,_0x2eb1e6){return db[_0x2772('0x30')][_0x2772('0x3e')]({'where':{'id':_0x488424[_0x2772('0x2f')]['id']}})[_0x2772('0x28')](handleEntityNotFound(_0x2eb1e6,null))[_0x2772('0x28')](removeEntity(_0x2eb1e6,null))[_0x2772('0x3f')](handleError(_0x2eb1e6,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index af03411..2be812d 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 _0xce70=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0xce70,0x9a));var _0x0ce7=function(_0x53091a,_0x32a4d1){_0x53091a=_0x53091a-0x0;var _0x147390=_0xce70[_0x53091a];return _0x147390;};'use strict';var _=require(_0x0ce7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ce7('0x1'));var moment=require(_0x0ce7('0x2'));var BPromise=require(_0x0ce7('0x3'));var rp=require(_0x0ce7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ce7('0x5'));var config=require(_0x0ce7('0x6'));var attributes=require(_0x0ce7('0x7'));module['exports']=function(_0xd7238d,_0xa6ca81){return _0xd7238d[_0x0ce7('0x8')](_0x0ce7('0x9'),attributes,{'tableName':_0x0ce7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f57=['define','ChatProactiveAction','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x3bc086,_0x2d5f25){var _0x434424=function(_0x1d2bfa){while(--_0x1d2bfa){_0x3bc086['push'](_0x3bc086['shift']());}};_0x434424(++_0x2d5f25);}(_0x3f57,0x1ca));var _0x73f5=function(_0x396d77,_0x3d62b1){_0x396d77=_0x396d77-0x0;var _0x22379a=_0x3f57[_0x396d77];return _0x22379a;};'use strict';var _=require(_0x73f5('0x0'));var util=require(_0x73f5('0x1'));var logger=require('../../config/logger')(_0x73f5('0x2'));var moment=require(_0x73f5('0x3'));var BPromise=require(_0x73f5('0x4'));var rp=require(_0x73f5('0x5'));var fs=require('fs');var path=require(_0x73f5('0x6'));var rimraf=require('rimraf');var config=require(_0x73f5('0x7'));var attributes=require(_0x73f5('0x8'));module[_0x73f5('0x9')]=function(_0x57e2e0,_0x577a36){return _0x57e2e0[_0x73f5('0xa')](_0x73f5('0xb'),attributes,{'tableName':'chat_proactive_actions','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 1db6a6f..8cc017d 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 _0xacd7=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch'];(function(_0xf44b77,_0x28e6e2){var _0x3c8e22=function(_0x2d0d11){while(--_0x2d0d11){_0xf44b77['push'](_0xf44b77['shift']());}};_0x3c8e22(++_0x28e6e2);}(_0xacd7,0x1a2));var _0x7acd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7acd('0x0'));var moment=require(_0x7acd('0x1'));var BPromise=require(_0x7acd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7acd('0x3'))['db'];var utils=require(_0x7acd('0x4'));var logger=require(_0x7acd('0x5'))('rpc');var config=require(_0x7acd('0x6'));var jayson=require(_0x7acd('0x7'));var client=jayson[_0x7acd('0x8')][_0x7acd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x322352,_0x2d0d3e,_0x156374){return new BPromise(function(_0x13c827,_0x35e0bc){return client[_0x7acd('0xa')](_0x322352,_0x156374)[_0x7acd('0xb')](function(_0x2a87bc){logger['info'](_0x7acd('0xc'),_0x2d0d3e,'request\x20sent');logger[_0x7acd('0xd')](_0x7acd('0xe'),_0x2d0d3e,_0x7acd('0xf'),JSON[_0x7acd('0x10')](_0x2a87bc));if(_0x2a87bc[_0x7acd('0x11')]){if(_0x2a87bc[_0x7acd('0x11')][_0x7acd('0x12')]===0x1f4){logger[_0x7acd('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d0d3e,_0x2a87bc[_0x7acd('0x11')]['message']);return _0x35e0bc(_0x2a87bc[_0x7acd('0x11')][_0x7acd('0x13')]);}logger['error'](_0x7acd('0xc'),_0x2d0d3e,_0x2a87bc[_0x7acd('0x11')][_0x7acd('0x13')]);return _0x13c827(_0x2a87bc['error'][_0x7acd('0x13')]);}else{logger[_0x7acd('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d0d3e,'request\x20sent');_0x13c827(_0x2a87bc['result']['message']);}})[_0x7acd('0x15')](function(_0xd159bf){logger[_0x7acd('0x11')](_0x7acd('0xc'),_0x2d0d3e,_0xd159bf);_0x35e0bc(_0xd159bf);});});}
\ No newline at end of file
+var _0x56c1=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x56c1,0xb7));var _0x156c=function(_0x50caa6,_0x140c98){_0x50caa6=_0x50caa6-0x0;var _0x5627eb=_0x56c1[_0x50caa6];return _0x5627eb;};'use strict';var _=require(_0x156c('0x0'));var util=require('util');var moment=require(_0x156c('0x1'));var BPromise=require(_0x156c('0x2'));var rs=require(_0x156c('0x3'));var fs=require('fs');var Redis=require(_0x156c('0x4'));var db=require(_0x156c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x156c('0x6'))(_0x156c('0x7'));var config=require(_0x156c('0x8'));var jayson=require(_0x156c('0x9'));var client=jayson[_0x156c('0xa')][_0x156c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59b8b5,_0x1b984c,_0x23f2c0){return new BPromise(function(_0x5f1e5b,_0x17c15f){return client[_0x156c('0xc')](_0x59b8b5,_0x23f2c0)[_0x156c('0xd')](function(_0x554665){logger[_0x156c('0xe')](_0x156c('0xf'),_0x1b984c,_0x156c('0x10'));logger[_0x156c('0x11')](_0x156c('0x12'),_0x1b984c,_0x156c('0x10'),JSON[_0x156c('0x13')](_0x554665));if(_0x554665[_0x156c('0x14')]){if(_0x554665['error'][_0x156c('0x15')]===0x1f4){logger[_0x156c('0x14')](_0x156c('0xf'),_0x1b984c,_0x554665[_0x156c('0x14')][_0x156c('0x16')]);return _0x17c15f(_0x554665['error'][_0x156c('0x16')]);}logger['error'](_0x156c('0xf'),_0x1b984c,_0x554665[_0x156c('0x14')][_0x156c('0x16')]);return _0x5f1e5b(_0x554665[_0x156c('0x14')][_0x156c('0x16')]);}else{logger['info'](_0x156c('0xf'),_0x1b984c,'request\x20sent');_0x5f1e5b(_0x554665[_0x156c('0x17')][_0x156c('0x16')]);}})[_0x156c('0x18')](function(_0x1f9702){logger['error'](_0x156c('0xf'),_0x1b984c,_0x1f9702);_0x17c15f(_0x1f9702);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 7690ce6..80aa709 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 _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0xcbf03b,_0x2ddbfd){var _0x2384a6=function(_0x58a614){while(--_0x58a614){_0xcbf03b['push'](_0xcbf03b['shift']());}};_0x2384a6(++_0x2ddbfd);}(_0x5d58,0x187));var _0x85d5=function(_0x26a4fd,_0x11b9e4){_0x26a4fd=_0x26a4fd-0x0;var _0x2b0990=_0x5d58[_0x26a4fd];return _0x2b0990;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbd51=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','./chatProactiveAction.controller','get','/:id'];(function(_0x1f467a,_0x541b53){var _0x4776f9=function(_0x556e0e){while(--_0x556e0e){_0x1f467a['push'](_0x1f467a['shift']());}};_0x4776f9(++_0x541b53);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x24e994,_0x4c48fe){_0x24e994=_0x24e994-0x0;var _0xbbf19a=_0xbd51[_0x24e994];return _0xbbf19a;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')](_0x1bd5('0x7'),auth['isAuthenticated'](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/:id',auth[_0x1bd5('0xa')](),controller['update']);router[_0x1bd5('0xd')](_0x1bd5('0x7'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);module[_0x1bd5('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index a39c762..3d9c094 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 _0x77d9=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x4579ff,_0xaa6f5){var _0x403c4c=function(_0xc3c2d6){while(--_0xc3c2d6){_0x4579ff['push'](_0x4579ff['shift']());}};_0x403c4c(++_0xaa6f5);}(_0x77d9,0x104));var _0x977d=function(_0x1b90e0,_0x128583){_0x1b90e0=_0x1b90e0-0x0;var _0x2a26c4=_0x77d9[_0x1b90e0];return _0x2a26c4;};'use strict';var Sequelize=require(_0x977d('0x0'));module[_0x977d('0x1')]={'name':{'type':Sequelize[_0x977d('0x2')],'unique':_0x977d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x977d('0x2')]},'timeout':{'type':Sequelize[_0x977d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x977d('0x5')](_0x977d('0x6'),_0x977d('0x7'),_0x977d('0x8'))}};
\ No newline at end of file
+var _0x01f8=['STRING','name','INTEGER','beepall','roundrobin','sequelize'];(function(_0x619d16,_0x56d4a3){var _0x481301=function(_0x365ab2){while(--_0x365ab2){_0x619d16['push'](_0x619d16['shift']());}};_0x481301(++_0x56d4a3);}(_0x01f8,0x1c1));var _0x801f=function(_0x5d61f8,_0x45c759){_0x5d61f8=_0x5d61f8-0x0;var _0x21a83a=_0x01f8[_0x5d61f8];return _0x21a83a;};'use strict';var Sequelize=require(_0x801f('0x0'));module['exports']={'name':{'type':Sequelize[_0x801f('0x1')],'unique':_0x801f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x801f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x801f('0x4'),_0x801f('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index b79ff11..4af0210 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 _0xa92b=['getAgents','nolimit','bluebird','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','ChatQueues','UserProfileResource','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','getOptions','where','include','query','ChatQueue','rows','show','model','keys','filters','intersection','fields','attributes','length','options','catch','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserChatQueue','hasOwnProperty','sort','pick','ChatQueueId','filter','merge','map','findAll','User','findAndCountAll','UserId','agent','chatPause','%s/%s','SIP','updatedAt','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','SELECT','includes','all','union','compact','value','removeAgents','addAgents','omit','spread','userChatQueue:save','userChatQueue:remove','findOne'];(function(_0x59276e,_0x4a3b7e){var _0x3a7801=function(_0x5d90e9){while(--_0x5d90e9){_0x59276e['push'](_0x59276e['shift']());}};_0x3a7801(++_0x4a3b7e);}(_0xa92b,0x7b));var _0xba92=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xa92b[_0x3cbe1c];return _0x5ee08b;};'use strict';var BPromise=require(_0xba92('0x0'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xba92('0x1'));var qs=require(_0xba92('0x2'));var logger=require(_0xba92('0x3'))(_0xba92('0x4'));var config=require(_0xba92('0x5'));var db=require(_0xba92('0x6'))['db'];config[_0xba92('0x7')]=_[_0xba92('0x8')](config['redis'],{'host':_0xba92('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba92('0x7')]));require(_0xba92('0xa'))[_0xba92('0xb')](socket);function respondWithStatusCode(_0x248946,_0x2a2c39){_0x2a2c39=_0x2a2c39||0xcc;return function(_0x451e78){if(_0x451e78){return _0x248946[_0xba92('0xc')](_0x2a2c39);}return _0x248946[_0xba92('0xd')](_0x2a2c39)['end']();};}function respondWithResult(_0x477c9a,_0x12cd02){_0x12cd02=_0x12cd02||0xc8;return function(_0x4aa5fc){if(_0x4aa5fc){return _0x477c9a[_0xba92('0xd')](_0x12cd02)[_0xba92('0xe')](_0x4aa5fc);}};}function respondWithFilteredResult(_0x1ccf12,_0x47f4a9){return function(_0x2f6b56){if(_0x2f6b56){var _0x160dfc=typeof _0x47f4a9[_0xba92('0xf')]===_0xba92('0x10')&&typeof _0x47f4a9[_0xba92('0x11')]===_0xba92('0x10');var _0x1ded03=_0x2f6b56[_0xba92('0x12')];var _0x58496d=_0x160dfc?0x0:_0x47f4a9['offset'];var _0x4a7ab5=_0x160dfc?_0x2f6b56[_0xba92('0x12')]:_0x47f4a9['offset']+_0x47f4a9[_0xba92('0x11')];var _0x5a6800;if(_0x4a7ab5>=_0x1ded03){_0x4a7ab5=_0x1ded03;_0x5a6800=0xc8;}else{_0x5a6800=0xce;}_0x1ccf12[_0xba92('0xd')](_0x5a6800);return _0x1ccf12[_0xba92('0x13')](_0xba92('0x14'),_0x58496d+'-'+_0x4a7ab5+'/'+_0x1ded03)[_0xba92('0xe')](_0x2f6b56);}return null;};}function saveUpdates(_0x495164){return function(_0x47886f){if(_0x47886f){return _0x47886f[_0xba92('0x15')](_0x495164)[_0xba92('0x16')](function(_0x379a59){return _0x379a59;});}return null;};}function removeEntity(_0x3c6adb){return function(_0x406f43){if(_0x406f43){return _0x406f43['destroy']()[_0xba92('0x16')](function(){var _0x48b27f=_0x406f43[_0xba92('0x17')]({'plain':!![]});var _0x12c083=_0xba92('0x18');return db[_0xba92('0x19')][_0xba92('0x1a')]({'where':{'type':_0x12c083,'resourceId':_0x48b27f['id']}})['then'](function(){return _0x406f43;});})[_0xba92('0x16')](function(){_0x3c6adb[_0xba92('0xd')](0xcc)[_0xba92('0x1b')]();});}};}function handleEntityNotFound(_0x2b7f82){return function(_0x5eba5d){if(!_0x5eba5d){_0x2b7f82['sendStatus'](0x194);}return _0x5eba5d;};}function handleError(_0x18f25c,_0x5b4cf2){_0x5b4cf2=_0x5b4cf2||0x1f4;return function(_0x5a5bee){logger[_0xba92('0x1c')](_0x5a5bee[_0xba92('0x1d')]);if(_0x5a5bee[_0xba92('0x1e')]){delete _0x5a5bee[_0xba92('0x1e')];}_0x18f25c[_0xba92('0xd')](_0x5b4cf2)['send'](_0x5a5bee);};}exports[_0xba92('0x1f')]=function(_0x5e072c,_0x413986){var _0x5a461a={};var _0x53cd5d={'count':0x0,'rows':[]};var _0x3519c1=_['map'](db['ChatQueue'][_0xba92('0x20')],function(_0x301b24){return{'name':_0x301b24[_0xba92('0x21')],'type':_0x301b24[_0xba92('0x22')][_0xba92('0x23')]};});_0x5a461a=qs[_0xba92('0x24')](_0x3519c1,_0x5e072c);var _0x2ac7fc={'where':_0x5a461a[_0xba92('0x25')]};return db['ChatQueue'][_0xba92('0x12')](_0x2ac7fc)[_0xba92('0x16')](function(_0x79e687){_0x53cd5d['count']=_0x79e687;_0x5a461a[_0xba92('0x26')]=qs[_0xba92('0x26')](_0x5e072c[_0xba92('0x27')]);return db[_0xba92('0x28')]['findAll'](_0x5a461a);})[_0xba92('0x16')](function(_0x1015e1){_0x53cd5d[_0xba92('0x29')]=_0x1015e1;return _0x53cd5d;})[_0xba92('0x16')](respondWithFilteredResult(_0x413986,_0x5a461a))['catch'](handleError(_0x413986,null));};exports[_0xba92('0x2a')]=function(_0x166c85,_0x1f84e9){var _0x2d8f9f={'raw':!![],'where':{'id':_0x166c85['params']['id']}},_0x34647a={};_0x34647a[_0xba92('0x2b')]=_[_0xba92('0x2c')](db[_0xba92('0x28')]['rawAttributes']);_0x34647a[_0xba92('0x27')]=_[_0xba92('0x2c')](_0x166c85['query']);_0x34647a[_0xba92('0x2d')]=_[_0xba92('0x2e')](_0x34647a['model'],_0x34647a[_0xba92('0x27')]);_0x2d8f9f['attributes']=_[_0xba92('0x2e')](_0x34647a['model'],qs[_0xba92('0x2f')](_0x166c85[_0xba92('0x27')]['fields']));_0x2d8f9f[_0xba92('0x30')]=_0x2d8f9f[_0xba92('0x30')][_0xba92('0x31')]?_0x2d8f9f[_0xba92('0x30')]:_0x34647a[_0xba92('0x2b')];if(_0x166c85[_0xba92('0x27')]['includeAll']){_0x2d8f9f[_0xba92('0x26')]=[{'all':!![]}];}_0x2d8f9f=_['merge']({},_0x2d8f9f,_0x166c85[_0xba92('0x32')]);return db[_0xba92('0x28')]['find'](_0x2d8f9f)[_0xba92('0x16')](handleEntityNotFound(_0x1f84e9,null))['then'](respondWithResult(_0x1f84e9,null))[_0xba92('0x33')](handleError(_0x1f84e9,null));};exports[_0xba92('0x34')]=function(_0x2bf79d,_0x3ad23a){return db[_0xba92('0x28')][_0xba92('0x34')](_0x2bf79d[_0xba92('0x35')],{})['then'](function(_0x2df4fc){var _0x18f85e=_0x2bf79d[_0xba92('0x36')][_0xba92('0x17')]({'plain':!![]});if(!_0x18f85e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18f85e[_0xba92('0x37')]===_0xba92('0x36')){var _0xc209ac=_0x2df4fc[_0xba92('0x17')]({'plain':!![]});var _0x4f6a0a=_0xba92('0x18');return db['UserProfileSection'][_0xba92('0x38')]({'where':{'name':_0x4f6a0a,'userProfileId':_0x18f85e[_0xba92('0x39')]},'raw':!![]})[_0xba92('0x16')](function(_0x327084){if(_0x327084&&_0x327084[_0xba92('0x3a')]===0x0){return db[_0xba92('0x19')]['create']({'name':_0xc209ac[_0xba92('0x1e')],'resourceId':_0xc209ac['id'],'type':_0x327084[_0xba92('0x1e')],'sectionId':_0x327084['id']},{})[_0xba92('0x16')](function(){return _0x2df4fc;});}else{return _0x2df4fc;}})[_0xba92('0x33')](function(_0x2f918b){logger[_0xba92('0x1c')](_0xba92('0x3b'),_0x2f918b);throw _0x2f918b;});}return _0x2df4fc;})[_0xba92('0x16')](respondWithResult(_0x3ad23a,0xc9))[_0xba92('0x33')](handleError(_0x3ad23a,null));};exports[_0xba92('0x15')]=function(_0x3a5bb8,_0x12658a){if(_0x3a5bb8['body']['id']){delete _0x3a5bb8[_0xba92('0x35')]['id'];}return db[_0xba92('0x28')][_0xba92('0x38')]({'where':{'id':_0x3a5bb8[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](handleEntityNotFound(_0x12658a,null))['then'](saveUpdates(_0x3a5bb8[_0xba92('0x35')],null))[_0xba92('0x16')](respondWithResult(_0x12658a,null))[_0xba92('0x33')](handleError(_0x12658a,null));};exports[_0xba92('0x1a')]=function(_0x5bc0c4,_0x503c47){return db[_0xba92('0x28')][_0xba92('0x38')]({'where':{'id':_0x5bc0c4[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](handleEntityNotFound(_0x503c47,null))['then'](removeEntity(_0x503c47,null))[_0xba92('0x33')](handleError(_0x503c47,null));};exports[_0xba92('0x3d')]=function(_0x1a0ada,_0x4f9dce){return db[_0xba92('0x28')][_0xba92('0x3d')]()[_0xba92('0x16')](respondWithResult(_0x4f9dce,null))[_0xba92('0x33')](handleError(_0x4f9dce,null));};exports[_0xba92('0x3e')]=function(_0x1c7587,_0x1cae35){var _0xeb482c={'raw':!![],'where':{}},_0x4fef6b={},_0x37ed62;return db[_0xba92('0x28')]['findOne']({'where':{'id':_0x1c7587['params']['id']}})[_0xba92('0x16')](handleEntityNotFound(_0x1cae35,null))[_0xba92('0x16')](function(_0x7be4eb){if(_0x7be4eb){_0x37ed62=_0x7be4eb[_0xba92('0x17')]({'plain':!![]});_0x4fef6b[_0xba92('0x2b')]=_[_0xba92('0x2c')](db[_0xba92('0x3f')][_0xba92('0x20')]);_0x4fef6b[_0xba92('0x27')]=_[_0xba92('0x2c')](_0x1c7587['query']);_0x4fef6b[_0xba92('0x2d')]=_[_0xba92('0x2e')](_0x4fef6b['model'],_0x4fef6b['query']);_0xeb482c[_0xba92('0x30')]=_[_0xba92('0x2e')](_0x4fef6b[_0xba92('0x2b')],qs[_0xba92('0x2f')](_0x1c7587[_0xba92('0x27')]['fields']));_0xeb482c['attributes']=_0xeb482c['attributes'][_0xba92('0x31')]?_0xeb482c[_0xba92('0x30')]:_0x4fef6b[_0xba92('0x2b')];if(!_0x1c7587['query'][_0xba92('0x40')]('nolimit')){_0xeb482c[_0xba92('0x11')]=qs[_0xba92('0x11')](_0x1c7587[_0xba92('0x27')][_0xba92('0x11')]);_0xeb482c['offset']=qs[_0xba92('0xf')](_0x1c7587[_0xba92('0x27')]['offset']);}_0xeb482c['order']=qs[_0xba92('0x41')](_0x1c7587[_0xba92('0x27')][_0xba92('0x41')]);_0xeb482c['where']=qs[_0xba92('0x2d')](_[_0xba92('0x42')](_0x1c7587[_0xba92('0x27')],_0x4fef6b[_0xba92('0x2d')]));_0xeb482c[_0xba92('0x25')][_0xba92('0x43')]=_0x7be4eb['id'];if(_0x1c7587['query'][_0xba92('0x44')]){_0xeb482c[_0xba92('0x25')]=_[_0xba92('0x45')](_0xeb482c[_0xba92('0x25')],{'$or':_[_0xba92('0x46')](_0xeb482c[_0xba92('0x30')],function(_0x42f1a6){var _0x4fe445={};_0x4fe445[_0x42f1a6]={'$like':'%'+_0x1c7587[_0xba92('0x27')][_0xba92('0x44')]+'%'};return _0x4fe445;})});}_0xeb482c=_[_0xba92('0x45')]({},_0xeb482c,_0x1c7587['options']);return db[_0xba92('0x3f')][_0xba92('0x47')](_0xeb482c);}})[_0xba92('0x16')](function(_0x16ed3c){if(_0x16ed3c){return db[_0xba92('0x48')][_0xba92('0x49')]({'where':{'id':_[_0xba92('0x46')](_0x16ed3c,_0xba92('0x4a')),'role':_0xba92('0x4b')},'attributes':['id',_0xba92('0x1e'),_0xba92('0x4c'),'updatedAt','createdAt']});}})['then'](function(_0x124dc0){if(_0x124dc0){return{'count':_0x124dc0[_0xba92('0x12')],'rows':_[_0xba92('0x46')](_0x124dc0[_0xba92('0x29')],function(_0x2c9c42){return{'membername':_0x2c9c42['name'],'UserId':_0x2c9c42['id'],'queue_name':_0x37ed62[_0xba92('0x1e')],'ChatQueueId':_0x37ed62['id'],'interface':util['format'](_0xba92('0x4d'),_0xba92('0x4e'),_0x2c9c42[_0xba92('0x1e')]),'penalty':0x0,'paused':_0x2c9c42[_0xba92('0x4c')],'createdAt':_0x2c9c42['createdAt'],'updatedAt':_0x2c9c42[_0xba92('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xba92('0x16')](respondWithFilteredResult(_0x1cae35,_0xeb482c))[_0xba92('0x33')](handleError(_0x1cae35,null));};exports[_0xba92('0x50')]=function(_0x533793,_0x2f68e3){var _0x28f211={};var _0x4deef2={};var _0x4f1fda;var _0x30c617;return db[_0xba92('0x28')]['findOne']({'where':{'id':_0x533793[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](handleEntityNotFound(_0x2f68e3,null))[_0xba92('0x16')](function(_0x2c4b0c){if(_0x2c4b0c){_0x4f1fda=_0x2c4b0c;_0x4deef2[_0xba92('0x2b')]=_[_0xba92('0x2c')](db[_0xba92('0x51')][_0xba92('0x20')]);_0x4deef2[_0xba92('0x27')]=_['keys'](_0x533793['query']);_0x4deef2[_0xba92('0x2d')]=_[_0xba92('0x2e')](_0x4deef2[_0xba92('0x2b')],_0x4deef2['query']);_0x28f211[_0xba92('0x30')]=_[_0xba92('0x2e')](_0x4deef2[_0xba92('0x2b')],qs['fields'](_0x533793[_0xba92('0x27')][_0xba92('0x2f')]));_0x28f211['attributes']=_0x28f211[_0xba92('0x30')][_0xba92('0x31')]?_0x28f211['attributes']:_0x4deef2[_0xba92('0x2b')];_0x28f211[_0xba92('0x52')]=qs[_0xba92('0x41')](_0x533793[_0xba92('0x27')][_0xba92('0x41')]);_0x28f211[_0xba92('0x25')]=qs[_0xba92('0x2d')](_[_0xba92('0x42')](_0x533793[_0xba92('0x27')],_0x4deef2['filters']));if(_0x533793[_0xba92('0x27')][_0xba92('0x44')]){_0x28f211[_0xba92('0x25')]=_['merge'](_0x28f211[_0xba92('0x25')],{'$or':_['map'](_0x28f211[_0xba92('0x30')],function(_0x2335b4){var _0xed0028={};_0xed0028[_0x2335b4]={'$like':'%'+_0x533793[_0xba92('0x27')][_0xba92('0x44')]+'%'};return _0xed0028;})});}_0x28f211=_[_0xba92('0x45')]({},_0x28f211,_0x533793[_0xba92('0x32')]);return _0x4f1fda[_0xba92('0x50')](_0x28f211);}})[_0xba92('0x16')](function(_0x555813){if(_0x555813){_0x30c617=_0x555813[_0xba92('0x31')];if(!_0x533793['query'][_0xba92('0x40')]('nolimit')){_0x28f211[_0xba92('0x11')]=qs[_0xba92('0x11')](_0x533793[_0xba92('0x27')][_0xba92('0x11')]);_0x28f211['offset']=qs[_0xba92('0xf')](_0x533793[_0xba92('0x27')][_0xba92('0xf')]);}return _0x4f1fda[_0xba92('0x50')](_0x28f211);}})[_0xba92('0x16')](function(_0x320246){if(_0x320246){return _0x320246?{'count':_0x30c617,'rows':_0x320246}:null;}})[_0xba92('0x16')](respondWithResult(_0x2f68e3,null))[_0xba92('0x33')](handleError(_0x2f68e3,null));};exports[_0xba92('0x53')]=function(_0x242907,_0x541125){var _0x3a88a1=_0x242907['body'][_0xba92('0x54')];return db[_0xba92('0x51')]['findAll']({'where':{'id':_0x3a88a1},'attributes':['id'],'include':[{'model':db[_0xba92('0x48')],'as':_0xba92('0x55'),'attributes':['id','name',_0xba92('0x56'),_0xba92('0x57'),'interface'],'raw':!![]}]})[_0xba92('0x16')](function(_0x3e5edb){if(_0x3e5edb){var _0x2cbe48=_[_0xba92('0x58')](_0x3e5edb,function(_0x29be63){var _0x1f7d7c=_0x29be63['get']({'plain':!![]});return _0x1f7d7c['Agents'];});return db[_0xba92('0x28')]['find']({'where':{'id':_0x242907['params']['id']}})[_0xba92('0x16')](function(_0x48d935){return db[_0xba92('0x59')][_0xba92('0x5a')](function(_0x286d56){return _0x48d935[_0xba92('0x53')](_0x3a88a1,{'transaction':_0x286d56})[_0xba92('0x16')](function(){return BPromise[_0xba92('0x5b')](_0x2cbe48,function(_0x4e7a63){return db[_0xba92('0x3f')][_0xba92('0x5c')]({'where':{'UserId':_0x4e7a63['id'],'ChatQueueId':_0x242907[_0xba92('0x3c')]['id']},'transaction':_0x286d56});});})[_0xba92('0x16')](function(){_0x2cbe48[_0xba92('0x5d')](function(_0x54eb1b){socket[_0xba92('0x5e')]('userChatQueue:save',{'UserId':_0x54eb1b['id'],'ChatQueueId':_0x48d935['id']});});});});});}})[_0xba92('0x16')](respondWithStatusCode(_0x541125,null))[_0xba92('0x33')](handleError(_0x541125,null));};exports[_0xba92('0x5f')]=function(_0x45a206,_0x39161a){return db['Team']['findAll']({'where':{'id':_0x45a206['query'][_0xba92('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xba92('0x55'),'attributes':['id'],'raw':!![]}]})[_0xba92('0x16')](handleEntityNotFound(_0x39161a,null))[_0xba92('0x16')](function(_0x141a3d){var _0x5a5404=_[_0xba92('0x46')](_0x141a3d,'id');var _0x4a1ebf=[];var _0x25cf16=[];var _0x35b47b=squel[_0xba92('0x60')]();_0x35b47b[_0xba92('0x61')](_0xba92('0x62'))[_0xba92('0x63')](_0xba92('0x64'),'tq')[_0xba92('0x65')](_0xba92('0x66'),'ut',_0xba92('0x67'))[_0xba92('0x25')]('ChatQueueId\x20=\x20?',_0x45a206[_0xba92('0x3c')]['id']);for(var _0x3fedf4=0x0;_0x3fedf4<_0x141a3d[_0xba92('0x31')];_0x3fedf4+=0x1){let _0x4559e5=_0x141a3d[_0x3fedf4];for(var _0x3ba9a3=0x0;_0x3ba9a3<_0x4559e5[_0xba92('0x55')][_0xba92('0x31')];_0x3ba9a3+=0x1){let _0x57b095=_0x4559e5['Agents'][_0x3ba9a3];var _0x194d7a=_0x35b47b[_0xba92('0x68')]();_0x194d7a[_0xba92('0x25')](_0xba92('0x69'),_0x57b095['id']);_0x25cf16['push'](db[_0xba92('0x59')][_0xba92('0x27')](_0x194d7a['toString'](),{'type':db[_0xba92('0x59')]['QueryTypes'][_0xba92('0x6a')]})['then'](function(_0x53c681){if(_0x53c681[_0xba92('0x31')]===0x1){return _0x57b095['id'];}else{var _0x383fb5=_['every'](_[_0xba92('0x46')](_0x53c681,'TeamId'),function(_0x519c16){return _[_0xba92('0x6b')](_0x5a5404,_0x519c16);});if(_0x383fb5){return _0x57b095['id'];}}}));}}return BPromise[_0xba92('0x6c')](_0x25cf16)[_0xba92('0x16')](function(_0x1e4d4a){_0x4a1ebf=_(_0x4a1ebf)[_0xba92('0x6d')](_0x1e4d4a)[_0xba92('0x6e')]()[_0xba92('0x6f')]();return db[_0xba92('0x28')][_0xba92('0x38')]({'where':{'id':_0x45a206[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](function(_0xf158d1){return db[_0xba92('0x59')][_0xba92('0x5a')](function(_0xa44da8){return _0xf158d1[_0xba92('0x5f')](_0x45a206[_0xba92('0x27')]['ids'],{'transaction':_0xa44da8})[_0xba92('0x16')](function(){if(!_['isEmpty'](_0x4a1ebf)){return _0xf158d1[_0xba92('0x70')](_0x4a1ebf,{'transaction':_0xa44da8});}})[_0xba92('0x16')](function(){_0x4a1ebf[_0xba92('0x5d')](function(_0x1dda3c){socket['emit']('userChatQueue:remove',{'UserId':_0x1dda3c,'ChatQueueId':_0xf158d1['id']});});});});});});})[_0xba92('0x16')](respondWithStatusCode(_0x39161a,null))[_0xba92('0x33')](handleError(_0x39161a,null));};exports[_0xba92('0x71')]=function(_0x3274d9,_0xc07841){return db[_0xba92('0x28')]['find']({'where':{'id':_0x3274d9[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](handleEntityNotFound(_0xc07841,null))[_0xba92('0x16')](function(_0x41821b){if(_0x41821b){return _0x41821b[_0xba92('0x71')](_0x3274d9['body'][_0xba92('0x54')],_[_0xba92('0x72')](_0x3274d9[_0xba92('0x35')],[_0xba92('0x54'),'id'])||{})[_0xba92('0x73')](function(_0x5a4228){for(var _0x3dc82d=0x0;_0x3dc82d<_0x3274d9[_0xba92('0x35')][_0xba92('0x54')]['length'];_0x3dc82d+=0x1){socket[_0xba92('0x5e')](_0xba92('0x74'),{'UserId':Number(_0x3274d9[_0xba92('0x35')][_0xba92('0x54')][_0x3dc82d]),'ChatQueueId':Number(_0x3274d9[_0xba92('0x3c')]['id'])});}return _0x5a4228;});}})[_0xba92('0x16')](respondWithResult(_0xc07841,null))[_0xba92('0x33')](handleError(_0xc07841,null));};exports[_0xba92('0x70')]=function(_0x160599,_0xd4f001){return db[_0xba92('0x28')][_0xba92('0x38')]({'where':{'id':_0x160599[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](handleEntityNotFound(_0xd4f001,null))['then'](function(_0x4ac02c){if(_0x4ac02c){return _0x4ac02c[_0xba92('0x70')](_0x160599['query']['ids'])[_0xba92('0x16')](function(){if(_['isArray'](_0x160599['query'][_0xba92('0x54')])){for(var _0x49c6e0=0x0;_0x49c6e0<_0x160599[_0xba92('0x27')][_0xba92('0x54')][_0xba92('0x31')];_0x49c6e0+=0x1){socket['emit'](_0xba92('0x75'),{'UserId':Number(_0x160599['query'][_0xba92('0x54')][_0x49c6e0]),'ChatQueueId':Number(_0x160599['params']['id'])});}}else{socket[_0xba92('0x5e')](_0xba92('0x75'),{'UserId':Number(_0x160599[_0xba92('0x27')]['ids']),'ChatQueueId':Number(_0x160599[_0xba92('0x3c')]['id'])});}});}})['then'](respondWithStatusCode(_0xd4f001,null))[_0xba92('0x33')](handleError(_0xd4f001,null));};exports['getAgents']=function(_0x72d6d6,_0xa34e45){var _0x26f04f={};var _0x38f030={};var _0x427486;var _0x49b2b8;return db['ChatQueue'][_0xba92('0x76')]({'where':{'id':_0x72d6d6[_0xba92('0x3c')]['id']}})[_0xba92('0x16')](handleEntityNotFound(_0xa34e45,null))['then'](function(_0x3f1be9){if(_0x3f1be9){_0x427486=_0x3f1be9;_0x38f030[_0xba92('0x2b')]=_[_0xba92('0x2c')](db[_0xba92('0x48')][_0xba92('0x20')]);_0x38f030[_0xba92('0x27')]=_['keys'](_0x72d6d6[_0xba92('0x27')]);_0x38f030['filters']=_['intersection'](_0x38f030[_0xba92('0x2b')],_0x38f030[_0xba92('0x27')]);_0x26f04f[_0xba92('0x30')]=_[_0xba92('0x2e')](_0x38f030[_0xba92('0x2b')],qs['fields'](_0x72d6d6[_0xba92('0x27')][_0xba92('0x2f')]));_0x26f04f[_0xba92('0x30')]=_0x26f04f['attributes']['length']?_0x26f04f[_0xba92('0x30')]:_0x38f030[_0xba92('0x2b')];_0x26f04f['order']=qs['sort'](_0x72d6d6[_0xba92('0x27')]['sort']);_0x26f04f[_0xba92('0x25')]=qs[_0xba92('0x2d')](_[_0xba92('0x42')](_0x72d6d6[_0xba92('0x27')],_0x38f030[_0xba92('0x2d')]));if(_0x72d6d6[_0xba92('0x27')]['filter']){_0x26f04f[_0xba92('0x25')]=_['merge'](_0x26f04f[_0xba92('0x25')],{'$or':_['map'](_0x26f04f[_0xba92('0x30')],function(_0x2c8dc1){var _0x30df0c={};_0x30df0c[_0x2c8dc1]={'$like':'%'+_0x72d6d6['query'][_0xba92('0x44')]+'%'};return _0x30df0c;})});}_0x26f04f=_[_0xba92('0x45')]({},_0x26f04f,_0x72d6d6[_0xba92('0x32')]);return _0x427486[_0xba92('0x77')](_0x26f04f);}})[_0xba92('0x16')](function(_0x590d98){if(_0x590d98){_0x49b2b8=_0x590d98[_0xba92('0x31')];if(!_0x72d6d6[_0xba92('0x27')][_0xba92('0x40')](_0xba92('0x78'))){_0x26f04f[_0xba92('0x11')]=qs[_0xba92('0x11')](_0x72d6d6[_0xba92('0x27')][_0xba92('0x11')]);_0x26f04f[_0xba92('0xf')]=qs['offset'](_0x72d6d6['query'][_0xba92('0xf')]);}return _0x427486[_0xba92('0x77')](_0x26f04f);}})['then'](function(_0x10dfd0){if(_0x10dfd0){return _0x10dfd0?{'count':_0x49b2b8,'rows':_0x10dfd0}:null;}})[_0xba92('0x16')](respondWithResult(_0xa34e45,null))[_0xba92('0x33')](handleError(_0xa34e45,null));};
\ No newline at end of file
+var _0x2339=['squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','ChatQueues','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','ChatQueue','include','query','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','nolimit','order','sort','where','pick','ChatQueueId','map','filter','options','findAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','User','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','ids','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','util','lodash'];(function(_0x19ce7a,_0x2317f7){var _0x57d7b1=function(_0x547bb1){while(--_0x547bb1){_0x19ce7a['push'](_0x19ce7a['shift']());}};_0x57d7b1(++_0x2317f7);}(_0x2339,0xf2));var _0x9233=function(_0x3f527c,_0x33dc39){_0x3f527c=_0x3f527c-0x0;var _0x5bc470=_0x2339[_0x3f527c];return _0x5bc470;};'use strict';var BPromise=require('bluebird');var util=require(_0x9233('0x0'));var _=require(_0x9233('0x1'));var squel=require(_0x9233('0x2'));var Redis=require('ioredis');var qs=require(_0x9233('0x3'));var logger=require(_0x9233('0x4'))(_0x9233('0x5'));var config=require('../../config/environment');var db=require(_0x9233('0x6'))['db'];config[_0x9233('0x7')]=_[_0x9233('0x8')](config[_0x9233('0x7')],{'host':_0x9233('0x9'),'port':0x18eb});var socket=require(_0x9233('0xa'))(new Redis(config[_0x9233('0x7')]));require(_0x9233('0xb'))['register'](socket);function respondWithStatusCode(_0x47eb42,_0x36ab37){_0x36ab37=_0x36ab37||0xcc;return function(_0x338d93){if(_0x338d93){return _0x47eb42[_0x9233('0xc')](_0x36ab37);}return _0x47eb42[_0x9233('0xd')](_0x36ab37)['end']();};}function respondWithResult(_0x3f4e7b,_0x27333e){_0x27333e=_0x27333e||0xc8;return function(_0x282625){if(_0x282625){return _0x3f4e7b['status'](_0x27333e)[_0x9233('0xe')](_0x282625);}};}function respondWithFilteredResult(_0x587147,_0x35d953){return function(_0x26de7d){if(_0x26de7d){var _0x130cb2=typeof _0x35d953[_0x9233('0xf')]==='undefined'&&typeof _0x35d953['limit']===_0x9233('0x10');var _0x3dd6b8=_0x26de7d[_0x9233('0x11')];var _0x6e6c62=_0x130cb2?0x0:_0x35d953[_0x9233('0xf')];var _0x10ff6c=_0x130cb2?_0x26de7d[_0x9233('0x11')]:_0x35d953[_0x9233('0xf')]+_0x35d953[_0x9233('0x12')];var _0x1fb62d;if(_0x10ff6c>=_0x3dd6b8){_0x10ff6c=_0x3dd6b8;_0x1fb62d=0xc8;}else{_0x1fb62d=0xce;}_0x587147[_0x9233('0xd')](_0x1fb62d);return _0x587147[_0x9233('0x13')](_0x9233('0x14'),_0x6e6c62+'-'+_0x10ff6c+'/'+_0x3dd6b8)[_0x9233('0xe')](_0x26de7d);}return null;};}function saveUpdates(_0x3a0993){return function(_0x4cdba5){if(_0x4cdba5){return _0x4cdba5['update'](_0x3a0993)['then'](function(_0x551073){return _0x551073;});}return null;};}function removeEntity(_0x4073ff){return function(_0x4ab4e7){if(_0x4ab4e7){return _0x4ab4e7[_0x9233('0x15')]()[_0x9233('0x16')](function(){var _0x295ea5=_0x4ab4e7[_0x9233('0x17')]({'plain':!![]});var _0x414f30=_0x9233('0x18');return db[_0x9233('0x19')][_0x9233('0x15')]({'where':{'type':_0x414f30,'resourceId':_0x295ea5['id']}})[_0x9233('0x16')](function(){return _0x4ab4e7;});})[_0x9233('0x16')](function(){_0x4073ff['status'](0xcc)[_0x9233('0x1a')]();});}};}function handleEntityNotFound(_0x259b65){return function(_0x1f5cb8){if(!_0x1f5cb8){_0x259b65[_0x9233('0xc')](0x194);}return _0x1f5cb8;};}function handleError(_0xddb274,_0x58f166){_0x58f166=_0x58f166||0x1f4;return function(_0x3f8541){logger[_0x9233('0x1b')](_0x3f8541[_0x9233('0x1c')]);if(_0x3f8541['name']){delete _0x3f8541[_0x9233('0x1d')];}_0xddb274[_0x9233('0xd')](_0x58f166)[_0x9233('0x1e')](_0x3f8541);};}exports[_0x9233('0x1f')]=function(_0x53ad7b,_0x56fd8b){var _0x54a697={};var _0xb8ddac={'count':0x0,'rows':[]};var _0x5ee2a1=_['map'](db['ChatQueue'][_0x9233('0x20')],function(_0x12006a){return{'name':_0x12006a[_0x9233('0x21')],'type':_0x12006a[_0x9233('0x22')][_0x9233('0x23')]};});_0x54a697=qs['getOptions'](_0x5ee2a1,_0x53ad7b);var _0x1f4a5f={'where':_0x54a697['where']};return db[_0x9233('0x24')]['count'](_0x1f4a5f)['then'](function(_0x3a86e2){_0xb8ddac[_0x9233('0x11')]=_0x3a86e2;_0x54a697[_0x9233('0x25')]=qs[_0x9233('0x25')](_0x53ad7b[_0x9233('0x26')]);return db['ChatQueue']['findAll'](_0x54a697);})[_0x9233('0x16')](function(_0x13fdaf){_0xb8ddac[_0x9233('0x27')]=_0x13fdaf;return _0xb8ddac;})[_0x9233('0x16')](respondWithFilteredResult(_0x56fd8b,_0x54a697))[_0x9233('0x28')](handleError(_0x56fd8b,null));};exports[_0x9233('0x29')]=function(_0x32bc8b,_0x4c6dca){var _0x352c98={'raw':!![],'where':{'id':_0x32bc8b[_0x9233('0x2a')]['id']}},_0x452674={};_0x452674[_0x9233('0x2b')]=_['keys'](db[_0x9233('0x24')]['rawAttributes']);_0x452674[_0x9233('0x26')]=_[_0x9233('0x2c')](_0x32bc8b[_0x9233('0x26')]);_0x452674[_0x9233('0x2d')]=_[_0x9233('0x2e')](_0x452674['model'],_0x452674[_0x9233('0x26')]);_0x352c98['attributes']=_['intersection'](_0x452674[_0x9233('0x2b')],qs['fields'](_0x32bc8b[_0x9233('0x26')][_0x9233('0x2f')]));_0x352c98['attributes']=_0x352c98[_0x9233('0x30')][_0x9233('0x31')]?_0x352c98[_0x9233('0x30')]:_0x452674[_0x9233('0x2b')];if(_0x32bc8b[_0x9233('0x26')]['includeAll']){_0x352c98[_0x9233('0x25')]=[{'all':!![]}];}_0x352c98=_[_0x9233('0x32')]({},_0x352c98,_0x32bc8b['options']);return db[_0x9233('0x24')]['find'](_0x352c98)[_0x9233('0x16')](handleEntityNotFound(_0x4c6dca,null))[_0x9233('0x16')](respondWithResult(_0x4c6dca,null))[_0x9233('0x28')](handleError(_0x4c6dca,null));};exports[_0x9233('0x33')]=function(_0x405c44,_0x5337e0){return db[_0x9233('0x24')][_0x9233('0x33')](_0x405c44[_0x9233('0x34')],{})[_0x9233('0x16')](function(_0x99139e){var _0x356b19=_0x405c44[_0x9233('0x35')][_0x9233('0x17')]({'plain':!![]});if(!_0x356b19)throw new Error(_0x9233('0x36'));if(_0x356b19[_0x9233('0x37')]===_0x9233('0x35')){var _0x5648ae=_0x99139e['get']({'plain':!![]});var _0x431e05=_0x9233('0x18');return db[_0x9233('0x38')][_0x9233('0x39')]({'where':{'name':_0x431e05,'userProfileId':_0x356b19[_0x9233('0x3a')]},'raw':!![]})[_0x9233('0x16')](function(_0x5b5d56){if(_0x5b5d56&&_0x5b5d56[_0x9233('0x3b')]===0x0){return db[_0x9233('0x19')]['create']({'name':_0x5648ae[_0x9233('0x1d')],'resourceId':_0x5648ae['id'],'type':_0x5b5d56[_0x9233('0x1d')],'sectionId':_0x5b5d56['id']},{})[_0x9233('0x16')](function(){return _0x99139e;});}else{return _0x99139e;}})[_0x9233('0x28')](function(_0x59db25){logger[_0x9233('0x1b')](_0x9233('0x3c'),_0x59db25);throw _0x59db25;});}return _0x99139e;})['then'](respondWithResult(_0x5337e0,0xc9))[_0x9233('0x28')](handleError(_0x5337e0,null));};exports[_0x9233('0x3d')]=function(_0x1a6dea,_0x552fee){if(_0x1a6dea[_0x9233('0x34')]['id']){delete _0x1a6dea[_0x9233('0x34')]['id'];}return db['ChatQueue'][_0x9233('0x39')]({'where':{'id':_0x1a6dea[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x552fee,null))[_0x9233('0x16')](saveUpdates(_0x1a6dea[_0x9233('0x34')],null))[_0x9233('0x16')](respondWithResult(_0x552fee,null))[_0x9233('0x28')](handleError(_0x552fee,null));};exports['destroy']=function(_0x5ba9cb,_0x10614c){return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x5ba9cb[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x10614c,null))[_0x9233('0x16')](removeEntity(_0x10614c,null))[_0x9233('0x28')](handleError(_0x10614c,null));};exports[_0x9233('0x3e')]=function(_0x5df49c,_0x50e158){return db['ChatQueue'][_0x9233('0x3e')]()[_0x9233('0x16')](respondWithResult(_0x50e158,null))['catch'](handleError(_0x50e158,null));};exports[_0x9233('0x3f')]=function(_0x4946be,_0x20a727){var _0x2fcba2={'raw':!![],'where':{}},_0x111a8d={},_0x245dba;return db[_0x9233('0x24')][_0x9233('0x40')]({'where':{'id':_0x4946be[_0x9233('0x2a')]['id']}})['then'](handleEntityNotFound(_0x20a727,null))[_0x9233('0x16')](function(_0x594b0d){if(_0x594b0d){_0x245dba=_0x594b0d['get']({'plain':!![]});_0x111a8d['model']=_[_0x9233('0x2c')](db[_0x9233('0x41')][_0x9233('0x20')]);_0x111a8d['query']=_['keys'](_0x4946be[_0x9233('0x26')]);_0x111a8d['filters']=_[_0x9233('0x2e')](_0x111a8d[_0x9233('0x2b')],_0x111a8d['query']);_0x2fcba2[_0x9233('0x30')]=_['intersection'](_0x111a8d['model'],qs[_0x9233('0x2f')](_0x4946be[_0x9233('0x26')][_0x9233('0x2f')]));_0x2fcba2[_0x9233('0x30')]=_0x2fcba2[_0x9233('0x30')]['length']?_0x2fcba2[_0x9233('0x30')]:_0x111a8d[_0x9233('0x2b')];if(!_0x4946be[_0x9233('0x26')]['hasOwnProperty'](_0x9233('0x42'))){_0x2fcba2[_0x9233('0x12')]=qs[_0x9233('0x12')](_0x4946be['query']['limit']);_0x2fcba2['offset']=qs['offset'](_0x4946be[_0x9233('0x26')][_0x9233('0xf')]);}_0x2fcba2[_0x9233('0x43')]=qs[_0x9233('0x44')](_0x4946be['query'][_0x9233('0x44')]);_0x2fcba2[_0x9233('0x45')]=qs[_0x9233('0x2d')](_[_0x9233('0x46')](_0x4946be[_0x9233('0x26')],_0x111a8d[_0x9233('0x2d')]));_0x2fcba2[_0x9233('0x45')][_0x9233('0x47')]=_0x594b0d['id'];if(_0x4946be[_0x9233('0x26')]['filter']){_0x2fcba2[_0x9233('0x45')]=_[_0x9233('0x32')](_0x2fcba2['where'],{'$or':_[_0x9233('0x48')](_0x2fcba2[_0x9233('0x30')],function(_0x47ca09){var _0x1b3564={};_0x1b3564[_0x47ca09]={'$like':'%'+_0x4946be[_0x9233('0x26')][_0x9233('0x49')]+'%'};return _0x1b3564;})});}_0x2fcba2=_[_0x9233('0x32')]({},_0x2fcba2,_0x4946be[_0x9233('0x4a')]);return db[_0x9233('0x41')][_0x9233('0x4b')](_0x2fcba2);}})[_0x9233('0x16')](function(_0xf6d35){if(_0xf6d35){return db['User']['findAndCountAll']({'where':{'id':_[_0x9233('0x48')](_0xf6d35,'UserId'),'role':_0x9233('0x4c')},'attributes':['id',_0x9233('0x1d'),_0x9233('0x4d'),_0x9233('0x4e'),_0x9233('0x4f')]});}})['then'](function(_0x2914dd){if(_0x2914dd){return{'count':_0x2914dd[_0x9233('0x11')],'rows':_[_0x9233('0x48')](_0x2914dd[_0x9233('0x27')],function(_0x503653){return{'membername':_0x503653[_0x9233('0x1d')],'UserId':_0x503653['id'],'queue_name':_0x245dba[_0x9233('0x1d')],'ChatQueueId':_0x245dba['id'],'interface':util[_0x9233('0x50')](_0x9233('0x51'),_0x9233('0x52'),_0x503653[_0x9233('0x1d')]),'penalty':0x0,'paused':_0x503653[_0x9233('0x4d')],'createdAt':_0x503653[_0x9233('0x4f')],'updatedAt':_0x503653[_0x9233('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9233('0x16')](respondWithFilteredResult(_0x20a727,_0x2fcba2))[_0x9233('0x28')](handleError(_0x20a727,null));};exports[_0x9233('0x53')]=function(_0x194264,_0x1f401d){var _0x5a30c5={};var _0x86bf89={};var _0x264077;var _0x3d9098;return db[_0x9233('0x24')][_0x9233('0x40')]({'where':{'id':_0x194264[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x1f401d,null))[_0x9233('0x16')](function(_0x425c9f){if(_0x425c9f){_0x264077=_0x425c9f;_0x86bf89[_0x9233('0x2b')]=_[_0x9233('0x2c')](db[_0x9233('0x54')][_0x9233('0x20')]);_0x86bf89['query']=_[_0x9233('0x2c')](_0x194264['query']);_0x86bf89['filters']=_[_0x9233('0x2e')](_0x86bf89[_0x9233('0x2b')],_0x86bf89['query']);_0x5a30c5['attributes']=_[_0x9233('0x2e')](_0x86bf89[_0x9233('0x2b')],qs[_0x9233('0x2f')](_0x194264[_0x9233('0x26')][_0x9233('0x2f')]));_0x5a30c5[_0x9233('0x30')]=_0x5a30c5[_0x9233('0x30')][_0x9233('0x31')]?_0x5a30c5[_0x9233('0x30')]:_0x86bf89[_0x9233('0x2b')];_0x5a30c5[_0x9233('0x43')]=qs[_0x9233('0x44')](_0x194264[_0x9233('0x26')][_0x9233('0x44')]);_0x5a30c5[_0x9233('0x45')]=qs['filters'](_[_0x9233('0x46')](_0x194264['query'],_0x86bf89[_0x9233('0x2d')]));if(_0x194264[_0x9233('0x26')][_0x9233('0x49')]){_0x5a30c5[_0x9233('0x45')]=_[_0x9233('0x32')](_0x5a30c5[_0x9233('0x45')],{'$or':_[_0x9233('0x48')](_0x5a30c5[_0x9233('0x30')],function(_0x2b1cf5){var _0x201e33={};_0x201e33[_0x2b1cf5]={'$like':'%'+_0x194264[_0x9233('0x26')]['filter']+'%'};return _0x201e33;})});}_0x5a30c5=_[_0x9233('0x32')]({},_0x5a30c5,_0x194264[_0x9233('0x4a')]);return _0x264077[_0x9233('0x53')](_0x5a30c5);}})['then'](function(_0x2acad0){if(_0x2acad0){_0x3d9098=_0x2acad0[_0x9233('0x31')];if(!_0x194264[_0x9233('0x26')][_0x9233('0x55')](_0x9233('0x42'))){_0x5a30c5[_0x9233('0x12')]=qs[_0x9233('0x12')](_0x194264[_0x9233('0x26')][_0x9233('0x12')]);_0x5a30c5[_0x9233('0xf')]=qs['offset'](_0x194264[_0x9233('0x26')][_0x9233('0xf')]);}return _0x264077['getTeams'](_0x5a30c5);}})[_0x9233('0x16')](function(_0x446e92){if(_0x446e92){return _0x446e92?{'count':_0x3d9098,'rows':_0x446e92}:null;}})[_0x9233('0x16')](respondWithResult(_0x1f401d,null))['catch'](handleError(_0x1f401d,null));};exports[_0x9233('0x56')]=function(_0x4558e3,_0x241705){var _0x2dcdb2=_0x4558e3[_0x9233('0x34')]['ids'];return db[_0x9233('0x54')][_0x9233('0x4b')]({'where':{'id':_0x2dcdb2},'attributes':['id'],'include':[{'model':db[_0x9233('0x57')],'as':'Agents','attributes':['id',_0x9233('0x1d'),'online','voicePause',_0x9233('0x58')],'raw':!![]}]})['then'](function(_0x2af982){if(_0x2af982){var _0x4ea715=_[_0x9233('0x59')](_0x2af982,function(_0x24b8f7){var _0x32a639=_0x24b8f7[_0x9233('0x17')]({'plain':!![]});return _0x32a639['Agents'];});return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x4558e3['params']['id']}})['then'](function(_0x2d2028){return db[_0x9233('0x5a')][_0x9233('0x5b')](function(_0x14faf6){return _0x2d2028[_0x9233('0x56')](_0x2dcdb2,{'transaction':_0x14faf6})[_0x9233('0x16')](function(){return BPromise[_0x9233('0x5c')](_0x4ea715,function(_0x1c8f80){return db[_0x9233('0x41')][_0x9233('0x5d')]({'where':{'UserId':_0x1c8f80['id'],'ChatQueueId':_0x4558e3['params']['id']},'transaction':_0x14faf6});});})['then'](function(){_0x4ea715[_0x9233('0x5e')](function(_0x5be4a4){socket['emit'](_0x9233('0x5f'),{'UserId':_0x5be4a4['id'],'ChatQueueId':_0x2d2028['id']});});});});});}})['then'](respondWithStatusCode(_0x241705,null))[_0x9233('0x28')](handleError(_0x241705,null));};exports['removeTeams']=function(_0x4467b2,_0x2f8b82){return db[_0x9233('0x54')][_0x9233('0x4b')]({'where':{'id':_0x4467b2['query'][_0x9233('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9233('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f8b82,null))[_0x9233('0x16')](function(_0x3d2243){var _0x678e2f=_[_0x9233('0x48')](_0x3d2243,'id');var _0x2c10b9=[];var _0x32564f=[];var _0x1f777a=squel[_0x9233('0x62')]();_0x1f777a[_0x9233('0x63')](_0x9233('0x64'))[_0x9233('0x65')](_0x9233('0x66'),'tq')[_0x9233('0x67')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9233('0x45')](_0x9233('0x68'),_0x4467b2['params']['id']);for(var _0x15d1ac=0x0;_0x15d1ac<_0x3d2243['length'];_0x15d1ac+=0x1){let _0x359843=_0x3d2243[_0x15d1ac];for(var _0x4b1d7d=0x0;_0x4b1d7d<_0x359843[_0x9233('0x61')]['length'];_0x4b1d7d+=0x1){let _0x28bc94=_0x359843[_0x9233('0x61')][_0x4b1d7d];var _0x383096=_0x1f777a[_0x9233('0x69')]();_0x383096['where'](_0x9233('0x6a'),_0x28bc94['id']);_0x32564f['push'](db[_0x9233('0x5a')][_0x9233('0x26')](_0x383096[_0x9233('0x6b')](),{'type':db['sequelize'][_0x9233('0x6c')]['SELECT']})[_0x9233('0x16')](function(_0x3151d4){if(_0x3151d4[_0x9233('0x31')]===0x1){return _0x28bc94['id'];}else{var _0x489dad=_[_0x9233('0x6d')](_[_0x9233('0x48')](_0x3151d4,_0x9233('0x6e')),function(_0x5e04be){return _['includes'](_0x678e2f,_0x5e04be);});if(_0x489dad){return _0x28bc94['id'];}}}));}}return BPromise['all'](_0x32564f)[_0x9233('0x16')](function(_0x3107a1){_0x2c10b9=_(_0x2c10b9)[_0x9233('0x6f')](_0x3107a1)[_0x9233('0x70')]()['value']();return db['ChatQueue'][_0x9233('0x39')]({'where':{'id':_0x4467b2[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](function(_0xb0a3ea){return db['sequelize'][_0x9233('0x5b')](function(_0x289434){return _0xb0a3ea[_0x9233('0x71')](_0x4467b2[_0x9233('0x26')]['ids'],{'transaction':_0x289434})['then'](function(){if(!_[_0x9233('0x72')](_0x2c10b9)){return _0xb0a3ea[_0x9233('0x73')](_0x2c10b9,{'transaction':_0x289434});}})[_0x9233('0x16')](function(){_0x2c10b9[_0x9233('0x5e')](function(_0x6f254a){socket[_0x9233('0x74')](_0x9233('0x75'),{'UserId':_0x6f254a,'ChatQueueId':_0xb0a3ea['id']});});});});});});})[_0x9233('0x16')](respondWithStatusCode(_0x2f8b82,null))[_0x9233('0x28')](handleError(_0x2f8b82,null));};exports['addAgents']=function(_0x249a44,_0x232855){return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x249a44[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x232855,null))[_0x9233('0x16')](function(_0x4c0230){if(_0x4c0230){return _0x4c0230[_0x9233('0x76')](_0x249a44[_0x9233('0x34')]['ids'],_['omit'](_0x249a44[_0x9233('0x34')],['ids','id'])||{})[_0x9233('0x77')](function(_0x28409e){for(var _0x5f3a33=0x0;_0x5f3a33<_0x249a44['body'][_0x9233('0x60')][_0x9233('0x31')];_0x5f3a33+=0x1){socket[_0x9233('0x74')](_0x9233('0x5f'),{'UserId':Number(_0x249a44[_0x9233('0x34')][_0x9233('0x60')][_0x5f3a33]),'ChatQueueId':Number(_0x249a44[_0x9233('0x2a')]['id'])});}return _0x28409e;});}})['then'](respondWithResult(_0x232855,null))[_0x9233('0x28')](handleError(_0x232855,null));};exports['removeAgents']=function(_0x471cc9,_0x522bf1){return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x471cc9[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x522bf1,null))['then'](function(_0x21bbdf){if(_0x21bbdf){return _0x21bbdf[_0x9233('0x73')](_0x471cc9[_0x9233('0x26')]['ids'])['then'](function(){if(_[_0x9233('0x78')](_0x471cc9[_0x9233('0x26')][_0x9233('0x60')])){for(var _0x3a5c18=0x0;_0x3a5c18<_0x471cc9[_0x9233('0x26')]['ids'][_0x9233('0x31')];_0x3a5c18+=0x1){socket[_0x9233('0x74')](_0x9233('0x75'),{'UserId':Number(_0x471cc9[_0x9233('0x26')]['ids'][_0x3a5c18]),'ChatQueueId':Number(_0x471cc9[_0x9233('0x2a')]['id'])});}}else{socket['emit'](_0x9233('0x75'),{'UserId':Number(_0x471cc9[_0x9233('0x26')][_0x9233('0x60')]),'ChatQueueId':Number(_0x471cc9['params']['id'])});}});}})[_0x9233('0x16')](respondWithStatusCode(_0x522bf1,null))[_0x9233('0x28')](handleError(_0x522bf1,null));};exports[_0x9233('0x79')]=function(_0xd34a22,_0x48b4cd){var _0x44040b={};var _0x6dbf7a={};var _0x535506;var _0x16e97e;return db[_0x9233('0x24')]['findOne']({'where':{'id':_0xd34a22[_0x9233('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48b4cd,null))[_0x9233('0x16')](function(_0x1ec6d6){if(_0x1ec6d6){_0x535506=_0x1ec6d6;_0x6dbf7a[_0x9233('0x2b')]=_['keys'](db[_0x9233('0x57')][_0x9233('0x20')]);_0x6dbf7a[_0x9233('0x26')]=_[_0x9233('0x2c')](_0xd34a22[_0x9233('0x26')]);_0x6dbf7a[_0x9233('0x2d')]=_[_0x9233('0x2e')](_0x6dbf7a[_0x9233('0x2b')],_0x6dbf7a[_0x9233('0x26')]);_0x44040b['attributes']=_[_0x9233('0x2e')](_0x6dbf7a[_0x9233('0x2b')],qs[_0x9233('0x2f')](_0xd34a22['query']['fields']));_0x44040b[_0x9233('0x30')]=_0x44040b[_0x9233('0x30')][_0x9233('0x31')]?_0x44040b[_0x9233('0x30')]:_0x6dbf7a[_0x9233('0x2b')];_0x44040b[_0x9233('0x43')]=qs[_0x9233('0x44')](_0xd34a22[_0x9233('0x26')]['sort']);_0x44040b[_0x9233('0x45')]=qs[_0x9233('0x2d')](_['pick'](_0xd34a22['query'],_0x6dbf7a[_0x9233('0x2d')]));if(_0xd34a22[_0x9233('0x26')][_0x9233('0x49')]){_0x44040b[_0x9233('0x45')]=_[_0x9233('0x32')](_0x44040b[_0x9233('0x45')],{'$or':_['map'](_0x44040b[_0x9233('0x30')],function(_0x2973a3){var _0x592a07={};_0x592a07[_0x2973a3]={'$like':'%'+_0xd34a22[_0x9233('0x26')][_0x9233('0x49')]+'%'};return _0x592a07;})});}_0x44040b=_[_0x9233('0x32')]({},_0x44040b,_0xd34a22[_0x9233('0x4a')]);return _0x535506[_0x9233('0x79')](_0x44040b);}})[_0x9233('0x16')](function(_0x57c43d){if(_0x57c43d){_0x16e97e=_0x57c43d[_0x9233('0x31')];if(!_0xd34a22['query']['hasOwnProperty'](_0x9233('0x42'))){_0x44040b[_0x9233('0x12')]=qs['limit'](_0xd34a22[_0x9233('0x26')]['limit']);_0x44040b[_0x9233('0xf')]=qs[_0x9233('0xf')](_0xd34a22[_0x9233('0x26')]['offset']);}return _0x535506[_0x9233('0x79')](_0x44040b);}})[_0x9233('0x16')](function(_0x41698b){if(_0x41698b){return _0x41698b?{'count':_0x16e97e,'rows':_0x41698b}:null;}})['then'](respondWithResult(_0x48b4cd,null))[_0x9233('0x28')](handleError(_0x48b4cd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f6f94c7..c90edaf 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 _0x5e57=['ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x104f06,_0xb99f12){var _0x4a6ffd=function(_0x1a7668){while(--_0x1a7668){_0x104f06['push'](_0x104f06['shift']());}};_0x4a6ffd(++_0xb99f12);}(_0x5e57,0x170));var _0x75e5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5e57[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x75e5('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x75e5('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x75e5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x75e5('0x3'),'afterDestroy':_0x75e5('0x4')};function emitEvent(_0x4efba7){return function(_0x40d02e,_0x46a5cf,_0x45c20e){ChatQueueEvents[_0x75e5('0x5')](_0x4efba7+':'+_0x40d02e['id'],_0x40d02e);ChatQueueEvents[_0x75e5('0x5')](_0x4efba7,_0x40d02e);_0x45c20e(null);};}for(var e in events){if(events[_0x75e5('0x6')](e)){var event=events[e];ChatQueue[_0x75e5('0x7')](e,emitEvent(event));}}module[_0x75e5('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xa3e6=['hook','exports','events','ChatQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x3fc5e8,_0x5af2c0){var _0x280d80=function(_0x199afb){while(--_0x199afb){_0x3fc5e8['push'](_0x3fc5e8['shift']());}};_0x280d80(++_0x5af2c0);}(_0xa3e6,0x158));var _0x6a3e=function(_0xb881d2,_0x65f919){_0xb881d2=_0xb881d2-0x0;var _0x247b51=_0xa3e6[_0xb881d2];return _0x247b51;};'use strict';var EventEmitter=require(_0x6a3e('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x6a3e('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6a3e('0x2'),'afterUpdate':_0x6a3e('0x3'),'afterDestroy':_0x6a3e('0x4')};function emitEvent(_0x5d8e3d){return function(_0x2190fc,_0x35a2b6,_0x3da56a){ChatQueueEvents[_0x6a3e('0x5')](_0x5d8e3d+':'+_0x2190fc['id'],_0x2190fc);ChatQueueEvents[_0x6a3e('0x5')](_0x5d8e3d,_0x2190fc);_0x3da56a(null);};}for(var e in events){if(events[_0x6a3e('0x6')](e)){var event=events[e];ChatQueue[_0x6a3e('0x7')](e,emitEvent(event));}}module[_0x6a3e('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 22cee6a..7a1a208 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 _0xe6e7=['bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x225f1d,_0x586a65){var _0x1f44bb=function(_0x1c51bd){while(--_0x1c51bd){_0x225f1d['push'](_0x225f1d['shift']());}};_0x1f44bb(++_0x586a65);}(_0xe6e7,0x81));var _0x7e6e=function(_0x3a3735,_0x2c7b7c){_0x3a3735=_0x3a3735-0x0;var _0x425ccc=_0xe6e7[_0x3a3735];return _0x425ccc;};'use strict';var _=require(_0x7e6e('0x0'));var util=require(_0x7e6e('0x1'));var logger=require(_0x7e6e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7e6e('0x3'));var rp=require(_0x7e6e('0x4'));var fs=require('fs');var path=require(_0x7e6e('0x5'));var rimraf=require('rimraf');var config=require(_0x7e6e('0x6'));var attributes=require(_0x7e6e('0x7'));module['exports']=function(_0xc63d94,_0x1ab8de){return _0xc63d94[_0x7e6e('0x8')](_0x7e6e('0x9'),attributes,{'tableName':_0x7e6e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ed5=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3333de,_0x323c42){var _0x20da72=function(_0x151536){while(--_0x151536){_0x3333de['push'](_0x3333de['shift']());}};_0x20da72(++_0x323c42);}(_0x6ed5,0xb6));var _0x56ed=function(_0x4561f1,_0x171083){_0x4561f1=_0x4561f1-0x0;var _0x1ddfb4=_0x6ed5[_0x4561f1];return _0x1ddfb4;};'use strict';var _=require(_0x56ed('0x0'));var util=require(_0x56ed('0x1'));var logger=require(_0x56ed('0x2'))(_0x56ed('0x3'));var moment=require(_0x56ed('0x4'));var BPromise=require(_0x56ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x56ed('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x56ed('0x7')]=function(_0x442557,_0x2a763a){return _0x442557[_0x56ed('0x8')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index c91e716..9d5d60a 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 _0x1a37=['then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x1f8e00,_0x4efcde){var _0x693a73=function(_0xd7e651){while(--_0xd7e651){_0x1f8e00['push'](_0x1f8e00['shift']());}};_0x693a73(++_0x4efcde);}(_0x1a37,0x127));var _0x71a3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a37[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require(_0x71a3('0xa'));var jayson=require(_0x71a3('0xb'));var client=jayson[_0x71a3('0xc')][_0x71a3('0xd')]({'port':0x232a});config[_0x71a3('0xe')]=_[_0x71a3('0xf')](config[_0x71a3('0xe')],{'host':_0x71a3('0x10'),'port':0x18eb});var socket=require(_0x71a3('0x11'))(new Redis(config[_0x71a3('0xe')]));require('./chatQueue.socket')[_0x71a3('0x12')](socket);function respondWithRpcPromise(_0x302975,_0x4a91d6,_0x52df4a){return new BPromise(function(_0x71346a,_0x5ee94d){return client[_0x71a3('0x13')](_0x302975,_0x52df4a)[_0x71a3('0x14')](function(_0x471b42){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4a91d6,'request\x20sent');logger[_0x71a3('0x15')](_0x71a3('0x16'),_0x4a91d6,_0x71a3('0x17'),JSON[_0x71a3('0x18')](_0x471b42));if(_0x471b42[_0x71a3('0x19')]){if(_0x471b42[_0x71a3('0x19')][_0x71a3('0x1a')]===0x1f4){logger[_0x71a3('0x19')](_0x71a3('0x1b'),_0x4a91d6,_0x471b42[_0x71a3('0x19')]['message']);return _0x5ee94d(_0x471b42[_0x71a3('0x19')][_0x71a3('0x1c')]);}logger['error'](_0x71a3('0x1b'),_0x4a91d6,_0x471b42[_0x71a3('0x19')][_0x71a3('0x1c')]);return _0x71346a(_0x471b42[_0x71a3('0x19')]['message']);}else{logger[_0x71a3('0x1d')](_0x71a3('0x1b'),_0x4a91d6,_0x71a3('0x17'));_0x71346a(_0x471b42[_0x71a3('0x1e')][_0x71a3('0x1c')]);}})[_0x71a3('0x1f')](function(_0x1f998d){logger[_0x71a3('0x19')]('ChatQueue,\x20%s,\x20%s',_0x4a91d6,_0x1f998d);_0x5ee94d(_0x1f998d);});});}exports[_0x71a3('0x20')]=function(_0x41c124){var _0x4eb38e=this;return new Promise(function(_0x5dc0c7,_0x523935){return db[_0x71a3('0x21')][_0x71a3('0x22')]({'raw':_0x41c124[_0x71a3('0x23')]?_0x41c124[_0x71a3('0x23')][_0x71a3('0x24')]===undefined?!![]:![]:!![],'where':_0x41c124[_0x71a3('0x23')]?_0x41c124['options'][_0x71a3('0x25')]||null:null,'attributes':_0x41c124[_0x71a3('0x23')]?_0x41c124['options']['attributes']||null:null,'limit':_0x41c124['options']?_0x41c124[_0x71a3('0x23')][_0x71a3('0x26')]||null:null,'include':_0x41c124[_0x71a3('0x23')]?_0x41c124[_0x71a3('0x23')][_0x71a3('0x27')]?_[_0x71a3('0x28')](_0x41c124[_0x71a3('0x23')]['include'],function(_0x3b4ebb){return{'model':db[_0x3b4ebb[_0x71a3('0x29')]],'as':_0x3b4ebb['as'],'attributes':_0x3b4ebb['attributes'],'include':_0x3b4ebb[_0x71a3('0x27')]?_[_0x71a3('0x28')](_0x3b4ebb[_0x71a3('0x27')],function(_0x2d42d9){return{'model':db[_0x2d42d9['model']],'as':_0x2d42d9['as'],'attributes':_0x2d42d9[_0x71a3('0x2a')],'include':_0x2d42d9['include']?_[_0x71a3('0x28')](_0x2d42d9[_0x71a3('0x27')],function(_0x3d29c3){return{'model':db[_0x3d29c3[_0x71a3('0x29')]],'as':_0x3d29c3['as'],'attributes':_0x3d29c3[_0x71a3('0x2a')]};}):[]};}):[]};}):[]:[]})[_0x71a3('0x14')](function(_0x547cc3){logger[_0x71a3('0x1d')]('GetChatQueue',_0x41c124);logger[_0x71a3('0x15')](_0x71a3('0x20'),_0x41c124,JSON[_0x71a3('0x18')](_0x547cc3));_0x5dc0c7(_0x547cc3);})[_0x71a3('0x1f')](function(_0x1e489a){logger[_0x71a3('0x19')]('GetChatQueue',_0x1e489a[_0x71a3('0x1c')],_0x41c124);_0x523935(_0x4eb38e[_0x71a3('0x19')](0x1f4,_0x1e489a[_0x71a3('0x1c')]));});});};exports[_0x71a3('0x2b')]=function(_0x3f7afd){var _0x472ef2=this;return new Promise(function(_0x3f5f0f,_0x1c22a4){return db[_0x71a3('0x21')][_0x71a3('0x2c')]({'raw':_0x3f7afd[_0x71a3('0x23')]?_0x3f7afd[_0x71a3('0x23')][_0x71a3('0x24')]===undefined?!![]:![]:!![],'where':_0x3f7afd['options']?_0x3f7afd[_0x71a3('0x23')][_0x71a3('0x25')]||null:null,'attributes':_0x3f7afd[_0x71a3('0x23')]?_0x3f7afd[_0x71a3('0x23')][_0x71a3('0x2a')]||null:null,'include':_0x3f7afd[_0x71a3('0x23')]?_0x3f7afd['options'][_0x71a3('0x27')]?_[_0x71a3('0x28')](_0x3f7afd[_0x71a3('0x23')][_0x71a3('0x27')],function(_0x1ee01a){return{'model':db[_0x1ee01a[_0x71a3('0x29')]],'as':_0x1ee01a['as'],'attributes':_0x1ee01a[_0x71a3('0x2a')],'include':_0x1ee01a['include']?_[_0x71a3('0x28')](_0x1ee01a['include'],function(_0xc17a92){return{'model':db[_0xc17a92[_0x71a3('0x29')]],'as':_0xc17a92['as'],'attributes':_0xc17a92[_0x71a3('0x2a')],'include':_0xc17a92[_0x71a3('0x27')]?_['map'](_0xc17a92[_0x71a3('0x27')],function(_0x51cce4){return{'model':db[_0x51cce4[_0x71a3('0x29')]],'as':_0x51cce4['as'],'attributes':_0x51cce4[_0x71a3('0x2a')]};}):[]};}):[]};}):[]:[]})[_0x71a3('0x14')](function(_0x3561a4){logger[_0x71a3('0x1d')](_0x71a3('0x2b'),_0x3f7afd);logger['debug'](_0x71a3('0x2b'),_0x3f7afd,JSON[_0x71a3('0x18')](_0x3561a4));_0x3f5f0f(_0x3561a4);})['catch'](function(_0x4f95a8){logger[_0x71a3('0x19')](_0x71a3('0x2b'),_0x4f95a8[_0x71a3('0x1c')],_0x3f7afd);_0x1c22a4(_0x472ef2['error'](0x1f4,_0x4f95a8[_0x71a3('0x1c')]));});});};
\ No newline at end of file
+var _0x332b=['options','where','attributes','include','map','model','then','debug','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetChatQueue','ChatQueue'];(function(_0x2969bc,_0x1d0a93){var _0x4790df=function(_0x4ec7ed){while(--_0x4ec7ed){_0x2969bc['push'](_0x2969bc['shift']());}};_0x4790df(++_0x1d0a93);}(_0x332b,0x1eb));var _0xb332=function(_0x37b003,_0x330b7a){_0x37b003=_0x37b003-0x0;var _0x1cb93a=_0x332b[_0x37b003];return _0x1cb93a;};'use strict';var _=require(_0xb332('0x0'));var util=require(_0xb332('0x1'));var moment=require(_0xb332('0x2'));var BPromise=require(_0xb332('0x3'));var rs=require(_0xb332('0x4'));var fs=require('fs');var Redis=require(_0xb332('0x5'));var db=require(_0xb332('0x6'))['db'];var utils=require(_0xb332('0x7'));var logger=require(_0xb332('0x8'))('rpc');var config=require(_0xb332('0x9'));var jayson=require(_0xb332('0xa'));var client=jayson[_0xb332('0xb')][_0xb332('0xc')]({'port':0x232a});config[_0xb332('0xd')]=_[_0xb332('0xe')](config[_0xb332('0xd')],{'host':_0xb332('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb332('0xd')]));require('./chatQueue.socket')[_0xb332('0x10')](socket);function respondWithRpcPromise(_0x3a8cc4,_0xf85dc6,_0x3c2721){return new BPromise(function(_0x596db2,_0x55d578){return client['request'](_0x3a8cc4,_0x3c2721)['then'](function(_0x4f9696){logger[_0xb332('0x11')](_0xb332('0x12'),_0xf85dc6,_0xb332('0x13'));logger['debug'](_0xb332('0x14'),_0xf85dc6,'request\x20sent',JSON[_0xb332('0x15')](_0x4f9696));if(_0x4f9696['error']){if(_0x4f9696['error'][_0xb332('0x16')]===0x1f4){logger[_0xb332('0x17')](_0xb332('0x12'),_0xf85dc6,_0x4f9696[_0xb332('0x17')][_0xb332('0x18')]);return _0x55d578(_0x4f9696[_0xb332('0x17')][_0xb332('0x18')]);}logger[_0xb332('0x17')](_0xb332('0x12'),_0xf85dc6,_0x4f9696[_0xb332('0x17')][_0xb332('0x18')]);return _0x596db2(_0x4f9696['error']['message']);}else{logger['info'](_0xb332('0x12'),_0xf85dc6,'request\x20sent');_0x596db2(_0x4f9696[_0xb332('0x19')]['message']);}})[_0xb332('0x1a')](function(_0x1b092d){logger[_0xb332('0x17')](_0xb332('0x12'),_0xf85dc6,_0x1b092d);_0x55d578(_0x1b092d);});});}exports[_0xb332('0x1b')]=function(_0x22312f){var _0x4a1ba0=this;return new Promise(function(_0x2b82db,_0x14dee6){return db[_0xb332('0x1c')]['findAll']({'raw':_0x22312f[_0xb332('0x1d')]?_0x22312f['options']['raw']===undefined?!![]:![]:!![],'where':_0x22312f[_0xb332('0x1d')]?_0x22312f[_0xb332('0x1d')][_0xb332('0x1e')]||null:null,'attributes':_0x22312f['options']?_0x22312f[_0xb332('0x1d')][_0xb332('0x1f')]||null:null,'limit':_0x22312f['options']?_0x22312f[_0xb332('0x1d')]['limit']||null:null,'include':_0x22312f[_0xb332('0x1d')]?_0x22312f[_0xb332('0x1d')][_0xb332('0x20')]?_[_0xb332('0x21')](_0x22312f['options'][_0xb332('0x20')],function(_0x49999a){return{'model':db[_0x49999a['model']],'as':_0x49999a['as'],'attributes':_0x49999a[_0xb332('0x1f')],'include':_0x49999a['include']?_[_0xb332('0x21')](_0x49999a[_0xb332('0x20')],function(_0x17fc02){return{'model':db[_0x17fc02['model']],'as':_0x17fc02['as'],'attributes':_0x17fc02[_0xb332('0x1f')],'include':_0x17fc02['include']?_[_0xb332('0x21')](_0x17fc02[_0xb332('0x20')],function(_0x3c8809){return{'model':db[_0x3c8809[_0xb332('0x22')]],'as':_0x3c8809['as'],'attributes':_0x3c8809[_0xb332('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb332('0x23')](function(_0x51ea26){logger[_0xb332('0x11')](_0xb332('0x1b'),_0x22312f);logger[_0xb332('0x24')](_0xb332('0x1b'),_0x22312f,JSON[_0xb332('0x15')](_0x51ea26));_0x2b82db(_0x51ea26);})[_0xb332('0x1a')](function(_0x197adf){logger[_0xb332('0x17')](_0xb332('0x1b'),_0x197adf['message'],_0x22312f);_0x14dee6(_0x4a1ba0[_0xb332('0x17')](0x1f4,_0x197adf[_0xb332('0x18')]));});});};exports[_0xb332('0x25')]=function(_0x4a7ddd){var _0x3845af=this;return new Promise(function(_0x4c55d3,_0x102df6){return db[_0xb332('0x1c')][_0xb332('0x26')]({'raw':_0x4a7ddd[_0xb332('0x1d')]?_0x4a7ddd[_0xb332('0x1d')][_0xb332('0x27')]===undefined?!![]:![]:!![],'where':_0x4a7ddd['options']?_0x4a7ddd['options'][_0xb332('0x1e')]||null:null,'attributes':_0x4a7ddd[_0xb332('0x1d')]?_0x4a7ddd[_0xb332('0x1d')]['attributes']||null:null,'include':_0x4a7ddd[_0xb332('0x1d')]?_0x4a7ddd[_0xb332('0x1d')][_0xb332('0x20')]?_[_0xb332('0x21')](_0x4a7ddd['options'][_0xb332('0x20')],function(_0x2e10fe){return{'model':db[_0x2e10fe[_0xb332('0x22')]],'as':_0x2e10fe['as'],'attributes':_0x2e10fe[_0xb332('0x1f')],'include':_0x2e10fe[_0xb332('0x20')]?_[_0xb332('0x21')](_0x2e10fe[_0xb332('0x20')],function(_0x46df74){return{'model':db[_0x46df74['model']],'as':_0x46df74['as'],'attributes':_0x46df74[_0xb332('0x1f')],'include':_0x46df74[_0xb332('0x20')]?_[_0xb332('0x21')](_0x46df74[_0xb332('0x20')],function(_0x440fd5){return{'model':db[_0x440fd5[_0xb332('0x22')]],'as':_0x440fd5['as'],'attributes':_0x440fd5[_0xb332('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb332('0x23')](function(_0x10247f){logger[_0xb332('0x11')](_0xb332('0x25'),_0x4a7ddd);logger[_0xb332('0x24')]('ShowChatQueue',_0x4a7ddd,JSON[_0xb332('0x15')](_0x10247f));_0x4c55d3(_0x10247f);})[_0xb332('0x1a')](function(_0x126c0){logger[_0xb332('0x17')](_0xb332('0x25'),_0x126c0['message'],_0x4a7ddd);_0x102df6(_0x3845af[_0xb332('0x17')](0x1f4,_0x126c0[_0xb332('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index d5e493e..458909a 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 _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x409b87,_0x5ef488){var _0x46fa68=function(_0x2ddda7){while(--_0x2ddda7){_0x409b87['push'](_0x409b87['shift']());}};_0x46fa68(++_0x5ef488);}(_0x80d9,0x15c));var _0x980d=function(_0x1f8f75,_0x115390){_0x1f8f75=_0x1f8f75-0x0;var _0x4d1161=_0x80d9[_0x1f8f75];return _0x4d1161;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}};
\ No newline at end of file
+var _0xc3b5=['length','remove','update','emit','register'];(function(_0x2915ed,_0x1407b8){var _0x1d4fd9=function(_0x357ebc){while(--_0x357ebc){_0x2915ed['push'](_0x2915ed['shift']());}};_0x1d4fd9(++_0x1407b8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1e8332,_0x19907e){_0x1e8332=_0x1e8332-0x0;var _0x46d11f=_0xc3b5[_0x1e8332];return _0x46d11f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 104ae04..e3ee10b 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1d1c0b,_0x3449f2){var _0x57ccd1=function(_0x192b0f){while(--_0x192b0f){_0x1d1c0b['push'](_0x1d1c0b['shift']());}};_0x57ccd1(++_0x3449f2);}(_0x814b,0x1a2));var _0xb814=function(_0x4730bd,_0x1e9541){_0x4730bd=_0x4730bd-0x0;var _0x1b2849=_0x814b[_0x4730bd];return _0x1b2849;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+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(_0x5966de,_0x2a212e){var _0x287241=function(_0x4f8a91){while(--_0x4f8a91){_0x5966de['push'](_0x5966de['shift']());}};_0x287241(++_0x2a212e);}(_0xe14b,0x93));var _0xbe14=function(_0x20c299,_0x3d9bb3){_0x20c299=_0x20c299-0x0;var _0x2fd0c3=_0xe14b[_0x20c299];return _0x2fd0c3;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index adb1ee7..b290287 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 _0x02ca=['exports','STRING','DATE','moment','sequelize'];(function(_0x26cebd,_0x13b265){var _0x499dc3=function(_0x38dd9a){while(--_0x38dd9a){_0x26cebd['push'](_0x26cebd['shift']());}};_0x499dc3(++_0x13b265);}(_0x02ca,0xdf));var _0xa02c=function(_0x502379,_0x437032){_0x502379=_0x502379-0x0;var _0x1bd978=_0x02ca[_0x502379];return _0x1bd978;};'use strict';var moment=require(_0xa02c('0x0'));var Sequelize=require(_0xa02c('0x1'));module[_0xa02c('0x2')]={'uniqueid':{'type':Sequelize[_0xa02c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa02c('0x3')]},'joinAt':{'type':Sequelize[_0xa02c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa02c('0x4')]},'exitAt':{'type':Sequelize[_0xa02c('0x4')]},'reason':{'type':Sequelize[_0xa02c('0x3')]}};
\ No newline at end of file
+var _0xdf85=['sequelize','STRING','DATE'];(function(_0x368d1a,_0x552486){var _0x4834c6=function(_0x2ce26b){while(--_0x2ce26b){_0x368d1a['push'](_0x368d1a['shift']());}};_0x4834c6(++_0x552486);}(_0xdf85,0x12c));var _0x5df8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdf85[_0x57b54c];return _0x59cc19;};'use strict';var moment=require('moment');var Sequelize=require(_0x5df8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5df8('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5df8('0x1')]},'joinAt':{'type':Sequelize[_0x5df8('0x2')]},'leaveAt':{'type':Sequelize[_0x5df8('0x2')]},'acceptAt':{'type':Sequelize[_0x5df8('0x2')]},'exitAt':{'type':Sequelize[_0x5df8('0x2')]},'reason':{'type':Sequelize[_0x5df8('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ac21f8c..2724b3e 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 _0x8ce1=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','Content-Range','reject','save','update','destroy','then','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','includeAll','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis'];(function(_0x3707b0,_0x2d3bbc){var _0x405040=function(_0x135308){while(--_0x135308){_0x3707b0['push'](_0x3707b0['shift']());}};_0x405040(++_0x2d3bbc);}(_0x8ce1,0x152));var _0x18ce=function(_0xa03b53,_0x321d51){_0xa03b53=_0xa03b53-0x0;var _0x55928e=_0x8ce1[_0xa03b53];return _0x55928e;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var BPromise=require(_0x18ce('0x6'));var Mustache=require('mustache');var util=require(_0x18ce('0x7'));var path=require(_0x18ce('0x8'));var sox=require(_0x18ce('0x9'));var csv=require(_0x18ce('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18ce('0xb'));var _=require(_0x18ce('0xc'));var squel=require('squel');var crypto=require(_0x18ce('0xd'));var jsforce=require(_0x18ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x18ce('0xa'));var querystring=require('querystring');var Papa=require(_0x18ce('0xf'));var Redis=require(_0x18ce('0x10'));var authService=require(_0x18ce('0x11'));var qs=require(_0x18ce('0x12'));var as=require(_0x18ce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x18ce('0x15'));var db=require(_0x18ce('0x16'))['db'];function respondWithStatusCode(_0x13a7d4,_0x361dca){_0x361dca=_0x361dca||0xcc;return function(_0x2f9e0c){if(_0x2f9e0c){return _0x13a7d4[_0x18ce('0x17')](_0x361dca);}return _0x13a7d4['status'](_0x361dca)[_0x18ce('0x18')]();};}function respondWithResult(_0x49c3a6,_0x187c41){_0x187c41=_0x187c41||0xc8;return function(_0x4563ff){if(_0x4563ff){return _0x49c3a6[_0x18ce('0x19')](_0x187c41)[_0x18ce('0x1a')](_0x4563ff);}};}function respondWithFilteredResult(_0x13e59f,_0x4ee0af){return function(_0x40134c){if(_0x40134c){var _0x5a7d99=typeof _0x4ee0af['offset']==='undefined'&&typeof _0x4ee0af['limit']===_0x18ce('0x1b');var _0x3d6202=_0x40134c[_0x18ce('0x1c')];var _0x4e65ba=_0x5a7d99?0x0:_0x4ee0af[_0x18ce('0x1d')];var _0xf9363b=_0x5a7d99?_0x40134c[_0x18ce('0x1c')]:_0x4ee0af[_0x18ce('0x1d')]+_0x4ee0af['limit'];var _0x3e9b16;if(_0xf9363b>=_0x3d6202){_0xf9363b=_0x3d6202;_0x3e9b16=0xc8;}else{_0x3e9b16=0xce;}_0x13e59f[_0x18ce('0x19')](_0x3e9b16);return _0x13e59f['set'](_0x18ce('0x1e'),_0x4e65ba+'-'+_0xf9363b+'/'+_0x3d6202)[_0x18ce('0x1a')](_0x40134c);}return null;};}function patchUpdates(_0x43ff5e){return function(_0x1f8e30){try{jsonpatch['apply'](_0x1f8e30,_0x43ff5e,!![]);}catch(_0x5a92cd){return BPromise[_0x18ce('0x1f')](_0x5a92cd);}return _0x1f8e30[_0x18ce('0x20')]();};}function saveUpdates(_0xc25148,_0x2e1df5){return function(_0x387110){if(_0x387110){return _0x387110[_0x18ce('0x21')](_0xc25148)['then'](function(_0x5e185e){return _0x5e185e;});}return null;};}function removeEntity(_0x52c3b1,_0x163cb8){return function(_0x3c4890){if(_0x3c4890){return _0x3c4890[_0x18ce('0x22')]()[_0x18ce('0x23')](function(){_0x52c3b1[_0x18ce('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c057f,_0x4bb2df){return function(_0x1469cf){if(!_0x1469cf){_0x3c057f['sendStatus'](0x194);}return _0x1469cf;};}function handleError(_0x511ab8,_0x163bfa){_0x163bfa=_0x163bfa||0x1f4;return function(_0x5b5588){logger['error'](_0x5b5588['stack']);if(_0x5b5588[_0x18ce('0x24')]){delete _0x5b5588['name'];}_0x511ab8[_0x18ce('0x19')](_0x163bfa)[_0x18ce('0x25')](_0x5b5588);};}exports[_0x18ce('0x26')]=function(_0xd07835,_0x54ddca){var _0x28a046={},_0x211848={},_0x9bfe7c={'count':0x0,'rows':[]};var _0x347e0b=_[_0x18ce('0x27')](db[_0x18ce('0x28')]['rawAttributes'],function(_0x59d764){return{'name':_0x59d764['fieldName'],'type':_0x59d764[_0x18ce('0x29')][_0x18ce('0x2a')]};});_0x211848[_0x18ce('0x2b')]=_[_0x18ce('0x27')](_0x347e0b,_0x18ce('0x24'));_0x211848[_0x18ce('0x2c')]=_[_0x18ce('0x2d')](_0xd07835[_0x18ce('0x2c')]);_0x211848[_0x18ce('0x2e')]=_[_0x18ce('0x2f')](_0x211848[_0x18ce('0x2b')],_0x211848[_0x18ce('0x2c')]);_0x28a046[_0x18ce('0x30')]=_['intersection'](_0x211848['model'],qs[_0x18ce('0x31')](_0xd07835[_0x18ce('0x2c')][_0x18ce('0x31')]));_0x28a046[_0x18ce('0x30')]=_0x28a046[_0x18ce('0x30')][_0x18ce('0x32')]?_0x28a046[_0x18ce('0x30')]:_0x211848[_0x18ce('0x2b')];if(!_0xd07835[_0x18ce('0x2c')][_0x18ce('0x33')](_0x18ce('0x34'))){_0x28a046[_0x18ce('0x35')]=qs['limit'](_0xd07835['query'][_0x18ce('0x35')]);_0x28a046[_0x18ce('0x1d')]=qs['offset'](_0xd07835['query'][_0x18ce('0x1d')]);}_0x28a046[_0x18ce('0x36')]=qs[_0x18ce('0x37')](_0xd07835['query'][_0x18ce('0x37')]);_0x28a046['where']=qs[_0x18ce('0x2e')](_[_0x18ce('0x38')](_0xd07835[_0x18ce('0x2c')],_0x211848[_0x18ce('0x2e')]),_0x347e0b);if(_0xd07835[_0x18ce('0x2c')][_0x18ce('0x39')]){_0x28a046[_0x18ce('0x3a')]=_[_0x18ce('0x3b')](_0x28a046['where'],{'$or':_['map'](_0x347e0b,function(_0x194d82){if(_0x194d82['type']!==_0x18ce('0x3c')){var _0x167528={};_0x167528[_0x194d82[_0x18ce('0x24')]]={'$like':'%'+_0xd07835[_0x18ce('0x2c')][_0x18ce('0x39')]+'%'};return _0x167528;}})});}_0x28a046=_['merge']({},_0x28a046,_0xd07835[_0x18ce('0x3d')]);var _0x49c4a6={'where':_0x28a046['where']};return db['ChatQueueReport']['count'](_0x49c4a6)[_0x18ce('0x23')](function(_0x2bffac){_0x9bfe7c[_0x18ce('0x1c')]=_0x2bffac;if(_0xd07835[_0x18ce('0x2c')]['includeAll']){_0x28a046['include']=[{'all':!![]}];}return db[_0x18ce('0x28')][_0x18ce('0x3e')](_0x28a046);})[_0x18ce('0x23')](function(_0x4ae02f){_0x9bfe7c['rows']=_0x4ae02f;return _0x9bfe7c;})['then'](respondWithFilteredResult(_0x54ddca,_0x28a046))['catch'](handleError(_0x54ddca,null));};exports['show']=function(_0x55ac56,_0x55ccb0){var _0x1ebeb2={'raw':!![],'where':{'id':_0x55ac56['params']['id']}},_0x37d1bb={};_0x37d1bb[_0x18ce('0x2b')]=_[_0x18ce('0x2d')](db['ChatQueueReport']['rawAttributes']);_0x37d1bb[_0x18ce('0x2c')]=_[_0x18ce('0x2d')](_0x55ac56['query']);_0x37d1bb[_0x18ce('0x2e')]=_[_0x18ce('0x2f')](_0x37d1bb['model'],_0x37d1bb[_0x18ce('0x2c')]);_0x1ebeb2[_0x18ce('0x30')]=_[_0x18ce('0x2f')](_0x37d1bb[_0x18ce('0x2b')],qs[_0x18ce('0x31')](_0x55ac56[_0x18ce('0x2c')]['fields']));_0x1ebeb2['attributes']=_0x1ebeb2[_0x18ce('0x30')][_0x18ce('0x32')]?_0x1ebeb2[_0x18ce('0x30')]:_0x37d1bb[_0x18ce('0x2b')];if(_0x55ac56[_0x18ce('0x2c')][_0x18ce('0x3f')]){_0x1ebeb2[_0x18ce('0x40')]=[{'all':!![]}];}_0x1ebeb2=_[_0x18ce('0x3b')]({},_0x1ebeb2,_0x55ac56[_0x18ce('0x3d')]);return db['ChatQueueReport'][_0x18ce('0x41')](_0x1ebeb2)[_0x18ce('0x23')](handleEntityNotFound(_0x55ccb0,null))[_0x18ce('0x23')](respondWithResult(_0x55ccb0,null))[_0x18ce('0x42')](handleError(_0x55ccb0,null));};exports[_0x18ce('0x43')]=function(_0x24b6dd,_0x5061d3){return db['ChatQueueReport']['create'](_0x24b6dd[_0x18ce('0x44')],{})['then'](respondWithResult(_0x5061d3,0xc9))[_0x18ce('0x42')](handleError(_0x5061d3,null));};exports[_0x18ce('0x21')]=function(_0x4a783d,_0x192cf2){if(_0x4a783d[_0x18ce('0x44')]['id']){delete _0x4a783d[_0x18ce('0x44')]['id'];}return db[_0x18ce('0x28')][_0x18ce('0x41')]({'where':{'id':_0x4a783d[_0x18ce('0x45')]['id']}})[_0x18ce('0x23')](handleEntityNotFound(_0x192cf2,null))['then'](saveUpdates(_0x4a783d['body'],null))[_0x18ce('0x23')](respondWithResult(_0x192cf2,null))[_0x18ce('0x42')](handleError(_0x192cf2,null));};exports[_0x18ce('0x22')]=function(_0x55e771,_0x1d4c23){return db[_0x18ce('0x28')][_0x18ce('0x41')]({'where':{'id':_0x55e771[_0x18ce('0x45')]['id']}})[_0x18ce('0x23')](handleEntityNotFound(_0x1d4c23,null))['then'](removeEntity(_0x1d4c23,null))[_0x18ce('0x42')](handleError(_0x1d4c23,null));};exports[_0x18ce('0x46')]=function(_0x318575,_0x5e2370){return db[_0x18ce('0x28')]['describe']()['then'](respondWithResult(_0x5e2370,null))[_0x18ce('0x42')](handleError(_0x5e2370,null));};
\ No newline at end of file
+var _0xed20=['../../mysqldb','sendStatus','end','status','offset','limit','undefined','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','show','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x20f92e,_0x54358f){var _0x4779d5=function(_0x2fca65){while(--_0x2fca65){_0x20f92e['push'](_0x20f92e['shift']());}};_0x4779d5(++_0x54358f);}(_0xed20,0xce));var _0x0ed2=function(_0x591cc7,_0x4437cf){_0x591cc7=_0x591cc7-0x0;var _0x2cd866=_0xed20[_0x591cc7];return _0x2cd866;};'use strict';var emlformat=require(_0x0ed2('0x0'));var rimraf=require(_0x0ed2('0x1'));var zipdir=require(_0x0ed2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ed2('0x3'));var moment=require(_0x0ed2('0x4'));var BPromise=require(_0x0ed2('0x5'));var Mustache=require(_0x0ed2('0x6'));var util=require(_0x0ed2('0x7'));var path=require(_0x0ed2('0x8'));var sox=require('sox');var csv=require(_0x0ed2('0x9'));var ejs=require(_0x0ed2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ed2('0xb'));var squel=require(_0x0ed2('0xc'));var crypto=require(_0x0ed2('0xd'));var jsforce=require(_0x0ed2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0ed2('0x9'));var querystring=require(_0x0ed2('0xf'));var Papa=require(_0x0ed2('0x10'));var Redis=require(_0x0ed2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ed2('0x12'));var hardwareService=require(_0x0ed2('0x13'));var logger=require(_0x0ed2('0x14'))(_0x0ed2('0x15'));var utils=require(_0x0ed2('0x16'));var config=require(_0x0ed2('0x17'));var licenseUtil=require(_0x0ed2('0x18'));var db=require(_0x0ed2('0x19'))['db'];function respondWithStatusCode(_0x3cc6b4,_0x342768){_0x342768=_0x342768||0xcc;return function(_0x14355d){if(_0x14355d){return _0x3cc6b4[_0x0ed2('0x1a')](_0x342768);}return _0x3cc6b4['status'](_0x342768)[_0x0ed2('0x1b')]();};}function respondWithResult(_0x3b0f4b,_0x28c90f){_0x28c90f=_0x28c90f||0xc8;return function(_0x11b884){if(_0x11b884){return _0x3b0f4b[_0x0ed2('0x1c')](_0x28c90f)['json'](_0x11b884);}};}function respondWithFilteredResult(_0x30ccd2,_0x55ca){return function(_0x350995){if(_0x350995){var _0x5101f2=typeof _0x55ca[_0x0ed2('0x1d')]==='undefined'&&typeof _0x55ca[_0x0ed2('0x1e')]===_0x0ed2('0x1f');var _0xc0f621=_0x350995['count'];var _0x50c142=_0x5101f2?0x0:_0x55ca[_0x0ed2('0x1d')];var _0x6b3af1=_0x5101f2?_0x350995['count']:_0x55ca[_0x0ed2('0x1d')]+_0x55ca['limit'];var _0x25e4dc;if(_0x6b3af1>=_0xc0f621){_0x6b3af1=_0xc0f621;_0x25e4dc=0xc8;}else{_0x25e4dc=0xce;}_0x30ccd2[_0x0ed2('0x1c')](_0x25e4dc);return _0x30ccd2['set']('Content-Range',_0x50c142+'-'+_0x6b3af1+'/'+_0xc0f621)['json'](_0x350995);}return null;};}function patchUpdates(_0x13060b){return function(_0x270de4){try{jsonpatch[_0x0ed2('0x20')](_0x270de4,_0x13060b,!![]);}catch(_0x1206e3){return BPromise[_0x0ed2('0x21')](_0x1206e3);}return _0x270de4[_0x0ed2('0x22')]();};}function saveUpdates(_0x13d3b7,_0x56f511){return function(_0x4c1dbd){if(_0x4c1dbd){return _0x4c1dbd[_0x0ed2('0x23')](_0x13d3b7)[_0x0ed2('0x24')](function(_0x7a3157){return _0x7a3157;});}return null;};}function removeEntity(_0x505321,_0x42911c){return function(_0x306f97){if(_0x306f97){return _0x306f97[_0x0ed2('0x25')]()[_0x0ed2('0x24')](function(){_0x505321['status'](0xcc)[_0x0ed2('0x1b')]();});}};}function handleEntityNotFound(_0x24983e,_0x1abc6f){return function(_0x19ffde){if(!_0x19ffde){_0x24983e[_0x0ed2('0x1a')](0x194);}return _0x19ffde;};}function handleError(_0x5bb903,_0x14c0e6){_0x14c0e6=_0x14c0e6||0x1f4;return function(_0x23b304){logger[_0x0ed2('0x26')](_0x23b304[_0x0ed2('0x27')]);if(_0x23b304[_0x0ed2('0x28')]){delete _0x23b304[_0x0ed2('0x28')];}_0x5bb903[_0x0ed2('0x1c')](_0x14c0e6)[_0x0ed2('0x29')](_0x23b304);};}exports[_0x0ed2('0x2a')]=function(_0x1e6efe,_0x597c6e){var _0x3bc558={},_0x5e9d4d={},_0x49ff37={'count':0x0,'rows':[]};var _0x3c62e4=_[_0x0ed2('0x2b')](db[_0x0ed2('0x2c')][_0x0ed2('0x2d')],function(_0x2a9b01){return{'name':_0x2a9b01[_0x0ed2('0x2e')],'type':_0x2a9b01['type']['key']};});_0x5e9d4d['model']=_[_0x0ed2('0x2b')](_0x3c62e4,_0x0ed2('0x28'));_0x5e9d4d[_0x0ed2('0x2f')]=_[_0x0ed2('0x30')](_0x1e6efe['query']);_0x5e9d4d[_0x0ed2('0x31')]=_['intersection'](_0x5e9d4d[_0x0ed2('0x32')],_0x5e9d4d[_0x0ed2('0x2f')]);_0x3bc558['attributes']=_[_0x0ed2('0x33')](_0x5e9d4d['model'],qs[_0x0ed2('0x34')](_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x34')]));_0x3bc558[_0x0ed2('0x35')]=_0x3bc558['attributes'][_0x0ed2('0x36')]?_0x3bc558[_0x0ed2('0x35')]:_0x5e9d4d['model'];if(!_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x37')](_0x0ed2('0x38'))){_0x3bc558[_0x0ed2('0x1e')]=qs[_0x0ed2('0x1e')](_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x1e')]);_0x3bc558[_0x0ed2('0x1d')]=qs[_0x0ed2('0x1d')](_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x1d')]);}_0x3bc558[_0x0ed2('0x39')]=qs['sort'](_0x1e6efe['query'][_0x0ed2('0x3a')]);_0x3bc558['where']=qs[_0x0ed2('0x31')](_[_0x0ed2('0x3b')](_0x1e6efe[_0x0ed2('0x2f')],_0x5e9d4d[_0x0ed2('0x31')]),_0x3c62e4);if(_0x1e6efe[_0x0ed2('0x2f')]['filter']){_0x3bc558[_0x0ed2('0x3c')]=_[_0x0ed2('0x3d')](_0x3bc558[_0x0ed2('0x3c')],{'$or':_[_0x0ed2('0x2b')](_0x3c62e4,function(_0x1ec43b){if(_0x1ec43b[_0x0ed2('0x3e')]!==_0x0ed2('0x3f')){var _0x5b9c67={};_0x5b9c67[_0x1ec43b['name']]={'$like':'%'+_0x1e6efe['query'][_0x0ed2('0x40')]+'%'};return _0x5b9c67;}})});}_0x3bc558=_[_0x0ed2('0x3d')]({},_0x3bc558,_0x1e6efe[_0x0ed2('0x41')]);var _0x5606d7={'where':_0x3bc558[_0x0ed2('0x3c')]};return db['ChatQueueReport'][_0x0ed2('0x42')](_0x5606d7)[_0x0ed2('0x24')](function(_0x694ebb){_0x49ff37[_0x0ed2('0x42')]=_0x694ebb;if(_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x43')]){_0x3bc558[_0x0ed2('0x44')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3bc558);})[_0x0ed2('0x24')](function(_0x4ced59){_0x49ff37[_0x0ed2('0x45')]=_0x4ced59;return _0x49ff37;})[_0x0ed2('0x24')](respondWithFilteredResult(_0x597c6e,_0x3bc558))['catch'](handleError(_0x597c6e,null));};exports[_0x0ed2('0x46')]=function(_0x3f5fa3,_0x50f596){var _0x1b4103={'raw':!![],'where':{'id':_0x3f5fa3['params']['id']}},_0x11c59d={};_0x11c59d[_0x0ed2('0x32')]=_['keys'](db[_0x0ed2('0x2c')][_0x0ed2('0x2d')]);_0x11c59d[_0x0ed2('0x2f')]=_['keys'](_0x3f5fa3['query']);_0x11c59d[_0x0ed2('0x31')]=_[_0x0ed2('0x33')](_0x11c59d[_0x0ed2('0x32')],_0x11c59d[_0x0ed2('0x2f')]);_0x1b4103['attributes']=_['intersection'](_0x11c59d[_0x0ed2('0x32')],qs['fields'](_0x3f5fa3[_0x0ed2('0x2f')][_0x0ed2('0x34')]));_0x1b4103[_0x0ed2('0x35')]=_0x1b4103[_0x0ed2('0x35')][_0x0ed2('0x36')]?_0x1b4103['attributes']:_0x11c59d[_0x0ed2('0x32')];if(_0x3f5fa3[_0x0ed2('0x2f')]['includeAll']){_0x1b4103[_0x0ed2('0x44')]=[{'all':!![]}];}_0x1b4103=_['merge']({},_0x1b4103,_0x3f5fa3['options']);return db[_0x0ed2('0x2c')][_0x0ed2('0x47')](_0x1b4103)[_0x0ed2('0x24')](handleEntityNotFound(_0x50f596,null))[_0x0ed2('0x24')](respondWithResult(_0x50f596,null))[_0x0ed2('0x48')](handleError(_0x50f596,null));};exports['create']=function(_0x567d5e,_0xa5b266){return db[_0x0ed2('0x2c')][_0x0ed2('0x49')](_0x567d5e[_0x0ed2('0x4a')],{})[_0x0ed2('0x24')](respondWithResult(_0xa5b266,0xc9))[_0x0ed2('0x48')](handleError(_0xa5b266,null));};exports[_0x0ed2('0x23')]=function(_0x6b3269,_0x3387e1){if(_0x6b3269[_0x0ed2('0x4a')]['id']){delete _0x6b3269[_0x0ed2('0x4a')]['id'];}return db[_0x0ed2('0x2c')][_0x0ed2('0x47')]({'where':{'id':_0x6b3269[_0x0ed2('0x4b')]['id']}})[_0x0ed2('0x24')](handleEntityNotFound(_0x3387e1,null))[_0x0ed2('0x24')](saveUpdates(_0x6b3269[_0x0ed2('0x4a')],null))['then'](respondWithResult(_0x3387e1,null))[_0x0ed2('0x48')](handleError(_0x3387e1,null));};exports[_0x0ed2('0x25')]=function(_0x204460,_0x58e9ca){return db[_0x0ed2('0x2c')]['find']({'where':{'id':_0x204460[_0x0ed2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58e9ca,null))[_0x0ed2('0x24')](removeEntity(_0x58e9ca,null))[_0x0ed2('0x48')](handleError(_0x58e9ca,null));};exports[_0x0ed2('0x4c')]=function(_0x1c77e2,_0x4b690e){return db['ChatQueueReport'][_0x0ed2('0x4c')]()['then'](respondWithResult(_0x4b690e,null))[_0x0ed2('0x48')](handleError(_0x4b690e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index ca523ab..00740b4 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x38ca5d,_0x4664ca){var _0x11ead7=function(_0x44aebc){while(--_0x44aebc){_0x38ca5d['push'](_0x38ca5d['shift']());}};_0x11ead7(++_0x4664ca);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4d01e3,_0x44c37e){var _0x3b2491=function(_0x40b771){while(--_0x40b771){_0x4d01e3['push'](_0x4d01e3['shift']());}};_0x3b2491(++_0x44c37e);}(_0x757a,0xde));var _0xa757=function(_0x9fadbd,_0x29b939){_0x9fadbd=_0x9fadbd-0x0;var _0x437523=_0x757a[_0x9fadbd];return _0x437523;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index b56b04b..afd917a 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 _0xbbd3=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x500655,_0x111a9c){var _0x395b0a=function(_0x478385){while(--_0x478385){_0x500655['push'](_0x500655['shift']());}};_0x395b0a(++_0x111a9c);}(_0xbbd3,0xf8));var _0x3bbd=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xbbd3[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x3bbd('0x0'));var util=require(_0x3bbd('0x1'));var moment=require(_0x3bbd('0x2'));var BPromise=require(_0x3bbd('0x3'));var rs=require(_0x3bbd('0x4'));var fs=require('fs');var Redis=require(_0x3bbd('0x5'));var db=require(_0x3bbd('0x6'))['db'];var utils=require(_0x3bbd('0x7'));var logger=require('../../config/logger')(_0x3bbd('0x8'));var config=require(_0x3bbd('0x9'));var jayson=require(_0x3bbd('0xa'));var client=jayson[_0x3bbd('0xb')][_0x3bbd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14e71f,_0xc39e73,_0x3ae881){return new BPromise(function(_0x23379f,_0x2c2fa9){return client[_0x3bbd('0xd')](_0x14e71f,_0x3ae881)[_0x3bbd('0xe')](function(_0xd2add3){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0xc39e73,'request\x20sent');logger[_0x3bbd('0xf')](_0x3bbd('0x10'),_0xc39e73,_0x3bbd('0x11'),JSON[_0x3bbd('0x12')](_0xd2add3));if(_0xd2add3[_0x3bbd('0x13')]){if(_0xd2add3[_0x3bbd('0x13')][_0x3bbd('0x14')]===0x1f4){logger[_0x3bbd('0x13')](_0x3bbd('0x15'),_0xc39e73,_0xd2add3[_0x3bbd('0x13')][_0x3bbd('0x16')]);return _0x2c2fa9(_0xd2add3[_0x3bbd('0x13')][_0x3bbd('0x16')]);}logger[_0x3bbd('0x13')](_0x3bbd('0x15'),_0xc39e73,_0xd2add3[_0x3bbd('0x13')][_0x3bbd('0x16')]);return _0x23379f(_0xd2add3[_0x3bbd('0x13')][_0x3bbd('0x16')]);}else{logger[_0x3bbd('0x17')](_0x3bbd('0x15'),_0xc39e73,'request\x20sent');_0x23379f(_0xd2add3['result'][_0x3bbd('0x16')]);}})[_0x3bbd('0x18')](function(_0x9ac90d){logger[_0x3bbd('0x13')](_0x3bbd('0x15'),_0xc39e73,_0x9ac90d);_0x2c2fa9(_0x9ac90d);});});}exports[_0x3bbd('0x19')]=function(_0x6d8b31){var _0x3c87d7=this;return new Promise(function(_0x4c406d,_0x1666bc){return db[_0x3bbd('0x1a')][_0x3bbd('0x1b')](_0x6d8b31[_0x3bbd('0x1c')],{'raw':_0x6d8b31['options']?_0x6d8b31[_0x3bbd('0x1d')][_0x3bbd('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1a6b30){logger[_0x3bbd('0x17')](_0x3bbd('0x19'),_0x6d8b31);logger[_0x3bbd('0xf')](_0x3bbd('0x19'),_0x6d8b31,JSON['stringify'](_0x1a6b30));_0x4c406d(_0x1a6b30);})[_0x3bbd('0x18')](function(_0x386762){logger['error'](_0x3bbd('0x19'),_0x386762[_0x3bbd('0x16')],_0x6d8b31);_0x1666bc(_0x3c87d7[_0x3bbd('0x13')](0x1f4,_0x386762['message']));});});};exports[_0x3bbd('0x1f')]=function(_0xb3ac43){var _0x202e7f=this;return new Promise(function(_0x114e97,_0x2c9dab){return db[_0x3bbd('0x1a')][_0x3bbd('0x20')](_0xb3ac43[_0x3bbd('0x1c')],{'raw':_0xb3ac43['options']?_0xb3ac43['options'][_0x3bbd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb3ac43[_0x3bbd('0x1d')]?_0xb3ac43[_0x3bbd('0x1d')][_0x3bbd('0x21')]||null:null,'attributes':_0xb3ac43[_0x3bbd('0x1d')]?_0xb3ac43['options'][_0x3bbd('0x22')]||null:null,'limit':_0xb3ac43[_0x3bbd('0x1d')]?_0xb3ac43['options'][_0x3bbd('0x23')]||null:null})[_0x3bbd('0xe')](function(_0x92e061){logger[_0x3bbd('0x17')](_0x3bbd('0x1f'),_0xb3ac43);logger[_0x3bbd('0xf')](_0x3bbd('0x1f'),_0xb3ac43,JSON[_0x3bbd('0x12')](_0x92e061));_0x114e97(_0x92e061);})[_0x3bbd('0x18')](function(_0x65d79a){logger[_0x3bbd('0x13')](_0x3bbd('0x1f'),_0x65d79a[_0x3bbd('0x16')],_0xb3ac43);_0x2c9dab(_0x202e7f[_0x3bbd('0x13')](0x1f4,_0x65d79a[_0x3bbd('0x16')]));});});};
\ No newline at end of file
+var _0xea36=['where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','UpdateChatQueueReport','update','body'];(function(_0x1e4612,_0xcfd7d6){var _0x40aaa3=function(_0x2aa6dd){while(--_0x2aa6dd){_0x1e4612['push'](_0x1e4612['shift']());}};_0x40aaa3(++_0xcfd7d6);}(_0xea36,0xfa));var _0x6ea3=function(_0x331bc7,_0x35ee48){_0x331bc7=_0x331bc7-0x0;var _0x286a84=_0xea36[_0x331bc7];return _0x286a84;};'use strict';var _=require(_0x6ea3('0x0'));var util=require(_0x6ea3('0x1'));var moment=require(_0x6ea3('0x2'));var BPromise=require(_0x6ea3('0x3'));var rs=require(_0x6ea3('0x4'));var fs=require('fs');var Redis=require(_0x6ea3('0x5'));var db=require(_0x6ea3('0x6'))['db'];var utils=require(_0x6ea3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ea3('0x8'));var jayson=require(_0x6ea3('0x9'));var client=jayson[_0x6ea3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1163b7,_0x7c406a,_0x33c269){return new BPromise(function(_0x5864e9,_0x340c8d){return client['request'](_0x1163b7,_0x33c269)['then'](function(_0x5ec474){logger['info'](_0x6ea3('0xb'),_0x7c406a,'request\x20sent');logger[_0x6ea3('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x7c406a,_0x6ea3('0xd'),JSON[_0x6ea3('0xe')](_0x5ec474));if(_0x5ec474[_0x6ea3('0xf')]){if(_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x10')]===0x1f4){logger[_0x6ea3('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x7c406a,_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x11')]);return _0x340c8d(_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x11')]);}logger[_0x6ea3('0xf')](_0x6ea3('0xb'),_0x7c406a,_0x5ec474[_0x6ea3('0xf')]['message']);return _0x5864e9(_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x11')]);}else{logger[_0x6ea3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x7c406a,'request\x20sent');_0x5864e9(_0x5ec474['result'][_0x6ea3('0x11')]);}})[_0x6ea3('0x13')](function(_0x1ca246){logger[_0x6ea3('0xf')](_0x6ea3('0xb'),_0x7c406a,_0x1ca246);_0x340c8d(_0x1ca246);});});}exports[_0x6ea3('0x14')]=function(_0x198e09){var _0x5b3ae6=this;return new Promise(function(_0x13c6ab,_0x4ce7a1){return db[_0x6ea3('0x15')][_0x6ea3('0x16')](_0x198e09['body'],{'raw':_0x198e09[_0x6ea3('0x17')]?_0x198e09[_0x6ea3('0x17')][_0x6ea3('0x18')]===undefined?!![]:![]:!![]})[_0x6ea3('0x19')](function(_0x56210a){logger[_0x6ea3('0x12')](_0x6ea3('0x14'),_0x198e09);logger[_0x6ea3('0xc')](_0x6ea3('0x14'),_0x198e09,JSON[_0x6ea3('0xe')](_0x56210a));_0x13c6ab(_0x56210a);})['catch'](function(_0x2c6ec8){logger['error'](_0x6ea3('0x14'),_0x2c6ec8[_0x6ea3('0x11')],_0x198e09);_0x4ce7a1(_0x5b3ae6['error'](0x1f4,_0x2c6ec8['message']));});});};exports[_0x6ea3('0x1a')]=function(_0x199880){var _0x2207ec=this;return new Promise(function(_0x4c53bc,_0x3b091a){return db[_0x6ea3('0x15')][_0x6ea3('0x1b')](_0x199880[_0x6ea3('0x1c')],{'raw':_0x199880[_0x6ea3('0x17')]?_0x199880[_0x6ea3('0x17')][_0x6ea3('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x199880['options']?_0x199880['options'][_0x6ea3('0x1d')]||null:null,'attributes':_0x199880[_0x6ea3('0x17')]?_0x199880['options']['attributes']||null:null,'limit':_0x199880[_0x6ea3('0x17')]?_0x199880['options'][_0x6ea3('0x1e')]||null:null})['then'](function(_0x1619e6){logger[_0x6ea3('0x12')](_0x6ea3('0x1a'),_0x199880);logger[_0x6ea3('0xc')](_0x6ea3('0x1a'),_0x199880,JSON['stringify'](_0x1619e6));_0x4c53bc(_0x1619e6);})[_0x6ea3('0x13')](function(_0x124b34){logger[_0x6ea3('0xf')](_0x6ea3('0x1a'),_0x124b34[_0x6ea3('0x11')],_0x199880);_0x3b091a(_0x2207ec[_0x6ea3('0xf')](0x1f4,_0x124b34['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 49858cd..2131b07 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 _0x67f5=['index','/describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x53437b,_0x33a52a){var _0x60e84b=function(_0x10275b){while(--_0x10275b){_0x53437b['push'](_0x53437b['shift']());}};_0x60e84b(++_0x33a52a);}(_0x67f5,0x9b));var _0x567f=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x67f5[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x567f('0x0'));var util=require(_0x567f('0x1'));var path=require(_0x567f('0x2'));var timeout=require(_0x567f('0x3'));var express=require(_0x567f('0x4'));var router=express[_0x567f('0x5')]();var fs_extra=require(_0x567f('0x6'));var auth=require(_0x567f('0x7'));var interaction=require(_0x567f('0x8'));var config=require(_0x567f('0x9'));var controller=require(_0x567f('0xa'));router[_0x567f('0xb')]('/',auth[_0x567f('0xc')](),controller[_0x567f('0xd')]);router[_0x567f('0xb')](_0x567f('0xe'),auth[_0x567f('0xc')](),controller['describe']);router['get'](_0x567f('0xf'),auth[_0x567f('0xc')](),controller[_0x567f('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x567f('0x11')]('/:id',auth[_0x567f('0xc')](),controller[_0x567f('0x12')]);router['delete'](_0x567f('0xf'),auth[_0x567f('0xc')](),controller[_0x567f('0x13')]);module[_0x567f('0x14')]=router;
\ No newline at end of file
+var _0x2dd8=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x13c3bd,_0x11bcfb){var _0x4bbc90=function(_0x3958d2){while(--_0x3958d2){_0x13c3bd['push'](_0x13c3bd['shift']());}};_0x4bbc90(++_0x11bcfb);}(_0x2dd8,0x11b));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var path=require(_0x82dd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x82dd('0x3')]();var fs_extra=require(_0x82dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82dd('0x5'));var config=require('../../config/environment');var controller=require(_0x82dd('0x6'));router[_0x82dd('0x7')]('/',auth[_0x82dd('0x8')](),controller[_0x82dd('0x9')]);router[_0x82dd('0x7')](_0x82dd('0xa'),auth[_0x82dd('0x8')](),controller['describe']);router[_0x82dd('0x7')](_0x82dd('0xb'),auth[_0x82dd('0x8')](),controller['show']);router['post']('/',auth[_0x82dd('0x8')](),controller[_0x82dd('0xc')]);router[_0x82dd('0xd')](_0x82dd('0xb'),auth[_0x82dd('0x8')](),controller['update']);router[_0x82dd('0xe')](_0x82dd('0xb'),auth[_0x82dd('0x8')](),controller[_0x82dd('0xf')]);module[_0x82dd('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 2b269f5..0f33388 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x153136,_0x2be1b6){var _0x35abfd=function(_0xc9e71f){while(--_0xc9e71f){_0x153136['push'](_0x153136['shift']());}};_0x35abfd(++_0x2be1b6);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xeec444,_0x267a72){var _0x124b7b=function(_0x50712d){while(--_0x50712d){_0xeec444['push'](_0xeec444['shift']());}};_0x124b7b(++_0x267a72);}(_0x70e0,0x17b));var _0x070e=function(_0x5b0ad9,_0x346d66){_0x5b0ad9=_0x5b0ad9-0x0;var _0xc976c6=_0x70e0[_0x5b0ad9];return _0xc976c6;};'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
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 37889ec..8a2fca2 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 _0xd2ad=['ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','undefined','offset','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xd2ad,0x13b));var _0xdd2a=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xd2ad[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0xdd2a('0x0'));var rimraf=require(_0xdd2a('0x1'));var zipdir=require(_0xdd2a('0x2'));var jsonpatch=require(_0xdd2a('0x3'));var rp=require(_0xdd2a('0x4'));var moment=require(_0xdd2a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdd2a('0x6'));var util=require(_0xdd2a('0x7'));var path=require(_0xdd2a('0x8'));var sox=require(_0xdd2a('0x9'));var csv=require(_0xdd2a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd2a('0xb'));var _=require(_0xdd2a('0xc'));var squel=require('squel');var crypto=require(_0xdd2a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdd2a('0xe'));var toCsv=require(_0xdd2a('0xa'));var querystring=require(_0xdd2a('0xf'));var Papa=require(_0xdd2a('0x10'));var Redis=require(_0xdd2a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd2a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd2a('0x13'))(_0xdd2a('0x14'));var utils=require(_0xdd2a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdd2a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x381447,_0x37160e){_0x37160e=_0x37160e||0xcc;return function(_0x1dec8a){if(_0x1dec8a){return _0x381447[_0xdd2a('0x17')](_0x37160e);}return _0x381447['status'](_0x37160e)[_0xdd2a('0x18')]();};}function respondWithResult(_0x42f414,_0x109cb2){_0x109cb2=_0x109cb2||0xc8;return function(_0x26748e){if(_0x26748e){return _0x42f414[_0xdd2a('0x19')](_0x109cb2)['json'](_0x26748e);}};}function respondWithFilteredResult(_0x50abac,_0x58ed46){return function(_0x5a19ed){if(_0x5a19ed){var _0x13af5c=typeof _0x58ed46['offset']===_0xdd2a('0x1a')&&typeof _0x58ed46['limit']===_0xdd2a('0x1a');var _0x3fc569=_0x5a19ed['count'];var _0x40bdd5=_0x13af5c?0x0:_0x58ed46[_0xdd2a('0x1b')];var _0xebd63c=_0x13af5c?_0x5a19ed[_0xdd2a('0x1c')]:_0x58ed46['offset']+_0x58ed46[_0xdd2a('0x1d')];var _0x5a7803;if(_0xebd63c>=_0x3fc569){_0xebd63c=_0x3fc569;_0x5a7803=0xc8;}else{_0x5a7803=0xce;}_0x50abac[_0xdd2a('0x19')](_0x5a7803);return _0x50abac[_0xdd2a('0x1e')](_0xdd2a('0x1f'),_0x40bdd5+'-'+_0xebd63c+'/'+_0x3fc569)['json'](_0x5a19ed);}return null;};}function patchUpdates(_0x1a584e){return function(_0xa7ed2c){try{jsonpatch['apply'](_0xa7ed2c,_0x1a584e,!![]);}catch(_0x37818c){return BPromise[_0xdd2a('0x20')](_0x37818c);}return _0xa7ed2c[_0xdd2a('0x21')]();};}function saveUpdates(_0x437260,_0x5ce928){return function(_0x2029ce){if(_0x2029ce){return _0x2029ce[_0xdd2a('0x22')](_0x437260)[_0xdd2a('0x23')](function(_0x1bddbe){return _0x1bddbe;});}return null;};}function removeEntity(_0x255fc7,_0x3acafc){return function(_0x4a0730){if(_0x4a0730){return _0x4a0730['destroy']()[_0xdd2a('0x23')](function(){_0x255fc7[_0xdd2a('0x19')](0xcc)[_0xdd2a('0x18')]();});}};}function handleEntityNotFound(_0x2d727d,_0x1f2ac7){return function(_0x4c3578){if(!_0x4c3578){_0x2d727d[_0xdd2a('0x17')](0x194);}return _0x4c3578;};}function handleError(_0x3a40b3,_0xb1967e){_0xb1967e=_0xb1967e||0x1f4;return function(_0x2f4794){logger[_0xdd2a('0x24')](_0x2f4794[_0xdd2a('0x25')]);if(_0x2f4794[_0xdd2a('0x26')]){delete _0x2f4794[_0xdd2a('0x26')];}_0x3a40b3['status'](_0xb1967e)[_0xdd2a('0x27')](_0x2f4794);};}exports['index']=function(_0x37ba2a,_0x3934a5){var _0x175ee8={},_0x2239d1={},_0xb10df3={'count':0x0,'rows':[]};var _0x265340=_['map'](db[_0xdd2a('0x28')][_0xdd2a('0x29')],function(_0x1b12ce){return{'name':_0x1b12ce[_0xdd2a('0x2a')],'type':_0x1b12ce[_0xdd2a('0x2b')][_0xdd2a('0x2c')]};});_0x2239d1[_0xdd2a('0x2d')]=_['map'](_0x265340,_0xdd2a('0x26'));_0x2239d1[_0xdd2a('0x2e')]=_['keys'](_0x37ba2a[_0xdd2a('0x2e')]);_0x2239d1[_0xdd2a('0x2f')]=_[_0xdd2a('0x30')](_0x2239d1[_0xdd2a('0x2d')],_0x2239d1['query']);_0x175ee8[_0xdd2a('0x31')]=_[_0xdd2a('0x30')](_0x2239d1[_0xdd2a('0x2d')],qs[_0xdd2a('0x32')](_0x37ba2a[_0xdd2a('0x2e')][_0xdd2a('0x32')]));_0x175ee8['attributes']=_0x175ee8[_0xdd2a('0x31')]['length']?_0x175ee8[_0xdd2a('0x31')]:_0x2239d1['model'];if(!_0x37ba2a['query']['hasOwnProperty'](_0xdd2a('0x33'))){_0x175ee8[_0xdd2a('0x1d')]=qs[_0xdd2a('0x1d')](_0x37ba2a[_0xdd2a('0x2e')][_0xdd2a('0x1d')]);_0x175ee8[_0xdd2a('0x1b')]=qs['offset'](_0x37ba2a['query'][_0xdd2a('0x1b')]);}_0x175ee8[_0xdd2a('0x34')]=qs[_0xdd2a('0x35')](_0x37ba2a[_0xdd2a('0x2e')][_0xdd2a('0x35')]);_0x175ee8[_0xdd2a('0x36')]=qs[_0xdd2a('0x2f')](_[_0xdd2a('0x37')](_0x37ba2a[_0xdd2a('0x2e')],_0x2239d1[_0xdd2a('0x2f')]),_0x265340);if(_0x37ba2a[_0xdd2a('0x2e')]['filter']){_0x175ee8['where']=_['merge'](_0x175ee8[_0xdd2a('0x36')],{'$or':_['map'](_0x265340,function(_0x54cc95){if(_0x54cc95[_0xdd2a('0x2b')]!==_0xdd2a('0x38')){var _0x2d2fe6={};_0x2d2fe6[_0x54cc95[_0xdd2a('0x26')]]={'$like':'%'+_0x37ba2a[_0xdd2a('0x2e')][_0xdd2a('0x39')]+'%'};return _0x2d2fe6;}})});}_0x175ee8=_['merge']({},_0x175ee8,_0x37ba2a[_0xdd2a('0x3a')]);var _0x2e4cb5={'where':_0x175ee8[_0xdd2a('0x36')]};return db[_0xdd2a('0x28')][_0xdd2a('0x1c')](_0x2e4cb5)[_0xdd2a('0x23')](function(_0x5d074b){_0xb10df3[_0xdd2a('0x1c')]=_0x5d074b;if(_0x37ba2a['query'][_0xdd2a('0x3b')]){_0x175ee8[_0xdd2a('0x3c')]=[{'all':!![]}];}return db[_0xdd2a('0x28')][_0xdd2a('0x3d')](_0x175ee8);})['then'](function(_0x252656){_0xb10df3['rows']=_0x252656;return _0xb10df3;})[_0xdd2a('0x23')](respondWithFilteredResult(_0x3934a5,_0x175ee8))[_0xdd2a('0x3e')](handleError(_0x3934a5,null));};exports['show']=function(_0x91186d,_0x48bafc){var _0x5031a6={'raw':!![],'where':{'id':_0x91186d[_0xdd2a('0x3f')]['id']}},_0xc5906a={};_0xc5906a['model']=_[_0xdd2a('0x40')](db['ChatTransferReport'][_0xdd2a('0x29')]);_0xc5906a[_0xdd2a('0x2e')]=_[_0xdd2a('0x40')](_0x91186d[_0xdd2a('0x2e')]);_0xc5906a[_0xdd2a('0x2f')]=_[_0xdd2a('0x30')](_0xc5906a[_0xdd2a('0x2d')],_0xc5906a[_0xdd2a('0x2e')]);_0x5031a6[_0xdd2a('0x31')]=_[_0xdd2a('0x30')](_0xc5906a[_0xdd2a('0x2d')],qs[_0xdd2a('0x32')](_0x91186d[_0xdd2a('0x2e')]['fields']));_0x5031a6['attributes']=_0x5031a6[_0xdd2a('0x31')][_0xdd2a('0x41')]?_0x5031a6['attributes']:_0xc5906a[_0xdd2a('0x2d')];if(_0x91186d[_0xdd2a('0x2e')][_0xdd2a('0x3b')]){_0x5031a6[_0xdd2a('0x3c')]=[{'all':!![]}];}_0x5031a6=_[_0xdd2a('0x42')]({},_0x5031a6,_0x91186d[_0xdd2a('0x3a')]);return db[_0xdd2a('0x28')][_0xdd2a('0x43')](_0x5031a6)[_0xdd2a('0x23')](handleEntityNotFound(_0x48bafc,null))[_0xdd2a('0x23')](respondWithResult(_0x48bafc,null))['catch'](handleError(_0x48bafc,null));};exports[_0xdd2a('0x44')]=function(_0x5c8ab2,_0x306ce5){return db[_0xdd2a('0x28')][_0xdd2a('0x44')](_0x5c8ab2[_0xdd2a('0x45')],{})[_0xdd2a('0x23')](respondWithResult(_0x306ce5,0xc9))['catch'](handleError(_0x306ce5,null));};exports[_0xdd2a('0x22')]=function(_0x7de236,_0x284373){if(_0x7de236[_0xdd2a('0x45')]['id']){delete _0x7de236[_0xdd2a('0x45')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x7de236[_0xdd2a('0x3f')]['id']}})[_0xdd2a('0x23')](handleEntityNotFound(_0x284373,null))[_0xdd2a('0x23')](saveUpdates(_0x7de236['body'],null))['then'](respondWithResult(_0x284373,null))[_0xdd2a('0x3e')](handleError(_0x284373,null));};exports['destroy']=function(_0x5bf9c7,_0x29a308){return db[_0xdd2a('0x28')][_0xdd2a('0x43')]({'where':{'id':_0x5bf9c7[_0xdd2a('0x3f')]['id']}})[_0xdd2a('0x23')](handleEntityNotFound(_0x29a308,null))[_0xdd2a('0x23')](removeEntity(_0x29a308,null))['catch'](handleError(_0x29a308,null));};exports[_0xdd2a('0x46')]=function(_0x259cf9,_0x275ab4){return db[_0xdd2a('0x28')][_0xdd2a('0x46')]()[_0xdd2a('0x23')](respondWithResult(_0x275ab4,null))['catch'](handleError(_0x275ab4,null));};
\ No newline at end of file
+var _0x9baf=['body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','findAll','rows','catch','show','params','keys','include','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9baf,0x1dd));var _0xf9ba=function(_0xf8cafb,_0x3bb857){_0xf8cafb=_0xf8cafb-0x0;var _0x11d273=_0x9baf[_0xf8cafb];return _0x11d273;};'use strict';var emlformat=require(_0xf9ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf9ba('0x1'));var rp=require('request-promise');var moment=require(_0xf9ba('0x2'));var BPromise=require(_0xf9ba('0x3'));var Mustache=require(_0xf9ba('0x4'));var util=require(_0xf9ba('0x5'));var path=require(_0xf9ba('0x6'));var sox=require(_0xf9ba('0x7'));var csv=require(_0xf9ba('0x8'));var ejs=require(_0xf9ba('0x9'));var fs=require('fs');var fs_extra=require(_0xf9ba('0xa'));var _=require(_0xf9ba('0xb'));var squel=require(_0xf9ba('0xc'));var crypto=require(_0xf9ba('0xd'));var jsforce=require(_0xf9ba('0xe'));var deskjs=require(_0xf9ba('0xf'));var toCsv=require(_0xf9ba('0x8'));var querystring=require(_0xf9ba('0x10'));var Papa=require(_0xf9ba('0x11'));var Redis=require(_0xf9ba('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf9ba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9ba('0x14'));var logger=require(_0xf9ba('0x15'))(_0xf9ba('0x16'));var utils=require(_0xf9ba('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf9ba('0x18'));var db=require(_0xf9ba('0x19'))['db'];function respondWithStatusCode(_0x5c14a9,_0x2213e3){_0x2213e3=_0x2213e3||0xcc;return function(_0x84f397){if(_0x84f397){return _0x5c14a9[_0xf9ba('0x1a')](_0x2213e3);}return _0x5c14a9['status'](_0x2213e3)['end']();};}function respondWithResult(_0x458474,_0x3beb82){_0x3beb82=_0x3beb82||0xc8;return function(_0x3ae1cf){if(_0x3ae1cf){return _0x458474[_0xf9ba('0x1b')](_0x3beb82)[_0xf9ba('0x1c')](_0x3ae1cf);}};}function respondWithFilteredResult(_0x47535a,_0x476a22){return function(_0x1ddb6d){if(_0x1ddb6d){var _0x5cfa1d=typeof _0x476a22['offset']==='undefined'&&typeof _0x476a22[_0xf9ba('0x1d')]===_0xf9ba('0x1e');var _0x898f0d=_0x1ddb6d[_0xf9ba('0x1f')];var _0xbbaa4c=_0x5cfa1d?0x0:_0x476a22[_0xf9ba('0x20')];var _0x461ce6=_0x5cfa1d?_0x1ddb6d[_0xf9ba('0x1f')]:_0x476a22['offset']+_0x476a22[_0xf9ba('0x1d')];var _0x9fa1e3;if(_0x461ce6>=_0x898f0d){_0x461ce6=_0x898f0d;_0x9fa1e3=0xc8;}else{_0x9fa1e3=0xce;}_0x47535a[_0xf9ba('0x1b')](_0x9fa1e3);return _0x47535a[_0xf9ba('0x21')]('Content-Range',_0xbbaa4c+'-'+_0x461ce6+'/'+_0x898f0d)[_0xf9ba('0x1c')](_0x1ddb6d);}return null;};}function patchUpdates(_0x1acb0e){return function(_0x45e2f0){try{jsonpatch[_0xf9ba('0x22')](_0x45e2f0,_0x1acb0e,!![]);}catch(_0x576318){return BPromise[_0xf9ba('0x23')](_0x576318);}return _0x45e2f0[_0xf9ba('0x24')]();};}function saveUpdates(_0x1d6d89,_0x18b495){return function(_0xe6ecf2){if(_0xe6ecf2){return _0xe6ecf2[_0xf9ba('0x25')](_0x1d6d89)[_0xf9ba('0x26')](function(_0x313f71){return _0x313f71;});}return null;};}function removeEntity(_0x1dbdb2,_0x288c72){return function(_0x194a0a){if(_0x194a0a){return _0x194a0a[_0xf9ba('0x27')]()[_0xf9ba('0x26')](function(){_0x1dbdb2[_0xf9ba('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45777f,_0xc6e83){return function(_0x4f56aa){if(!_0x4f56aa){_0x45777f[_0xf9ba('0x1a')](0x194);}return _0x4f56aa;};}function handleError(_0x4bd37d,_0x46a993){_0x46a993=_0x46a993||0x1f4;return function(_0x25eb5e){logger[_0xf9ba('0x28')](_0x25eb5e[_0xf9ba('0x29')]);if(_0x25eb5e[_0xf9ba('0x2a')]){delete _0x25eb5e[_0xf9ba('0x2a')];}_0x4bd37d['status'](_0x46a993)[_0xf9ba('0x2b')](_0x25eb5e);};}exports['index']=function(_0x1ff183,_0x19c57e){var _0x55829d={},_0x2494d9={},_0x21bb75={'count':0x0,'rows':[]};var _0x1ec9e1=_[_0xf9ba('0x2c')](db['ChatTransferReport'][_0xf9ba('0x2d')],function(_0x3aae87){return{'name':_0x3aae87[_0xf9ba('0x2e')],'type':_0x3aae87[_0xf9ba('0x2f')][_0xf9ba('0x30')]};});_0x2494d9[_0xf9ba('0x31')]=_[_0xf9ba('0x2c')](_0x1ec9e1,'name');_0x2494d9[_0xf9ba('0x32')]=_['keys'](_0x1ff183[_0xf9ba('0x32')]);_0x2494d9['filters']=_[_0xf9ba('0x33')](_0x2494d9[_0xf9ba('0x31')],_0x2494d9[_0xf9ba('0x32')]);_0x55829d[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x2494d9[_0xf9ba('0x31')],qs[_0xf9ba('0x35')](_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x35')]));_0x55829d[_0xf9ba('0x34')]=_0x55829d['attributes'][_0xf9ba('0x36')]?_0x55829d[_0xf9ba('0x34')]:_0x2494d9[_0xf9ba('0x31')];if(!_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x37')](_0xf9ba('0x38'))){_0x55829d['limit']=qs[_0xf9ba('0x1d')](_0x1ff183[_0xf9ba('0x32')]['limit']);_0x55829d[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x1ff183['query'][_0xf9ba('0x20')]);}_0x55829d[_0xf9ba('0x39')]=qs[_0xf9ba('0x3a')](_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x3a')]);_0x55829d['where']=qs['filters'](_[_0xf9ba('0x3b')](_0x1ff183['query'],_0x2494d9[_0xf9ba('0x3c')]),_0x1ec9e1);if(_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x3d')]){_0x55829d[_0xf9ba('0x3e')]=_[_0xf9ba('0x3f')](_0x55829d[_0xf9ba('0x3e')],{'$or':_[_0xf9ba('0x2c')](_0x1ec9e1,function(_0x1aa33e){if(_0x1aa33e[_0xf9ba('0x2f')]!==_0xf9ba('0x40')){var _0x219067={};_0x219067[_0x1aa33e[_0xf9ba('0x2a')]]={'$like':'%'+_0x1ff183['query'][_0xf9ba('0x3d')]+'%'};return _0x219067;}})});}_0x55829d=_[_0xf9ba('0x3f')]({},_0x55829d,_0x1ff183[_0xf9ba('0x41')]);var _0x2d7b13={'where':_0x55829d[_0xf9ba('0x3e')]};return db[_0xf9ba('0x42')][_0xf9ba('0x1f')](_0x2d7b13)[_0xf9ba('0x26')](function(_0x20c711){_0x21bb75['count']=_0x20c711;if(_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x43')]){_0x55829d['include']=[{'all':!![]}];}return db[_0xf9ba('0x42')][_0xf9ba('0x44')](_0x55829d);})[_0xf9ba('0x26')](function(_0x47dd69){_0x21bb75[_0xf9ba('0x45')]=_0x47dd69;return _0x21bb75;})[_0xf9ba('0x26')](respondWithFilteredResult(_0x19c57e,_0x55829d))[_0xf9ba('0x46')](handleError(_0x19c57e,null));};exports[_0xf9ba('0x47')]=function(_0x242e06,_0x57e8c6){var _0x30c4d7={'raw':!![],'where':{'id':_0x242e06[_0xf9ba('0x48')]['id']}},_0x3fbf21={};_0x3fbf21[_0xf9ba('0x31')]=_[_0xf9ba('0x49')](db[_0xf9ba('0x42')][_0xf9ba('0x2d')]);_0x3fbf21[_0xf9ba('0x32')]=_[_0xf9ba('0x49')](_0x242e06[_0xf9ba('0x32')]);_0x3fbf21[_0xf9ba('0x3c')]=_[_0xf9ba('0x33')](_0x3fbf21[_0xf9ba('0x31')],_0x3fbf21['query']);_0x30c4d7[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3fbf21['model'],qs[_0xf9ba('0x35')](_0x242e06['query'][_0xf9ba('0x35')]));_0x30c4d7[_0xf9ba('0x34')]=_0x30c4d7[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x30c4d7['attributes']:_0x3fbf21[_0xf9ba('0x31')];if(_0x242e06[_0xf9ba('0x32')][_0xf9ba('0x43')]){_0x30c4d7[_0xf9ba('0x4a')]=[{'all':!![]}];}_0x30c4d7=_['merge']({},_0x30c4d7,_0x242e06[_0xf9ba('0x41')]);return db[_0xf9ba('0x42')]['find'](_0x30c4d7)[_0xf9ba('0x26')](handleEntityNotFound(_0x57e8c6,null))[_0xf9ba('0x26')](respondWithResult(_0x57e8c6,null))[_0xf9ba('0x46')](handleError(_0x57e8c6,null));};exports['create']=function(_0x577151,_0x47547d){return db['ChatTransferReport'][_0xf9ba('0x4b')](_0x577151[_0xf9ba('0x4c')],{})['then'](respondWithResult(_0x47547d,0xc9))['catch'](handleError(_0x47547d,null));};exports['update']=function(_0x28fc45,_0x4ffc4b){if(_0x28fc45['body']['id']){delete _0x28fc45[_0xf9ba('0x4c')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x28fc45[_0xf9ba('0x48')]['id']}})[_0xf9ba('0x26')](handleEntityNotFound(_0x4ffc4b,null))[_0xf9ba('0x26')](saveUpdates(_0x28fc45[_0xf9ba('0x4c')],null))['then'](respondWithResult(_0x4ffc4b,null))[_0xf9ba('0x46')](handleError(_0x4ffc4b,null));};exports[_0xf9ba('0x27')]=function(_0x277ef0,_0xd9a2b6){return db['ChatTransferReport'][_0xf9ba('0x4d')]({'where':{'id':_0x277ef0['params']['id']}})[_0xf9ba('0x26')](handleEntityNotFound(_0xd9a2b6,null))[_0xf9ba('0x26')](removeEntity(_0xd9a2b6,null))[_0xf9ba('0x46')](handleError(_0xd9a2b6,null));};exports['describe']=function(_0x51b407,_0x17c061){return db[_0xf9ba('0x42')][_0xf9ba('0x4e')]()[_0xf9ba('0x26')](respondWithResult(_0x17c061,null))[_0xf9ba('0x46')](handleError(_0x17c061,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 6cf9479..3c92e6d 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 _0x7a77=['rimraf','../../config/environment','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b8642,_0x49d4d5){var _0x5c0d3b=function(_0x17e52c){while(--_0x17e52c){_0x5b8642['push'](_0x5b8642['shift']());}};_0x5c0d3b(++_0x49d4d5);}(_0x7a77,0x164));var _0x77a7=function(_0x37a899,_0x567b0c){_0x37a899=_0x37a899-0x0;var _0x9d4b3=_0x7a77[_0x37a899];return _0x9d4b3;};'use strict';var _=require(_0x77a7('0x0'));var util=require(_0x77a7('0x1'));var logger=require(_0x77a7('0x2'))(_0x77a7('0x3'));var moment=require(_0x77a7('0x4'));var BPromise=require(_0x77a7('0x5'));var rp=require(_0x77a7('0x6'));var fs=require('fs');var path=require(_0x77a7('0x7'));var rimraf=require(_0x77a7('0x8'));var config=require(_0x77a7('0x9'));var attributes=require('./chatTransferReport.attributes');module[_0x77a7('0xa')]=function(_0xef5b97,_0x433f8d){return _0xef5b97[_0x77a7('0xb')]('ChatTransferReport',attributes,{'tableName':_0x77a7('0xc'),'paranoid':![],'indexes':[{'name':_0x77a7('0xd'),'fields':[_0x77a7('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa34=['path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1213eb,_0x254d44){var _0x1cb4bb=function(_0x37c984){while(--_0x37c984){_0x1213eb['push'](_0x1213eb['shift']());}};_0x1cb4bb(++_0x254d44);}(_0xfa34,0xbe));var _0x4fa3=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xfa34[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x4fa3('0x0'));var util=require(_0x4fa3('0x1'));var logger=require(_0x4fa3('0x2'))(_0x4fa3('0x3'));var moment=require(_0x4fa3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fa3('0x5'));var rimraf=require(_0x4fa3('0x6'));var config=require(_0x4fa3('0x7'));var attributes=require(_0x4fa3('0x8'));module['exports']=function(_0x3f3c08,_0x91010e){return _0x3f3c08[_0x4fa3('0x9')](_0x4fa3('0xa'),attributes,{'tableName':_0x4fa3('0xb'),'paranoid':![],'indexes':[{'name':_0x4fa3('0xc'),'fields':[_0x4fa3('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index e24786b..b599ded 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 _0x9ab8=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1805ce,_0x565a64){var _0x344d75=function(_0x1ec743){while(--_0x1ec743){_0x1805ce['push'](_0x1805ce['shift']());}};_0x344d75(++_0x565a64);}(_0x9ab8,0xd1));var _0x89ab=function(_0x296cb0,_0x3f5ae1){_0x296cb0=_0x296cb0-0x0;var _0x31bb6a=_0x9ab8[_0x296cb0];return _0x31bb6a;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require(_0x89ab('0x3'));var rs=require(_0x89ab('0x4'));var fs=require('fs');var Redis=require(_0x89ab('0x5'));var db=require(_0x89ab('0x6'))['db'];var utils=require(_0x89ab('0x7'));var logger=require(_0x89ab('0x8'))('rpc');var config=require(_0x89ab('0x9'));var jayson=require(_0x89ab('0xa'));var client=jayson['client'][_0x89ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2666e4,_0x5726bc,_0x3f295f){return new BPromise(function(_0x4a26de,_0x1d48fe){return client[_0x89ab('0xc')](_0x2666e4,_0x3f295f)[_0x89ab('0xd')](function(_0x5789cf){logger[_0x89ab('0xe')](_0x89ab('0xf'),_0x5726bc,'request\x20sent');logger[_0x89ab('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5726bc,'request\x20sent',JSON[_0x89ab('0x11')](_0x5789cf));if(_0x5789cf[_0x89ab('0x12')]){if(_0x5789cf[_0x89ab('0x12')]['code']===0x1f4){logger[_0x89ab('0x12')](_0x89ab('0xf'),_0x5726bc,_0x5789cf[_0x89ab('0x12')][_0x89ab('0x13')]);return _0x1d48fe(_0x5789cf['error'][_0x89ab('0x13')]);}logger['error'](_0x89ab('0xf'),_0x5726bc,_0x5789cf['error'][_0x89ab('0x13')]);return _0x4a26de(_0x5789cf[_0x89ab('0x12')]['message']);}else{logger[_0x89ab('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5726bc,'request\x20sent');_0x4a26de(_0x5789cf[_0x89ab('0x14')]['message']);}})[_0x89ab('0x15')](function(_0x162fb0){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5726bc,_0x162fb0);_0x1d48fe(_0x162fb0);});});}
\ No newline at end of file
+var _0xb1fb=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','randomstring'];(function(_0x3bea28,_0x42a177){var _0xfcc523=function(_0x20bea0){while(--_0x20bea0){_0x3bea28['push'](_0x3bea28['shift']());}};_0xfcc523(++_0x42a177);}(_0xb1fb,0xec));var _0xbb1f=function(_0x4d18c8,_0x43a0d1){_0x4d18c8=_0x4d18c8-0x0;var _0x4314c9=_0xb1fb[_0x4d18c8];return _0x4314c9;};'use strict';var _=require('lodash');var util=require(_0xbb1f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbb1f('0x1'));var fs=require('fs');var Redis=require(_0xbb1f('0x2'));var db=require(_0xbb1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb1f('0x4'))('rpc');var config=require(_0xbb1f('0x5'));var jayson=require(_0xbb1f('0x6'));var client=jayson[_0xbb1f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33cad5,_0x4022,_0x2cb5e8){return new BPromise(function(_0x190189,_0x4ffd16){return client['request'](_0x33cad5,_0x2cb5e8)[_0xbb1f('0x8')](function(_0x169479){logger['info'](_0xbb1f('0x9'),_0x4022,_0xbb1f('0xa'));logger['debug'](_0xbb1f('0xb'),_0x4022,_0xbb1f('0xa'),JSON[_0xbb1f('0xc')](_0x169479));if(_0x169479[_0xbb1f('0xd')]){if(_0x169479[_0xbb1f('0xd')][_0xbb1f('0xe')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4022,_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);return _0x4ffd16(_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);}logger[_0xbb1f('0xd')](_0xbb1f('0x9'),_0x4022,_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);return _0x190189(_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4022,_0xbb1f('0xa'));_0x190189(_0x169479['result'][_0xbb1f('0xf')]);}})[_0xbb1f('0x10')](function(_0x1caa45){logger[_0xbb1f('0xd')](_0xbb1f('0x9'),_0x4022,_0x1caa45);_0x4ffd16(_0x1caa45);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 521dbde..1c4c127 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 _0x66cd=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x66cd,0xca));var _0xd66c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x66cd[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xd66c('0x0'));var util=require(_0xd66c('0x1'));var path=require('path');var timeout=require(_0xd66c('0x2'));var express=require(_0xd66c('0x3'));var router=express[_0xd66c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd66c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd66c('0x6'));var controller=require('./chatTransferReport.controller');router[_0xd66c('0x7')]('/',auth[_0xd66c('0x8')](),controller[_0xd66c('0x9')]);router[_0xd66c('0x7')](_0xd66c('0xa'),auth[_0xd66c('0x8')](),controller[_0xd66c('0xb')]);router[_0xd66c('0x7')](_0xd66c('0xc'),auth['isAuthenticated'](),controller[_0xd66c('0xd')]);router[_0xd66c('0xe')]('/',auth[_0xd66c('0x8')](),controller[_0xd66c('0xf')]);router[_0xd66c('0x10')]('/:id',auth[_0xd66c('0x8')](),controller[_0xd66c('0x11')]);router[_0xd66c('0x12')](_0xd66c('0xc'),auth[_0xd66c('0x8')](),controller[_0xd66c('0x13')]);module[_0xd66c('0x14')]=router;
\ No newline at end of file
+var _0x9d64=['./chatTransferReport.controller','isAuthenticated','get','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d64,0x122));var _0x49d6=function(_0x4a3d63,_0x5cbed5){_0x4a3d63=_0x4a3d63-0x0;var _0x8cbc66=_0x9d64[_0x4a3d63];return _0x8cbc66;};'use strict';var multer=require(_0x49d6('0x0'));var util=require(_0x49d6('0x1'));var path=require(_0x49d6('0x2'));var timeout=require(_0x49d6('0x3'));var express=require(_0x49d6('0x4'));var router=express[_0x49d6('0x5')]();var fs_extra=require(_0x49d6('0x6'));var auth=require(_0x49d6('0x7'));var interaction=require(_0x49d6('0x8'));var config=require(_0x49d6('0x9'));var controller=require(_0x49d6('0xa'));router['get']('/',auth[_0x49d6('0xb')](),controller['index']);router[_0x49d6('0xc')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x49d6('0xc')](_0x49d6('0xd'),auth['isAuthenticated'](),controller[_0x49d6('0xe')]);router[_0x49d6('0xf')]('/',auth['isAuthenticated'](),controller[_0x49d6('0x10')]);router['put'](_0x49d6('0xd'),auth[_0x49d6('0xb')](),controller['update']);router[_0x49d6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x49d6('0x12')]);module[_0x49d6('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 969d937..b34e31c 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 _0x470b=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','ENUM','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x470b,0x1da));var _0xb470=function(_0x2d071c,_0x2a0600){_0x2d071c=_0x2d071c-0x0;var _0x3d71f9=_0x470b[_0x2d071c];return _0x3d71f9;};'use strict';var Sequelize=require(_0xb470('0x0'));var rs=require(_0xb470('0x1'));module[_0xb470('0x2')]={'name':{'type':Sequelize[_0xb470('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb470('0x3')],'allowNull':![],'unique':_0xb470('0x4')},'description':{'type':Sequelize[_0xb470('0x3')]},'mapKey':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb470('0x5')},'key':{'type':Sequelize[_0xb470('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb470('0x3')],'allowNull':![],'defaultValue':_0xb470('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb470('0x3')],'allowNull':![],'defaultValue':_0xb470('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb470('0x3')],'allowNull':![],'defaultValue':_0xb470('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb470('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb470('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb470('0x3')]},'animation':{'type':Sequelize[_0xb470('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb470('0xa'),_0xb470('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb470('0xd')},'offline_chat_button':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0xe')},'header_offline':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xb470('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb470('0x11')]},'closingQuestion':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x13')},'noteTitle':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb470('0x15')},'closingMessage':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x16')},'conditionAgreement':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb470('0x17')](_0xb470('0x18'),'thumb'),'defaultValue':_0xb470('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xb470('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb470('0x11')],'defaultValue':function(){return JSON[_0xb470('0x19')]({'items':[{'type':_0xb470('0x1a'),'variable':null,'config':{'placeholder':_0xb470('0x1b'),'type':'text','required':!![]},'props':{'title':_0xb470('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xb470('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xb470('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb470('0x1c')](_0xb470('0x1d'))?JSON[_0xb470('0x1e')](this[_0xb470('0x1c')](_0xb470('0x1d'))):{};},'set':function(_0x1ca15c){return this[_0xb470('0x1f')]('onlineForm',JSON['stringify'](_0x1ca15c));}},'offlineForm':{'type':Sequelize[_0xb470('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb470('0x1a'),'props':{'title':_0xb470('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xb470('0x5'),'type':_0xb470('0x5')},'variable':null},{'type':_0xb470('0x20'),'config':{'placeholder':_0xb470('0x21')},'props':{'title':_0xb470('0x21'),'helpText':_0xb470('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xb470('0x1c')]('offlineForm')?JSON[_0xb470('0x1e')](this[_0xb470('0x1c')]('offlineForm')):{};},'set':function(_0x182025){return this['setDataValue']('offlineForm',JSON[_0xb470('0x19')](_0x182025));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb470('0x23')]();}},'autoclose':{'type':Sequelize[_0xb470('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb470('0x3')]},'forwardOffline':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x24')},'waitingMessage':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x26')},'offlineMessageBody':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb470('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb470('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb470('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb470('0x11')],'defaultValue':function(){return _0xb470('0x28');}},'notificationSound':{'type':Sequelize[_0xb470('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb470('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb470('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x2a')},'verticalAlignment':{'type':Sequelize[_0xb470('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x2b')},'messagesAlignment':{'type':Sequelize[_0xb470('0x3')],'defaultValue':_0xb470('0x2c')},'defaultTitle':{'type':Sequelize[_0xb470('0x3')]},'customerAvatar':{'type':Sequelize[_0xb470('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb470('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb470('0x3')],'allowNull':![],'defaultValue':_0xb470('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb470('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb470('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb470('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb470('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![],'comment':_0xb470('0x2f'),'set':function(_0x26be94){if(!_0x26be94)this['setDataValue'](_0xb470('0x30'),null);this[_0xb470('0x1f')](_0xb470('0x31'),_0x26be94);}},'vidaooEscalation':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb470('0x3')]},'vidaooTopic':{'type':Sequelize[_0xb470('0x3')],'allowNull':![],'defaultValue':_0xb470('0x32')},'vidaooNote':{'type':Sequelize[_0xb470('0x3')],'defaultValue':function(){return _0xb470('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xb470('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb470('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb470('0x11')]}};
\ No newline at end of file
+var _0x8032=['Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','Agent','#011F6A','#ffffff','INTEGER','squared','rounded','We\x20are\x20here!','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','input','name','text','email','parse','getDataValue','setDataValue','onlineForm','stringify','textarea'];(function(_0x516387,_0x133120){var _0x181646=function(_0x2e4297){while(--_0x2e4297){_0x516387['push'](_0x516387['shift']());}};_0x181646(++_0x133120);}(_0x8032,0x163));var _0x2803=function(_0x26dd96,_0x1e70a6){_0x26dd96=_0x26dd96-0x0;var _0x1aa18f=_0x8032[_0x26dd96];return _0x1aa18f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2803('0x0'));module[_0x2803('0x1')]={'name':{'type':Sequelize[_0x2803('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'unique':_0x2803('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x2803('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x4')},'customerAlias':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2803('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'defaultValue':_0x2803('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'defaultValue':_0x2803('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2803('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x2803('0x8')),'defaultValue':_0x2803('0x9')},'header_online':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xa')},'start_chat_button':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xb')},'offline_chat_button':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xc')},'header_offline':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x2803('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2803('0xf')]},'closingQuestion':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x12')},'noteTitle':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x13')},'placeholderMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x14')},'closingMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x15')},'closingMessageButton':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xc')},'skipMessageButton':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x16')},'conditionAgreement':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x17')},'ratingType':{'type':Sequelize[_0x2803('0x18')](_0x2803('0x19'),_0x2803('0x1a')),'defaultValue':_0x2803('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2803('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2803('0x1b'),'variable':null,'config':{'placeholder':_0x2803('0x1c'),'type':_0x2803('0x1d'),'required':!![]},'props':{'title':_0x2803('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2803('0x1e')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x2803('0x1f')](this[_0x2803('0x20')]('onlineForm')):{};},'set':function(_0x507363){return this[_0x2803('0x21')](_0x2803('0x22'),JSON[_0x2803('0x23')](_0x507363));}},'offlineForm':{'type':Sequelize[_0x2803('0xf')],'defaultValue':function(){return JSON[_0x2803('0x23')]({'items':[{'type':'input','props':{'title':_0x2803('0x1e'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2803('0x1e')},'variable':null},{'type':_0x2803('0x24'),'config':{'placeholder':_0x2803('0x25')},'props':{'title':_0x2803('0x25'),'helpText':_0x2803('0x26')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x2803('0x27'))?JSON[_0x2803('0x1f')](this[_0x2803('0x20')](_0x2803('0x27'))):{};},'set':function(_0x563db1){return this[_0x2803('0x21')](_0x2803('0x27'),JSON[_0x2803('0x23')](_0x563db1));}},'token':{'type':Sequelize[_0x2803('0x2')],'defaultValue':function(){return rs[_0x2803('0x28')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2803('0x2')]},'forwardOffline':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2803('0x2')]},'waitingTitle':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x29')},'waitingMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x2a')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x2803('0x2b')},'offlineMessageBody':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x2c')},'enableUnmanagedNote':{'type':Sequelize[_0x2803('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2803('0xf')],'defaultValue':function(){return _0x2803('0x2d');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2803('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2803('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x2803('0x2f')},'verticalAlignment':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x2803('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2803('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2803('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2803('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x31')},'systemAvatar':{'type':Sequelize[_0x2803('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2803('0x7')],'comment':_0x2803('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![],'comment':_0x2803('0x33'),'set':function(_0x239011){if(!_0x239011)this[_0x2803('0x21')](_0x2803('0x34'),null);this[_0x2803('0x21')](_0x2803('0x35'),_0x239011);}},'vidaooEscalation':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2803('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'defaultValue':_0x2803('0x36')},'vidaooNote':{'type':Sequelize[_0x2803('0x2')],'defaultValue':function(){return _0x2803('0x37');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2803('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 9efb1e6..ce07d77 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 _0x0e85=['externalUrl','ChatInteraction','ContactId','interaction','contact','firstName','messageId','created','push','close','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','Start','startRouting','EventManager','notify','files','ValidationError','no\x20available\x20attributes','difference','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','originalname','mimetype','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','findOne','Contact','User','Owner','fullname','Tags','color','tag','getSnippet','getProactiveActions','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','origin','http://localhost:9000','testWebsiteWithWildcard','remote','connection','remoteAddress','virtual','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','socket.io-emitter','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','model','device','vendor','type','index','Pause','ChatWebsite','rawAttributes','fieldName','key','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','rows','show','params','include','create','address','forEach','testWildcardValidity','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','mandatoryDispositionPause','describe','ChatWebsiteId','getDispositions','order','includeAll','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','timezone','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','DESC','ChatApplication','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','priority','account','list','List','Contacts','headers','threadId','closed','Writing\x20on\x20closed\x20interaction'];(function(_0x2d861c,_0x47be4d){var _0x47c2c4=function(_0x310185){while(--_0x310185){_0x2d861c['push'](_0x2d861c['shift']());}};_0x47c2c4(++_0x47be4d);}(_0x0e85,0x7c));var _0x50e8=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x0e85[_0x4dc7b9];return _0x3ab114;};'use strict';var Mustache=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var ejs=require(_0x50e8('0x2'));var fs=require('fs');var fs_extra=require(_0x50e8('0x3'));var _=require('lodash');var querystring=require('querystring');var htmlToText=require('html-to-text');var Redis=require(_0x50e8('0x4'));var jayson=require('jayson/promise');var qs=require(_0x50e8('0x5'));var logger=require(_0x50e8('0x6'))(_0x50e8('0x7'));var config=require(_0x50e8('0x8'));var APIBadRequestError=require('../../errors/api')[_0x50e8('0x9')];var APINotFoundError=require(_0x50e8('0xa'))[_0x50e8('0xb')];var APIOutOfIntervalError=require(_0x50e8('0xa'))[_0x50e8('0xc')];var APIHandleError=require(_0x50e8('0xa'))['handleError'];var APIConflictError=require(_0x50e8('0xa'))[_0x50e8('0xd')];var wildcardUtils=require(_0x50e8('0xe'));var URL=require(_0x50e8('0xf'))[_0x50e8('0x10')];var db=require(_0x50e8('0x11'))['db'];config[_0x50e8('0x12')]=_[_0x50e8('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x50e8('0x14'))(new Redis(config[_0x50e8('0x12')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x50e8('0x15')][_0x50e8('0x16')]({'port':0x232c});var client9002=jayson[_0x50e8('0x15')][_0x50e8('0x16')]({'port':0x232a});var client9003=jayson['client'][_0x50e8('0x16')]({'port':0x232b});var client9001=jayson[_0x50e8('0x15')][_0x50e8('0x16')]({'port':0x2329});function respondWithRpcPromise(_0x5c3baa,_0x5524a3,_0x30a872,_0xf02b48){return new Promise(function(_0x40c184,_0x291fb7){var _0x211731=_0xf02b48||client;return _0x211731[_0x50e8('0x17')](_0x5c3baa,_0x30a872)['then'](function(_0x5a5ef2){logger[_0x50e8('0x18')](_0x50e8('0x19'),_0x5524a3,_0x50e8('0x1a'));logger[_0x50e8('0x1b')](_0x50e8('0x1c'),_0x5524a3,_0x50e8('0x1a'),JSON[_0x50e8('0x1d')](_0x5a5ef2));if(_0x5a5ef2['error']){if(_0x5a5ef2[_0x50e8('0x1e')]['code']===0x1f4){logger[_0x50e8('0x1e')](_0x50e8('0x19'),_0x5524a3,_0x5a5ef2[_0x50e8('0x1e')][_0x50e8('0x1f')]);return _0x291fb7(_0x5a5ef2[_0x50e8('0x1e')]['message']);}logger[_0x50e8('0x1e')](_0x50e8('0x19'),_0x5524a3,_0x5a5ef2['error'][_0x50e8('0x1f')]);return _0x40c184(_0x5a5ef2[_0x50e8('0x1e')]['message']);}else{logger[_0x50e8('0x18')](_0x50e8('0x19'),_0x5524a3,'request\x20sent');_0x40c184(_0x5a5ef2['result']['message']);}})[_0x50e8('0x20')](function(_0x160372){logger[_0x50e8('0x1e')](_0x50e8('0x19'),_0x5524a3,_0x160372);_0x291fb7(_0x160372);});});}function respondWithStatusCode(_0xc2f832,_0x13b6e9){_0x13b6e9=_0x13b6e9||0xcc;return function(_0x53d848){if(_0x53d848){return _0xc2f832[_0x50e8('0x21')](_0x13b6e9);}return _0xc2f832[_0x50e8('0x22')](_0x13b6e9)['end']();};}function respondWithResult(_0x177201,_0x2bc8d8){_0x2bc8d8=_0x2bc8d8||0xc8;return function(_0x3a14ca){if(_0x3a14ca){return _0x177201[_0x50e8('0x22')](_0x2bc8d8)['json'](_0x3a14ca);}};}function respondWithFilteredResult(_0x1f5a6c,_0x5b0723){return function(_0x30fedf){if(_0x30fedf){var _0x39c0c6=typeof _0x5b0723[_0x50e8('0x23')]==='undefined'&&typeof _0x5b0723[_0x50e8('0x24')]===_0x50e8('0x25');var _0x1bed48=_0x30fedf[_0x50e8('0x26')];var _0x1d77d0=_0x39c0c6?0x0:_0x5b0723[_0x50e8('0x23')];var _0x2c6fb3=_0x39c0c6?_0x30fedf['count']:_0x5b0723[_0x50e8('0x23')]+_0x5b0723[_0x50e8('0x24')];var _0x535c24;if(_0x2c6fb3>=_0x1bed48){_0x2c6fb3=_0x1bed48;_0x535c24=0xc8;}else{_0x535c24=0xce;}_0x1f5a6c['status'](_0x535c24);return _0x1f5a6c[_0x50e8('0x27')](_0x50e8('0x28'),_0x1d77d0+'-'+_0x2c6fb3+'/'+_0x1bed48)[_0x50e8('0x29')](_0x30fedf);}return null;};}function saveUpdates(_0x47ace2){return function(_0x594187){if(_0x594187){return _0x594187[_0x50e8('0x2a')](_0x47ace2)[_0x50e8('0x2b')](function(_0x5c2e04){return _0x5c2e04;});}return null;};}function removeEntity(_0x26b974){return function(_0x17c6a5){if(_0x17c6a5){return _0x17c6a5[_0x50e8('0x2c')]()[_0x50e8('0x2b')](function(){var _0x5d279c=_0x17c6a5[_0x50e8('0x2d')]({'plain':!![]});var _0x4ec6ad=_0x50e8('0x2e');return db[_0x50e8('0x2f')][_0x50e8('0x2c')]({'where':{'type':_0x4ec6ad,'resourceId':_0x5d279c['id']}})['then'](function(){return _0x17c6a5;});})[_0x50e8('0x2b')](function(){_0x26b974[_0x50e8('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x245b45){return function(_0x1c2fdb){if(!_0x1c2fdb){_0x245b45[_0x50e8('0x21')](0x194);}return _0x1c2fdb;};}function handleError(_0x1a7ba4,_0x5b827f){_0x5b827f=_0x5b827f||0x1f4;return function(_0x1c513c){logger[_0x50e8('0x1e')](_0x1c513c[_0x50e8('0x30')]);if(_0x1c513c[_0x50e8('0x31')]){delete _0x1c513c['name'];}_0x1a7ba4[_0x50e8('0x22')](_0x5b827f)[_0x50e8('0x32')](_0x1c513c);};}function createInteractionObject(_0x3f01ee,_0x4d3454,_0x58ec1c,_0x5dff99){var _0xd39553=require(_0x50e8('0x33'));var _0x2cbee3=new _0xd39553();var _0x2d17b0=_0x2cbee3[_0x50e8('0x34')](_0x58ec1c[_0x50e8('0x35')])[_0x50e8('0x36')]();var _0x40b57c=_0x4d3454[_0x50e8('0x37')];if(_0x58ec1c[_0x50e8('0x38')]){_0x40b57c=_0x58ec1c['cf-connecting-ip'];}else if(_0x58ec1c[_0x50e8('0x39')]){_0x40b57c=_[_0x50e8('0x3a')](_0x58ec1c[_0x50e8('0x39')][_0x50e8('0x3b')](','));}return{'ContactId':_0x5dff99['id'],'ChatWebsiteId':_0x3f01ee,'from':(_0x5dff99['firstName']||'')+'\x20'+(_0x5dff99[_0x50e8('0x3c')]||''),'customerIp':_0x40b57c,'customerPort':_0x58ec1c[_0x50e8('0x3d')]?_0x58ec1c[_0x50e8('0x3d')]:null,'referer':_0x4d3454[_0x50e8('0x3e')],'browserName':_0x2d17b0[_0x50e8('0x3f')]['name']&&_0x2d17b0['browser'][_0x50e8('0x40')]?util[_0x50e8('0x41')]('%s\x20%s',_0x2d17b0[_0x50e8('0x3f')][_0x50e8('0x31')],_0x2d17b0[_0x50e8('0x3f')][_0x50e8('0x40')]):_0x50e8('0x42'),'browserVersion':_0x2d17b0[_0x50e8('0x3f')][_0x50e8('0x40')]||_0x50e8('0x42'),'osName':util['format'](_0x50e8('0x43'),_0x2d17b0['os'][_0x50e8('0x31')],_0x2d17b0['os'][_0x50e8('0x40')]),'osVersion':_0x2d17b0['os'][_0x50e8('0x40')],'deviceModel':_0x2d17b0['device'][_0x50e8('0x44')]&&_0x2d17b0[_0x50e8('0x45')][_0x50e8('0x46')]?util[_0x50e8('0x41')]('%s\x20%s\x20%s',_0x2d17b0[_0x50e8('0x45')]['model'],_0x2d17b0['device']['vendor'],_0x2d17b0[_0x50e8('0x45')][_0x50e8('0x47')]):null,'deviceVendor':_0x2d17b0['device'][_0x50e8('0x46')],'deviceType':_0x2d17b0[_0x50e8('0x45')][_0x50e8('0x47')],'formData':JSON[_0x50e8('0x1d')](_0x4d3454)};}exports[_0x50e8('0x48')]=function(_0x22527f,_0x51d239){var _0x16fdf6={'include':[{'model':db[_0x50e8('0x49')],'as':'mandatoryDispositionPause'}]},_0x596f62={},_0x1cc4fe={'count':0x0,'rows':[]};var _0xcac7c2=_['map'](db[_0x50e8('0x4a')][_0x50e8('0x4b')],function(_0x2e55ed){return{'name':_0x2e55ed[_0x50e8('0x4c')],'type':_0x2e55ed[_0x50e8('0x47')][_0x50e8('0x4d')]};});_0x596f62[_0x50e8('0x44')]=_[_0x50e8('0x4e')](_0xcac7c2,_0x50e8('0x31'));_0x596f62[_0x50e8('0x4f')]=_[_0x50e8('0x50')](_0x22527f['query']);_0x596f62[_0x50e8('0x51')]=_[_0x50e8('0x52')](_0x596f62['model'],_0x596f62[_0x50e8('0x4f')]);_0x16fdf6['attributes']=_[_0x50e8('0x52')](_0x596f62['model'],qs[_0x50e8('0x53')](_0x22527f[_0x50e8('0x4f')][_0x50e8('0x53')]));_0x16fdf6[_0x50e8('0x54')]=_0x16fdf6[_0x50e8('0x54')][_0x50e8('0x55')]?_0x16fdf6[_0x50e8('0x54')]:_0x596f62['model'];if(!_0x22527f[_0x50e8('0x4f')][_0x50e8('0x56')](_0x50e8('0x57'))){_0x16fdf6[_0x50e8('0x24')]=qs[_0x50e8('0x24')](_0x22527f[_0x50e8('0x4f')]['limit']);_0x16fdf6[_0x50e8('0x23')]=qs[_0x50e8('0x23')](_0x22527f[_0x50e8('0x4f')][_0x50e8('0x23')]);}_0x16fdf6['order']=qs[_0x50e8('0x58')](_0x22527f[_0x50e8('0x4f')][_0x50e8('0x58')]);_0x16fdf6[_0x50e8('0x59')]=qs[_0x50e8('0x51')](_[_0x50e8('0x5a')](_0x22527f[_0x50e8('0x4f')],_0x596f62['filters']),_0xcac7c2);if(_0x22527f['query']['filter']){_0x16fdf6[_0x50e8('0x59')]=_[_0x50e8('0x5b')](_0x16fdf6[_0x50e8('0x59')],{'$or':_[_0x50e8('0x4e')](_0xcac7c2,function(_0xa33e6e){if(_0xa33e6e[_0x50e8('0x47')]!=='VIRTUAL'){var _0x2f2154={};_0x2f2154[_0xa33e6e[_0x50e8('0x31')]]={'$like':'%'+_0x22527f[_0x50e8('0x4f')][_0x50e8('0x5c')]+'%'};return _0x2f2154;}})});}_0x16fdf6=_['merge']({},_0x16fdf6,_0x22527f[_0x50e8('0x5d')]);var _0xf773fd={'where':_0x16fdf6[_0x50e8('0x59')]};return db[_0x50e8('0x4a')][_0x50e8('0x26')](_0xf773fd)[_0x50e8('0x2b')](function(_0x57a73a){_0x1cc4fe[_0x50e8('0x26')]=_0x57a73a;if(_0x22527f['query']['includeAll']){_0x16fdf6['include']=[{'all':!![]}];}return db[_0x50e8('0x4a')]['findAll'](_0x16fdf6);})[_0x50e8('0x2b')](function(_0x2d4759){_0x1cc4fe[_0x50e8('0x5e')]=_0x2d4759;return _0x1cc4fe;})[_0x50e8('0x2b')](respondWithFilteredResult(_0x51d239,_0x16fdf6))[_0x50e8('0x20')](handleError(_0x51d239,null));};exports[_0x50e8('0x5f')]=function(_0x229445,_0x59cdf2){var _0x26ab46={'raw':![],'where':{'id':_0x229445[_0x50e8('0x60')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x42f1ed={};_0x42f1ed['model']=_[_0x50e8('0x50')](db[_0x50e8('0x4a')][_0x50e8('0x4b')]);_0x42f1ed[_0x50e8('0x4f')]=_[_0x50e8('0x50')](_0x229445[_0x50e8('0x4f')]);_0x42f1ed['filters']=_[_0x50e8('0x52')](_0x42f1ed['model'],_0x42f1ed[_0x50e8('0x4f')]);_0x26ab46[_0x50e8('0x54')]=_['intersection'](_0x42f1ed['model'],qs['fields'](_0x229445[_0x50e8('0x4f')][_0x50e8('0x53')]));_0x26ab46['attributes']=_0x26ab46[_0x50e8('0x54')][_0x50e8('0x55')]?_0x26ab46[_0x50e8('0x54')]:_0x42f1ed[_0x50e8('0x44')];if(_0x229445[_0x50e8('0x4f')]['includeAll']){_0x26ab46[_0x50e8('0x61')]=[{'all':!![]}];}_0x26ab46=_[_0x50e8('0x5b')]({},_0x26ab46,_0x229445[_0x50e8('0x5d')]);return db['ChatWebsite']['find'](_0x26ab46)[_0x50e8('0x2b')](handleEntityNotFound(_0x59cdf2,null))[_0x50e8('0x2b')](respondWithResult(_0x59cdf2,null))[_0x50e8('0x20')](handleError(_0x59cdf2,null));};exports[_0x50e8('0x62')]=function(_0x2b59f5,_0x257f9e){var _0x58714c=null;_0x2b59f5['body'][_0x50e8('0x63')]['split'](',')[_0x50e8('0x64')](_0x36a288=>{if(_0x36a288['trim']()!==''&&!wildcardUtils[_0x50e8('0x65')](_0x36a288['trim']())){_0x58714c=new APIBadRequestError('\x22'+_0x36a288['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x58714c){return handleError(_0x257f9e,null)(_0x58714c);}return db[_0x50e8('0x4a')][_0x50e8('0x62')](_0x2b59f5[_0x50e8('0x66')],{})[_0x50e8('0x2b')](function(_0x590a33){var _0x480362=_0x2b59f5[_0x50e8('0x67')][_0x50e8('0x2d')]({'plain':!![]});if(!_0x480362)throw new Error(_0x50e8('0x68'));if(_0x480362[_0x50e8('0x69')]===_0x50e8('0x67')){var _0x3fea05=_0x590a33[_0x50e8('0x2d')]({'plain':!![]});var _0x29c80a=_0x50e8('0x2e');return db[_0x50e8('0x6a')][_0x50e8('0x6b')]({'where':{'name':_0x29c80a,'userProfileId':_0x480362[_0x50e8('0x6c')]},'raw':!![]})[_0x50e8('0x2b')](function(_0x3f7935){if(_0x3f7935&&_0x3f7935[_0x50e8('0x6d')]===0x0){return db[_0x50e8('0x2f')][_0x50e8('0x62')]({'name':_0x3fea05[_0x50e8('0x31')],'resourceId':_0x3fea05['id'],'type':_0x3f7935['name'],'sectionId':_0x3f7935['id']},{})[_0x50e8('0x2b')](function(){return _0x590a33;});}else{return _0x590a33;}})[_0x50e8('0x20')](function(_0xd9e82e){logger[_0x50e8('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd9e82e);throw _0xd9e82e;});}return _0x590a33;})[_0x50e8('0x2b')](respondWithResult(_0x257f9e,0xc9))[_0x50e8('0x20')](handleError(_0x257f9e,null));};exports[_0x50e8('0x2a')]=function(_0x161a07,_0x76d18a){var _0x9319f0=null;_0x161a07['body'][_0x50e8('0x63')][_0x50e8('0x3b')](',')[_0x50e8('0x64')](_0x13667e=>{if(_0x13667e['trim']()!==''&&!wildcardUtils[_0x50e8('0x65')](_0x13667e['trim']())){_0x9319f0=new APIBadRequestError('\x22'+_0x13667e[_0x50e8('0x6e')]()+_0x50e8('0x6f'));}});if(_0x9319f0){return handleError(_0x76d18a,null)(_0x9319f0);}if(_0x161a07[_0x50e8('0x66')]['id']){delete _0x161a07[_0x50e8('0x66')]['id'];}return db[_0x50e8('0x4a')]['find']({'where':{'id':_0x161a07[_0x50e8('0x60')]['id']},'include':[{'model':db[_0x50e8('0x49')],'as':_0x50e8('0x70')}]})[_0x50e8('0x2b')](handleEntityNotFound(_0x76d18a,null))[_0x50e8('0x2b')](saveUpdates(_0x161a07[_0x50e8('0x66')],null))['then'](respondWithResult(_0x76d18a,null))[_0x50e8('0x20')](handleError(_0x76d18a,null));};exports[_0x50e8('0x2c')]=function(_0x4fc73d,_0x2d35ab){return db[_0x50e8('0x4a')]['find']({'where':{'id':_0x4fc73d[_0x50e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x2d35ab,null))[_0x50e8('0x2b')](removeEntity(_0x2d35ab,null))[_0x50e8('0x20')](handleError(_0x2d35ab,null));};exports['describe']=function(_0x1cc4c3,_0x1733f5){return db[_0x50e8('0x4a')][_0x50e8('0x71')]()['then'](respondWithResult(_0x1733f5,null))[_0x50e8('0x20')](handleError(_0x1733f5,null));};exports['addDisposition']=function(_0x1691f4,_0x3b6d54){if(_0x1691f4['body']['id']){delete _0x1691f4[_0x50e8('0x66')]['id'];}return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'where':{'id':_0x1691f4[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x3b6d54,null))[_0x50e8('0x2b')](function(_0x2c85a6){if(_0x2c85a6){_0x1691f4[_0x50e8('0x66')][_0x50e8('0x72')]=_0x2c85a6['id'];return db['Disposition'][_0x50e8('0x62')](_0x1691f4[_0x50e8('0x66')]);}})[_0x50e8('0x2b')](respondWithResult(_0x3b6d54,null))['catch'](handleError(_0x3b6d54,null));};exports[_0x50e8('0x73')]=function(_0x1bf6ae,_0x1812b7){var _0x530681={'raw':![],'where':{}};var _0x56d8f1={};var _0x37839e={'count':0x0,'rows':[]};return db[_0x50e8('0x4a')]['findOne']({'where':{'id':_0x1bf6ae[_0x50e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x1812b7,null))[_0x50e8('0x2b')](function(_0x21bff2){if(_0x21bff2){_0x56d8f1[_0x50e8('0x44')]=_[_0x50e8('0x50')](db['Disposition'][_0x50e8('0x4b')]);_0x56d8f1['query']=_[_0x50e8('0x50')](_0x1bf6ae['query']);_0x56d8f1['filters']=_[_0x50e8('0x52')](_0x56d8f1[_0x50e8('0x44')],_0x56d8f1['query']);_0x530681[_0x50e8('0x54')]=_['intersection'](_0x56d8f1[_0x50e8('0x44')],qs['fields'](_0x1bf6ae['query'][_0x50e8('0x53')]));_0x530681[_0x50e8('0x54')]=_0x530681[_0x50e8('0x54')][_0x50e8('0x55')]?_0x530681['attributes']:_0x56d8f1[_0x50e8('0x44')];if(!_0x1bf6ae['query']['hasOwnProperty'](_0x50e8('0x57'))){_0x530681[_0x50e8('0x24')]=qs[_0x50e8('0x24')](_0x1bf6ae['query']['limit']);_0x530681['offset']=qs[_0x50e8('0x23')](_0x1bf6ae[_0x50e8('0x4f')][_0x50e8('0x23')]);}_0x530681[_0x50e8('0x74')]=qs[_0x50e8('0x58')](_0x1bf6ae[_0x50e8('0x4f')]['sort']);_0x530681['where']=qs[_0x50e8('0x51')](_[_0x50e8('0x5a')](_0x1bf6ae[_0x50e8('0x4f')],_0x56d8f1[_0x50e8('0x51')]));_0x530681[_0x50e8('0x59')]['ChatWebsiteId']=_0x21bff2['id'];if(_0x1bf6ae[_0x50e8('0x4f')][_0x50e8('0x5c')]){_0x530681[_0x50e8('0x59')]=_['merge'](_0x530681['where'],{'$or':_[_0x50e8('0x4e')](_0x530681[_0x50e8('0x54')],function(_0x474dc){var _0x53d8c7={};_0x53d8c7[_0x474dc]={'$like':'%'+_0x1bf6ae[_0x50e8('0x4f')][_0x50e8('0x5c')]+'%'};return _0x53d8c7;})});}_0x530681=_['merge']({},_0x530681,_0x1bf6ae[_0x50e8('0x5d')]);return db['Disposition'][_0x50e8('0x26')]({'where':_0x530681[_0x50e8('0x59')]})[_0x50e8('0x2b')](function(_0x34be73){_0x37839e[_0x50e8('0x26')]=_0x34be73;if(_0x1bf6ae[_0x50e8('0x4f')][_0x50e8('0x75')]){_0x530681[_0x50e8('0x61')]=[{'all':!![]}];}return db[_0x50e8('0x76')]['findAll'](_0x530681);})[_0x50e8('0x2b')](function(_0x4e431e){_0x37839e[_0x50e8('0x5e')]=_0x4e431e;return _0x37839e;});}})[_0x50e8('0x2b')](respondWithFilteredResult(_0x1812b7,_0x530681))[_0x50e8('0x20')](handleError(_0x1812b7,null));};exports[_0x50e8('0x77')]=function(_0x556af1,_0x3cb2f2){return db['ChatWebsite'][_0x50e8('0x6b')]({'where':{'id':_0x556af1[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x3cb2f2,null))[_0x50e8('0x2b')](function(_0x443638){if(_0x443638){return _0x443638[_0x50e8('0x77')](_0x556af1[_0x50e8('0x4f')]['ids']);}})[_0x50e8('0x2b')](respondWithStatusCode(_0x3cb2f2,null))[_0x50e8('0x20')](handleError(_0x3cb2f2,null));};exports[_0x50e8('0x78')]=function(_0xc55fb5,_0x28ce03){if(_0xc55fb5[_0x50e8('0x66')]['id']){delete _0xc55fb5[_0x50e8('0x66')]['id'];}return db[_0x50e8('0x4a')]['find']({'where':{'id':_0xc55fb5['params']['id']}})['then'](handleEntityNotFound(_0x28ce03,null))[_0x50e8('0x2b')](function(_0x4d055e){if(_0x4d055e){_0xc55fb5[_0x50e8('0x66')][_0x50e8('0x72')]=_0x4d055e['id'];return db[_0x50e8('0x79')][_0x50e8('0x62')](_0xc55fb5[_0x50e8('0x66')]);}})[_0x50e8('0x2b')](respondWithResult(_0x28ce03,null))[_0x50e8('0x20')](handleError(_0x28ce03,null));};exports[_0x50e8('0x7a')]=function(_0x351ece,_0xbe9538){var _0xfe25fb={'raw':![],'where':{}};var _0x5a1afd={};var _0x528fdf={'count':0x0,'rows':[]};return db[_0x50e8('0x4a')]['findOne']({'where':{'id':_0x351ece[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0xbe9538,null))[_0x50e8('0x2b')](function(_0x228f7e){if(_0x228f7e){_0x5a1afd['model']=_[_0x50e8('0x50')](db[_0x50e8('0x79')]['rawAttributes']);_0x5a1afd[_0x50e8('0x4f')]=_['keys'](_0x351ece[_0x50e8('0x4f')]);_0x5a1afd[_0x50e8('0x51')]=_[_0x50e8('0x52')](_0x5a1afd[_0x50e8('0x44')],_0x5a1afd[_0x50e8('0x4f')]);_0xfe25fb[_0x50e8('0x54')]=_[_0x50e8('0x52')](_0x5a1afd[_0x50e8('0x44')],qs[_0x50e8('0x53')](_0x351ece['query'][_0x50e8('0x53')]));_0xfe25fb[_0x50e8('0x54')]=_0xfe25fb[_0x50e8('0x54')]['length']?_0xfe25fb[_0x50e8('0x54')]:_0x5a1afd[_0x50e8('0x44')];if(!_0x351ece[_0x50e8('0x4f')][_0x50e8('0x56')]('nolimit')){_0xfe25fb['limit']=qs[_0x50e8('0x24')](_0x351ece[_0x50e8('0x4f')][_0x50e8('0x24')]);_0xfe25fb[_0x50e8('0x23')]=qs[_0x50e8('0x23')](_0x351ece['query'][_0x50e8('0x23')]);}_0xfe25fb[_0x50e8('0x74')]=qs['sort'](_0x351ece['query'][_0x50e8('0x58')]);_0xfe25fb[_0x50e8('0x59')]=qs['filters'](_[_0x50e8('0x5a')](_0x351ece['query'],_0x5a1afd[_0x50e8('0x51')]));_0xfe25fb[_0x50e8('0x59')][_0x50e8('0x72')]=_0x228f7e['id'];if(_0x351ece[_0x50e8('0x4f')][_0x50e8('0x5c')]){_0xfe25fb[_0x50e8('0x59')]=_['merge'](_0xfe25fb['where'],{'$or':_[_0x50e8('0x4e')](_0xfe25fb[_0x50e8('0x54')],function(_0x5d0198){var _0x52ef2c={};_0x52ef2c[_0x5d0198]={'$like':'%'+_0x351ece[_0x50e8('0x4f')]['filter']+'%'};return _0x52ef2c;})});}_0xfe25fb=_[_0x50e8('0x5b')]({},_0xfe25fb,_0x351ece[_0x50e8('0x5d')]);return db['CannedAnswer'][_0x50e8('0x26')]({'where':_0xfe25fb['where']})[_0x50e8('0x2b')](function(_0x47bdfc){_0x528fdf[_0x50e8('0x26')]=_0x47bdfc;if(_0x351ece['query'][_0x50e8('0x75')]){_0xfe25fb[_0x50e8('0x61')]=[{'all':!![]}];}return db[_0x50e8('0x79')][_0x50e8('0x7b')](_0xfe25fb);})['then'](function(_0xcea0a5){_0x528fdf[_0x50e8('0x5e')]=_0xcea0a5;return _0x528fdf;});}})['then'](respondWithFilteredResult(_0xbe9538,_0xfe25fb))[_0x50e8('0x20')](handleError(_0xbe9538,null));};exports[_0x50e8('0x7c')]=function(_0x3d9855,_0x33d56d){return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'where':{'id':_0x3d9855[_0x50e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x33d56d,null))[_0x50e8('0x2b')](function(_0x431017){if(_0x431017){return _0x431017[_0x50e8('0x7c')](_0x3d9855[_0x50e8('0x4f')][_0x50e8('0x7d')]);}})[_0x50e8('0x2b')](respondWithStatusCode(_0x33d56d,null))[_0x50e8('0x20')](handleError(_0x33d56d,null));};exports[_0x50e8('0x7e')]=function(_0x26ecb5,_0x4bdd8c){_0x26ecb5[_0x50e8('0x66')][_0x50e8('0x7f')]=_0x26ecb5[_0x50e8('0x80')][_0x50e8('0x81')];return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'where':{'id':_0x26ecb5[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x4bdd8c,null))[_0x50e8('0x2b')](saveUpdates(_0x26ecb5['body'],null))[_0x50e8('0x2b')](respondWithResult(_0x4bdd8c,null))['catch'](handleError(_0x4bdd8c,null));};exports['addAvatar']=function(_0x31b00e,_0x4e9801){_0x31b00e[_0x50e8('0x66')][_0x50e8('0x82')]=_0x31b00e['file']['filename'];return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'where':{'id':_0x31b00e[_0x50e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x4e9801,null))[_0x50e8('0x2b')](saveUpdates(_0x31b00e['body'],null))[_0x50e8('0x2b')](respondWithResult(_0x4e9801,null))[_0x50e8('0x20')](handleError(_0x4e9801,null));};exports[_0x50e8('0x83')]=function(_0x1fc0bf,_0x4b0fe3){_0x1fc0bf[_0x50e8('0x66')][_0x50e8('0x84')]=_0x1fc0bf[_0x50e8('0x80')][_0x50e8('0x81')];return db['ChatWebsite'][_0x50e8('0x6b')]({'where':{'id':_0x1fc0bf[_0x50e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x4b0fe3,null))[_0x50e8('0x2b')](saveUpdates(_0x1fc0bf[_0x50e8('0x66')],null))['then'](respondWithResult(_0x4b0fe3,null))['catch'](handleError(_0x4b0fe3,null));};exports['addSystemAvatar']=function(_0x2e5e22,_0x2cf10f){_0x2e5e22[_0x50e8('0x66')]['systemAvatar']=_0x2e5e22[_0x50e8('0x80')][_0x50e8('0x81')];return db['ChatWebsite'][_0x50e8('0x6b')]({'where':{'id':_0x2e5e22[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x2cf10f,null))[_0x50e8('0x2b')](saveUpdates(_0x2e5e22[_0x50e8('0x66')],null))[_0x50e8('0x2b')](respondWithResult(_0x2cf10f,null))['catch'](handleError(_0x2cf10f,null));};exports[_0x50e8('0x85')]=function(_0x592357,_0x344319){var _0x5a4fa8=path[_0x50e8('0x86')](config[_0x50e8('0x87')],'server/files/images/logos/default_logo.svg');var _0x2ef5d9={'where':{'id':_0x592357[_0x50e8('0x60')]['id']},'attributes':['id',_0x50e8('0x7f')],'raw':!![]};var _0x32819a=![];return require(_0x50e8('0x88'))[_0x50e8('0x89')]()[_0x50e8('0x2b')](function(_0x132798){if(_0x132798){_0x32819a=_0x132798[_0x50e8('0x8a')];}})[_0x50e8('0x2b')](function(){return db[_0x50e8('0x4a')][_0x50e8('0x6b')](_0x2ef5d9);})['then'](handleEntityNotFound(_0x344319,null))[_0x50e8('0x2b')](function(_0x9b79ee){if(_0x9b79ee){if(!_[_0x50e8('0x8b')](_0x9b79ee[_0x50e8('0x7f')])){if(fs[_0x50e8('0x8c')](path[_0x50e8('0x86')](config[_0x50e8('0x87')],'server/files/images/logos/',_0x9b79ee[_0x50e8('0x7f')]))&&_0x32819a){_0x5a4fa8=path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x8d'),_0x9b79ee[_0x50e8('0x7f')]);}}return _0x344319[_0x50e8('0x8e')](_0x5a4fa8);}})['catch'](handleError(_0x344319,null));};exports['getAvatar']=function(_0xc8a217,_0x2eded4){var _0x546026=path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x8f'));var _0x5a8ad4={'where':{'id':_0xc8a217[_0x50e8('0x60')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x50e8('0x4a')][_0x50e8('0x6b')](_0x5a8ad4)['then'](handleEntityNotFound(_0x2eded4,null))['then'](function(_0x320a5a){if(_0x320a5a){if(!_[_0x50e8('0x8b')](_0x320a5a[_0x50e8('0x82')])){if(fs['existsSync'](path[_0x50e8('0x86')](config['root'],_0x50e8('0x90'),_0x320a5a[_0x50e8('0x82')]))){_0x546026=path[_0x50e8('0x86')](config[_0x50e8('0x87')],'server/files/images/avatars/',_0x320a5a[_0x50e8('0x82')]);}}return _0x2eded4[_0x50e8('0x8e')](_0x546026);}})[_0x50e8('0x20')](handleError(_0x2eded4,null));};exports[_0x50e8('0x91')]=function(_0x4a4b06,_0xea8c5d){var _0x5be029=path[_0x50e8('0x86')](config['root'],_0x50e8('0x92'));var _0xc3b3ae={'where':{'id':_0x4a4b06[_0x50e8('0x60')]['id']},'attributes':['id',_0x50e8('0x84'),_0x50e8('0x93')],'raw':!![]};return db[_0x50e8('0x4a')]['find'](_0xc3b3ae)[_0x50e8('0x2b')](handleEntityNotFound(_0xea8c5d,null))[_0x50e8('0x2b')](function(_0x3fff9e){if(_0x3fff9e){if(!_[_0x50e8('0x8b')](_0x3fff9e[_0x50e8('0x84')])){if(fs[_0x50e8('0x8c')](path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x90'),_0x3fff9e[_0x50e8('0x84')]))&&_0x3fff9e[_0x50e8('0x93')]){_0x5be029=path['join'](config['root'],_0x50e8('0x90'),_0x3fff9e[_0x50e8('0x84')]);}}return _0xea8c5d[_0x50e8('0x8e')](_0x5be029);}})[_0x50e8('0x20')](handleError(_0xea8c5d,null));};exports['getSystemAvatar']=function(_0x17061d,_0x2b952b){var _0x58c1d5=path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x94'));var _0x152f45={'where':{'id':_0x17061d[_0x50e8('0x60')]['id']},'attributes':['id',_0x50e8('0x95')],'raw':!![]};return db[_0x50e8('0x4a')][_0x50e8('0x6b')](_0x152f45)[_0x50e8('0x2b')](handleEntityNotFound(_0x2b952b,null))[_0x50e8('0x2b')](function(_0x44e3d5){if(_0x44e3d5){if(!_[_0x50e8('0x8b')](_0x44e3d5['systemAvatar'])){if(fs[_0x50e8('0x8c')](path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x90'),_0x44e3d5[_0x50e8('0x95')]))){_0x58c1d5=path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x90'),_0x44e3d5[_0x50e8('0x95')]);}}return _0x2b952b['download'](_0x58c1d5);}})[_0x50e8('0x20')](handleError(_0x2b952b,null));};function checkWebsiteInterval(_0x4ecddb){var _0x5ba641=_0x4ecddb['Interval'];if(!_0x5ba641){return Promise['resolve'](_0x4ecddb);}var _0x3cd6bf=_0x4ecddb[_0x50e8('0x96')]||undefined;return _0x5ba641['ifTime'](_0x3cd6bf)[_0x50e8('0x2b')](function(_0x4596b0){if(!_0x4596b0){throw new APIOutOfIntervalError();}return _0x4ecddb;});}exports['notify']=function(_0x415022,_0x10ae58){var _0x549f58={'body':_0x415022[_0x50e8('0x66')],'channel':'chat'};var _0x1fccd9=[];var _0x358f4c=[];var _0x5d77e4={};var _0x43d6a2=![];if(_0x415022[_0x50e8('0x66')]['id']){delete _0x415022[_0x50e8('0x66')]['id'];}if(_['isNil'](_0x415022[_0x50e8('0x66')]['from'])){throw new APIBadRequestError(_0x50e8('0x97'));}if(_['isNil'](_0x415022['body'][_0x50e8('0x98')])){throw new APIBadRequestError(_0x50e8('0x99'));}if(_[_0x50e8('0x9a')](_0x415022[_0x50e8('0x66')][_0x50e8('0x66')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x1bd2ac=_0x415022[_0x50e8('0x66')][_0x50e8('0x37')]&&_0x415022['body']['referer'];return db[_0x50e8('0x9b')]['describe']()['then'](function(_0x5163e4){if(!_0x5163e4){throw new Error(_0x50e8('0x9c'));}_0x1fccd9=Object[_0x50e8('0x50')](_0x5163e4)['filter'](function(_0x28886c){return![_0x50e8('0x9d'),_0x50e8('0x9e')][_0x50e8('0x9f')](_0x28886c);});_0x358f4c=Object[_0x50e8('0x50')](_0x5163e4)['filter'](function(_0x4587cc){return![_0x50e8('0x9d'),_0x50e8('0x9e'),_0x50e8('0xa0'),_0x50e8('0xa1')]['includes'](_0x4587cc);});if(!_[_0x50e8('0x9f')](_0x358f4c,_0x415022[_0x50e8('0x66')][_0x50e8('0x98')])){throw new APIBadRequestError(_0x50e8('0xa2')+_0x358f4c['join'](',\x20'));}_0x5d77e4[_0x415022[_0x50e8('0x66')][_0x50e8('0x98')]]=_0x415022[_0x50e8('0x66')][_0x50e8('0xa3')];})['then'](function(){return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'where':{'id':_0x415022[_0x50e8('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5d77e4,'limit':0x1,'order':[[_0x50e8('0x9e'),_0x50e8('0xa4')]]}]},{'model':db[_0x50e8('0xa5')],'as':_0x50e8('0xa6')},{'model':db[_0x50e8('0xa7')],'as':_0x50e8('0xa7'),'include':[{'model':db['Interval'],'as':_0x50e8('0xa8'),'attributes':['id',_0x50e8('0xa9')],'raw':!![]}]}]});})[_0x50e8('0x2b')](function(_0x5553b6){if(!_0x5553b6){throw new APINotFoundError(util[_0x50e8('0x41')](_0x50e8('0xaa'),_0x415022[_0x50e8('0x60')]['id']));}if(_0x1bd2ac){return checkWebsiteInterval(_0x5553b6);}return _0x5553b6;})['then'](function(_0x40d700){_0x549f58['account']=_0x40d700;_0x549f58[_0x50e8('0xab')]=_['orderBy'](_0x40d700[_0x50e8('0xa6')],[_0x50e8('0xac')],['asc']);if(_0x549f58[_0x50e8('0xad')][_0x50e8('0xa6')]){delete _0x549f58[_0x50e8('0xad')]['Applications'];}_0x549f58[_0x50e8('0xae')]=_0x40d700[_0x50e8('0xaf')]||{'id':_0x40d700['ListId']};if(_0x549f58[_0x50e8('0xae')]&&_0x549f58[_0x50e8('0xae')][_0x50e8('0xb0')][_0x50e8('0x55')]){return _0x549f58[_0x50e8('0xae')][_0x50e8('0xb0')][0x0];}var _0x30a4ad=_[_0x50e8('0x13')](_0x415022[_0x50e8('0x66')],{'firstName':_0x415022[_0x50e8('0x66')][_0x50e8('0xa3')],'ListId':_0x40d700['ListId']});_0x30a4ad[_0x415022[_0x50e8('0x66')][_0x50e8('0x98')]]=_0x415022[_0x50e8('0x66')][_0x50e8('0xa3')];return db['CmContact'][_0x50e8('0x62')](_0x30a4ad,{'fields':_0x1fccd9,'raw':!![]});})[_0x50e8('0x2b')](function(_0x36ea2c){_0x549f58['contact']=_0x36ea2c;var _0x3f03d1=createInteractionObject(_0x415022[_0x50e8('0x60')]['id'],_0x415022[_0x50e8('0x66')],_0x415022[_0x50e8('0xb1')],_0x36ea2c);var _0xc59473={'ChatWebsiteId':_0x415022[_0x50e8('0x60')]['id']};if(_0x415022['body'][_0x50e8('0xb2')]){_0xc59473[_0x50e8('0xb2')]=_0x415022[_0x50e8('0x66')][_0x50e8('0xb2')];_0xc59473[_0x50e8('0xb3')]=![];return db['ChatInteraction'][_0x50e8('0x6b')]({'where':_0xc59473})[_0x50e8('0x2b')](function(_0x1f4768){var _0x52b77a=_0x415022['body'][_0x50e8('0x37')]&&_0x415022[_0x50e8('0x66')][_0x50e8('0x3e')];if(_0x1f4768){_0x43d6a2=!![];return _0x1f4768;}else if(!_0x52b77a&&_0x1f4768&&_0x1f4768[_0x50e8('0xb3')]){throw new APIConflictError(_0x50e8('0xb4'));}_0x3f03d1[_0x50e8('0xb2')]=_0x415022[_0x50e8('0x66')]['threadId'];_0x3f03d1[_0x50e8('0xb5')]=_0x415022[_0x50e8('0x66')][_0x50e8('0xb5')];return db[_0x50e8('0xb6')]['create'](_0x3f03d1);});}_0xc59473[_0x50e8('0xb7')]=_0x36ea2c['id'];if(_0x415022[_0x50e8('0x66')][_0x50e8('0xb8')]&&_0x415022[_0x50e8('0x66')][_0x50e8('0xb8')]['id']){_0xc59473['id']=_0x415022[_0x50e8('0x66')][_0x50e8('0xb8')]['id'];return db['ChatInteraction'][_0x50e8('0x6b')]({'where':_0xc59473})['then'](function(_0x34eb5d){var _0x1ee3eb=_0x415022[_0x50e8('0x66')][_0x50e8('0x37')]&&_0x415022['body'][_0x50e8('0x3e')];if(!_0x1ee3eb&&_0x34eb5d&&_0x34eb5d[_0x50e8('0xb3')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x34eb5d){_0x43d6a2=!![];return _0x34eb5d;}else{return db[_0x50e8('0xb6')][_0x50e8('0x62')](_0x3f03d1);}});}return db[_0x50e8('0xb6')][_0x50e8('0x62')](_0x3f03d1);})[_0x50e8('0x2b')](function(_0x2ece4a){if(!_0x43d6a2){return _0x2ece4a;}var _0x55dd46={'from':(_0x549f58[_0x50e8('0xb9')][_0x50e8('0xba')]||'')+'\x20'+(_0x549f58[_0x50e8('0xb9')]['lastName']||'')};if(_0x415022['body'][_0x50e8('0xb2')]&&_0x415022[_0x50e8('0x66')][_0x50e8('0xbb')]&&_0x415022[_0x50e8('0x66')]['threadId']!=_0x415022[_0x50e8('0x66')][_0x50e8('0xbb')]){_0x55dd46[_0x50e8('0xb2')]=_0x415022['body'][_0x50e8('0xbb')];}return _0x2ece4a[_0x50e8('0x2a')](_0x55dd46);})[_0x50e8('0x2b')](function(_0x49c22c){_0x549f58[_0x50e8('0xb8')]=_0x49c22c['get']({'plain':!![]});_0x549f58[_0x50e8('0xb8')][_0x50e8('0xbc')]=!_0x43d6a2;if(_0x549f58[_0x50e8('0xb8')][_0x50e8('0xbc')]){if(_0x549f58['account']['autoclose']){_0x549f58[_0x50e8('0xab')][_0x50e8('0xbd')]({'id':0x0,'priority':_0x549f58[_0x50e8('0xab')][_0x50e8('0x55')]+0x1,'app':_0x50e8('0xbe'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x50e8('0xbf')]['create']({'body':_0x415022['body'][_0x50e8('0x66')],'ChatWebsiteId':_0x415022[_0x50e8('0x60')]['id'],'ChatInteractionId':_0x49c22c['id'],'direction':'in','ContactId':_0x549f58[_0x50e8('0xb9')]['id'],'AttachmentId':_0x415022['body'][_0x50e8('0xc0')]});})[_0x50e8('0x2b')](function(_0x17d2a6){_0x549f58[_0x50e8('0x1f')]=_0x17d2a6;if(!_0x549f58[_0x50e8('0xb8')][_0x50e8('0xc1')]){return;}return db['User']['find']({'attributes':['id',_0x50e8('0x31')],'where':{'id':_0x549f58[_0x50e8('0xb8')][_0x50e8('0xc1')]}});})['then'](function(_0x27b09f){if(_0x27b09f){_0x549f58['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x50e8('0xc2'),'appdata':_0x27b09f[_0x50e8('0x31')]+','+(_0x549f58[_0x50e8('0xad')][_0x50e8('0xc3')]||0xa),'interval':_0x50e8('0xc4')});_0x549f58[_0x50e8('0xc5')]=!![];}if(!_0x549f58[_0x50e8('0xb8')][_0x50e8('0xc6')]){return;}return db[_0x50e8('0xc7')]['find']({'attributes':['id',_0x50e8('0x31')],'where':{'id':_0x549f58[_0x50e8('0xb8')][_0x50e8('0xc6')]}});})[_0x50e8('0x2b')](function(_0x4952b4){if(_0x4952b4){_0x549f58[_0x50e8('0xab')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4952b4[_0x50e8('0x31')]+','+(_0x549f58[_0x50e8('0xad')]['waitForTheAssignedQueue']||0x12c),'interval':_0x50e8('0xc4')});}return respondWithRpcPromise(_0x50e8('0xc8'),_0x50e8('0xc9'),_0x549f58);})[_0x50e8('0x2b')](function(_0x4b2166){respondWithRpcPromise(_0x50e8('0xca'),_0x50e8('0xca'),{'event':_0x50e8('0xcb'),'message':_0x4b2166},client9002);return _0x4b2166;})[_0x50e8('0x2b')](respondWithResult(_0x10ae58,null))[_0x50e8('0x20')](APIHandleError(_0x10ae58));};exports['offline']=function(_0x317038,_0x5ed182){var _0xdd5f70,_0x2a6b90,_0x5c1ab2;var _0x13aa64=[];var _0x564d66={};var _0x2176ec=_0x317038[_0x50e8('0xcc')]||[];var _0xb280fb=[];var _0x3152e6;return db[_0x50e8('0x9b')][_0x50e8('0x71')]()[_0x50e8('0x2b')](function(_0x32c703){if(!_0x32c703){throw new db['Sequelize'][(_0x50e8('0xcd'))](_0x50e8('0xce'));}_0x13aa64=_[_0x50e8('0xcf')](_[_0x50e8('0x50')](_0x32c703),['createdAt',_0x50e8('0x9e'),'CompanyId',_0x50e8('0xa1')]);if(_0x317038[_0x50e8('0x66')]['id']){delete _0x317038['body']['id'];}if(_['isNil'](_0x317038[_0x50e8('0x66')][_0x50e8('0xa3')])){throw _0x5ed182[_0x50e8('0x22')](0x1f4)[_0x50e8('0x32')](new db[(_0x50e8('0xd0'))]['ValidationError'](_0x50e8('0xd1')));}if(_[_0x50e8('0x8b')](_0x317038[_0x50e8('0x66')]['body'])||_0x317038['body']['body']===''){throw _0x5ed182[_0x50e8('0x22')](0x1f4)[_0x50e8('0x32')](new db[(_0x50e8('0xd0'))][(_0x50e8('0xcd'))](_0x50e8('0xd2')));}if(_[_0x50e8('0x8b')](_0x317038[_0x50e8('0x66')][_0x50e8('0xd3')])){throw _0x5ed182['status'](0x1f4)[_0x50e8('0x32')](new db['Sequelize'][(_0x50e8('0xcd'))](_0x50e8('0xd4')+_0x13aa64));}if(!_['includes'](_0x13aa64,_0x317038[_0x50e8('0x66')]['mapKeyOffline'])){throw _0x5ed182[_0x50e8('0x22')](0x1f4)['send'](new db[(_0x50e8('0xd0'))]['ValidationError'](_0x50e8('0xd5')+_0x13aa64));}_0x564d66[_0x317038[_0x50e8('0x66')][_0x50e8('0xd3')]]=_0x317038['body']['from'];})[_0x50e8('0x2b')](function(){return db['ChatWebsite'][_0x50e8('0x6b')]({'where':{'id':_0x317038['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x50e8('0xd6')}]});})[_0x50e8('0x2b')](handleEntityNotFound(_0x5ed182,null))['then'](function(_0x2aee57){if(_0x2aee57&&_0x2aee57[_0x50e8('0xaf')]){_0x2a6b90=_0x2aee57;var _0x1b5e5f=_['defaults'](_0x317038[_0x50e8('0x66')],{'firstName':_0x317038[_0x50e8('0x66')][_0x50e8('0xa3')],'phone':_0x317038[_0x50e8('0x66')][_0x50e8('0xa3')],'ListId':_0x2aee57['ListId']});_0x1b5e5f[_0x317038['body'][_0x50e8('0xd3')]]=_0x317038[_0x50e8('0x66')][_0x50e8('0xa3')];return db[_0x50e8('0x9b')][_0x50e8('0xd7')]({'where':_0x564d66,'defaults':_0x1b5e5f});}})[_0x50e8('0xd8')](function(_0x49b47f){if(_0x49b47f){_0x5c1ab2=_0x49b47f;var _0x36c557=fs[_0x50e8('0xd9')](path[_0x50e8('0x86')](config['root'],_0x50e8('0xda')),_0x50e8('0xdb'));var _0x5c5cd8=ejs[_0x50e8('0xdc')](_0x36c557,{'body':_['toPairs'](_0x317038[_0x50e8('0x66')][_0x50e8('0x66')]),'bodyTitle':_0x2a6b90[_0x50e8('0xdd')]});return db[_0x50e8('0xde')][_0x50e8('0x62')]({'body':_0x5c5cd8,'plainBody':htmlToText[_0x50e8('0xdf')](_0x5c5cd8),'ContactId':_0x49b47f['id'],'ChatWebsiteId':_0x2a6b90['id']});}})[_0x50e8('0x2b')](function(_0x3bdb40){_0x3152e6=_0x3bdb40;if(_0x2176ec[_0x50e8('0x55')]){var _0x145f55=_0x2176ec[_0x50e8('0x4e')](function(_0x4df157){return{'name':_0x4df157['originalname'],'basename':_0x4df157[_0x50e8('0x81')],'type':_0x4df157['mimetype'],'ChatOfflineMessageId':_0x3bdb40['id']};});_0xb280fb=_0x145f55['map'](_0x45e5a0=>{var _0x29d9c7={'filename':_0x45e5a0[_0x50e8('0x31')],'path':path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0xe0'),_0x50e8('0xcc'),_0x50e8('0xe1'),_0x50e8('0xe2'),_0x45e5a0[_0x50e8('0xe3')])};return _0x29d9c7;});if(!_0x2a6b90['openNewInteraction']){return db[_0x50e8('0xe4')][_0x50e8('0xe5')](function(_0x2a451d){return db['Attachment'][_0x50e8('0xe6')](_0x145f55,{'transaction':_0x2a451d});});}}})['then'](function(){if(_0x3152e6){_0xdd5f70=_0x3152e6;return db[_0x50e8('0xd6')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x50e8('0xe7')],'as':_0x50e8('0xe8'),'raw':!![],'include':[{'model':db[_0x50e8('0xe9')],'as':_0x50e8('0xe9'),'raw':!![]}]}]});}})[_0x50e8('0x2b')](function(_0x48f4de){if(_0x48f4de&&_0x48f4de[_0x50e8('0xe8')]&&_0x2a6b90[_0x50e8('0xea')]&&_0x2a6b90[_0x50e8('0xeb')]){var _0x5a50fa=_0x48f4de[_0x50e8('0xec')]();return respondWithRpcPromise(_0x50e8('0xed'),_0x50e8('0xee'),{'account':_0x5a50fa,'message':{'from':util[_0x50e8('0x41')](_0x50e8('0xef'),_0x48f4de[_0x50e8('0x31')],_0x48f4de[_0x50e8('0xf0')]||_0x48f4de['Smtp'][_0x50e8('0x67')]),'to':_0x2a6b90[_0x50e8('0xeb')],'subject':_0x2a6b90[_0x50e8('0xf1')],'html':_0xdd5f70[_0x50e8('0x66')],'attachments':_0xb280fb}},client9003)[_0x50e8('0x2b')](function(){return _0xdd5f70;})[_0x50e8('0x20')](function(_0x319b5a){logger[_0x50e8('0x1e')](_0x319b5a);});}})[_0x50e8('0x2b')](function(){if(_0x2a6b90&&_0x2a6b90[_0x50e8('0xf2')]&&_0x2a6b90['MailAccountId']){var _0x56d2e6=[];if(_0x2176ec[_0x50e8('0x55')]){_0x56d2e6=_0x2176ec[_0x50e8('0x4e')](function(_0x110c9f){return{'name':_0x110c9f[_0x50e8('0xf3')],'basename':_0x110c9f[_0x50e8('0x81')],'type':_0x110c9f[_0x50e8('0xf4')],'ChatOfflineMessageId':_0x3152e6['id']};});}var _0x4b9ca2;if(!_[_0x50e8('0x8b')](_0x2a6b90[_0x50e8('0xf5')])){var _0x46a7ed=_[_0x50e8('0x4e')](_0x317038[_0x50e8('0x66')],function(_0x40c9a7){return _0x40c9a7;});var _0x289024=_['toPairsIn'](_0x46a7ed)[0x0];var _0x38b87f=_['mapValues'](_0x289024,function(_0x1abc45){return _0x1abc45;});_0x4b9ca2=_0x38b87f[0x1][_0x2a6b90[_0x50e8('0xf5')]];}var _0x6c75c2={'from':_0x5c1ab2[_0x50e8('0xf0')],'firstName':_0x5c1ab2[_0x50e8('0xba')],'lastName':_0x5c1ab2[_0x50e8('0x3c')],'mapKey':_0x50e8('0xf0'),'message':{'from':_0x5c1ab2[_0x50e8('0xf0')],'to':_0x2a6b90['MailAccount'][_0x50e8('0xf0')],'cc':'','subject':_[_0x50e8('0x8b')](_0x4b9ca2)?_0x2a6b90[_0x50e8('0xf1')]:_0x4b9ca2,'messageId':'','sentAt':new Date(),'attach':_0x56d2e6['length'],'attachments':_0x56d2e6,'originChannel':_0x50e8('0xf6'),'ChatWebsiteId':_0x2a6b90['id'],'ChatOfflineMessageId':_0xdd5f70['id'],'originTo':_0x2a6b90['MailAccount'][_0x50e8('0xf0')]},'body':_0xdd5f70[_0x50e8('0x66')]};var _0x8ca769={'account':{'id':_0x2a6b90[_0x50e8('0xf7')]},'body':_0x6c75c2,'log':_0x50e8('0xf8')};return respondWithRpcPromise(_0x50e8('0xf8'),_0x50e8('0xf9'),_0x8ca769,client9001)[_0x50e8('0x2b')](function(){return _0xdd5f70;})[_0x50e8('0x20')](function(_0x3fe6de){logger['error'](_0x3fe6de);});}return;})['then'](function(){if(_0xdd5f70){return _0xdd5f70;}})[_0x50e8('0x2b')](respondWithResult(_0x5ed182,null))[_0x50e8('0x20')](function(){for(var _0x27ac6b of _0x2176ec){var _0x1a0b3f=path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0xe0'),_0x50e8('0xcc'),'attachments','offline-chat',_0x27ac6b[_0x50e8('0x81')]);fs_extra[_0x50e8('0xfa')](_0x1a0b3f)['catch'](function(_0x48be40){logger[_0x50e8('0x1e')](_0x50e8('0xfb'),_0x1a0b3f,_0x48be40);});}});};exports['addInteraction']=function(_0x305a8d,_0x2c9735){return db[_0x50e8('0xb6')][_0x50e8('0x6b')]({'where':{'id':_0x305a8d['params']['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x2c9735,null))[_0x50e8('0x2b')](function(_0x2cf4c9){if(_0x2cf4c9){return _0x2cf4c9[_0x50e8('0xfc')](_0x305a8d[_0x50e8('0x66')][_0x50e8('0x7d')],_[_0x50e8('0xfd')](_0x305a8d[_0x50e8('0x66')],[_0x50e8('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x2c9735,null))['catch'](handleError(_0x2c9735,null));};exports['getInteractions']=function(_0x356534,_0x163440){var _0x13fcc7={'raw':![],'where':{}};var _0x1acbf1={};var _0x2d018e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x50e8('0xfe')]({'where':{'id':_0x356534[_0x50e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x163440,null))[_0x50e8('0x2b')](function(_0x53bad8){if(_0x53bad8){_0x1acbf1[_0x50e8('0x44')]=_[_0x50e8('0x50')](db[_0x50e8('0xb6')][_0x50e8('0x4b')]);_0x1acbf1[_0x50e8('0x4f')]=_[_0x50e8('0x50')](_0x356534[_0x50e8('0x4f')]);_0x1acbf1[_0x50e8('0x51')]=_['intersection'](_0x1acbf1[_0x50e8('0x44')],_0x1acbf1[_0x50e8('0x4f')]);_0x13fcc7[_0x50e8('0x54')]=_[_0x50e8('0x52')](_0x1acbf1[_0x50e8('0x44')],qs['fields'](_0x356534[_0x50e8('0x4f')][_0x50e8('0x53')]));_0x13fcc7['attributes']=_0x13fcc7[_0x50e8('0x54')][_0x50e8('0x55')]?_0x13fcc7['attributes']:_0x1acbf1['model'];if(!_0x356534[_0x50e8('0x4f')]['hasOwnProperty'](_0x50e8('0x57'))){_0x13fcc7[_0x50e8('0x24')]=qs['limit'](_0x356534[_0x50e8('0x4f')]['limit']);_0x13fcc7[_0x50e8('0x23')]=qs[_0x50e8('0x23')](_0x356534[_0x50e8('0x4f')]['offset']);}_0x13fcc7['order']=qs[_0x50e8('0x58')](_0x356534[_0x50e8('0x4f')]['sort']);_0x13fcc7[_0x50e8('0x59')]=qs[_0x50e8('0x51')](_[_0x50e8('0x5a')](_0x356534[_0x50e8('0x4f')],_0x1acbf1[_0x50e8('0x51')]));_0x13fcc7['where'][_0x50e8('0x72')]=_0x53bad8['id'];if(_0x356534[_0x50e8('0x4f')][_0x50e8('0x5c')]){_0x13fcc7['where']=_[_0x50e8('0x5b')](_0x13fcc7[_0x50e8('0x59')],{'$or':_[_0x50e8('0x4e')](_0x13fcc7[_0x50e8('0x54')],function(_0x578121){var _0xbbe47f={};_0xbbe47f[_0x578121]={'$like':'%'+_0x356534[_0x50e8('0x4f')][_0x50e8('0x5c')]+'%'};return _0xbbe47f;})});}_0x13fcc7=_[_0x50e8('0x5b')]({},_0x13fcc7,_0x356534['options']);return db[_0x50e8('0xb6')][_0x50e8('0x26')]({'where':_0x13fcc7[_0x50e8('0x59')]})[_0x50e8('0x2b')](function(_0x441ad6){_0x2d018e[_0x50e8('0x26')]=_0x441ad6;if(_0x356534[_0x50e8('0x4f')][_0x50e8('0x75')]){_0x13fcc7[_0x50e8('0x61')]=[{'model':db[_0x50e8('0x9b')],'as':_0x50e8('0xff'),'required':![]},{'model':db[_0x50e8('0x100')],'as':_0x50e8('0x101'),'attributes':['name',_0x50e8('0x102'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x50e8('0x103'),'attributes':['id',_0x50e8('0x31'),_0x50e8('0x104')],'where':_0x356534[_0x50e8('0x4f')][_0x50e8('0x105')]?{'id':_0x356534[_0x50e8('0x4f')]['tag']}:undefined,'required':_0x356534['query'][_0x50e8('0x105')]?!![]:![]}];}return db['ChatInteraction'][_0x50e8('0x7b')](_0x13fcc7);})[_0x50e8('0x2b')](function(_0xad321e){_0x2d018e['rows']=_0xad321e;return _0x2d018e;});}})[_0x50e8('0x2b')](respondWithFilteredResult(_0x163440,_0x13fcc7))[_0x50e8('0x20')](handleError(_0x163440,null));};exports[_0x50e8('0x106')]=function(_0x59d284,_0x52999d){var _0x52a70d=0x0;var _0x150977=0x0;var _0xaa3d55=![];var _0x1b048d;var _0x3556fb;return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'where':{'id':_0x59d284['params']['id']},'include':[{'model':db[_0x50e8('0xa7')],'as':_0x50e8('0xa7'),'include':[{'model':db['Interval'],'as':_0x50e8('0xa8'),'attributes':['id',_0x50e8('0xa9')]}]}]})[_0x50e8('0x2b')](handleEntityNotFound(_0x52999d,null))[_0x50e8('0x2b')](function(_0xdd947a){if(_0xdd947a){_0x1b048d=_0xdd947a;return _0xdd947a[_0x50e8('0x107')]({'raw':!![]});}})['then'](function(_0x25bec3){if(_0x1b048d){if(_0x25bec3){_0x3556fb=_0x25bec3;}}return require(_0x50e8('0x88'))[_0x50e8('0x89')]();})[_0x50e8('0x2b')](function(_0x1c3342){if(_0x1c3342){_0x150977=_0x1c3342['virtual'];_0xaa3d55=_0x1c3342[_0x50e8('0x8a')];}})[_0x50e8('0x2b')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x50e8('0x2b')](function(_0x161e16){_0x52a70d=_0x161e16;if(_0x150977&&_0x161e16>_0x150977){return db[_0x50e8('0x108')][_0x50e8('0xfe')]({'where':{'id':0x1}})[_0x50e8('0x2b')](function(_0x3f0648){if(_0x3f0648){_0x3f0648[_0x50e8('0x109')](_0x50e8('0x10a'));}});}})[_0x50e8('0x2b')](function(){var _0x597109=_0x1b048d['Interval'];var _0x3f06d8=_0x1b048d[_0x50e8('0x96')]||undefined;return _0x597109?_0x597109['ifTime'](_0x3f06d8):!![];})[_0x50e8('0x2b')](function(_0x6e869){var _0x2cc727=fs['readFileSync'](path[_0x50e8('0x86')](config[_0x50e8('0x87')],_0x50e8('0x10b')),_0x50e8('0xdb'));var _0x5b9328='3.13.0';var _0x53eb2c=![];var _0x29336e,_0x422bc1;if(_0x59d284[_0x50e8('0xb1')][_0x50e8('0x3e')]){_0x29336e=new URL(_0x59d284[_0x50e8('0xb1')][_0x50e8('0x3e')])['origin'];}else if(_0x59d284[_0x50e8('0xb1')][_0x50e8('0x10c')]){_0x29336e=new URL(_0x59d284[_0x50e8('0xb1')][_0x50e8('0x10c')])[_0x50e8('0x10c')];}else{_0x29336e=_0x50e8('0x10d');}_0x422bc1=typeof _0x1b048d['address']['split'](',')[_0x50e8('0x6b')](function(_0x12a9b5){return wildcardUtils[_0x50e8('0x10e')](_0x12a9b5,_0x29336e);})!==_0x50e8('0x25');var _0x119050={'chatVersion':_0x5b9328,'chatWebsiteAddressOrigin':_0x422bc1?_0x29336e:_0x1b048d[_0x50e8('0x63')],'remote':_0x1b048d[_0x50e8('0x10f')],'query':querystring[_0x50e8('0x1d')](_[_0x50e8('0x5b')](_0x1b048d[_0x50e8('0x2d')]({'plain':!![]}),{'customerIp':_0x59d284['headers'][_0x50e8('0x39')]||_0x59d284['headers']['x-real-ip']||_0x59d284[_0x50e8('0x110')][_0x50e8('0x111')]||_0x59d284['ip'],'referer':_0x59d284[_0x50e8('0xb1')][_0x50e8('0x3e')],'openedInteractions':_0x52a70d,'maxInteractions':_0x150977,'virtual':_0xaa3d55[_0x50e8('0x112')],'online':_0x6e869,'custom':_0xaa3d55,'address':_0x422bc1?_0x29336e:null}))[_0x50e8('0x113')](/'/g,'\x5c\x27')};_0x52999d[_0x50e8('0x32')](ejs[_0x50e8('0xdc')](Mustache[_0x50e8('0xdc')](_0x2cc727,_0x119050),{'proactiveActions':_0x3556fb,'alignment':_0x1b048d[_0x50e8('0x114')],'verticalAlignment':_0x1b048d[_0x50e8('0x115')],'div_color':_0x1b048d['color'],'labelText':_0x1b048d[_0x50e8('0x116')],'text_color':_0x1b048d[_0x50e8('0x117')],'text_button_color':_0x1b048d['textButtonColor'],'button_color':_0x1b048d[_0x50e8('0x118')],'background_color':_0x1b048d[_0x50e8('0x119')],'hideWhenOffline':_0x1b048d[_0x50e8('0x11a')],'intervalId':_0x1b048d[_0x50e8('0x11b')],'isDevelopment':_0x53eb2c,'chatVersion':_0x5b9328}));})[_0x50e8('0x20')](handleError(_0x52999d,null));};exports['addApplications']=function(_0xbd278b,_0x346072){var _0x36889e=_0xbd278b[_0x50e8('0x60')]['id'];var _0x123e78=_0xbd278b[_0x50e8('0x66')];var _0x429fa1=0xc8;var _0x2094cf=null;return db[_0x50e8('0xe4')][_0x50e8('0xe5')]({'isolationLevel':db[_0x50e8('0xe4')][_0x50e8('0x11c')]['ISOLATION_LEVELS'][_0x50e8('0x11d')]},function(_0x1d1cbd){return db[_0x50e8('0x4a')]['findOne']({'where':{'id':_0x36889e},'transaction':_0x1d1cbd})[_0x50e8('0x2b')](function(_0x95929b){if(_0x95929b){return db['ChatApplication'][_0x50e8('0x2c')]({'where':{'ChatWebsiteId':_0x36889e},'transaction':_0x1d1cbd})[_0x50e8('0x2b')](function(){var _0x3d1f34=_[_0x50e8('0x4e')](_0x123e78,function(_0x2782d7){_0x2782d7['ChatWebsiteId']=_0x36889e;return _0x2782d7;});return db[_0x50e8('0xa5')][_0x50e8('0xe6')](_0x3d1f34,{'transaction':_0x1d1cbd});});}else{_0x429fa1=0x194;_0x2094cf=[];}});})[_0x50e8('0x2b')](function(){if(_0x429fa1!==0x194){return db[_0x50e8('0xa5')][_0x50e8('0x11e')]({'where':{'ChatWebsiteId':_0x36889e},'order':'priority'})[_0x50e8('0x2b')](function(_0x1b52c2){_0x2094cf=_0x1b52c2;});}})[_0x50e8('0x20')](function(_0x2d3bf6){_0x429fa1=0x1f4;logger[_0x50e8('0x1e')](_0x2d3bf6[_0x50e8('0x30')]);if(_0x2d3bf6[_0x50e8('0x31')]){delete _0x2d3bf6[_0x50e8('0x31')];}_0x2094cf=_0x2d3bf6;})['finally'](function(){if(_0x2094cf===null){_0x346072[_0x50e8('0x21')](_0x429fa1);}else{if(_0x429fa1===0x1f4){_0x346072['status'](_0x429fa1)[_0x50e8('0x32')](_0x2094cf);}else{_0x346072[_0x50e8('0x22')](_0x429fa1)['json'](_0x2094cf);}}});};exports[_0x50e8('0x11f')]=function(_0x5f25d9,_0x242212){var _0x37cfaa={};var _0x280e4d={};var _0x21106a;var _0x46aa04;return db[_0x50e8('0x4a')][_0x50e8('0xfe')]({'where':{'id':_0x5f25d9['params']['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x242212,null))['then'](function(_0x1c3d12){if(_0x1c3d12){_0x21106a=_0x1c3d12;_0x280e4d['model']=_['keys'](db[_0x50e8('0xa5')]['rawAttributes']);_0x280e4d[_0x50e8('0x4f')]=_[_0x50e8('0x50')](_0x5f25d9[_0x50e8('0x4f')]);_0x280e4d['filters']=_['intersection'](_0x280e4d[_0x50e8('0x44')],_0x280e4d['query']);_0x37cfaa[_0x50e8('0x54')]=_[_0x50e8('0x52')](_0x280e4d[_0x50e8('0x44')],qs['fields'](_0x5f25d9[_0x50e8('0x4f')][_0x50e8('0x53')]));_0x37cfaa[_0x50e8('0x54')]=_0x37cfaa[_0x50e8('0x54')][_0x50e8('0x55')]?_0x37cfaa['attributes']:_0x280e4d['model'];_0x37cfaa['order']=qs[_0x50e8('0x58')](_0x5f25d9[_0x50e8('0x4f')][_0x50e8('0x58')]);_0x37cfaa[_0x50e8('0x59')]=qs[_0x50e8('0x51')](_[_0x50e8('0x5a')](_0x5f25d9['query'],_0x280e4d[_0x50e8('0x51')]));if(_0x5f25d9[_0x50e8('0x4f')]['filter']){_0x37cfaa[_0x50e8('0x59')]=_[_0x50e8('0x5b')](_0x37cfaa['where'],{'$or':_[_0x50e8('0x4e')](_0x37cfaa['attributes'],function(_0x3aefea){var _0x174121={};_0x174121[_0x3aefea]={'$like':'%'+_0x5f25d9[_0x50e8('0x4f')][_0x50e8('0x5c')]+'%'};return _0x174121;})});}_0x37cfaa=_[_0x50e8('0x5b')]({},_0x37cfaa,_0x5f25d9[_0x50e8('0x5d')]);return _0x21106a['getApplications'](_0x37cfaa);}})['then'](function(_0x41c881){if(_0x41c881){_0x46aa04=_0x41c881['length'];if(!_0x5f25d9[_0x50e8('0x4f')][_0x50e8('0x56')](_0x50e8('0x57'))){_0x37cfaa[_0x50e8('0x24')]=qs[_0x50e8('0x24')](_0x5f25d9['query'][_0x50e8('0x24')]);_0x37cfaa[_0x50e8('0x23')]=qs[_0x50e8('0x23')](_0x5f25d9[_0x50e8('0x4f')]['offset']);}return _0x21106a[_0x50e8('0x11f')](_0x37cfaa);}})[_0x50e8('0x2b')](function(_0x4a73e9){if(_0x4a73e9){return _0x4a73e9?{'count':_0x46aa04,'rows':_0x4a73e9}:null;}})[_0x50e8('0x2b')](respondWithResult(_0x242212,null))[_0x50e8('0x20')](handleError(_0x242212,null));};exports[_0x50e8('0x120')]=function(_0x1beccc,_0x3a5324){return db[_0x50e8('0x121')]['find']({'where':{'id':_0x1beccc[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x3a5324,null))['then'](function(_0x525bf8){if(_0x525bf8){return _0x525bf8[_0x50e8('0x120')](_0x1beccc[_0x50e8('0x66')][_0x50e8('0x7d')],_['omit'](_0x1beccc['body'],['ids','id'])||{});}})[_0x50e8('0x2b')](respondWithResult(_0x3a5324,null))['catch'](handleError(_0x3a5324,null));};exports[_0x50e8('0x107')]=function(_0x12ea11,_0x19ca64){var _0x24a442={};var _0x407740={};var _0x3b0fe6;var _0x24108a;return db[_0x50e8('0x4a')]['findOne']({'where':{'id':_0x12ea11[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x19ca64,null))['then'](function(_0x3dadb3){if(_0x3dadb3){_0x3b0fe6=_0x3dadb3;_0x407740[_0x50e8('0x44')]=_[_0x50e8('0x50')](db[_0x50e8('0x122')][_0x50e8('0x4b')]);_0x407740[_0x50e8('0x4f')]=_[_0x50e8('0x50')](_0x12ea11['query']);_0x407740[_0x50e8('0x51')]=_[_0x50e8('0x52')](_0x407740[_0x50e8('0x44')],_0x407740[_0x50e8('0x4f')]);_0x24a442[_0x50e8('0x54')]=_['intersection'](_0x407740['model'],qs[_0x50e8('0x53')](_0x12ea11[_0x50e8('0x4f')]['fields']));_0x24a442[_0x50e8('0x54')]=_0x24a442[_0x50e8('0x54')][_0x50e8('0x55')]?_0x24a442['attributes']:_0x407740[_0x50e8('0x44')];_0x24a442['order']=qs['sort'](_0x12ea11[_0x50e8('0x4f')][_0x50e8('0x58')]);_0x24a442[_0x50e8('0x59')]=qs['filters'](_[_0x50e8('0x5a')](_0x12ea11[_0x50e8('0x4f')],_0x407740[_0x50e8('0x51')]));if(_0x12ea11['query'][_0x50e8('0x5c')]){_0x24a442[_0x50e8('0x59')]=_[_0x50e8('0x5b')](_0x24a442[_0x50e8('0x59')],{'$or':_['map'](_0x24a442[_0x50e8('0x54')],function(_0x48a100){var _0x784fca={};_0x784fca[_0x48a100]={'$like':'%'+_0x12ea11[_0x50e8('0x4f')][_0x50e8('0x5c')]+'%'};return _0x784fca;})});}_0x24a442=_[_0x50e8('0x5b')]({},_0x24a442,_0x12ea11[_0x50e8('0x5d')]);return _0x3b0fe6['getProactiveActions'](_0x24a442);}})[_0x50e8('0x2b')](function(_0x12d822){if(_0x12d822){_0x24108a=_0x12d822['length'];if(!_0x12ea11[_0x50e8('0x4f')][_0x50e8('0x56')]('nolimit')){_0x24a442[_0x50e8('0x24')]=qs['limit'](_0x12ea11['query'][_0x50e8('0x24')]);_0x24a442['offset']=qs[_0x50e8('0x23')](_0x12ea11['query'][_0x50e8('0x23')]);}return _0x3b0fe6['getProactiveActions'](_0x24a442);}})[_0x50e8('0x2b')](function(_0x349895){if(_0x349895){return _0x349895?{'count':_0x24108a,'rows':_0x349895}:null;}})[_0x50e8('0x2b')](respondWithResult(_0x19ca64,null))[_0x50e8('0x20')](handleError(_0x19ca64,null));};exports['getFields']=function(_0x4bd679,_0x19a2d1){var _0x38a275=_0x4bd679['query']['online']==='false'?_0x50e8('0x123'):_0x50e8('0x124');return db[_0x50e8('0x4a')][_0x50e8('0x6b')]({'attributes':['id',_0x38a275],'where':{'id':_0x4bd679[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x19a2d1,null))[_0x50e8('0x2b')](function(_0x47b64b){if(_0x47b64b){var _0x3eda59=_0x47b64b[_0x38a275];var _0x5f1843=_0x3eda59&&_0x3eda59['items']?_0x3eda59[_0x50e8('0x125')]:[];_0x19a2d1[_0x50e8('0x32')]({'fromKey':_['isNil'](_0x3eda59[_0x50e8('0x126')])?undefined:_0x3eda59[_0x50e8('0x126')],'count':_0x5f1843[_0x50e8('0x55')],'rows':_0x5f1843});}})[_0x50e8('0x20')](handleError(_0x19a2d1,null));};exports[_0x50e8('0x127')]=function(_0x4ffc03,_0x56f592){var _0xc2ca3b={'raw':![],'where':{}};var _0x446d27={};var _0x1ae92e={'count':0x0,'rows':[]};return db[_0x50e8('0x4a')]['findOne']({'where':{'id':_0x4ffc03[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x56f592,null))[_0x50e8('0x2b')](function(_0x3400f2){if(_0x3400f2){_0x446d27[_0x50e8('0x44')]=_[_0x50e8('0x50')](db[_0x50e8('0xde')][_0x50e8('0x4b')]);_0x446d27[_0x50e8('0x4f')]=_[_0x50e8('0x50')](_0x4ffc03[_0x50e8('0x4f')]);_0x446d27[_0x50e8('0x51')]=_[_0x50e8('0x52')](_0x446d27[_0x50e8('0x44')],_0x446d27[_0x50e8('0x4f')]);_0xc2ca3b['attributes']=_[_0x50e8('0x52')](_0x446d27[_0x50e8('0x44')],qs[_0x50e8('0x53')](_0x4ffc03['query'][_0x50e8('0x53')]));_0xc2ca3b[_0x50e8('0x54')]=_0xc2ca3b[_0x50e8('0x54')][_0x50e8('0x55')]?_0xc2ca3b[_0x50e8('0x54')]:_0x446d27[_0x50e8('0x44')];if(!_0x4ffc03[_0x50e8('0x4f')][_0x50e8('0x56')](_0x50e8('0x57'))){_0xc2ca3b['limit']=qs[_0x50e8('0x24')](_0x4ffc03['query'][_0x50e8('0x24')]);_0xc2ca3b[_0x50e8('0x23')]=qs[_0x50e8('0x23')](_0x4ffc03[_0x50e8('0x4f')]['offset']);}_0xc2ca3b[_0x50e8('0x74')]=qs[_0x50e8('0x58')](_0x4ffc03[_0x50e8('0x4f')][_0x50e8('0x58')]);_0xc2ca3b['where']=qs[_0x50e8('0x51')](_[_0x50e8('0x5a')](_0x4ffc03['query'],_0x446d27[_0x50e8('0x51')]));_0xc2ca3b[_0x50e8('0x59')][_0x50e8('0x72')]=_0x3400f2['id'];if(_0x4ffc03[_0x50e8('0x4f')][_0x50e8('0x5c')]){_0xc2ca3b[_0x50e8('0x59')]=_[_0x50e8('0x5b')](_0xc2ca3b[_0x50e8('0x59')],{'$or':_[_0x50e8('0x4e')](_0xc2ca3b['attributes'],function(_0x27b2c5){var _0x38ba5d={};_0x38ba5d[_0x27b2c5]={'$like':'%'+_0x4ffc03['query'][_0x50e8('0x5c')]+'%'};return _0x38ba5d;})});}_0xc2ca3b=_[_0x50e8('0x5b')]({},_0xc2ca3b,_0x4ffc03[_0x50e8('0x5d')]);return db[_0x50e8('0xde')][_0x50e8('0x26')]({'where':_0xc2ca3b[_0x50e8('0x59')]})['then'](function(_0x3c6795){_0x1ae92e['count']=_0x3c6795;if(_0x4ffc03[_0x50e8('0x4f')][_0x50e8('0x75')]){_0xc2ca3b['include']=[{'all':!![]}];}else{_0xc2ca3b['include']=[{'model':db[_0x50e8('0x9b')],'as':_0x50e8('0xff'),'required':![]},{'model':db[_0x50e8('0x128')],'as':_0x50e8('0x129'),'required':![]}];}return db[_0x50e8('0xde')][_0x50e8('0x7b')](_0xc2ca3b);})[_0x50e8('0x2b')](function(_0x47769c){_0x1ae92e['rows']=_0x47769c;return _0x1ae92e;});}})[_0x50e8('0x2b')](respondWithFilteredResult(_0x56f592,_0xc2ca3b))[_0x50e8('0x20')](handleError(_0x56f592,null));};exports[_0x50e8('0x12a')]=function(_0x45ca98,_0x3c0c54){return db[_0x50e8('0x4a')]['find']({'where':{'id':_0x45ca98[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x3c0c54,null))[_0x50e8('0x2b')](function(_0x243638){if(_0x243638){return _0x243638['addAgents'](_0x45ca98[_0x50e8('0x66')]['ids'],_[_0x50e8('0xfd')](_0x45ca98['body'],[_0x50e8('0x7d'),'id'])||{})['spread'](function(_0x5eac76){for(var _0x885e6f=0x0;_0x885e6f<_0x45ca98[_0x50e8('0x66')]['ids'][_0x50e8('0x55')];_0x885e6f+=0x1){socket[_0x50e8('0x12b')](_0x50e8('0x12c'),{'UserId':Number(_0x45ca98['body'][_0x50e8('0x7d')][_0x885e6f]),'ChatWebsiteId':Number(_0x45ca98['params']['id'])});}return _0x5eac76;});}})['then'](respondWithResult(_0x3c0c54,null))[_0x50e8('0x20')](handleError(_0x3c0c54,null));};exports[_0x50e8('0x12d')]=function(_0x316ff6,_0x271bc3){return db['ChatWebsite'][_0x50e8('0x6b')]({'where':{'id':_0x316ff6[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x271bc3,null))[_0x50e8('0x2b')](function(_0x2aecb0){if(_0x2aecb0){return _0x2aecb0['removeAgents'](_0x316ff6[_0x50e8('0x4f')][_0x50e8('0x7d')])[_0x50e8('0x2b')](function(){if(_[_0x50e8('0x12e')](_0x316ff6[_0x50e8('0x4f')]['ids'])){for(var _0x2b9df0=0x0;_0x2b9df0<_0x316ff6['query'][_0x50e8('0x7d')][_0x50e8('0x55')];_0x2b9df0+=0x1){socket['emit'](_0x50e8('0x12f'),{'UserId':Number(_0x316ff6['query'][_0x50e8('0x7d')][_0x2b9df0]),'ChatWebsiteId':Number(_0x316ff6[_0x50e8('0x60')]['id'])});}}else{socket[_0x50e8('0x12b')](_0x50e8('0x12f'),{'UserId':Number(_0x316ff6[_0x50e8('0x4f')][_0x50e8('0x7d')]),'ChatWebsiteId':Number(_0x316ff6[_0x50e8('0x60')]['id'])});}});}})[_0x50e8('0x2b')](respondWithStatusCode(_0x271bc3,null))[_0x50e8('0x20')](handleError(_0x271bc3,null));};exports[_0x50e8('0x130')]=function(_0x167951,_0x507df4){var _0xa53e97={};var _0x4f34f2={};var _0x528da7;var _0x456f17;return db[_0x50e8('0x4a')][_0x50e8('0xfe')]({'where':{'id':_0x167951[_0x50e8('0x60')]['id']}})[_0x50e8('0x2b')](handleEntityNotFound(_0x507df4,null))['then'](function(_0x3edbc6){if(_0x3edbc6){_0x528da7=_0x3edbc6;_0x4f34f2[_0x50e8('0x44')]=_['keys'](db[_0x50e8('0x100')][_0x50e8('0x4b')]);_0x4f34f2['query']=_[_0x50e8('0x50')](_0x167951[_0x50e8('0x4f')]);_0x4f34f2[_0x50e8('0x51')]=_[_0x50e8('0x52')](_0x4f34f2[_0x50e8('0x44')],_0x4f34f2[_0x50e8('0x4f')]);_0xa53e97[_0x50e8('0x54')]=_[_0x50e8('0x52')](_0x4f34f2[_0x50e8('0x44')],qs[_0x50e8('0x53')](_0x167951[_0x50e8('0x4f')][_0x50e8('0x53')]));_0xa53e97['attributes']=_0xa53e97[_0x50e8('0x54')][_0x50e8('0x55')]?_0xa53e97[_0x50e8('0x54')]:_0x4f34f2[_0x50e8('0x44')];_0xa53e97[_0x50e8('0x74')]=qs['sort'](_0x167951[_0x50e8('0x4f')]['sort']);_0xa53e97[_0x50e8('0x59')]=qs[_0x50e8('0x51')](_['pick'](_0x167951[_0x50e8('0x4f')],_0x4f34f2[_0x50e8('0x51')]));if(_0x167951[_0x50e8('0x4f')][_0x50e8('0x5c')]){_0xa53e97[_0x50e8('0x59')]=_[_0x50e8('0x5b')](_0xa53e97[_0x50e8('0x59')],{'$or':_[_0x50e8('0x4e')](_0xa53e97[_0x50e8('0x54')],function(_0x8d3f42){var _0x5417cb={};_0x5417cb[_0x8d3f42]={'$like':'%'+_0x167951[_0x50e8('0x4f')][_0x50e8('0x5c')]+'%'};return _0x5417cb;})});}_0xa53e97=_[_0x50e8('0x5b')]({},_0xa53e97,_0x167951['options']);return _0x528da7[_0x50e8('0x130')](_0xa53e97);}})['then'](function(_0x33f480){if(_0x33f480){_0x456f17=_0x33f480['length'];if(!_0x167951[_0x50e8('0x4f')][_0x50e8('0x56')](_0x50e8('0x57'))){_0xa53e97[_0x50e8('0x24')]=qs[_0x50e8('0x24')](_0x167951['query'][_0x50e8('0x24')]);_0xa53e97[_0x50e8('0x23')]=qs[_0x50e8('0x23')](_0x167951[_0x50e8('0x4f')][_0x50e8('0x23')]);}return _0x528da7[_0x50e8('0x130')](_0xa53e97);}})[_0x50e8('0x2b')](function(_0x2cd184){if(_0x2cd184){return _0x2cd184?{'count':_0x456f17,'rows':_0x2cd184}:null;}})['then'](respondWithResult(_0x507df4,null))[_0x50e8('0x20')](handleError(_0x507df4,null));};
\ No newline at end of file
+var _0xb138=['getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','chat','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','notify','offline','Sequelize','no\x20available\x20attributes','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','ValidationError','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','user','MailAccountId','mimetype','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','interval','getProactiveActions','virtual','License','ifTime','readFileSync','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textButtonColor','color_button','READ_COMMITTED','findAndCountAll','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','send','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Pause','find','create','address','split','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar'];(function(_0x64b2e1,_0x4b12fe){var _0x1ca8cd=function(_0x38992b){while(--_0x38992b){_0x64b2e1['push'](_0x64b2e1['shift']());}};_0x1ca8cd(++_0x4b12fe);}(_0xb138,0x1dd));var _0x8b13=function(_0x3df38b,_0x46223e){_0x3df38b=_0x3df38b-0x0;var _0x5e5e22=_0xb138[_0x3df38b];return _0x5e5e22;};'use strict';var Mustache=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var ejs=require(_0x8b13('0x3'));var fs=require('fs');var fs_extra=require(_0x8b13('0x4'));var _=require(_0x8b13('0x5'));var querystring=require(_0x8b13('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x8b13('0x7'));var jayson=require(_0x8b13('0x8'));var qs=require(_0x8b13('0x9'));var logger=require('../../config/logger')(_0x8b13('0xa'));var config=require(_0x8b13('0xb'));var APIBadRequestError=require('../../errors/api')[_0x8b13('0xc')];var APINotFoundError=require(_0x8b13('0xd'))[_0x8b13('0xe')];var APIOutOfIntervalError=require('../../errors/api')[_0x8b13('0xf')];var APIHandleError=require(_0x8b13('0xd'))['handleError'];var APIConflictError=require('../../errors/api')[_0x8b13('0x10')];var wildcardUtils=require(_0x8b13('0x11'));var URL=require(_0x8b13('0x12'))[_0x8b13('0x13')];var db=require(_0x8b13('0x14'))['db'];config['redis']=_[_0x8b13('0x15')](config[_0x8b13('0x16')],{'host':_0x8b13('0x17'),'port':0x18eb});var socket=require(_0x8b13('0x18'))(new Redis(config[_0x8b13('0x16')]));require(_0x8b13('0x19'))['register'](socket);var client=jayson['client'][_0x8b13('0x1a')]({'port':0x232c});var client9002=jayson[_0x8b13('0x1b')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x8b13('0x1b')][_0x8b13('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0xf29086,_0x2c615a,_0x13f956,_0x542357){return new Promise(function(_0x1c6c99,_0xea7881){var _0x393bc1=_0x542357||client;return _0x393bc1[_0x8b13('0x1c')](_0xf29086,_0x13f956)[_0x8b13('0x1d')](function(_0x1fcfe6){logger[_0x8b13('0x1e')](_0x8b13('0x1f'),_0x2c615a,'request\x20sent');logger['debug'](_0x8b13('0x20'),_0x2c615a,_0x8b13('0x21'),JSON[_0x8b13('0x22')](_0x1fcfe6));if(_0x1fcfe6[_0x8b13('0x23')]){if(_0x1fcfe6[_0x8b13('0x23')][_0x8b13('0x24')]===0x1f4){logger['error'](_0x8b13('0x1f'),_0x2c615a,_0x1fcfe6[_0x8b13('0x23')][_0x8b13('0x25')]);return _0xea7881(_0x1fcfe6['error']['message']);}logger[_0x8b13('0x23')](_0x8b13('0x1f'),_0x2c615a,_0x1fcfe6['error'][_0x8b13('0x25')]);return _0x1c6c99(_0x1fcfe6[_0x8b13('0x23')][_0x8b13('0x25')]);}else{logger[_0x8b13('0x1e')](_0x8b13('0x1f'),_0x2c615a,'request\x20sent');_0x1c6c99(_0x1fcfe6[_0x8b13('0x26')][_0x8b13('0x25')]);}})['catch'](function(_0x33422f){logger['error'](_0x8b13('0x1f'),_0x2c615a,_0x33422f);_0xea7881(_0x33422f);});});}function respondWithStatusCode(_0x325d68,_0x54786a){_0x54786a=_0x54786a||0xcc;return function(_0x3f1756){if(_0x3f1756){return _0x325d68[_0x8b13('0x27')](_0x54786a);}return _0x325d68['status'](_0x54786a)[_0x8b13('0x28')]();};}function respondWithResult(_0x14a739,_0x410122){_0x410122=_0x410122||0xc8;return function(_0x4048e4){if(_0x4048e4){return _0x14a739[_0x8b13('0x29')](_0x410122)['json'](_0x4048e4);}};}function respondWithFilteredResult(_0x6023f5,_0x1b09e2){return function(_0x3475d8){if(_0x3475d8){var _0x1511bf=typeof _0x1b09e2[_0x8b13('0x2a')]===_0x8b13('0x2b')&&typeof _0x1b09e2['limit']===_0x8b13('0x2b');var _0xfec033=_0x3475d8[_0x8b13('0x2c')];var _0x9d2377=_0x1511bf?0x0:_0x1b09e2[_0x8b13('0x2a')];var _0x29946e=_0x1511bf?_0x3475d8[_0x8b13('0x2c')]:_0x1b09e2[_0x8b13('0x2a')]+_0x1b09e2[_0x8b13('0x2d')];var _0x5751db;if(_0x29946e>=_0xfec033){_0x29946e=_0xfec033;_0x5751db=0xc8;}else{_0x5751db=0xce;}_0x6023f5[_0x8b13('0x29')](_0x5751db);return _0x6023f5[_0x8b13('0x2e')](_0x8b13('0x2f'),_0x9d2377+'-'+_0x29946e+'/'+_0xfec033)[_0x8b13('0x30')](_0x3475d8);}return null;};}function saveUpdates(_0x51a334){return function(_0x4f7d91){if(_0x4f7d91){return _0x4f7d91[_0x8b13('0x31')](_0x51a334)['then'](function(_0x5663fa){return _0x5663fa;});}return null;};}function removeEntity(_0x3b1dfa){return function(_0x535521){if(_0x535521){return _0x535521[_0x8b13('0x32')]()[_0x8b13('0x1d')](function(){var _0x40fc29=_0x535521[_0x8b13('0x33')]({'plain':!![]});var _0x11657e=_0x8b13('0x34');return db[_0x8b13('0x35')][_0x8b13('0x32')]({'where':{'type':_0x11657e,'resourceId':_0x40fc29['id']}})[_0x8b13('0x1d')](function(){return _0x535521;});})[_0x8b13('0x1d')](function(){_0x3b1dfa['status'](0xcc)[_0x8b13('0x28')]();});}};}function handleEntityNotFound(_0x31f5bd){return function(_0x19b21c){if(!_0x19b21c){_0x31f5bd[_0x8b13('0x27')](0x194);}return _0x19b21c;};}function handleError(_0x1ff25c,_0x24179a){_0x24179a=_0x24179a||0x1f4;return function(_0x6b4645){logger[_0x8b13('0x23')](_0x6b4645['stack']);if(_0x6b4645[_0x8b13('0x36')]){delete _0x6b4645['name'];}_0x1ff25c[_0x8b13('0x29')](_0x24179a)[_0x8b13('0x37')](_0x6b4645);};}function createInteractionObject(_0x2a8f6b,_0x5e63f6,_0x2bf1b0,_0x327eb1){var _0x4ec1a5=require('user-agent-parser');var _0xe6963d=new _0x4ec1a5();var _0x5daee9=_0xe6963d[_0x8b13('0x38')](_0x2bf1b0['user-agent'])[_0x8b13('0x39')]();var _0x3a8e06=_0x5e63f6[_0x8b13('0x3a')];if(_0x2bf1b0[_0x8b13('0x3b')]){_0x3a8e06=_0x2bf1b0[_0x8b13('0x3b')];}else if(_0x2bf1b0['x-forwarded-for']){_0x3a8e06=_['first'](_0x2bf1b0[_0x8b13('0x3c')]['split'](','));}return{'ContactId':_0x327eb1['id'],'ChatWebsiteId':_0x2a8f6b,'from':(_0x327eb1[_0x8b13('0x3d')]||'')+'\x20'+(_0x327eb1[_0x8b13('0x3e')]||''),'customerIp':_0x3a8e06,'customerPort':_0x2bf1b0['x-real-port']?_0x2bf1b0[_0x8b13('0x3f')]:null,'referer':_0x5e63f6[_0x8b13('0x40')],'browserName':_0x5daee9[_0x8b13('0x41')][_0x8b13('0x36')]&&_0x5daee9[_0x8b13('0x41')][_0x8b13('0x42')]?util[_0x8b13('0x43')]('%s\x20%s',_0x5daee9['browser']['name'],_0x5daee9[_0x8b13('0x41')][_0x8b13('0x42')]):_0x8b13('0x44'),'browserVersion':_0x5daee9[_0x8b13('0x41')][_0x8b13('0x42')]||_0x8b13('0x44'),'osName':util['format'](_0x8b13('0x45'),_0x5daee9['os']['name'],_0x5daee9['os'][_0x8b13('0x42')]),'osVersion':_0x5daee9['os']['version'],'deviceModel':_0x5daee9[_0x8b13('0x46')][_0x8b13('0x47')]&&_0x5daee9[_0x8b13('0x46')][_0x8b13('0x48')]?util[_0x8b13('0x43')](_0x8b13('0x49'),_0x5daee9[_0x8b13('0x46')]['model'],_0x5daee9['device']['vendor'],_0x5daee9[_0x8b13('0x46')][_0x8b13('0x4a')]):null,'deviceVendor':_0x5daee9[_0x8b13('0x46')][_0x8b13('0x48')],'deviceType':_0x5daee9['device']['type'],'formData':JSON[_0x8b13('0x22')](_0x5e63f6)};}exports['index']=function(_0x24262a,_0x10928d){var _0x20c363={'include':[{'model':db['Pause'],'as':_0x8b13('0x4b')}]},_0x28ae75={},_0x46556f={'count':0x0,'rows':[]};var _0x2044fc=_[_0x8b13('0x4c')](db[_0x8b13('0x4d')][_0x8b13('0x4e')],function(_0x2619df){return{'name':_0x2619df[_0x8b13('0x4f')],'type':_0x2619df[_0x8b13('0x4a')][_0x8b13('0x50')]};});_0x28ae75['model']=_[_0x8b13('0x4c')](_0x2044fc,'name');_0x28ae75[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0x24262a[_0x8b13('0x51')]);_0x28ae75['filters']=_[_0x8b13('0x53')](_0x28ae75[_0x8b13('0x47')],_0x28ae75[_0x8b13('0x51')]);_0x20c363[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x28ae75[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x24262a['query'][_0x8b13('0x55')]));_0x20c363['attributes']=_0x20c363[_0x8b13('0x54')][_0x8b13('0x56')]?_0x20c363[_0x8b13('0x54')]:_0x28ae75[_0x8b13('0x47')];if(!_0x24262a[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0x20c363[_0x8b13('0x2d')]=qs[_0x8b13('0x2d')](_0x24262a[_0x8b13('0x51')][_0x8b13('0x2d')]);_0x20c363[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0x24262a[_0x8b13('0x51')][_0x8b13('0x2a')]);}_0x20c363[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x24262a['query'][_0x8b13('0x5a')]);_0x20c363[_0x8b13('0x5b')]=qs['filters'](_[_0x8b13('0x5c')](_0x24262a[_0x8b13('0x51')],_0x28ae75[_0x8b13('0x5d')]),_0x2044fc);if(_0x24262a[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x20c363[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0x20c363[_0x8b13('0x5b')],{'$or':_[_0x8b13('0x4c')](_0x2044fc,function(_0x1ff311){if(_0x1ff311[_0x8b13('0x4a')]!==_0x8b13('0x60')){var _0x137e8c={};_0x137e8c[_0x1ff311[_0x8b13('0x36')]]={'$like':'%'+_0x24262a[_0x8b13('0x51')]['filter']+'%'};return _0x137e8c;}})});}_0x20c363=_[_0x8b13('0x5f')]({},_0x20c363,_0x24262a[_0x8b13('0x61')]);var _0x47a3fa={'where':_0x20c363[_0x8b13('0x5b')]};return db[_0x8b13('0x4d')][_0x8b13('0x2c')](_0x47a3fa)[_0x8b13('0x1d')](function(_0x1263f4){_0x46556f['count']=_0x1263f4;if(_0x24262a[_0x8b13('0x51')][_0x8b13('0x62')]){_0x20c363[_0x8b13('0x63')]=[{'all':!![]}];}return db['ChatWebsite'][_0x8b13('0x64')](_0x20c363);})[_0x8b13('0x1d')](function(_0x585392){_0x46556f[_0x8b13('0x65')]=_0x585392;return _0x46556f;})[_0x8b13('0x1d')](respondWithFilteredResult(_0x10928d,_0x20c363))[_0x8b13('0x66')](handleError(_0x10928d,null));};exports[_0x8b13('0x67')]=function(_0x49e5cd,_0x13c8bd){var _0x28d568={'raw':![],'where':{'id':_0x49e5cd[_0x8b13('0x68')]['id']},'include':[{'model':db[_0x8b13('0x69')],'as':_0x8b13('0x4b')}]},_0x52e705={};_0x52e705[_0x8b13('0x47')]=_['keys'](db[_0x8b13('0x4d')][_0x8b13('0x4e')]);_0x52e705[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0x49e5cd[_0x8b13('0x51')]);_0x52e705[_0x8b13('0x5d')]=_['intersection'](_0x52e705[_0x8b13('0x47')],_0x52e705[_0x8b13('0x51')]);_0x28d568[_0x8b13('0x54')]=_['intersection'](_0x52e705[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x49e5cd[_0x8b13('0x51')][_0x8b13('0x55')]));_0x28d568['attributes']=_0x28d568['attributes']['length']?_0x28d568['attributes']:_0x52e705['model'];if(_0x49e5cd[_0x8b13('0x51')][_0x8b13('0x62')]){_0x28d568['include']=[{'all':!![]}];}_0x28d568=_[_0x8b13('0x5f')]({},_0x28d568,_0x49e5cd['options']);return db[_0x8b13('0x4d')][_0x8b13('0x6a')](_0x28d568)[_0x8b13('0x1d')](handleEntityNotFound(_0x13c8bd,null))[_0x8b13('0x1d')](respondWithResult(_0x13c8bd,null))[_0x8b13('0x66')](handleError(_0x13c8bd,null));};exports[_0x8b13('0x6b')]=function(_0xa7c7d5,_0x4c433c){var _0xe7e8eb=null;_0xa7c7d5['body'][_0x8b13('0x6c')][_0x8b13('0x6d')](',')[_0x8b13('0x6e')](_0x11a4ba=>{if(_0x11a4ba[_0x8b13('0x6f')]()!==''&&!wildcardUtils[_0x8b13('0x70')](_0x11a4ba[_0x8b13('0x6f')]())){_0xe7e8eb=new APIBadRequestError('\x22'+_0x11a4ba['trim']()+_0x8b13('0x71'));}});if(_0xe7e8eb){return handleError(_0x4c433c,null)(_0xe7e8eb);}return db['ChatWebsite'][_0x8b13('0x6b')](_0xa7c7d5[_0x8b13('0x72')],{})[_0x8b13('0x1d')](function(_0x177f73){var _0x177a64=_0xa7c7d5['user']['get']({'plain':!![]});if(!_0x177a64)throw new Error(_0x8b13('0x73'));if(_0x177a64[_0x8b13('0x74')]==='user'){var _0x180866=_0x177f73[_0x8b13('0x33')]({'plain':!![]});var _0x670b3e='ChatWebsites';return db[_0x8b13('0x75')][_0x8b13('0x6a')]({'where':{'name':_0x670b3e,'userProfileId':_0x177a64[_0x8b13('0x76')]},'raw':!![]})[_0x8b13('0x1d')](function(_0x52850c){if(_0x52850c&&_0x52850c[_0x8b13('0x77')]===0x0){return db[_0x8b13('0x35')]['create']({'name':_0x180866[_0x8b13('0x36')],'resourceId':_0x180866['id'],'type':_0x52850c[_0x8b13('0x36')],'sectionId':_0x52850c['id']},{})[_0x8b13('0x1d')](function(){return _0x177f73;});}else{return _0x177f73;}})[_0x8b13('0x66')](function(_0x45fe23){logger[_0x8b13('0x23')](_0x8b13('0x78'),_0x45fe23);throw _0x45fe23;});}return _0x177f73;})[_0x8b13('0x1d')](respondWithResult(_0x4c433c,0xc9))[_0x8b13('0x66')](handleError(_0x4c433c,null));};exports[_0x8b13('0x31')]=function(_0x2f2bc5,_0x46c25c){var _0x26b888=null;_0x2f2bc5[_0x8b13('0x72')]['address'][_0x8b13('0x6d')](',')['forEach'](_0x14dee4=>{if(_0x14dee4[_0x8b13('0x6f')]()!==''&&!wildcardUtils[_0x8b13('0x70')](_0x14dee4[_0x8b13('0x6f')]())){_0x26b888=new APIBadRequestError('\x22'+_0x14dee4['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x26b888){return handleError(_0x46c25c,null)(_0x26b888);}if(_0x2f2bc5[_0x8b13('0x72')]['id']){delete _0x2f2bc5[_0x8b13('0x72')]['id'];}return db['ChatWebsite'][_0x8b13('0x6a')]({'where':{'id':_0x2f2bc5[_0x8b13('0x68')]['id']},'include':[{'model':db[_0x8b13('0x69')],'as':_0x8b13('0x4b')}]})[_0x8b13('0x1d')](handleEntityNotFound(_0x46c25c,null))[_0x8b13('0x1d')](saveUpdates(_0x2f2bc5[_0x8b13('0x72')],null))[_0x8b13('0x1d')](respondWithResult(_0x46c25c,null))[_0x8b13('0x66')](handleError(_0x46c25c,null));};exports[_0x8b13('0x32')]=function(_0x48fd36,_0x2a1fd3){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x48fd36[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x2a1fd3,null))['then'](removeEntity(_0x2a1fd3,null))[_0x8b13('0x66')](handleError(_0x2a1fd3,null));};exports[_0x8b13('0x79')]=function(_0x1f77b1,_0x1dce78){return db[_0x8b13('0x4d')][_0x8b13('0x79')]()[_0x8b13('0x1d')](respondWithResult(_0x1dce78,null))[_0x8b13('0x66')](handleError(_0x1dce78,null));};exports['addDisposition']=function(_0x2642b1,_0x213b43){if(_0x2642b1[_0x8b13('0x72')]['id']){delete _0x2642b1['body']['id'];}return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x2642b1[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x213b43,null))[_0x8b13('0x1d')](function(_0x40fefa){if(_0x40fefa){_0x2642b1[_0x8b13('0x72')][_0x8b13('0x7a')]=_0x40fefa['id'];return db[_0x8b13('0x7b')][_0x8b13('0x6b')](_0x2642b1[_0x8b13('0x72')]);}})[_0x8b13('0x1d')](respondWithResult(_0x213b43,null))['catch'](handleError(_0x213b43,null));};exports[_0x8b13('0x7c')]=function(_0x111a4f,_0x235b61){var _0xc76c8b={'raw':![],'where':{}};var _0x15f169={};var _0x120a71={'count':0x0,'rows':[]};return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x111a4f[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x235b61,null))[_0x8b13('0x1d')](function(_0x1819fb){if(_0x1819fb){_0x15f169[_0x8b13('0x47')]=_['keys'](db['Disposition'][_0x8b13('0x4e')]);_0x15f169['query']=_[_0x8b13('0x52')](_0x111a4f[_0x8b13('0x51')]);_0x15f169['filters']=_['intersection'](_0x15f169[_0x8b13('0x47')],_0x15f169[_0x8b13('0x51')]);_0xc76c8b[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x15f169[_0x8b13('0x47')],qs['fields'](_0x111a4f[_0x8b13('0x51')]['fields']));_0xc76c8b[_0x8b13('0x54')]=_0xc76c8b[_0x8b13('0x54')]['length']?_0xc76c8b[_0x8b13('0x54')]:_0x15f169[_0x8b13('0x47')];if(!_0x111a4f[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0xc76c8b['limit']=qs[_0x8b13('0x2d')](_0x111a4f[_0x8b13('0x51')][_0x8b13('0x2d')]);_0xc76c8b['offset']=qs[_0x8b13('0x2a')](_0x111a4f['query'][_0x8b13('0x2a')]);}_0xc76c8b[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x111a4f[_0x8b13('0x51')][_0x8b13('0x5a')]);_0xc76c8b[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x111a4f[_0x8b13('0x51')],_0x15f169[_0x8b13('0x5d')]));_0xc76c8b['where'][_0x8b13('0x7a')]=_0x1819fb['id'];if(_0x111a4f[_0x8b13('0x51')][_0x8b13('0x5e')]){_0xc76c8b[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0xc76c8b['where'],{'$or':_[_0x8b13('0x4c')](_0xc76c8b[_0x8b13('0x54')],function(_0x350441){var _0x10bf1a={};_0x10bf1a[_0x350441]={'$like':'%'+_0x111a4f[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x10bf1a;})});}_0xc76c8b=_['merge']({},_0xc76c8b,_0x111a4f[_0x8b13('0x61')]);return db[_0x8b13('0x7b')]['count']({'where':_0xc76c8b[_0x8b13('0x5b')]})['then'](function(_0x1e85eb){_0x120a71['count']=_0x1e85eb;if(_0x111a4f[_0x8b13('0x51')][_0x8b13('0x62')]){_0xc76c8b[_0x8b13('0x63')]=[{'all':!![]}];}return db[_0x8b13('0x7b')][_0x8b13('0x64')](_0xc76c8b);})[_0x8b13('0x1d')](function(_0x165813){_0x120a71[_0x8b13('0x65')]=_0x165813;return _0x120a71;});}})['then'](respondWithFilteredResult(_0x235b61,_0xc76c8b))[_0x8b13('0x66')](handleError(_0x235b61,null));};exports[_0x8b13('0x7e')]=function(_0x5f190a,_0x35c94d){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x5f190a[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x35c94d,null))[_0x8b13('0x1d')](function(_0x42de53){if(_0x42de53){return _0x42de53[_0x8b13('0x7e')](_0x5f190a['query']['ids']);}})[_0x8b13('0x1d')](respondWithStatusCode(_0x35c94d,null))[_0x8b13('0x66')](handleError(_0x35c94d,null));};exports[_0x8b13('0x7f')]=function(_0x36f3af,_0xcafeff){if(_0x36f3af[_0x8b13('0x72')]['id']){delete _0x36f3af[_0x8b13('0x72')]['id'];}return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x36f3af[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0xcafeff,null))[_0x8b13('0x1d')](function(_0xf19be7){if(_0xf19be7){_0x36f3af[_0x8b13('0x72')][_0x8b13('0x7a')]=_0xf19be7['id'];return db[_0x8b13('0x80')]['create'](_0x36f3af[_0x8b13('0x72')]);}})['then'](respondWithResult(_0xcafeff,null))[_0x8b13('0x66')](handleError(_0xcafeff,null));};exports[_0x8b13('0x81')]=function(_0xeb3c0f,_0x394932){var _0x148dde={'raw':![],'where':{}};var _0x402c92={};var _0x7e200e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8b13('0x7d')]({'where':{'id':_0xeb3c0f['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x394932,null))[_0x8b13('0x1d')](function(_0x4db508){if(_0x4db508){_0x402c92['model']=_[_0x8b13('0x52')](db[_0x8b13('0x80')][_0x8b13('0x4e')]);_0x402c92[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0xeb3c0f[_0x8b13('0x51')]);_0x402c92['filters']=_[_0x8b13('0x53')](_0x402c92[_0x8b13('0x47')],_0x402c92['query']);_0x148dde['attributes']=_['intersection'](_0x402c92[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x55')]));_0x148dde[_0x8b13('0x54')]=_0x148dde[_0x8b13('0x54')][_0x8b13('0x56')]?_0x148dde[_0x8b13('0x54')]:_0x402c92['model'];if(!_0xeb3c0f[_0x8b13('0x51')]['hasOwnProperty'](_0x8b13('0x58'))){_0x148dde['limit']=qs[_0x8b13('0x2d')](_0xeb3c0f[_0x8b13('0x51')]['limit']);_0x148dde[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x2a')]);}_0x148dde[_0x8b13('0x59')]=qs['sort'](_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x5a')]);_0x148dde[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_['pick'](_0xeb3c0f[_0x8b13('0x51')],_0x402c92['filters']));_0x148dde[_0x8b13('0x5b')][_0x8b13('0x7a')]=_0x4db508['id'];if(_0xeb3c0f[_0x8b13('0x51')]['filter']){_0x148dde['where']=_['merge'](_0x148dde['where'],{'$or':_[_0x8b13('0x4c')](_0x148dde['attributes'],function(_0x390acb){var _0x4a32ea={};_0x4a32ea[_0x390acb]={'$like':'%'+_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x4a32ea;})});}_0x148dde=_[_0x8b13('0x5f')]({},_0x148dde,_0xeb3c0f[_0x8b13('0x61')]);return db[_0x8b13('0x80')][_0x8b13('0x2c')]({'where':_0x148dde[_0x8b13('0x5b')]})[_0x8b13('0x1d')](function(_0x2a5ed3){_0x7e200e[_0x8b13('0x2c')]=_0x2a5ed3;if(_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x62')]){_0x148dde[_0x8b13('0x63')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8b13('0x64')](_0x148dde);})['then'](function(_0x592d90){_0x7e200e['rows']=_0x592d90;return _0x7e200e;});}})[_0x8b13('0x1d')](respondWithFilteredResult(_0x394932,_0x148dde))[_0x8b13('0x66')](handleError(_0x394932,null));};exports[_0x8b13('0x82')]=function(_0x9f7c7c,_0x58545c){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x9f7c7c[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x58545c,null))['then'](function(_0x218f95){if(_0x218f95){return _0x218f95[_0x8b13('0x82')](_0x9f7c7c[_0x8b13('0x51')]['ids']);}})[_0x8b13('0x1d')](respondWithStatusCode(_0x58545c,null))[_0x8b13('0x66')](handleError(_0x58545c,null));};exports[_0x8b13('0x83')]=function(_0xf629c6,_0x3f2ac6){_0xf629c6[_0x8b13('0x72')][_0x8b13('0x84')]=_0xf629c6[_0x8b13('0x85')][_0x8b13('0x86')];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0xf629c6[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x3f2ac6,null))[_0x8b13('0x1d')](saveUpdates(_0xf629c6[_0x8b13('0x72')],null))[_0x8b13('0x1d')](respondWithResult(_0x3f2ac6,null))['catch'](handleError(_0x3f2ac6,null));};exports[_0x8b13('0x87')]=function(_0x386b00,_0x350c62){_0x386b00['body'][_0x8b13('0x88')]=_0x386b00['file'][_0x8b13('0x86')];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x386b00['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x350c62,null))[_0x8b13('0x1d')](saveUpdates(_0x386b00[_0x8b13('0x72')],null))['then'](respondWithResult(_0x350c62,null))[_0x8b13('0x66')](handleError(_0x350c62,null));};exports[_0x8b13('0x89')]=function(_0x56d3e5,_0x1d8a81){_0x56d3e5[_0x8b13('0x72')][_0x8b13('0x8a')]=_0x56d3e5[_0x8b13('0x85')]['filename'];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x56d3e5[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x1d8a81,null))[_0x8b13('0x1d')](saveUpdates(_0x56d3e5[_0x8b13('0x72')],null))['then'](respondWithResult(_0x1d8a81,null))[_0x8b13('0x66')](handleError(_0x1d8a81,null));};exports['addSystemAvatar']=function(_0x2e3023,_0x178d6b){_0x2e3023['body']['systemAvatar']=_0x2e3023[_0x8b13('0x85')][_0x8b13('0x86')];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x2e3023[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x178d6b,null))[_0x8b13('0x1d')](saveUpdates(_0x2e3023[_0x8b13('0x72')],null))[_0x8b13('0x1d')](respondWithResult(_0x178d6b,null))[_0x8b13('0x66')](handleError(_0x178d6b,null));};exports[_0x8b13('0x8b')]=function(_0x49f5f7,_0x305103){var _0x2c2f68=path['join'](config[_0x8b13('0x8c')],'server/files/images/logos/default_logo.svg');var _0x1a9b61={'where':{'id':_0x49f5f7[_0x8b13('0x68')]['id']},'attributes':['id',_0x8b13('0x84')],'raw':!![]};var _0x59ed6e=![];return require(_0x8b13('0x8d'))[_0x8b13('0x8e')]()[_0x8b13('0x1d')](function(_0x3e0cf8){if(_0x3e0cf8){_0x59ed6e=_0x3e0cf8[_0x8b13('0x8f')];}})['then'](function(){return db[_0x8b13('0x4d')][_0x8b13('0x6a')](_0x1a9b61);})[_0x8b13('0x1d')](handleEntityNotFound(_0x305103,null))[_0x8b13('0x1d')](function(_0xfe9601){if(_0xfe9601){if(!_[_0x8b13('0x90')](_0xfe9601['sitepic'])){if(fs[_0x8b13('0x91')](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x93'),_0xfe9601['sitepic']))&&_0x59ed6e){_0x2c2f68=path[_0x8b13('0x92')](config['root'],'server/files/images/logos/',_0xfe9601[_0x8b13('0x84')]);}}return _0x305103[_0x8b13('0x94')](_0x2c2f68);}})['catch'](handleError(_0x305103,null));};exports[_0x8b13('0x95')]=function(_0x4bb94f,_0x38cbc5){var _0x5ac718=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x96'));var _0x4049ae={'where':{'id':_0x4bb94f[_0x8b13('0x68')]['id']},'attributes':['id',_0x8b13('0x88')],'raw':!![]};return db[_0x8b13('0x4d')][_0x8b13('0x6a')](_0x4049ae)[_0x8b13('0x1d')](handleEntityNotFound(_0x38cbc5,null))['then'](function(_0x146e07){if(_0x146e07){if(!_[_0x8b13('0x90')](_0x146e07['agentAvatar'])){if(fs[_0x8b13('0x91')](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],'server/files/images/avatars/',_0x146e07[_0x8b13('0x88')]))){_0x5ac718=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x146e07['agentAvatar']);}}return _0x38cbc5[_0x8b13('0x94')](_0x5ac718);}})[_0x8b13('0x66')](handleError(_0x38cbc5,null));};exports[_0x8b13('0x98')]=function(_0x2ad402,_0x2a44a7){var _0x46d487=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x99'));var _0x3c2bf8={'where':{'id':_0x2ad402[_0x8b13('0x68')]['id']},'attributes':['id','customerAvatar',_0x8b13('0x9a')],'raw':!![]};return db[_0x8b13('0x4d')]['find'](_0x3c2bf8)[_0x8b13('0x1d')](handleEntityNotFound(_0x2a44a7,null))['then'](function(_0x254c92){if(_0x254c92){if(!_[_0x8b13('0x90')](_0x254c92[_0x8b13('0x8a')])){if(fs[_0x8b13('0x91')](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x254c92[_0x8b13('0x8a')]))&&_0x254c92[_0x8b13('0x9a')]){_0x46d487=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x254c92[_0x8b13('0x8a')]);}}return _0x2a44a7[_0x8b13('0x94')](_0x46d487);}})[_0x8b13('0x66')](handleError(_0x2a44a7,null));};exports[_0x8b13('0x9b')]=function(_0x11e8df,_0x406603){var _0x2a31c5=path[_0x8b13('0x92')](config['root'],_0x8b13('0x9c'));var _0x4d8e3c={'where':{'id':_0x11e8df[_0x8b13('0x68')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8b13('0x4d')]['find'](_0x4d8e3c)[_0x8b13('0x1d')](handleEntityNotFound(_0x406603,null))['then'](function(_0x2de36d){if(_0x2de36d){if(!_[_0x8b13('0x90')](_0x2de36d[_0x8b13('0x9d')])){if(fs['existsSync'](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x2de36d[_0x8b13('0x9d')]))){_0x2a31c5=path['join'](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x2de36d[_0x8b13('0x9d')]);}}return _0x406603[_0x8b13('0x94')](_0x2a31c5);}})[_0x8b13('0x66')](handleError(_0x406603,null));};function checkWebsiteInterval(_0x5f1130){var _0x3a7034=_0x5f1130[_0x8b13('0x9e')];if(!_0x3a7034){return Promise[_0x8b13('0x9f')](_0x5f1130);}var _0x440ba0=_0x5f1130[_0x8b13('0xa0')]||undefined;return _0x3a7034['ifTime'](_0x440ba0)['then'](function(_0x408300){if(!_0x408300){throw new APIOutOfIntervalError();}return _0x5f1130;});}exports['notify']=function(_0x35d90b,_0x3ce2f6){var _0x467779={'body':_0x35d90b[_0x8b13('0x72')],'channel':_0x8b13('0xa1')};var _0x28905c=[];var _0x360e01=[];var _0x146486={};var _0xf31db9=![];if(_0x35d90b[_0x8b13('0x72')]['id']){delete _0x35d90b[_0x8b13('0x72')]['id'];}if(_[_0x8b13('0x90')](_0x35d90b['body']['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_['isNil'](_0x35d90b['body'][_0x8b13('0xa2')])){throw new APIBadRequestError(_0x8b13('0xa3'));}if(_[_0x8b13('0xa4')](_0x35d90b[_0x8b13('0x72')][_0x8b13('0x72')])){throw new APIBadRequestError(_0x8b13('0xa5'));}var _0x33ab8d=_0x35d90b[_0x8b13('0x72')][_0x8b13('0x3a')]&&_0x35d90b[_0x8b13('0x72')]['referer'];return db[_0x8b13('0xa6')][_0x8b13('0x79')]()[_0x8b13('0x1d')](function(_0x5ce5e8){if(!_0x5ce5e8){throw new Error('No\x20available\x20attributes');}_0x28905c=Object[_0x8b13('0x52')](_0x5ce5e8)[_0x8b13('0x5e')](function(_0x5188d5){return![_0x8b13('0xa7'),_0x8b13('0xa8')]['includes'](_0x5188d5);});_0x360e01=Object[_0x8b13('0x52')](_0x5ce5e8)[_0x8b13('0x5e')](function(_0x1ed1d5){return![_0x8b13('0xa7'),_0x8b13('0xa8'),'CompanyId','ListId'][_0x8b13('0xa9')](_0x1ed1d5);});if(!_['includes'](_0x360e01,_0x35d90b[_0x8b13('0x72')][_0x8b13('0xa2')])){throw new APIBadRequestError(_0x8b13('0xaa')+_0x360e01['join'](',\x20'));}_0x146486[_0x35d90b[_0x8b13('0x72')][_0x8b13('0xa2')]]=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xab')];})['then'](function(){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x35d90b[_0x8b13('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0x8b13('0xac'),'include':[{'model':db[_0x8b13('0xa6')],'as':_0x8b13('0xad'),'where':_0x146486,'limit':0x1,'order':[[_0x8b13('0xa8'),_0x8b13('0xae')]]}]},{'model':db[_0x8b13('0xaf')],'as':_0x8b13('0xb0')},{'model':db[_0x8b13('0x9e')],'as':_0x8b13('0x9e'),'include':[{'model':db[_0x8b13('0x9e')],'as':_0x8b13('0xb1'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x8b13('0x1d')](function(_0xc42df9){if(!_0xc42df9){throw new APINotFoundError(util['format'](_0x8b13('0xb2'),_0x35d90b[_0x8b13('0x68')]['id']));}if(_0x33ab8d){return checkWebsiteInterval(_0xc42df9);}return _0xc42df9;})[_0x8b13('0x1d')](function(_0x2d605e){_0x467779[_0x8b13('0xb3')]=_0x2d605e;_0x467779[_0x8b13('0xb4')]=_[_0x8b13('0xb5')](_0x2d605e[_0x8b13('0xb0')],[_0x8b13('0xb6')],[_0x8b13('0xb7')]);if(_0x467779['account'][_0x8b13('0xb0')]){delete _0x467779['account'][_0x8b13('0xb0')];}_0x467779['list']=_0x2d605e[_0x8b13('0xac')]||{'id':_0x2d605e['ListId']};if(_0x467779[_0x8b13('0xb8')]&&_0x467779['list'][_0x8b13('0xad')][_0x8b13('0x56')]){return _0x467779[_0x8b13('0xb8')][_0x8b13('0xad')][0x0];}var _0x43d524=_[_0x8b13('0x15')](_0x35d90b[_0x8b13('0x72')],{'firstName':_0x35d90b[_0x8b13('0x72')][_0x8b13('0xab')],'ListId':_0x2d605e[_0x8b13('0xb9')]});_0x43d524[_0x35d90b[_0x8b13('0x72')]['mapKey']]=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xab')];return db[_0x8b13('0xa6')][_0x8b13('0x6b')](_0x43d524,{'fields':_0x28905c,'raw':!![]});})['then'](function(_0x50ba6e){_0x467779[_0x8b13('0xba')]=_0x50ba6e;var _0x15c9d8=createInteractionObject(_0x35d90b[_0x8b13('0x68')]['id'],_0x35d90b[_0x8b13('0x72')],_0x35d90b[_0x8b13('0xbb')],_0x50ba6e);var _0x55827a={'ChatWebsiteId':_0x35d90b[_0x8b13('0x68')]['id']};if(_0x35d90b[_0x8b13('0x72')][_0x8b13('0xbc')]){_0x55827a[_0x8b13('0xbc')]=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xbc')];_0x55827a[_0x8b13('0xbd')]=![];return db[_0x8b13('0xbe')][_0x8b13('0x6a')]({'where':_0x55827a})[_0x8b13('0x1d')](function(_0x5cbbe3){var _0x478185=_0x35d90b[_0x8b13('0x72')]['customerIp']&&_0x35d90b[_0x8b13('0x72')]['referer'];if(_0x5cbbe3){_0xf31db9=!![];return _0x5cbbe3;}else if(!_0x478185&&_0x5cbbe3&&_0x5cbbe3[_0x8b13('0xbd')]){throw new APIConflictError(_0x8b13('0xbf'));}_0x15c9d8[_0x8b13('0xbc')]=_0x35d90b[_0x8b13('0x72')]['threadId'];_0x15c9d8[_0x8b13('0xc0')]=_0x35d90b[_0x8b13('0x72')]['externalUrl'];return db[_0x8b13('0xbe')]['create'](_0x15c9d8);});}_0x55827a[_0x8b13('0xc1')]=_0x50ba6e['id'];if(_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc2')]&&_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc2')]['id']){_0x55827a['id']=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc2')]['id'];return db['ChatInteraction'][_0x8b13('0x6a')]({'where':_0x55827a})[_0x8b13('0x1d')](function(_0x1a4d35){var _0x1fc092=_0x35d90b['body']['customerIp']&&_0x35d90b['body'][_0x8b13('0x40')];if(!_0x1fc092&&_0x1a4d35&&_0x1a4d35['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x1a4d35){_0xf31db9=!![];return _0x1a4d35;}else{return db[_0x8b13('0xbe')][_0x8b13('0x6b')](_0x15c9d8);}});}return db[_0x8b13('0xbe')][_0x8b13('0x6b')](_0x15c9d8);})[_0x8b13('0x1d')](function(_0x2a90ae){if(!_0xf31db9){return _0x2a90ae;}var _0x2e865f={'from':(_0x467779['contact']['firstName']||'')+'\x20'+(_0x467779[_0x8b13('0xba')]['lastName']||'')};if(_0x35d90b[_0x8b13('0x72')][_0x8b13('0xbc')]&&_0x35d90b[_0x8b13('0x72')]['messageId']&&_0x35d90b[_0x8b13('0x72')]['threadId']!=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc3')]){_0x2e865f[_0x8b13('0xbc')]=_0x35d90b['body'][_0x8b13('0xc3')];}return _0x2a90ae[_0x8b13('0x31')](_0x2e865f);})[_0x8b13('0x1d')](function(_0x3cc463){_0x467779[_0x8b13('0xc2')]=_0x3cc463[_0x8b13('0x33')]({'plain':!![]});_0x467779[_0x8b13('0xc2')]['created']=!_0xf31db9;if(_0x467779['interaction']['created']){if(_0x467779[_0x8b13('0xb3')][_0x8b13('0xc4')]){_0x467779['applications'][_0x8b13('0xc5')]({'id':0x0,'priority':_0x467779['applications'][_0x8b13('0x56')]+0x1,'app':_0x8b13('0xc6'),'appdata':'unmanaged','interval':_0x8b13('0xc7')});}}return db[_0x8b13('0xc8')][_0x8b13('0x6b')]({'body':_0x35d90b[_0x8b13('0x72')][_0x8b13('0x72')],'ChatWebsiteId':_0x35d90b['params']['id'],'ChatInteractionId':_0x3cc463['id'],'direction':'in','ContactId':_0x467779['contact']['id'],'AttachmentId':_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc9')]});})[_0x8b13('0x1d')](function(_0x1e3cc8){_0x467779[_0x8b13('0x25')]=_0x1e3cc8;if(!_0x467779[_0x8b13('0xc2')][_0x8b13('0xca')]){return;}return db[_0x8b13('0xcb')]['find']({'attributes':['id',_0x8b13('0x36')],'where':{'id':_0x467779['interaction'][_0x8b13('0xca')]}});})[_0x8b13('0x1d')](function(_0x1883b0){if(_0x1883b0){_0x467779[_0x8b13('0xb4')][_0x8b13('0xcc')]({'id':0x0,'priority':0x0,'app':_0x8b13('0xcd'),'appdata':_0x1883b0[_0x8b13('0x36')]+','+(_0x467779[_0x8b13('0xb3')][_0x8b13('0xce')]||0xa),'interval':_0x8b13('0xc7')});_0x467779[_0x8b13('0xcf')]=!![];}if(!_0x467779[_0x8b13('0xc2')][_0x8b13('0xd0')]){return;}return db[_0x8b13('0xd1')]['find']({'attributes':['id',_0x8b13('0x36')],'where':{'id':_0x467779[_0x8b13('0xc2')][_0x8b13('0xd0')]}});})[_0x8b13('0x1d')](function(_0x2d43e0){if(_0x2d43e0){_0x467779[_0x8b13('0xb4')][_0x8b13('0xcc')]({'id':0x0,'priority':0x1,'app':_0x8b13('0xd2'),'appdata':_0x2d43e0[_0x8b13('0x36')]+','+(_0x467779[_0x8b13('0xb3')][_0x8b13('0xd3')]||0x12c),'interval':_0x8b13('0xc7')});}return respondWithRpcPromise(_0x8b13('0xd4'),'startRouting',_0x467779);})['then'](function(_0x347e78){respondWithRpcPromise(_0x8b13('0xd5'),'EventManager',{'event':_0x8b13('0xd6'),'message':_0x347e78},client9002);return _0x347e78;})[_0x8b13('0x1d')](respondWithResult(_0x3ce2f6,null))[_0x8b13('0x66')](APIHandleError(_0x3ce2f6));};exports[_0x8b13('0xd7')]=function(_0x59babb,_0x5f4be9){var _0x12a4f8,_0xed9630,_0x350a80;var _0x35f557=[];var _0x1e84f3={};var _0x446fab=_0x59babb['files']||[];var _0x32c2d9=[];var _0x8c1dc0;return db['CmContact']['describe']()[_0x8b13('0x1d')](function(_0x2350d3){if(!_0x2350d3){throw new db[(_0x8b13('0xd8'))]['ValidationError'](_0x8b13('0xd9'));}_0x35f557=_['difference'](_['keys'](_0x2350d3),[_0x8b13('0xa7'),_0x8b13('0xa8'),'CompanyId','ListId']);if(_0x59babb[_0x8b13('0x72')]['id']){delete _0x59babb['body']['id'];}if(_[_0x8b13('0x90')](_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')])){throw _0x5f4be9[_0x8b13('0x29')](0x1f4)[_0x8b13('0x37')](new db['Sequelize']['ValidationError'](_0x8b13('0xda')));}if(_['isNil'](_0x59babb['body'][_0x8b13('0x72')])||_0x59babb[_0x8b13('0x72')][_0x8b13('0x72')]===''){throw _0x5f4be9[_0x8b13('0x29')](0x1f4)[_0x8b13('0x37')](new db[(_0x8b13('0xd8'))]['ValidationError'](_0x8b13('0xdb')));}if(_[_0x8b13('0x90')](_0x59babb[_0x8b13('0x72')][_0x8b13('0xdc')])){throw _0x5f4be9['status'](0x1f4)['send'](new db[(_0x8b13('0xd8'))][(_0x8b13('0xdd'))](_0x8b13('0xde')+_0x35f557));}if(!_[_0x8b13('0xa9')](_0x35f557,_0x59babb[_0x8b13('0x72')]['mapKeyOffline'])){throw _0x5f4be9[_0x8b13('0x29')](0x1f4)['send'](new db[(_0x8b13('0xd8'))][(_0x8b13('0xdd'))](_0x8b13('0xdf')+_0x35f557));}_0x1e84f3[_0x59babb['body'][_0x8b13('0xdc')]]=_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')];})['then'](function(){return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x59babb[_0x8b13('0x68')]['id']},'include':[{'model':db[_0x8b13('0xe0')],'as':_0x8b13('0xac')},{'model':db[_0x8b13('0xe1')],'as':'MailAccount'}]});})[_0x8b13('0x1d')](handleEntityNotFound(_0x5f4be9,null))[_0x8b13('0x1d')](function(_0x4c9273){if(_0x4c9273&&_0x4c9273['List']){_0xed9630=_0x4c9273;var _0x4935f0=_[_0x8b13('0x15')](_0x59babb['body'],{'firstName':_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')],'phone':_0x59babb[_0x8b13('0x72')]['from'],'ListId':_0x4c9273['ListId']});_0x4935f0[_0x59babb['body'][_0x8b13('0xdc')]]=_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')];return db['CmContact'][_0x8b13('0xe2')]({'where':_0x1e84f3,'defaults':_0x4935f0});}})['spread'](function(_0x28090c){if(_0x28090c){_0x350a80=_0x28090c;var _0x5011be=fs['readFileSync'](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0xe3')),_0x8b13('0xe4'));var _0x5b033b=ejs['render'](_0x5011be,{'body':_[_0x8b13('0xe5')](_0x59babb[_0x8b13('0x72')]['body']),'bodyTitle':_0xed9630['offlineMessageBody']});return db[_0x8b13('0xe6')][_0x8b13('0x6b')]({'body':_0x5b033b,'plainBody':htmlToText[_0x8b13('0xe7')](_0x5b033b),'ContactId':_0x28090c['id'],'ChatWebsiteId':_0xed9630['id']});}})[_0x8b13('0x1d')](function(_0x2de61d){_0x8c1dc0=_0x2de61d;if(_0x446fab[_0x8b13('0x56')]){var _0x5a195d=_0x446fab[_0x8b13('0x4c')](function(_0xecc8ea){return{'name':_0xecc8ea[_0x8b13('0xe8')],'basename':_0xecc8ea[_0x8b13('0x86')],'type':_0xecc8ea['mimetype'],'ChatOfflineMessageId':_0x2de61d['id']};});_0x32c2d9=_0x5a195d['map'](_0x2e24f2=>{var _0x1e2036={'filename':_0x2e24f2[_0x8b13('0x36')],'path':path[_0x8b13('0x92')](config['root'],_0x8b13('0xe9'),_0x8b13('0xea'),'attachments',_0x8b13('0xeb'),_0x2e24f2['basename'])};return _0x1e2036;});if(!_0xed9630[_0x8b13('0xec')]){return db[_0x8b13('0xed')][_0x8b13('0xee')](function(_0x24b945){return db[_0x8b13('0xef')][_0x8b13('0xf0')](_0x5a195d,{'transaction':_0x24b945});});}}})[_0x8b13('0x1d')](function(){if(_0x8c1dc0){_0x12a4f8=_0x8c1dc0;return db['MailAccount'][_0x8b13('0x7d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8b13('0xf1')],'as':_0x8b13('0xf1'),'raw':!![]}]}]});}})[_0x8b13('0x1d')](function(_0x38a88d){if(_0x38a88d&&_0x38a88d['Smtp']&&_0xed9630[_0x8b13('0xf2')]&&_0xed9630[_0x8b13('0xf3')]){var _0x1f9f15=_0x38a88d['getSmtpOptions']();return respondWithRpcPromise(_0x8b13('0xf4'),_0x8b13('0xf5'),{'account':_0x1f9f15,'message':{'from':util[_0x8b13('0x43')](_0x8b13('0xf6'),_0x38a88d[_0x8b13('0x36')],_0x38a88d[_0x8b13('0xf7')]||_0x38a88d[_0x8b13('0xf8')][_0x8b13('0xf9')]),'to':_0xed9630[_0x8b13('0xf3')],'subject':_0xed9630['offlineMessageSubject'],'html':_0x12a4f8[_0x8b13('0x72')],'attachments':_0x32c2d9}},client9003)[_0x8b13('0x1d')](function(){return _0x12a4f8;})[_0x8b13('0x66')](function(_0x104e89){logger['error'](_0x104e89);});}})['then'](function(){if(_0xed9630&&_0xed9630[_0x8b13('0xec')]&&_0xed9630[_0x8b13('0xfa')]){var _0x331434=[];if(_0x446fab[_0x8b13('0x56')]){_0x331434=_0x446fab[_0x8b13('0x4c')](function(_0x4a19ef){return{'name':_0x4a19ef[_0x8b13('0xe8')],'basename':_0x4a19ef[_0x8b13('0x86')],'type':_0x4a19ef[_0x8b13('0xfb')],'ChatOfflineMessageId':_0x8c1dc0['id']};});}var _0x49a92f;if(!_['isNil'](_0xed9630['subjectOffline'])){var _0x542e1b=_[_0x8b13('0x4c')](_0x59babb[_0x8b13('0x72')],function(_0x59615c){return _0x59615c;});var _0x132e63=_[_0x8b13('0xfc')](_0x542e1b)[0x0];var _0x27c8d9=_[_0x8b13('0xfd')](_0x132e63,function(_0x3eda97){return _0x3eda97;});_0x49a92f=_0x27c8d9[0x1][_0xed9630['subjectOffline']];}var _0x1f544c={'from':_0x350a80['email'],'firstName':_0x350a80['firstName'],'lastName':_0x350a80[_0x8b13('0x3e')],'mapKey':_0x8b13('0xf7'),'message':{'from':_0x350a80[_0x8b13('0xf7')],'to':_0xed9630[_0x8b13('0xe1')]['email'],'cc':'','subject':_[_0x8b13('0x90')](_0x49a92f)?_0xed9630[_0x8b13('0xfe')]:_0x49a92f,'messageId':'','sentAt':new Date(),'attach':_0x331434['length'],'attachments':_0x331434,'originChannel':_0x8b13('0xff'),'ChatWebsiteId':_0xed9630['id'],'ChatOfflineMessageId':_0x12a4f8['id'],'originTo':_0xed9630[_0x8b13('0xe1')]['email']},'body':_0x12a4f8[_0x8b13('0x72')]};var _0x1d47ff={'account':{'id':_0xed9630['MailAccountId']},'body':_0x1f544c,'log':_0x8b13('0x100')};return respondWithRpcPromise(_0x8b13('0x100'),_0x8b13('0x101'),_0x1d47ff,client9001)[_0x8b13('0x1d')](function(){return _0x12a4f8;})['catch'](function(_0xfb0a65){logger['error'](_0xfb0a65);});}return;})[_0x8b13('0x1d')](function(){if(_0x12a4f8){return _0x12a4f8;}})[_0x8b13('0x1d')](respondWithResult(_0x5f4be9,null))[_0x8b13('0x66')](function(){for(var _0x3c12ea of _0x446fab){var _0x8cd0e=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0xe9'),_0x8b13('0xea'),_0x8b13('0x102'),_0x8b13('0xeb'),_0x3c12ea[_0x8b13('0x86')]);fs_extra[_0x8b13('0x103')](_0x8cd0e)['catch'](function(_0x188f6e){logger[_0x8b13('0x23')](_0x8b13('0x104'),_0x8cd0e,_0x188f6e);});}});};exports[_0x8b13('0x105')]=function(_0x2db1b7,_0x433862){return db[_0x8b13('0xbe')]['find']({'where':{'id':_0x2db1b7['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x433862,null))[_0x8b13('0x1d')](function(_0x2defbf){if(_0x2defbf){return _0x2defbf[_0x8b13('0x105')](_0x2db1b7[_0x8b13('0x72')][_0x8b13('0x106')],_[_0x8b13('0x107')](_0x2db1b7[_0x8b13('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x433862,null))['catch'](handleError(_0x433862,null));};exports[_0x8b13('0x108')]=function(_0x392239,_0x360153){var _0x33e47b={'raw':![],'where':{}};var _0x1be7a8={};var _0x5369e2={'count':0x0,'rows':[]};return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x392239[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x360153,null))[_0x8b13('0x1d')](function(_0x1f771c){if(_0x1f771c){_0x1be7a8[_0x8b13('0x47')]=_[_0x8b13('0x52')](db[_0x8b13('0xbe')]['rawAttributes']);_0x1be7a8['query']=_['keys'](_0x392239[_0x8b13('0x51')]);_0x1be7a8[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x1be7a8[_0x8b13('0x47')],_0x1be7a8[_0x8b13('0x51')]);_0x33e47b[_0x8b13('0x54')]=_['intersection'](_0x1be7a8[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x392239['query']['fields']));_0x33e47b['attributes']=_0x33e47b[_0x8b13('0x54')]['length']?_0x33e47b['attributes']:_0x1be7a8[_0x8b13('0x47')];if(!_0x392239['query'][_0x8b13('0x57')](_0x8b13('0x58'))){_0x33e47b[_0x8b13('0x2d')]=qs['limit'](_0x392239['query'][_0x8b13('0x2d')]);_0x33e47b[_0x8b13('0x2a')]=qs['offset'](_0x392239[_0x8b13('0x51')]['offset']);}_0x33e47b[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x392239['query'][_0x8b13('0x5a')]);_0x33e47b['where']=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x392239[_0x8b13('0x51')],_0x1be7a8['filters']));_0x33e47b[_0x8b13('0x5b')][_0x8b13('0x7a')]=_0x1f771c['id'];if(_0x392239[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x33e47b[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0x33e47b[_0x8b13('0x5b')],{'$or':_['map'](_0x33e47b[_0x8b13('0x54')],function(_0x476cce){var _0x378484={};_0x378484[_0x476cce]={'$like':'%'+_0x392239[_0x8b13('0x51')]['filter']+'%'};return _0x378484;})});}_0x33e47b=_[_0x8b13('0x5f')]({},_0x33e47b,_0x392239['options']);return db[_0x8b13('0xbe')][_0x8b13('0x2c')]({'where':_0x33e47b['where']})[_0x8b13('0x1d')](function(_0x110259){_0x5369e2['count']=_0x110259;if(_0x392239[_0x8b13('0x51')][_0x8b13('0x62')]){_0x33e47b['include']=[{'model':db['CmContact'],'as':_0x8b13('0x109'),'required':![]},{'model':db[_0x8b13('0xcb')],'as':_0x8b13('0x10a'),'attributes':[_0x8b13('0x36'),_0x8b13('0x10b'),'internal'],'required':![]},{'model':db[_0x8b13('0x10c')],'as':_0x8b13('0x10d'),'attributes':['id',_0x8b13('0x36'),_0x8b13('0x10e')],'where':_0x392239['query'][_0x8b13('0x10f')]?{'id':_0x392239['query']['tag']}:undefined,'required':_0x392239[_0x8b13('0x51')][_0x8b13('0x10f')]?!![]:![]}];}return db[_0x8b13('0xbe')]['findAll'](_0x33e47b);})['then'](function(_0xf3a99b){_0x5369e2[_0x8b13('0x65')]=_0xf3a99b;return _0x5369e2;});}})[_0x8b13('0x1d')](respondWithFilteredResult(_0x360153,_0x33e47b))[_0x8b13('0x66')](handleError(_0x360153,null));};exports['getSnippet']=function(_0x4d1e8f,_0xce789c){var _0x29db49=0x0;var _0x20a25a=0x0;var _0x2be3a5=![];var _0x1c1513;var _0x2dc404;return db['ChatWebsite'][_0x8b13('0x6a')]({'where':{'id':_0x4d1e8f[_0x8b13('0x68')]['id']},'include':[{'model':db['Interval'],'as':_0x8b13('0x9e'),'include':[{'model':db[_0x8b13('0x9e')],'as':_0x8b13('0xb1'),'attributes':['id',_0x8b13('0x110')]}]}]})[_0x8b13('0x1d')](handleEntityNotFound(_0xce789c,null))['then'](function(_0x43f7ff){if(_0x43f7ff){_0x1c1513=_0x43f7ff;return _0x43f7ff[_0x8b13('0x111')]({'raw':!![]});}})[_0x8b13('0x1d')](function(_0x48d167){if(_0x1c1513){if(_0x48d167){_0x2dc404=_0x48d167;}}return require(_0x8b13('0x8d'))[_0x8b13('0x8e')]();})['then'](function(_0x19f701){if(_0x19f701){_0x20a25a=_0x19f701[_0x8b13('0x112')];_0x2be3a5=_0x19f701[_0x8b13('0x8f')];}})['then'](function(){return db['ChatInteraction'][_0x8b13('0x2c')]({'where':{'closed':![]}});})['then'](function(_0x2dc339){_0x29db49=_0x2dc339;if(_0x20a25a&&_0x2dc339>_0x20a25a){return db[_0x8b13('0x113')][_0x8b13('0x7d')]({'where':{'id':0x1}})['then'](function(_0x18aa8f){if(_0x18aa8f){_0x18aa8f['increment']('chatLicenseExceeded');}});}})[_0x8b13('0x1d')](function(){var _0x12408a=_0x1c1513[_0x8b13('0x9e')];var _0x1c87fa=_0x1c1513[_0x8b13('0xa0')]||undefined;return _0x12408a?_0x12408a[_0x8b13('0x114')](_0x1c87fa):!![];})['then'](function(_0x273dec){var _0x3680b8=fs[_0x8b13('0x115')](path[_0x8b13('0x92')](config['root'],_0x8b13('0x116')),_0x8b13('0xe4'));var _0x41d888=_0x8b13('0x117');var _0x1a3b50=![];var _0x3af827,_0xc62a7c;if(_0x4d1e8f['headers'][_0x8b13('0x40')]){_0x3af827=new URL(_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x40')])[_0x8b13('0x118')];}else if(_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x118')]){_0x3af827=new URL(_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x118')])['origin'];}else{_0x3af827=_0x8b13('0x119');}_0xc62a7c=typeof _0x1c1513['address'][_0x8b13('0x6d')](',')[_0x8b13('0x6a')](function(_0x1f0508){return wildcardUtils[_0x8b13('0x11a')](_0x1f0508,_0x3af827);})!==_0x8b13('0x2b');var _0x132264={'chatVersion':_0x41d888,'chatWebsiteAddressOrigin':_0xc62a7c?_0x3af827:_0x1c1513['address'],'remote':_0x1c1513[_0x8b13('0x11b')],'query':querystring[_0x8b13('0x22')](_['merge'](_0x1c1513['get']({'plain':!![]}),{'customerIp':_0x4d1e8f['headers']['x-forwarded-for']||_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x11c')]||_0x4d1e8f[_0x8b13('0x11d')][_0x8b13('0x11e')]||_0x4d1e8f['ip'],'referer':_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x40')],'openedInteractions':_0x29db49,'maxInteractions':_0x20a25a,'virtual':_0x2be3a5['virtual'],'online':_0x273dec,'custom':_0x2be3a5,'address':_0xc62a7c?_0x3af827:null}))['replace'](/'/g,'\x5c\x27')};_0xce789c[_0x8b13('0x37')](ejs[_0x8b13('0x11f')](Mustache[_0x8b13('0x11f')](_0x3680b8,_0x132264),{'proactiveActions':_0x2dc404,'alignment':_0x1c1513[_0x8b13('0x120')],'verticalAlignment':_0x1c1513[_0x8b13('0x121')],'div_color':_0x1c1513[_0x8b13('0x10e')],'labelText':_0x1c1513[_0x8b13('0x122')],'text_color':_0x1c1513['textColor'],'text_button_color':_0x1c1513[_0x8b13('0x123')],'button_color':_0x1c1513[_0x8b13('0x124')],'background_color':_0x1c1513['backgroundColor'],'hideWhenOffline':_0x1c1513['hideWhenOffline'],'intervalId':_0x1c1513['IntervalId'],'isDevelopment':_0x1a3b50,'chatVersion':_0x41d888}));})[_0x8b13('0x66')](handleError(_0xce789c,null));};exports['addApplications']=function(_0x458c8f,_0xdda7e0){var _0xd5a593=_0x458c8f[_0x8b13('0x68')]['id'];var _0x17df3f=_0x458c8f[_0x8b13('0x72')];var _0x68adf4=0xc8;var _0x429040=null;return db[_0x8b13('0xed')]['transaction']({'isolationLevel':db[_0x8b13('0xed')]['Transaction']['ISOLATION_LEVELS'][_0x8b13('0x125')]},function(_0x259a1f){return db['ChatWebsite'][_0x8b13('0x7d')]({'where':{'id':_0xd5a593},'transaction':_0x259a1f})[_0x8b13('0x1d')](function(_0x457dd1){if(_0x457dd1){return db[_0x8b13('0xaf')][_0x8b13('0x32')]({'where':{'ChatWebsiteId':_0xd5a593},'transaction':_0x259a1f})[_0x8b13('0x1d')](function(){var _0x2c8a6d=_[_0x8b13('0x4c')](_0x17df3f,function(_0x3f35c1){_0x3f35c1[_0x8b13('0x7a')]=_0xd5a593;return _0x3f35c1;});return db[_0x8b13('0xaf')][_0x8b13('0xf0')](_0x2c8a6d,{'transaction':_0x259a1f});});}else{_0x68adf4=0x194;_0x429040=[];}});})[_0x8b13('0x1d')](function(){if(_0x68adf4!==0x194){return db[_0x8b13('0xaf')][_0x8b13('0x126')]({'where':{'ChatWebsiteId':_0xd5a593},'order':_0x8b13('0xb6')})[_0x8b13('0x1d')](function(_0x1ea799){_0x429040=_0x1ea799;});}})[_0x8b13('0x66')](function(_0x50032d){_0x68adf4=0x1f4;logger[_0x8b13('0x23')](_0x50032d[_0x8b13('0x127')]);if(_0x50032d['name']){delete _0x50032d[_0x8b13('0x36')];}_0x429040=_0x50032d;})['finally'](function(){if(_0x429040===null){_0xdda7e0[_0x8b13('0x27')](_0x68adf4);}else{if(_0x68adf4===0x1f4){_0xdda7e0[_0x8b13('0x29')](_0x68adf4)[_0x8b13('0x37')](_0x429040);}else{_0xdda7e0[_0x8b13('0x29')](_0x68adf4)[_0x8b13('0x30')](_0x429040);}}});};exports[_0x8b13('0x128')]=function(_0xdf5ae6,_0x286254){var _0x18abba={};var _0x2a1b92={};var _0x95e9fb;var _0x2dcef4;return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0xdf5ae6[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x286254,null))[_0x8b13('0x1d')](function(_0x3349ac){if(_0x3349ac){_0x95e9fb=_0x3349ac;_0x2a1b92['model']=_[_0x8b13('0x52')](db[_0x8b13('0xaf')][_0x8b13('0x4e')]);_0x2a1b92[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0xdf5ae6['query']);_0x2a1b92[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x2a1b92[_0x8b13('0x47')],_0x2a1b92[_0x8b13('0x51')]);_0x18abba[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x2a1b92['model'],qs[_0x8b13('0x55')](_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x55')]));_0x18abba[_0x8b13('0x54')]=_0x18abba[_0x8b13('0x54')]['length']?_0x18abba[_0x8b13('0x54')]:_0x2a1b92['model'];_0x18abba[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0xdf5ae6['query'][_0x8b13('0x5a')]);_0x18abba[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0xdf5ae6[_0x8b13('0x51')],_0x2a1b92[_0x8b13('0x5d')]));if(_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x18abba[_0x8b13('0x5b')]=_['merge'](_0x18abba[_0x8b13('0x5b')],{'$or':_[_0x8b13('0x4c')](_0x18abba[_0x8b13('0x54')],function(_0x29503b){var _0x246e17={};_0x246e17[_0x29503b]={'$like':'%'+_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x246e17;})});}_0x18abba=_[_0x8b13('0x5f')]({},_0x18abba,_0xdf5ae6[_0x8b13('0x61')]);return _0x95e9fb['getApplications'](_0x18abba);}})['then'](function(_0x405fa3){if(_0x405fa3){_0x2dcef4=_0x405fa3[_0x8b13('0x56')];if(!_0xdf5ae6['query'][_0x8b13('0x57')]('nolimit')){_0x18abba['limit']=qs[_0x8b13('0x2d')](_0xdf5ae6[_0x8b13('0x51')]['limit']);_0x18abba['offset']=qs[_0x8b13('0x2a')](_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x2a')]);}return _0x95e9fb[_0x8b13('0x128')](_0x18abba);}})[_0x8b13('0x1d')](function(_0x359014){if(_0x359014){return _0x359014?{'count':_0x2dcef4,'rows':_0x359014}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x286254,null))[_0x8b13('0x66')](handleError(_0x286254,null));};exports[_0x8b13('0x129')]=function(_0x7c338d,_0x50bf52){return db[_0x8b13('0x12a')][_0x8b13('0x6a')]({'where':{'id':_0x7c338d[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x50bf52,null))['then'](function(_0x54c415){if(_0x54c415){return _0x54c415[_0x8b13('0x129')](_0x7c338d[_0x8b13('0x72')][_0x8b13('0x106')],_[_0x8b13('0x107')](_0x7c338d[_0x8b13('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x50bf52,null))[_0x8b13('0x66')](handleError(_0x50bf52,null));};exports[_0x8b13('0x111')]=function(_0x2d15be,_0x393e7e){var _0x3a0822={};var _0x5e49c9={};var _0x18a6ad;var _0x9c9c4;return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x2d15be[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x393e7e,null))[_0x8b13('0x1d')](function(_0x3e4da0){if(_0x3e4da0){_0x18a6ad=_0x3e4da0;_0x5e49c9[_0x8b13('0x47')]=_[_0x8b13('0x52')](db[_0x8b13('0x12b')][_0x8b13('0x4e')]);_0x5e49c9[_0x8b13('0x51')]=_['keys'](_0x2d15be['query']);_0x5e49c9['filters']=_['intersection'](_0x5e49c9['model'],_0x5e49c9[_0x8b13('0x51')]);_0x3a0822['attributes']=_[_0x8b13('0x53')](_0x5e49c9[_0x8b13('0x47')],qs['fields'](_0x2d15be['query']['fields']));_0x3a0822[_0x8b13('0x54')]=_0x3a0822[_0x8b13('0x54')]['length']?_0x3a0822['attributes']:_0x5e49c9['model'];_0x3a0822[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x2d15be[_0x8b13('0x51')]['sort']);_0x3a0822['where']=qs['filters'](_[_0x8b13('0x5c')](_0x2d15be[_0x8b13('0x51')],_0x5e49c9[_0x8b13('0x5d')]));if(_0x2d15be[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x3a0822[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0x3a0822[_0x8b13('0x5b')],{'$or':_[_0x8b13('0x4c')](_0x3a0822[_0x8b13('0x54')],function(_0x4f5f8d){var _0x438b94={};_0x438b94[_0x4f5f8d]={'$like':'%'+_0x2d15be[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x438b94;})});}_0x3a0822=_[_0x8b13('0x5f')]({},_0x3a0822,_0x2d15be[_0x8b13('0x61')]);return _0x18a6ad[_0x8b13('0x111')](_0x3a0822);}})['then'](function(_0x220af3){if(_0x220af3){_0x9c9c4=_0x220af3[_0x8b13('0x56')];if(!_0x2d15be[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0x3a0822['limit']=qs[_0x8b13('0x2d')](_0x2d15be[_0x8b13('0x51')][_0x8b13('0x2d')]);_0x3a0822[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0x2d15be['query'][_0x8b13('0x2a')]);}return _0x18a6ad[_0x8b13('0x111')](_0x3a0822);}})[_0x8b13('0x1d')](function(_0x29b91b){if(_0x29b91b){return _0x29b91b?{'count':_0x9c9c4,'rows':_0x29b91b}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x393e7e,null))['catch'](handleError(_0x393e7e,null));};exports[_0x8b13('0x12c')]=function(_0x5d1b47,_0x545e66){var _0x531a35=_0x5d1b47[_0x8b13('0x51')][_0x8b13('0x12d')]===_0x8b13('0x12e')?_0x8b13('0x12f'):_0x8b13('0x130');return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'attributes':['id',_0x531a35],'where':{'id':_0x5d1b47[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x545e66,null))[_0x8b13('0x1d')](function(_0x118f07){if(_0x118f07){var _0x3cc93f=_0x118f07[_0x531a35];var _0x436d82=_0x3cc93f&&_0x3cc93f[_0x8b13('0x131')]?_0x3cc93f['items']:[];_0x545e66[_0x8b13('0x37')]({'fromKey':_[_0x8b13('0x90')](_0x3cc93f[_0x8b13('0x132')])?undefined:_0x3cc93f['fromKey'],'count':_0x436d82['length'],'rows':_0x436d82});}})[_0x8b13('0x66')](handleError(_0x545e66,null));};exports[_0x8b13('0x133')]=function(_0x5e0767,_0x3dc6f2){var _0xd2411f={'raw':![],'where':{}};var _0x34f260={};var _0x22e6bd={'count':0x0,'rows':[]};return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x5e0767[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x3dc6f2,null))['then'](function(_0x411ee5){if(_0x411ee5){_0x34f260[_0x8b13('0x47')]=_[_0x8b13('0x52')](db[_0x8b13('0xe6')][_0x8b13('0x4e')]);_0x34f260[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0x5e0767[_0x8b13('0x51')]);_0x34f260[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x34f260[_0x8b13('0x47')],_0x34f260[_0x8b13('0x51')]);_0xd2411f[_0x8b13('0x54')]=_['intersection'](_0x34f260['model'],qs[_0x8b13('0x55')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x55')]));_0xd2411f[_0x8b13('0x54')]=_0xd2411f[_0x8b13('0x54')][_0x8b13('0x56')]?_0xd2411f['attributes']:_0x34f260[_0x8b13('0x47')];if(!_0x5e0767[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0xd2411f['limit']=qs[_0x8b13('0x2d')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x2d')]);_0xd2411f[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x2a')]);}_0xd2411f[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x5a')]);_0xd2411f['where']=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x5e0767[_0x8b13('0x51')],_0x34f260[_0x8b13('0x5d')]));_0xd2411f[_0x8b13('0x5b')][_0x8b13('0x7a')]=_0x411ee5['id'];if(_0x5e0767[_0x8b13('0x51')][_0x8b13('0x5e')]){_0xd2411f[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0xd2411f['where'],{'$or':_[_0x8b13('0x4c')](_0xd2411f[_0x8b13('0x54')],function(_0x419f85){var _0x3b62e4={};_0x3b62e4[_0x419f85]={'$like':'%'+_0x5e0767[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x3b62e4;})});}_0xd2411f=_[_0x8b13('0x5f')]({},_0xd2411f,_0x5e0767[_0x8b13('0x61')]);return db[_0x8b13('0xe6')]['count']({'where':_0xd2411f[_0x8b13('0x5b')]})['then'](function(_0xc5960e){_0x22e6bd[_0x8b13('0x2c')]=_0xc5960e;if(_0x5e0767[_0x8b13('0x51')]['includeAll']){_0xd2411f[_0x8b13('0x63')]=[{'all':!![]}];}else{_0xd2411f[_0x8b13('0x63')]=[{'model':db['CmContact'],'as':_0x8b13('0x109'),'required':![]},{'model':db[_0x8b13('0xef')],'as':'Attachments','required':![]}];}return db[_0x8b13('0xe6')]['findAll'](_0xd2411f);})['then'](function(_0x25d83b){_0x22e6bd[_0x8b13('0x65')]=_0x25d83b;return _0x22e6bd;});}})[_0x8b13('0x1d')](respondWithFilteredResult(_0x3dc6f2,_0xd2411f))[_0x8b13('0x66')](handleError(_0x3dc6f2,null));};exports[_0x8b13('0x134')]=function(_0xc43aba,_0x1c68da){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0xc43aba[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x1c68da,null))[_0x8b13('0x1d')](function(_0xf3e201){if(_0xf3e201){return _0xf3e201[_0x8b13('0x134')](_0xc43aba['body'][_0x8b13('0x106')],_['omit'](_0xc43aba['body'],[_0x8b13('0x106'),'id'])||{})[_0x8b13('0x135')](function(_0x559cdf){for(var _0x1f2a30=0x0;_0x1f2a30<_0xc43aba[_0x8b13('0x72')][_0x8b13('0x106')][_0x8b13('0x56')];_0x1f2a30+=0x1){socket[_0x8b13('0x136')](_0x8b13('0x137'),{'UserId':Number(_0xc43aba[_0x8b13('0x72')]['ids'][_0x1f2a30]),'ChatWebsiteId':Number(_0xc43aba[_0x8b13('0x68')]['id'])});}return _0x559cdf;});}})['then'](respondWithResult(_0x1c68da,null))[_0x8b13('0x66')](handleError(_0x1c68da,null));};exports[_0x8b13('0x138')]=function(_0x5d245e,_0x2b4de7){return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x5d245e[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x2b4de7,null))[_0x8b13('0x1d')](function(_0x51e2da){if(_0x51e2da){return _0x51e2da['removeAgents'](_0x5d245e[_0x8b13('0x51')][_0x8b13('0x106')])['then'](function(){if(_[_0x8b13('0x139')](_0x5d245e['query']['ids'])){for(var _0x5827ee=0x0;_0x5827ee<_0x5d245e[_0x8b13('0x51')]['ids'][_0x8b13('0x56')];_0x5827ee+=0x1){socket[_0x8b13('0x136')](_0x8b13('0x13a'),{'UserId':Number(_0x5d245e[_0x8b13('0x51')][_0x8b13('0x106')][_0x5827ee]),'ChatWebsiteId':Number(_0x5d245e[_0x8b13('0x68')]['id'])});}}else{socket['emit'](_0x8b13('0x13a'),{'UserId':Number(_0x5d245e[_0x8b13('0x51')][_0x8b13('0x106')]),'ChatWebsiteId':Number(_0x5d245e[_0x8b13('0x68')]['id'])});}});}})['then'](respondWithStatusCode(_0x2b4de7,null))[_0x8b13('0x66')](handleError(_0x2b4de7,null));};exports['getAgents']=function(_0x703e,_0x326163){var _0x503451={};var _0x21dedb={};var _0x50e0b8;var _0x555589;return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x703e[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x326163,null))[_0x8b13('0x1d')](function(_0x36cbd3){if(_0x36cbd3){_0x50e0b8=_0x36cbd3;_0x21dedb[_0x8b13('0x47')]=_[_0x8b13('0x52')](db['User'][_0x8b13('0x4e')]);_0x21dedb['query']=_[_0x8b13('0x52')](_0x703e[_0x8b13('0x51')]);_0x21dedb[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x21dedb[_0x8b13('0x47')],_0x21dedb['query']);_0x503451[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x21dedb[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x703e['query'][_0x8b13('0x55')]));_0x503451[_0x8b13('0x54')]=_0x503451['attributes']['length']?_0x503451[_0x8b13('0x54')]:_0x21dedb[_0x8b13('0x47')];_0x503451['order']=qs[_0x8b13('0x5a')](_0x703e[_0x8b13('0x51')][_0x8b13('0x5a')]);_0x503451[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x703e[_0x8b13('0x51')],_0x21dedb['filters']));if(_0x703e[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x503451['where']=_[_0x8b13('0x5f')](_0x503451[_0x8b13('0x5b')],{'$or':_['map'](_0x503451['attributes'],function(_0x5e3ec8){var _0x24c28c={};_0x24c28c[_0x5e3ec8]={'$like':'%'+_0x703e[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x24c28c;})});}_0x503451=_[_0x8b13('0x5f')]({},_0x503451,_0x703e[_0x8b13('0x61')]);return _0x50e0b8[_0x8b13('0x13b')](_0x503451);}})[_0x8b13('0x1d')](function(_0xe679a3){if(_0xe679a3){_0x555589=_0xe679a3['length'];if(!_0x703e[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0x503451[_0x8b13('0x2d')]=qs[_0x8b13('0x2d')](_0x703e[_0x8b13('0x51')][_0x8b13('0x2d')]);_0x503451[_0x8b13('0x2a')]=qs['offset'](_0x703e[_0x8b13('0x51')][_0x8b13('0x2a')]);}return _0x50e0b8[_0x8b13('0x13b')](_0x503451);}})[_0x8b13('0x1d')](function(_0x5816cd){if(_0x5816cd){return _0x5816cd?{'count':_0x555589,'rows':_0x5816cd}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x326163,null))[_0x8b13('0x66')](handleError(_0x326163,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 9961da4..3dfa82c 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 _0x56e6=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x5a0583,_0x104158){var _0x16488e=function(_0x45ed90){while(--_0x45ed90){_0x5a0583['push'](_0x5a0583['shift']());}};_0x16488e(++_0x104158);}(_0x56e6,0x6b));var _0x656e=function(_0xbd2a8d,_0x451894){_0xbd2a8d=_0xbd2a8d-0x0;var _0x5dc929=_0x56e6[_0xbd2a8d];return _0x5dc929;};'use strict';var EventEmitter=require(_0x656e('0x0'));var ChatWebsite=require(_0x656e('0x1'))['db'][_0x656e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x656e('0x3')](0x0);var events={'afterCreate':_0x656e('0x4'),'afterUpdate':_0x656e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x40a874){return function(_0x23c947,_0xe7d540,_0x162ffe){ChatWebsiteEvents[_0x656e('0x6')](_0x40a874+':'+_0x23c947['id'],_0x23c947);ChatWebsiteEvents[_0x656e('0x6')](_0x40a874,_0x23c947);_0x162ffe(null);};}for(var e in events){if(events[_0x656e('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x656e('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6a88=['ChatWebsite','setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6a88,0xa9));var _0x86a8=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x6a88[_0x187d80];return _0x498a77;};'use strict';var EventEmitter=require(_0x86a8('0x0'));var ChatWebsite=require(_0x86a8('0x1'))['db'][_0x86a8('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x86a8('0x3')](0x0);var events={'afterCreate':_0x86a8('0x4'),'afterUpdate':_0x86a8('0x5'),'afterDestroy':_0x86a8('0x6')};function emitEvent(_0x510057){return function(_0x21afeb,_0x5aa681,_0x59313b){ChatWebsiteEvents[_0x86a8('0x7')](_0x510057+':'+_0x21afeb['id'],_0x21afeb);ChatWebsiteEvents[_0x86a8('0x7')](_0x510057,_0x21afeb);_0x59313b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x86a8('0x8')](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 4a40114..130377b 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 _0xd85e=['bluebird','request-promise','../../config/environment','./chatWebsite.attributes','define','chat_websites','util','../../config/logger','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd85e,0xde));var _0xed85=function(_0x3212a3,_0x59fba4){_0x3212a3=_0x3212a3-0x0;var _0x52275=_0xd85e[_0x3212a3];return _0x52275;};'use strict';var _=require('lodash');var util=require(_0xed85('0x0'));var logger=require(_0xed85('0x1'))('api');var moment=require(_0xed85('0x2'));var BPromise=require(_0xed85('0x3'));var rp=require(_0xed85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed85('0x5'));var attributes=require(_0xed85('0x6'));module['exports']=function(_0x4d9fa8,_0x49bed0){return _0x4d9fa8[_0xed85('0x7')]('ChatWebsite',attributes,{'tableName':_0xed85('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bb6=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x1be72f,_0x50ca93){var _0xbfdb40=function(_0x572568){while(--_0x572568){_0x1be72f['push'](_0x1be72f['shift']());}};_0xbfdb40(++_0x50ca93);}(_0x4bb6,0x1e5));var _0x64bb=function(_0xe069b2,_0x1259a5){_0xe069b2=_0xe069b2-0x0;var _0x4a9d61=_0x4bb6[_0xe069b2];return _0x4a9d61;};'use strict';var _=require(_0x64bb('0x0'));var util=require(_0x64bb('0x1'));var logger=require('../../config/logger')(_0x64bb('0x2'));var moment=require('moment');var BPromise=require(_0x64bb('0x3'));var rp=require(_0x64bb('0x4'));var fs=require('fs');var path=require(_0x64bb('0x5'));var rimraf=require(_0x64bb('0x6'));var config=require(_0x64bb('0x7'));var attributes=require(_0x64bb('0x8'));module[_0x64bb('0x9')]=function(_0x1422eb,_0x5cdff5){return _0x1422eb[_0x64bb('0xa')](_0x64bb('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 6ee51d7..f38c4d3 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 _0x2259=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x2259,0x1c7));var _0x9225=function(_0x3927f9,_0x547878){_0x3927f9=_0x3927f9-0x0;var _0x8fae7d=_0x2259[_0x3927f9];return _0x8fae7d;};'use strict';var _=require('lodash');var util=require(_0x9225('0x0'));var moment=require(_0x9225('0x1'));var BPromise=require(_0x9225('0x2'));var rs=require(_0x9225('0x3'));var fs=require('fs');var Redis=require(_0x9225('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9225('0x5'));var logger=require(_0x9225('0x6'))(_0x9225('0x7'));var config=require(_0x9225('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9225('0x9')]['http']({'port':0x232a});config[_0x9225('0xa')]=_[_0x9225('0xb')](config[_0x9225('0xa')],{'host':_0x9225('0xc'),'port':0x18eb});var socket=require(_0x9225('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x9225('0xe')](socket);function respondWithRpcPromise(_0x59a5a7,_0x1605cc,_0xaef688){return new BPromise(function(_0x5f1ec3,_0x3084b1){return client[_0x9225('0xf')](_0x59a5a7,_0xaef688)[_0x9225('0x10')](function(_0x5580bb){logger[_0x9225('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x1605cc,_0x9225('0x12'));logger[_0x9225('0x13')](_0x9225('0x14'),_0x1605cc,_0x9225('0x12'),JSON[_0x9225('0x15')](_0x5580bb));if(_0x5580bb['error']){if(_0x5580bb['error'][_0x9225('0x16')]===0x1f4){logger[_0x9225('0x17')](_0x9225('0x18'),_0x1605cc,_0x5580bb[_0x9225('0x17')][_0x9225('0x19')]);return _0x3084b1(_0x5580bb['error'][_0x9225('0x19')]);}logger['error'](_0x9225('0x18'),_0x1605cc,_0x5580bb[_0x9225('0x17')][_0x9225('0x19')]);return _0x5f1ec3(_0x5580bb['error'][_0x9225('0x19')]);}else{logger['info'](_0x9225('0x18'),_0x1605cc,_0x9225('0x12'));_0x5f1ec3(_0x5580bb[_0x9225('0x1a')][_0x9225('0x19')]);}})['catch'](function(_0xd90ed2){logger[_0x9225('0x17')](_0x9225('0x18'),_0x1605cc,_0xd90ed2);_0x3084b1(_0xd90ed2);});});}
\ No newline at end of file
+var _0x36bc=['register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x2dc2f9,_0x3f3394){var _0x7f9396=function(_0x38d080){while(--_0x38d080){_0x2dc2f9['push'](_0x2dc2f9['shift']());}};_0x7f9396(++_0x3f3394);}(_0x36bc,0xd1));var _0xc36b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x36bc[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xc36b('0x0'));var util=require(_0xc36b('0x1'));var moment=require(_0xc36b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc36b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc36b('0x4'));var config=require(_0xc36b('0x5'));var jayson=require(_0xc36b('0x6'));var client=jayson[_0xc36b('0x7')][_0xc36b('0x8')]({'port':0x232a});config[_0xc36b('0x9')]=_['defaults'](config['redis'],{'host':_0xc36b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc36b('0x9')]));require('./chatWebsite.socket')[_0xc36b('0xb')](socket);function respondWithRpcPromise(_0xe1f33c,_0x406b10,_0x4e4336){return new BPromise(function(_0x1a2df1,_0x3e8083){return client[_0xc36b('0xc')](_0xe1f33c,_0x4e4336)[_0xc36b('0xd')](function(_0xbfaa78){logger['info'](_0xc36b('0xe'),_0x406b10,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x406b10,_0xc36b('0xf'),JSON[_0xc36b('0x10')](_0xbfaa78));if(_0xbfaa78[_0xc36b('0x11')]){if(_0xbfaa78['error'][_0xc36b('0x12')]===0x1f4){logger[_0xc36b('0x11')](_0xc36b('0xe'),_0x406b10,_0xbfaa78[_0xc36b('0x11')][_0xc36b('0x13')]);return _0x3e8083(_0xbfaa78['error'][_0xc36b('0x13')]);}logger[_0xc36b('0x11')](_0xc36b('0xe'),_0x406b10,_0xbfaa78[_0xc36b('0x11')]['message']);return _0x1a2df1(_0xbfaa78[_0xc36b('0x11')]['message']);}else{logger[_0xc36b('0x14')](_0xc36b('0xe'),_0x406b10,_0xc36b('0xf'));_0x1a2df1(_0xbfaa78[_0xc36b('0x15')]['message']);}})['catch'](function(_0x18a54d){logger[_0xc36b('0x11')](_0xc36b('0xe'),_0x406b10,_0x18a54d);_0x3e8083(_0x18a54d);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d1a8d79..85c0951 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 _0x46f7=['length','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46f7,0x16a));var _0x746f=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x46f7[_0x2b4411];return _0x8e41ef;};'use strict';var ChatWebsiteEvents=require(_0x746f('0x0'));var events=[_0x746f('0x1'),_0x746f('0x2'),_0x746f('0x3')];function createListener(_0x1df0c6,_0x4bd309){return function(_0x3a96ef){_0x4bd309['emit'](_0x1df0c6,_0x3a96ef);};}function removeListener(_0x4efe61,_0x4b7bcd){return function(){ChatWebsiteEvents[_0x746f('0x4')](_0x4efe61,_0x4b7bcd);};}exports[_0x746f('0x5')]=function(_0x7673d0){for(var _0xe5da01=0x0,_0x421875=events[_0x746f('0x6')];_0xe5da01<_0x421875;_0xe5da01++){var _0x29ad43=events[_0xe5da01];var _0x2f90f8=createListener(_0x746f('0x7')+_0x29ad43,_0x7673d0);ChatWebsiteEvents['on'](_0x29ad43,_0x2f90f8);}};
\ No newline at end of file
+var _0x2016=['register','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x1a9cd8,_0x2d4348){var _0x4fcb0b=function(_0x356822){while(--_0x356822){_0x1a9cd8['push'](_0x1a9cd8['shift']());}};_0x4fcb0b(++_0x2d4348);}(_0x2016,0xb2));var _0x6201=function(_0x592db3,_0x4ad1f9){_0x592db3=_0x592db3-0x0;var _0x2320e7=_0x2016[_0x592db3];return _0x2320e7;};'use strict';var ChatWebsiteEvents=require(_0x6201('0x0'));var events=[_0x6201('0x1'),_0x6201('0x2'),_0x6201('0x3')];function createListener(_0x2d28e7,_0x32e72d){return function(_0x2abacd){_0x32e72d[_0x6201('0x4')](_0x2d28e7,_0x2abacd);};}function removeListener(_0x271273,_0x2e896f){return function(){ChatWebsiteEvents[_0x6201('0x5')](_0x271273,_0x2e896f);};}exports[_0x6201('0x6')]=function(_0xe0cf3d){for(var _0xcc2881=0x0,_0x3302c0=events['length'];_0xcc2881<_0x3302c0;_0xcc2881++){var _0x4e4540=events[_0xcc2881];var _0xa1b91c=createListener(_0x6201('0x7')+_0x4e4540,_0xe0cf3d);ChatWebsiteEvents['on'](_0x4e4540,_0xa1b91c);}};
\ 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 bea9790..dcc5042 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 _0x1280=['replace','localhost','test','([\x5cw]+)','../../../utils/misc','url','URL'];(function(_0x300860,_0x509371){var _0x2094ad=function(_0x2090a2){while(--_0x2090a2){_0x300860['push'](_0x300860['shift']());}};_0x2094ad(++_0x509371);}(_0x1280,0xac));var _0x0128=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x1280[_0x559a80];return _0x42f555;};var escapeRegExp=require(_0x0128('0x0'))['escapeRegExp'];var URL=require(_0x0128('0x1'))[_0x0128('0x2')];function testWildcardValidity(_0x80931f){var _0xf0c1aa=!![];try{new URL(_0x80931f[_0x0128('0x3')]('*',_0x0128('0x4')));}catch(_0x4bd1f3){_0xf0c1aa=![];}return _0xf0c1aa&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0128('0x5')](_0x80931f);}function testWebsiteWithWildcard(_0x30da23,_0xa65596){var _0x2631a2;var _0x4aa391=escapeRegExp(_0x30da23['trim']()[_0x0128('0x3')](/\/$/,''))[_0x0128('0x3')]('\x5c*',_0x0128('0x6'));try{new URL(_0x30da23[_0x0128('0x3')]('\x5c*','localhost'));_0x2631a2=new RegExp(_0x4aa391)[_0x0128('0x5')](_0xa65596);}catch(_0x2fa9cb){_0x2631a2=![];}return _0x2631a2;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x1ab1=['URL','localhost','test','trim','replace','([\x5cw]+)','../../../utils/misc'];(function(_0x4faa2c,_0x2d8ecd){var _0x32514d=function(_0x418f7b){while(--_0x418f7b){_0x4faa2c['push'](_0x4faa2c['shift']());}};_0x32514d(++_0x2d8ecd);}(_0x1ab1,0x12c));var _0x11ab=function(_0x394729,_0x3c0b55){_0x394729=_0x394729-0x0;var _0x1b4e61=_0x1ab1[_0x394729];return _0x1b4e61;};var escapeRegExp=require(_0x11ab('0x0'))['escapeRegExp'];var URL=require('url')[_0x11ab('0x1')];function testWildcardValidity(_0x49ed3f){var _0x593928=!![];try{new URL(_0x49ed3f['replace']('*',_0x11ab('0x2')));}catch(_0x4a6492){_0x593928=![];}return _0x593928&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x11ab('0x3')](_0x49ed3f);}function testWebsiteWithWildcard(_0x363103,_0x1edb9b){var _0x1399f4;var _0x5758c5=escapeRegExp(_0x363103[_0x11ab('0x4')]()[_0x11ab('0x5')](/\/$/,''))[_0x11ab('0x5')]('\x5c*',_0x11ab('0x6'));try{new URL(_0x363103[_0x11ab('0x5')]('\x5c*',_0x11ab('0x2')));_0x1399f4=new RegExp(_0x5758c5)['test'](_0x1edb9b);}catch(_0x1abc4e){_0x1399f4=![];}return _0x1399f4;}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 fbf616d..47a65c7 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 _0xb27c=['/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/applications','getApplications','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','/:id/logo','single','addLogo','file','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','getDispositions'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb27c,0x14f));var _0xcb27=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb27c[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xcb27('0x0'));var util=require(_0xcb27('0x1'));var path=require(_0xcb27('0x2'));var timeout=require(_0xcb27('0x3'));var express=require('express');var router=express[_0xcb27('0x4')]();var fs_extra=require(_0xcb27('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb27('0x6'));var config=require('../../config/environment');var controller=require(_0xcb27('0x7'));router['get']('/',auth[_0xcb27('0x8')](),controller[_0xcb27('0x9')]);router[_0xcb27('0xa')](_0xcb27('0xb'),auth[_0xcb27('0x8')](),controller[_0xcb27('0xc')]);router['get'](_0xcb27('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0xcb27('0x8')](),controller[_0xcb27('0xe')]);router[_0xcb27('0xa')](_0xcb27('0xf'),auth[_0xcb27('0x8')](),controller['getAnswers']);router[_0xcb27('0xa')]('/:id/logo',controller[_0xcb27('0x10')]);router[_0xcb27('0xa')](_0xcb27('0x11'),controller[_0xcb27('0x12')]);router['get'](_0xcb27('0x13'),controller[_0xcb27('0x14')]);router[_0xcb27('0xa')](_0xcb27('0x15'),controller['getSystemAvatar']);router[_0xcb27('0xa')](_0xcb27('0x16'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x17')]);router[_0xcb27('0xa')]('/:id/snippet',controller['getSnippet']);router['get'](_0xcb27('0x18'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x19')]);router[_0xcb27('0xa')]('/:id/proactive_actions',auth[_0xcb27('0x8')](),controller['getProactiveActions']);router[_0xcb27('0xa')]('/:id/fields',controller[_0xcb27('0x1a')]);router[_0xcb27('0xa')](_0xcb27('0x1b'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x1c')]);router[_0xcb27('0xa')](_0xcb27('0x1d'),auth['isAuthenticated'](),controller[_0xcb27('0x1e')]);router['post']('/',auth[_0xcb27('0x8')](),controller['create']);router[_0xcb27('0x1f')]('/:id/dispositions',auth[_0xcb27('0x8')](),controller[_0xcb27('0x20')]);router[_0xcb27('0x1f')](_0xcb27('0xf'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x21')]);var upload=multer({'storage':multer[_0xcb27('0x22')]({'destination':function(_0x13051d,_0x10a496,_0x16b8c8){_0x16b8c8(null,path[_0xcb27('0x23')](config[_0xcb27('0x24')],'server/files/images/logos/'));},'filename':function(_0x48f5cd,_0x16a919,_0x38352f){_0x38352f(null,util[_0xcb27('0x25')](_0xcb27('0x26'),Date[_0xcb27('0x27')](),_0x16a919[_0xcb27('0x28')]));}})});router[_0xcb27('0x1f')](_0xcb27('0x29'),upload[_0xcb27('0x2a')]('file'),controller[_0xcb27('0x2b')]);var upload=multer({'storage':multer[_0xcb27('0x22')]({'destination':function(_0x46eed7,_0x2ceb6a,_0x42a740){_0x42a740(null,path[_0xcb27('0x23')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x29d42c,_0x324b6d,_0x28dd37){_0x28dd37(null,util[_0xcb27('0x25')](_0xcb27('0x26'),Date['now'](),_0x324b6d[_0xcb27('0x28')]));}})});router[_0xcb27('0x1f')]('/:id/avatar',upload[_0xcb27('0x2a')](_0xcb27('0x2c')),controller[_0xcb27('0x2d')]);var upload=multer({'storage':multer[_0xcb27('0x22')]({'destination':function(_0x399159,_0x5301f7,_0x55ac68){_0x55ac68(null,path[_0xcb27('0x23')](config[_0xcb27('0x24')],_0xcb27('0x2e')));},'filename':function(_0x55e4f5,_0x2b26ec,_0x298a94){_0x298a94(null,util[_0xcb27('0x25')](_0xcb27('0x26'),Date[_0xcb27('0x27')](),_0x2b26ec['originalname']));}})});router[_0xcb27('0x1f')](_0xcb27('0x13'),upload['single'](_0xcb27('0x2c')),controller[_0xcb27('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d1d20,_0x2fa236,_0x39d75a){_0x39d75a(null,path[_0xcb27('0x23')](config[_0xcb27('0x24')],_0xcb27('0x2e')));},'filename':function(_0xb3aa11,_0x5d3abd,_0x529f9e){_0x529f9e(null,util[_0xcb27('0x25')]('%s-%s',Date[_0xcb27('0x27')](),_0x5d3abd[_0xcb27('0x28')]));}})});router['post'](_0xcb27('0x15'),upload['single'](_0xcb27('0x2c')),controller[_0xcb27('0x30')]);router[_0xcb27('0x1f')](_0xcb27('0x31'),controller[_0xcb27('0x32')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x193ae3,_0x1cd384,_0x3c64a7){const _0x204788=path[_0xcb27('0x23')](config[_0xcb27('0x24')],_0xcb27('0x33'),_0xcb27('0x34'),_0xcb27('0x35'));fs_extra[_0xcb27('0x36')](_0x204788,function(){_0x3c64a7(null,_0x204788);});},'filename':function(_0x40308c,_0x407b97,_0x48bc5d){const _0x2e3432=_0x407b97['originalname'][_0xcb27('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b2c26=path[_0xcb27('0x38')](_0x2e3432);const _0x7c1984=Date[_0xcb27('0x27')]()+'-'+_0x2e3432[_0xcb27('0x37')](_0x5b2c26,'')+_0x5b2c26;_0x48bc5d(null,_0x7c1984);}})});router[_0xcb27('0x1f')]('/:id/offline',offlineUploadMulter[_0xcb27('0x39')](),controller[_0xcb27('0x3a')]);router[_0xcb27('0x1f')](_0xcb27('0x16'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x3b')]);router[_0xcb27('0x1f')](_0xcb27('0x18'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x3c')]);router[_0xcb27('0x1f')](_0xcb27('0x3d'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x3e')]);router['post'](_0xcb27('0x1d'),auth[_0xcb27('0x8')](),controller[_0xcb27('0x3f')]);router['put']('/:id',auth[_0xcb27('0x8')](),controller[_0xcb27('0x40')]);router[_0xcb27('0x41')](_0xcb27('0xd'),auth[_0xcb27('0x8')](),controller['destroy']);router[_0xcb27('0x41')]('/:id/dispositions',auth[_0xcb27('0x8')](),controller[_0xcb27('0x42')]);router[_0xcb27('0x41')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xcb27('0x43')]);router[_0xcb27('0x41')]('/:id/users',auth[_0xcb27('0x8')](),controller[_0xcb27('0x44')]);module[_0xcb27('0x45')]=router;
\ No newline at end of file
+var _0x405b=['/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','format','%s-%s','now','originalname','single','file','diskStorage','join','root','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5af39d,_0x3944b5){var _0x4a8b97=function(_0x22936e){while(--_0x22936e){_0x5af39d['push'](_0x5af39d['shift']());}};_0x4a8b97(++_0x3944b5);}(_0x405b,0x80));var _0xb405=function(_0x27eab3,_0x751481){_0x27eab3=_0x27eab3-0x0;var _0x25802f=_0x405b[_0x27eab3];return _0x25802f;};'use strict';var multer=require('multer');var util=require(_0xb405('0x0'));var path=require(_0xb405('0x1'));var timeout=require(_0xb405('0x2'));var express=require('express');var router=express[_0xb405('0x3')]();var fs_extra=require(_0xb405('0x4'));var auth=require(_0xb405('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb405('0x6'));var controller=require('./chatWebsite.controller');router[_0xb405('0x7')]('/',auth[_0xb405('0x8')](),controller[_0xb405('0x9')]);router[_0xb405('0x7')](_0xb405('0xa'),auth[_0xb405('0x8')](),controller['describe']);router[_0xb405('0x7')]('/:id',auth[_0xb405('0x8')](),controller[_0xb405('0xb')]);router[_0xb405('0x7')](_0xb405('0xc'),auth[_0xb405('0x8')](),controller[_0xb405('0xd')]);router[_0xb405('0x7')](_0xb405('0xe'),auth[_0xb405('0x8')](),controller[_0xb405('0xf')]);router[_0xb405('0x7')](_0xb405('0x10'),controller[_0xb405('0x11')]);router[_0xb405('0x7')](_0xb405('0x12'),controller[_0xb405('0x13')]);router[_0xb405('0x7')](_0xb405('0x14'),controller['getCustomerAvatar']);router[_0xb405('0x7')](_0xb405('0x15'),controller[_0xb405('0x16')]);router[_0xb405('0x7')](_0xb405('0x17'),auth[_0xb405('0x8')](),controller[_0xb405('0x18')]);router[_0xb405('0x7')](_0xb405('0x19'),controller[_0xb405('0x1a')]);router[_0xb405('0x7')](_0xb405('0x1b'),auth[_0xb405('0x8')](),controller['getApplications']);router[_0xb405('0x7')](_0xb405('0x1c'),auth[_0xb405('0x8')](),controller[_0xb405('0x1d')]);router['get'](_0xb405('0x1e'),controller['getFields']);router[_0xb405('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xb405('0x1f')]);router[_0xb405('0x7')](_0xb405('0x20'),auth[_0xb405('0x8')](),controller['getAgents']);router[_0xb405('0x21')]('/',auth[_0xb405('0x8')](),controller[_0xb405('0x22')]);router['post'](_0xb405('0xc'),auth['isAuthenticated'](),controller[_0xb405('0x23')]);router[_0xb405('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb405('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d4ce4,_0x1e36f5,_0x20eb1a){_0x20eb1a(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0xe764,_0xafaf79,_0x26d092){_0x26d092(null,util[_0xb405('0x25')](_0xb405('0x26'),Date[_0xb405('0x27')](),_0xafaf79[_0xb405('0x28')]));}})});router[_0xb405('0x21')](_0xb405('0x10'),upload[_0xb405('0x29')](_0xb405('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0xc99531,_0x503c4e,_0x31101d){_0x31101d(null,path[_0xb405('0x2c')](config[_0xb405('0x2d')],_0xb405('0x2e')));},'filename':function(_0x1d192e,_0x322fec,_0x4ff3f5){_0x4ff3f5(null,util[_0xb405('0x25')]('%s-%s',Date[_0xb405('0x27')](),_0x322fec[_0xb405('0x28')]));}})});router[_0xb405('0x21')](_0xb405('0x12'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0x4c1b16,_0x511a09,_0x57ec9b){_0x57ec9b(null,path[_0xb405('0x2c')](config[_0xb405('0x2d')],_0xb405('0x2e')));},'filename':function(_0x59b499,_0x343604,_0x29f4c9){_0x29f4c9(null,util[_0xb405('0x25')](_0xb405('0x26'),Date[_0xb405('0x27')](),_0x343604[_0xb405('0x28')]));}})});router['post'](_0xb405('0x14'),upload['single'](_0xb405('0x2a')),controller[_0xb405('0x2f')]);var upload=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0x2e2189,_0x5329d0,_0x2e5f02){_0x2e5f02(null,path[_0xb405('0x2c')](config[_0xb405('0x2d')],_0xb405('0x2e')));},'filename':function(_0x5630c0,_0x639e64,_0x258808){_0x258808(null,util[_0xb405('0x25')](_0xb405('0x26'),Date[_0xb405('0x27')](),_0x639e64['originalname']));}})});router['post']('/:id/system_avatar',upload['single']('file'),controller[_0xb405('0x30')]);router[_0xb405('0x21')](_0xb405('0x31'),controller[_0xb405('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0x1beb74,_0x282f11,_0x85be36){const _0x5202d1=path['join'](config[_0xb405('0x2d')],_0xb405('0x33'),_0xb405('0x34'),_0xb405('0x35'));fs_extra[_0xb405('0x36')](_0x5202d1,function(){_0x85be36(null,_0x5202d1);});},'filename':function(_0x5232e4,_0xb96436,_0x2915df){const _0x5ca3ef=_0xb96436[_0xb405('0x28')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x150368=path[_0xb405('0x37')](_0x5ca3ef);const _0x410c9d=Date[_0xb405('0x27')]()+'-'+_0x5ca3ef[_0xb405('0x38')](_0x150368,'')+_0x150368;_0x2915df(null,_0x410c9d);}})});router[_0xb405('0x21')]('/:id/offline',offlineUploadMulter[_0xb405('0x39')](),controller[_0xb405('0x3a')]);router[_0xb405('0x21')]('/:id/interactions',auth[_0xb405('0x8')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0xb405('0x8')](),controller[_0xb405('0x3b')]);router[_0xb405('0x21')]('/:id/proactive_actions',auth[_0xb405('0x8')](),controller[_0xb405('0x3c')]);router['post'](_0xb405('0x20'),auth[_0xb405('0x8')](),controller['addAgents']);router[_0xb405('0x3d')](_0xb405('0x3e'),auth[_0xb405('0x8')](),controller[_0xb405('0x3f')]);router[_0xb405('0x40')]('/:id',auth[_0xb405('0x8')](),controller[_0xb405('0x41')]);router['delete'](_0xb405('0xc'),auth[_0xb405('0x8')](),controller['removeDispositions']);router[_0xb405('0x40')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb405('0x42')]);router['delete'](_0xb405('0x20'),auth[_0xb405('0x8')](),controller[_0xb405('0x43')]);module[_0xb405('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 4f84595..de9a884 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 _0x03fc=['Router','env','app','get','expressEndpoint','use','isAuthenticated','beaver-logger/server','express','../components/auth/service'];(function(_0x3d8d04,_0x51536b){var _0x43b01a=function(_0x330909){while(--_0x330909){_0x3d8d04['push'](_0x3d8d04['shift']());}};_0x43b01a(++_0x51536b);}(_0x03fc,0xa7));var _0xc03f=function(_0x20db6c,_0x4ff24a){_0x20db6c=_0x20db6c-0x0;var _0x30b5d3=_0x03fc[_0x20db6c];return _0x30b5d3;};var beaverLogger=require(_0xc03f('0x0'));var express=require(_0xc03f('0x1'));var auth=require(_0xc03f('0x2'));var config=require('../config/environment');var router=express[_0xc03f('0x3')]();var isProduction=config[_0xc03f('0x4')]==='production'||![];function clientSideLogs(_0x4c5ced,_0x18a083,_0x3fd4dd){var _0x372de6=_0x4c5ced[_0xc03f('0x5')][_0xc03f('0x6')]('client-side-logger');if(!_0x372de6){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xc03f('0x7')]({'uri':'/client-logs','logger':_0x372de6,'enableCors':!isProduction})(_0x4c5ced,_0x18a083,_0x3fd4dd);}router[_0xc03f('0x8')](auth[_0xc03f('0x9')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x8d85=['../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x4626c2,_0x69aced){var _0x4dec86=function(_0x1a92a9){while(--_0x1a92a9){_0x4626c2['push'](_0x4626c2['shift']());}};_0x4dec86(++_0x69aced);}(_0x8d85,0x16a));var _0x58d8=function(_0x30308a,_0x178f66){_0x30308a=_0x30308a-0x0;var _0x13771c=_0x8d85[_0x30308a];return _0x13771c;};var beaverLogger=require(_0x58d8('0x0'));var express=require(_0x58d8('0x1'));var auth=require('../components/auth/service');var config=require(_0x58d8('0x2'));var router=express[_0x58d8('0x3')]();var isProduction=config[_0x58d8('0x4')]===_0x58d8('0x5')||![];function clientSideLogs(_0x45d62b,_0x3b1476,_0x216962){var _0x3308d0=_0x45d62b[_0x58d8('0x6')][_0x58d8('0x7')](_0x58d8('0x8'));if(!_0x3308d0){throw new Error(_0x58d8('0x9'));}return beaverLogger[_0x58d8('0xa')]({'uri':'/client-logs','logger':_0x3308d0,'enableCors':!isProduction})(_0x45d62b,_0x3b1476,_0x216962);}router['use'](auth[_0x58d8('0xb')](),clientSideLogs);module[_0x58d8('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index d419571..05017ae 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 _0xdae5=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x504b79,_0x4115b0){var _0x10f21a=function(_0x36dcb9){while(--_0x36dcb9){_0x504b79['push'](_0x504b79['shift']());}};_0x10f21a(++_0x4115b0);}(_0xdae5,0xe2));var _0x5dae=function(_0x42c32e,_0x54a035){_0x42c32e=_0x42c32e-0x0;var _0xee9088=_0xdae5[_0x42c32e];return _0xee9088;};'use strict';var Sequelize=require(_0x5dae('0x0'));module['exports']={'name':{'type':Sequelize[_0x5dae('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5dae('0x2')](_0x5dae('0x3'),_0x5dae('0x4'),_0x5dae('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5dae('0x2')](_0x5dae('0x6'),_0x5dae('0x7'))},'data1':{'type':Sequelize[_0x5dae('0x1')],'comment':_0x5dae('0x8')},'data2':{'type':Sequelize[_0x5dae('0x1')],'comment':_0x5dae('0x9')},'data3':{'type':Sequelize[_0x5dae('0x1')],'comment':_0x5dae('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x5dae('0xb')},'data5':{'type':Sequelize[_0x5dae('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x5dae('0xd')},'data7':{'type':Sequelize[_0x5dae('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xcf36=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Dynamics365'];(function(_0x2c0acf,_0x310413){var _0x513851=function(_0x4105b0){while(--_0x4105b0){_0x2c0acf['push'](_0x2c0acf['shift']());}};_0x513851(++_0x310413);}(_0xcf36,0x1b9));var _0x6cf3=function(_0x288522,_0x18a6d8){_0x288522=_0x288522-0x0;var _0x37851f=_0xcf36[_0x288522];return _0x37851f;};'use strict';var Sequelize=require(_0x6cf3('0x0'));module[_0x6cf3('0x1')]={'name':{'type':Sequelize[_0x6cf3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6cf3('0x3')](_0x6cf3('0x4'),_0x6cf3('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6cf3('0x3')]('Outlook365',_0x6cf3('0x6'))},'data1':{'type':Sequelize[_0x6cf3('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x6cf3('0x7')},'data3':{'type':Sequelize[_0x6cf3('0x2')],'comment':_0x6cf3('0x8')},'data4':{'type':Sequelize[_0x6cf3('0x2')],'comment':_0x6cf3('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x6cf3('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0x6cf3('0xb')},'data7':{'type':Sequelize[_0x6cf3('0xc')],'comment':_0x6cf3('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 78848e9..6118190 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 _0xba32=['MicrosoftAzure','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','params','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','base64','toString','ascii','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','limit','count','offset','set','destroy','then','error','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','keys','find'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xba32,0x87));var _0x2ba3=function(_0x155574,_0x4e0b0b){_0x155574=_0x155574-0x0;var _0x56b559=_0xba32[_0x155574];return _0x56b559;};'use strict';var _=require(_0x2ba3('0x0'));var Redis=require(_0x2ba3('0x1'));var qs=require(_0x2ba3('0x2'));var encryptor=require(_0x2ba3('0x3'));var config=require(_0x2ba3('0x4'));var logger=require('../../config/logger')(_0x2ba3('0x5'));var db=require(_0x2ba3('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x2ba3('0x7')]=_[_0x2ba3('0x8')](config[_0x2ba3('0x7')],{'host':_0x2ba3('0x9'),'port':0x18eb});var socket=require(_0x2ba3('0xa'))(new Redis(config[_0x2ba3('0x7')]));var redis=new Redis(config[_0x2ba3('0x7')]);function respondWithStatusCode(_0x14b7d2,_0x31b888){_0x31b888=_0x31b888||0xcc;return function(_0x30b983){if(_0x30b983){return _0x14b7d2[_0x2ba3('0xb')](_0x31b888);}return _0x14b7d2['status'](_0x31b888)[_0x2ba3('0xc')]();};}function respondWithResult(_0xa49de5,_0x30eeee){_0x30eeee=_0x30eeee||0xc8;return function(_0x279ad9){if(_0x279ad9){return _0xa49de5[_0x2ba3('0xd')](_0x30eeee)['json'](_0x279ad9);}};}function respondWithFilteredResult(_0x55fe19,_0x471916){return function(_0x5eb79c){if(_0x5eb79c){var _0x271ede=typeof _0x471916['offset']==='undefined'&&typeof _0x471916[_0x2ba3('0xe')]==='undefined';var _0x29887f=_0x5eb79c[_0x2ba3('0xf')];var _0x5b972b=_0x271ede?0x0:_0x471916[_0x2ba3('0x10')];var _0x146376=_0x271ede?_0x5eb79c[_0x2ba3('0xf')]:_0x471916['offset']+_0x471916[_0x2ba3('0xe')];var _0x4408d4;if(_0x146376>=_0x29887f){_0x146376=_0x29887f;_0x4408d4=0xc8;}else{_0x4408d4=0xce;}_0x55fe19[_0x2ba3('0xd')](_0x4408d4);return _0x55fe19[_0x2ba3('0x11')]('Content-Range',_0x5b972b+'-'+_0x146376+'/'+_0x29887f)['json'](_0x5eb79c);}return null;};}function saveUpdates(_0x415599){return function(_0x283c18){if(_0x283c18){return _0x283c18['update'](_0x415599)['then'](function(_0x35ad80){return _0x35ad80;});}return null;};}function removeEntity(_0x385150){return function(_0x50cf36){if(_0x50cf36){return _0x50cf36[_0x2ba3('0x12')]()[_0x2ba3('0x13')](function(){_0x385150[_0x2ba3('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45814b){return function(_0x48fe2d){if(!_0x48fe2d){_0x45814b[_0x2ba3('0xb')](0x194);}return _0x48fe2d;};}function handleError(_0x42aaac,_0x479a1b){_0x479a1b=_0x479a1b||0x1f4;return function(_0x31173a){logger[_0x2ba3('0x14')](_0x31173a[_0x2ba3('0x15')]);if(_0x31173a[_0x2ba3('0x16')]){delete _0x31173a['name'];}_0x42aaac[_0x2ba3('0xd')](_0x479a1b)[_0x2ba3('0x17')](_0x31173a);};}function maskClientSecret(_0x2c85ff){return _[_0x2ba3('0x18')](_0x2c85ff[_0x2ba3('0x19')](0x0,0x3),0x14,'*');}exports[_0x2ba3('0x1a')]=function(_0x126093,_0x7467a6){var _0x5cd739={},_0x1c018d={},_0x31d24e={'count':0x0,'rows':[]};var _0x164a77=_[_0x2ba3('0x1b')](db['CloudProvider'][_0x2ba3('0x1c')],function(_0x5c8166){return{'name':_0x5c8166[_0x2ba3('0x1d')],'type':_0x5c8166[_0x2ba3('0x1e')][_0x2ba3('0x1f')]};});_0x1c018d[_0x2ba3('0x20')]=_[_0x2ba3('0x1b')](_0x164a77,'name');_0x1c018d[_0x2ba3('0x21')]=_['keys'](_0x126093[_0x2ba3('0x21')]);_0x1c018d[_0x2ba3('0x22')]=_[_0x2ba3('0x23')](_0x1c018d[_0x2ba3('0x20')],_0x1c018d[_0x2ba3('0x21')]);_0x5cd739['attributes']=_[_0x2ba3('0x23')](_0x1c018d[_0x2ba3('0x20')],qs[_0x2ba3('0x24')](_0x126093[_0x2ba3('0x21')][_0x2ba3('0x24')]));_0x5cd739['attributes']=_0x5cd739[_0x2ba3('0x25')][_0x2ba3('0x26')]?_0x5cd739[_0x2ba3('0x25')]:_0x1c018d[_0x2ba3('0x20')];if(!_0x126093[_0x2ba3('0x21')][_0x2ba3('0x27')]('nolimit')){_0x5cd739['limit']=qs['limit'](_0x126093[_0x2ba3('0x21')]['limit']);_0x5cd739[_0x2ba3('0x10')]=qs[_0x2ba3('0x10')](_0x126093[_0x2ba3('0x21')][_0x2ba3('0x10')]);}_0x5cd739[_0x2ba3('0x28')]=qs[_0x2ba3('0x29')](_0x126093[_0x2ba3('0x21')][_0x2ba3('0x29')]);_0x5cd739['where']=qs['filters'](_['pick'](_0x126093[_0x2ba3('0x21')],_0x1c018d['filters']),_0x164a77);if(_0x126093[_0x2ba3('0x21')][_0x2ba3('0x2a')]){_0x5cd739['where']=_[_0x2ba3('0x2b')](_0x5cd739[_0x2ba3('0x2c')],{'$or':_[_0x2ba3('0x1b')](_0x164a77,function(_0x512626){if(_0x512626[_0x2ba3('0x1e')]!==_0x2ba3('0x2d')){var _0x5430ff={};_0x5430ff[_0x512626[_0x2ba3('0x16')]]={'$like':'%'+_0x126093[_0x2ba3('0x21')]['filter']+'%'};return _0x5430ff;}})});}_0x5cd739=_[_0x2ba3('0x2b')]({},_0x5cd739,_0x126093[_0x2ba3('0x2e')]);var _0x5c3d66={'where':_0x5cd739[_0x2ba3('0x2c')]};return db[_0x2ba3('0x2f')][_0x2ba3('0xf')](_0x5c3d66)['then'](function(_0x156c72){_0x31d24e['count']=_0x156c72;if(_0x126093[_0x2ba3('0x21')][_0x2ba3('0x30')]){_0x5cd739[_0x2ba3('0x31')]=[{'all':!![]}];}return db[_0x2ba3('0x2f')][_0x2ba3('0x32')](_0x5cd739);})['then'](function(_0x3a36f0){_0x31d24e[_0x2ba3('0x33')]=_[_0x2ba3('0x1b')](_0x3a36f0,function(_0x346987){if(_0x346987[_0x2ba3('0x34')]==='MicrosoftAzure'){var _0x193379=encryptor[_0x2ba3('0x35')](_0x346987['data3']);_0x346987[_0x2ba3('0x36')]=maskClientSecret(_0x193379);}return _0x346987;});return _0x31d24e;})['then'](respondWithFilteredResult(_0x7467a6,_0x5cd739))[_0x2ba3('0x37')](handleError(_0x7467a6,null));};exports[_0x2ba3('0x38')]=function(_0xc224bf,_0x21f57e){var _0x5d1f03={'raw':!![],'where':{'id':_0xc224bf['params']['id']}},_0x190ca8={};_0x190ca8['model']=_['keys'](db['CloudProvider'][_0x2ba3('0x1c')]);_0x190ca8[_0x2ba3('0x21')]=_[_0x2ba3('0x39')](_0xc224bf[_0x2ba3('0x21')]);_0x190ca8[_0x2ba3('0x22')]=_[_0x2ba3('0x23')](_0x190ca8[_0x2ba3('0x20')],_0x190ca8['query']);_0x5d1f03['attributes']=_['intersection'](_0x190ca8['model'],qs[_0x2ba3('0x24')](_0xc224bf['query'][_0x2ba3('0x24')]));_0x5d1f03['attributes']=_0x5d1f03[_0x2ba3('0x25')]['length']?_0x5d1f03[_0x2ba3('0x25')]:_0x190ca8[_0x2ba3('0x20')];if(_0xc224bf[_0x2ba3('0x21')][_0x2ba3('0x30')]){_0x5d1f03[_0x2ba3('0x31')]=[{'all':!![]}];}_0x5d1f03=_[_0x2ba3('0x2b')]({},_0x5d1f03,_0xc224bf[_0x2ba3('0x2e')]);return db['CloudProvider'][_0x2ba3('0x3a')](_0x5d1f03)[_0x2ba3('0x13')](handleEntityNotFound(_0x21f57e,null))[_0x2ba3('0x13')](function(_0x532dd9){if(_0x532dd9['service']===_0x2ba3('0x3b')){var _0x4fc569=encryptor[_0x2ba3('0x35')](_0x532dd9[_0x2ba3('0x36')]);_0x532dd9[_0x2ba3('0x36')]=maskClientSecret(_0x4fc569);}return _0x532dd9;})['then'](respondWithResult(_0x21f57e,null))['catch'](handleError(_0x21f57e,null));};exports[_0x2ba3('0x3c')]=function(_0x57eeda,_0x3ca4db){if(!_0x57eeda['body'][_0x2ba3('0x16')])throw new Error(_0x2ba3('0x3d'));if(!_0x57eeda[_0x2ba3('0x3e')]['service'])throw new Error(_0x2ba3('0x3f'));var _0x33f1a4=db['CloudProvider'][_0x2ba3('0x1c')]['service'][_0x2ba3('0x40')];if(!_0x33f1a4[_0x2ba3('0x41')](_0x57eeda['body'][_0x2ba3('0x34')]))throw new Error(_0x2ba3('0x42')+_0x33f1a4[_0x2ba3('0x43')](',\x20'));if(_0x57eeda[_0x2ba3('0x3e')][_0x2ba3('0x34')]==='MicrosoftAzure'&&_0x57eeda[_0x2ba3('0x3e')][_0x2ba3('0x36')]){_0x57eeda[_0x2ba3('0x3e')]['data3']=encryptor[_0x2ba3('0x44')](_0x57eeda[_0x2ba3('0x3e')]['data3']);}return db[_0x2ba3('0x2f')][_0x2ba3('0x3c')](_0x57eeda[_0x2ba3('0x3e')],{})[_0x2ba3('0x13')](respondWithResult(_0x3ca4db,0xc9))[_0x2ba3('0x37')](handleError(_0x3ca4db,null));};exports[_0x2ba3('0x45')]=function(_0x46c6c7,_0x3279d0){if(_0x46c6c7[_0x2ba3('0x3e')]['id']){delete _0x46c6c7['body']['id'];}return db[_0x2ba3('0x2f')][_0x2ba3('0x3a')]({'where':{'id':_0x46c6c7['params']['id']}})[_0x2ba3('0x13')](handleEntityNotFound(_0x3279d0,null))[_0x2ba3('0x13')](function(_0x5c4662){if(_0x5c4662[_0x2ba3('0x34')]===_0x2ba3('0x3b')&&_0x46c6c7[_0x2ba3('0x3e')][_0x2ba3('0x36')]){_0x46c6c7['body']['data3']=encryptor[_0x2ba3('0x44')](_0x46c6c7['body'][_0x2ba3('0x36')]);}return _0x5c4662;})[_0x2ba3('0x13')](saveUpdates(_0x46c6c7[_0x2ba3('0x3e')],null))[_0x2ba3('0x13')](respondWithResult(_0x3279d0,null))[_0x2ba3('0x37')](handleError(_0x3279d0,null));};exports[_0x2ba3('0x12')]=function(_0x5b0cae,_0xae7f31){return db[_0x2ba3('0x2f')]['find']({'where':{'id':_0x5b0cae[_0x2ba3('0x46')]['id']}})[_0x2ba3('0x13')](handleEntityNotFound(_0xae7f31,null))['then'](removeEntity(_0xae7f31,null))['catch'](handleError(_0xae7f31,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3be2ed,_0x21b3c3){return db['CloudProvider'][_0x2ba3('0x47')]({'where':{'id':_0x3be2ed[_0x2ba3('0x46')]['id']},'raw':!![]})[_0x2ba3('0x13')](function(_0x52460a){if(!_0x52460a)return _0x21b3c3[_0x2ba3('0xb')](0x194);return{'url':oauth[_0x2ba3('0x48')](_0x52460a,_0x3be2ed[_0x2ba3('0x49')]['id'])};})['then'](respondWithResult(_0x21b3c3,null))[_0x2ba3('0x37')](handleError(_0x21b3c3,null));};exports[_0x2ba3('0x4a')]=function(_0x46ea19,_0xb3df64){var _0x1b013b=_0x46ea19[_0x2ba3('0x3e')];var _0x314d69;var _0x168d9d;if(_0x1b013b[_0x2ba3('0x14')])throw _0x1b013b;redis[_0x2ba3('0x4b')](_0x1b013b['state'])['then'](function(_0x3a6207){if(!_0x3a6207)throw new Error(_0x2ba3('0x4c'));_0x314d69=JSON[_0x2ba3('0x4d')](_0x3a6207);var _0x21a864=Buffer['from'](_0x1b013b[_0x2ba3('0x4e')],_0x2ba3('0x4f'))[_0x2ba3('0x50')](_0x2ba3('0x51'));_0x168d9d=JSON[_0x2ba3('0x4d')](_0x21a864);if(!oauth['isValidIdToken'](_0x1b013b['id_token'],_0x314d69['oauth2Claims']))throw new Error(_0x2ba3('0x52'));redis[_0x2ba3('0x53')](_0x1b013b[_0x2ba3('0x4e')]);return oauth[_0x2ba3('0x54')](_0x1b013b[_0x2ba3('0x55')],_0x314d69);})[_0x2ba3('0x13')](function(_0x2e3102){_0x314d69['data5']=_0x2e3102[_0x2ba3('0x56')];_0x314d69[_0x2ba3('0x57')]=_0x2e3102[_0x2ba3('0x58')];return db[_0x2ba3('0x2f')][_0x2ba3('0x45')]({'data5':_0x314d69[_0x2ba3('0x59')],'data6':_0x314d69[_0x2ba3('0x57')]},{'where':{'id':_0x314d69['id']}});})['then'](function(){oauth[_0x2ba3('0x5a')](_0x314d69);socket[_0x2ba3('0x5b')](_0x2ba3('0x5c'),{'id':_0x168d9d['id']});return;})['then'](respondWithStatusCode(_0xb3df64,null))['catch'](function(_0x4c88c2){if(_0x168d9d){socket['emit'](_0x2ba3('0x5d'),{'id':_0x168d9d['id']});}if(!_0x314d69){logger[_0x2ba3('0x14')](_0x2ba3('0x5e'),_0x4c88c2);return _0xb3df64[_0x2ba3('0xd')](0x1f4)[_0x2ba3('0x17')](_0x4c88c2[_0x2ba3('0x5f')]);}logger[_0x2ba3('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x314d69['id'],JSON[_0x2ba3('0x60')](_0x4c88c2));});};
\ No newline at end of file
+var _0xaa45=['generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','end','error','name','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','service','MicrosoftAzure','show','options','find','decryptString','data3','create','body','Name\x20parameter\x20not\x20specified','includes','join','encryptString','update','params','catch','destroy','oauth2MicrosoftAuthorize'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0xaa45,0x130));var _0x5aa4=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xaa45[_0x421725];return _0x51b322;};'use strict';var _=require('lodash');var Redis=require(_0x5aa4('0x0'));var qs=require(_0x5aa4('0x1'));var encryptor=require(_0x5aa4('0x2'));var config=require(_0x5aa4('0x3'));var logger=require(_0x5aa4('0x4'))('api');var db=require(_0x5aa4('0x5'))['db'];var oauth=require(_0x5aa4('0x6'));config[_0x5aa4('0x7')]=_[_0x5aa4('0x8')](config[_0x5aa4('0x7')],{'host':_0x5aa4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5aa4('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x45b863,_0x4c819d){_0x4c819d=_0x4c819d||0xcc;return function(_0x3b8194){if(_0x3b8194){return _0x45b863[_0x5aa4('0xa')](_0x4c819d);}return _0x45b863['status'](_0x4c819d)['end']();};}function respondWithResult(_0x16c984,_0x2dcedf){_0x2dcedf=_0x2dcedf||0xc8;return function(_0x52d7f7){if(_0x52d7f7){return _0x16c984[_0x5aa4('0xb')](_0x2dcedf)[_0x5aa4('0xc')](_0x52d7f7);}};}function respondWithFilteredResult(_0x22b797,_0x3a4443){return function(_0x51811f){if(_0x51811f){var _0x5cd221=typeof _0x3a4443[_0x5aa4('0xd')]===_0x5aa4('0xe')&&typeof _0x3a4443[_0x5aa4('0xf')]===_0x5aa4('0xe');var _0x2a61fc=_0x51811f[_0x5aa4('0x10')];var _0x28df28=_0x5cd221?0x0:_0x3a4443['offset'];var _0x263a28=_0x5cd221?_0x51811f[_0x5aa4('0x10')]:_0x3a4443[_0x5aa4('0xd')]+_0x3a4443[_0x5aa4('0xf')];var _0x7f576;if(_0x263a28>=_0x2a61fc){_0x263a28=_0x2a61fc;_0x7f576=0xc8;}else{_0x7f576=0xce;}_0x22b797[_0x5aa4('0xb')](_0x7f576);return _0x22b797[_0x5aa4('0x11')](_0x5aa4('0x12'),_0x28df28+'-'+_0x263a28+'/'+_0x2a61fc)[_0x5aa4('0xc')](_0x51811f);}return null;};}function saveUpdates(_0x5972f5){return function(_0x503957){if(_0x503957){return _0x503957['update'](_0x5972f5)[_0x5aa4('0x13')](function(_0x3b6a03){return _0x3b6a03;});}return null;};}function removeEntity(_0x1e0eb7){return function(_0x167e0f){if(_0x167e0f){return _0x167e0f['destroy']()[_0x5aa4('0x13')](function(){_0x1e0eb7[_0x5aa4('0xb')](0xcc)[_0x5aa4('0x14')]();});}};}function handleEntityNotFound(_0x58bcf5){return function(_0x53b970){if(!_0x53b970){_0x58bcf5[_0x5aa4('0xa')](0x194);}return _0x53b970;};}function handleError(_0x513da0,_0x9353b3){_0x9353b3=_0x9353b3||0x1f4;return function(_0x94010c){logger[_0x5aa4('0x15')](_0x94010c['stack']);if(_0x94010c[_0x5aa4('0x16')]){delete _0x94010c[_0x5aa4('0x16')];}_0x513da0[_0x5aa4('0xb')](_0x9353b3)['send'](_0x94010c);};}function maskClientSecret(_0x528ea3){return _['padEnd'](_0x528ea3[_0x5aa4('0x17')](0x0,0x3),0x14,'*');}exports[_0x5aa4('0x18')]=function(_0x1efd00,_0x128395){var _0x11ed4c={},_0x5d32a3={},_0x35b197={'count':0x0,'rows':[]};var _0xca403b=_['map'](db[_0x5aa4('0x19')][_0x5aa4('0x1a')],function(_0x42b26d){return{'name':_0x42b26d[_0x5aa4('0x1b')],'type':_0x42b26d[_0x5aa4('0x1c')][_0x5aa4('0x1d')]};});_0x5d32a3[_0x5aa4('0x1e')]=_['map'](_0xca403b,'name');_0x5d32a3[_0x5aa4('0x1f')]=_[_0x5aa4('0x20')](_0x1efd00[_0x5aa4('0x1f')]);_0x5d32a3[_0x5aa4('0x21')]=_[_0x5aa4('0x22')](_0x5d32a3[_0x5aa4('0x1e')],_0x5d32a3[_0x5aa4('0x1f')]);_0x11ed4c[_0x5aa4('0x23')]=_[_0x5aa4('0x22')](_0x5d32a3[_0x5aa4('0x1e')],qs['fields'](_0x1efd00['query'][_0x5aa4('0x24')]));_0x11ed4c[_0x5aa4('0x23')]=_0x11ed4c[_0x5aa4('0x23')][_0x5aa4('0x25')]?_0x11ed4c[_0x5aa4('0x23')]:_0x5d32a3['model'];if(!_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x26')]('nolimit')){_0x11ed4c['limit']=qs[_0x5aa4('0xf')](_0x1efd00[_0x5aa4('0x1f')]['limit']);_0x11ed4c['offset']=qs['offset'](_0x1efd00['query'][_0x5aa4('0xd')]);}_0x11ed4c[_0x5aa4('0x27')]=qs[_0x5aa4('0x28')](_0x1efd00[_0x5aa4('0x1f')]['sort']);_0x11ed4c[_0x5aa4('0x29')]=qs[_0x5aa4('0x21')](_[_0x5aa4('0x2a')](_0x1efd00[_0x5aa4('0x1f')],_0x5d32a3[_0x5aa4('0x21')]),_0xca403b);if(_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x2b')]){_0x11ed4c['where']=_[_0x5aa4('0x2c')](_0x11ed4c[_0x5aa4('0x29')],{'$or':_[_0x5aa4('0x2d')](_0xca403b,function(_0x1e96cc){if(_0x1e96cc[_0x5aa4('0x1c')]!==_0x5aa4('0x2e')){var _0x4d0af4={};_0x4d0af4[_0x1e96cc[_0x5aa4('0x16')]]={'$like':'%'+_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x2b')]+'%'};return _0x4d0af4;}})});}_0x11ed4c=_[_0x5aa4('0x2c')]({},_0x11ed4c,_0x1efd00['options']);var _0x115c2c={'where':_0x11ed4c['where']};return db[_0x5aa4('0x19')][_0x5aa4('0x10')](_0x115c2c)[_0x5aa4('0x13')](function(_0x1c3de9){_0x35b197[_0x5aa4('0x10')]=_0x1c3de9;if(_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x2f')]){_0x11ed4c['include']=[{'all':!![]}];}return db[_0x5aa4('0x19')][_0x5aa4('0x30')](_0x11ed4c);})[_0x5aa4('0x13')](function(_0x594b95){_0x35b197[_0x5aa4('0x31')]=_[_0x5aa4('0x2d')](_0x594b95,function(_0x1aaaf1){if(_0x1aaaf1[_0x5aa4('0x32')]===_0x5aa4('0x33')){var _0x5ddb60=encryptor['decryptString'](_0x1aaaf1['data3']);_0x1aaaf1['data3']=maskClientSecret(_0x5ddb60);}return _0x1aaaf1;});return _0x35b197;})['then'](respondWithFilteredResult(_0x128395,_0x11ed4c))['catch'](handleError(_0x128395,null));};exports[_0x5aa4('0x34')]=function(_0x288e99,_0x58cd00){var _0x5b841b={'raw':!![],'where':{'id':_0x288e99['params']['id']}},_0x16d0f4={};_0x16d0f4[_0x5aa4('0x1e')]=_[_0x5aa4('0x20')](db[_0x5aa4('0x19')]['rawAttributes']);_0x16d0f4['query']=_[_0x5aa4('0x20')](_0x288e99[_0x5aa4('0x1f')]);_0x16d0f4[_0x5aa4('0x21')]=_[_0x5aa4('0x22')](_0x16d0f4[_0x5aa4('0x1e')],_0x16d0f4[_0x5aa4('0x1f')]);_0x5b841b[_0x5aa4('0x23')]=_[_0x5aa4('0x22')](_0x16d0f4[_0x5aa4('0x1e')],qs[_0x5aa4('0x24')](_0x288e99[_0x5aa4('0x1f')][_0x5aa4('0x24')]));_0x5b841b[_0x5aa4('0x23')]=_0x5b841b[_0x5aa4('0x23')][_0x5aa4('0x25')]?_0x5b841b['attributes']:_0x16d0f4['model'];if(_0x288e99['query'][_0x5aa4('0x2f')]){_0x5b841b['include']=[{'all':!![]}];}_0x5b841b=_['merge']({},_0x5b841b,_0x288e99[_0x5aa4('0x35')]);return db[_0x5aa4('0x19')][_0x5aa4('0x36')](_0x5b841b)['then'](handleEntityNotFound(_0x58cd00,null))[_0x5aa4('0x13')](function(_0x1c63ee){if(_0x1c63ee[_0x5aa4('0x32')]===_0x5aa4('0x33')){var _0x569e78=encryptor[_0x5aa4('0x37')](_0x1c63ee[_0x5aa4('0x38')]);_0x1c63ee[_0x5aa4('0x38')]=maskClientSecret(_0x569e78);}return _0x1c63ee;})[_0x5aa4('0x13')](respondWithResult(_0x58cd00,null))['catch'](handleError(_0x58cd00,null));};exports[_0x5aa4('0x39')]=function(_0x31cba4,_0x2fa1cf){if(!_0x31cba4[_0x5aa4('0x3a')][_0x5aa4('0x16')])throw new Error(_0x5aa4('0x3b'));if(!_0x31cba4[_0x5aa4('0x3a')][_0x5aa4('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4b9691=db[_0x5aa4('0x19')][_0x5aa4('0x1a')][_0x5aa4('0x32')]['values'];if(!_0x4b9691[_0x5aa4('0x3c')](_0x31cba4[_0x5aa4('0x3a')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x4b9691[_0x5aa4('0x3d')](',\x20'));if(_0x31cba4[_0x5aa4('0x3a')]['service']==='MicrosoftAzure'&&_0x31cba4[_0x5aa4('0x3a')][_0x5aa4('0x38')]){_0x31cba4['body'][_0x5aa4('0x38')]=encryptor[_0x5aa4('0x3e')](_0x31cba4[_0x5aa4('0x3a')]['data3']);}return db['CloudProvider'][_0x5aa4('0x39')](_0x31cba4['body'],{})[_0x5aa4('0x13')](respondWithResult(_0x2fa1cf,0xc9))['catch'](handleError(_0x2fa1cf,null));};exports[_0x5aa4('0x3f')]=function(_0x4cf064,_0x5423a4){if(_0x4cf064['body']['id']){delete _0x4cf064[_0x5aa4('0x3a')]['id'];}return db[_0x5aa4('0x19')]['find']({'where':{'id':_0x4cf064[_0x5aa4('0x40')]['id']}})[_0x5aa4('0x13')](handleEntityNotFound(_0x5423a4,null))[_0x5aa4('0x13')](function(_0x37c74f){if(_0x37c74f[_0x5aa4('0x32')]===_0x5aa4('0x33')&&_0x4cf064[_0x5aa4('0x3a')]['data3']){_0x4cf064['body'][_0x5aa4('0x38')]=encryptor[_0x5aa4('0x3e')](_0x4cf064[_0x5aa4('0x3a')][_0x5aa4('0x38')]);}return _0x37c74f;})[_0x5aa4('0x13')](saveUpdates(_0x4cf064[_0x5aa4('0x3a')],null))[_0x5aa4('0x13')](respondWithResult(_0x5423a4,null))[_0x5aa4('0x41')](handleError(_0x5423a4,null));};exports[_0x5aa4('0x42')]=function(_0x45943d,_0x4d0685){return db[_0x5aa4('0x19')][_0x5aa4('0x36')]({'where':{'id':_0x45943d['params']['id']}})[_0x5aa4('0x13')](handleEntityNotFound(_0x4d0685,null))[_0x5aa4('0x13')](removeEntity(_0x4d0685,null))[_0x5aa4('0x41')](handleError(_0x4d0685,null));};exports[_0x5aa4('0x43')]=function(_0x4e2c8c,_0x4fa874){return db[_0x5aa4('0x19')]['findOne']({'where':{'id':_0x4e2c8c[_0x5aa4('0x40')]['id']},'raw':!![]})[_0x5aa4('0x13')](function(_0xc9248d){if(!_0xc9248d)return _0x4fa874['sendStatus'](0x194);return{'url':oauth[_0x5aa4('0x44')](_0xc9248d,_0x4e2c8c[_0x5aa4('0x45')]['id'])};})[_0x5aa4('0x13')](respondWithResult(_0x4fa874,null))['catch'](handleError(_0x4fa874,null));};exports[_0x5aa4('0x46')]=function(_0x246981,_0x38adf2){var _0x433f2a=_0x246981[_0x5aa4('0x3a')];var _0x1b0320;var _0x134493;if(_0x433f2a['error'])throw _0x433f2a;redis[_0x5aa4('0x47')](_0x433f2a['state'])['then'](function(_0x551651){if(!_0x551651)throw new Error(_0x5aa4('0x48'));_0x1b0320=JSON[_0x5aa4('0x49')](_0x551651);var _0x33abf5=Buffer[_0x5aa4('0x4a')](_0x433f2a[_0x5aa4('0x4b')],_0x5aa4('0x4c'))[_0x5aa4('0x4d')](_0x5aa4('0x4e'));_0x134493=JSON[_0x5aa4('0x49')](_0x33abf5);if(!oauth[_0x5aa4('0x4f')](_0x433f2a[_0x5aa4('0x50')],_0x1b0320[_0x5aa4('0x51')]))throw new Error(_0x5aa4('0x52'));redis[_0x5aa4('0x53')](_0x433f2a[_0x5aa4('0x4b')]);return oauth['getOauth2MicrosoftAccessToken'](_0x433f2a['code'],_0x1b0320);})['then'](function(_0x52126e){_0x1b0320[_0x5aa4('0x54')]=_0x52126e['access_token'];_0x1b0320[_0x5aa4('0x55')]=_0x52126e['refresh_token'];return db[_0x5aa4('0x19')][_0x5aa4('0x3f')]({'data5':_0x1b0320['data5'],'data6':_0x1b0320['data6']},{'where':{'id':_0x1b0320['id']}});})['then'](function(){oauth[_0x5aa4('0x56')](_0x1b0320);socket[_0x5aa4('0x57')](_0x5aa4('0x58'),{'id':_0x134493['id']});return;})[_0x5aa4('0x13')](respondWithStatusCode(_0x38adf2,null))[_0x5aa4('0x41')](function(_0x44fcac){if(_0x134493){socket[_0x5aa4('0x57')]('microsoftAuthorization:error',{'id':_0x134493['id']});}if(!_0x1b0320){logger[_0x5aa4('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0x44fcac);return _0x38adf2[_0x5aa4('0xb')](0x1f4)[_0x5aa4('0x59')](_0x44fcac[_0x5aa4('0x5a')]);}logger[_0x5aa4('0x15')](_0x5aa4('0x5b'),_0x1b0320['id'],JSON[_0x5aa4('0x5c')](_0x44fcac));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 6f67a9f..c3f4c05 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 _0xdaae=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','bluebird','request-promise','path','rimraf'];(function(_0xb4d928,_0x579093){var _0x47166e=function(_0x198064){while(--_0x198064){_0xb4d928['push'](_0xb4d928['shift']());}};_0x47166e(++_0x579093);}(_0xdaae,0x1bd));var _0xedaa=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xdaae[_0x260f28];return _0x3aefcc;};'use strict';var _=require(_0xedaa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xedaa('0x1'));var rp=require(_0xedaa('0x2'));var fs=require('fs');var path=require(_0xedaa('0x3'));var rimraf=require(_0xedaa('0x4'));var config=require(_0xedaa('0x5'));var attributes=require(_0xedaa('0x6'));module[_0xedaa('0x7')]=function(_0x324ff7,_0x3b8052){return _0x324ff7['define'](_0xedaa('0x8'),attributes,{'tableName':_0xedaa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2214=['../../config/logger','api','bluebird','rimraf','./cloudProvider.attributes','define','util'];(function(_0x5d4c9e,_0x208e78){var _0x4ae946=function(_0x1375a6){while(--_0x1375a6){_0x5d4c9e['push'](_0x5d4c9e['shift']());}};_0x4ae946(++_0x208e78);}(_0x2214,0x1a3));var _0x4221=function(_0x33f7f6,_0x44bcb8){_0x33f7f6=_0x33f7f6-0x0;var _0x4a5c30=_0x2214[_0x33f7f6];return _0x4a5c30;};'use strict';var _=require('lodash');var util=require(_0x4221('0x0'));var logger=require(_0x4221('0x1'))(_0x4221('0x2'));var moment=require('moment');var BPromise=require(_0x4221('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4221('0x4'));var config=require('../../config/environment');var attributes=require(_0x4221('0x5'));module['exports']=function(_0x2488b1,_0x2f59f6){return _0x2488b1[_0x4221('0x6')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 4c4196c..500f3be 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 _0x4920=['https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','replace','data2','id_token','from','stringify','toString','randomBytes','hex','data1','response_type','join','response_mode','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','isAfter','exp','resolve','then','data3','findOne','refresh_token','data6','data4','POST','{TENANT_ID}','data5','CloudProvider','update','error','authorization_code','decryptString','intervals','findAll','all','catch','inspect','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All'];(function(_0x923556,_0x22b18e){var _0x37d5e=function(_0x1286ea){while(--_0x1286ea){_0x923556['push'](_0x923556['shift']());}};_0x37d5e(++_0x22b18e);}(_0x4920,0xd7));var _0x0492=function(_0x13bc77,_0x1495ee){_0x13bc77=_0x13bc77-0x0;var _0x56b6e7=_0x4920[_0x13bc77];return _0x56b6e7;};'use strict';var _=require(_0x0492('0x0'));var crypto=require('crypto');var jwt=require(_0x0492('0x1'));var moment=require(_0x0492('0x2'));var Redis=require(_0x0492('0x3'));var rp=require(_0x0492('0x4'));var util=require(_0x0492('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0x0492('0x6'));var logger=require(_0x0492('0x7'))(_0x0492('0x8'));var schedule=require(_0x0492('0x9'));var db=require('../../mysqldb')['db'];config[_0x0492('0xa')]=_[_0x0492('0xb')](config[_0x0492('0xa')],{'host':_0x0492('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x0492('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x0492('0xe'),_0x0492('0xf'),_0x0492('0x10'),_0x0492('0x11'),_0x0492('0x12'),_0x0492('0x13'),_0x0492('0x14')],'Dynamics365':['openid',_0x0492('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x0492('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x0492('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3965bd){var _0x367c80=_[_0x0492('0x17')](AZURE_AUTH_SCOPES[_0x3965bd[_0x0492('0x18')]]);if(_0x3965bd[_0x0492('0x18')]===_0x0492('0x19'))_0x367c80[_0x0492('0x1a')](_0x3965bd['data7']+_0x0492('0x1b'));return _0x367c80['join']('\x20');}function getAccessTokenScope(_0x48a20c){if(_0x48a20c[_0x0492('0x18')]==='Outlook365')return _0x0492('0x12');if(_0x48a20c[_0x0492('0x18')]==='Dynamics365')return _0x48a20c['data7']+_0x0492('0x1b');}function generateMicrosoftAuthorizationUrl(_0x44a4bc,_0x41de48){var _0x7c9b45=MICROSOFT_AUTH_URL[_0x0492('0x1c')]('{TENANT_ID}',_0x44a4bc[_0x0492('0x1d')]);var _0x2cfe0d=['code',_0x0492('0x1e')];var _0x28755b=Buffer[_0x0492('0x1f')](JSON[_0x0492('0x20')]({'id':_0x41de48}))[_0x0492('0x21')]('base64');var _0x36e69e=crypto[_0x0492('0x22')](0x10)[_0x0492('0x21')](_0x0492('0x23'));var _0xf302bc=getAuthorizationScopes(_0x44a4bc);var _0x28ec6f=[{'key':'client_id','value':_0x44a4bc[_0x0492('0x24')]},{'key':_0x0492('0x25'),'value':encodeURIComponent(_0x2cfe0d[_0x0492('0x26')]('\x20'))},{'key':'redirect_uri','value':_0x44a4bc['data4']},{'key':_0x0492('0x27'),'value':_0x0492('0x28')},{'key':_0x0492('0x29'),'value':encodeURIComponent(_0xf302bc)},{'key':_0x0492('0x2a'),'value':_0x28755b},{'key':_0x0492('0x2b'),'value':_0x36e69e},{'key':_0x0492('0x2c'),'value':_0x0492('0x2d')}];var _0x3ffa92=_0x7c9b45+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0492('0x17')](_0x28ec6f,function(_0x1ec629){return _0x1ec629[_0x0492('0x2e')]+'='+_0x1ec629[_0x0492('0x2f')];})[_0x0492('0x26')]('&');_0x44a4bc[_0x0492('0x30')]={'issuer':_0x7c9b45[_0x0492('0x1c')](_0x0492('0x31'),''),'audience':_0x44a4bc[_0x0492('0x24')],'state':_0x28755b,'nonce':_0x36e69e};redis['set'](_0x28755b,JSON[_0x0492('0x20')](_0x44a4bc));return _0x3ffa92;}function isValidIdToken(_0x1ea4db,_0x5efde6){try{var _0xac7d05=jwt[_0x0492('0x32')](_0x1ea4db,{'complete':!![]});var _0x14eb6f=_0xac7d05[_0x0492('0x33')];if(_0x14eb6f[_0x0492('0x34')]!==_0x5efde6[_0x0492('0x35')])return![];if(_0x14eb6f[_0x0492('0x36')]!==_0x5efde6['audience'])return![];if(_0x14eb6f[_0x0492('0x2b')]!==_0x5efde6[_0x0492('0x2b')])return![];if(moment()[_0x0492('0x37')](moment['unix'](_0x14eb6f[_0x0492('0x38')])))return![];return!![];}catch(_0x4f24a4){throw _0x4f24a4;}}function refreshOauth2MicrosoftAccessToken(_0x3ed013){return Promise[_0x0492('0x39')]()[_0x0492('0x3a')](function(){if(_0x3ed013[_0x0492('0x3b')])return _0x3ed013;return db['CloudProvider'][_0x0492('0x3c')]({'where':{'id':_0x3ed013['id']},'raw':!![]});})[_0x0492('0x3a')](function(_0x27a295){var _0x6ef1bb={'grant_type':_0x0492('0x3d'),'refresh_token':_0x27a295[_0x0492('0x3e')],'scope':getAccessTokenScope(_0x27a295),'redirect_uri':_0x27a295[_0x0492('0x3f')],'client_id':_0x27a295['data1'],'client_secret':encryptor['decryptString'](_0x27a295[_0x0492('0x3b')])};var _0x156d95={'method':_0x0492('0x40'),'uri':MICROSOFT_AUTH_URL[_0x0492('0x1c')](_0x0492('0x41'),_0x27a295['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x6ef1bb,'json':!![]};return rp(_0x156d95);})[_0x0492('0x3a')](function(_0x6916f7){_0x3ed013[_0x0492('0x42')]=_0x6916f7['access_token'];_0x3ed013[_0x0492('0x3e')]=_0x6916f7[_0x0492('0x3d')];return db[_0x0492('0x43')][_0x0492('0x44')]({'data5':_0x3ed013[_0x0492('0x42')],'data6':_0x3ed013['data6']},{'where':{'id':_0x3ed013['id']}});})[_0x0492('0x3a')](function(){return _0x3ed013;})['catch'](function(_0x4c5cf1){logger[_0x0492('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x3ed013['id'],_0x4c5cf1);});}function getOauth2MicrosoftAccessToken(_0x31e0bd,_0x1b46e5){var _0x5a6b4a={'grant_type':_0x0492('0x46'),'code':_0x31e0bd,'scope':getAccessTokenScope(_0x1b46e5),'redirect_uri':_0x1b46e5[_0x0492('0x3f')],'client_id':_0x1b46e5['data1'],'client_secret':encryptor[_0x0492('0x47')](_0x1b46e5[_0x0492('0x3b')])};var _0x5362fb={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x0492('0x1c')](_0x0492('0x41'),_0x1b46e5[_0x0492('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5a6b4a,'json':!![]};return rp(_0x5362fb);}function startRefreshInterval(_0x1f058d){var _0x419a67=schedule[_0x0492('0x48')];if(_0x419a67[_0x1f058d['id']])clearInterval(_0x419a67[_0x1f058d['id']]);_0x419a67[_0x1f058d['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1f058d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x0492('0x48')]=_0x419a67;}function startAllRefreshIntervals(){return db[_0x0492('0x43')][_0x0492('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0492('0x3a')](function(_0x51732d){var _0x1f3d81=_0x51732d['map'](function(_0x314fde){return refreshOauth2MicrosoftAccessToken(_0x314fde)[_0x0492('0x3a')](function(_0x1d00da){startRefreshInterval(_0x1d00da);});});return Promise[_0x0492('0x4a')](_0x1f3d81);})[_0x0492('0x4b')](function(_0x3ed1fa){var _0x2571bb=_0x3ed1fa?util[_0x0492('0x4c')](_0x3ed1fa,{'showHidden':![],'depth':null}):'';logger[_0x0492('0x45')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2571bb);});}module[_0x0492('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x226d=['oauth2Claims','oauth2/','set','payload','iss','issuer','exp','resolve','data3','CloudProvider','findOne','then','data6','decryptString','POST','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','stringify','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','nonce','prompt','value'];(function(_0x4993a3,_0x492845){var _0x5723ec=function(_0x2b9d18){while(--_0x2b9d18){_0x4993a3['push'](_0x4993a3['shift']());}};_0x5723ec(++_0x492845);}(_0x226d,0x13c));var _0xd226=function(_0x502372,_0x304dd9){_0x502372=_0x502372-0x0;var _0xf99629=_0x226d[_0x502372];return _0xf99629;};'use strict';var _=require(_0xd226('0x0'));var crypto=require(_0xd226('0x1'));var jwt=require(_0xd226('0x2'));var moment=require('moment');var Redis=require(_0xd226('0x3'));var rp=require(_0xd226('0x4'));var util=require('util');var encryptor=require(_0xd226('0x5'));var config=require(_0xd226('0x6'));var logger=require(_0xd226('0x7'))(_0xd226('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xd226('0x9'))['db'];config[_0xd226('0xa')]=_['defaults'](config['redis'],{'host':_0xd226('0xb'),'port':0x18eb});var redis=new Redis(config[_0xd226('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xd226('0xc'),_0xd226('0xd'),_0xd226('0xe'),_0xd226('0xf'),_0xd226('0x10'),_0xd226('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd226('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xd226('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2f06de){var _0x59291e=_[_0xd226('0x13')](AZURE_AUTH_SCOPES[_0x2f06de[_0xd226('0x14')]]);if(_0x2f06de[_0xd226('0x14')]===_0xd226('0x15'))_0x59291e[_0xd226('0x16')](_0x2f06de['data7']+_0xd226('0x17'));return _0x59291e[_0xd226('0x18')]('\x20');}function getAccessTokenScope(_0x431ada){if(_0x431ada[_0xd226('0x14')]===_0xd226('0x19'))return _0xd226('0x10');if(_0x431ada['type']===_0xd226('0x15'))return _0x431ada[_0xd226('0x1a')]+_0xd226('0x17');}function generateMicrosoftAuthorizationUrl(_0x448a19,_0x2dd0e5){var _0x2bb8cc=MICROSOFT_AUTH_URL[_0xd226('0x1b')](_0xd226('0x1c'),_0x448a19[_0xd226('0x1d')]);var _0x535417=[_0xd226('0x1e'),'id_token'];var _0x59f418=Buffer['from'](JSON[_0xd226('0x1f')]({'id':_0x2dd0e5}))['toString'](_0xd226('0x20'));var _0xd9d6a8=crypto['randomBytes'](0x10)['toString'](_0xd226('0x21'));var _0x18aa59=getAuthorizationScopes(_0x448a19);var _0x18b6bd=[{'key':_0xd226('0x22'),'value':_0x448a19[_0xd226('0x23')]},{'key':_0xd226('0x24'),'value':encodeURIComponent(_0x535417['join']('\x20'))},{'key':_0xd226('0x25'),'value':_0x448a19[_0xd226('0x26')]},{'key':_0xd226('0x27'),'value':_0xd226('0x28')},{'key':'scope','value':encodeURIComponent(_0x18aa59)},{'key':'state','value':_0x59f418},{'key':_0xd226('0x29'),'value':_0xd9d6a8},{'key':_0xd226('0x2a'),'value':'login'}];var _0x263e22=_0x2bb8cc+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x18b6bd,function(_0x33692d){return _0x33692d['key']+'='+_0x33692d[_0xd226('0x2b')];})[_0xd226('0x18')]('&');_0x448a19[_0xd226('0x2c')]={'issuer':_0x2bb8cc[_0xd226('0x1b')](_0xd226('0x2d'),''),'audience':_0x448a19[_0xd226('0x23')],'state':_0x59f418,'nonce':_0xd9d6a8};redis[_0xd226('0x2e')](_0x59f418,JSON[_0xd226('0x1f')](_0x448a19));return _0x263e22;}function isValidIdToken(_0x74d1b1,_0x4f954a){try{var _0x5698b2=jwt['decode'](_0x74d1b1,{'complete':!![]});var _0x5ba309=_0x5698b2[_0xd226('0x2f')];if(_0x5ba309[_0xd226('0x30')]!==_0x4f954a[_0xd226('0x31')])return![];if(_0x5ba309['aud']!==_0x4f954a['audience'])return![];if(_0x5ba309['nonce']!==_0x4f954a[_0xd226('0x29')])return![];if(moment()['isAfter'](moment['unix'](_0x5ba309[_0xd226('0x32')])))return![];return!![];}catch(_0x4a6f2c){throw _0x4a6f2c;}}function refreshOauth2MicrosoftAccessToken(_0x540e59){return Promise[_0xd226('0x33')]()['then'](function(){if(_0x540e59[_0xd226('0x34')])return _0x540e59;return db[_0xd226('0x35')][_0xd226('0x36')]({'where':{'id':_0x540e59['id']},'raw':!![]});})[_0xd226('0x37')](function(_0x4faa60){var _0x400a93={'grant_type':'refresh_token','refresh_token':_0x4faa60[_0xd226('0x38')],'scope':getAccessTokenScope(_0x4faa60),'redirect_uri':_0x4faa60['data4'],'client_id':_0x4faa60[_0xd226('0x23')],'client_secret':encryptor[_0xd226('0x39')](_0x4faa60[_0xd226('0x34')])};var _0x2d8a44={'method':_0xd226('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xd226('0x1b')]('{TENANT_ID}',_0x4faa60['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x400a93,'json':!![]};return rp(_0x2d8a44);})[_0xd226('0x37')](function(_0x268e58){_0x540e59['data5']=_0x268e58[_0xd226('0x3b')];_0x540e59['data6']=_0x268e58['refresh_token'];return db[_0xd226('0x35')][_0xd226('0x3c')]({'data5':_0x540e59[_0xd226('0x3d')],'data6':_0x540e59[_0xd226('0x38')]},{'where':{'id':_0x540e59['id']}});})['then'](function(){return _0x540e59;})[_0xd226('0x3e')](function(_0x3f5cbc){logger[_0xd226('0x3f')](_0xd226('0x40'),_0x540e59['id'],_0x3f5cbc);});}function getOauth2MicrosoftAccessToken(_0x13b66d,_0x42f93a){var _0x16bcbe={'grant_type':_0xd226('0x41'),'code':_0x13b66d,'scope':getAccessTokenScope(_0x42f93a),'redirect_uri':_0x42f93a[_0xd226('0x26')],'client_id':_0x42f93a['data1'],'client_secret':encryptor[_0xd226('0x39')](_0x42f93a[_0xd226('0x34')])};var _0x1a2861={'method':_0xd226('0x3a'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd226('0x1c'),_0x42f93a[_0xd226('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x16bcbe,'json':!![]};return rp(_0x1a2861);}function startRefreshInterval(_0xa56c31){var _0x4ec8b9=schedule[_0xd226('0x42')];if(_0x4ec8b9[_0xa56c31['id']])clearInterval(_0x4ec8b9[_0xa56c31['id']]);_0x4ec8b9[_0xa56c31['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xa56c31['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd226('0x42')]=_0x4ec8b9;}function startAllRefreshIntervals(){return db[_0xd226('0x35')][_0xd226('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd226('0x37')](function(_0x1c6b10){var _0x26ced=_0x1c6b10[_0xd226('0x13')](function(_0x1ba123){return refreshOauth2MicrosoftAccessToken(_0x1ba123)[_0xd226('0x37')](function(_0x1157a1){startRefreshInterval(_0x1157a1);});});return Promise[_0xd226('0x44')](_0x26ced);})[_0xd226('0x3e')](function(_0x14993c){var _0x2597a7=_0x14993c?util[_0xd226('0x45')](_0x14993c,{'showHidden':![],'depth':null}):'';logger[_0xd226('0x3f')](_0xd226('0x46'),_0x2597a7);});}module[_0xd226('0x47')]={'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 1fc45b5..9acb437 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 _0xd48e=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CloudProvider,\x20%s,\x20%s','message','catch'];(function(_0x2eb8ce,_0x4417c0){var _0x58f7ff=function(_0x536032){while(--_0x536032){_0x2eb8ce['push'](_0x2eb8ce['shift']());}};_0x58f7ff(++_0x4417c0);}(_0xd48e,0x93));var _0xed48=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xd48e[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0xed48('0x0'));var moment=require(_0xed48('0x1'));var BPromise=require(_0xed48('0x2'));var rs=require(_0xed48('0x3'));var fs=require('fs');var Redis=require(_0xed48('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed48('0x5'));var logger=require(_0xed48('0x6'))(_0xed48('0x7'));var config=require('../../config/environment');var jayson=require(_0xed48('0x8'));var client=jayson[_0xed48('0x9')][_0xed48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50b4ce,_0x2cc522,_0x1c9299){return new BPromise(function(_0x52a5e2,_0x5f0f1b){return client['request'](_0x50b4ce,_0x1c9299)[_0xed48('0xb')](function(_0x28096a){logger[_0xed48('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2cc522,'request\x20sent');logger[_0xed48('0xd')](_0xed48('0xe'),_0x2cc522,_0xed48('0xf'),JSON['stringify'](_0x28096a));if(_0x28096a[_0xed48('0x10')]){if(_0x28096a[_0xed48('0x10')][_0xed48('0x11')]===0x1f4){logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);return _0x5f0f1b(_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);}logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x28096a[_0xed48('0x10')][_0xed48('0x13')]);return _0x52a5e2(_0x28096a['error'][_0xed48('0x13')]);}else{logger['info'](_0xed48('0x12'),_0x2cc522,'request\x20sent');_0x52a5e2(_0x28096a['result'][_0xed48('0x13')]);}})[_0xed48('0x14')](function(_0x3dd77d){logger[_0xed48('0x10')](_0xed48('0x12'),_0x2cc522,_0x3dd77d);_0x5f0f1b(_0x3dd77d);});});}
\ No newline at end of file
+var _0xedf1=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x45a1c4,_0x78263e){var _0x1947bf=function(_0x4c40ba){while(--_0x4c40ba){_0x45a1c4['push'](_0x45a1c4['shift']());}};_0x1947bf(++_0x78263e);}(_0xedf1,0xb2));var _0x1edf=function(_0x25b80e,_0x503088){_0x25b80e=_0x25b80e-0x0;var _0xd2c680=_0xedf1[_0x25b80e];return _0xd2c680;};'use strict';var _=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1edf('0x2'));var fs=require('fs');var Redis=require(_0x1edf('0x3'));var db=require(_0x1edf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1edf('0x5'))(_0x1edf('0x6'));var config=require(_0x1edf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1edf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1615b2,_0x1029fe,_0x20b629){return new BPromise(function(_0x12293b,_0x206f63){return client[_0x1edf('0x9')](_0x1615b2,_0x20b629)[_0x1edf('0xa')](function(_0x30a13f){logger['info'](_0x1edf('0xb'),_0x1029fe,_0x1edf('0xc'));logger[_0x1edf('0xd')](_0x1edf('0xe'),_0x1029fe,'request\x20sent',JSON[_0x1edf('0xf')](_0x30a13f));if(_0x30a13f['error']){if(_0x30a13f[_0x1edf('0x10')][_0x1edf('0x11')]===0x1f4){logger[_0x1edf('0x10')](_0x1edf('0xb'),_0x1029fe,_0x30a13f[_0x1edf('0x10')][_0x1edf('0x12')]);return _0x206f63(_0x30a13f[_0x1edf('0x10')][_0x1edf('0x12')]);}logger[_0x1edf('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1029fe,_0x30a13f[_0x1edf('0x10')][_0x1edf('0x12')]);return _0x12293b(_0x30a13f['error'][_0x1edf('0x12')]);}else{logger[_0x1edf('0x13')](_0x1edf('0xb'),_0x1029fe,_0x1edf('0xc'));_0x12293b(_0x30a13f[_0x1edf('0x14')][_0x1edf('0x12')]);}})['catch'](function(_0x4f2584){logger[_0x1edf('0x10')](_0x1edf('0xb'),_0x1029fe,_0x4f2584);_0x206f63(_0x4f2584);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index faabc27..8a3dbb5 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x105154,_0x11f478){var _0x295abf=function(_0x4367e0){while(--_0x4367e0){_0x105154['push'](_0x105154['shift']());}};_0x295abf(++_0x11f478);}(_0xdb28,0x106));var _0x8db2=function(_0x1f38d3,_0x235a4a){_0x1f38d3=_0x1f38d3-0x0;var _0x942b6d=_0xdb28[_0x1f38d3];return _0x942b6d;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x1261,0x144));var _0x1126=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x1261[_0x1e393b];return _0x3d0bfe;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d86dbfb..d5b4016 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 _0x8c2f=['name','STRING'];(function(_0x81f67b,_0x4409a5){var _0x22f2ff=function(_0x577350){while(--_0x577350){_0x81f67b['push'](_0x81f67b['shift']());}};_0x22f2ff(++_0x4409a5);}(_0x8c2f,0xdc));var _0xf8c2=function(_0x423035,_0x51ddeb){_0x423035=_0x423035-0x0;var _0x3645fc=_0x8c2f[_0x423035];return _0x3645fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf8c2('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xf8c2('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf8c2('0x1')]},'type':{'type':Sequelize[_0xf8c2('0x1')]},'street':{'type':Sequelize[_0xf8c2('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf8c2('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf8c2('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf8c2('0x1')]},'sStreet':{'type':Sequelize[_0xf8c2('0x1')]},'sPostalCode':{'type':Sequelize[_0xf8c2('0x1')]},'sCity':{'type':Sequelize[_0xf8c2('0x1')]},'sCountry':{'type':Sequelize[_0xf8c2('0x1')]},'description':{'type':Sequelize[_0xf8c2('0x1')]}};
\ No newline at end of file
+var _0xf350=['STRING','sequelize','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf350,0x1e9));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0f35('0x0'));module[_0x0f35('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0f35('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0f35('0x3')]},'companyId':{'type':Sequelize[_0x0f35('0x3')]},'website':{'type':Sequelize[_0x0f35('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0f35('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0f35('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0f35('0x3')]},'email':{'type':Sequelize[_0x0f35('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0f35('0x3')]},'sStreet':{'type':Sequelize[_0x0f35('0x3')]},'sPostalCode':{'type':Sequelize[_0x0f35('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0f35('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 1a1f405..7a7cf94 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 _0x7a67=['show','params','length','include','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','CmContact','rawAttributes','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','update','destroy','then','get','UserProfileResource','stack','name','send','index','describe','model','keys','query','intersection','attributes','fields','order','sort','where','pick','filters','filter','merge','map','options','CmCompany','includeAll','findAll','rows','catch'];(function(_0x3877c6,_0x12bb7f){var _0x4e3936=function(_0x1aaa93){while(--_0x1aaa93){_0x3877c6['push'](_0x3877c6['shift']());}};_0x4e3936(++_0x12bb7f);}(_0x7a67,0x10e));var _0x77a6=function(_0x41462e,_0x4af00a){_0x41462e=_0x41462e-0x0;var _0x354bc1=_0x7a67[_0x41462e];return _0x354bc1;};'use strict';var emlformat=require(_0x77a6('0x0'));var rimraf=require(_0x77a6('0x1'));var zipdir=require(_0x77a6('0x2'));var jsonpatch=require(_0x77a6('0x3'));var rp=require(_0x77a6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x77a6('0x5'));var util=require('util');var path=require(_0x77a6('0x6'));var sox=require(_0x77a6('0x7'));var csv=require('to-csv');var ejs=require(_0x77a6('0x8'));var fs=require('fs');var fs_extra=require(_0x77a6('0x9'));var _=require(_0x77a6('0xa'));var squel=require(_0x77a6('0xb'));var crypto=require(_0x77a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x77a6('0xd'));var toCsv=require(_0x77a6('0xe'));var querystring=require(_0x77a6('0xf'));var Papa=require(_0x77a6('0x10'));var Redis=require(_0x77a6('0x11'));var authService=require(_0x77a6('0x12'));var qs=require(_0x77a6('0x13'));var as=require(_0x77a6('0x14'));var hardwareService=require(_0x77a6('0x15'));var logger=require(_0x77a6('0x16'))(_0x77a6('0x17'));var utils=require('../../config/utils');var config=require(_0x77a6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x77a6('0x19'))['db'];function respondWithStatusCode(_0x2b1215,_0x10e850){_0x10e850=_0x10e850||0xcc;return function(_0x38fa78){if(_0x38fa78){return _0x2b1215[_0x77a6('0x1a')](_0x10e850);}return _0x2b1215[_0x77a6('0x1b')](_0x10e850)[_0x77a6('0x1c')]();};}function respondWithResult(_0x5d2cf3,_0x1d5997){_0x1d5997=_0x1d5997||0xc8;return function(_0xa5cc0b){if(_0xa5cc0b){return _0x5d2cf3[_0x77a6('0x1b')](_0x1d5997)['json'](_0xa5cc0b);}};}function respondWithFilteredResult(_0x343bc0,_0x4762d9){return function(_0x3c8561){if(_0x3c8561){var _0x3997bb=typeof _0x4762d9['offset']===_0x77a6('0x1d')&&typeof _0x4762d9['limit']===_0x77a6('0x1d');var _0x43efd0=_0x3c8561[_0x77a6('0x1e')];var _0x5cb482=_0x3997bb?0x0:_0x4762d9['offset'];var _0x9cd957=_0x3997bb?_0x3c8561[_0x77a6('0x1e')]:_0x4762d9[_0x77a6('0x1f')]+_0x4762d9[_0x77a6('0x20')];var _0x4410c2;if(_0x9cd957>=_0x43efd0){_0x9cd957=_0x43efd0;_0x4410c2=0xc8;}else{_0x4410c2=0xce;}_0x343bc0[_0x77a6('0x1b')](_0x4410c2);return _0x343bc0['set'](_0x77a6('0x21'),_0x5cb482+'-'+_0x9cd957+'/'+_0x43efd0)[_0x77a6('0x22')](_0x3c8561);}return null;};}function patchUpdates(_0x502e70){return function(_0x448b49){try{jsonpatch[_0x77a6('0x23')](_0x448b49,_0x502e70,!![]);}catch(_0x1b74a7){return BPromise['reject'](_0x1b74a7);}return _0x448b49['save']();};}function saveUpdates(_0x132c23,_0x1c61cc){return function(_0x19334f){if(_0x19334f){return _0x19334f[_0x77a6('0x24')](_0x132c23)['then'](function(_0xccdc75){return _0xccdc75;});}return null;};}function removeEntity(_0x771e00,_0xd448cb){return function(_0x534694){if(_0x534694){return _0x534694[_0x77a6('0x25')]()[_0x77a6('0x26')](function(){var _0x2fdc41=_0x534694[_0x77a6('0x27')]({'plain':!![]});var _0xc281e7='Companies';return db[_0x77a6('0x28')]['destroy']({'where':{'type':_0xc281e7,'resourceId':_0x2fdc41['id']}})['then'](function(){return _0x534694;});})[_0x77a6('0x26')](function(){_0x771e00['status'](0xcc)[_0x77a6('0x1c')]();});}};}function handleEntityNotFound(_0x2729ee,_0x4aaf8a){return function(_0x3911a8){if(!_0x3911a8){_0x2729ee[_0x77a6('0x1a')](0x194);}return _0x3911a8;};}function handleError(_0x45207f,_0x4da1c6){_0x4da1c6=_0x4da1c6||0x1f4;return function(_0x52831b){logger['error'](_0x52831b[_0x77a6('0x29')]);if(_0x52831b[_0x77a6('0x2a')]){delete _0x52831b[_0x77a6('0x2a')];}_0x45207f[_0x77a6('0x1b')](_0x4da1c6)[_0x77a6('0x2b')](_0x52831b);};}exports[_0x77a6('0x2c')]=function(_0x2d2f77,_0x689fb3){var _0x3809e7={},_0xfb485b={},_0x534f2c={'count':0x0,'rows':[]};return db['CmCompany'][_0x77a6('0x2d')]()[_0x77a6('0x26')](function(_0x39cf57){_0xfb485b[_0x77a6('0x2e')]=_[_0x77a6('0x2f')](_0x39cf57);_0xfb485b[_0x77a6('0x30')]=_['keys'](_0x2d2f77[_0x77a6('0x30')]);_0xfb485b['filters']=_[_0x77a6('0x31')](_0xfb485b[_0x77a6('0x2e')],_0xfb485b[_0x77a6('0x30')]);_0x3809e7[_0x77a6('0x32')]=_['intersection'](_0xfb485b[_0x77a6('0x2e')],qs[_0x77a6('0x33')](_0x2d2f77['query'][_0x77a6('0x33')]));_0x3809e7[_0x77a6('0x32')]=_0x3809e7['attributes']['length']?_0x3809e7[_0x77a6('0x32')]:_0xfb485b[_0x77a6('0x2e')];if(!_0x2d2f77[_0x77a6('0x30')]['hasOwnProperty']('nolimit')){_0x3809e7[_0x77a6('0x20')]=qs['limit'](_0x2d2f77[_0x77a6('0x30')][_0x77a6('0x20')]);_0x3809e7[_0x77a6('0x1f')]=qs['offset'](_0x2d2f77[_0x77a6('0x30')][_0x77a6('0x1f')]);}_0x3809e7[_0x77a6('0x34')]=qs[_0x77a6('0x35')](_0x2d2f77[_0x77a6('0x30')][_0x77a6('0x35')]);_0x3809e7[_0x77a6('0x36')]=qs['filters'](_[_0x77a6('0x37')](_0x2d2f77[_0x77a6('0x30')],_0xfb485b[_0x77a6('0x38')]),_0x39cf57);if(_0x2d2f77['query'][_0x77a6('0x39')]){_0x3809e7['where']=_[_0x77a6('0x3a')](_0x3809e7[_0x77a6('0x36')],{'$or':_[_0x77a6('0x3b')](_0x3809e7[_0x77a6('0x32')],function(_0x5ac8cc){var _0x4793c9={};_0x4793c9[_0x5ac8cc]={'$like':'%'+_0x2d2f77[_0x77a6('0x30')]['filter']+'%'};return _0x4793c9;})});}_0x3809e7=_[_0x77a6('0x3a')]({},_0x3809e7,_0x2d2f77[_0x77a6('0x3c')]);var _0x1aa89c={'where':_0x3809e7[_0x77a6('0x36')]};return db[_0x77a6('0x3d')]['count'](_0x1aa89c)[_0x77a6('0x26')](function(_0x5b3620){_0x534f2c['count']=_0x5b3620;if(_0x2d2f77[_0x77a6('0x30')][_0x77a6('0x3e')]){_0x3809e7['include']=[{'all':!![]}];}return db[_0x77a6('0x3d')][_0x77a6('0x3f')](_0x3809e7);})[_0x77a6('0x26')](function(_0x268ee4){_0x534f2c[_0x77a6('0x40')]=_0x268ee4;return _0x534f2c;})[_0x77a6('0x26')](respondWithFilteredResult(_0x689fb3,_0x3809e7))[_0x77a6('0x41')](handleError(_0x689fb3,null));})[_0x77a6('0x41')](handleError(_0x689fb3,null));};exports[_0x77a6('0x42')]=function(_0x214de4,_0x40e5a8){var _0x2ebf99={'raw':![],'where':{'id':_0x214de4[_0x77a6('0x43')]['id']}},_0x527102={};_0x527102['model']=_['keys'](db[_0x77a6('0x3d')]['rawAttributes']);_0x527102[_0x77a6('0x30')]=_['keys'](_0x214de4[_0x77a6('0x30')]);_0x527102[_0x77a6('0x38')]=_['intersection'](_0x527102['model'],_0x527102[_0x77a6('0x30')]);_0x2ebf99['attributes']=_[_0x77a6('0x31')](_0x527102[_0x77a6('0x2e')],qs[_0x77a6('0x33')](_0x214de4[_0x77a6('0x30')]['fields']));_0x2ebf99[_0x77a6('0x32')]=_0x2ebf99[_0x77a6('0x32')][_0x77a6('0x44')]?_0x2ebf99[_0x77a6('0x32')]:_0x527102['model'];if(_0x214de4[_0x77a6('0x30')][_0x77a6('0x3e')]){_0x2ebf99[_0x77a6('0x45')]=[{'all':!![]}];}_0x2ebf99=_['merge']({},_0x2ebf99,_0x214de4[_0x77a6('0x3c')]);return db[_0x77a6('0x3d')][_0x77a6('0x46')](_0x2ebf99)[_0x77a6('0x26')](handleEntityNotFound(_0x40e5a8,null))['then'](respondWithResult(_0x40e5a8,null))[_0x77a6('0x41')](handleError(_0x40e5a8,null));};exports[_0x77a6('0x47')]=function(_0x1bcafd,_0x558583){return db[_0x77a6('0x3d')][_0x77a6('0x47')](_0x1bcafd[_0x77a6('0x48')],{})[_0x77a6('0x26')](function(_0x5b2a5a){var _0x4c2149=_0x1bcafd[_0x77a6('0x49')][_0x77a6('0x27')]({'plain':!![]});if(!_0x4c2149)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c2149[_0x77a6('0x4a')]===_0x77a6('0x49')){var _0x1f0ae0=_0x5b2a5a[_0x77a6('0x27')]({'plain':!![]});var _0x2150c4='Companies';return db[_0x77a6('0x4b')][_0x77a6('0x46')]({'where':{'name':_0x2150c4,'userProfileId':_0x4c2149['userProfileId']},'raw':!![]})[_0x77a6('0x26')](function(_0x340c63){if(_0x340c63&&_0x340c63['autoAssociation']===0x0){return db[_0x77a6('0x28')][_0x77a6('0x47')]({'name':_0x1f0ae0[_0x77a6('0x2a')],'resourceId':_0x1f0ae0['id'],'type':_0x340c63[_0x77a6('0x2a')],'sectionId':_0x340c63['id']},{})[_0x77a6('0x26')](function(){return _0x5b2a5a;});}else{return _0x5b2a5a;}})['catch'](function(_0x1b44db){logger[_0x77a6('0x4c')](_0x77a6('0x4d'),_0x1b44db);throw _0x1b44db;});}return _0x5b2a5a;})[_0x77a6('0x26')](respondWithResult(_0x558583,0xc9))[_0x77a6('0x41')](handleError(_0x558583,null));};exports[_0x77a6('0x24')]=function(_0x17a437,_0x5e9009){if(_0x17a437[_0x77a6('0x48')]['id']){delete _0x17a437[_0x77a6('0x48')]['id'];}return db[_0x77a6('0x3d')][_0x77a6('0x46')]({'where':{'id':_0x17a437[_0x77a6('0x43')]['id']}})[_0x77a6('0x26')](handleEntityNotFound(_0x5e9009,null))[_0x77a6('0x26')](saveUpdates(_0x17a437['body'],null))['then'](respondWithResult(_0x5e9009,null))[_0x77a6('0x41')](handleError(_0x5e9009,null));};exports[_0x77a6('0x25')]=function(_0x36b736,_0x43f791){return db[_0x77a6('0x3d')]['find']({'where':{'id':_0x36b736[_0x77a6('0x43')]['id']}})[_0x77a6('0x26')](handleEntityNotFound(_0x43f791,null))['then'](removeEntity(_0x43f791,null))[_0x77a6('0x41')](handleError(_0x43f791,null));};exports[_0x77a6('0x2d')]=function(_0x417091,_0x223dc5){return db[_0x77a6('0x3d')][_0x77a6('0x2d')]()['then'](respondWithResult(_0x223dc5,null))[_0x77a6('0x41')](handleError(_0x223dc5,null));};exports['addContacts']=function(_0x2e4a,_0x317c7f,_0x398003){return db['CmContact'][_0x77a6('0x46')]({'where':{'id':_0x2e4a[_0x77a6('0x43')]['id']}})[_0x77a6('0x26')](handleEntityNotFound(_0x317c7f,null))[_0x77a6('0x26')](function(_0xf1da7b){if(_0xf1da7b){return _0xf1da7b[_0x77a6('0x4e')](_0x2e4a[_0x77a6('0x48')]['ids'],_[_0x77a6('0x4f')](_0x2e4a[_0x77a6('0x48')],['ids','id'])||{});}})[_0x77a6('0x26')](respondWithResult(_0x317c7f,null))[_0x77a6('0x41')](handleError(_0x317c7f,null));};exports['getContacts']=function(_0x37c2bd,_0x546e70,_0x62f0d2){var _0x331eed={};var _0x30d3d1={};var _0x54fd7b;var _0xa9516;return db[_0x77a6('0x3d')]['findOne']({'where':{'id':_0x37c2bd[_0x77a6('0x43')]['id']}})[_0x77a6('0x26')](handleEntityNotFound(_0x546e70,null))[_0x77a6('0x26')](function(_0x571134){if(_0x571134){_0x54fd7b=_0x571134;_0x30d3d1[_0x77a6('0x2e')]=_[_0x77a6('0x2f')](db[_0x77a6('0x50')][_0x77a6('0x51')]);_0x30d3d1[_0x77a6('0x30')]=_[_0x77a6('0x2f')](_0x37c2bd[_0x77a6('0x30')]);_0x30d3d1[_0x77a6('0x38')]=_[_0x77a6('0x31')](_0x30d3d1[_0x77a6('0x2e')],_0x30d3d1['query']);_0x331eed[_0x77a6('0x32')]=_['intersection'](_0x30d3d1[_0x77a6('0x2e')],qs[_0x77a6('0x33')](_0x37c2bd['query'][_0x77a6('0x33')]));_0x331eed[_0x77a6('0x32')]=_0x331eed[_0x77a6('0x32')][_0x77a6('0x44')]?_0x331eed['attributes']:_0x30d3d1[_0x77a6('0x2e')];_0x331eed[_0x77a6('0x34')]=qs[_0x77a6('0x35')](_0x37c2bd[_0x77a6('0x30')][_0x77a6('0x35')]);_0x331eed['where']=qs['filters'](_['pick'](_0x37c2bd[_0x77a6('0x30')],_0x30d3d1[_0x77a6('0x38')]));if(_0x37c2bd['query'][_0x77a6('0x39')]){_0x331eed[_0x77a6('0x36')]=_['merge'](_0x331eed[_0x77a6('0x36')],{'$or':_[_0x77a6('0x3b')](_0x331eed['attributes'],function(_0x5c31a3){var _0x3f942c={};_0x3f942c[_0x5c31a3]={'$like':'%'+_0x37c2bd[_0x77a6('0x30')][_0x77a6('0x39')]+'%'};return _0x3f942c;})});}_0x331eed=_[_0x77a6('0x3a')]({},_0x331eed,_0x37c2bd[_0x77a6('0x3c')]);return _0x54fd7b[_0x77a6('0x52')](_0x331eed);}})['then'](function(_0x25feb8){if(_0x25feb8){_0xa9516=_0x25feb8['length'];if(!_0x37c2bd['query']['hasOwnProperty'](_0x77a6('0x53'))){_0x331eed[_0x77a6('0x20')]=qs['limit'](_0x37c2bd[_0x77a6('0x30')][_0x77a6('0x20')]);_0x331eed[_0x77a6('0x1f')]=qs[_0x77a6('0x1f')](_0x37c2bd[_0x77a6('0x30')][_0x77a6('0x1f')]);}return _0x54fd7b[_0x77a6('0x52')](_0x331eed);}})['then'](function(_0x14bcdb){if(_0x14bcdb){return _0x14bcdb?{'count':_0xa9516,'rows':_0x14bcdb}:null;}})[_0x77a6('0x26')](respondWithResult(_0x546e70,null))[_0x77a6('0x41')](handleError(_0x546e70,null));};
\ No newline at end of file
+var _0x5323=['Companies','UserProfileResource','error','name','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','CmContact','addContacts','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5323,0x1e8));var _0x3532=function(_0x4495f4,_0x1df31f){_0x4495f4=_0x4495f4-0x0;var _0xc2651c=_0x5323[_0x4495f4];return _0xc2651c;};'use strict';var emlformat=require(_0x3532('0x0'));var rimraf=require(_0x3532('0x1'));var zipdir=require(_0x3532('0x2'));var jsonpatch=require(_0x3532('0x3'));var rp=require(_0x3532('0x4'));var moment=require('moment');var BPromise=require(_0x3532('0x5'));var Mustache=require(_0x3532('0x6'));var util=require(_0x3532('0x7'));var path=require('path');var sox=require(_0x3532('0x8'));var csv=require(_0x3532('0x9'));var ejs=require(_0x3532('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3532('0xb'));var squel=require(_0x3532('0xc'));var crypto=require(_0x3532('0xd'));var jsforce=require(_0x3532('0xe'));var deskjs=require(_0x3532('0xf'));var toCsv=require(_0x3532('0x9'));var querystring=require('querystring');var Papa=require(_0x3532('0x10'));var Redis=require(_0x3532('0x11'));var authService=require(_0x3532('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3532('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3532('0x14'));var utils=require(_0x3532('0x15'));var config=require(_0x3532('0x16'));var licenseUtil=require(_0x3532('0x17'));var db=require(_0x3532('0x18'))['db'];function respondWithStatusCode(_0x379f29,_0x212786){_0x212786=_0x212786||0xcc;return function(_0x4a56c2){if(_0x4a56c2){return _0x379f29[_0x3532('0x19')](_0x212786);}return _0x379f29[_0x3532('0x1a')](_0x212786)[_0x3532('0x1b')]();};}function respondWithResult(_0x80089b,_0x465846){_0x465846=_0x465846||0xc8;return function(_0x706a49){if(_0x706a49){return _0x80089b['status'](_0x465846)[_0x3532('0x1c')](_0x706a49);}};}function respondWithFilteredResult(_0x4e3ffd,_0x3d619b){return function(_0x580693){if(_0x580693){var _0x19ed61=typeof _0x3d619b[_0x3532('0x1d')]==='undefined'&&typeof _0x3d619b[_0x3532('0x1e')]===_0x3532('0x1f');var _0x48eb5d=_0x580693[_0x3532('0x20')];var _0x19b3c5=_0x19ed61?0x0:_0x3d619b[_0x3532('0x1d')];var _0x3be0ec=_0x19ed61?_0x580693['count']:_0x3d619b[_0x3532('0x1d')]+_0x3d619b[_0x3532('0x1e')];var _0x1e961c;if(_0x3be0ec>=_0x48eb5d){_0x3be0ec=_0x48eb5d;_0x1e961c=0xc8;}else{_0x1e961c=0xce;}_0x4e3ffd[_0x3532('0x1a')](_0x1e961c);return _0x4e3ffd[_0x3532('0x21')](_0x3532('0x22'),_0x19b3c5+'-'+_0x3be0ec+'/'+_0x48eb5d)[_0x3532('0x1c')](_0x580693);}return null;};}function patchUpdates(_0x5eea7e){return function(_0x56f35f){try{jsonpatch['apply'](_0x56f35f,_0x5eea7e,!![]);}catch(_0x5ca2ca){return BPromise[_0x3532('0x23')](_0x5ca2ca);}return _0x56f35f[_0x3532('0x24')]();};}function saveUpdates(_0x82cde4,_0x450a32){return function(_0x2b1e03){if(_0x2b1e03){return _0x2b1e03[_0x3532('0x25')](_0x82cde4)['then'](function(_0x54be45){return _0x54be45;});}return null;};}function removeEntity(_0x1836a7,_0x5e97b8){return function(_0xbe99eb){if(_0xbe99eb){return _0xbe99eb[_0x3532('0x26')]()[_0x3532('0x27')](function(){var _0x3751d8=_0xbe99eb['get']({'plain':!![]});var _0x146c4d=_0x3532('0x28');return db[_0x3532('0x29')]['destroy']({'where':{'type':_0x146c4d,'resourceId':_0x3751d8['id']}})[_0x3532('0x27')](function(){return _0xbe99eb;});})[_0x3532('0x27')](function(){_0x1836a7['status'](0xcc)[_0x3532('0x1b')]();});}};}function handleEntityNotFound(_0x206cd6,_0x3cacae){return function(_0x47fe58){if(!_0x47fe58){_0x206cd6[_0x3532('0x19')](0x194);}return _0x47fe58;};}function handleError(_0x28dc84,_0x23d003){_0x23d003=_0x23d003||0x1f4;return function(_0x2c38b7){logger[_0x3532('0x2a')](_0x2c38b7['stack']);if(_0x2c38b7[_0x3532('0x2b')]){delete _0x2c38b7[_0x3532('0x2b')];}_0x28dc84[_0x3532('0x1a')](_0x23d003)['send'](_0x2c38b7);};}exports['index']=function(_0x495a03,_0x56d634){var _0x5260c5={},_0x144ad9={},_0x409fd3={'count':0x0,'rows':[]};return db[_0x3532('0x2c')]['describe']()[_0x3532('0x27')](function(_0x5b6f19){_0x144ad9[_0x3532('0x2d')]=_[_0x3532('0x2e')](_0x5b6f19);_0x144ad9[_0x3532('0x2f')]=_[_0x3532('0x2e')](_0x495a03[_0x3532('0x2f')]);_0x144ad9[_0x3532('0x30')]=_[_0x3532('0x31')](_0x144ad9[_0x3532('0x2d')],_0x144ad9[_0x3532('0x2f')]);_0x5260c5[_0x3532('0x32')]=_[_0x3532('0x31')](_0x144ad9[_0x3532('0x2d')],qs[_0x3532('0x33')](_0x495a03[_0x3532('0x2f')][_0x3532('0x33')]));_0x5260c5[_0x3532('0x32')]=_0x5260c5[_0x3532('0x32')][_0x3532('0x34')]?_0x5260c5['attributes']:_0x144ad9[_0x3532('0x2d')];if(!_0x495a03[_0x3532('0x2f')]['hasOwnProperty'](_0x3532('0x35'))){_0x5260c5[_0x3532('0x1e')]=qs[_0x3532('0x1e')](_0x495a03[_0x3532('0x2f')][_0x3532('0x1e')]);_0x5260c5[_0x3532('0x1d')]=qs[_0x3532('0x1d')](_0x495a03[_0x3532('0x2f')][_0x3532('0x1d')]);}_0x5260c5[_0x3532('0x36')]=qs[_0x3532('0x37')](_0x495a03[_0x3532('0x2f')]['sort']);_0x5260c5[_0x3532('0x38')]=qs[_0x3532('0x30')](_[_0x3532('0x39')](_0x495a03[_0x3532('0x2f')],_0x144ad9[_0x3532('0x30')]),_0x5b6f19);if(_0x495a03[_0x3532('0x2f')][_0x3532('0x3a')]){_0x5260c5[_0x3532('0x38')]=_['merge'](_0x5260c5['where'],{'$or':_[_0x3532('0x3b')](_0x5260c5[_0x3532('0x32')],function(_0x4de40d){var _0x3dbcbc={};_0x3dbcbc[_0x4de40d]={'$like':'%'+_0x495a03['query'][_0x3532('0x3a')]+'%'};return _0x3dbcbc;})});}_0x5260c5=_[_0x3532('0x3c')]({},_0x5260c5,_0x495a03[_0x3532('0x3d')]);var _0x476f54={'where':_0x5260c5[_0x3532('0x38')]};return db[_0x3532('0x2c')]['count'](_0x476f54)[_0x3532('0x27')](function(_0x149201){_0x409fd3[_0x3532('0x20')]=_0x149201;if(_0x495a03[_0x3532('0x2f')][_0x3532('0x3e')]){_0x5260c5[_0x3532('0x3f')]=[{'all':!![]}];}return db[_0x3532('0x2c')][_0x3532('0x40')](_0x5260c5);})[_0x3532('0x27')](function(_0x443a61){_0x409fd3[_0x3532('0x41')]=_0x443a61;return _0x409fd3;})['then'](respondWithFilteredResult(_0x56d634,_0x5260c5))[_0x3532('0x42')](handleError(_0x56d634,null));})[_0x3532('0x42')](handleError(_0x56d634,null));};exports[_0x3532('0x43')]=function(_0x221e7f,_0x1c98b7){var _0x2acf54={'raw':![],'where':{'id':_0x221e7f['params']['id']}},_0x3c7e19={};_0x3c7e19[_0x3532('0x2d')]=_['keys'](db[_0x3532('0x2c')][_0x3532('0x44')]);_0x3c7e19[_0x3532('0x2f')]=_[_0x3532('0x2e')](_0x221e7f[_0x3532('0x2f')]);_0x3c7e19[_0x3532('0x30')]=_['intersection'](_0x3c7e19[_0x3532('0x2d')],_0x3c7e19['query']);_0x2acf54[_0x3532('0x32')]=_[_0x3532('0x31')](_0x3c7e19[_0x3532('0x2d')],qs[_0x3532('0x33')](_0x221e7f[_0x3532('0x2f')][_0x3532('0x33')]));_0x2acf54[_0x3532('0x32')]=_0x2acf54[_0x3532('0x32')][_0x3532('0x34')]?_0x2acf54['attributes']:_0x3c7e19[_0x3532('0x2d')];if(_0x221e7f['query']['includeAll']){_0x2acf54[_0x3532('0x3f')]=[{'all':!![]}];}_0x2acf54=_['merge']({},_0x2acf54,_0x221e7f[_0x3532('0x3d')]);return db['CmCompany'][_0x3532('0x45')](_0x2acf54)['then'](handleEntityNotFound(_0x1c98b7,null))[_0x3532('0x27')](respondWithResult(_0x1c98b7,null))[_0x3532('0x42')](handleError(_0x1c98b7,null));};exports[_0x3532('0x46')]=function(_0x70a162,_0x1f12e0){return db['CmCompany'][_0x3532('0x46')](_0x70a162[_0x3532('0x47')],{})[_0x3532('0x27')](function(_0x5883e6){var _0x200588=_0x70a162[_0x3532('0x48')][_0x3532('0x49')]({'plain':!![]});if(!_0x200588)throw new Error(_0x3532('0x4a'));if(_0x200588[_0x3532('0x4b')]==='user'){var _0x5a3605=_0x5883e6[_0x3532('0x49')]({'plain':!![]});var _0x493e6c=_0x3532('0x28');return db[_0x3532('0x4c')][_0x3532('0x45')]({'where':{'name':_0x493e6c,'userProfileId':_0x200588[_0x3532('0x4d')]},'raw':!![]})[_0x3532('0x27')](function(_0xd347ad){if(_0xd347ad&&_0xd347ad[_0x3532('0x4e')]===0x0){return db[_0x3532('0x29')][_0x3532('0x46')]({'name':_0x5a3605[_0x3532('0x2b')],'resourceId':_0x5a3605['id'],'type':_0xd347ad[_0x3532('0x2b')],'sectionId':_0xd347ad['id']},{})[_0x3532('0x27')](function(){return _0x5883e6;});}else{return _0x5883e6;}})['catch'](function(_0x253a40){logger['error'](_0x3532('0x4f'),_0x253a40);throw _0x253a40;});}return _0x5883e6;})[_0x3532('0x27')](respondWithResult(_0x1f12e0,0xc9))[_0x3532('0x42')](handleError(_0x1f12e0,null));};exports['update']=function(_0x550585,_0x19b9af){if(_0x550585[_0x3532('0x47')]['id']){delete _0x550585['body']['id'];}return db[_0x3532('0x2c')][_0x3532('0x45')]({'where':{'id':_0x550585[_0x3532('0x50')]['id']}})['then'](handleEntityNotFound(_0x19b9af,null))[_0x3532('0x27')](saveUpdates(_0x550585[_0x3532('0x47')],null))['then'](respondWithResult(_0x19b9af,null))[_0x3532('0x42')](handleError(_0x19b9af,null));};exports['destroy']=function(_0x6c93a1,_0x593938){return db[_0x3532('0x2c')][_0x3532('0x45')]({'where':{'id':_0x6c93a1[_0x3532('0x50')]['id']}})[_0x3532('0x27')](handleEntityNotFound(_0x593938,null))['then'](removeEntity(_0x593938,null))[_0x3532('0x42')](handleError(_0x593938,null));};exports['describe']=function(_0x1282bb,_0x44b6a7){return db[_0x3532('0x2c')][_0x3532('0x51')]()[_0x3532('0x27')](respondWithResult(_0x44b6a7,null))['catch'](handleError(_0x44b6a7,null));};exports['addContacts']=function(_0x15e7fb,_0x100d84,_0x1a7cec){return db[_0x3532('0x52')][_0x3532('0x45')]({'where':{'id':_0x15e7fb[_0x3532('0x50')]['id']}})['then'](handleEntityNotFound(_0x100d84,null))['then'](function(_0x5bce3d){if(_0x5bce3d){return _0x5bce3d[_0x3532('0x53')](_0x15e7fb[_0x3532('0x47')][_0x3532('0x54')],_[_0x3532('0x55')](_0x15e7fb[_0x3532('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x100d84,null))[_0x3532('0x42')](handleError(_0x100d84,null));};exports[_0x3532('0x56')]=function(_0x380a30,_0x480359,_0x197b20){var _0x23674b={};var _0x11d3da={};var _0x1fab4f;var _0x5b288b;return db[_0x3532('0x2c')]['findOne']({'where':{'id':_0x380a30[_0x3532('0x50')]['id']}})[_0x3532('0x27')](handleEntityNotFound(_0x480359,null))[_0x3532('0x27')](function(_0x2120b0){if(_0x2120b0){_0x1fab4f=_0x2120b0;_0x11d3da[_0x3532('0x2d')]=_[_0x3532('0x2e')](db['CmContact'][_0x3532('0x44')]);_0x11d3da['query']=_[_0x3532('0x2e')](_0x380a30[_0x3532('0x2f')]);_0x11d3da[_0x3532('0x30')]=_[_0x3532('0x31')](_0x11d3da['model'],_0x11d3da[_0x3532('0x2f')]);_0x23674b[_0x3532('0x32')]=_[_0x3532('0x31')](_0x11d3da[_0x3532('0x2d')],qs[_0x3532('0x33')](_0x380a30[_0x3532('0x2f')]['fields']));_0x23674b[_0x3532('0x32')]=_0x23674b[_0x3532('0x32')][_0x3532('0x34')]?_0x23674b[_0x3532('0x32')]:_0x11d3da['model'];_0x23674b[_0x3532('0x36')]=qs[_0x3532('0x37')](_0x380a30['query'][_0x3532('0x37')]);_0x23674b[_0x3532('0x38')]=qs[_0x3532('0x30')](_[_0x3532('0x39')](_0x380a30[_0x3532('0x2f')],_0x11d3da[_0x3532('0x30')]));if(_0x380a30['query'][_0x3532('0x3a')]){_0x23674b['where']=_['merge'](_0x23674b[_0x3532('0x38')],{'$or':_[_0x3532('0x3b')](_0x23674b[_0x3532('0x32')],function(_0x6d4e7){var _0x52a89a={};_0x52a89a[_0x6d4e7]={'$like':'%'+_0x380a30[_0x3532('0x2f')][_0x3532('0x3a')]+'%'};return _0x52a89a;})});}_0x23674b=_['merge']({},_0x23674b,_0x380a30['options']);return _0x1fab4f[_0x3532('0x56')](_0x23674b);}})[_0x3532('0x27')](function(_0x1e406e){if(_0x1e406e){_0x5b288b=_0x1e406e[_0x3532('0x34')];if(!_0x380a30['query'][_0x3532('0x57')](_0x3532('0x35'))){_0x23674b['limit']=qs['limit'](_0x380a30[_0x3532('0x2f')]['limit']);_0x23674b[_0x3532('0x1d')]=qs[_0x3532('0x1d')](_0x380a30['query'][_0x3532('0x1d')]);}return _0x1fab4f[_0x3532('0x56')](_0x23674b);}})[_0x3532('0x27')](function(_0x3dd9d7){if(_0x3dd9d7){return _0x3dd9d7?{'count':_0x5b288b,'rows':_0x3dd9d7}:null;}})['then'](respondWithResult(_0x480359,null))['catch'](handleError(_0x480359,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a08de6e..77b2709 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 _0x78c2=['rimraf','./cmCompany.attributes','exports','define','cm_companies','lodash','util','moment','bluebird'];(function(_0xa82c60,_0x3f05bf){var _0x291fef=function(_0x31feda){while(--_0x31feda){_0xa82c60['push'](_0xa82c60['shift']());}};_0x291fef(++_0x3f05bf);}(_0x78c2,0xcb));var _0x278c=function(_0x30fcdb,_0x553637){_0x30fcdb=_0x30fcdb-0x0;var _0x4ccd2e=_0x78c2[_0x30fcdb];return _0x4ccd2e;};'use strict';var _=require(_0x278c('0x0'));var util=require(_0x278c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x278c('0x2'));var BPromise=require(_0x278c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x278c('0x4'));var config=require('../../config/environment');var attributes=require(_0x278c('0x5'));module[_0x278c('0x6')]=function(_0x22e738,_0x1d0262){return _0x22e738[_0x278c('0x7')]('CmCompany',attributes,{'tableName':_0x278c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xadcd=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xadcd,0x141));var _0xdadc=function(_0x17e3d6,_0x40ec46){_0x17e3d6=_0x17e3d6-0x0;var _0x987bbe=_0xadcd[_0x17e3d6];return _0x987bbe;};'use strict';var _=require(_0xdadc('0x0'));var util=require(_0xdadc('0x1'));var logger=require('../../config/logger')(_0xdadc('0x2'));var moment=require(_0xdadc('0x3'));var BPromise=require('bluebird');var rp=require(_0xdadc('0x4'));var fs=require('fs');var path=require(_0xdadc('0x5'));var rimraf=require(_0xdadc('0x6'));var config=require(_0xdadc('0x7'));var attributes=require(_0xdadc('0x8'));module[_0xdadc('0x9')]=function(_0x516874,_0x17614c){return _0x516874[_0xdadc('0xa')](_0xdadc('0xb'),attributes,{'tableName':_0xdadc('0xc'),'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 245b922..8d416e0 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 _0x5d52=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','bluebird'];(function(_0x3f8561,_0x294bd2){var _0x529730=function(_0x33baaa){while(--_0x33baaa){_0x3f8561['push'](_0x3f8561['shift']());}};_0x529730(++_0x294bd2);}(_0x5d52,0x1cd));var _0x25d5=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x5d52[_0x53afa6];return _0x51f86a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x25d5('0x0'));var rs=require(_0x25d5('0x1'));var fs=require('fs');var Redis=require(_0x25d5('0x2'));var db=require(_0x25d5('0x3'))['db'];var utils=require(_0x25d5('0x4'));var logger=require(_0x25d5('0x5'))(_0x25d5('0x6'));var config=require(_0x25d5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x25d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dca8c,_0x1793c,_0x584c96){return new BPromise(function(_0x170899,_0xb88ec6){return client[_0x25d5('0x9')](_0x2dca8c,_0x584c96)[_0x25d5('0xa')](function(_0x227516){logger['info'](_0x25d5('0xb'),_0x1793c,_0x25d5('0xc'));logger[_0x25d5('0xd')](_0x25d5('0xe'),_0x1793c,_0x25d5('0xc'),JSON[_0x25d5('0xf')](_0x227516));if(_0x227516[_0x25d5('0x10')]){if(_0x227516[_0x25d5('0x10')][_0x25d5('0x11')]===0x1f4){logger[_0x25d5('0x10')](_0x25d5('0xb'),_0x1793c,_0x227516['error'][_0x25d5('0x12')]);return _0xb88ec6(_0x227516[_0x25d5('0x10')][_0x25d5('0x12')]);}logger[_0x25d5('0x10')](_0x25d5('0xb'),_0x1793c,_0x227516[_0x25d5('0x10')][_0x25d5('0x12')]);return _0x170899(_0x227516[_0x25d5('0x10')][_0x25d5('0x12')]);}else{logger[_0x25d5('0x13')]('CmCompany,\x20%s,\x20%s',_0x1793c,_0x25d5('0xc'));_0x170899(_0x227516[_0x25d5('0x14')]['message']);}})[_0x25d5('0x15')](function(_0x21119e){logger['error'](_0x25d5('0xb'),_0x1793c,_0x21119e);_0xb88ec6(_0x21119e);});});}
\ No newline at end of file
+var _0x2b01=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','CmCompany,\x20%s,\x20%s','result','catch','util','moment','bluebird'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0x2b01,0xed));var _0x12b0=function(_0xff4115,_0x4ee874){_0xff4115=_0xff4115-0x0;var _0x271f95=_0x2b01[_0xff4115];return _0x271f95;};'use strict';var _=require('lodash');var util=require(_0x12b0('0x0'));var moment=require(_0x12b0('0x1'));var BPromise=require(_0x12b0('0x2'));var rs=require(_0x12b0('0x3'));var fs=require('fs');var Redis=require(_0x12b0('0x4'));var db=require(_0x12b0('0x5'))['db'];var utils=require(_0x12b0('0x6'));var logger=require('../../config/logger')(_0x12b0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x128afc,_0x54ea84,_0x1b29da){return new BPromise(function(_0x449c6c,_0x491a3d){return client[_0x12b0('0x8')](_0x128afc,_0x1b29da)[_0x12b0('0x9')](function(_0x5b9d06){logger[_0x12b0('0xa')]('CmCompany,\x20%s,\x20%s',_0x54ea84,_0x12b0('0xb'));logger[_0x12b0('0xc')](_0x12b0('0xd'),_0x54ea84,'request\x20sent',JSON[_0x12b0('0xe')](_0x5b9d06));if(_0x5b9d06['error']){if(_0x5b9d06[_0x12b0('0xf')]['code']===0x1f4){logger[_0x12b0('0xf')]('CmCompany,\x20%s,\x20%s',_0x54ea84,_0x5b9d06[_0x12b0('0xf')][_0x12b0('0x10')]);return _0x491a3d(_0x5b9d06[_0x12b0('0xf')][_0x12b0('0x10')]);}logger['error'](_0x12b0('0x11'),_0x54ea84,_0x5b9d06[_0x12b0('0xf')][_0x12b0('0x10')]);return _0x449c6c(_0x5b9d06['error']['message']);}else{logger[_0x12b0('0xa')](_0x12b0('0x11'),_0x54ea84,_0x12b0('0xb'));_0x449c6c(_0x5b9d06[_0x12b0('0x12')][_0x12b0('0x10')]);}})[_0x12b0('0x13')](function(_0x3ae4cd){logger['error'](_0x12b0('0x11'),_0x54ea84,_0x3ae4cd);_0x491a3d(_0x3ae4cd);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d4abe56..48ad87b 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 _0x4f27=['/:id','/:id/contacts','getContacts','post','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x4f27,0x8c));var _0x74f2=function(_0x198a95,_0x3f0ffe){_0x198a95=_0x198a95-0x0;var _0x557884=_0x4f27[_0x198a95];return _0x557884;};'use strict';var multer=require(_0x74f2('0x0'));var util=require('util');var path=require(_0x74f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x74f2('0x2'));var router=express[_0x74f2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x74f2('0x4'));var interaction=require(_0x74f2('0x5'));var config=require(_0x74f2('0x6'));var controller=require(_0x74f2('0x7'));router[_0x74f2('0x8')]('/',auth['isAuthenticated'](),controller[_0x74f2('0x9')]);router[_0x74f2('0x8')](_0x74f2('0xa'),auth[_0x74f2('0xb')](),controller['describe']);router[_0x74f2('0x8')](_0x74f2('0xc'),auth[_0x74f2('0xb')](),controller['show']);router[_0x74f2('0x8')](_0x74f2('0xd'),auth[_0x74f2('0xb')](),controller[_0x74f2('0xe')]);router[_0x74f2('0xf')]('/',auth[_0x74f2('0xb')](),controller['create']);router[_0x74f2('0xf')](_0x74f2('0xd'),auth[_0x74f2('0xb')](),controller['addContacts']);router['put'](_0x74f2('0xc'),auth[_0x74f2('0xb')](),controller['update']);router[_0x74f2('0x10')](_0x74f2('0xc'),auth[_0x74f2('0xb')](),controller[_0x74f2('0x11')]);module[_0x74f2('0x12')]=router;
\ No newline at end of file
+var _0x39ff=['../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe','show','/:id/contacts','getContacts','create','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x55febe,_0x459f86){var _0x35e354=function(_0x5c90b6){while(--_0x5c90b6){_0x55febe['push'](_0x55febe['shift']());}};_0x35e354(++_0x459f86);}(_0x39ff,0xd5));var _0xf39f=function(_0x24d2fc,_0x29f500){_0x24d2fc=_0x24d2fc-0x0;var _0x3cd97f=_0x39ff[_0x24d2fc];return _0x3cd97f;};'use strict';var multer=require(_0xf39f('0x0'));var util=require(_0xf39f('0x1'));var path=require(_0xf39f('0x2'));var timeout=require(_0xf39f('0x3'));var express=require(_0xf39f('0x4'));var router=express[_0xf39f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf39f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf39f('0x7'));var controller=require(_0xf39f('0x8'));router['get']('/',auth[_0xf39f('0x9')](),controller['index']);router[_0xf39f('0xa')](_0xf39f('0xb'),auth[_0xf39f('0x9')](),controller['describe']);router[_0xf39f('0xa')]('/:id',auth[_0xf39f('0x9')](),controller[_0xf39f('0xc')]);router[_0xf39f('0xa')](_0xf39f('0xd'),auth[_0xf39f('0x9')](),controller[_0xf39f('0xe')]);router['post']('/',auth[_0xf39f('0x9')](),controller[_0xf39f('0xf')]);router[_0xf39f('0x10')](_0xf39f('0xd'),auth[_0xf39f('0x9')](),controller['addContacts']);router['put'](_0xf39f('0x11'),auth[_0xf39f('0x9')](),controller[_0xf39f('0x12')]);router[_0xf39f('0x13')](_0xf39f('0x11'),auth[_0xf39f('0x9')](),controller[_0xf39f('0x14')]);module[_0xf39f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 9dd108a..c630206 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 _0xa8d2=['STRING','TEXT','INTEGER','DATE','lodash','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8d2,0xa0));var _0x2a8d=function(_0xae25f6,_0x2d930b){_0xae25f6=_0xae25f6-0x0;var _0x3d820f=_0xa8d2[_0xae25f6];return _0x3d820f;};'use strict';var _=require(_0x2a8d('0x0'));var Sequelize=require('sequelize');module[_0x2a8d('0x1')]={'firstName':{'type':Sequelize[_0x2a8d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2a8d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2a8d('0x2')]},'country':{'type':Sequelize[_0x2a8d('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2a8d('0x3')]},'phone':{'type':Sequelize[_0x2a8d('0x2')]},'mobile':{'type':Sequelize[_0x2a8d('0x2')]},'fax':{'type':Sequelize[_0x2a8d('0x2')]},'email':{'type':Sequelize[_0x2a8d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x2a8d('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x2a8d('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x2a8d('0x2')]},'wechat':{'type':Sequelize[_0x2a8d('0x2')]},'telegram':{'type':Sequelize[_0x2a8d('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x2a8d('0x2')]},'priority':{'type':Sequelize[_0x2a8d('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2a8d('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x2a8d('0x2')]},'utcOffset':{'type':Sequelize[_0x2a8d('0x4')]}};
\ No newline at end of file
+var _0x2193=['INTEGER','UNSIGNED','DATE','NOW','sequelize','STRING'];(function(_0x5cafe1,_0x3ab7cb){var _0x3acc70=function(_0x60081f){while(--_0x60081f){_0x5cafe1['push'](_0x5cafe1['shift']());}};_0x3acc70(++_0x3ab7cb);}(_0x2193,0x1f0));var _0x3219=function(_0x4d75af,_0x39c35a){_0x4d75af=_0x4d75af-0x0;var _0x2abbea=_0x2193[_0x4d75af];return _0x2abbea;};'use strict';var _=require('lodash');var Sequelize=require(_0x3219('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x3219('0x1')]},'street':{'type':Sequelize[_0x3219('0x1')]},'postalCode':{'type':Sequelize[_0x3219('0x1')]},'city':{'type':Sequelize[_0x3219('0x1')]},'country':{'type':Sequelize[_0x3219('0x1')]},'dateOfBirth':{'type':Sequelize[_0x3219('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3219('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3219('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x3219('0x1')]},'fb_data':{'type':Sequelize[_0x3219('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x3219('0x1')]},'viber':{'type':Sequelize[_0x3219('0x1')]},'line':{'type':Sequelize[_0x3219('0x1')]},'wechat':{'type':Sequelize[_0x3219('0x1')]},'telegram':{'type':Sequelize[_0x3219('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3219('0x2')](0x2)[_0x3219('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3219('0x4')],'defaultValue':Sequelize[_0x3219('0x5')]},'dialTimezone':{'type':Sequelize[_0x3219('0x1')]},'utcOffset':{'type':Sequelize[_0x3219('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index c8190cd..3288a99 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 _0x4efc=['source','callerid','starttime','endtime','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','alias','startCase','Account','closed','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','Interaction','findAndCountAll','flatten','sortBy','reverse','value','moment','bluebird','util','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','describe','getOptions','findAll','query','user','CmContact','find','catch','tags','keys','cf_','columnName','displayName','analytics','CmCustomField','custom','values','info','forEach','hasOwnProperty','merge','body','from','length','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','spread','all','params','Tag','Tags','color','tag','CmContactHasItem','Phones','ItemType','sequelize','literal','Phones.OrderBy','omit','map','format','cf_%d','timezones','$and','pickBy','startsWith','isEmpty','table','cm_contacts','setFields','toParam','text','phone','getTags','rawAttributes','filters','intersection','model','attributes','fields','order','sort','pick','filter','options','nolimit','setTags','findOne','ids','setAdditionalPhones','items','item_types','description','OrderBy','ItemTypeId','contact\x20phone\x20exists','PHONE','item','ContactItemType','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','include','getHopperHistories','CmHopperHistory','includeAll','rows','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','socket_timestamp','binding_values','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','file','parse','User','agent','binding','child_process','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','chat','sms','whatsapp','-createdAt','resolve','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','type'];(function(_0x4c817a,_0x5b67b1){var _0x20ac98=function(_0x4fc8e3){while(--_0x4fc8e3){_0x4c817a['push'](_0x4c817a['shift']());}};_0x20ac98(++_0x5b67b1);}(_0x4efc,0x125));var _0xc4ef=function(_0x261a4a,_0x41ec2e){_0x261a4a=_0x261a4a-0x0;var _0x33da9d=_0x4efc[_0x261a4a];return _0x33da9d;};'use strict';var moment=require(_0xc4ef('0x0'));var BPromise=require(_0xc4ef('0x1'));var util=require(_0xc4ef('0x2'));var path=require(_0xc4ef('0x3'));var fs=require('fs');var _=require(_0xc4ef('0x4'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xc4ef('0x5'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0xc4ef('0x6'))(_0xc4ef('0x7'));var config=require(_0xc4ef('0x8'));var shared=require(_0xc4ef('0x9'));var db=require(_0xc4ef('0xa'))['db'];config[_0xc4ef('0xb')]=_[_0xc4ef('0xc')](config['redis'],{'host':_0xc4ef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4ef('0xb')]));require(_0xc4ef('0xe'))[_0xc4ef('0xf')](socket);function respondWithResult(_0x37ae73,_0x8c3349){_0x8c3349=_0x8c3349||0xc8;return function(_0x445cb7){if(_0x445cb7){return _0x37ae73[_0xc4ef('0x10')](_0x8c3349)[_0xc4ef('0x11')](_0x445cb7);}};}function respondWithFilteredResult(_0x17f3c5,_0x1bb71d){return function(_0xf41b43){if(_0xf41b43){var _0x215aa8=typeof _0x1bb71d[_0xc4ef('0x12')]===_0xc4ef('0x13')&&typeof _0x1bb71d['limit']===_0xc4ef('0x13');var _0x4f67f7=_0xf41b43[_0xc4ef('0x14')];var _0x5a0c5f=_0x215aa8?0x0:_0x1bb71d[_0xc4ef('0x12')];var _0x50b6f=_0x215aa8?_0xf41b43[_0xc4ef('0x14')]:_0x1bb71d[_0xc4ef('0x12')]+_0x1bb71d[_0xc4ef('0x15')];var _0x3bd9aa;if(_0x50b6f>=_0x4f67f7){_0x50b6f=_0x4f67f7;_0x3bd9aa=0xc8;}else{_0x3bd9aa=0xce;}_0x17f3c5[_0xc4ef('0x10')](_0x3bd9aa);return _0x17f3c5[_0xc4ef('0x16')](_0xc4ef('0x17'),_0x5a0c5f+'-'+_0x50b6f+'/'+_0x4f67f7)[_0xc4ef('0x11')](_0xf41b43);}return null;};}function saveUpdates(_0x332cea){return function(_0x479dca){if(_0x479dca){return _0x479dca[_0xc4ef('0x18')](_0x332cea)[_0xc4ef('0x19')](function(_0x18b042){return _0x18b042;});}return null;};}function removeEntity(_0x3f8c23){return function(_0x17cd5c){if(_0x17cd5c){return _0x17cd5c[_0xc4ef('0x1a')]()[_0xc4ef('0x19')](function(){_0x3f8c23[_0xc4ef('0x10')](0xcc)[_0xc4ef('0x1b')]();});}};}function handleEntityNotFound(_0x301954){return function(_0x4cc66e){if(!_0x4cc66e){_0x301954[_0xc4ef('0x1c')](0x194);}return _0x4cc66e;};}function handleError(_0x3b03a7,_0x309831){_0x309831=_0x309831||0x1f4;return function(_0xe62609){logger[_0xc4ef('0x1d')](_0xe62609[_0xc4ef('0x1e')]);if(_0xe62609[_0xc4ef('0x1f')]){delete _0xe62609['name'];}_0x3b03a7[_0xc4ef('0x10')](_0x309831)['send'](_0xe62609);};}exports[_0xc4ef('0x20')]=function(_0xcd39a9,_0xc7ee11){var _0x2447fe={};return contacts[_0xc4ef('0x21')]()[_0xc4ef('0x19')](function(_0x4ce73e){_0x2447fe=qs[_0xc4ef('0x22')](_0x4ce73e,_0xcd39a9);return contacts[_0xc4ef('0x23')](_0xcd39a9[_0xc4ef('0x24')],_0xcd39a9[_0xc4ef('0x25')],_0x2447fe,_0x4ce73e);})[_0xc4ef('0x19')](respondWithFilteredResult(_0xc7ee11,_0x2447fe))['catch'](handleError(_0xc7ee11,null));};exports[_0xc4ef('0x1a')]=function(_0x2e6de,_0x45d71d){return db[_0xc4ef('0x26')][_0xc4ef('0x27')]({'where':{'id':_0x2e6de['params']['id']}})[_0xc4ef('0x19')](handleEntityNotFound(_0x45d71d,null))[_0xc4ef('0x19')](removeEntity(_0x45d71d,null))[_0xc4ef('0x28')](handleError(_0x45d71d,null));};exports['describe']=function(_0x4f1ff1,_0x2f514b){return db[_0xc4ef('0x26')][_0xc4ef('0x21')]()[_0xc4ef('0x19')](function(_0x5d4c6b){delete _0x5d4c6b[_0xc4ef('0x29')];for(var _0x46c9dd=0x0;_0x46c9dd
','Attachments','Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','lodash','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','split','slice','join','Anonymous','length','pop'];(function(_0x4f9a63,_0x25bf8e){var _0x4b6bac=function(_0x40522d){while(--_0x40522d){_0x4f9a63['push'](_0x4f9a63['shift']());}};_0x4b6bac(++_0x25bf8e);}(_0x122d,0x10b));var _0xd122=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0x122d[_0x279368];return _0x40b6d0;};'use strict';var _=require(_0xd122('0x0'));var moment=require('moment');var random=require(_0xd122('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xd122('0x2'));var tnef=require(_0xd122('0x3'));var logger=require(_0xd122('0x4'))(_0xd122('0x5'));var config=require(_0xd122('0x6'));function getAddress(_0x3f1888){var _0x5a8c0e=_[_0xd122('0x7')](_0x3f1888[_0xd122('0x8')]);return _0x5a8c0e&&_0x5a8c0e[_0xd122('0x9')]?_0x5a8c0e[_0xd122('0x9')]:_0xd122('0xa')+random[_0xd122('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x18aa51){var _0x31771a=_[_0xd122('0x7')](_0x18aa51[_0xd122('0x8')]);if(_0x31771a&&_0x31771a[_0xd122('0xc')]){if(_0x31771a['name']==_0x31771a[_0xd122('0x9')]){return _0x31771a[_0xd122('0xc')][_0xd122('0xd')](0x0,_0x31771a[_0xd122('0xc')][_0xd122('0xe')]('@'));}var _0x25ee5e=_0x31771a[_0xd122('0xc')][_0xd122('0xf')](/\s+/);return _0x25ee5e['length']>0x1?_0x25ee5e[_0xd122('0x10')](0x0,-0x1)[_0xd122('0x11')]('\x20'):_0x31771a[_0xd122('0xc')];}return _0xd122('0x12');}function getLastName(_0x72b6c9){var _0x2d343b=_[_0xd122('0x7')](_0x72b6c9[_0xd122('0x8')]);if(_0x2d343b&&_0x2d343b['name']){var _0x16cd1f=_0x2d343b['name'][_0xd122('0xf')](/\s+/);return _0x16cd1f[_0xd122('0x13')]>0x1?_0x16cd1f[_0xd122('0x14')]():'';}return'';}function getMails(_0x2db331,_0x50293d){var _0x4640a9='';for(var _0x561320=0x0;_0x561320<_0x50293d[_0xd122('0x8')][_0xd122('0x13')];_0x561320+=0x1){if(_0x50293d['value'][_0x561320][_0xd122('0x9')]!==_0x2db331){if(!_['isEmpty'](_0x4640a9)){_0x4640a9+=',';}_0x4640a9+=_0x50293d[_0xd122('0x8')][_0x561320][_0xd122('0xc')]||_0x50293d[_0xd122('0x8')][_0x561320]['address']||'';_0x4640a9+='\x20<';_0x4640a9+=_0x50293d[_0xd122('0x8')][_0x561320][_0xd122('0x9')]?_0x50293d['value'][_0x561320][_0xd122('0x9')]:_0xd122('0xa')+random[_0xd122('0xb')](0x6)+_0xd122('0x15');_0x4640a9+='>';}}return _0x4640a9;}function parseEmail(_0x5f1891,_0x5b4cec,_0x300dc1){if(_0x5b4cec[_0xd122('0x16')]){var _0x1cd958=/